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 23b78dc988d9e5cf9e846510b0525166222b184c Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 29 Apr 2009 12:48:07 +0200 Subject: MSVC refuses to compile if variables get defined in a case block without braces. I think that is a useful feature. --- src/gui/styles/qs60style.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 58dcb98..059198d 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2157,12 +2157,13 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple ret = QCommonStyle::subControlRect(control, option, scontrol, widget); switch (scontrol) { case SC_GroupBoxCheckBox: //fallthrough - case SC_GroupBoxLabel: + case SC_GroupBoxLabel: { //slightly indent text and boxes, so that dialog border does not mess with them. const int horizontalSpacing = QS60StylePrivate::pixelMetric(QStyle::PM_LayoutHorizontalSpacing); const int bottomMargin = QS60StylePrivate::pixelMetric(QStyle::PM_LayoutBottomMargin); ret.adjust(2,horizontalSpacing-3,0,0); + } break; case SC_GroupBoxFrame: { const QRect textBox = subControlRect(control, option, SC_GroupBoxLabel, widget); -- cgit v0.12 From e7864bbc420151aee1facc6383fd8c7fd9a63d13 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Thu, 30 Apr 2009 14:42:10 +0200 Subject: Initial skeleton of what is to become the cross platform softkey API. Current version is very experimental and can and will change very radically. Also functionality on this early version is very limited. API can only set single Back button on S60 platform. Work is somewhat based in softkey experiment done in Brisbane. Major difference is that this implementation will only be API through which softkeys will be adapted and will not have any kind of visualization in itself --- src/gui/softkeys/main.cpp | 42 +++++++++++ src/gui/softkeys/qsoftkeyaction.cpp | 139 ++++++++++++++++++++++++++++++++++++ src/gui/softkeys/qsoftkeyaction.h | 59 +++++++++++++++ src/gui/softkeys/qsoftkeystack.cpp | 93 ++++++++++++++++++++++++ src/gui/softkeys/qsoftkeystack.h | 74 +++++++++++++++++++ src/gui/softkeys/softkeys.pro | 13 ++++ 6 files changed, 420 insertions(+) create mode 100644 src/gui/softkeys/main.cpp create mode 100644 src/gui/softkeys/qsoftkeyaction.cpp create mode 100644 src/gui/softkeys/qsoftkeyaction.h create mode 100644 src/gui/softkeys/qsoftkeystack.cpp create mode 100644 src/gui/softkeys/qsoftkeystack.h create mode 100644 src/gui/softkeys/softkeys.pro diff --git a/src/gui/softkeys/main.cpp b/src/gui/softkeys/main.cpp new file mode 100644 index 0000000..4f452d6 --- /dev/null +++ b/src/gui/softkeys/main.cpp @@ -0,0 +1,42 @@ + +#include +#include +#include +#include +#include "qsoftkeystack.h" + +class MainWindow : public QMainWindow +{ + Q_OBJECT +public: + MainWindow(QWidget *parent = 0); + ~MainWindow() {} +}; + +MainWindow::MainWindow(QWidget *parent) + : QMainWindow(parent) +{ + QWidget *central = new QWidget(this); + QVBoxLayout *layout = new QVBoxLayout(central); + + QPushButton *button = new QPushButton("Hello"); + layout->addWidget(button); + + QSoftKeyStack *stack = new QSoftKeyStack(central); + QSoftKeyAction action(central); + action.setRole(QSoftKeyAction::Back); + int role = action.role(); + stack->push(&action); + + setCentralWidget(central); +} + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + MainWindow mw; + mw.show(); + return app.exec(); +} + +#include "main.moc" diff --git a/src/gui/softkeys/qsoftkeyaction.cpp b/src/gui/softkeys/qsoftkeyaction.cpp new file mode 100644 index 0000000..ac6cb01 --- /dev/null +++ b/src/gui/softkeys/qsoftkeyaction.cpp @@ -0,0 +1,139 @@ +/**************************************************************************** +** +** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the $MODULE$ of the Qt Toolkit. +** +** $TROLLTECH_DUAL_LICENSE$ +** +****************************************************************************/ + +#include "qsoftkeyaction.h" + +/*! + \class QSoftKeyAction + \brief The QSoftKeyAction class defines a special kind of QAction that may also be displayed in a QSoftKeyBar. +*/ + +class QSoftKeyActionPrivate +{ +public: + QSoftKeyActionPrivate(QSoftKeyAction::StandardRole role = QSoftKeyAction::Custom) + { + this->role = role; + } + + QSoftKeyAction::StandardRole role; + QString roleName; +}; + +/*! + \enum QSoftKeyAction::StandardRole + This enum defines the standard role for a QSoftKeyAction. + + \value Options + \value Select + \value Back + \value Next + \value Previous + \value Ok + \value Cancel + \value Edit + \value View + \value BackSpace + \value EndEdit + \value RevertEdit + \value Deselect + \value Finish + \value Custom +*/ + +QSoftKeyAction::QSoftKeyAction(QObject *parent) + : QAction(parent) +{ + d = new QSoftKeyActionPrivate(); +} + +QSoftKeyAction::QSoftKeyAction(QSoftKeyAction::StandardRole role, QObject *parent) + : QAction(parent) +{ + d = new QSoftKeyActionPrivate(role); +} + +QSoftKeyAction::QSoftKeyAction(const QString &text, QObject* parent) + : QAction(text, parent) +{ + d = new QSoftKeyActionPrivate(); +} + +QSoftKeyAction::QSoftKeyAction(QSoftKeyAction::StandardRole role, const QString &text, QObject* parent) + : QAction(text, parent) +{ + d = new QSoftKeyActionPrivate(role); +} + +QSoftKeyAction::QSoftKeyAction(const QIcon &icon, const QString &text, QObject* parent) + : QAction(icon, text, parent) +{ + d = new QSoftKeyActionPrivate(); +} + +QSoftKeyAction::QSoftKeyAction(QSoftKeyAction::StandardRole role, const QIcon &icon, const QString &text, QObject* parent) + : QAction(icon, text, parent) +{ + d = new QSoftKeyActionPrivate(role); +} + +QSoftKeyAction::~QSoftKeyAction() +{ + delete d; +} + +/*! + Returns the standard role associated with this action, or Custom + if the role is defined by roleName(). + + \sa setRole(), roleName() +*/ +QSoftKeyAction::StandardRole QSoftKeyAction::role() const +{ + return d->role; +} + +/*! + Returns the custom role name if role() is Custom, or an empty + string otherwise. + + \sa role(), setRole() +*/ +QString QSoftKeyAction::roleName() const +{ + return d->roleName; +} + +/*! + Sets the standard role associated with this action to \a role, + and also sets roleName() to the empty string. + + \sa role(), roleName() +*/ +void QSoftKeyAction::setRole(QSoftKeyAction::StandardRole role) +{ + d->role = role; + d->roleName = QString(); + emit changed(); +} + +/*! + Sets the custom roleName() associated with this action to \a role, + and also sets role() to Custom. + + \sa role(), roleName() +*/ +void QSoftKeyAction::setRole(const QString& role) +{ + d->role = QSoftKeyAction::Custom; + d->roleName = role; + emit changed(); +} diff --git a/src/gui/softkeys/qsoftkeyaction.h b/src/gui/softkeys/qsoftkeyaction.h new file mode 100644 index 0000000..67401e2 --- /dev/null +++ b/src/gui/softkeys/qsoftkeyaction.h @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the $MODULE$ of the Qt Toolkit. +** +** $TROLLTECH_DUAL_LICENSE$ +** +****************************************************************************/ + +#ifndef QSOFTKEYACTION_H +#define QSOFTKEYACTION_H + +#include + +class QSoftKeyActionPrivate; + +class QSoftKeyAction : public QAction +{ + Q_OBJECT +public: + enum StandardRole + { + Options, + Select, + Back, + Next, + Previous, + Ok, + Cancel, + Edit, + View, + BackSpace, + EndEdit, + RevertEdit, + Deselect, + Finish, + Custom + }; + + QSoftKeyAction(QObject *parent); + QSoftKeyAction(QSoftKeyAction::StandardRole role, QObject *parent); + QSoftKeyAction(const QString &text, QObject* parent); + QSoftKeyAction(QSoftKeyAction::StandardRole role, const QString &text, QObject* parent); + QSoftKeyAction(const QIcon &icon, const QString &text, QObject* parent); + QSoftKeyAction(QSoftKeyAction::StandardRole role, const QIcon &icon, const QString &text, QObject* parent); + ~QSoftKeyAction(); + + QSoftKeyAction::StandardRole role() const; + QString roleName() const; + + void setRole(QSoftKeyAction::StandardRole role); + void setRole(const QString& role); + + QSoftKeyActionPrivate *d; +}; + +#endif // QSOFTKEYACTION_H diff --git a/src/gui/softkeys/qsoftkeystack.cpp b/src/gui/softkeys/qsoftkeystack.cpp new file mode 100644 index 0000000..669198b --- /dev/null +++ b/src/gui/softkeys/qsoftkeystack.cpp @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the $MODULE$ of the Qt Toolkit. +** +** $TROLLTECH_DUAL_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include +#include + +#include "qsoftkeystack.h" + +QSoftKeyStackPrivate::QSoftKeyStackPrivate() +{ + +} + +QSoftKeyStackPrivate::~QSoftKeyStackPrivate() +{ + +} + +void QSoftKeyStackPrivate::setNativeSoftKeys() +{ + QSoftkeySet top = softKeyStack.top(); + CCoeAppUi* appui = CEikonEnv::Static()->AppUi(); + CAknAppUi* aknAppUi = static_cast (appui); + CEikButtonGroupContainer* nativeContainer = aknAppUi->Cba(); + int role = top.at(0)->role(); + + switch( top.at(0)->role() ) + { + case(QSoftKeyAction::Back): + { + nativeContainer->SetCommandSetL(R_AVKON_SOFTKEYS_BACK); + } + break; + default: + { + } + } +} + +void QSoftKeyStackPrivate::push(QSoftKeyAction *softKey) +{ + QSoftkeySet softkeys; + softkeys.append( softKey ); + softKeyStack.push(softkeys); + setNativeSoftKeys(); + +} +void QSoftKeyStackPrivate::push( QList softkeys) +{ + +} + +void QSoftKeyStackPrivate::pop() +{ + softKeyStack.pop(); +} + +EXPORT_C QSoftKeyStack::QSoftKeyStack(QWidget *parent) +{ + d = new QSoftKeyStackPrivate(); +} + +QSoftKeyStack::~QSoftKeyStack() +{ + delete d; +} + +void QSoftKeyStack::push(QSoftKeyAction *softKey) +{ + d->push(softKey); +} + +void QSoftKeyStack::push(QList softKeys) +{ + d->push(softKeys); +} + +void QSoftKeyStack::pop() +{ + d->pop(); +} + diff --git a/src/gui/softkeys/qsoftkeystack.h b/src/gui/softkeys/qsoftkeystack.h new file mode 100644 index 0000000..d725954 --- /dev/null +++ b/src/gui/softkeys/qsoftkeystack.h @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the $MODULE$ of the Qt Toolkit. +** +** $TROLLTECH_DUAL_LICENSE$ +** +****************************************************************************/ + +#ifndef QSOFTKEYSTACK_H +#define QSOFTKEYSTACK_H + +#include +#include +#include + +#include "qsoftkeyaction.h" + +#define QSoftkeySet QList + +class QSoftKeyStackPrivate : public QObject + { + Q_OBJECT + public: + IMPORT_C QSoftKeyStackPrivate(); + ~QSoftKeyStackPrivate(); + +public: + void push(QSoftKeyAction *softKey); + void push(QList softKeys); + void pop(); + +private: + void setNativeSoftKeys(); + +private: + QStack softKeyStack; + }; + + + +/*class QSoftkeySet + { + const QList softkeys; + }; + + +class QSoftkeySet + { + const QList softkeys; + }; +*/ +class QSoftKeyStack : public QObject +{ + Q_OBJECT +public: + IMPORT_C QSoftKeyStack(QWidget *parent); + ~QSoftKeyStack(); +public: + void push(QSoftKeyAction *softKey); + void push(QList softkeys); + void pop(); +protected: + +private Q_SLOTS: + +private: + QSoftKeyStackPrivate *d; + +}; + +#endif // QSOFTKEYSTACK_H diff --git a/src/gui/softkeys/softkeys.pro b/src/gui/softkeys/softkeys.pro new file mode 100644 index 0000000..88a813e --- /dev/null +++ b/src/gui/softkeys/softkeys.pro @@ -0,0 +1,13 @@ +TEMPLATE = app +TARGET = softkeys + +HEADERS += \ + qsoftkeystack.h \ + qsoftkeyaction.h + +SOURCES += \ + main.cpp \ + qsoftkeyaction.cpp \ + qsoftkeystack.cpp + +iCONFIG += qt debug warn_on -- cgit v0.12 From d24c24b6c0c840d7bbea5e8b81e1faaea6b5fede Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Mon, 4 May 2009 11:18:34 +0200 Subject: Very rough implementation of setting multiple buttons. Current implementation is missing loads of needed functionality but is enough to start testing the initial API --- src/gui/softkeys/qsoftkeystack.cpp | 42 ++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/src/gui/softkeys/qsoftkeystack.cpp b/src/gui/softkeys/qsoftkeystack.cpp index 669198b..158d382 100644 --- a/src/gui/softkeys/qsoftkeystack.cpp +++ b/src/gui/softkeys/qsoftkeystack.cpp @@ -15,6 +15,9 @@ #include #include +#include "private/qcore_symbian_p.h" + + #include "qsoftkeystack.h" QSoftKeyStackPrivate::QSoftKeyStackPrivate() @@ -29,41 +32,50 @@ QSoftKeyStackPrivate::~QSoftKeyStackPrivate() void QSoftKeyStackPrivate::setNativeSoftKeys() { - QSoftkeySet top = softKeyStack.top(); CCoeAppUi* appui = CEikonEnv::Static()->AppUi(); CAknAppUi* aknAppUi = static_cast (appui); CEikButtonGroupContainer* nativeContainer = aknAppUi->Cba(); - int role = top.at(0)->role(); + nativeContainer->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY_WITH_IDS); + if(softKeyStack.isEmpty()) + return; + + QSoftkeySet top = softKeyStack.top(); - switch( top.at(0)->role() ) + // FIX THIS + // veryWeirdMagic is needes as s60 5th edition sdk always panics if cba is set with index 1, this hops over it + // This needs further investigation why so that the hack can be removed + int veryWeirdMagic = 0; + for (int index=0;indexSetCommandSetL(R_AVKON_SOFTKEYS_BACK); - } - break; - default: - { - } + QSoftKeyAction* softKeyAction = top.at(index); + HBufC* text = qt_QString2HBufCNewL(softKeyAction->text()); + CleanupStack::PushL(text); + nativeContainer->SetCommandL(index+veryWeirdMagic, softKeyAction->role(), *text); + CleanupStack::PopAndDestroy(); + if (veryWeirdMagic==0) + veryWeirdMagic=1; } } void QSoftKeyStackPrivate::push(QSoftKeyAction *softKey) { - QSoftkeySet softkeys; - softkeys.append( softKey ); - softKeyStack.push(softkeys); + QSoftkeySet softKeySet; + softKeySet.append( softKey ); + softKeyStack.push(softKeySet); setNativeSoftKeys(); } void QSoftKeyStackPrivate::push( QList softkeys) { - + QSoftkeySet softKeySet(softkeys); + softKeyStack.push(softKeySet); + setNativeSoftKeys(); } void QSoftKeyStackPrivate::pop() { softKeyStack.pop(); + setNativeSoftKeys(); } EXPORT_C QSoftKeyStack::QSoftKeyStack(QWidget *parent) -- cgit v0.12 From 3a336c63f9eef19d99b114bda9ff375f84c99234 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Mon, 4 May 2009 11:19:47 +0200 Subject: More code to test the stack implementatioMore code to test the stack implementationn --- src/gui/softkeys/main.cpp | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/gui/softkeys/main.cpp b/src/gui/softkeys/main.cpp index 4f452d6..fd82ce5 100644 --- a/src/gui/softkeys/main.cpp +++ b/src/gui/softkeys/main.cpp @@ -23,11 +23,24 @@ MainWindow::MainWindow(QWidget *parent) layout->addWidget(button); QSoftKeyStack *stack = new QSoftKeyStack(central); - QSoftKeyAction action(central); - action.setRole(QSoftKeyAction::Back); - int role = action.role(); - stack->push(&action); - + QSoftKeyAction action1(central); + action1.setText(QString("text1")); + action1.setRole(QSoftKeyAction::Ok); + QSoftKeyAction action2(central); + action2.setText(QString("text2")); + action2.setRole(QSoftKeyAction::Back); + QSoftKeyAction action3(central); + action3.setText(QString("text3")); + action3.setRole(QSoftKeyAction::Cancel); + + QList myActionList; + myActionList.append(&action1); + myActionList.append(&action2); + myActionList.append(&action3); + stack->push(myActionList); + stack->pop(); + stack->push(&action1); + setCentralWidget(central); } -- cgit v0.12 From b83e03ce82c84eaaf08ac1df154dcaa88691063d Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Mon, 4 May 2009 13:17:52 +0200 Subject: Changed way how softkey command is mapped --- src/gui/softkeys/qsoftkeystack.cpp | 2 +- src/gui/softkeys/qsoftkeystack.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/softkeys/qsoftkeystack.cpp b/src/gui/softkeys/qsoftkeystack.cpp index 158d382..6cbcddd 100644 --- a/src/gui/softkeys/qsoftkeystack.cpp +++ b/src/gui/softkeys/qsoftkeystack.cpp @@ -50,7 +50,7 @@ void QSoftKeyStackPrivate::setNativeSoftKeys() QSoftKeyAction* softKeyAction = top.at(index); HBufC* text = qt_QString2HBufCNewL(softKeyAction->text()); CleanupStack::PushL(text); - nativeContainer->SetCommandL(index+veryWeirdMagic, softKeyAction->role(), *text); + nativeContainer->SetCommandL(index+veryWeirdMagic, SOFTKEYSTART+index, *text); CleanupStack::PopAndDestroy(); if (veryWeirdMagic==0) veryWeirdMagic=1; diff --git a/src/gui/softkeys/qsoftkeystack.h b/src/gui/softkeys/qsoftkeystack.h index d725954..98c2632 100644 --- a/src/gui/softkeys/qsoftkeystack.h +++ b/src/gui/softkeys/qsoftkeystack.h @@ -19,7 +19,8 @@ #include "qsoftkeyaction.h" #define QSoftkeySet QList - +#define SOFTKEYSTART 5000 +#define SOFTKEYEND 5004 class QSoftKeyStackPrivate : public QObject { Q_OBJECT -- cgit v0.12 From 93a61a4cbe092dce8e5d221858d6b613fa258f07 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Mon, 4 May 2009 14:26:13 +0200 Subject: Skeleton implementation allowing us to conviniently change place where softkeys are visualized on the screen. Added mapping to native and Qt id's for QSoftKeyActions. Added rudimentary implementation for reordering QSoftKeyActions. --- src/gui/softkeys/qsoftkeyaction.cpp | 22 ++++++++++++++++++++++ src/gui/softkeys/qsoftkeyaction.h | 4 ++++ src/gui/softkeys/qsoftkeystack.cpp | 33 +++++++++++++++++++++++++-------- src/gui/softkeys/qsoftkeystack.h | 3 ++- 4 files changed, 53 insertions(+), 9 deletions(-) diff --git a/src/gui/softkeys/qsoftkeyaction.cpp b/src/gui/softkeys/qsoftkeyaction.cpp index ac6cb01..bfa8330 100644 --- a/src/gui/softkeys/qsoftkeyaction.cpp +++ b/src/gui/softkeys/qsoftkeyaction.cpp @@ -26,6 +26,8 @@ public: QSoftKeyAction::StandardRole role; QString roleName; + int nativePosition; + int qtContextKey; }; /*! @@ -137,3 +139,23 @@ void QSoftKeyAction::setRole(const QString& role) d->roleName = role; emit changed(); } + +int QSoftKeyAction::nativePosition() +{ + return d->nativePosition; +} + +void QSoftKeyAction::setNativePosition(int position) +{ + d->nativePosition = position; +} + +int QSoftKeyAction::qtContextKey() +{ + return d->qtContextKey; +} + +void QSoftKeyAction::setQtContextKey(int key) +{ + d->qtContextKey = key; +} diff --git a/src/gui/softkeys/qsoftkeyaction.h b/src/gui/softkeys/qsoftkeyaction.h index 67401e2..85f5bc7 100644 --- a/src/gui/softkeys/qsoftkeyaction.h +++ b/src/gui/softkeys/qsoftkeyaction.h @@ -52,6 +52,10 @@ public: void setRole(QSoftKeyAction::StandardRole role); void setRole(const QString& role); + int nativePosition(); + void setNativePosition(int position); + int qtContextKey(); + void setQtContextKey(int position); QSoftKeyActionPrivate *d; }; diff --git a/src/gui/softkeys/qsoftkeystack.cpp b/src/gui/softkeys/qsoftkeystack.cpp index 6cbcddd..bd9a636 100644 --- a/src/gui/softkeys/qsoftkeystack.cpp +++ b/src/gui/softkeys/qsoftkeystack.cpp @@ -30,6 +30,29 @@ QSoftKeyStackPrivate::~QSoftKeyStackPrivate() } +void QSoftKeyStackPrivate::mapSoftKeys(QSoftkeySet& top) +{ + if( top.count() == 1) + { + top.at(0)->setNativePosition(2); + top.at(0)->setQtContextKey(Qt::Key_Context2); + } + else + { + // FIX THIS + // veryWeirdMagic is needes as s60 5th edition sdk always panics if cba is set with index 1, this hops over it + // This needs further investigation why so that the hack can be removed + int veryWeirdMagic = 0; + for (int index=0;indexsetNativePosition(index+veryWeirdMagic); + top.at(index)->setQtContextKey(Qt::Key_Context1+index); + if (veryWeirdMagic==0) + veryWeirdMagic=1; + } + } +} + void QSoftKeyStackPrivate::setNativeSoftKeys() { CCoeAppUi* appui = CEikonEnv::Static()->AppUi(); @@ -40,20 +63,14 @@ void QSoftKeyStackPrivate::setNativeSoftKeys() return; QSoftkeySet top = softKeyStack.top(); - - // FIX THIS - // veryWeirdMagic is needes as s60 5th edition sdk always panics if cba is set with index 1, this hops over it - // This needs further investigation why so that the hack can be removed - int veryWeirdMagic = 0; + mapSoftKeys(top); for (int index=0;indextext()); CleanupStack::PushL(text); - nativeContainer->SetCommandL(index+veryWeirdMagic, SOFTKEYSTART+index, *text); + nativeContainer->SetCommandL(softKeyAction->nativePosition(), SOFTKEYSTART+softKeyAction->qtContextKey(), *text); CleanupStack::PopAndDestroy(); - if (veryWeirdMagic==0) - veryWeirdMagic=1; } } diff --git a/src/gui/softkeys/qsoftkeystack.h b/src/gui/softkeys/qsoftkeystack.h index 98c2632..add4ab9 100644 --- a/src/gui/softkeys/qsoftkeystack.h +++ b/src/gui/softkeys/qsoftkeystack.h @@ -20,7 +20,7 @@ #define QSoftkeySet QList #define SOFTKEYSTART 5000 -#define SOFTKEYEND 5004 +#define SOFTKEYEND 5005 class QSoftKeyStackPrivate : public QObject { Q_OBJECT @@ -34,6 +34,7 @@ public: void pop(); private: + void mapSoftKeys(QSoftkeySet& top); void setNativeSoftKeys(); private: -- cgit v0.12 From cfe8216b0fd5270d4dc90d5cf3df62e12d0c35b3 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Mon, 4 May 2009 14:30:41 +0200 Subject: Changed mapping of softkey id's --- src/gui/softkeys/qsoftkeystack.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/softkeys/qsoftkeystack.h b/src/gui/softkeys/qsoftkeystack.h index add4ab9..b96bf60 100644 --- a/src/gui/softkeys/qsoftkeystack.h +++ b/src/gui/softkeys/qsoftkeystack.h @@ -20,7 +20,8 @@ #define QSoftkeySet QList #define SOFTKEYSTART 5000 -#define SOFTKEYEND 5005 +#define SOFTKEYEND 5000+Qt::Key_Context4 + class QSoftKeyStackPrivate : public QObject { Q_OBJECT -- cgit v0.12 From 2e76d2bfedce77064fde85573f5267032ce7979e Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Mon, 4 May 2009 16:17:15 +0200 Subject: Added proper headers --- src/gui/softkeys/main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gui/softkeys/main.cpp b/src/gui/softkeys/main.cpp index fd82ce5..e5a7065 100644 --- a/src/gui/softkeys/main.cpp +++ b/src/gui/softkeys/main.cpp @@ -1,3 +1,13 @@ +/**************************************************************************** +** +** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the $MODULE$ of the Qt Toolkit. +** +** $TROLLTECH_DUAL_LICENSE$ +** +****************************************************************************/ #include #include -- cgit v0.12 From 4bf005f424ed4aa86f3539ee3018bf11779550cd Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Mon, 11 May 2009 13:58:24 +0200 Subject: Refactored implementation so that it works with multiple QMainWindows --- src/gui/widgets/qmenu_symbian.cpp | 59 +++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index 9e53df5..4c8b4ae 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -32,8 +32,10 @@ QT_BEGIN_NAMESPACE // ### FIX/Document this, we need some safe range of menu id's for Qt that don't clash with AIW ones +typedef QHash MenuBarHash; +Q_GLOBAL_STATIC(MenuBarHash, menubars) + #define QT_FIRST_MENU_ITEM 32000 -static QList s60_menubars; struct SymbianMenuItem { @@ -47,6 +49,15 @@ static QList symbianMenus; static QList nativeMenuBars; static uint qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM; +bool menuExists() +{ + QWidget *w = qApp->activeWindow(); + QMenuBarPrivate *mb = menubars()->value(w); + if (!mb) + return false; + return true; +} + // ### FIX THIS, copy/paste of original (faulty) stripped text implementation. // Implementation should be removed from QAction implementation to some generic place static QString qt_strippedText_copy_from_qaction(QString s) @@ -167,7 +178,7 @@ static void setSoftkeys() { CEikButtonGroupContainer* cba = CEikonEnv::Static()->AppUiFactory()->Cba(); if (cba){ - if (s60_menubars.count()>0) + if (menuExists()) cba->SetCommandSetL(R_AVKON_SOFTKEYS_OPTIONS_EXIT); else cba->SetCommandSetL(R_AVKON_SOFTKEYS_EXIT); @@ -176,24 +187,23 @@ static void setSoftkeys() static void rebuildMenu() { - qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM; - deleteAll( &symbianMenus ); - if (s60_menubars.count()==0) - return; - for (int i = 0; i < s60_menubars.last()->actions.size(); ++i) { - QSymbianMenuAction *symbianActionTopLevel = new QSymbianMenuAction; - symbianActionTopLevel->action = s60_menubars.last()->actions.at(i); - symbianActionTopLevel->parent = 0; - symbianActionTopLevel->command = qt_symbian_menu_static_cmd_id++; - qt_symbian_insert_action(symbianActionTopLevel, &symbianMenus); + QMenuBarPrivate *mb = 0; + setSoftkeys(); + QWidget *w = qApp->activeWindow(); + if (w) + { + mb = menubars()->value(w); + qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM; + deleteAll( &symbianMenus ); + if (!mb) + return; + mb->symbian_menubar->rebuild(); } - - return; } Q_GUI_EXPORT void qt_symbian_show_toplevel( CEikMenuPane* menuPane) { - if (s60_menubars.count()==0) + if (!menuExists()) return; rebuildMenu(); for (int i = 0; i < symbianMenus.count(); ++i) @@ -251,6 +261,7 @@ void QMenuBarPrivate::symbianCreateMenuBar(QWidget *parent) { Q_Q(QMenuBar); if (parent && parent->isWindow()){ + menubars()->insert(q->window(), this); symbian_menubar = new QSymbianMenuBarPrivate(this); nativeMenuBars.append(q); } @@ -261,7 +272,7 @@ void QMenuBarPrivate::symbianDestroyMenuBar() Q_Q(QMenuBar); int index = nativeMenuBars.indexOf(q); nativeMenuBars.removeAt(index); - s60_menubars.removeLast(); + menubars()->remove(q->window()); rebuildMenu(); if (symbian_menubar) delete symbian_menubar; @@ -271,7 +282,6 @@ void QMenuBarPrivate::symbianDestroyMenuBar() QMenuBarPrivate::QSymbianMenuBarPrivate::QSymbianMenuBarPrivate(QMenuBarPrivate *menubar) { d = menubar; - s60_menubars.append(menubar); } QMenuBarPrivate::QSymbianMenuBarPrivate::~QSymbianMenuBarPrivate() @@ -364,10 +374,17 @@ void QMenuBarPrivate::QSymbianMenuBarPrivate::removeAction(QSymbianMenuAction *a void QMenuBarPrivate::QSymbianMenuBarPrivate::rebuild() { setSoftkeys(); - if (s60_menubars.count()==0) + qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM; + deleteAll( &symbianMenus ); + if (!d) return; - - rebuildMenu(); - } + for (int i = 0; i < d->actions.size(); ++i) { + QSymbianMenuAction *symbianActionTopLevel = new QSymbianMenuAction; + symbianActionTopLevel->action = d->actions.at(i); + symbianActionTopLevel->parent = 0; + symbianActionTopLevel->command = qt_symbian_menu_static_cmd_id++; + qt_symbian_insert_action(symbianActionTopLevel, &symbianMenus); + } +} #endif //QT_NO_MENUBAR -- cgit v0.12 From 61b111228d0abf66130b229fcb6c5e2a54faecbf Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Tue, 12 May 2009 15:24:43 +0200 Subject: Removed setting native softkeys from menu implementation as from now on the menu softkey will be set by the brand new softkey stack. --- src/gui/widgets/qmenu_symbian.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index aee55b9..1dc727c 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -173,21 +173,9 @@ void deleteAll(QList *items) } } -static void setSoftkeys() -{ - CEikButtonGroupContainer* cba = CEikonEnv::Static()->AppUiFactory()->Cba(); - if (cba){ - if (menuExists()) - cba->SetCommandSetL(R_AVKON_SOFTKEYS_OPTIONS_EXIT); - else - cba->SetCommandSetL(R_AVKON_SOFTKEYS_EXIT); - } -} - static void rebuildMenu() { QMenuBarPrivate *mb = 0; - setSoftkeys(); QWidget *w = qApp->activeWindow(); if (w) { @@ -372,7 +360,6 @@ void QMenuBarPrivate::QSymbianMenuBarPrivate::removeAction(QSymbianMenuAction *a void QMenuBarPrivate::QSymbianMenuBarPrivate::rebuild() { - setSoftkeys(); qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM; deleteAll( &symbianMenus ); if (!d) -- cgit v0.12 From 9ef6e374126ba212bccbf3cf61f86f8412099c49 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Tue, 12 May 2009 15:31:18 +0200 Subject: Initial naive implementation for menu softkey --- src/gui/softkeys/main.cpp | 29 ++++++++++++++++++++--------- src/gui/softkeys/qsoftkeyaction.h | 1 + 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/gui/softkeys/main.cpp b/src/gui/softkeys/main.cpp index e5a7065..a61e512 100644 --- a/src/gui/softkeys/main.cpp +++ b/src/gui/softkeys/main.cpp @@ -11,8 +11,8 @@ #include #include -#include -#include +#include + #include "qsoftkeystack.h" class MainWindow : public QMainWindow @@ -26,22 +26,26 @@ public: MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { - QWidget *central = new QWidget(this); - QVBoxLayout *layout = new QVBoxLayout(central); - QPushButton *button = new QPushButton("Hello"); - layout->addWidget(button); + QWidget *central = new QWidget(this); + + QMenuBar* menuBar = new QMenuBar(this); + menuBar->addAction("MyMenuItem1"); + this->setMenuBar(menuBar); QSoftKeyStack *stack = new QSoftKeyStack(central); QSoftKeyAction action1(central); - action1.setText(QString("text1")); + action1.setText(QString("Ok")); action1.setRole(QSoftKeyAction::Ok); QSoftKeyAction action2(central); - action2.setText(QString("text2")); + action2.setText(QString("Back")); action2.setRole(QSoftKeyAction::Back); QSoftKeyAction action3(central); - action3.setText(QString("text3")); + action3.setText(QString("Cancel")); action3.setRole(QSoftKeyAction::Cancel); + QSoftKeyAction action4(central); + action4.setText(QString("Menu")); + action4.setRole(QSoftKeyAction::Menu); QList myActionList; myActionList.append(&action1); @@ -50,6 +54,13 @@ MainWindow::MainWindow(QWidget *parent) stack->push(myActionList); stack->pop(); stack->push(&action1); + stack->pop(); + + QList myActionList2; + myActionList2.append(&action4); + myActionList2.append(&action1); + stack->push(myActionList2); + setCentralWidget(central); } diff --git a/src/gui/softkeys/qsoftkeyaction.h b/src/gui/softkeys/qsoftkeyaction.h index 85f5bc7..76be8ee 100644 --- a/src/gui/softkeys/qsoftkeyaction.h +++ b/src/gui/softkeys/qsoftkeyaction.h @@ -36,6 +36,7 @@ public: RevertEdit, Deselect, Finish, + Menu, Custom }; -- cgit v0.12 From 21d8da6365281426c50d6d5b8393d833e16d4096 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Tue, 12 May 2009 16:17:35 +0200 Subject: Added handling of softkey with the role of menu --- src/gui/softkeys/qsoftkeystack.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/softkeys/qsoftkeystack.cpp b/src/gui/softkeys/qsoftkeystack.cpp index bd9a636..c1d6e98 100644 --- a/src/gui/softkeys/qsoftkeystack.cpp +++ b/src/gui/softkeys/qsoftkeystack.cpp @@ -64,12 +64,18 @@ void QSoftKeyStackPrivate::setNativeSoftKeys() QSoftkeySet top = softKeyStack.top(); mapSoftKeys(top); + for (int index=0;indextext()); CleanupStack::PushL(text); - nativeContainer->SetCommandL(softKeyAction->nativePosition(), SOFTKEYSTART+softKeyAction->qtContextKey(), *text); + if (softKeyAction->role() == QSoftKeyAction::Menu) { + nativeContainer->SetCommandL(softKeyAction->nativePosition(), EAknSoftkeyOptions, *text); + } + else { + nativeContainer->SetCommandL(softKeyAction->nativePosition(), SOFTKEYSTART+softKeyAction->qtContextKey(), *text); + } CleanupStack::PopAndDestroy(); } } -- cgit v0.12 From 27ace2c1eb1faecf01b6229cf7ebb7534a1c6125 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 12 May 2009 18:48:22 +0200 Subject: Qt-ifications. Mostly license headers and coding conventions. --- src/gui/softkeys/qsoftkeyaction.cpp | 48 ++++++++++++--- src/gui/softkeys/qsoftkeyaction.h | 60 ++++++++++++++----- src/gui/softkeys/qsoftkeystack.cpp | 104 ++++++++++++--------------------- src/gui/softkeys/qsoftkeystack.h | 91 ++++++++++++++--------------- src/gui/softkeys/qsoftkeystack_p.h | 86 +++++++++++++++++++++++++++ src/gui/softkeys/qsoftkeystack_s60.cpp | 100 +++++++++++++++++++++++++++++++ src/gui/softkeys/softkeys.pro | 2 + 7 files changed, 355 insertions(+), 136 deletions(-) create mode 100644 src/gui/softkeys/qsoftkeystack_p.h create mode 100644 src/gui/softkeys/qsoftkeystack_s60.cpp diff --git a/src/gui/softkeys/qsoftkeyaction.cpp b/src/gui/softkeys/qsoftkeyaction.cpp index bfa8330..1d21376 100644 --- a/src/gui/softkeys/qsoftkeyaction.cpp +++ b/src/gui/softkeys/qsoftkeyaction.cpp @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -57,7 +87,7 @@ QSoftKeyAction::QSoftKeyAction(QObject *parent) d = new QSoftKeyActionPrivate(); } -QSoftKeyAction::QSoftKeyAction(QSoftKeyAction::StandardRole role, QObject *parent) +QSoftKeyAction::QSoftKeyAction(StandardRole role, QObject *parent) : QAction(parent) { d = new QSoftKeyActionPrivate(role); @@ -69,7 +99,7 @@ QSoftKeyAction::QSoftKeyAction(const QString &text, QObject* parent) d = new QSoftKeyActionPrivate(); } -QSoftKeyAction::QSoftKeyAction(QSoftKeyAction::StandardRole role, const QString &text, QObject* parent) +QSoftKeyAction::QSoftKeyAction(StandardRole role, const QString &text, QObject* parent) : QAction(text, parent) { d = new QSoftKeyActionPrivate(role); @@ -81,7 +111,7 @@ QSoftKeyAction::QSoftKeyAction(const QIcon &icon, const QString &text, QObject* d = new QSoftKeyActionPrivate(); } -QSoftKeyAction::QSoftKeyAction(QSoftKeyAction::StandardRole role, const QIcon &icon, const QString &text, QObject* parent) +QSoftKeyAction::QSoftKeyAction(StandardRole role, const QIcon &icon, const QString &text, QObject* parent) : QAction(icon, text, parent) { d = new QSoftKeyActionPrivate(role); @@ -120,7 +150,7 @@ QString QSoftKeyAction::roleName() const \sa role(), roleName() */ -void QSoftKeyAction::setRole(QSoftKeyAction::StandardRole role) +void QSoftKeyAction::setRole(StandardRole role) { d->role = role; d->roleName = QString(); @@ -140,7 +170,7 @@ void QSoftKeyAction::setRole(const QString& role) emit changed(); } -int QSoftKeyAction::nativePosition() +int QSoftKeyAction::nativePosition() const { return d->nativePosition; } @@ -150,7 +180,7 @@ void QSoftKeyAction::setNativePosition(int position) d->nativePosition = position; } -int QSoftKeyAction::qtContextKey() +int QSoftKeyAction::qtContextKey() const { return d->qtContextKey; } diff --git a/src/gui/softkeys/qsoftkeyaction.h b/src/gui/softkeys/qsoftkeyaction.h index 76be8ee..e735376 100644 --- a/src/gui/softkeys/qsoftkeyaction.h +++ b/src/gui/softkeys/qsoftkeyaction.h @@ -1,27 +1,57 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QSOFTKEYACTION_H #define QSOFTKEYACTION_H -#include +#include "QtGui/qaction.h" + +QT_BEGIN_NAMESPACE class QSoftKeyActionPrivate; class QSoftKeyAction : public QAction { - Q_OBJECT public: - enum StandardRole - { + enum StandardRole { Options, Select, Back, @@ -41,24 +71,26 @@ public: }; QSoftKeyAction(QObject *parent); - QSoftKeyAction(QSoftKeyAction::StandardRole role, QObject *parent); + QSoftKeyAction(StandardRole role, QObject *parent); QSoftKeyAction(const QString &text, QObject* parent); - QSoftKeyAction(QSoftKeyAction::StandardRole role, const QString &text, QObject* parent); + QSoftKeyAction(StandardRole role, const QString &text, QObject* parent); QSoftKeyAction(const QIcon &icon, const QString &text, QObject* parent); - QSoftKeyAction(QSoftKeyAction::StandardRole role, const QIcon &icon, const QString &text, QObject* parent); + QSoftKeyAction(StandardRole role, const QIcon &icon, const QString &text, QObject* parent); ~QSoftKeyAction(); - QSoftKeyAction::StandardRole role() const; + StandardRole role() const; QString roleName() const; - void setRole(QSoftKeyAction::StandardRole role); + void setRole(StandardRole role); void setRole(const QString& role); - int nativePosition(); + int nativePosition() const; void setNativePosition(int position); - int qtContextKey(); + int qtContextKey() const; void setQtContextKey(int position); QSoftKeyActionPrivate *d; }; +QT_END_NAMESPACE + #endif // QSOFTKEYACTION_H diff --git a/src/gui/softkeys/qsoftkeystack.cpp b/src/gui/softkeys/qsoftkeystack.cpp index c1d6e98..a8bd3a9 100644 --- a/src/gui/softkeys/qsoftkeystack.cpp +++ b/src/gui/softkeys/qsoftkeystack.cpp @@ -1,24 +1,46 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ -#include -#include -#include -#include -#include - -#include "private/qcore_symbian_p.h" - - #include "qsoftkeystack.h" +#include "qsoftkeystack_p.h" QSoftKeyStackPrivate::QSoftKeyStackPrivate() { @@ -30,65 +52,15 @@ QSoftKeyStackPrivate::~QSoftKeyStackPrivate() } -void QSoftKeyStackPrivate::mapSoftKeys(QSoftkeySet& top) -{ - if( top.count() == 1) - { - top.at(0)->setNativePosition(2); - top.at(0)->setQtContextKey(Qt::Key_Context2); - } - else - { - // FIX THIS - // veryWeirdMagic is needes as s60 5th edition sdk always panics if cba is set with index 1, this hops over it - // This needs further investigation why so that the hack can be removed - int veryWeirdMagic = 0; - for (int index=0;indexsetNativePosition(index+veryWeirdMagic); - top.at(index)->setQtContextKey(Qt::Key_Context1+index); - if (veryWeirdMagic==0) - veryWeirdMagic=1; - } - } -} - -void QSoftKeyStackPrivate::setNativeSoftKeys() -{ - CCoeAppUi* appui = CEikonEnv::Static()->AppUi(); - CAknAppUi* aknAppUi = static_cast (appui); - CEikButtonGroupContainer* nativeContainer = aknAppUi->Cba(); - nativeContainer->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY_WITH_IDS); - if(softKeyStack.isEmpty()) - return; - - QSoftkeySet top = softKeyStack.top(); - mapSoftKeys(top); - - for (int index=0;indextext()); - CleanupStack::PushL(text); - if (softKeyAction->role() == QSoftKeyAction::Menu) { - nativeContainer->SetCommandL(softKeyAction->nativePosition(), EAknSoftkeyOptions, *text); - } - else { - nativeContainer->SetCommandL(softKeyAction->nativePosition(), SOFTKEYSTART+softKeyAction->qtContextKey(), *text); - } - CleanupStack::PopAndDestroy(); - } -} - void QSoftKeyStackPrivate::push(QSoftKeyAction *softKey) { QSoftkeySet softKeySet; - softKeySet.append( softKey ); + softKeySet.append(softKey); softKeyStack.push(softKeySet); setNativeSoftKeys(); } -void QSoftKeyStackPrivate::push( QList softkeys) +void QSoftKeyStackPrivate::push(const QList &softkeys) { QSoftkeySet softKeySet(softkeys); softKeyStack.push(softKeySet); @@ -101,7 +73,7 @@ void QSoftKeyStackPrivate::pop() setNativeSoftKeys(); } -EXPORT_C QSoftKeyStack::QSoftKeyStack(QWidget *parent) +QSoftKeyStack::QSoftKeyStack(QWidget *parent) { d = new QSoftKeyStackPrivate(); } @@ -116,7 +88,7 @@ void QSoftKeyStack::push(QSoftKeyAction *softKey) d->push(softKey); } -void QSoftKeyStack::push(QList softKeys) +void QSoftKeyStack::push(const QList &softKeys) { d->push(softKeys); } diff --git a/src/gui/softkeys/qsoftkeystack.h b/src/gui/softkeys/qsoftkeystack.h index b96bf60..90df43d 100644 --- a/src/gui/softkeys/qsoftkeystack.h +++ b/src/gui/softkeys/qsoftkeystack.h @@ -1,77 +1,74 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QSOFTKEYSTACK_H #define QSOFTKEYSTACK_H -#include -#include -#include +#include "QtGui/qwidget.h" +#include "QtGui/qaction.h" +#include "qstack.h" #include "qsoftkeyaction.h" -#define QSoftkeySet QList -#define SOFTKEYSTART 5000 -#define SOFTKEYEND 5000+Qt::Key_Context4 +QT_BEGIN_NAMESPACE -class QSoftKeyStackPrivate : public QObject - { - Q_OBJECT - public: - IMPORT_C QSoftKeyStackPrivate(); - ~QSoftKeyStackPrivate(); - -public: - void push(QSoftKeyAction *softKey); - void push(QList softKeys); - void pop(); - -private: - void mapSoftKeys(QSoftkeySet& top); - void setNativeSoftKeys(); - -private: - QStack softKeyStack; - }; - - - -/*class QSoftkeySet - { - const QList softkeys; - }; +#define QSoftkeySet QList +class QSoftKeyStackPrivate; -class QSoftkeySet - { - const QList softkeys; - }; -*/ class QSoftKeyStack : public QObject { - Q_OBJECT public: - IMPORT_C QSoftKeyStack(QWidget *parent); + QSoftKeyStack(QWidget *parent); ~QSoftKeyStack(); + public: void push(QSoftKeyAction *softKey); - void push(QList softkeys); + void push(const QList &softkeys); void pop(); -protected: - -private Q_SLOTS: private: QSoftKeyStackPrivate *d; - }; +QT_END_NAMESPACE + #endif // QSOFTKEYSTACK_H diff --git a/src/gui/softkeys/qsoftkeystack_p.h b/src/gui/softkeys/qsoftkeystack_p.h new file mode 100644 index 0000000..8e029af --- /dev/null +++ b/src/gui/softkeys/qsoftkeystack_p.h @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QSOFTKEYSTACK_P_H +#define QSOFTKEYSTACK_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "QtGui/qwidget.h" +#include "QtGui/qaction.h" +#include "qstack.h" + +#include "qsoftkeyaction.h" + +QT_BEGIN_NAMESPACE + +#define QSoftkeySet QList + +class QSoftKeyStackPrivate : public QObject +{ +public: + QSoftKeyStackPrivate(); + ~QSoftKeyStackPrivate(); + + void push(QSoftKeyAction *softKey); + void push(const QList &softKeys); + void pop(); + +private: + void mapSoftKeys(const QSoftkeySet &top); + void setNativeSoftKeys(); + +private: + QStack softKeyStack; +}; + +QT_END_NAMESPACE + +#endif // QSOFTKEYSTACK_P_H diff --git a/src/gui/softkeys/qsoftkeystack_s60.cpp b/src/gui/softkeys/qsoftkeystack_s60.cpp new file mode 100644 index 0000000..ce4f116 --- /dev/null +++ b/src/gui/softkeys/qsoftkeystack_s60.cpp @@ -0,0 +1,100 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include +#include + +#include "private/qcore_symbian_p.h" + +#include "qsoftkeystack_p.h" + +#define SOFTKEYSTART 5000 +#define SOFTKEYEND (5000 + Qt::Key_Context4) + +void QSoftKeyStackPrivate::mapSoftKeys(const QSoftkeySet &top) +{ + if (top.count() == 1) { + top.at(0)->setNativePosition(2); + top.at(0)->setQtContextKey(Qt::Key_Context2); + } + else { + // FIX THIS + // veryWeirdMagic is needes as s60 5th edition sdk always panics if cba is set with index 1, this hops over it + // This needs further investigation why so that the hack can be removed + int veryWeirdMagic = 0; + for (int index = 0; index < top.count(); index++) { + top.at(index)->setNativePosition(index + veryWeirdMagic); + top.at(index)->setQtContextKey(Qt::Key_Context1 + index); + if (veryWeirdMagic == 0) + veryWeirdMagic = 1; + } + } +} + +void QSoftKeyStackPrivate::setNativeSoftKeys() +{ + CCoeAppUi* appui = CEikonEnv::Static()->AppUi(); + CAknAppUi* aknAppUi = static_cast (appui); + CEikButtonGroupContainer* nativeContainer = aknAppUi->Cba(); + nativeContainer->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY_WITH_IDS); + if (softKeyStack.isEmpty()) + return; + + const QSoftkeySet top = softKeyStack.top(); + mapSoftKeys(top); + + for (int index = 0; index < top.count(); index++) { + const QSoftKeyAction* softKeyAction = top.at(index); + HBufC* text = qt_QString2HBufCNewL(softKeyAction->text()); + CleanupStack::PushL(text); + if (softKeyAction->role() == QSoftKeyAction::Menu) { + nativeContainer->SetCommandL(softKeyAction->nativePosition(), EAknSoftkeyOptions, *text); + } else { + nativeContainer->SetCommandL(softKeyAction->nativePosition(), SOFTKEYSTART + softKeyAction->qtContextKey(), *text); + } + CleanupStack::PopAndDestroy(); + } +} + + diff --git a/src/gui/softkeys/softkeys.pro b/src/gui/softkeys/softkeys.pro index 88a813e..6bb584e 100644 --- a/src/gui/softkeys/softkeys.pro +++ b/src/gui/softkeys/softkeys.pro @@ -3,11 +3,13 @@ TARGET = softkeys HEADERS += \ qsoftkeystack.h \ + qsoftkeystack_p.h \ qsoftkeyaction.h SOURCES += \ main.cpp \ qsoftkeyaction.cpp \ + qsoftkeystack_s60.cpp \ qsoftkeystack.cpp iCONFIG += qt debug warn_on -- cgit v0.12 From 282a724b26b734aa4d9406567f5ec4ca96e8c320 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 12 May 2009 18:49:38 +0200 Subject: Removed redundancies --- src/gui/softkeys/softkeys.pro | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/gui/softkeys/softkeys.pro b/src/gui/softkeys/softkeys.pro index 6bb584e..e9e700c 100644 --- a/src/gui/softkeys/softkeys.pro +++ b/src/gui/softkeys/softkeys.pro @@ -1,6 +1,3 @@ -TEMPLATE = app -TARGET = softkeys - HEADERS += \ qsoftkeystack.h \ qsoftkeystack_p.h \ @@ -11,5 +8,3 @@ SOURCES += \ qsoftkeyaction.cpp \ qsoftkeystack_s60.cpp \ qsoftkeystack.cpp - -iCONFIG += qt debug warn_on -- cgit v0.12 From 10a294b71d0ccaddb48b1396352a744fdd0de6bf Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 12 May 2009 19:57:13 +0200 Subject: Moved SoftkeyStack files into src/widgets Corrected PImpl-ing and cleaned up headers --- src/gui/softkeys/qsoftkeyaction.cpp | 191 ------------------------------- src/gui/softkeys/qsoftkeyaction.h | 96 ---------------- src/gui/softkeys/qsoftkeystack.cpp | 100 ----------------- src/gui/softkeys/qsoftkeystack.h | 74 ------------ src/gui/softkeys/qsoftkeystack_p.h | 86 -------------- src/gui/softkeys/qsoftkeystack_s60.cpp | 100 ----------------- src/gui/widgets/qsoftkeyaction.cpp | 198 +++++++++++++++++++++++++++++++++ src/gui/widgets/qsoftkeyaction.h | 101 +++++++++++++++++ src/gui/widgets/qsoftkeystack.cpp | 102 +++++++++++++++++ src/gui/widgets/qsoftkeystack.h | 75 +++++++++++++ src/gui/widgets/qsoftkeystack_p.h | 86 ++++++++++++++ src/gui/widgets/qsoftkeystack_s60.cpp | 100 +++++++++++++++++ 12 files changed, 662 insertions(+), 647 deletions(-) delete mode 100644 src/gui/softkeys/qsoftkeyaction.cpp delete mode 100644 src/gui/softkeys/qsoftkeyaction.h delete mode 100644 src/gui/softkeys/qsoftkeystack.cpp delete mode 100644 src/gui/softkeys/qsoftkeystack.h delete mode 100644 src/gui/softkeys/qsoftkeystack_p.h delete mode 100644 src/gui/softkeys/qsoftkeystack_s60.cpp create mode 100644 src/gui/widgets/qsoftkeyaction.cpp create mode 100644 src/gui/widgets/qsoftkeyaction.h create mode 100644 src/gui/widgets/qsoftkeystack.cpp create mode 100644 src/gui/widgets/qsoftkeystack.h create mode 100644 src/gui/widgets/qsoftkeystack_p.h create mode 100644 src/gui/widgets/qsoftkeystack_s60.cpp diff --git a/src/gui/softkeys/qsoftkeyaction.cpp b/src/gui/softkeys/qsoftkeyaction.cpp deleted file mode 100644 index 1d21376..0000000 --- a/src/gui/softkeys/qsoftkeyaction.cpp +++ /dev/null @@ -1,191 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qsoftkeyaction.h" - -/*! - \class QSoftKeyAction - \brief The QSoftKeyAction class defines a special kind of QAction that may also be displayed in a QSoftKeyBar. -*/ - -class QSoftKeyActionPrivate -{ -public: - QSoftKeyActionPrivate(QSoftKeyAction::StandardRole role = QSoftKeyAction::Custom) - { - this->role = role; - } - - QSoftKeyAction::StandardRole role; - QString roleName; - int nativePosition; - int qtContextKey; -}; - -/*! - \enum QSoftKeyAction::StandardRole - This enum defines the standard role for a QSoftKeyAction. - - \value Options - \value Select - \value Back - \value Next - \value Previous - \value Ok - \value Cancel - \value Edit - \value View - \value BackSpace - \value EndEdit - \value RevertEdit - \value Deselect - \value Finish - \value Custom -*/ - -QSoftKeyAction::QSoftKeyAction(QObject *parent) - : QAction(parent) -{ - d = new QSoftKeyActionPrivate(); -} - -QSoftKeyAction::QSoftKeyAction(StandardRole role, QObject *parent) - : QAction(parent) -{ - d = new QSoftKeyActionPrivate(role); -} - -QSoftKeyAction::QSoftKeyAction(const QString &text, QObject* parent) - : QAction(text, parent) -{ - d = new QSoftKeyActionPrivate(); -} - -QSoftKeyAction::QSoftKeyAction(StandardRole role, const QString &text, QObject* parent) - : QAction(text, parent) -{ - d = new QSoftKeyActionPrivate(role); -} - -QSoftKeyAction::QSoftKeyAction(const QIcon &icon, const QString &text, QObject* parent) - : QAction(icon, text, parent) -{ - d = new QSoftKeyActionPrivate(); -} - -QSoftKeyAction::QSoftKeyAction(StandardRole role, const QIcon &icon, const QString &text, QObject* parent) - : QAction(icon, text, parent) -{ - d = new QSoftKeyActionPrivate(role); -} - -QSoftKeyAction::~QSoftKeyAction() -{ - delete d; -} - -/*! - Returns the standard role associated with this action, or Custom - if the role is defined by roleName(). - - \sa setRole(), roleName() -*/ -QSoftKeyAction::StandardRole QSoftKeyAction::role() const -{ - return d->role; -} - -/*! - Returns the custom role name if role() is Custom, or an empty - string otherwise. - - \sa role(), setRole() -*/ -QString QSoftKeyAction::roleName() const -{ - return d->roleName; -} - -/*! - Sets the standard role associated with this action to \a role, - and also sets roleName() to the empty string. - - \sa role(), roleName() -*/ -void QSoftKeyAction::setRole(StandardRole role) -{ - d->role = role; - d->roleName = QString(); - emit changed(); -} - -/*! - Sets the custom roleName() associated with this action to \a role, - and also sets role() to Custom. - - \sa role(), roleName() -*/ -void QSoftKeyAction::setRole(const QString& role) -{ - d->role = QSoftKeyAction::Custom; - d->roleName = role; - emit changed(); -} - -int QSoftKeyAction::nativePosition() const -{ - return d->nativePosition; -} - -void QSoftKeyAction::setNativePosition(int position) -{ - d->nativePosition = position; -} - -int QSoftKeyAction::qtContextKey() const -{ - return d->qtContextKey; -} - -void QSoftKeyAction::setQtContextKey(int key) -{ - d->qtContextKey = key; -} diff --git a/src/gui/softkeys/qsoftkeyaction.h b/src/gui/softkeys/qsoftkeyaction.h deleted file mode 100644 index e735376..0000000 --- a/src/gui/softkeys/qsoftkeyaction.h +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QSOFTKEYACTION_H -#define QSOFTKEYACTION_H - -#include "QtGui/qaction.h" - -QT_BEGIN_NAMESPACE - -class QSoftKeyActionPrivate; - -class QSoftKeyAction : public QAction -{ -public: - enum StandardRole { - Options, - Select, - Back, - Next, - Previous, - Ok, - Cancel, - Edit, - View, - BackSpace, - EndEdit, - RevertEdit, - Deselect, - Finish, - Menu, - Custom - }; - - QSoftKeyAction(QObject *parent); - QSoftKeyAction(StandardRole role, QObject *parent); - QSoftKeyAction(const QString &text, QObject* parent); - QSoftKeyAction(StandardRole role, const QString &text, QObject* parent); - QSoftKeyAction(const QIcon &icon, const QString &text, QObject* parent); - QSoftKeyAction(StandardRole role, const QIcon &icon, const QString &text, QObject* parent); - ~QSoftKeyAction(); - - StandardRole role() const; - QString roleName() const; - - void setRole(StandardRole role); - void setRole(const QString& role); - int nativePosition() const; - void setNativePosition(int position); - int qtContextKey() const; - void setQtContextKey(int position); - - QSoftKeyActionPrivate *d; -}; - -QT_END_NAMESPACE - -#endif // QSOFTKEYACTION_H diff --git a/src/gui/softkeys/qsoftkeystack.cpp b/src/gui/softkeys/qsoftkeystack.cpp deleted file mode 100644 index a8bd3a9..0000000 --- a/src/gui/softkeys/qsoftkeystack.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qsoftkeystack.h" -#include "qsoftkeystack_p.h" - -QSoftKeyStackPrivate::QSoftKeyStackPrivate() -{ - -} - -QSoftKeyStackPrivate::~QSoftKeyStackPrivate() -{ - -} - -void QSoftKeyStackPrivate::push(QSoftKeyAction *softKey) -{ - QSoftkeySet softKeySet; - softKeySet.append(softKey); - softKeyStack.push(softKeySet); - setNativeSoftKeys(); - -} -void QSoftKeyStackPrivate::push(const QList &softkeys) -{ - QSoftkeySet softKeySet(softkeys); - softKeyStack.push(softKeySet); - setNativeSoftKeys(); -} - -void QSoftKeyStackPrivate::pop() -{ - softKeyStack.pop(); - setNativeSoftKeys(); -} - -QSoftKeyStack::QSoftKeyStack(QWidget *parent) -{ - d = new QSoftKeyStackPrivate(); -} - -QSoftKeyStack::~QSoftKeyStack() -{ - delete d; -} - -void QSoftKeyStack::push(QSoftKeyAction *softKey) -{ - d->push(softKey); -} - -void QSoftKeyStack::push(const QList &softKeys) -{ - d->push(softKeys); -} - -void QSoftKeyStack::pop() -{ - d->pop(); -} - diff --git a/src/gui/softkeys/qsoftkeystack.h b/src/gui/softkeys/qsoftkeystack.h deleted file mode 100644 index 90df43d..0000000 --- a/src/gui/softkeys/qsoftkeystack.h +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QSOFTKEYSTACK_H -#define QSOFTKEYSTACK_H - -#include "QtGui/qwidget.h" -#include "QtGui/qaction.h" -#include "qstack.h" - -#include "qsoftkeyaction.h" - -QT_BEGIN_NAMESPACE - -#define QSoftkeySet QList - -class QSoftKeyStackPrivate; - -class QSoftKeyStack : public QObject -{ -public: - QSoftKeyStack(QWidget *parent); - ~QSoftKeyStack(); - -public: - void push(QSoftKeyAction *softKey); - void push(const QList &softkeys); - void pop(); - -private: - QSoftKeyStackPrivate *d; -}; - -QT_END_NAMESPACE - -#endif // QSOFTKEYSTACK_H diff --git a/src/gui/softkeys/qsoftkeystack_p.h b/src/gui/softkeys/qsoftkeystack_p.h deleted file mode 100644 index 8e029af..0000000 --- a/src/gui/softkeys/qsoftkeystack_p.h +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QSOFTKEYSTACK_P_H -#define QSOFTKEYSTACK_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "QtGui/qwidget.h" -#include "QtGui/qaction.h" -#include "qstack.h" - -#include "qsoftkeyaction.h" - -QT_BEGIN_NAMESPACE - -#define QSoftkeySet QList - -class QSoftKeyStackPrivate : public QObject -{ -public: - QSoftKeyStackPrivate(); - ~QSoftKeyStackPrivate(); - - void push(QSoftKeyAction *softKey); - void push(const QList &softKeys); - void pop(); - -private: - void mapSoftKeys(const QSoftkeySet &top); - void setNativeSoftKeys(); - -private: - QStack softKeyStack; -}; - -QT_END_NAMESPACE - -#endif // QSOFTKEYSTACK_P_H diff --git a/src/gui/softkeys/qsoftkeystack_s60.cpp b/src/gui/softkeys/qsoftkeystack_s60.cpp deleted file mode 100644 index ce4f116..0000000 --- a/src/gui/softkeys/qsoftkeystack_s60.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include -#include -#include - -#include "private/qcore_symbian_p.h" - -#include "qsoftkeystack_p.h" - -#define SOFTKEYSTART 5000 -#define SOFTKEYEND (5000 + Qt::Key_Context4) - -void QSoftKeyStackPrivate::mapSoftKeys(const QSoftkeySet &top) -{ - if (top.count() == 1) { - top.at(0)->setNativePosition(2); - top.at(0)->setQtContextKey(Qt::Key_Context2); - } - else { - // FIX THIS - // veryWeirdMagic is needes as s60 5th edition sdk always panics if cba is set with index 1, this hops over it - // This needs further investigation why so that the hack can be removed - int veryWeirdMagic = 0; - for (int index = 0; index < top.count(); index++) { - top.at(index)->setNativePosition(index + veryWeirdMagic); - top.at(index)->setQtContextKey(Qt::Key_Context1 + index); - if (veryWeirdMagic == 0) - veryWeirdMagic = 1; - } - } -} - -void QSoftKeyStackPrivate::setNativeSoftKeys() -{ - CCoeAppUi* appui = CEikonEnv::Static()->AppUi(); - CAknAppUi* aknAppUi = static_cast (appui); - CEikButtonGroupContainer* nativeContainer = aknAppUi->Cba(); - nativeContainer->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY_WITH_IDS); - if (softKeyStack.isEmpty()) - return; - - const QSoftkeySet top = softKeyStack.top(); - mapSoftKeys(top); - - for (int index = 0; index < top.count(); index++) { - const QSoftKeyAction* softKeyAction = top.at(index); - HBufC* text = qt_QString2HBufCNewL(softKeyAction->text()); - CleanupStack::PushL(text); - if (softKeyAction->role() == QSoftKeyAction::Menu) { - nativeContainer->SetCommandL(softKeyAction->nativePosition(), EAknSoftkeyOptions, *text); - } else { - nativeContainer->SetCommandL(softKeyAction->nativePosition(), SOFTKEYSTART + softKeyAction->qtContextKey(), *text); - } - CleanupStack::PopAndDestroy(); - } -} - - diff --git a/src/gui/widgets/qsoftkeyaction.cpp b/src/gui/widgets/qsoftkeyaction.cpp new file mode 100644 index 0000000..51b80bc --- /dev/null +++ b/src/gui/widgets/qsoftkeyaction.cpp @@ -0,0 +1,198 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qsoftkeyaction.h" + +/*! + \class QSoftKeyAction + \brief The QSoftKeyAction class defines a special kind of QAction that may also be displayed in a QSoftKeyBar. +*/ + +class QSoftKeyActionPrivate +{ +public: + QSoftKeyActionPrivate(QSoftKeyAction::StandardRole role = QSoftKeyAction::Custom) + { + this->role = role; + } + + QSoftKeyAction::StandardRole role; + QString roleName; + int nativePosition; + int qtContextKey; +}; + +/*! + \enum QSoftKeyAction::StandardRole + This enum defines the standard role for a QSoftKeyAction. + + \value Options + \value Select + \value Back + \value Next + \value Previous + \value Ok + \value Cancel + \value Edit + \value View + \value BackSpace + \value EndEdit + \value RevertEdit + \value Deselect + \value Finish + \value Custom +*/ + +QSoftKeyAction::QSoftKeyAction(QObject *parent) + : QAction(parent) +{ +} + +QSoftKeyAction::QSoftKeyAction(StandardRole role, QObject *parent) + : QAction(parent) +{ + Q_D(QSoftKeyAction); + d->role = role; +} + +QSoftKeyAction::QSoftKeyAction(const QString &text, QObject* parent) + : QAction(text, parent) +{ +} + +QSoftKeyAction::QSoftKeyAction(StandardRole role, const QString &text, QObject* parent) + : QAction(text, parent) +{ + Q_D(QSoftKeyAction); + d->role = role; +} + +QSoftKeyAction::QSoftKeyAction(const QIcon &icon, const QString &text, QObject* parent) + : QAction(icon, text, parent) +{ +} + +QSoftKeyAction::QSoftKeyAction(StandardRole role, const QIcon &icon, const QString &text, QObject* parent) + : QAction(icon, text, parent) +{ + Q_D(QSoftKeyAction); + d->role = role; +} + +QSoftKeyAction::~QSoftKeyAction() +{ +} + +/*! + Returns the standard role associated with this action, or Custom + if the role is defined by roleName(). + + \sa setRole(), roleName() +*/ +QSoftKeyAction::StandardRole QSoftKeyAction::role() const +{ + Q_D(const QSoftKeyAction); + return d->role; +} + +/*! + Returns the custom role name if role() is Custom, or an empty + string otherwise. + + \sa role(), setRole() +*/ +QString QSoftKeyAction::roleName() const +{ + Q_D(const QSoftKeyAction); + return d->roleName; +} + +/*! + Sets the standard role associated with this action to \a role, + and also sets roleName() to the empty string. + + \sa role(), roleName() +*/ +void QSoftKeyAction::setRole(StandardRole role) +{ + Q_D(QSoftKeyAction); + d->role = role; + d->roleName = QString(); + emit changed(); +} + +/*! + Sets the custom roleName() associated with this action to \a role, + and also sets role() to Custom. + + \sa role(), roleName() +*/ +void QSoftKeyAction::setRole(const QString& role) +{ + Q_D(QSoftKeyAction); + d->role = Custom; + d->roleName = role; + emit changed(); +} + +int QSoftKeyAction::nativePosition() const +{ + Q_D(const QSoftKeyAction); + return d->nativePosition; +} + +void QSoftKeyAction::setNativePosition(int position) +{ + Q_D(QSoftKeyAction); + d->nativePosition = position; +} + +int QSoftKeyAction::qtContextKey() const +{ + Q_D(const QSoftKeyAction); + return d->qtContextKey; +} + +void QSoftKeyAction::setQtContextKey(int key) +{ + Q_D(QSoftKeyAction); + d->qtContextKey = key; +} diff --git a/src/gui/widgets/qsoftkeyaction.h b/src/gui/widgets/qsoftkeyaction.h new file mode 100644 index 0000000..fc5baf1 --- /dev/null +++ b/src/gui/widgets/qsoftkeyaction.h @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QSOFTKEYACTION_H +#define QSOFTKEYACTION_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +class QSoftKeyActionPrivate; + +class Q_GUI_EXPORT QSoftKeyAction : public QAction +{ + Q_DECLARE_PRIVATE(QSoftKeyAction) +public: + enum StandardRole { + Options, + Select, + Back, + Next, + Previous, + Ok, + Cancel, + Edit, + View, + BackSpace, + EndEdit, + RevertEdit, + Deselect, + Finish, + Menu, + Custom + }; + + QSoftKeyAction(QObject *parent); + QSoftKeyAction(StandardRole role, QObject *parent); + QSoftKeyAction(const QString &text, QObject *parent); + QSoftKeyAction(StandardRole role, const QString &text, QObject *parent); + QSoftKeyAction(const QIcon &icon, const QString &text, QObject *parent); + QSoftKeyAction(StandardRole role, const QIcon &icon, const QString &text, QObject *parent); + ~QSoftKeyAction(); + + StandardRole role() const; + QString roleName() const; + + void setRole(StandardRole role); + void setRole(const QString &role); + int nativePosition() const; + void setNativePosition(int position); + int qtContextKey() const; + void setQtContextKey(int position); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QSOFTKEYACTION_H diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp new file mode 100644 index 0000000..1054852 --- /dev/null +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -0,0 +1,102 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qsoftkeystack.h" +#include "qsoftkeystack_p.h" + +QSoftKeyStackPrivate::QSoftKeyStackPrivate() +{ + +} + +QSoftKeyStackPrivate::~QSoftKeyStackPrivate() +{ + +} + +void QSoftKeyStackPrivate::push(QSoftKeyAction *softKey) +{ + QSoftkeySet softKeySet; + softKeySet.append(softKey); + softKeyStack.push(softKeySet); + setNativeSoftKeys(); + +} +void QSoftKeyStackPrivate::push(const QList &softkeys) +{ + QSoftkeySet softKeySet(softkeys); + softKeyStack.push(softKeySet); + setNativeSoftKeys(); +} + +void QSoftKeyStackPrivate::pop() +{ + softKeyStack.pop(); + setNativeSoftKeys(); +} + +QSoftKeyStack::QSoftKeyStack(QWidget *parent) + : QObject(parent) +{ +} + +QSoftKeyStack::~QSoftKeyStack() +{ +} + +void QSoftKeyStack::push(QSoftKeyAction *softKey) +{ + Q_D(QSoftKeyStack); + d->push(softKey); +} + +void QSoftKeyStack::push(const QList &softKeys) +{ + Q_D(QSoftKeyStack); + d->push(softKeys); +} + +void QSoftKeyStack::pop() +{ + Q_D(QSoftKeyStack); + d->pop(); +} + diff --git a/src/gui/widgets/qsoftkeystack.h b/src/gui/widgets/qsoftkeystack.h new file mode 100644 index 0000000..a9137d2 --- /dev/null +++ b/src/gui/widgets/qsoftkeystack.h @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QSOFTKEYSTACK_H +#define QSOFTKEYSTACK_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#define QSoftkeySet QList + +class QSoftKeyStackPrivate; +class QSoftKeyAction; + +class Q_GUI_EXPORT QSoftKeyStack : public QObject +{ + Q_DECLARE_PRIVATE(QSoftKeyStack) +public: + QSoftKeyStack(QWidget *parent); + ~QSoftKeyStack(); + +public: + void push(QSoftKeyAction *softKey); + void push(const QList &softkeys); + void pop(); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QSOFTKEYSTACK_H diff --git a/src/gui/widgets/qsoftkeystack_p.h b/src/gui/widgets/qsoftkeystack_p.h new file mode 100644 index 0000000..2e3fde1 --- /dev/null +++ b/src/gui/widgets/qsoftkeystack_p.h @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QSOFTKEYSTACK_P_H +#define QSOFTKEYSTACK_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "QtGui/qwidget.h" +#include "QtGui/qaction.h" +#include "qstack.h" + +#include "qsoftkeyaction.h" + +QT_BEGIN_NAMESPACE + +#define QSoftkeySet QList + +class QSoftKeyStackPrivate : public QObject +{ +public: + QSoftKeyStackPrivate(); + ~QSoftKeyStackPrivate(); + + void push(QSoftKeyAction *softKey); + void push(const QList &softKeys); + void pop(); + +private: + void mapSoftKeys(const QSoftkeySet &top); + void setNativeSoftKeys(); + +private: + QStack softKeyStack; +}; + +QT_END_NAMESPACE + +#endif // QSOFTKEYSTACK_P_H diff --git a/src/gui/widgets/qsoftkeystack_s60.cpp b/src/gui/widgets/qsoftkeystack_s60.cpp new file mode 100644 index 0000000..ce4f116 --- /dev/null +++ b/src/gui/widgets/qsoftkeystack_s60.cpp @@ -0,0 +1,100 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include +#include + +#include "private/qcore_symbian_p.h" + +#include "qsoftkeystack_p.h" + +#define SOFTKEYSTART 5000 +#define SOFTKEYEND (5000 + Qt::Key_Context4) + +void QSoftKeyStackPrivate::mapSoftKeys(const QSoftkeySet &top) +{ + if (top.count() == 1) { + top.at(0)->setNativePosition(2); + top.at(0)->setQtContextKey(Qt::Key_Context2); + } + else { + // FIX THIS + // veryWeirdMagic is needes as s60 5th edition sdk always panics if cba is set with index 1, this hops over it + // This needs further investigation why so that the hack can be removed + int veryWeirdMagic = 0; + for (int index = 0; index < top.count(); index++) { + top.at(index)->setNativePosition(index + veryWeirdMagic); + top.at(index)->setQtContextKey(Qt::Key_Context1 + index); + if (veryWeirdMagic == 0) + veryWeirdMagic = 1; + } + } +} + +void QSoftKeyStackPrivate::setNativeSoftKeys() +{ + CCoeAppUi* appui = CEikonEnv::Static()->AppUi(); + CAknAppUi* aknAppUi = static_cast (appui); + CEikButtonGroupContainer* nativeContainer = aknAppUi->Cba(); + nativeContainer->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY_WITH_IDS); + if (softKeyStack.isEmpty()) + return; + + const QSoftkeySet top = softKeyStack.top(); + mapSoftKeys(top); + + for (int index = 0; index < top.count(); index++) { + const QSoftKeyAction* softKeyAction = top.at(index); + HBufC* text = qt_QString2HBufCNewL(softKeyAction->text()); + CleanupStack::PushL(text); + if (softKeyAction->role() == QSoftKeyAction::Menu) { + nativeContainer->SetCommandL(softKeyAction->nativePosition(), EAknSoftkeyOptions, *text); + } else { + nativeContainer->SetCommandL(softKeyAction->nativePosition(), SOFTKEYSTART + softKeyAction->qtContextKey(), *text); + } + CleanupStack::PopAndDestroy(); + } +} + + -- cgit v0.12 From f8de827f56c6548490681fd3b5c252853f6fffb6 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 12 May 2009 21:14:49 +0200 Subject: Adapted example code --- src/gui/softkeys/main.cpp | 6 +----- src/gui/softkeys/softkeys.pro | 10 +--------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/gui/softkeys/main.cpp b/src/gui/softkeys/main.cpp index a61e512..c305d19 100644 --- a/src/gui/softkeys/main.cpp +++ b/src/gui/softkeys/main.cpp @@ -9,11 +9,7 @@ ** ****************************************************************************/ -#include -#include -#include - -#include "qsoftkeystack.h" +#include class MainWindow : public QMainWindow { diff --git a/src/gui/softkeys/softkeys.pro b/src/gui/softkeys/softkeys.pro index e9e700c..a16103e 100644 --- a/src/gui/softkeys/softkeys.pro +++ b/src/gui/softkeys/softkeys.pro @@ -1,10 +1,2 @@ -HEADERS += \ - qsoftkeystack.h \ - qsoftkeystack_p.h \ - qsoftkeyaction.h - SOURCES += \ - main.cpp \ - qsoftkeyaction.cpp \ - qsoftkeystack_s60.cpp \ - qsoftkeystack.cpp + main.cpp -- cgit v0.12 From a32fa3b48f2e58b409e27a465e99f5ef915ed3ed Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 12 May 2009 21:15:46 +0200 Subject: Adding qsoftkey* to widgets.pri. Currently, only for S60. It will spread as soon as it builds cross platform. --- src/gui/widgets/widgets.pri | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gui/widgets/widgets.pri b/src/gui/widgets/widgets.pri index fc57944..c9e68a1 100644 --- a/src/gui/widgets/widgets.pri +++ b/src/gui/widgets/widgets.pri @@ -162,5 +162,14 @@ wince*: { } symbian*: { - SOURCES += widgets/qmenu_symbian.cpp + HEADERS += \ + widgets/qsoftkeyaction.h \ + widgets/qsoftkeystack.h \ + widgets/qsoftkeystack_p.h + + SOURCES += \ + widgets/qmenu_symbian.cpp \ + widgets/qsoftkeyaction.cpp \ + widgets/qsoftkeystack.cpp \ + widgets/qsoftkeystack_s60.cpp } -- cgit v0.12 From af612206adc919e3c13b7856f9f7c020ef9c3a7b Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 13 May 2009 14:52:25 +0200 Subject: Fixed pImpl, the private object were not created. --- src/gui/widgets/qsoftkeyaction.cpp | 21 ++++++++++++++------- src/gui/widgets/qsoftkeyaction.h | 5 ++++- src/gui/widgets/qsoftkeystack.cpp | 2 +- src/gui/widgets/qsoftkeystack.h | 6 ++++-- src/gui/widgets/qsoftkeystack_p.h | 6 +++--- 5 files changed, 26 insertions(+), 14 deletions(-) diff --git a/src/gui/widgets/qsoftkeyaction.cpp b/src/gui/widgets/qsoftkeyaction.cpp index 51b80bc..583cf65 100644 --- a/src/gui/widgets/qsoftkeyaction.cpp +++ b/src/gui/widgets/qsoftkeyaction.cpp @@ -40,13 +40,14 @@ ****************************************************************************/ #include "qsoftkeyaction.h" +#include /*! \class QSoftKeyAction \brief The QSoftKeyAction class defines a special kind of QAction that may also be displayed in a QSoftKeyBar. */ -class QSoftKeyActionPrivate +class QSoftKeyActionPrivate : public QActionPrivate { public: QSoftKeyActionPrivate(QSoftKeyAction::StandardRole role = QSoftKeyAction::Custom) @@ -82,37 +83,43 @@ public: */ QSoftKeyAction::QSoftKeyAction(QObject *parent) - : QAction(parent) + : QAction(*new QSoftKeyActionPrivate(), parent) { } QSoftKeyAction::QSoftKeyAction(StandardRole role, QObject *parent) - : QAction(parent) + : QAction(*new QSoftKeyActionPrivate(), parent) { Q_D(QSoftKeyAction); d->role = role; } QSoftKeyAction::QSoftKeyAction(const QString &text, QObject* parent) - : QAction(text, parent) + : QAction(*new QSoftKeyActionPrivate(), parent) { + setText(text); } QSoftKeyAction::QSoftKeyAction(StandardRole role, const QString &text, QObject* parent) - : QAction(text, parent) + : QAction(*new QSoftKeyActionPrivate(), parent) { + setText(text); Q_D(QSoftKeyAction); d->role = role; } QSoftKeyAction::QSoftKeyAction(const QIcon &icon, const QString &text, QObject* parent) - : QAction(icon, text, parent) + : QAction(*new QSoftKeyActionPrivate(), parent) { + setIcon(icon); + setText(text); } QSoftKeyAction::QSoftKeyAction(StandardRole role, const QIcon &icon, const QString &text, QObject* parent) - : QAction(icon, text, parent) + : QAction(*new QSoftKeyActionPrivate(), parent) { + setIcon(icon); + setText(text); Q_D(QSoftKeyAction); d->role = role; } diff --git a/src/gui/widgets/qsoftkeyaction.h b/src/gui/widgets/qsoftkeyaction.h index fc5baf1..26fa601 100644 --- a/src/gui/widgets/qsoftkeyaction.h +++ b/src/gui/widgets/qsoftkeyaction.h @@ -54,7 +54,6 @@ class QSoftKeyActionPrivate; class Q_GUI_EXPORT QSoftKeyAction : public QAction { - Q_DECLARE_PRIVATE(QSoftKeyAction) public: enum StandardRole { Options, @@ -92,6 +91,10 @@ public: void setNativePosition(int position); int qtContextKey() const; void setQtContextKey(int position); + +private: + Q_DECLARE_PRIVATE(QSoftKeyAction) + Q_DISABLE_COPY(QSoftKeyAction) }; QT_END_NAMESPACE diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index 1054852..687b236 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -74,7 +74,7 @@ void QSoftKeyStackPrivate::pop() } QSoftKeyStack::QSoftKeyStack(QWidget *parent) - : QObject(parent) + : QObject(*new QSoftKeyStackPrivate, parent) { } diff --git a/src/gui/widgets/qsoftkeystack.h b/src/gui/widgets/qsoftkeystack.h index a9137d2..66edab0 100644 --- a/src/gui/widgets/qsoftkeystack.h +++ b/src/gui/widgets/qsoftkeystack.h @@ -57,15 +57,17 @@ class QSoftKeyAction; class Q_GUI_EXPORT QSoftKeyStack : public QObject { - Q_DECLARE_PRIVATE(QSoftKeyStack) public: QSoftKeyStack(QWidget *parent); ~QSoftKeyStack(); -public: void push(QSoftKeyAction *softKey); void push(const QList &softkeys); void pop(); + +private: + Q_DECLARE_PRIVATE(QSoftKeyStack) + Q_DISABLE_COPY(QSoftKeyStack) }; QT_END_NAMESPACE diff --git a/src/gui/widgets/qsoftkeystack_p.h b/src/gui/widgets/qsoftkeystack_p.h index 2e3fde1..1e8d0d1 100644 --- a/src/gui/widgets/qsoftkeystack_p.h +++ b/src/gui/widgets/qsoftkeystack_p.h @@ -53,9 +53,9 @@ // We mean it. // -#include "QtGui/qwidget.h" -#include "QtGui/qaction.h" + #include "qstack.h" +#include #include "qsoftkeyaction.h" @@ -63,7 +63,7 @@ QT_BEGIN_NAMESPACE #define QSoftkeySet QList -class QSoftKeyStackPrivate : public QObject +class QSoftKeyStackPrivate : public QObjectPrivate { public: QSoftKeyStackPrivate(); -- cgit v0.12 From a28a4bccad5d885bf3ac5f58a8febb8d59fffe0f Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Wed, 13 May 2009 16:25:24 +0200 Subject: Added Methods to set and access QSoftKeyStack from QMainWindow. --- src/gui/softkeys/main.cpp | 8 ++++++ src/gui/widgets/qmainwindow.cpp | 47 +++++++++++++++++++++++++++++++++++ src/gui/widgets/qmainwindow.h | 11 ++++++-- src/gui/widgets/qsoftkeyaction.h | 1 + src/gui/widgets/qsoftkeystack_s60.cpp | 17 +++++++------ 5 files changed, 75 insertions(+), 9 deletions(-) diff --git a/src/gui/softkeys/main.cpp b/src/gui/softkeys/main.cpp index c305d19..6a75c40 100644 --- a/src/gui/softkeys/main.cpp +++ b/src/gui/softkeys/main.cpp @@ -30,6 +30,8 @@ MainWindow::MainWindow(QWidget *parent) this->setMenuBar(menuBar); QSoftKeyStack *stack = new QSoftKeyStack(central); + setSoftKeyStack(stack); + QSoftKeyAction action1(central); action1.setText(QString("Ok")); action1.setRole(QSoftKeyAction::Ok); @@ -43,6 +45,11 @@ MainWindow::MainWindow(QWidget *parent) action4.setText(QString("Menu")); action4.setRole(QSoftKeyAction::Menu); + QSoftKeyAction action5(central); + action5.setText(QString("ContextMenu")); + action5.setRole(QSoftKeyAction::ContextMenu); + + QList myActionList; myActionList.append(&action1); myActionList.append(&action2); @@ -55,6 +62,7 @@ MainWindow::MainWindow(QWidget *parent) QList myActionList2; myActionList2.append(&action4); myActionList2.append(&action1); + myActionList2.append(&action5); stack->push(myActionList2); diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index 502c1e9..43bc098 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -66,6 +66,10 @@ extern OSWindowRef qt_mac_window_for(const QWidget *); // qwidget_mac.cpp QT_END_NAMESPACE #endif +#ifndef QT_NO_SOFTKEYSTACK +#include +#endif + QT_BEGIN_NAMESPACE class QMainWindowPrivate : public QWidgetPrivate @@ -80,6 +84,9 @@ public: #if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_CURSOR) , hasOldCursor(false) , cursorAdjusted(false) #endif +#ifndef QT_NO_SOFTKEYSTACK + , softKeyStack(0) +#endif { } QMainWindowLayout *layout; QSize iconSize; @@ -99,6 +106,10 @@ public: uint hasOldCursor : 1; uint cursorAdjusted : 1; #endif + +#ifndef QT_NO_SOFTKEYSTACK + QSoftKeyStack* softKeyStack; +#endif }; void QMainWindowPrivate::init() @@ -514,6 +525,42 @@ void QMainWindow::setMenuWidget(QWidget *menuBar) } #endif // QT_NO_MENUBAR +#ifndef QT_NO_SOFTKEYSTACK +/*! + Returns the softkey stack for the main window. This function creates + and returns an empty soft key stack if the stack does not exist. + + \sa softKeyStack() +*/ +QSoftKeyStack *QMainWindow::softKeyStack() const +{ + if (!d_func()->softKeyStack) { + QMainWindow *self = const_cast(this); + QSoftKeyStack* softKeyStack = new QSoftKeyStack(self); + self->setSoftKeyStack(softKeyStack); + } + return d_func()->softKeyStack; +} + +/*! + Sets the softkey stackfor the main window to \a softKeyStack. + + Note: QMainWindow takes ownership of the \a softKeyStack pointer and + deletes it at the appropriate time. + + \sa softKeyStack() +*/ +void QMainWindow::setSoftKeyStack(QSoftKeyStack *softKeyStack) +{ + Q_D(QMainWindow); + if (d->softKeyStack && d->softKeyStack != softKeyStack) { + QSoftKeyStack *oldSoftKeyStack = d->softKeyStack; + delete oldSoftKeyStack; + } + d->softKeyStack = softKeyStack; +} +#endif // QT_NO_SOFTKEYSTACK + #ifndef QT_NO_STATUSBAR /*! Returns the status bar for the main window. This function creates diff --git a/src/gui/widgets/qmainwindow.h b/src/gui/widgets/qmainwindow.h index 9983c7a..e2dcd5e 100644 --- a/src/gui/widgets/qmainwindow.h +++ b/src/gui/widgets/qmainwindow.h @@ -59,7 +59,9 @@ class QMenuBar; class QStatusBar; class QToolBar; class QMenu; - +#ifndef QT_NO_SOFTKEYSTACK +class QSoftKeyStack; +#endif class Q_GUI_EXPORT QMainWindow : public QWidget { Q_OBJECT @@ -129,7 +131,12 @@ public: QWidget *menuWidget() const; void setMenuWidget(QWidget *menubar); #endif - + +#ifndef QT_NO_SOFTKEYSTACK + QSoftKeyStack *softKeyStack() const; + void setSoftKeyStack(QSoftKeyStack *softKeyStack); +#endif + #ifndef QT_NO_STATUSBAR QStatusBar *statusBar() const; void setStatusBar(QStatusBar *statusbar); diff --git a/src/gui/widgets/qsoftkeyaction.h b/src/gui/widgets/qsoftkeyaction.h index 26fa601..4ce5c5b 100644 --- a/src/gui/widgets/qsoftkeyaction.h +++ b/src/gui/widgets/qsoftkeyaction.h @@ -71,6 +71,7 @@ public: Deselect, Finish, Menu, + ContextMenu, Custom }; diff --git a/src/gui/widgets/qsoftkeystack_s60.cpp b/src/gui/widgets/qsoftkeystack_s60.cpp index ce4f116..35835f6 100644 --- a/src/gui/widgets/qsoftkeystack_s60.cpp +++ b/src/gui/widgets/qsoftkeystack_s60.cpp @@ -86,14 +86,17 @@ void QSoftKeyStackPrivate::setNativeSoftKeys() for (int index = 0; index < top.count(); index++) { const QSoftKeyAction* softKeyAction = top.at(index); - HBufC* text = qt_QString2HBufCNewL(softKeyAction->text()); - CleanupStack::PushL(text); - if (softKeyAction->role() == QSoftKeyAction::Menu) { - nativeContainer->SetCommandL(softKeyAction->nativePosition(), EAknSoftkeyOptions, *text); - } else { - nativeContainer->SetCommandL(softKeyAction->nativePosition(), SOFTKEYSTART + softKeyAction->qtContextKey(), *text); + if (softKeyAction->role() != QSoftKeyAction::ContextMenu) { + + HBufC* text = qt_QString2HBufCNewL(softKeyAction->text()); + CleanupStack::PushL(text); + if (softKeyAction->role() == QSoftKeyAction::Menu) { + nativeContainer->SetCommandL(softKeyAction->nativePosition(), EAknSoftkeyOptions, *text); + } else { + nativeContainer->SetCommandL(softKeyAction->nativePosition(), SOFTKEYSTART + softKeyAction->qtContextKey(), *text); + } + CleanupStack::PopAndDestroy(); } - CleanupStack::PopAndDestroy(); } } -- cgit v0.12 From 062e913e56a104f7d794cd4a7cecebbd33ead5a9 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 13 May 2009 19:27:24 +0200 Subject: QSoftKeyStack::handleSoftKeyPress(int command) will be called whenever a softkey is pressed. --- src/gui/widgets/qsoftkeystack.h | 2 ++ src/gui/widgets/qsoftkeystack_p.h | 5 +++++ src/gui/widgets/qsoftkeystack_s60.cpp | 9 +++++---- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/gui/widgets/qsoftkeystack.h b/src/gui/widgets/qsoftkeystack.h index 66edab0..ca06072 100644 --- a/src/gui/widgets/qsoftkeystack.h +++ b/src/gui/widgets/qsoftkeystack.h @@ -65,6 +65,8 @@ public: void push(const QList &softkeys); void pop(); + void handleSoftKeyPress(int command); + private: Q_DECLARE_PRIVATE(QSoftKeyStack) Q_DISABLE_COPY(QSoftKeyStack) diff --git a/src/gui/widgets/qsoftkeystack_p.h b/src/gui/widgets/qsoftkeystack_p.h index 1e8d0d1..77ae553 100644 --- a/src/gui/widgets/qsoftkeystack_p.h +++ b/src/gui/widgets/qsoftkeystack_p.h @@ -58,9 +58,14 @@ #include #include "qsoftkeyaction.h" +#include "qsoftkeystack.h" QT_BEGIN_NAMESPACE +// The following 2 defines may only be needed for s60. To be seen. +#define SOFTKEYSTART 5000 +#define SOFTKEYEND (5000 + Qt::Key_Context4) + #define QSoftkeySet QList class QSoftKeyStackPrivate : public QObjectPrivate diff --git a/src/gui/widgets/qsoftkeystack_s60.cpp b/src/gui/widgets/qsoftkeystack_s60.cpp index 35835f6..9e90fdf 100644 --- a/src/gui/widgets/qsoftkeystack_s60.cpp +++ b/src/gui/widgets/qsoftkeystack_s60.cpp @@ -49,9 +49,6 @@ #include "qsoftkeystack_p.h" -#define SOFTKEYSTART 5000 -#define SOFTKEYEND (5000 + Qt::Key_Context4) - void QSoftKeyStackPrivate::mapSoftKeys(const QSoftkeySet &top) { if (top.count() == 1) { @@ -100,4 +97,8 @@ void QSoftKeyStackPrivate::setNativeSoftKeys() } } - +void QSoftKeyStack::handleSoftKeyPress(int command) +{ + // Do the magic, here. + // Map the command back to actual softkey on the top of the stack and handle it +} -- cgit v0.12 From 3cd818783435ceb1314aba9a94f575ab52bd3d0f Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 13 May 2009 19:28:56 +0200 Subject: If the command is in a magic range pass it along to a currently active QMainWindow's softKeyStack. --- src/gui/kernel/qapplication_s60.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 72c2855..c0b4dc5 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -28,6 +28,9 @@ #include "private/qwindowsurface_s60_p.h" #include "qpaintengine.h" #include "qmenubar.h" +#include "qmainwindow.h" +#include "qsoftkeystack.h" +#include "private/qsoftkeystack_p.h" #include "apgwgnam.h" // For CApaWindowGroupName #include // For CMdaAudioToneUtility @@ -1019,8 +1022,14 @@ void QApplication::s60HandleCommandL(int command) qApp->exit(); break; default: - // For now assume all unknown menu items are Qt menu items - QMenuBar::symbianCommands(command); + if (command >= SOFTKEYSTART && command <= SOFTKEYEND) { + const QMainWindow *activeMainWindow = + qobject_cast(QApplication::activeWindow()); + if (activeMainWindow) + activeMainWindow->softKeyStack()->handleSoftKeyPress(command); + } else { + QMenuBar::symbianCommands(command); + } break; } } -- cgit v0.12 From b60c4838f3a40609136c45e4832b50007dc2be37 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 13 May 2009 19:29:12 +0200 Subject: Less meat. --- src/gui/kernel/qapplication_s60.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index c0b4dc5..8cf2f8f 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1017,9 +1017,8 @@ void QApplication::s60HandleCommandL(int command) { switch (command) { case EEikCmdExit: - case EAknSoftkeyBack: case EAknSoftkeyExit: - qApp->exit(); + exit(); break; default: if (command >= SOFTKEYSTART && command <= SOFTKEYEND) { -- 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 99d848f54c34aaa935d67ec406352bbafef03ae9 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Thu, 14 May 2009 21:27:30 +0200 Subject: Use the new QMainWindow::softKeyStack() --- src/gui/softkeys/main.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/gui/softkeys/main.cpp b/src/gui/softkeys/main.cpp index 6a75c40..e69156a 100644 --- a/src/gui/softkeys/main.cpp +++ b/src/gui/softkeys/main.cpp @@ -23,15 +23,16 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { - QWidget *central = new QWidget(this); + QWidget *central = new QWidget(this); + central->setLayout(new QVBoxLayout); + central->layout()->addWidget(new QPushButton); + central->layout()->addWidget(new QPushButton); + central->layout()->addWidget(new QPushButton); QMenuBar* menuBar = new QMenuBar(this); menuBar->addAction("MyMenuItem1"); this->setMenuBar(menuBar); - QSoftKeyStack *stack = new QSoftKeyStack(central); - setSoftKeyStack(stack); - QSoftKeyAction action1(central); action1.setText(QString("Ok")); action1.setRole(QSoftKeyAction::Ok); @@ -54,16 +55,16 @@ MainWindow::MainWindow(QWidget *parent) myActionList.append(&action1); myActionList.append(&action2); myActionList.append(&action3); - stack->push(myActionList); - stack->pop(); - stack->push(&action1); - stack->pop(); + softKeyStack()->push(myActionList); + softKeyStack()->pop(); + softKeyStack()->push(&action1); + softKeyStack()->pop(); QList myActionList2; myActionList2.append(&action4); myActionList2.append(&action1); myActionList2.append(&action5); - stack->push(myActionList2); + softKeyStack()->push(myActionList2); setCentralWidget(central); -- cgit v0.12 From 285ce9a19f2dd16f0aca650b52ac25daf6656b09 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Thu, 14 May 2009 21:28:30 +0200 Subject: Connecting to focusChanged in order to ask the freshly focussed widget for its actions. --- src/gui/widgets/qsoftkeystack.cpp | 26 ++++++++++++++++++++++++++ src/gui/widgets/qsoftkeystack.h | 4 ++++ 2 files changed, 30 insertions(+) diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index 687b236..61f7b64 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -41,6 +41,8 @@ #include "qsoftkeystack.h" #include "qsoftkeystack_p.h" +#include "qapplication.h" +#include "qmainwindow.h" QSoftKeyStackPrivate::QSoftKeyStackPrivate() { @@ -76,6 +78,7 @@ void QSoftKeyStackPrivate::pop() QSoftKeyStack::QSoftKeyStack(QWidget *parent) : QObject(*new QSoftKeyStackPrivate, parent) { + connect(qApp, SIGNAL(focusChanged(QWidget*, QWidget*)), SLOT(handleFocusChanged(QWidget*, QWidget*))); } QSoftKeyStack::~QSoftKeyStack() @@ -100,3 +103,26 @@ void QSoftKeyStack::pop() d->pop(); } +void QSoftKeyStack::handleFocusChanged(QWidget *old, QWidget *now) +{ + if (!now) + return; + bool nowInOurMainWindow = false; + const QMainWindow *ourMainWindow = qobject_cast(parent()); + Q_ASSERT(ourMainWindow); + + // "ourMainWindow" in parent chain of "now"? Isn't there a helper in Qt for this? + QWidget *nowParent = now; + while (nowParent = nowParent->parentWidget()) { + if (nowParent == ourMainWindow) { + nowInOurMainWindow = true; + break; + } + } + + if (!nowInOurMainWindow) + return; + + QList actions = now->actions(); + // Do something with these actions. +} diff --git a/src/gui/widgets/qsoftkeystack.h b/src/gui/widgets/qsoftkeystack.h index ca06072..d126b32 100644 --- a/src/gui/widgets/qsoftkeystack.h +++ b/src/gui/widgets/qsoftkeystack.h @@ -57,6 +57,7 @@ class QSoftKeyAction; class Q_GUI_EXPORT QSoftKeyStack : public QObject { + Q_OBJECT public: QSoftKeyStack(QWidget *parent); ~QSoftKeyStack(); @@ -67,6 +68,9 @@ public: void handleSoftKeyPress(int command); +private Q_SLOTS: + void handleFocusChanged(QWidget *old, QWidget *now); + private: Q_DECLARE_PRIVATE(QSoftKeyStack) Q_DISABLE_COPY(QSoftKeyStack) -- cgit v0.12 From c0e517977eefb579628c66716fa6bfcf5058f6b1 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Fri, 15 May 2009 12:05:37 +0200 Subject: Added method to return top of the stack --- src/gui/widgets/qsoftkeystack.cpp | 11 +++++++++++ src/gui/widgets/qsoftkeystack.h | 1 + src/gui/widgets/qsoftkeystack_p.h | 3 ++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index 61f7b64..fc6e107 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -75,6 +75,11 @@ void QSoftKeyStackPrivate::pop() setNativeSoftKeys(); } +const QSoftkeySet& QSoftKeyStackPrivate::top() +{ + return softKeyStack.top(); +} + QSoftKeyStack::QSoftKeyStack(QWidget *parent) : QObject(*new QSoftKeyStackPrivate, parent) { @@ -103,6 +108,12 @@ void QSoftKeyStack::pop() d->pop(); } +const QSoftkeySet& QSoftKeyStack::top() +{ + Q_D(QSoftKeyStack); + return d->top(); +} + void QSoftKeyStack::handleFocusChanged(QWidget *old, QWidget *now) { if (!now) diff --git a/src/gui/widgets/qsoftkeystack.h b/src/gui/widgets/qsoftkeystack.h index d126b32..c9a05c3 100644 --- a/src/gui/widgets/qsoftkeystack.h +++ b/src/gui/widgets/qsoftkeystack.h @@ -65,6 +65,7 @@ public: void push(QSoftKeyAction *softKey); void push(const QList &softkeys); void pop(); + const QSoftkeySet& top(); void handleSoftKeyPress(int command); diff --git a/src/gui/widgets/qsoftkeystack_p.h b/src/gui/widgets/qsoftkeystack_p.h index 77ae553..06e9253 100644 --- a/src/gui/widgets/qsoftkeystack_p.h +++ b/src/gui/widgets/qsoftkeystack_p.h @@ -77,7 +77,8 @@ public: void push(QSoftKeyAction *softKey); void push(const QList &softKeys); void pop(); - + const QSoftkeySet& top(); + private: void mapSoftKeys(const QSoftkeySet &top); void setNativeSoftKeys(); -- cgit v0.12 From c5417af885d7e9ff52f0b27526516dd39a788288 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Mon, 18 May 2009 10:52:17 +0200 Subject: Initial implementation for context menus --- src/gui/widgets/qmenu_symbian.cpp | 45 ++++++++++++++++++++++++++++++--------- src/gui/widgets/qmenubar_p.h | 1 + src/gui/widgets/qsoftkeyaction.h | 2 +- 3 files changed, 37 insertions(+), 11 deletions(-) diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index 1dc727c..b9633b5 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -26,7 +26,8 @@ #include #include #include - +#include +#include #ifndef QT_NO_MENUBAR QT_BEGIN_NAMESPACE @@ -47,6 +48,7 @@ struct SymbianMenuItem static QList symbianMenus; static QList nativeMenuBars; static uint qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM; +static QWidget* widgetWithContextMenu=0; bool menuExists() { @@ -177,6 +179,22 @@ static void rebuildMenu() { QMenuBarPrivate *mb = 0; QWidget *w = qApp->activeWindow(); + QMainWindow *mainWindow = qobject_cast(w); + QSoftKeyStack* softKeyStack = mainWindow->softKeyStack(); + const QSoftkeySet& softKeyTop = softKeyStack->top(); + + int index=0; + bool found=false; + while( indexrole(); + if(softAction->role() == QSoftKeyAction::ContextMenu) { + widgetWithContextMenu = softAction->parentWidget(); + found=true; + } + index++; + } if (w) { mb = menubars()->value(w); @@ -186,7 +204,8 @@ static void rebuildMenu() return; mb->symbian_menubar->rebuild(); } - } + widgetWithContextMenu = 0; +} Q_GUI_EXPORT void qt_symbian_show_toplevel( CEikMenuPane* menuPane) { @@ -358,21 +377,27 @@ void QMenuBarPrivate::QSymbianMenuBarPrivate::removeAction(QSymbianMenuAction *a rebuild(); } -void QMenuBarPrivate::QSymbianMenuBarPrivate::rebuild() +void QMenuBarPrivate::QSymbianMenuBarPrivate::InsertNativeMenuItems(const QList &actions) { - qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM; - deleteAll( &symbianMenus ); - if (!d) - return; - for (int i = 0; i < d->actions.size(); ++i) { + for (int i = 0; i action = d->actions.at(i); + symbianActionTopLevel->action = actions.at(i); symbianActionTopLevel->parent = 0; symbianActionTopLevel->command = qt_symbian_menu_static_cmd_id++; qt_symbian_insert_action(symbianActionTopLevel, &symbianMenus); - } + } } +void QMenuBarPrivate::QSymbianMenuBarPrivate::rebuild() +{ + qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM; + deleteAll( &symbianMenus ); + if (d) + InsertNativeMenuItems(d->actions); + + if (widgetWithContextMenu) + InsertNativeMenuItems(widgetWithContextMenu->actions()); + } QT_END_NAMESPACE #endif //QT_NO_MENUBAR diff --git a/src/gui/widgets/qmenubar_p.h b/src/gui/widgets/qmenubar_p.h index d562cd9..1b9bac7 100644 --- a/src/gui/widgets/qmenubar_p.h +++ b/src/gui/widgets/qmenubar_p.h @@ -257,6 +257,7 @@ public: } return 0; } + void InsertNativeMenuItems(const QList &actions); } *symbian_menubar; bool symbianCommands(int command); diff --git a/src/gui/widgets/qsoftkeyaction.h b/src/gui/widgets/qsoftkeyaction.h index 4ce5c5b..43c4ea7 100644 --- a/src/gui/widgets/qsoftkeyaction.h +++ b/src/gui/widgets/qsoftkeyaction.h @@ -56,7 +56,7 @@ class Q_GUI_EXPORT QSoftKeyAction : public QAction { public: enum StandardRole { - Options, + Options=0, Select, Back, Next, -- cgit v0.12 From 620cfd6a8d4fc84f5626b7eac3b70882620d5ef1 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Mon, 18 May 2009 10:52:50 +0200 Subject: Refactored test code and added test case for context sensitive menu --- src/gui/softkeys/main.cpp | 69 ++++++++++++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 28 deletions(-) diff --git a/src/gui/softkeys/main.cpp b/src/gui/softkeys/main.cpp index e69156a..b0d5ae1 100644 --- a/src/gui/softkeys/main.cpp +++ b/src/gui/softkeys/main.cpp @@ -16,59 +16,72 @@ class MainWindow : public QMainWindow Q_OBJECT public: MainWindow(QWidget *parent = 0); - ~MainWindow() {} + ~MainWindow(); + QAction* context1; + QAction* context2; + QAction* context3; + QSoftKeyAction *action1; + QSoftKeyAction *action2; + QSoftKeyAction *action3; + QSoftKeyAction *action4; + QSoftKeyAction *action5; }; MainWindow::MainWindow(QWidget *parent) - : QMainWindow(parent) + : QMainWindow(parent), + context1(0), context2(0), context3(0), + action1(0),action2(0),action3(0),action4(0),action5(0) + { - QWidget *central = new QWidget(this); central->setLayout(new QVBoxLayout); central->layout()->addWidget(new QPushButton); central->layout()->addWidget(new QPushButton); central->layout()->addWidget(new QPushButton); - + context1 = new QAction(QString("Context1"), central); + context2 = new QAction(QString("Context2"), central); + context3 = new QAction(QString("Context3"), context2); + central->addAction(context1); + central->addAction(context2); QMenuBar* menuBar = new QMenuBar(this); menuBar->addAction("MyMenuItem1"); this->setMenuBar(menuBar); - QSoftKeyAction action1(central); - action1.setText(QString("Ok")); - action1.setRole(QSoftKeyAction::Ok); - QSoftKeyAction action2(central); - action2.setText(QString("Back")); - action2.setRole(QSoftKeyAction::Back); - QSoftKeyAction action3(central); - action3.setText(QString("Cancel")); - action3.setRole(QSoftKeyAction::Cancel); - QSoftKeyAction action4(central); - action4.setText(QString("Menu")); - action4.setRole(QSoftKeyAction::Menu); - - QSoftKeyAction action5(central); - action5.setText(QString("ContextMenu")); - action5.setRole(QSoftKeyAction::ContextMenu); - + action1 = new QSoftKeyAction(QSoftKeyAction::Ok, QString("Ok"), central); + action2 = new QSoftKeyAction(QSoftKeyAction::Back, QString("Back"), central); + action3 = new QSoftKeyAction(QSoftKeyAction::Cancel, QString("Cancel"), central); + action4 = new QSoftKeyAction(QSoftKeyAction::Menu, QString("Menu"), central); + action5 = new QSoftKeyAction(QSoftKeyAction::ContextMenu,QString("ContextMenu"), central); + QList myActionList; - myActionList.append(&action1); - myActionList.append(&action2); - myActionList.append(&action3); + myActionList.append(action1); + myActionList.append(action2); + myActionList.append(action3); softKeyStack()->push(myActionList); softKeyStack()->pop(); - softKeyStack()->push(&action1); + softKeyStack()->push(action1); softKeyStack()->pop(); QList myActionList2; - myActionList2.append(&action4); - myActionList2.append(&action1); - myActionList2.append(&action5); + myActionList2.append(action4); + myActionList2.append(action5); softKeyStack()->push(myActionList2); setCentralWidget(central); } +MainWindow::~MainWindow() +{ + delete context1; + delete context2; + delete context3; + delete action1; + delete action2; + delete action3; + delete action4; + delete action5; +} int main(int argc, char *argv[]) { -- cgit v0.12 From 1e2b8d3d63c05bc81f2024959480235489a479a7 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Mon, 18 May 2009 11:00:52 +0200 Subject: Added test case for submenus inside context sensitive menu --- src/gui/softkeys/main.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/gui/softkeys/main.cpp b/src/gui/softkeys/main.cpp index b0d5ae1..e89c737 100644 --- a/src/gui/softkeys/main.cpp +++ b/src/gui/softkeys/main.cpp @@ -17,6 +17,7 @@ class MainWindow : public QMainWindow public: MainWindow(QWidget *parent = 0); ~MainWindow(); + QMenu *contextMenu; QAction* context1; QAction* context2; QAction* context3; @@ -29,24 +30,30 @@ public: MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), + contextMenu(0), context1(0), context2(0), context3(0), action1(0),action2(0),action3(0),action4(0),action5(0) { QWidget *central = new QWidget(this); + contextMenu = new QMenu(); + central->setLayout(new QVBoxLayout); central->layout()->addWidget(new QPushButton); central->layout()->addWidget(new QPushButton); central->layout()->addWidget(new QPushButton); context1 = new QAction(QString("Context1"), central); context2 = new QAction(QString("Context2"), central); - context3 = new QAction(QString("Context3"), context2); + + context3 = new QAction(QString("Context3"), contextMenu); central->addAction(context1); central->addAction(context2); QMenuBar* menuBar = new QMenuBar(this); menuBar->addAction("MyMenuItem1"); this->setMenuBar(menuBar); - + context2->setMenu(contextMenu); + contextMenu->addAction(context3); + action1 = new QSoftKeyAction(QSoftKeyAction::Ok, QString("Ok"), central); action2 = new QSoftKeyAction(QSoftKeyAction::Back, QString("Back"), central); action3 = new QSoftKeyAction(QSoftKeyAction::Cancel, QString("Cancel"), central); @@ -81,6 +88,7 @@ MainWindow::~MainWindow() delete action3; delete action4; delete action5; + delete contextMenu; } int main(int argc, char *argv[]) -- cgit v0.12 From bfe64f383c418b37a71ad2b395dc207d47916a90 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Mon, 18 May 2009 13:53:59 +0200 Subject: Fixed SOFTKEYEND definition to be of right value --- src/gui/widgets/qsoftkeystack_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widgets/qsoftkeystack_p.h b/src/gui/widgets/qsoftkeystack_p.h index 06e9253..a8ab2d5 100644 --- a/src/gui/widgets/qsoftkeystack_p.h +++ b/src/gui/widgets/qsoftkeystack_p.h @@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE // The following 2 defines may only be needed for s60. To be seen. #define SOFTKEYSTART 5000 -#define SOFTKEYEND (5000 + Qt::Key_Context4) +#define SOFTKEYEND (5000 + Qt::Key_Context4-Qt::Key_Context1) #define QSoftkeySet QList -- cgit v0.12 From 906c9646b448aeaaeba89bf66e9fc4ce2bb305c9 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Mon, 18 May 2009 13:54:32 +0200 Subject: Catch actions coming from context sensitive menu items --- src/gui/softkeys/main.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/gui/softkeys/main.cpp b/src/gui/softkeys/main.cpp index e89c737..6adbb2d 100644 --- a/src/gui/softkeys/main.cpp +++ b/src/gui/softkeys/main.cpp @@ -15,6 +15,12 @@ class MainWindow : public QMainWindow { Q_OBJECT public: + +private slots: + void context1Slot(); + void context3Slot(); +public: + MainWindow(QWidget *parent = 0); ~MainWindow(); QMenu *contextMenu; @@ -54,6 +60,8 @@ MainWindow::MainWindow(QWidget *parent) context2->setMenu(contextMenu); contextMenu->addAction(context3); + connect(context1, SIGNAL(triggered()), this, SLOT(context1Slot())); + connect(context3, SIGNAL(triggered()), this, SLOT(context3Slot())); action1 = new QSoftKeyAction(QSoftKeyAction::Ok, QString("Ok"), central); action2 = new QSoftKeyAction(QSoftKeyAction::Back, QString("Back"), central); action3 = new QSoftKeyAction(QSoftKeyAction::Cancel, QString("Cancel"), central); @@ -91,6 +99,13 @@ MainWindow::~MainWindow() delete contextMenu; } +void MainWindow::context1Slot() + { + } +void MainWindow::context3Slot() + { + } + int main(int argc, char *argv[]) { QApplication app(argc, argv); -- cgit v0.12 From e4010084c0dcf05f417e5aca6c8c0ad1767599ca Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Mon, 18 May 2009 14:20:45 +0200 Subject: Implemented handling keypresses coming from software keys --- src/gui/widgets/qsoftkeystack.cpp | 6 ++++++ src/gui/widgets/qsoftkeystack_p.h | 1 + src/gui/widgets/qsoftkeystack_s60.cpp | 15 +++++++++++---- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index fc6e107..14daecd 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -137,3 +137,9 @@ void QSoftKeyStack::handleFocusChanged(QWidget *old, QWidget *now) QList actions = now->actions(); // Do something with these actions. } + +void QSoftKeyStack::handleSoftKeyPress(int command) +{ + Q_D(QSoftKeyStack); + d->handleSoftKeyPress(command); +} diff --git a/src/gui/widgets/qsoftkeystack_p.h b/src/gui/widgets/qsoftkeystack_p.h index a8ab2d5..2469648 100644 --- a/src/gui/widgets/qsoftkeystack_p.h +++ b/src/gui/widgets/qsoftkeystack_p.h @@ -78,6 +78,7 @@ public: void push(const QList &softKeys); void pop(); const QSoftkeySet& top(); + void handleSoftKeyPress(int command); private: void mapSoftKeys(const QSoftkeySet &top); diff --git a/src/gui/widgets/qsoftkeystack_s60.cpp b/src/gui/widgets/qsoftkeystack_s60.cpp index 9e90fdf..a6b885e 100644 --- a/src/gui/widgets/qsoftkeystack_s60.cpp +++ b/src/gui/widgets/qsoftkeystack_s60.cpp @@ -90,15 +90,22 @@ void QSoftKeyStackPrivate::setNativeSoftKeys() if (softKeyAction->role() == QSoftKeyAction::Menu) { nativeContainer->SetCommandL(softKeyAction->nativePosition(), EAknSoftkeyOptions, *text); } else { - nativeContainer->SetCommandL(softKeyAction->nativePosition(), SOFTKEYSTART + softKeyAction->qtContextKey(), *text); + nativeContainer->SetCommandL(softKeyAction->nativePosition(), SOFTKEYSTART + softKeyAction->qtContextKey()-Qt::Key_Context1, *text); } CleanupStack::PopAndDestroy(); } } } -void QSoftKeyStack::handleSoftKeyPress(int command) +void QSoftKeyStackPrivate::handleSoftKeyPress(int command) { - // Do the magic, here. - // Map the command back to actual softkey on the top of the stack and handle it + const QSoftkeySet top = softKeyStack.top(); + int index = command-SOFTKEYSTART; + if( index<0 || index>=top.count()){ + // ### FIX THIS, add proper error handling, now fail quietly + return; + } + + top.at(index)->activate(QAction::Trigger); } + -- cgit v0.12 From 3d49f6854f35f19866c4076d551228aa63f38e3d Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Mon, 18 May 2009 14:21:44 +0200 Subject: Added slot that is triggered when back softkey is pressed --- src/gui/softkeys/main.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/softkeys/main.cpp b/src/gui/softkeys/main.cpp index 6adbb2d..a92e2c2 100644 --- a/src/gui/softkeys/main.cpp +++ b/src/gui/softkeys/main.cpp @@ -19,6 +19,7 @@ public: private slots: void context1Slot(); void context3Slot(); + void softKeySlot(); public: MainWindow(QWidget *parent = 0); @@ -68,7 +69,8 @@ MainWindow::MainWindow(QWidget *parent) action4 = new QSoftKeyAction(QSoftKeyAction::Menu, QString("Menu"), central); action5 = new QSoftKeyAction(QSoftKeyAction::ContextMenu,QString("ContextMenu"), central); - + connect(action2, SIGNAL(triggered()), this, SLOT(softKeySlot())); + QList myActionList; myActionList.append(action1); myActionList.append(action2); @@ -80,6 +82,7 @@ MainWindow::MainWindow(QWidget *parent) QList myActionList2; myActionList2.append(action4); + myActionList2.append(action2); myActionList2.append(action5); softKeyStack()->push(myActionList2); @@ -106,6 +109,11 @@ void MainWindow::context3Slot() { } +void MainWindow::softKeySlot() +{ + +} + int main(int argc, char *argv[]) { QApplication app(argc, argv); -- cgit v0.12 From 6f81986c3e5022fb6a873c6d60bede460bf6a4dd Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 18 May 2009 14:33:03 +0200 Subject: Fix incorrect signal referred to in the docs Fix the documentation to state sortIndicatorChanged() should be used and not sectionClicked() for connecting to the sortByColumn() slot as the sortByColumn() takes two parameters, not one. Reviewed-by: Kavindra Palaraja --- doc/src/model-view-programming.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/model-view-programming.qdoc b/doc/src/model-view-programming.qdoc index bf0c1c8..8874cfa 100644 --- a/doc/src/model-view-programming.qdoc +++ b/doc/src/model-view-programming.qdoc @@ -249,7 +249,7 @@ provide an API that allows you to sort your model data programmatically. In addition, you can enable interactive sorting (i.e. allowing the users to sort the data by clicking the view's - headers), by connecting the QHeaderView::sectionClicked() signal + headers), by connecting the QHeaderView::sortIndicatorChanged() signal to the QTableView::sortByColumn() slot or the QTreeView::sortByColumn() slot, respectively. -- cgit v0.12 From 0ff3bb25df3626a8112def75fc3ff048c70ebdb2 Mon Sep 17 00:00:00 2001 From: jasplin Date: Mon, 18 May 2009 14:30:09 +0200 Subject: Fixed crash in QWizard running on old Windows systems. When compiling the QWizard on a Windows system where QT_NO_STYLE_WINDOWSVISTA is not set and running the app on an old system that has no Vista support, the app would crash in the paint event of the Vista Back button. In this scenario, the Vista Back button is not needed (i.e. the regular Back button next to the Next button is used), so the fix is simply to avoid instanciating it altogether. Reviewed-by: janarve Task-number: 252662 --- src/gui/dialogs/qwizard.cpp | 4 ++-- src/gui/dialogs/qwizard_win.cpp | 5 ++++- src/gui/dialogs/qwizard_win_p.h | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gui/dialogs/qwizard.cpp b/src/gui/dialogs/qwizard.cpp index 32395c4..298f23f 100644 --- a/src/gui/dialogs/qwizard.cpp +++ b/src/gui/dialogs/qwizard.cpp @@ -1465,7 +1465,7 @@ void QWizardPrivate::handleAeroStyleChange() return; // prevent recursion inHandleAeroStyleChange = true; - vistaHelper->backButton()->disconnect(); + vistaHelper->disconnectBackButton(); q->removeEventFilter(vistaHelper); if (isVistaThemeEnabled()) { @@ -1491,7 +1491,7 @@ void QWizardPrivate::handleAeroStyleChange() q->setMouseTracking(true); // ### original value possibly different q->unsetCursor(); // ### ditto antiFlickerWidget->move(0, 0); - vistaHelper->backButton()->hide(); + vistaHelper->hideBackButton(); vistaHelper->setTitleBarIconAndCaptionVisible(true); } diff --git a/src/gui/dialogs/qwizard_win.cpp b/src/gui/dialogs/qwizard_win.cpp index 64696de..8aad4af 100644 --- a/src/gui/dialogs/qwizard_win.cpp +++ b/src/gui/dialogs/qwizard_win.cpp @@ -239,9 +239,11 @@ void QVistaBackButton::paintEvent(QPaintEvent *) QVistaHelper::QVistaHelper(QWizard *wizard) : pressed(false) , wizard(wizard) + , backButton_(0) { is_vista = resolveSymbols(); - backButton_ = new QVistaBackButton(wizard); + if (is_vista) + backButton_ = new QVistaBackButton(wizard); } QVistaHelper::~QVistaHelper() @@ -310,6 +312,7 @@ void QVistaHelper::drawTitleBar(QPainter *painter) QRect(0, 0, wizard->width(), titleBarSize() + topOffset()), painter->paintEngine()->getDC()); + Q_ASSERT(backButton_); const int btnTop = backButton_->mapToParent(QPoint()).y(); const int btnHeight = backButton_->size().height(); const int verticalCenter = (btnTop + btnHeight / 2); diff --git a/src/gui/dialogs/qwizard_win_p.h b/src/gui/dialogs/qwizard_win_p.h index cbb3b17..148be26 100644 --- a/src/gui/dialogs/qwizard_win_p.h +++ b/src/gui/dialogs/qwizard_win_p.h @@ -94,6 +94,8 @@ public: void resizeEvent(QResizeEvent *event); void paintEvent(QPaintEvent *event); QVistaBackButton *backButton() const { return backButton_; } + void disconnectBackButton() { if (backButton_) backButton_->disconnect(); } + void hideBackButton() { if (backButton_) backButton_->hide(); } void setWindowPosHack(); QColor basicWindowFrameColor(); enum VistaState { VistaAero, VistaBasic, Classic, Dirty }; -- cgit v0.12 From 6c16cb557205c8cf33bcf0493b3d9436c6f43236 Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Mon, 18 May 2009 14:39:14 +0200 Subject: QCalendarWidget::setDateTextFormat() reset the format is the date is invalid According to the documentation, QCalendarWidget::setDateTextFormat() should reset the format if the date is not valid. New tests included for the formating of this widget. Task-number: 252943 Reviewed-by: Olivier --- src/gui/widgets/qcalendarwidget.cpp | 2 +- tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp | 53 ++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/src/gui/widgets/qcalendarwidget.cpp b/src/gui/widgets/qcalendarwidget.cpp index 92c12a5..4436c04 100644 --- a/src/gui/widgets/qcalendarwidget.cpp +++ b/src/gui/widgets/qcalendarwidget.cpp @@ -2791,7 +2791,7 @@ QTextCharFormat QCalendarWidget::dateTextFormat(const QDate &date) const void QCalendarWidget::setDateTextFormat(const QDate &date, const QTextCharFormat &format) { Q_D(QCalendarWidget); - if ( date.isNull() && !format.isValid() ) + if (date.isNull()) d->m_model->m_dateFormats.clear(); else d->m_model->m_dateFormats[date] = format; diff --git a/tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp b/tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp index 67a822f..617832b 100644 --- a/tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp +++ b/tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp @@ -47,6 +47,8 @@ #include #include #include +#include +#include //TESTED_CLASS= @@ -68,6 +70,11 @@ public slots: private slots: void getSetCheck(); void buttonClickCheck(); + + void setTextFormat(); + void resetTextFormat(); + + void setWeekdayFormat(); }; // Testing get/set functions @@ -215,6 +222,52 @@ void tst_QCalendarWidget::buttonClickCheck() } +void tst_QCalendarWidget::setTextFormat() +{ + QCalendarWidget calendar; + QTextCharFormat format; + format.setFontItalic(true); + format.setForeground(Qt::green); + + const QDate date(1984, 10, 20); + calendar.setDateTextFormat(date, format); + QCOMPARE(calendar.dateTextFormat(date), format); +} + +void tst_QCalendarWidget::resetTextFormat() +{ + QCalendarWidget calendar; + QTextCharFormat format; + format.setFontItalic(true); + format.setForeground(Qt::green); + + const QDate date(1984, 10, 20); + calendar.setDateTextFormat(date, format); + + calendar.setDateTextFormat(QDate(), QTextCharFormat()); + QCOMPARE(calendar.dateTextFormat(date), QTextCharFormat()); +} + +void tst_QCalendarWidget::setWeekdayFormat() +{ + QCalendarWidget calendar; + + QTextCharFormat format; + format.setFontItalic(true); + format.setForeground(Qt::green); + + calendar.setWeekdayTextFormat(Qt::Wednesday, format); + + // check the format of the a given month + for (int i = 1; i <= 31; ++i) { + const QDate date(1984, 10, i); + const Qt::DayOfWeek dayOfWeek = static_cast(date.dayOfWeek()); + if (dayOfWeek == Qt::Wednesday) + QCOMPARE(calendar.weekdayTextFormat(dayOfWeek), format); + else + QVERIFY(calendar.weekdayTextFormat(dayOfWeek) != format); + } +} tst_QCalendarWidget::tst_QCalendarWidget() { -- cgit v0.12 From 3c40b1af35319f1fd1b10c97b954adff3abbe9b0 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 15 May 2009 13:54:44 +0200 Subject: Fix race condition in ~QObject while using QOrderedMutexLocker::relock we might unlock our mutex protecting the 'senders' list for a short moment. Another thread may then modify or remove element on the list. Therefore, we need to recheck the consistency of the list once we did that. Also, we cannot call removeSender because that will remove every connections, making impossible for another object destroyed in the same time to clean up the senders list, so call derefSender instead. Reviewed-by: Brad --- src/corelib/kernel/qobject.cpp | 30 ++++------ src/corelib/kernel/qobject_p.h | 1 - tests/auto/qobjectrace/tst_qobjectrace.cpp | 89 ++++++++++++++++++++++++++++++ 3 files changed, 100 insertions(+), 20 deletions(-) diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 05015c0..f1a1eb5 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -345,18 +345,6 @@ void QObjectPrivate::derefSender(QObject *sender, int signal) // Q_ASSERT_X(false, "QObjectPrivate::derefSender", "sender not found"); } -void QObjectPrivate::removeSender(QObject *sender, int signal) -{ - for (int i = 0; i < senders.count(); ++i) { - Sender &s = senders[i]; - if (s.sender == sender && s.signal == signal) { - senders.removeAt(i); - return; - } - } - // Q_ASSERT_X(false, "QObjectPrivate::removeSender", "sender not found"); -} - QObjectPrivate::Sender *QObjectPrivate::setCurrentSender(QObject *receiver, Sender *sender) { @@ -790,7 +778,7 @@ QObject::~QObject() bool needToUnlock = QOrderedMutexLocker::relock(locker.mutex(), m); c = &connectionList[i]; if (c->receiver) - c->receiver->d_func()->removeSender(this, signal); + c->receiver->d_func()->derefSender(this, signal); if (needToUnlock) m->unlock(); @@ -811,18 +799,22 @@ QObject::~QObject() } // disconnect all senders - for (int i = 0; i < d->senders.count(); ++i) { + for (int i = 0; i < d->senders.count(); ) { QObjectPrivate::Sender *s = &d->senders[i]; - if (!s->sender) - continue; QMutex *m = &s->sender->d_func()->threadData->mutex; bool needToUnlock = QOrderedMutexLocker::relock(locker.mutex(), m); - s = &d->senders[i]; - if (s->sender) - s->sender->d_func()->removeReceiver(s->signal, this); + if (m < locker.mutex()) { + if (i >= d->senders.count() || s != &d->senders[i]) { + if (needToUnlock) + m->unlock(); + continue; + } + } + s->sender->d_func()->removeReceiver(s->signal, this); if (needToUnlock) m->unlock(); + ++i; } d->senders.clear(); diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h index b324334..0eed938 100644 --- a/src/corelib/kernel/qobject_p.h +++ b/src/corelib/kernel/qobject_p.h @@ -163,7 +163,6 @@ public: QList senders; void refSender(QObject *sender, int signal); void derefSender(QObject *sender, int signal); - void removeSender(QObject *sender, int signal); static Sender *setCurrentSender(QObject *receiver, Sender *sender); diff --git a/tests/auto/qobjectrace/tst_qobjectrace.cpp b/tests/auto/qobjectrace/tst_qobjectrace.cpp index 0c88f29..fcfd528 100644 --- a/tests/auto/qobjectrace/tst_qobjectrace.cpp +++ b/tests/auto/qobjectrace/tst_qobjectrace.cpp @@ -50,6 +50,7 @@ class tst_QObjectRace: public QObject Q_OBJECT private slots: void moveToThreadRace(); + void destroyRace(); }; class RaceObject : public QObject @@ -147,5 +148,93 @@ void tst_QObjectRace::moveToThreadRace() delete object; } + +class MyObject : public QObject +{ Q_OBJECT + public slots: + void slot1() { emit signal1(); } + void slot2() { emit signal2(); } + void slot3() { emit signal3(); } + void slot4() { emit signal4(); } + void slot5() { emit signal5(); } + void slot6() { emit signal6(); } + void slot7() { emit signal7(); } + signals: + void signal1(); + void signal2(); + void signal3(); + void signal4(); + void signal5(); + void signal6(); + void signal7(); +}; + + + +class DestroyThread : public QThread +{ + Q_OBJECT + QObject **objects; + int number; + +public: + void setObjects(QObject **o, int n) + { + objects = o; + number = n; + for(int i = 0; i < number; i++) + objects[i]->moveToThread(this); + } + + void run() { + for(int i = 0; i < number; i++) + delete objects[i]; + } +}; + +void tst_QObjectRace::destroyRace() +{ + enum { ThreadCount = 10, ObjectCountPerThread = 733, + ObjectCount = ThreadCount * ObjectCountPerThread }; + + const char *_slots[] = { SLOT(slot1()) , SLOT(slot2()) , SLOT(slot3()), + SLOT(slot4()) , SLOT(slot5()) , SLOT(slot6()), + SLOT(slot7()) }; + + const char *_signals[] = { SIGNAL(signal1()), SIGNAL(signal2()), SIGNAL(signal3()), + SIGNAL(signal4()), SIGNAL(signal5()), SIGNAL(signal6()), + SIGNAL(signal7()) }; + + QObject *objects[ObjectCount]; + for (int i = 0; i < ObjectCount; ++i) + objects[i] = new MyObject; + + + for (int i = 0; i < ObjectCount * 11; ++i) { + connect(objects[(i*13) % ObjectCount], _signals[(2*i)%7], + objects[((i+2)*17) % ObjectCount], _slots[(3*i+2)%7] ); + connect(objects[((i+6)*23) % ObjectCount], _signals[(5*i+4)%7], + objects[((i+8)*41) % ObjectCount], _slots[(i+6)%7] ); + } + + DestroyThread *threads[ThreadCount]; + for (int i = 0; i < ThreadCount; ++i) { + threads[i] = new DestroyThread; + threads[i]->setObjects(objects + i*ObjectCountPerThread, ObjectCountPerThread); + } + + for (int i = 0; i < ThreadCount; ++i) + threads[i]->start(); + + QVERIFY(threads[0]->wait(TwoMinutes)); + // the other threads should finish pretty quickly now + for (int i = 1; i < ThreadCount; ++i) + QVERIFY(threads[i]->wait(3000)); + + for (int i = 0; i < ThreadCount; ++i) + delete threads[i]; +} + + QTEST_MAIN(tst_QObjectRace) #include "tst_qobjectrace.moc" -- cgit v0.12 From e8ac2b958d92319da7c725f0c30f8ba5fe06497b Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 18 May 2009 14:59:14 +0200 Subject: QCss: font-family handle fallback font specs if one specify more than one parameter in font-family, e.g., font-family: Verdana, Arial Qt should fallback on the second font if the first cannot be found. QFont::setFamily handle the case when the family name contains a comas, so we do not need to handle that specially in the css parser code. Task-number: 252311 Reviewed-by: Thomas Zander --- doc/src/stylesheet.qdoc | 4 ---- src/gui/text/qcssparser.cpp | 19 ++++++++++++------- tests/auto/qcssparser/tst_cssparser.cpp | 13 +++++++++---- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/doc/src/stylesheet.qdoc b/doc/src/stylesheet.qdoc index c0d13da..f895918 100644 --- a/doc/src/stylesheet.qdoc +++ b/doc/src/stylesheet.qdoc @@ -1872,10 +1872,6 @@ \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 54 - \note If you specify more than one parameter in \c font-family, - e.g., \c{font-family: Verdana, Arial}, Qt will only use the first - font. If it cannot be found, Qt uses the system fallbacks instead. - \row \o \c font-size \o \l{#Font Size}{Font Size} diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp index 8214e54..38621c1 100644 --- a/src/gui/text/qcssparser.cpp +++ b/src/gui/text/qcssparser.cpp @@ -1161,13 +1161,20 @@ static bool setFontWeightFromValue(const Value &value, QFont *font) return true; } -static bool setFontFamilyFromValues(const QVector &values, QFont *font) +/** \internal + * parse the font family from the values (starting from index \a start) + * and set it the \a font + * \returns true if a family was extracted. + */ +static bool setFontFamilyFromValues(const QVector &values, QFont *font, int start = 0) { QString family; - for (int i = 0; i < values.count(); ++i) { + for (int i = start; i < values.count(); ++i) { const Value &v = values.at(i); - if (v.type == Value::TermOperatorComma) - break; + if (v.type == Value::TermOperatorComma) { + family += QLatin1Char(','); + continue; + } const QString str = v.variant.toString(); if (str.isEmpty()) break; @@ -1221,9 +1228,7 @@ static void parseShorthandFontProperty(const QVector &values, QFont *font } if (i < values.count()) { - QString fam = values.at(i).variant.toString(); - if (!fam.isEmpty()) - font->setFamily(fam); + setFontFamilyFromValues(values, font, i); } } diff --git a/tests/auto/qcssparser/tst_cssparser.cpp b/tests/auto/qcssparser/tst_cssparser.cpp index ab6bad6..7c4fac1 100644 --- a/tests/auto/qcssparser/tst_cssparser.cpp +++ b/tests/auto/qcssparser/tst_cssparser.cpp @@ -123,7 +123,7 @@ static void debug(const QVector &symbols, int index = -1) qDebug() << "failure at index" << index; } -static void debug(const QCss::Parser &p) { debug(p.symbols); } +//static void debug(const QCss::Parser &p) { debug(p.symbols); } void tst_CssParser::scanner() { @@ -1473,7 +1473,12 @@ void tst_CssParser::extractFontFamily_data() QTest::newRow("quoted-family-name") << "font-family: 'Times New Roman'" << QString("Times New Roman"); QTest::newRow("unquoted-family-name") << "font-family: Times New Roman" << QString("Times New Roman"); QTest::newRow("unquoted-family-name2") << "font-family: Times New Roman" << QString("Times New Roman"); - QTest::newRow("multiple") << "font-family: Times New Roman , foobar, 'baz'" << QString("Times New Roman"); + QTest::newRow("multiple") << "font-family: Times New Roman , foobar, 'baz'" << QString("Times New Roman"); + QTest::newRow("multiple2") << "font-family: invalid, Times New Roman " << QString("Times New Roman"); + QTest::newRow("invalid") << "font-family: invalid" << QFont().family(); + QTest::newRow("shorthand") << "font: 12pt Times New Roman" << QString("Times New Roman"); + QTest::newRow("shorthand multiple quote") << "font: 12pt invalid, \"Times New Roman\" " << QString("Times New Roman"); + QTest::newRow("shorthand multiple") << "font: 12pt invalid, Times New Roman " << QString("Times New Roman"); } void tst_CssParser::extractFontFamily() @@ -1497,8 +1502,8 @@ void tst_CssParser::extractFontFamily() int adjustment = 0; QFont fnt; extractor.extractFont(&fnt, &adjustment); - - QTEST(fnt.family(), "expectedFamily"); + QFontInfo info(fnt); + QTEST(info.family(), "expectedFamily"); } void tst_CssParser::extractBorder_data() -- cgit v0.12 From 5c25207628fbcc94e92b129ac7660af14613ad85 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Mon, 18 May 2009 15:00:59 +0200 Subject: Adding change details in to Qt 3 to Qt 4 porting guide Adding details about QCloseEvents being acceptet by default in Qt 4 opposed to Qt 3 Task-number: 192607 Rev-by: msorvig --- doc/src/porting4-overview.qdoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/src/porting4-overview.qdoc b/doc/src/porting4-overview.qdoc index b0146a6..462f849 100644 --- a/doc/src/porting4-overview.qdoc +++ b/doc/src/porting4-overview.qdoc @@ -364,4 +364,10 @@ In Qt 4.2 and later, \l{Qt Style Sheets} can be used to implement many common modifications to existing styles, and this may be sufficient for Qt 3 applications. + + \section2 Events + In Qt 3, QCloseEvents were not accepted by default. In Qt 4, + the event handler QWidget::closeEvent() receives QCloseEvents, + and accepts them by default closing the application. To avoid + this, please reimplement QWidget::closeEvent(). */ -- cgit v0.12 From 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 b64e097303707161d0db663db06fdf239d40d4a2 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Tue, 19 May 2009 12:39:49 +0200 Subject: added Q_OBJECT macro --- src/gui/widgets/qsoftkeyaction.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/widgets/qsoftkeyaction.h b/src/gui/widgets/qsoftkeyaction.h index 43c4ea7..77aeac0 100644 --- a/src/gui/widgets/qsoftkeyaction.h +++ b/src/gui/widgets/qsoftkeyaction.h @@ -54,6 +54,7 @@ class QSoftKeyActionPrivate; class Q_GUI_EXPORT QSoftKeyAction : public QAction { + Q_OBJECT public: enum StandardRole { Options=0, -- 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 ad475e3b8935b1314382e2d2c6a7d09ace98b550 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Tue, 19 May 2009 14:44:47 +0200 Subject: First hacky approach to context menus. This was commited so stuff relied on context menus can be implemented concurrently while making the internals of context menu implementation cleaner. --- src/gui/widgets/qmenu_symbian.cpp | 30 +++++++++++++++++++++++------- src/gui/widgets/qsoftkeystack.cpp | 19 +++++++++++++++++++ 2 files changed, 42 insertions(+), 7 deletions(-) diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index b9633b5..1cff1bf 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -49,6 +49,9 @@ static QList symbianMenus; static QList nativeMenuBars; static uint qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM; static QWidget* widgetWithContextMenu=0; +static QList contextMenuActionList; +static QAction contextAction(0); +static int contexMenuCommand=0; bool menuExists() { @@ -177,6 +180,7 @@ void deleteAll(QList *items) static void rebuildMenu() { + widgetWithContextMenu = 0; QMenuBarPrivate *mb = 0; QWidget *w = qApp->activeWindow(); QMainWindow *mainWindow = qobject_cast(w); @@ -185,8 +189,7 @@ static void rebuildMenu() int index=0; bool found=false; - while( indexrole(); if(softAction->role() == QSoftKeyAction::ContextMenu) { @@ -195,8 +198,8 @@ static void rebuildMenu() } index++; } - if (w) - { + + if (w) { mb = menubars()->value(w); qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM; deleteAll( &symbianMenus ); @@ -204,7 +207,6 @@ static void rebuildMenu() return; mb->symbian_menubar->rebuild(); } - widgetWithContextMenu = 0; } Q_GUI_EXPORT void qt_symbian_show_toplevel( CEikMenuPane* menuPane) @@ -233,6 +235,11 @@ void QMenu::symbianCommands(int command) void QMenuBar::symbianCommands(int command) { + if (command == contexMenuCommand) { + QContextMenuEvent* event = new QContextMenuEvent(QContextMenuEvent::Keyboard, QPoint(0,0)); + QCoreApplication::postEvent(widgetWithContextMenu, event); + } + int size = nativeMenuBars.size(); for (int i = 0; i < nativeMenuBars.size(); ++i) { bool result = nativeMenuBars.at(i)->d_func()->symbianCommands(command); @@ -388,16 +395,25 @@ void QMenuBarPrivate::QSymbianMenuBarPrivate::InsertNativeMenuItems(const QList< } } + + void QMenuBarPrivate::QSymbianMenuBarPrivate::rebuild() { + contexMenuCommand = 0; qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM; deleteAll( &symbianMenus ); if (d) InsertNativeMenuItems(d->actions); - if (widgetWithContextMenu) - InsertNativeMenuItems(widgetWithContextMenu->actions()); + contextMenuActionList.clear(); + if (widgetWithContextMenu) { + contexMenuCommand = qt_symbian_menu_static_cmd_id; + contextAction.setText(QString("Actions")); + contextMenuActionList.append(&contextAction); + InsertNativeMenuItems(contextMenuActionList); } + +} QT_END_NAMESPACE #endif //QT_NO_MENUBAR diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index 14daecd..f702530 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -118,6 +118,24 @@ void QSoftKeyStack::handleFocusChanged(QWidget *old, QWidget *now) { if (!now) return; + QWidget *w = qApp->activeWindow(); + QMainWindow *mainWindow = qobject_cast(w); + QSoftKeyStack* softKeyStack = mainWindow->softKeyStack(); + if (old) + softKeyStack->pop(); + + Qt::ContextMenuPolicy policy = now->contextMenuPolicy(); + if (policy != Qt::NoContextMenu && policy != Qt::PreventContextMenu ) { + QList actionList; + QSoftKeyAction* menu = new QSoftKeyAction(QSoftKeyAction::Menu, QString("Menu"), now); + QSoftKeyAction* contextMenu = new QSoftKeyAction(QSoftKeyAction::ContextMenu, QString("ContextMenu"), now); + actionList.append(menu); + actionList.append(contextMenu); + softKeyStack->push(actionList); + } + +/* if (!now) + return; bool nowInOurMainWindow = false; const QMainWindow *ourMainWindow = qobject_cast(parent()); Q_ASSERT(ourMainWindow); @@ -136,6 +154,7 @@ void QSoftKeyStack::handleFocusChanged(QWidget *old, QWidget *now) QList actions = now->actions(); // Do something with these actions. +*/ } void QSoftKeyStack::handleSoftKeyPress(int command) -- cgit v0.12 From d2a9a4c38df32aed0bbcc21c0f971e1cf799226a Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Tue, 19 May 2009 14:45:55 +0200 Subject: Changed stylesheets example to create softkeystack. This commit should probably be reverted before merging to master --- examples/widgets/stylesheet/mainwindow.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/widgets/stylesheet/mainwindow.cpp b/examples/widgets/stylesheet/mainwindow.cpp index a1307a8..a0a38ad 100644 --- a/examples/widgets/stylesheet/mainwindow.cpp +++ b/examples/widgets/stylesheet/mainwindow.cpp @@ -46,6 +46,9 @@ MainWindow::MainWindow() { + QSoftKeyStack* stack = new QSoftKeyStack(this); + setSoftKeyStack(stack); + ui.setupUi(this); ui.nameLabel->setProperty("class", "mandatory QLabel"); -- cgit v0.12 From 3cfd4e97aa8f5e8c7b9eda9d7847b3f236d3efb5 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Tue, 19 May 2009 15:03:41 +0200 Subject: experiment with QMainWindow --- src/gui/widgets/qsoftkeystack.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index f702530..cd17171 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -120,6 +120,8 @@ void QSoftKeyStack::handleFocusChanged(QWidget *old, QWidget *now) return; QWidget *w = qApp->activeWindow(); QMainWindow *mainWindow = qobject_cast(w); + if( !mainWindow) + return; QSoftKeyStack* softKeyStack = mainWindow->softKeyStack(); if (old) softKeyStack->pop(); -- 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 fb869402dd5d061d1e5257f3c4b25d28ab9428a5 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 f7b3702719b85f0ecff069b15e80d4ebaab111f6 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 19 May 2009 16:52:07 +0200 Subject: Doc: Added information about the third-party MD4, SHA-1 and DES code. Reviewed-by: Trust Me --- doc/src/3rdparty.qdoc | 136 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 82 insertions(+), 54 deletions(-) diff --git a/doc/src/3rdparty.qdoc b/doc/src/3rdparty.qdoc index a87878e..23dfb12 100644 --- a/doc/src/3rdparty.qdoc +++ b/doc/src/3rdparty.qdoc @@ -61,6 +61,15 @@ \tableofcontents + \section1 DES (\c des.cpp) + + \e{Implementation of DES encryption for NTLM\br + Copyright 1997-2005 Simon Tatham.\br + This software is released under the MIT license.} + + See \c src/3rdparty/des/des.cpp for more information about the terms and + conditions under which the code is supplied. + \section1 FreeType 2 (\c freetype) version 2.3.6 \e{The FreeType project is a team of volunteers who develop free, portable @@ -108,18 +117,6 @@ See \c src/3rdparty/harfbuzz/COPYING.FTL and src/3rdparty/harfbuzz/COPYING.GPL for license details. - \section1 MD5 (\c md5.cpp and \c md5.h) - - \e{This code implements the MD5 message-digest algorithm. - The algorithm is due to Ron Rivest. This code was - written by Colin Plumb in 1993, no copyright is claimed. - This code is in the public domain; do with it what you wish.} -- quoted from - \c src/3rdparty/md5/md5.h - - See \c src/3rdparty/md5/md5.cpp and \c src/3rdparty/md5/md5.h for more - information about the terms and conditions under which the code is - supplied. - \section1 The Independent JPEG Group's JPEG Software (\c libjpeg) version 6b \e{This package contains C software to implement JPEG image compression and @@ -132,6 +129,29 @@ See \c src/3rdparty/libjpeg/README for license details. + \section1 MD4 (\c md4.cpp and \c md4.h) + + \e{MD4 (RFC-1320) message digest.\br + Modified from MD5 code by Andrey Panin \br\br + Written by Solar Designer in 2001, and placed in\br + the public domain. There's absolutely no warranty.} + + See \c src/3rdparty/md4/md4.cpp and \c src/3rdparty/md4/md4.h for more + information about the terms and conditions under which the code is + supplied. + + \section1 MD5 (\c md5.cpp and \c md5.h) + + \e{This code implements the MD5 message-digest algorithm. + The algorithm is due to Ron Rivest. This code was + written by Colin Plumb in 1993, no copyright is claimed. + This code is in the public domain; do with it what you wish.} -- quoted from + \c src/3rdparty/md5/md5.h + + See \c src/3rdparty/md5/md5.cpp and \c src/3rdparty/md5/md5.h for more + information about the terms and conditions under which the code is + supplied. + \section1 MNG Library (\c libmng) version 1.0.10 \e{The libmng library supports decoding, displaying, encoding, and various @@ -152,6 +172,56 @@ See \c src/3rdparty/libpng/LICENSE for license details. + \section1 The ptmalloc memory allocator (\c ptmalloc3) version 1.8 + + \e ptmcalloc3 is a scalable concurrent memory allocator suitable + for use in multi-threaded programs. + + \hr + + Copyright (c) 2001-2006 Wolfram Gloger + + Permission to use, copy, modify, distribute, and sell this software + and its documentation for any purpose is hereby granted without fee, + provided that (i) the above copyright notices and this permission + notice appear in all copies of the software and related documentation, + and (ii) the name of Wolfram Gloger may not be used in any advertising + or publicity relating to the software. + + THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + + IN NO EVENT SHALL WOLFRAM GLOGER BE LIABLE FOR ANY SPECIAL, + INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY + DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY + OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + + \hr + + See \c src/3rdparty/ptmalloc/COPYRIGHT for license details. + + \section1 SHA-1 (\c sha1.cpp) + + \e{Based on the public domain implementation of the SHA-1 algorithm\br + Copyright (C) Dominik Reichl } + + See \c src/3rdparty/sha1/sha1.cpp for more information about the terms and + conditions under which the code is supplied. + + \section1 SQLite (\c sqlite) version 3.5.9 + + \e{SQLite is a small C library that implements a + self-contained, embeddable, zero-configuration SQL database engine.} + -- quoted from \l{http://www.sqlite.org/}{www.sqlite.org}. + + According to the comments in the source files, the code is in the public + domain. See the + \l{http://www.sqlite.org/copyright.html}{SQLite Copyright} page on the + SQLite web site for further information. + \section1 TIFF Software Distribution (\c libtiff) version 3.8.2 \e {libtiff is a set of C functions (a library) that support the @@ -212,17 +282,6 @@ See \c src/3rdparty/libtiff/COPYRIGHT for license details. - \section1 SQLite (\c sqlite) version 3.5.9 - - \e{SQLite is a small C library that implements a - self-contained, embeddable, zero-configuration SQL database engine.} - -- quoted from \l{http://www.sqlite.org/}{www.sqlite.org}. - - According to the comments in the source files, the code is in the public - domain. See the - \l{http://www.sqlite.org/copyright.html}{SQLite Copyright} page on the - SQLite web site for further information. - \section1 Wintab API (\c wintab) Wintab is a de facto API for pointing devices on Windows. The @@ -238,35 +297,4 @@ src/3rdparty/zlib/README. See \c src/3rdparty/zlib/README for license details. - - \section1 The ptmalloc memory allocator (\c ptmalloc3) version 1.8 - - \e ptmcalloc3 is a scalable concurrent memory allocator suitable - for use in multi-threaded programs. - - \hr - - Copyright (c) 2001-2006 Wolfram Gloger - - Permission to use, copy, modify, distribute, and sell this software - and its documentation for any purpose is hereby granted without fee, - provided that (i) the above copyright notices and this permission - notice appear in all copies of the software and related documentation, - and (ii) the name of Wolfram Gloger may not be used in any advertising - or publicity relating to the software. - - THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, - EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - - IN NO EVENT SHALL WOLFRAM GLOGER BE LIABLE FOR ANY SPECIAL, - INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY - DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY - OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. - - \hr - - See \c src/3rdparty/ptmalloc/COPYRIGHT for license details. */ -- cgit v0.12 From 90b4f0ca7b9fe21f6c4b39a80f8f9cf98626690a Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 19 May 2009 17:53:38 +0200 Subject: Revert "Makes the layout of many of the areas be in aligned columns to immensely increase readability" This was pushed accidentially. This reverts commit ffecdf0bf9f25f7ab9aa4f69e37507dd595fecea. --- tools/qdoc3/htmlgenerator.cpp | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 7702628..13d52bf 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -2079,7 +2079,17 @@ void HtmlGenerator::generateSectionList(const Section& section, const Node *rela CodeMarker *marker, CodeMarker::SynopsisStyle style) { if (!section.members.isEmpty()) { - out() << "\n"; + bool twoColumn = false; + if (style == CodeMarker::SeparateList) { + twoColumn = (section.members.count() >= 16); + } else if (section.members.first()->type() == Node::Property) { + twoColumn = (section.members.count() >= 5); + } + if (twoColumn) + out() << "

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

    \n"; } if (style == CodeMarker::Summary && !section.inherited.isEmpty()) { @@ -2114,7 +2129,7 @@ void HtmlGenerator::generateSectionInheritedList(const Section& section, const N { QList >::ConstIterator p = section.inherited.begin(); while (p != section.inherited.end()) { - out() << "
  • "; + out() << "
  • "; out() << (*p).second << " "; if ((*p).second == 1) { out() << section.singularMember; @@ -2410,9 +2425,7 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, // replace all <@link> tags: "(<@link node=\"([^\"]+)\">).*()" static const QString linkTag("link"); for (int i = 0, n = src.size(); i < n;) { - if (src.at(i) == charLangle && src.at(i + 1).unicode() == '@') { - if (i != 0) - html += " "; + if (src.at(i) == charLangle && src.at(i + 1) == charAt) { i += 2; if (parseArg(src, linkTag, &i, n, &arg, &par1)) { QString link = linkForNode( -- cgit v0.12 From a372fc602a3cb09379875ced99ec969c371917d7 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Tue, 19 May 2009 18:05:38 +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: --- .../webkit/WebCore/generated/CSSPropertyNames.cpp | 5 +- .../webkit/WebCore/generated/CSSValueKeywords.c | 5 +- src/3rdparty/webkit/WebCore/generated/ColorData.c | 5 +- .../webkit/WebCore/generated/DocTypeStrings.cpp | 5 +- .../webkit/WebCore/generated/HTMLEntityNames.c | 5 +- .../webkit/WebCore/generated/tokenizer.cpp | 2315 ++++++-------------- 6 files changed, 695 insertions(+), 1645 deletions(-) diff --git a/src/3rdparty/webkit/WebCore/generated/CSSPropertyNames.cpp b/src/3rdparty/webkit/WebCore/generated/CSSPropertyNames.cpp index 25313ac..ca4ea5a 100644 --- a/src/3rdparty/webkit/WebCore/generated/CSSPropertyNames.cpp +++ b/src/3rdparty/webkit/WebCore/generated/CSSPropertyNames.cpp @@ -1,4 +1,4 @@ -/* ANSI-C code produced by gperf version 3.0.3 */ +/* ANSI-C code produced by gperf version 3.0.2 */ /* Command-line: gperf -a -L ANSI-C -E -C -c -o -t --key-positions='*' -NfindProp -Hhash_prop -Wwordlist_prop -D -s 2 CSSPropertyNames.gperf */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ @@ -217,9 +217,6 @@ hash_prop (register const char *str, register unsigned int len) #ifdef __GNUC__ __inline -#ifdef __GNUC_STDC_INLINE__ -__attribute__ ((__gnu_inline__)) -#endif #endif const struct props * findProp (register const char *str, register unsigned int len) diff --git a/src/3rdparty/webkit/WebCore/generated/CSSValueKeywords.c b/src/3rdparty/webkit/WebCore/generated/CSSValueKeywords.c index 5ff0858..d0433e0 100644 --- a/src/3rdparty/webkit/WebCore/generated/CSSValueKeywords.c +++ b/src/3rdparty/webkit/WebCore/generated/CSSValueKeywords.c @@ -1,4 +1,4 @@ -/* ANSI-C code produced by gperf version 3.0.3 */ +/* ANSI-C code produced by gperf version 3.0.2 */ /* Command-line: gperf -L ANSI-C -E -C -n -o -t --key-positions='*' -NfindValue -Hhash_val -Wwordlist_value -D CSSValueKeywords.gperf */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ @@ -179,9 +179,6 @@ hash_val (register const char *str, register unsigned int len) #ifdef __GNUC__ __inline -#ifdef __GNUC_STDC_INLINE__ -__attribute__ ((__gnu_inline__)) -#endif #endif const struct css_value * findValue (register const char *str, register unsigned int len) diff --git a/src/3rdparty/webkit/WebCore/generated/ColorData.c b/src/3rdparty/webkit/WebCore/generated/ColorData.c index 478566c..18d9926 100644 --- a/src/3rdparty/webkit/WebCore/generated/ColorData.c +++ b/src/3rdparty/webkit/WebCore/generated/ColorData.c @@ -1,5 +1,5 @@ #include // bogus -/* ANSI-C code produced by gperf version 3.0.3 */ +/* ANSI-C code produced by gperf version 3.0.2 */ /* Command-line: gperf -CDEot -L ANSI-C --key-positions='*' -N findColor -D -s 2 */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ @@ -141,9 +141,6 @@ hash (register const char *str, register unsigned int len) #ifdef __GNUC__ __inline -#ifdef __GNUC_STDC_INLINE__ -__attribute__ ((__gnu_inline__)) -#endif #endif const struct NamedColor * findColor (register const char *str, register unsigned int len) diff --git a/src/3rdparty/webkit/WebCore/generated/DocTypeStrings.cpp b/src/3rdparty/webkit/WebCore/generated/DocTypeStrings.cpp index 686629c..ad63b9e 100644 --- a/src/3rdparty/webkit/WebCore/generated/DocTypeStrings.cpp +++ b/src/3rdparty/webkit/WebCore/generated/DocTypeStrings.cpp @@ -1,5 +1,5 @@ #include // bogus -/* ANSI-C code produced by gperf version 3.0.3 */ +/* ANSI-C code produced by gperf version 3.0.2 */ /* Command-line: gperf -CEot -L ANSI-C --key-positions='*' -N findDoctypeEntry -F ,PubIDInfo::eAlmostStandards,PubIDInfo::eAlmostStandards */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ @@ -331,9 +331,6 @@ hash (register const char *str, register unsigned int len) #ifdef __GNUC__ __inline -#ifdef __GNUC_STDC_INLINE__ -__attribute__ ((__gnu_inline__)) -#endif #endif const struct PubIDInfo * findDoctypeEntry (register const char *str, register unsigned int len) diff --git a/src/3rdparty/webkit/WebCore/generated/HTMLEntityNames.c b/src/3rdparty/webkit/WebCore/generated/HTMLEntityNames.c index 993e106..470c4cd 100644 --- a/src/3rdparty/webkit/WebCore/generated/HTMLEntityNames.c +++ b/src/3rdparty/webkit/WebCore/generated/HTMLEntityNames.c @@ -1,4 +1,4 @@ -/* ANSI-C code produced by gperf version 3.0.3 */ +/* ANSI-C code produced by gperf version 3.0.2 */ /* Command-line: gperf -a -L ANSI-C -C -G -c -o -t --key-positions='*' -N findEntity -D -s 2 */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ @@ -520,9 +520,6 @@ static const short lookup[] = #ifdef __GNUC__ __inline -#ifdef __GNUC_STDC_INLINE__ -__attribute__ ((__gnu_inline__)) -#endif #endif const struct Entity * findEntity (register const char *str, register unsigned int len) diff --git a/src/3rdparty/webkit/WebCore/generated/tokenizer.cpp b/src/3rdparty/webkit/WebCore/generated/tokenizer.cpp index 8462f51..1da1a0b 100644 --- a/src/3rdparty/webkit/WebCore/generated/tokenizer.cpp +++ b/src/3rdparty/webkit/WebCore/generated/tokenizer.cpp @@ -78,42 +78,42 @@ static yyconst flex_int16_t yy_accept[479] = { 0, 0, 0, 0, 0, 0, 0, 69, 67, 2, 2, 67, 67, 67, 67, 67, 67, 67, 67, 67, 56, - 67, 67, 15, 15, 15, 67, 67, 67, 67, 66, + 67, 67, 67, 67, 15, 15, 15, 67, 67, 66, 15, 15, 15, 65, 15, 2, 0, 0, 0, 14, - 0, 0, 0, 18, 18, 0, 8, 0, 0, 9, - 0, 0, 15, 15, 15, 0, 57, 0, 55, 0, - 0, 56, 54, 54, 54, 54, 54, 54, 54, 54, - 54, 16, 54, 54, 51, 54, 0, 54, 0, 0, - 35, 35, 35, 35, 35, 35, 35, 0, 62, 15, - 0, 0, 15, 15, 0, 15, 15, 15, 7, 6, + 0, 0, 0, 0, 18, 18, 8, 0, 0, 9, + 0, 0, 0, 15, 15, 15, 57, 0, 55, 0, + 0, 56, 0, 54, 54, 54, 54, 54, 54, 54, + 54, 54, 54, 16, 54, 54, 51, 54, 0, 0, + 0, 35, 35, 35, 35, 35, 35, 35, 15, 15, + 7, 62, 15, 0, 0, 15, 15, 0, 15, 6, 5, 15, 15, 15, 15, 0, 0, 0, 14, 0, - 0, 0, 18, 18, 0, 18, 18, 0, 0, 14, - 0, 0, 4, 16, 15, 0, 0, 54, 0, 41, - 54, 37, 39, 54, 52, 43, 54, 42, 50, 54, - 45, 44, 40, 54, 54, 54, 54, 54, 0, 35, - 35, 0, 35, 35, 35, 35, 35, 35, 35, 35, - 15, 15, 16, 15, 15, 63, 63, 15, 15, 12, - 10, 15, 13, 0, 0, 0, 17, 17, 18, 18, - 18, 0, 0, 15, 0, 1, 54, 54, 46, 54, - 53, 16, 47, 54, 54, 54, 3, 35, 35, 35, - - 35, 35, 35, 35, 35, 35, 35, 15, 58, 0, - 63, 63, 63, 62, 15, 11, 0, 0, 0, 18, - 18, 18, 0, 15, 0, 0, 54, 48, 49, 54, - 54, 35, 35, 35, 35, 35, 35, 35, 20, 35, - 15, 64, 63, 63, 63, 63, 0, 0, 0, 0, - 60, 0, 15, 0, 0, 0, 18, 18, 18, 0, - 15, 54, 54, 38, 35, 35, 35, 35, 35, 21, - 35, 35, 15, 64, 63, 63, 63, 63, 63, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, - 0, 15, 0, 0, 17, 17, 18, 18, 0, 15, - - 54, 54, 35, 35, 35, 35, 19, 35, 35, 15, - 64, 63, 63, 63, 63, 63, 63, 0, 59, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 15, 0, 0, 18, 18, 0, 15, 54, 54, 35, - 35, 23, 35, 35, 35, 15, 64, 63, 63, 63, + 0, 0, 18, 18, 18, 0, 18, 0, 0, 14, + 0, 0, 4, 16, 15, 0, 0, 54, 54, 54, + 0, 54, 41, 54, 37, 39, 54, 52, 43, 54, + 42, 50, 54, 45, 44, 40, 54, 54, 0, 35, + 35, 35, 35, 0, 35, 35, 35, 35, 35, 35, + 15, 15, 15, 16, 15, 15, 63, 63, 15, 12, + 10, 15, 13, 0, 0, 0, 17, 18, 18, 18, + 17, 0, 0, 15, 0, 1, 54, 54, 54, 54, + 46, 54, 53, 16, 47, 54, 3, 35, 35, 35, + + 35, 35, 35, 35, 35, 35, 35, 15, 15, 58, + 0, 63, 63, 63, 62, 11, 0, 0, 0, 18, + 18, 18, 0, 15, 0, 0, 54, 54, 54, 48, + 49, 35, 35, 35, 35, 35, 35, 35, 35, 20, + 15, 15, 64, 63, 63, 63, 63, 0, 0, 0, + 0, 60, 0, 0, 0, 0, 18, 18, 18, 0, + 15, 54, 54, 38, 35, 35, 35, 35, 35, 35, + 21, 35, 15, 15, 64, 63, 63, 63, 63, 63, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, + 0, 0, 0, 0, 17, 18, 18, 17, 0, 15, + + 54, 54, 35, 35, 35, 35, 35, 19, 35, 15, + 15, 64, 63, 63, 63, 63, 63, 63, 0, 59, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 18, 18, 0, 15, 54, 54, 35, + 35, 35, 23, 35, 35, 15, 64, 63, 63, 63, 63, 63, 63, 63, 0, 59, 0, 0, 0, 59, 0, 0, 0, 0, 18, 15, 54, 35, 35, 35, 35, 64, 0, 0, 0, 36, 15, 35, 35, 35, @@ -122,7 +122,7 @@ static yyconst flex_int16_t yy_accept[479] = 35, 35, 35, 35, 35, 35, 35, 35, 0, 0, 0, 0, 0, 0, 35, 35, 35, 35, 25, 35, - 35, 35, 0, 61, 0, 0, 0, 0, 26, 35, + 35, 35, 0, 0, 0, 61, 0, 0, 26, 35, 35, 35, 35, 27, 35, 0, 0, 0, 0, 31, 35, 35, 35, 35, 0, 0, 0, 35, 35, 35, 35, 0, 0, 35, 35, 29, 35, 0, 0, 35, @@ -138,909 +138,437 @@ static yyconst flex_int32_t yy_ec[256] = 1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 12, 18, 19, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 12, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 12, 54, 12, 55, 56, 12, 57, 58, 59, 60, - - 61, 62, 63, 64, 65, 37, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 12, 84, 1, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, - - 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 85 + 24, 25, 26, 27, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 12, 28, 12, 29, 30, 12, 31, 32, 33, 34, + + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 12, 59, 1, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60 } ; -static yyconst flex_int32_t yy_meta[86] = +static yyconst flex_int32_t yy_meta[61] = { 0, - 1, 2, 3, 4, 4, 5, 6, 7, 6, 6, - 6, 6, 7, 8, 9, 6, 6, 10, 6, 6, - 11, 6, 6, 6, 6, 12, 6, 13, 13, 13, - 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 6, 14, 13, 13, 13, 13, - 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 6, 6, 6, 14 + 1, 2, 3, 3, 3, 4, 5, 5, 5, 5, + 5, 5, 5, 6, 7, 5, 5, 8, 5, 5, + 9, 5, 5, 5, 5, 10, 5, 11, 5, 11, + 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 5, 5, 5, 11 } ; -static yyconst flex_int16_t yy_base[550] = +static yyconst flex_int16_t yy_base[517] = { 0, - 0, 0, 64, 66, 54, 56, 1407, 6578, 93, 98, - 107, 83, 155, 1376, 77, 1350, 99, 1345, 1328, 207, - 1334, 275, 100, 108, 125, 326, 1315, 1313, 1312, 6578, - 141, 110, 151, 6578, 105, 197, 295, 89, 107, 6578, - 387, 120, 0, 429, 1281, 471, 6578, 117, 532, 6578, - 1283, 269, 137, 176, 281, 574, 283, 1289, 1292, 1246, - 1257, 0, 1221, 249, 135, 282, 276, 153, 91, 169, - 299, 308, 318, 266, 1219, 320, 616, 102, 1246, 348, - 1209, 316, 127, 359, 346, 347, 375, 658, 6578, 208, - 700, 1241, 400, 409, 1220, 397, 327, 761, 6578, 6578, - - 6578, 411, 419, 414, 424, 248, 368, 355, 356, 822, - 883, 0, 1191, 925, 967, 1190, 1028, 381, 421, 464, - 1089, 1150, 6578, 214, 456, 1225, 312, 1151, 1192, 1142, - 442, 1139, 1134, 452, 1131, 1104, 458, 1082, 1060, 358, - 1046, 1028, 1027, 462, 453, 1000, 1253, 469, 1023, 463, - 986, 1295, 492, 486, 500, 484, 502, 513, 969, 1356, - 425, 1417, 1001, 545, 494, 193, 993, 543, 1459, 544, - 554, 558, 555, 508, 398, 1520, 0, 1562, 956, 1623, - 1684, 570, 1745, 563, 993, 6578, 948, 1806, 935, 520, - 921, 498, 914, 546, 1848, 564, 6578, 585, 913, 1909, - - 568, 576, 586, 606, 631, 640, 1951, 2012, 6578, 0, - 203, 924, 907, 694, 2054, 565, 543, 2115, 0, 2157, - 2218, 2279, 2340, 669, 912, 505, 2401, 856, 840, 2443, - 612, 615, 2504, 608, 557, 639, 682, 668, 839, 2546, - 2607, 0, 288, 863, 841, 819, 741, 794, 573, 418, - 6578, 2668, 2710, 620, 2771, 0, 2813, 2874, 2935, 2996, - 3057, 3131, 3173, 3234, 670, 3295, 718, 719, 729, 763, - 684, 3337, 3398, 0, 456, 782, 777, 760, 742, 829, - 649, 834, 3459, 572, 3520, 854, 894, 915, 920, 3581, - 3642, 3684, 593, 3745, 6578, 697, 3806, 3867, 3928, 3989, - - 4050, 4111, 730, 4172, 731, 683, 672, 759, 4214, 4275, - 0, 762, 682, 429, 417, 414, 411, 859, 6578, 650, - 838, 957, 4336, 4397, 607, 926, 988, 4458, 4519, 4580, - 1002, 672, 1010, 4622, 4664, 1042, 752, 4706, 4767, 756, - 4828, 376, 812, 847, 1069, 1033, 0, 387, 6578, 6578, - 6578, 6578, 6578, 6578, 1122, 924, 963, 4870, 1162, 1049, - 1050, 4912, 4973, 678, 1063, 850, 1074, 5005, 1103, 841, - 989, 0, 5062, 5104, 5146, 6578, 1066, 1080, 1081, 1084, - 1108, 1137, 877, 328, 273, 6578, 5188, 5230, 5272, 641, - 1140, 884, 916, 836, 1105, 1161, 5314, 5356, 1233, 1286, - - 1147, 1138, 919, 1206, 1165, 1186, 1141, 1207, 1291, 1263, - 1316, 1345, 1327, 5398, 1086, 1029, 1225, 1133, 258, 1247, - 1248, 1310, 1388, 6578, 1427, 5440, 1449, 5501, 242, 1311, - 1341, 1324, 1326, 173, 1317, 1454, 5562, 1480, 5604, 170, - 1061, 1328, 1355, 1372, 1552, 5646, 5688, 1351, 1374, 1389, - 1409, 5730, 5772, 1419, 1456, 154, 1453, 5814, 5856, 1457, - 112, 897, 793, 5898, 1557, 1418, 109, 1348, 1582, 1550, - 1477, 1481, 1485, 90, 1564, 1458, 39, 6578, 5959, 5964, - 5977, 5982, 5987, 5994, 6004, 6017, 296, 6022, 6032, 6045, - 6059, 651, 6064, 6074, 6079, 6089, 6099, 6103, 571, 6112, - - 6125, 6138, 6152, 6166, 6176, 6186, 6191, 6203, 657, 6217, - 758, 6222, 6234, 6247, 801, 6261, 859, 6266, 6278, 6291, - 6304, 6317, 6330, 1086, 6335, 6348, 1120, 6353, 6365, 6378, - 6391, 6404, 6417, 6430, 6435, 6448, 1216, 6453, 6465, 6478, - 6491, 6504, 6517, 1219, 1220, 6530, 6543, 6553, 6563 + 0, 0, 39, 41, 1573, 1566, 1594, 2399, 62, 71, + 76, 61, 69, 1560, 78, 1559, 89, 1561, 1565, 132, + 1573, 91, 123, 1555, 80, 104, 97, 1554, 1551, 2399, + 85, 176, 175, 2399, 177, 193, 204, 1531, 84, 2399, + 242, 110, 180, 196, 1545, 205, 2399, 113, 277, 2399, + 1547, 72, 221, 133, 206, 234, 181, 1555, 1548, 1530, + 1528, 0, 268, 118, 1515, 221, 60, 240, 92, 230, + 95, 223, 244, 267, 238, 286, 1512, 268, 1521, 279, + 294, 1510, 278, 190, 290, 232, 292, 293, 308, 335, + 2399, 2399, 317, 326, 1516, 351, 336, 356, 366, 2399, + + 2399, 320, 367, 369, 370, 1478, 393, 327, 345, 420, + 455, 398, 1495, 490, 1481, 446, 481, 372, 365, 386, + 525, 560, 2399, 325, 388, 1491, 387, 1477, 595, 1476, + 516, 399, 1475, 34, 1472, 1461, 378, 1438, 1430, 318, + 1429, 1426, 323, 1424, 1423, 1422, 231, 387, 1430, 377, + 1411, 630, 1396, 551, 382, 108, 415, 408, 419, 412, + 586, 436, 665, 1400, 624, 456, 419, 1382, 457, 490, + 491, 625, 492, 1362, 526, 656, 672, 681, 1378, 716, + 707, 527, 723, 561, 1374, 2399, 732, 1346, 767, 437, + 1322, 410, 1312, 445, 1311, 546, 2399, 469, 758, 1303, + + 802, 576, 482, 580, 470, 440, 472, 793, 809, 2399, + 818, 515, 1288, 1273, 853, 552, 1205, 839, 855, 861, + 877, 883, 899, 645, 1227, 483, 905, 921, 612, 1183, + 1168, 609, 927, 943, 626, 517, 628, 508, 629, 1167, + 949, 965, 971, 550, 1167, 1157, 1123, 1006, 1020, 666, + 682, 2399, 1047, 1091, 1006, 1038, 1055, 1063, 1071, 1079, + 632, 1087, 1095, 1105, 539, 1103, 1111, 542, 543, 681, + 1097, 683, 1119, 1127, 1135, 585, 1091, 1083, 1067, 1039, + 721, 752, 772, 1170, 717, 1205, 1184, 1217, 1244, 1258, + 1285, 1320, 984, 1244, 2399, 1276, 1311, 917, 1328, 767, + + 1336, 1344, 733, 1352, 1360, 734, 578, 899, 582, 1395, + 1381, 1397, 623, 853, 822, 794, 793, 760, 807, 2399, + 875, 788, 1432, 1459, 1494, 818, 769, 1440, 1529, 1564, + 1438, 702, 1485, 919, 1520, 1555, 849, 963, 1572, 587, + 1299, 1580, 706, 441, 614, 1615, 1601, 715, 2399, 2399, + 2399, 2399, 2399, 2399, 1473, 839, 856, 1617, 1652, 804, + 852, 1638, 1654, 633, 1480, 871, 1508, 1650, 1542, 644, + 834, 1673, 1679, 1695, 1701, 2399, 1015, 872, 915, 916, + 877, 959, 704, 616, 586, 2399, 1717, 1723, 1739, 1002, + 1148, 514, 961, 989, 990, 1016, 1745, 1761, 1767, 1802, + + 1137, 1008, 1018, 1017, 985, 1129, 878, 1038, 1790, 1806, + 1829, 1211, 1827, 1849, 944, 1057, 1152, 787, 584, 615, + 1196, 918, 1863, 1890, 1279, 2399, 1869, 1867, 516, 1199, + 1154, 943, 1242, 515, 653, 1904, 1906, 1941, 1968, 480, + 945, 1200, 1149, 1214, 1927, 1949, 1947, 1239, 1301, 1207, + 1302, 1974, 1990, 1392, 1267, 411, 1354, 1996, 2012, 1310, + 376, 1241, 1039, 2018, 2034, 1338, 348, 1377, 2040, 1216, + 1391, 1421, 1394, 324, 1226, 1376, 263, 2399, 2075, 2080, + 2091, 2096, 2101, 2110, 2117, 2128, 2137, 2142, 2153, 2165, + 2167, 2176, 2181, 2190, 2195, 2204, 2213, 2225, 2234, 2243, + + 2248, 2260, 2265, 2276, 2281, 2292, 2303, 2314, 2319, 2330, + 2341, 2346, 2357, 2366, 2377, 2386 } ; -static yyconst flex_int16_t yy_def[550] = +static yyconst flex_int16_t yy_def[517] = { 0, 478, 1, 1, 1, 1, 1, 478, 478, 478, 478, 478, 479, 480, 478, 481, 478, 482, 478, 478, 478, - 478, 483, 484, 484, 484, 485, 478, 478, 478, 478, - 484, 484, 484, 478, 484, 478, 478, 478, 479, 478, - 486, 480, 487, 488, 488, 489, 478, 481, 490, 478, - 478, 478, 484, 484, 484, 485, 20, 491, 478, 492, - 478, 20, 493, 493, 493, 493, 493, 493, 493, 493, - 493, 493, 493, 493, 493, 493, 494, 493, 478, 483, - 495, 495, 495, 495, 495, 495, 495, 496, 478, 484, - 497, 478, 484, 484, 498, 484, 484, 484, 478, 478, - - 478, 484, 484, 484, 484, 478, 479, 479, 479, 479, - 486, 499, 488, 488, 500, 488, 114, 501, 501, 501, - 501, 502, 478, 478, 484, 503, 504, 493, 505, 493, - 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, + 478, 483, 484, 478, 485, 485, 485, 478, 478, 478, + 485, 485, 485, 478, 485, 478, 478, 478, 479, 478, + 486, 480, 478, 487, 488, 488, 478, 481, 489, 478, + 478, 478, 484, 485, 485, 485, 20, 490, 478, 491, + 478, 20, 492, 493, 493, 493, 493, 493, 493, 493, + 493, 493, 493, 493, 493, 493, 493, 493, 478, 483, + 494, 495, 495, 495, 495, 495, 495, 495, 485, 485, + 478, 478, 485, 496, 478, 485, 485, 478, 485, 478, + + 478, 485, 485, 485, 485, 478, 479, 479, 479, 479, + 486, 478, 488, 46, 488, 497, 46, 481, 481, 481, + 481, 489, 478, 478, 485, 490, 498, 493, 493, 493, + 499, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 478, 495, - 495, 506, 495, 495, 495, 495, 495, 495, 495, 495, - 484, 98, 478, 484, 484, 507, 478, 484, 98, 484, - 484, 484, 484, 478, 508, 508, 509, 114, 488, 114, - 114, 501, 501, 484, 510, 478, 493, 147, 493, 493, - 493, 493, 493, 493, 147, 493, 478, 495, 495, 160, - - 495, 495, 495, 495, 495, 495, 160, 98, 478, 511, - 512, 478, 478, 513, 98, 484, 478, 514, 515, 114, - 114, 114, 501, 484, 510, 516, 147, 493, 493, 147, - 493, 495, 160, 495, 495, 495, 495, 495, 495, 160, - 98, 517, 518, 478, 478, 478, 519, 519, 520, 521, - 478, 522, 98, 478, 523, 524, 525, 525, 258, 526, - 98, 147, 147, 147, 495, 160, 495, 495, 495, 495, - 495, 160, 98, 527, 528, 478, 478, 478, 478, 478, - 520, 478, 529, 530, 531, 532, 532, 532, 532, 532, - 533, 98, 478, 534, 478, 535, 535, 297, 536, 98, - - 147, 301, 495, 160, 495, 495, 495, 495, 160, 98, - 537, 538, 478, 478, 478, 478, 478, 478, 478, 539, - 539, 539, 539, 540, 541, 541, 541, 541, 542, 543, - 300, 478, 534, 297, 298, 536, 300, 301, 301, 495, - 160, 495, 495, 495, 495, 300, 544, 478, 478, 478, - 478, 478, 478, 478, 539, 539, 539, 323, 541, 541, - 541, 328, 543, 478, 335, 300, 339, 495, 495, 495, - 495, 545, 323, 328, 363, 478, 300, 495, 495, 495, - 495, 495, 495, 495, 495, 478, 323, 328, 363, 300, - 495, 495, 495, 495, 495, 495, 323, 328, 543, 546, - - 495, 495, 495, 495, 495, 495, 495, 495, 539, 541, - 546, 546, 547, 548, 495, 495, 495, 495, 495, 495, - 495, 495, 478, 478, 547, 549, 547, 547, 495, 495, - 495, 495, 495, 495, 495, 547, 428, 547, 428, 495, - 495, 495, 495, 495, 547, 437, 428, 495, 495, 495, - 495, 437, 428, 495, 495, 495, 495, 437, 428, 495, - 495, 495, 495, 437, 547, 495, 495, 495, 547, 495, + 495, 495, 495, 500, 495, 495, 495, 495, 495, 495, + 90, 485, 90, 478, 485, 485, 501, 478, 485, 485, + 485, 485, 485, 478, 479, 110, 478, 114, 488, 114, + 46, 481, 121, 485, 502, 478, 129, 493, 129, 493, + 493, 493, 493, 493, 493, 493, 478, 495, 152, 495, + + 152, 495, 495, 495, 495, 495, 495, 90, 163, 478, + 478, 503, 478, 478, 504, 485, 478, 110, 478, 114, + 180, 46, 121, 485, 502, 498, 129, 189, 493, 493, + 493, 495, 152, 201, 495, 495, 495, 495, 495, 495, + 90, 163, 478, 505, 478, 478, 478, 504, 504, 506, + 507, 478, 508, 478, 110, 478, 114, 180, 46, 121, + 485, 129, 189, 493, 495, 152, 201, 495, 495, 495, + 495, 495, 90, 163, 478, 509, 478, 478, 478, 478, + 478, 506, 478, 510, 507, 511, 504, 504, 504, 504, + 504, 508, 478, 110, 478, 114, 180, 488, 121, 485, + + 129, 189, 495, 152, 201, 495, 495, 495, 495, 485, + 163, 478, 512, 478, 478, 478, 478, 478, 478, 478, + 506, 506, 506, 506, 510, 507, 507, 507, 507, 511, + 291, 478, 110, 488, 180, 121, 485, 493, 189, 495, + 495, 201, 495, 495, 495, 485, 478, 478, 478, 478, + 478, 478, 478, 478, 506, 506, 506, 324, 507, 507, + 507, 329, 291, 478, 488, 485, 493, 495, 495, 495, + 495, 478, 324, 329, 291, 478, 485, 495, 495, 495, + 495, 495, 495, 495, 495, 478, 324, 329, 291, 485, + 495, 495, 495, 495, 495, 495, 324, 329, 291, 513, + + 495, 495, 495, 495, 495, 495, 495, 495, 324, 329, + 513, 411, 514, 515, 495, 495, 495, 495, 495, 495, + 495, 495, 515, 515, 478, 478, 515, 516, 495, 495, + 495, 495, 495, 495, 495, 515, 424, 515, 424, 495, + 495, 495, 495, 495, 424, 515, 439, 495, 495, 495, + 495, 424, 439, 495, 495, 495, 495, 424, 439, 495, + 495, 495, 495, 424, 439, 495, 495, 495, 439, 495, 495, 495, 495, 495, 495, 495, 495, 0, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478 + 478, 478, 478, 478, 478, 478 } ; -static yyconst flex_int16_t yy_nxt[6664] = +static yyconst flex_int16_t yy_nxt[2460] = { 0, 8, 9, 10, 9, 9, 9, 11, 12, 13, 14, 8, 8, 15, 8, 8, 16, 8, 17, 18, 19, - 20, 8, 21, 8, 8, 8, 22, 23, 23, 23, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 24, 23, 23, 23, 23, 23, 23, 25, 23, 23, - 23, 23, 23, 26, 27, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 23, 23, 23, 24, 23, - 23, 23, 23, 23, 23, 25, 23, 23, 23, 23, - 23, 8, 28, 29, 23, 30, 35, 30, 35, 40, - 40, 31, 152, 31, 36, 36, 36, 36, 36, 36, - - 36, 36, 36, 36, 32, 33, 32, 33, 37, 37, - 37, 37, 37, 89, 40, 35, 51, 35, 89, 52, - 31, 89, 31, 89, 92, 93, 92, 93, 106, 40, - 49, 136, 32, 33, 32, 33, 41, 478, 89, 54, - 478, 95, 38, 152, 129, 34, 105, 34, 55, 94, - 89, 103, 56, 91, 89, 129, 106, 148, 91, 136, - 41, 91, 152, 91, 89, 152, 131, 54, 154, 96, - 49, 38, 42, 46, 105, 43, 55, 94, 91, 103, - 152, 102, 44, 44, 44, 44, 44, 44, 129, 89, - 91, 104, 92, 93, 91, 131, 154, 96, 36, 36, - - 36, 36, 36, 137, 91, 135, 129, 152, 46, 102, - 210, 44, 44, 44, 44, 44, 44, 59, 212, 104, - 210, 89, 129, 152, 60, 61, 152, 62, 244, 91, - 92, 92, 137, 135, 63, 63, 64, 65, 66, 63, - 67, 68, 69, 63, 70, 63, 71, 72, 63, 73, - 63, 74, 75, 76, 63, 63, 63, 63, 63, 63, - 77, 91, 78, 63, 63, 64, 65, 66, 63, 67, - 68, 69, 70, 63, 71, 72, 63, 73, 63, 74, - 75, 76, 63, 63, 63, 63, 63, 63, 130, 52, - 174, 63, 80, 144, 89, 152, 37, 37, 37, 37, - - 37, 478, 129, 57, 82, 210, 112, 83, 112, 124, - 84, 152, 125, 276, 85, 86, 130, 87, 174, 129, - 134, 132, 144, 63, 92, 140, 152, 127, 88, 129, - 38, 186, 133, 82, 91, 129, 83, 124, 138, 84, - 89, 125, 85, 86, 139, 87, 98, 141, 134, 132, - 153, 63, 129, 98, 98, 98, 98, 98, 98, 38, - 133, 129, 40, 40, 142, 478, 138, 145, 143, 152, - 39, 129, 139, 129, 157, 40, 141, 156, 192, 153, - 91, 152, 98, 98, 98, 98, 98, 98, 39, 39, - 39, 107, 142, 40, 109, 145, 143, 150, 155, 152, - - 152, 88, 158, 157, 210, 40, 156, 110, 41, 41, - 89, 129, 152, 89, 110, 110, 110, 110, 110, 110, - 164, 41, 89, 478, 89, 150, 155, 89, 152, 152, - 282, 158, 89, 40, 49, 168, 354, 89, 89, 353, - 111, 170, 352, 110, 110, 110, 110, 110, 110, 114, - 91, 41, 172, 91, 351, 165, 114, 114, 114, 114, - 114, 114, 91, 168, 91, 171, 478, 91, 173, 89, - 170, 285, 91, 210, 49, 189, 40, 91, 91, 190, - 172, 313, 115, 165, 184, 114, 114, 114, 114, 114, - 114, 117, 193, 171, 198, 129, 173, 194, 117, 117, - - 117, 117, 117, 117, 189, 129, 129, 209, 190, 91, - 191, 129, 196, 184, 204, 129, 152, 49, 192, 201, - 226, 193, 129, 198, 186, 194, 202, 117, 117, 117, - 117, 117, 117, 48, 48, 48, 118, 152, 191, 152, - 196, 205, 203, 204, 120, 152, 206, 91, 201, 217, - 228, 129, 121, 152, 202, 152, 214, 89, 89, 121, - 121, 121, 121, 121, 121, 164, 152, 209, 89, 205, - 203, 89, 478, 129, 268, 206, 89, 217, 89, 228, - 282, 177, 40, 177, 282, 122, 229, 254, 121, 121, - 121, 121, 121, 121, 98, 231, 91, 91, 91, 129, - - 224, 98, 98, 98, 98, 98, 98, 91, 91, 216, - 152, 91, 234, 232, 229, 254, 91, 129, 91, 282, - 332, 152, 235, 49, 231, 285, 283, 236, 224, 152, - 98, 98, 98, 98, 98, 98, 147, 216, 152, 152, - 234, 237, 232, 147, 147, 147, 147, 147, 147, 332, - 235, 264, 265, 267, 400, 236, 282, 282, 90, 152, - 285, 152, 238, 63, 63, 129, 293, 219, 152, 219, - 237, 239, 147, 147, 147, 147, 147, 147, 160, 264, - 265, 267, 89, 269, 152, 160, 160, 160, 160, 160, - 160, 238, 152, 152, 293, 247, 247, 247, 247, 247, - - 239, 249, 283, 283, 261, 303, 250, 350, 251, 270, - 343, 269, 364, 271, 160, 160, 160, 160, 160, 160, - 162, 152, 91, 152, 376, 152, 308, 162, 162, 162, - 162, 162, 162, 261, 303, 152, 152, 152, 270, 343, - 364, 271, 247, 247, 247, 247, 247, 252, 249, 305, - 115, 306, 376, 250, 308, 251, 162, 162, 162, 162, - 162, 162, 97, 97, 97, 97, 97, 317, 242, 90, - 242, 152, 152, 368, 89, 307, 340, 342, 305, 210, - 306, 169, 152, 152, 152, 316, 344, 349, 169, 169, - 169, 169, 169, 169, 252, 280, 280, 280, 280, 280, - - 366, 478, 315, 307, 340, 342, 478, 314, 251, 152, - 468, 256, 152, 256, 91, 344, 152, 169, 169, 169, - 169, 169, 169, 108, 175, 175, 175, 108, 366, 40, - 280, 280, 280, 280, 280, 318, 318, 318, 318, 318, - 478, 370, 176, 251, 279, 282, 152, 252, 319, 176, - 176, 176, 176, 176, 176, 280, 280, 280, 280, 280, - 318, 318, 318, 318, 318, 152, 278, 90, 251, 274, - 370, 274, 384, 319, 405, 41, 371, 377, 176, 176, - 176, 176, 176, 176, 39, 39, 39, 107, 277, 152, - 109, 283, 152, 129, 152, 280, 280, 280, 280, 280, - - 152, 384, 405, 110, 396, 371, 377, 252, 251, 129, - 110, 110, 110, 110, 110, 110, 280, 280, 280, 280, - 280, 280, 280, 280, 280, 280, 478, 226, 478, 251, - 152, 282, 246, 396, 251, 403, 111, 152, 282, 110, - 110, 110, 110, 110, 110, 178, 404, 252, 467, 245, - 152, 417, 178, 178, 178, 178, 178, 178, 355, 318, - 318, 318, 355, 403, 282, 478, 152, 129, 252, 152, - 282, 356, 152, 252, 129, 404, 467, 283, 115, 285, - 417, 178, 178, 178, 178, 178, 178, 180, 129, 359, - 318, 318, 318, 359, 180, 180, 180, 180, 180, 180, - - 282, 129, 360, 97, 97, 97, 97, 97, 226, 115, - 283, 108, 175, 175, 175, 108, 283, 40, 213, 90, - 385, 163, 152, 180, 180, 180, 180, 180, 180, 116, - 116, 116, 116, 116, 161, 161, 161, 161, 161, 152, - 197, 285, 152, 119, 182, 182, 182, 119, 181, 385, - 90, 478, 478, 129, 40, 181, 181, 181, 181, 181, - 181, 282, 282, 41, 179, 179, 179, 179, 179, 430, - 159, 159, 159, 159, 159, 187, 187, 187, 187, 187, - 129, 129, 152, 90, 181, 181, 181, 181, 181, 181, - 119, 182, 182, 182, 119, 49, 295, 430, 295, 129, - - 448, 40, 285, 285, 199, 199, 199, 199, 199, 183, - 390, 391, 392, 129, 152, 393, 183, 183, 183, 183, - 183, 183, 152, 355, 318, 318, 318, 355, 448, 282, - 311, 429, 311, 152, 152, 129, 356, 152, 390, 152, - 391, 392, 49, 406, 393, 183, 183, 183, 183, 183, - 183, 48, 48, 48, 118, 394, 152, 129, 152, 429, - 432, 152, 120, 359, 318, 318, 318, 359, 395, 401, - 121, 406, 402, 416, 282, 283, 360, 121, 121, 121, - 121, 121, 121, 394, 129, 415, 152, 129, 421, 432, - 152, 152, 129, 152, 152, 129, 419, 395, 401, 407, - - 152, 402, 416, 122, 129, 408, 121, 121, 121, 121, - 121, 121, 188, 415, 152, 285, 421, 420, 152, 188, - 188, 188, 188, 188, 188, 419, 347, 407, 347, 372, - 386, 372, 386, 408, 286, 286, 286, 286, 286, 152, - 127, 418, 422, 115, 115, 167, 420, 251, 188, 188, - 188, 188, 188, 188, 146, 146, 146, 146, 146, 152, - 152, 163, 152, 149, 326, 361, 361, 361, 326, 431, - 418, 422, 129, 195, 129, 282, 433, 57, 152, 434, - 195, 195, 195, 195, 195, 195, 252, 411, 411, 411, - 411, 411, 321, 357, 357, 357, 321, 431, 282, 77, - - 152, 152, 59, 412, 127, 433, 129, 123, 434, 195, - 195, 195, 195, 195, 195, 200, 285, 411, 411, 411, - 411, 411, 200, 200, 200, 200, 200, 200, 423, 423, - 423, 423, 423, 412, 115, 101, 100, 435, 99, 414, - 79, 424, 440, 58, 283, 444, 478, 478, 478, 478, - 478, 200, 200, 200, 200, 200, 200, 159, 159, 159, - 159, 159, 478, 152, 152, 57, 435, 442, 441, 414, - 152, 440, 443, 50, 444, 449, 207, 152, 471, 152, - 426, 152, 454, 207, 207, 207, 207, 207, 207, 423, - 423, 423, 423, 423, 152, 442, 450, 441, 414, 47, - - 443, 152, 424, 449, 152, 455, 478, 471, 152, 152, - 451, 454, 207, 207, 207, 207, 207, 207, 161, 161, - 161, 161, 161, 478, 450, 152, 478, 152, 423, 423, - 423, 423, 423, 456, 455, 478, 460, 208, 451, 478, - 457, 424, 152, 478, 208, 208, 208, 208, 208, 208, - 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, - 478, 456, 152, 424, 461, 470, 478, 478, 424, 457, - 478, 152, 152, 208, 208, 208, 208, 208, 208, 215, - 426, 423, 423, 423, 423, 423, 215, 215, 215, 215, - 215, 215, 461, 470, 424, 478, 478, 478, 463, 478, - - 462, 466, 426, 477, 478, 478, 152, 426, 473, 152, - 152, 152, 474, 478, 475, 215, 215, 215, 215, 215, - 215, 108, 175, 175, 175, 108, 463, 40, 462, 466, - 152, 477, 478, 426, 152, 478, 478, 473, 152, 478, - 218, 474, 478, 475, 478, 478, 478, 218, 218, 218, - 218, 218, 218, 423, 423, 423, 423, 423, 438, 438, - 438, 438, 438, 478, 478, 478, 424, 478, 478, 478, - 478, 424, 478, 41, 478, 478, 218, 218, 218, 218, - 218, 218, 220, 445, 445, 445, 445, 445, 472, 220, - 220, 220, 220, 220, 220, 478, 424, 478, 478, 478, - - 478, 478, 476, 152, 478, 426, 478, 478, 478, 478, - 426, 478, 478, 478, 478, 478, 472, 152, 220, 220, - 220, 220, 220, 220, 179, 179, 179, 179, 179, 478, - 476, 478, 478, 478, 478, 426, 478, 478, 478, 478, - 478, 478, 478, 221, 478, 478, 478, 478, 478, 478, - 221, 221, 221, 221, 221, 221, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 221, - 221, 221, 221, 221, 221, 116, 116, 116, 116, 116, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - - 478, 478, 478, 478, 222, 478, 478, 478, 478, 478, - 478, 222, 222, 222, 222, 222, 222, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 222, 222, 222, 222, 222, 222, 119, 182, 182, 182, - 119, 478, 478, 478, 478, 478, 478, 40, 478, 478, - 478, 478, 478, 478, 478, 223, 478, 478, 478, 478, - 478, 478, 223, 223, 223, 223, 223, 223, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 49, 478, - - 478, 223, 223, 223, 223, 223, 223, 187, 187, 187, - 187, 187, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 227, 478, 478, 478, - 478, 478, 478, 227, 227, 227, 227, 227, 227, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 227, 227, 227, 227, 227, 227, 230, 478, - 478, 478, 478, 478, 478, 230, 230, 230, 230, 230, - 230, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - - 478, 478, 478, 478, 230, 230, 230, 230, 230, 230, - 199, 199, 199, 199, 199, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 233, - 478, 478, 478, 478, 478, 478, 233, 233, 233, 233, - 233, 233, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 233, 233, 233, 233, 233, - 233, 240, 478, 478, 478, 478, 478, 478, 240, 240, - 240, 240, 240, 240, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - - 478, 478, 478, 478, 478, 478, 478, 240, 240, 240, - 240, 240, 240, 161, 161, 161, 161, 161, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 241, 478, 478, 478, 478, 478, 478, 241, - 241, 241, 241, 241, 241, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 241, 241, - 241, 241, 241, 241, 253, 478, 478, 478, 478, 478, - 478, 253, 253, 253, 253, 253, 253, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 253, 253, 253, 253, 253, 253, 108, 175, 175, 175, - 108, 478, 40, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 255, 478, 478, 478, 478, - 478, 478, 255, 255, 255, 255, 255, 255, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 41, 478, - 478, 255, 255, 255, 255, 255, 255, 257, 478, 478, - 478, 478, 478, 478, 257, 257, 257, 257, 257, 257, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 257, 257, 257, 257, 257, 257, 179, - 179, 179, 179, 179, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 258, 478, - 478, 478, 478, 478, 478, 258, 258, 258, 258, 258, - 258, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 258, 258, 258, 258, 258, 258, - 116, 116, 116, 116, 116, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 259, - - 478, 478, 478, 478, 478, 478, 259, 259, 259, 259, - 259, 259, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 259, 259, 259, 259, 259, - 259, 119, 182, 182, 182, 119, 478, 478, 478, 478, - 478, 478, 40, 478, 478, 478, 478, 478, 478, 478, - 260, 478, 478, 478, 478, 478, 478, 260, 260, 260, - 260, 260, 260, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 49, 478, 478, 260, 260, 260, 260, - - 260, 260, 187, 187, 187, 187, 187, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 262, 478, 478, 478, 478, 478, 478, 262, 262, - 262, 262, 262, 262, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 262, 262, 262, - 262, 262, 262, 263, 478, 478, 478, 478, 478, 478, - 263, 263, 263, 263, 263, 263, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 263, - - 263, 263, 263, 263, 263, 199, 199, 199, 199, 199, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 266, 478, 478, 478, 478, 478, - 478, 266, 266, 266, 266, 266, 266, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 266, 266, 266, 266, 266, 266, 272, 478, 478, 478, - 478, 478, 478, 272, 272, 272, 272, 272, 272, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - - 478, 478, 272, 272, 272, 272, 272, 272, 161, 161, - 161, 161, 161, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 273, 478, 478, - 478, 478, 478, 478, 273, 273, 273, 273, 273, 273, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 273, 273, 273, 273, 273, 273, 280, - 280, 280, 280, 286, 478, 288, 478, 478, 478, 478, - 288, 288, 289, 478, 478, 478, 478, 478, 290, 478, - 478, 478, 478, 478, 478, 290, 290, 290, 290, 290, - - 290, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 291, 478, 478, 290, 290, 290, 290, 290, 290, - 292, 478, 478, 478, 478, 478, 478, 292, 292, 292, - 292, 292, 292, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 292, 292, 292, 292, - 292, 292, 108, 175, 175, 175, 108, 478, 40, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 294, 478, 478, 478, 478, 478, 478, 294, 294, - - 294, 294, 294, 294, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 41, 478, 478, 294, 294, 294, - 294, 294, 294, 296, 478, 478, 478, 478, 478, 478, - 296, 296, 296, 296, 296, 296, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 115, 478, 478, 296, - 296, 296, 296, 296, 296, 179, 179, 179, 179, 179, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 297, 478, 478, 478, 478, 478, - - 478, 297, 297, 297, 297, 297, 297, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 115, 478, 478, - 297, 297, 297, 297, 297, 297, 116, 116, 116, 116, - 116, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 298, 478, 478, 478, 478, - 478, 478, 298, 298, 298, 298, 298, 298, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 298, 298, 298, 298, 298, 298, 119, 182, 182, - - 182, 119, 478, 478, 478, 478, 478, 478, 40, 478, - 478, 478, 478, 478, 478, 478, 299, 478, 478, 478, - 478, 478, 478, 299, 299, 299, 299, 299, 299, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 49, - 478, 478, 299, 299, 299, 299, 299, 299, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 90, 478, 478, - 478, 478, 478, 478, 90, 90, 90, 90, 90, 90, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - - 478, 478, 478, 300, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 90, 90, 90, 90, 90, 90, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 300, 187, 187, 187, 187, 187, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 301, 478, 478, 478, 478, 478, 478, 301, 301, - 301, 301, 301, 301, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 301, 301, 301, - 301, 301, 301, 302, 478, 478, 478, 478, 478, 478, - - 302, 302, 302, 302, 302, 302, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 302, - 302, 302, 302, 302, 302, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 128, 478, 478, 478, 478, 478, - 478, 128, 128, 128, 128, 128, 128, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 128, 128, 128, 128, 128, 128, 199, 199, 199, 199, - - 199, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 304, 478, 478, 478, 478, - 478, 478, 304, 304, 304, 304, 304, 304, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 304, 304, 304, 304, 304, 304, 309, 478, 478, - 478, 478, 478, 478, 309, 309, 309, 309, 309, 309, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 309, 309, 309, 309, 309, 309, 161, - - 161, 161, 161, 161, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 310, 478, - 478, 478, 478, 478, 478, 310, 310, 310, 310, 310, - 310, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 310, 310, 310, 310, 310, 310, - 281, 281, 281, 320, 478, 478, 322, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 323, - 478, 478, 478, 478, 478, 478, 323, 323, 323, 323, - 323, 323, 478, 478, 478, 478, 478, 478, 478, 478, - - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 324, 478, 478, 323, 323, 323, 323, 323, - 323, 284, 284, 284, 325, 478, 478, 478, 478, 478, - 478, 478, 327, 478, 478, 478, 478, 478, 478, 478, - 328, 478, 478, 478, 478, 478, 478, 328, 328, 328, - 328, 328, 328, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 329, 478, 478, 328, 328, 328, 328, - 328, 328, 286, 286, 286, 286, 286, 478, 478, 478, - 478, 478, 478, 478, 478, 251, 478, 478, 478, 478, - - 478, 330, 478, 478, 478, 478, 478, 478, 330, 330, - 330, 330, 330, 330, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 252, 478, 478, 330, 330, 330, - 330, 330, 330, 280, 280, 280, 280, 286, 478, 288, - 478, 478, 478, 478, 288, 288, 289, 478, 478, 478, - 478, 478, 290, 478, 478, 478, 478, 478, 478, 290, - 290, 290, 290, 290, 290, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 291, 478, 478, 290, 290, - - 290, 290, 290, 290, 331, 478, 478, 478, 478, 478, - 478, 331, 331, 331, 331, 331, 331, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 331, 331, 331, 331, 331, 331, 108, 175, 175, 175, - 108, 478, 40, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 333, 478, 478, 478, 478, - 478, 478, 333, 333, 333, 333, 333, 333, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 41, 478, - - 478, 333, 333, 333, 333, 333, 333, 179, 179, 179, - 179, 179, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 334, 478, 478, 478, - 478, 478, 478, 334, 334, 334, 334, 334, 334, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 115, - 478, 478, 334, 334, 334, 334, 334, 334, 116, 116, - 116, 116, 116, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 335, 478, 478, - 478, 478, 478, 478, 335, 335, 335, 335, 335, 335, - - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 335, 335, 335, 335, 335, 335, 119, - 182, 182, 182, 119, 478, 478, 478, 478, 478, 478, - 40, 478, 478, 478, 478, 478, 478, 478, 336, 478, - 478, 478, 478, 478, 478, 336, 336, 336, 336, 336, - 336, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 49, 478, 478, 336, 336, 336, 336, 336, 336, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - - 478, 478, 478, 478, 478, 478, 337, 478, 478, 90, - 478, 478, 478, 478, 478, 478, 90, 90, 90, 90, - 90, 90, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 90, 90, 90, 90, 90, - 90, 187, 187, 187, 187, 187, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 338, 478, 478, 478, 478, 478, 478, 338, 338, 338, - 338, 338, 338, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - - 478, 478, 478, 478, 478, 478, 338, 338, 338, 338, - 338, 338, 146, 146, 146, 146, 146, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 339, 478, 478, 478, 478, 478, 478, 339, 339, - 339, 339, 339, 339, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 339, 339, 339, - 339, 339, 339, 199, 199, 199, 199, 199, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 341, 478, 478, 478, 478, 478, 478, 341, - - 341, 341, 341, 341, 341, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 341, 341, - 341, 341, 341, 341, 345, 478, 478, 478, 478, 478, - 478, 345, 345, 345, 345, 345, 345, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 345, 345, 345, 345, 345, 345, 161, 161, 161, 161, - 161, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 346, 478, 478, 478, 478, - - 478, 478, 346, 346, 346, 346, 346, 346, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 346, 346, 346, 346, 346, 346, 321, 357, 357, - 357, 321, 478, 282, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 358, 478, 478, 478, - 478, 478, 478, 358, 358, 358, 358, 358, 358, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 283, - 478, 478, 358, 358, 358, 358, 358, 358, 281, 281, - - 281, 320, 478, 478, 322, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 323, 478, 478, - 478, 478, 478, 478, 323, 323, 323, 323, 323, 323, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 324, 478, 478, 323, 323, 323, 323, 323, 323, 326, - 361, 361, 361, 326, 478, 478, 478, 478, 478, 478, - 282, 478, 478, 478, 478, 478, 478, 478, 362, 478, - 478, 478, 478, 478, 478, 362, 362, 362, 362, 362, - 362, 478, 478, 478, 478, 478, 478, 478, 478, 478, - - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 285, 478, 478, 362, 362, 362, 362, 362, 362, - 284, 284, 284, 325, 478, 478, 478, 478, 478, 478, - 478, 327, 478, 478, 478, 478, 478, 478, 478, 328, - 478, 478, 478, 478, 478, 478, 328, 328, 328, 328, - 328, 328, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 329, 478, 478, 328, 328, 328, 328, 328, - 328, 286, 286, 286, 286, 286, 478, 478, 478, 478, - 478, 478, 478, 478, 251, 478, 478, 478, 478, 478, - - 363, 478, 478, 478, 478, 478, 478, 363, 363, 363, - 363, 363, 363, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 252, 478, 478, 363, 363, 363, 363, - 363, 363, 365, 478, 478, 478, 478, 478, 478, 365, - 365, 365, 365, 365, 365, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 365, 365, - 365, 365, 365, 365, 113, 478, 478, 478, 478, 478, - 478, 113, 113, 113, 113, 113, 113, 478, 478, 478, - - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 113, 113, 113, 113, 113, 113, 367, 478, 478, 478, - 478, 478, 478, 367, 367, 367, 367, 367, 367, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 367, 367, 367, 367, 367, 367, 146, 146, - 146, 146, 146, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 128, 478, 478, - 478, 478, 478, 478, 128, 128, 128, 128, 128, 128, - - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 128, 128, 128, 128, 128, 128, 199, - 199, 199, 199, 199, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 369, 478, - 478, 478, 478, 478, 478, 369, 369, 369, 369, 369, - 369, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 369, 369, 369, 369, 369, 369, - 373, 478, 478, 478, 478, 478, 478, 373, 373, 373, - - 373, 373, 373, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 373, 373, 373, 373, - 373, 373, 374, 478, 478, 478, 478, 478, 478, 374, - 374, 374, 374, 374, 374, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 374, 374, - 374, 374, 374, 374, 286, 286, 286, 286, 286, 478, - 478, 478, 478, 478, 478, 478, 478, 251, 478, 478, - 478, 478, 478, 375, 478, 478, 478, 478, 478, 478, - - 375, 375, 375, 375, 375, 375, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 252, 478, 478, 375, - 375, 375, 375, 375, 375, 378, 478, 478, 478, 478, - 478, 478, 379, 478, 380, 478, 478, 478, 478, 381, - 382, 478, 478, 383, 478, 478, 478, 478, 152, 478, - 478, 478, 478, 478, 378, 478, 478, 478, 478, 478, - 379, 478, 380, 478, 478, 478, 478, 381, 382, 478, - 478, 383, 387, 478, 478, 478, 478, 478, 478, 387, - 387, 387, 387, 387, 387, 478, 478, 478, 478, 478, - - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 387, 387, - 387, 387, 387, 387, 388, 478, 478, 478, 478, 478, - 478, 388, 388, 388, 388, 388, 388, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 388, 388, 388, 388, 388, 388, 389, 478, 478, 478, - 478, 478, 478, 389, 389, 389, 389, 389, 389, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - - 478, 478, 389, 389, 389, 389, 389, 389, 397, 478, - 478, 478, 478, 478, 478, 397, 397, 397, 397, 397, - 397, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 397, 397, 397, 397, 397, 397, - 398, 478, 478, 478, 478, 478, 478, 398, 398, 398, - 398, 398, 398, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 398, 398, 398, 398, - 398, 398, 399, 478, 478, 478, 478, 478, 478, 399, - - 399, 399, 399, 399, 399, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 399, 399, - 399, 399, 399, 399, 409, 478, 478, 478, 478, 478, - 478, 409, 409, 409, 409, 409, 409, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 409, 409, 409, 409, 409, 409, 410, 478, 478, 478, - 478, 478, 478, 410, 410, 410, 410, 410, 410, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 410, 410, 410, 410, 410, 410, 428, 478, - 478, 478, 478, 478, 478, 428, 428, 428, 428, 428, - 428, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 428, 428, 428, 428, 428, 428, - 437, 478, 478, 478, 478, 478, 478, 437, 437, 437, - 437, 437, 437, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 437, 437, 437, 437, - - 437, 437, 438, 438, 438, 438, 438, 478, 478, 478, - 478, 478, 478, 478, 478, 424, 478, 478, 478, 478, - 478, 439, 478, 478, 478, 478, 478, 478, 439, 439, - 439, 439, 439, 439, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 426, 478, 478, 439, 439, 439, - 439, 439, 439, 445, 445, 445, 445, 445, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 446, 478, 478, 478, 478, 478, 478, 446, - 446, 446, 446, 446, 446, 478, 478, 478, 478, 478, - - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 446, 446, - 446, 446, 446, 446, 447, 478, 478, 478, 478, 478, - 478, 447, 447, 447, 447, 447, 447, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 447, 447, 447, 447, 447, 447, 452, 478, 478, 478, - 478, 478, 478, 452, 452, 452, 452, 452, 452, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - - 478, 478, 452, 452, 452, 452, 452, 452, 453, 478, - 478, 478, 478, 478, 478, 453, 453, 453, 453, 453, - 453, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 453, 453, 453, 453, 453, 453, - 458, 478, 478, 478, 478, 478, 478, 458, 458, 458, - 458, 458, 458, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 458, 458, 458, 458, - 458, 458, 459, 478, 478, 478, 478, 478, 478, 459, - - 459, 459, 459, 459, 459, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 459, 459, - 459, 459, 459, 459, 464, 478, 478, 478, 478, 478, - 478, 464, 464, 464, 464, 464, 464, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 464, 464, 464, 464, 464, 464, 465, 478, 478, 478, - 478, 478, 478, 465, 465, 465, 465, 465, 465, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 465, 465, 465, 465, 465, 465, 469, 478, - 478, 478, 478, 478, 478, 469, 469, 469, 469, 469, - 469, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 469, 469, 469, 469, 469, 469, - 39, 478, 478, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 45, 45, 478, 45, 45, 48, 478, - 478, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 53, 53, 478, 53, 53, 81, 478, 478, 81, - - 81, 90, 478, 90, 90, 478, 90, 90, 97, 97, - 97, 97, 97, 97, 97, 97, 97, 97, 108, 108, + 20, 8, 21, 8, 8, 8, 22, 23, 24, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 26, 25, 25, 25, 25, 25, 25, + 27, 25, 25, 25, 25, 25, 8, 28, 29, 25, + 30, 131, 30, 36, 36, 36, 36, 36, 40, 31, + 191, 31, 36, 36, 36, 36, 36, 37, 37, 37, + 37, 37, 32, 33, 32, 33, 42, 131, 41, 43, + 40, 40, 52, 92, 134, 34, 44, 34, 92, 46, + + 46, 46, 46, 46, 46, 49, 51, 94, 80, 52, + 92, 41, 94, 98, 38, 124, 53, 92, 81, 131, + 95, 96, 131, 83, 94, 40, 84, 478, 102, 85, + 478, 94, 55, 86, 87, 154, 88, 44, 139, 137, + 49, 56, 59, 90, 99, 131, 92, 132, 97, 60, + 61, 203, 62, 90, 90, 90, 90, 90, 90, 63, + 94, 64, 65, 65, 66, 67, 68, 65, 69, 70, + 71, 65, 72, 65, 73, 74, 65, 75, 65, 76, + 77, 78, 65, 65, 65, 65, 65, 65, 92, 92, + 92, 65, 95, 96, 36, 36, 36, 36, 36, 478, + + 112, 57, 94, 94, 94, 37, 37, 37, 37, 37, + 112, 112, 112, 112, 112, 112, 114, 154, 104, 92, + 103, 105, 95, 96, 65, 117, 114, 114, 114, 114, + 114, 114, 116, 94, 156, 117, 117, 117, 117, 117, + 117, 90, 38, 39, 39, 39, 107, 92, 131, 109, + 131, 90, 90, 90, 90, 90, 90, 131, 131, 154, + 140, 94, 110, 133, 195, 131, 158, 131, 125, 111, + 144, 131, 110, 110, 110, 110, 110, 110, 48, 48, + 48, 118, 135, 95, 143, 138, 141, 145, 129, 120, + 154, 146, 142, 136, 131, 131, 478, 121, 129, 129, + + 129, 129, 129, 129, 122, 154, 81, 121, 121, 121, + 121, 121, 121, 131, 152, 155, 147, 154, 148, 154, + 154, 92, 159, 160, 152, 152, 152, 152, 152, 152, + 92, 150, 157, 92, 40, 94, 89, 89, 89, 89, + 89, 95, 95, 194, 94, 131, 163, 94, 92, 92, + 131, 154, 40, 170, 41, 161, 163, 163, 163, 163, + 163, 163, 94, 94, 92, 161, 161, 161, 161, 161, + 161, 165, 41, 193, 48, 154, 167, 40, 94, 92, + 92, 168, 92, 92, 40, 166, 167, 167, 167, 167, + 167, 167, 49, 94, 94, 39, 94, 94, 40, 49, + + 40, 92, 127, 154, 154, 131, 186, 169, 192, 154, + 172, 198, 202, 49, 131, 94, 171, 173, 177, 184, + 41, 108, 175, 175, 175, 108, 131, 40, 177, 177, + 177, 177, 177, 177, 196, 154, 211, 131, 154, 154, + 176, 205, 154, 230, 213, 190, 154, 41, 207, 92, + 176, 176, 176, 176, 176, 176, 39, 39, 39, 107, + 204, 206, 109, 94, 131, 194, 180, 154, 154, 210, + 215, 229, 131, 370, 239, 110, 180, 180, 180, 180, + 180, 180, 111, 94, 94, 110, 110, 110, 110, 110, + 110, 113, 113, 113, 113, 113, 154, 154, 226, 154, + + 232, 181, 186, 92, 210, 92, 240, 154, 238, 154, + 178, 181, 181, 181, 181, 181, 181, 94, 94, 94, + 178, 178, 178, 178, 178, 178, 119, 182, 182, 182, + 119, 236, 211, 40, 269, 154, 189, 40, 271, 40, + 245, 154, 154, 154, 154, 183, 189, 189, 189, 189, + 189, 189, 49, 41, 49, 183, 183, 183, 183, 183, + 183, 48, 48, 48, 118, 92, 154, 211, 403, 154, + 154, 201, 120, 131, 92, 277, 306, 303, 307, 94, + 121, 201, 201, 201, 201, 201, 201, 122, 94, 231, + 121, 121, 121, 121, 121, 121, 128, 128, 128, 128, + + 128, 224, 211, 154, 368, 154, 208, 154, 344, 154, + 314, 154, 345, 154, 154, 187, 208, 208, 208, 208, + 208, 208, 131, 235, 237, 187, 187, 187, 187, 187, + 187, 151, 151, 151, 151, 151, 154, 92, 92, 131, + 211, 154, 154, 154, 165, 92, 371, 433, 349, 265, + 199, 94, 94, 154, 264, 154, 154, 154, 92, 94, + 199, 199, 199, 199, 199, 199, 162, 162, 162, 162, + 162, 154, 94, 283, 268, 270, 218, 272, 384, 216, + 154, 300, 376, 261, 444, 209, 218, 218, 218, 218, + 218, 218, 219, 284, 283, 209, 209, 209, 209, 209, + + 209, 220, 219, 219, 219, 219, 219, 219, 154, 286, + 154, 220, 220, 220, 220, 220, 220, 179, 179, 179, + 179, 179, 281, 281, 281, 281, 281, 222, 309, 283, + 308, 154, 211, 154, 396, 252, 221, 222, 222, 222, + 222, 222, 222, 223, 286, 364, 221, 221, 221, 221, + 221, 221, 227, 223, 223, 223, 223, 223, 223, 283, + 154, 154, 227, 227, 227, 227, 227, 227, 188, 188, + 188, 188, 188, 319, 319, 319, 319, 319, 233, 284, + 92, 283, 340, 343, 337, 354, 320, 228, 233, 233, + 233, 233, 233, 233, 94, 283, 286, 228, 228, 228, + + 228, 228, 228, 200, 200, 200, 200, 200, 319, 319, + 319, 319, 319, 241, 154, 284, 283, 432, 353, 352, + 285, 320, 234, 241, 241, 241, 241, 241, 241, 242, + 283, 286, 234, 234, 234, 234, 234, 234, 243, 242, + 242, 242, 242, 242, 242, 286, 283, 351, 243, 243, + 243, 243, 243, 243, 248, 248, 248, 248, 248, 255, + 250, 154, 92, 283, 283, 251, 284, 252, 385, 255, + 255, 255, 255, 255, 255, 256, 94, 282, 350, 286, + 253, 257, 283, 284, 92, 256, 256, 256, 256, 256, + 256, 257, 257, 257, 257, 257, 257, 258, 94, 154, + + 366, 377, 284, 259, 154, 154, 391, 258, 258, 258, + 258, 258, 258, 259, 259, 259, 259, 259, 259, 260, + 113, 113, 113, 113, 113, 262, 154, 394, 421, 260, + 260, 260, 260, 260, 260, 262, 262, 262, 262, 262, + 262, 263, 154, 154, 116, 154, 116, 266, 435, 392, + 393, 263, 263, 263, 263, 263, 263, 266, 266, 266, + 266, 266, 266, 267, 128, 128, 128, 128, 128, 273, + 154, 154, 154, 267, 267, 267, 267, 267, 267, 273, + 273, 273, 273, 273, 273, 274, 154, 448, 154, 442, + 131, 275, 429, 395, 404, 274, 274, 274, 274, 274, + + 274, 275, 275, 275, 275, 275, 275, 248, 248, 248, + 248, 248, 154, 250, 332, 400, 154, 154, 251, 419, + 252, 281, 281, 281, 281, 281, 294, 478, 92, 94, + 405, 406, 478, 253, 252, 154, 294, 294, 294, 294, + 294, 294, 94, 154, 154, 154, 416, 253, 281, 281, + 281, 281, 287, 417, 289, 418, 468, 407, 295, 289, + 289, 290, 390, 408, 318, 154, 154, 291, 295, 295, + 295, 295, 295, 295, 292, 296, 422, 291, 291, 291, + 291, 291, 291, 297, 154, 296, 296, 296, 296, 296, + 296, 298, 317, 297, 297, 297, 297, 297, 297, 299, + + 430, 298, 298, 298, 298, 298, 298, 301, 316, 299, + 299, 299, 299, 299, 299, 302, 315, 301, 301, 301, + 301, 301, 301, 304, 154, 302, 302, 302, 302, 302, + 302, 305, 131, 304, 304, 304, 304, 304, 304, 310, + 293, 305, 305, 305, 305, 305, 305, 311, 280, 310, + 310, 310, 310, 310, 310, 312, 154, 311, 311, 311, + 311, 311, 311, 420, 154, 312, 312, 312, 312, 312, + 312, 282, 282, 282, 321, 154, 154, 323, 415, 154, + 401, 154, 279, 402, 441, 281, 281, 281, 281, 281, + 324, 478, 278, 450, 154, 131, 478, 325, 252, 431, + + 324, 324, 324, 324, 324, 324, 285, 285, 285, 326, + 131, 253, 478, 478, 478, 478, 478, 328, 281, 281, + 281, 281, 281, 154, 478, 329, 154, 154, 478, 478, + 434, 252, 330, 440, 154, 329, 329, 329, 329, 329, + 329, 154, 226, 154, 253, 281, 281, 281, 281, 281, + 449, 478, 254, 154, 456, 451, 478, 472, 252, 281, + 281, 281, 281, 281, 333, 478, 154, 476, 154, 154, + 478, 253, 252, 454, 333, 333, 333, 333, 333, 333, + 425, 425, 425, 425, 425, 253, 287, 287, 287, 287, + 287, 443, 478, 426, 154, 467, 334, 478, 247, 252, + + 151, 151, 151, 151, 151, 331, 334, 334, 334, 334, + 334, 334, 253, 246, 462, 331, 331, 331, 331, 331, + 331, 281, 281, 281, 281, 287, 154, 289, 154, 154, + 154, 335, 289, 289, 290, 455, 457, 154, 131, 131, + 291, 335, 335, 335, 335, 335, 335, 292, 336, 131, + 291, 291, 291, 291, 291, 291, 338, 466, 336, 336, + 336, 336, 336, 336, 339, 154, 338, 338, 338, 338, + 338, 338, 341, 131, 339, 339, 339, 339, 339, 339, + 342, 154, 341, 341, 341, 341, 341, 341, 470, 226, + 342, 342, 342, 342, 342, 342, 89, 89, 89, 89, + + 89, 346, 463, 154, 154, 116, 217, 214, 92, 460, + 471, 346, 346, 346, 346, 346, 346, 347, 154, 154, + 164, 154, 94, 154, 477, 473, 475, 347, 347, 347, + 347, 347, 347, 355, 319, 319, 319, 355, 154, 283, + 461, 359, 319, 319, 319, 359, 356, 197, 154, 131, + 131, 131, 283, 131, 360, 474, 131, 131, 363, 284, + 322, 357, 357, 357, 322, 131, 283, 286, 363, 363, + 363, 363, 363, 363, 355, 319, 319, 319, 355, 358, + 283, 179, 179, 179, 179, 179, 284, 356, 131, 358, + 358, 358, 358, 358, 358, 282, 282, 282, 321, 131, + + 284, 323, 131, 131, 131, 39, 127, 116, 116, 188, + 188, 188, 188, 188, 324, 39, 39, 39, 39, 39, + 39, 325, 116, 174, 324, 324, 324, 324, 324, 324, + 327, 361, 361, 361, 327, 131, 164, 154, 149, 131, + 365, 283, 131, 200, 200, 200, 200, 200, 57, 362, + 365, 365, 365, 365, 365, 365, 286, 63, 59, 362, + 362, 362, 362, 362, 362, 285, 285, 285, 326, 154, + 127, 123, 116, 106, 101, 48, 328, 100, 91, 79, + 58, 57, 50, 47, 329, 48, 48, 48, 48, 48, + 48, 330, 367, 478, 329, 329, 329, 329, 329, 329, + + 369, 35, 367, 367, 367, 367, 367, 367, 35, 478, + 369, 369, 369, 369, 369, 369, 162, 162, 162, 162, + 162, 372, 478, 478, 478, 478, 478, 478, 92, 478, + 478, 372, 372, 372, 372, 372, 372, 373, 478, 478, + 478, 478, 94, 478, 478, 478, 478, 373, 373, 373, + 373, 373, 373, 359, 319, 319, 319, 359, 374, 478, + 478, 478, 478, 478, 283, 478, 360, 478, 374, 374, + 374, 374, 374, 374, 375, 478, 478, 154, 478, 286, + 478, 478, 478, 378, 375, 375, 375, 375, 375, 375, + 379, 478, 380, 386, 478, 478, 478, 381, 382, 387, + + 478, 383, 478, 386, 386, 386, 386, 386, 386, 387, + 387, 387, 387, 387, 387, 388, 478, 478, 478, 478, + 478, 389, 478, 478, 478, 388, 388, 388, 388, 388, + 388, 389, 389, 389, 389, 389, 389, 397, 478, 478, + 478, 478, 478, 398, 478, 478, 478, 397, 397, 397, + 397, 397, 397, 398, 398, 398, 398, 398, 398, 399, + 478, 478, 478, 478, 478, 409, 478, 478, 478, 399, + 399, 399, 399, 399, 399, 409, 409, 409, 409, 409, + 409, 410, 478, 478, 478, 478, 478, 249, 478, 478, + 478, 410, 410, 410, 410, 410, 410, 249, 249, 249, + + 249, 249, 249, 411, 411, 411, 411, 411, 478, 478, + 282, 478, 478, 478, 478, 478, 478, 478, 478, 412, + 282, 282, 282, 282, 282, 282, 285, 478, 478, 413, + 411, 411, 411, 411, 411, 478, 285, 285, 285, 285, + 285, 285, 478, 478, 478, 478, 412, 424, 478, 478, + 425, 425, 425, 425, 425, 478, 413, 424, 424, 424, + 424, 424, 424, 426, 425, 425, 425, 425, 425, 478, + 425, 425, 425, 425, 425, 478, 428, 426, 478, 478, + 478, 478, 478, 426, 478, 478, 478, 439, 478, 478, + 428, 436, 436, 436, 436, 436, 428, 439, 439, 439, + + 439, 439, 439, 478, 426, 425, 425, 425, 425, 425, + 437, 478, 478, 478, 478, 478, 478, 428, 426, 478, + 437, 437, 437, 437, 437, 437, 445, 478, 478, 478, + 478, 428, 478, 478, 478, 478, 445, 445, 445, 445, + 445, 445, 425, 425, 425, 425, 425, 452, 478, 478, + 425, 425, 425, 425, 425, 426, 478, 452, 452, 452, + 452, 452, 452, 426, 478, 478, 478, 453, 428, 446, + 446, 446, 446, 446, 478, 478, 428, 453, 453, 453, + 453, 453, 453, 478, 478, 478, 478, 478, 447, 478, + 478, 478, 478, 478, 458, 478, 478, 478, 447, 447, + + 447, 447, 447, 447, 458, 458, 458, 458, 458, 458, + 459, 478, 478, 478, 478, 478, 464, 478, 478, 478, + 459, 459, 459, 459, 459, 459, 464, 464, 464, 464, + 464, 464, 465, 478, 478, 478, 478, 478, 427, 478, + 478, 478, 465, 465, 465, 465, 465, 465, 427, 427, + 427, 427, 427, 427, 469, 478, 478, 478, 478, 478, + 427, 478, 478, 478, 469, 469, 469, 469, 469, 469, + 427, 427, 427, 427, 427, 427, 39, 478, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 45, 45, 478, + 45, 45, 48, 478, 48, 48, 48, 48, 48, 48, + + 48, 48, 48, 54, 54, 478, 54, 54, 82, 478, + 478, 82, 82, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 93, 478, 93, 93, 478, 93, 93, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, - 108, 113, 113, 478, 113, 113, 116, 116, 116, 116, - 116, 116, 116, 116, 116, 116, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 119, 119, 126, - 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 128, 128, 478, 128, 128, 146, 146, - 146, 146, 146, 146, 146, 146, 146, 146, 151, 151, - 478, 151, 151, 159, 159, 159, 159, 159, 159, 159, - - 159, 159, 159, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 166, 166, 166, 179, 179, 179, 179, - 179, 179, 179, 179, 179, 179, 48, 48, 478, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 119, - 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, - 119, 119, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - - 211, 211, 211, 211, 39, 478, 478, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 225, 225, 225, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 115, + 115, 478, 115, 115, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 65, 65, 128, + 128, 128, 128, 128, 128, 128, 128, 128, 130, 130, + 478, 130, 130, 151, 151, 151, 151, 151, 151, 151, + + 151, 151, 153, 153, 478, 153, 153, 162, 162, 162, + 162, 162, 162, 162, 162, 162, 179, 179, 179, 179, + 179, 179, 179, 179, 179, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 200, 200, 200, 200, + 200, 200, 200, 200, 200, 212, 212, 212, 478, 212, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, - 225, 243, 243, 243, 243, 248, 248, 248, 248, 248, - 248, 478, 248, 248, 248, 248, 248, 248, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 275, 275, 275, 275, 248, - 248, 248, 248, 248, 248, 478, 248, 248, 248, 248, - 248, 248, 281, 478, 478, 281, 281, 281, 281, 281, - - 281, 281, 281, 281, 281, 284, 478, 478, 284, 284, - 284, 284, 284, 284, 284, 284, 284, 284, 287, 287, - 287, 287, 287, 287, 287, 287, 287, 287, 287, 287, - 287, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 113, 113, 478, 113, 113, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 312, 312, 312, 312, 321, 321, 321, 321, - 321, 321, 321, 321, 321, 321, 321, 321, 321, 284, - 478, 478, 284, 284, 284, 284, 284, 284, 284, 284, - 284, 284, 326, 326, 326, 326, 326, 326, 326, 326, - - 326, 326, 326, 326, 326, 248, 248, 248, 248, 248, - 478, 478, 248, 248, 248, 248, 248, 248, 287, 287, - 287, 287, 287, 287, 287, 287, 287, 287, 287, 287, - 287, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 113, 113, 478, 113, 113, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 348, 348, 348, 348, 281, 281, 478, 281, - 281, 281, 281, 281, 281, 281, 281, 281, 281, 321, - 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, - 321, 321, 284, 284, 478, 284, 284, 284, 284, 284, - - 284, 284, 284, 284, 284, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, 248, 248, - 248, 248, 248, 478, 478, 248, 248, 248, 248, 248, - 248, 413, 413, 413, 413, 478, 478, 478, 478, 413, - 478, 478, 413, 413, 425, 425, 425, 425, 478, 478, - 478, 425, 425, 425, 478, 425, 425, 427, 427, 427, - 427, 427, 427, 427, 427, 427, 427, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 436, 7, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 225, 225, 244, 244, 244, 478, 244, 249, 249, 249, + 249, 478, 249, 249, 249, 249, 249, 249, 276, 276, + 276, 478, 276, 282, 478, 282, 282, 282, 282, 282, + + 282, 282, 282, 282, 285, 478, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 288, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 313, 313, 313, 478, + 313, 322, 322, 322, 322, 322, 322, 322, 322, 322, + 322, 322, 327, 327, 327, 327, 327, 327, 327, 327, + 327, 327, 327, 348, 348, 348, 478, 348, 414, 414, + 414, 478, 478, 478, 414, 478, 478, 414, 414, 423, + 423, 423, 423, 423, 423, 423, 423, 423, 427, 427, + 427, 478, 478, 427, 427, 427, 478, 427, 427, 438, + 438, 438, 438, 438, 438, 438, 438, 438, 7, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478 + 478, 478, 478, 478, 478, 478, 478, 478, 478 } ; -static yyconst flex_int16_t yy_chk[6664] = +static yyconst flex_int16_t yy_chk[2460] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -1048,733 +576,270 @@ static yyconst flex_int16_t yy_chk[6664] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 3, 5, 4, 6, 15, - 12, 3, 477, 4, 9, 9, 9, 9, 9, 10, - - 10, 10, 10, 10, 3, 3, 4, 4, 11, 11, - 11, 11, 11, 23, 39, 5, 17, 6, 35, 17, - 3, 24, 4, 32, 24, 24, 32, 32, 38, 48, - 15, 69, 3, 3, 4, 4, 12, 42, 25, 17, - 42, 25, 11, 474, 69, 3, 35, 4, 17, 24, - 53, 32, 17, 23, 31, 78, 38, 78, 35, 69, - 39, 24, 467, 32, 33, 461, 65, 17, 83, 25, - 48, 11, 13, 42, 35, 13, 17, 24, 25, 32, - 83, 31, 13, 13, 13, 13, 13, 13, 65, 54, - 53, 33, 54, 54, 31, 65, 83, 25, 36, 36, - - 36, 36, 36, 70, 33, 68, 68, 456, 13, 31, - 166, 13, 13, 13, 13, 13, 13, 20, 166, 33, - 211, 90, 70, 440, 20, 20, 434, 20, 211, 54, - 124, 124, 70, 68, 20, 20, 20, 20, 20, 20, + 3, 134, 4, 9, 9, 9, 9, 9, 12, 3, + 134, 4, 10, 10, 10, 10, 10, 11, 11, 11, + 11, 11, 3, 3, 4, 4, 13, 67, 12, 13, + 15, 39, 52, 25, 67, 3, 13, 4, 31, 13, + + 13, 13, 13, 13, 13, 15, 17, 25, 22, 17, + 27, 39, 31, 27, 11, 52, 17, 26, 22, 69, + 26, 26, 71, 22, 27, 48, 22, 42, 31, 22, + 42, 26, 17, 22, 22, 156, 22, 42, 71, 69, + 48, 17, 20, 23, 27, 64, 54, 64, 26, 20, + 20, 156, 20, 23, 23, 23, 23, 23, 23, 20, + 54, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 90, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 64, 52, - 106, 20, 22, 74, 55, 429, 37, 37, 37, 37, - - 37, 57, 64, 57, 22, 243, 487, 22, 487, 52, - 22, 419, 55, 243, 22, 22, 64, 22, 106, 74, - 67, 66, 74, 57, 72, 72, 385, 127, 22, 67, - 37, 127, 66, 22, 55, 66, 22, 52, 71, 22, - 97, 55, 22, 22, 71, 22, 26, 73, 67, 66, - 82, 57, 71, 26, 26, 26, 26, 26, 26, 37, - 66, 72, 108, 109, 73, 80, 71, 76, 73, 82, - 107, 73, 71, 76, 86, 107, 73, 85, 140, 82, - 97, 384, 26, 26, 26, 26, 26, 26, 41, 41, - 41, 41, 73, 118, 41, 76, 73, 80, 84, 85, - - 86, 80, 87, 86, 348, 175, 85, 41, 108, 109, - 96, 140, 84, 93, 41, 41, 41, 41, 41, 41, - 93, 107, 94, 119, 102, 80, 84, 104, 87, 342, - 250, 87, 103, 119, 118, 96, 317, 105, 161, 316, - 41, 102, 315, 41, 41, 41, 41, 41, 41, 44, - 96, 175, 104, 93, 314, 94, 44, 44, 44, 44, - 44, 44, 94, 96, 102, 103, 120, 104, 105, 125, - 102, 250, 103, 275, 119, 131, 120, 105, 161, 134, - 104, 275, 44, 94, 125, 44, 44, 44, 44, 44, - 44, 46, 144, 103, 150, 131, 105, 145, 46, 46, - - 46, 46, 46, 46, 131, 134, 145, 165, 134, 125, - 137, 137, 148, 125, 156, 144, 150, 120, 192, 153, - 226, 144, 148, 150, 226, 145, 154, 46, 46, 46, - 46, 46, 46, 49, 49, 49, 49, 156, 137, 154, - 148, 157, 155, 156, 49, 153, 158, 165, 153, 174, - 190, 192, 49, 155, 154, 157, 168, 170, 164, 49, - 49, 49, 49, 49, 49, 164, 158, 171, 173, 157, - 155, 172, 182, 190, 235, 158, 184, 174, 216, 190, - 249, 499, 182, 499, 284, 49, 194, 217, 49, 49, - 49, 49, 49, 49, 56, 196, 168, 170, 164, 194, - - 184, 56, 56, 56, 56, 56, 56, 171, 173, 172, - 235, 172, 201, 198, 194, 217, 184, 196, 216, 325, - 293, 201, 202, 182, 196, 284, 249, 203, 184, 202, - 56, 56, 56, 56, 56, 56, 77, 172, 198, 203, - 201, 204, 198, 77, 77, 77, 77, 77, 77, 293, - 202, 231, 232, 234, 390, 203, 281, 320, 390, 204, - 325, 234, 205, 492, 492, 231, 254, 509, 232, 509, - 204, 206, 77, 77, 77, 77, 77, 77, 88, 231, - 232, 234, 224, 236, 205, 88, 88, 88, 88, 88, - 88, 205, 236, 206, 254, 214, 214, 214, 214, 214, - - 206, 214, 281, 320, 224, 265, 214, 313, 214, 237, - 306, 236, 332, 238, 88, 88, 88, 88, 88, 88, - 91, 238, 224, 265, 364, 307, 271, 91, 91, 91, - 91, 91, 91, 224, 265, 237, 306, 271, 237, 306, - 332, 238, 247, 247, 247, 247, 247, 214, 247, 267, - 296, 268, 364, 247, 271, 247, 91, 91, 91, 91, - 91, 91, 98, 98, 98, 98, 98, 279, 511, 337, - 511, 267, 268, 340, 98, 269, 303, 305, 267, 312, - 268, 98, 269, 303, 305, 278, 308, 312, 98, 98, - 98, 98, 98, 98, 247, 248, 248, 248, 248, 248, - - 337, 248, 277, 269, 303, 305, 248, 276, 248, 340, - 463, 515, 308, 515, 98, 308, 270, 98, 98, 98, - 98, 98, 98, 110, 110, 110, 110, 110, 337, 110, - 280, 280, 280, 280, 280, 282, 282, 282, 282, 282, - 321, 343, 110, 280, 246, 321, 463, 248, 282, 110, - 110, 110, 110, 110, 110, 286, 286, 286, 286, 286, - 318, 318, 318, 318, 318, 343, 245, 366, 286, 517, - 343, 517, 370, 318, 394, 110, 344, 366, 110, 110, - 110, 110, 110, 110, 111, 111, 111, 111, 244, 394, - 111, 321, 239, 229, 370, 287, 287, 287, 287, 287, - - 344, 370, 394, 111, 383, 344, 366, 286, 287, 228, - 111, 111, 111, 111, 111, 111, 288, 288, 288, 288, - 288, 289, 289, 289, 289, 289, 356, 225, 326, 288, - 383, 356, 213, 383, 289, 392, 111, 392, 326, 111, - 111, 111, 111, 111, 111, 114, 393, 287, 462, 212, - 462, 403, 114, 114, 114, 114, 114, 114, 322, 322, - 322, 322, 322, 392, 322, 357, 199, 193, 288, 393, - 357, 322, 403, 289, 191, 393, 462, 356, 114, 326, - 403, 114, 114, 114, 114, 114, 114, 115, 189, 327, - 327, 327, 327, 327, 115, 115, 115, 115, 115, 115, - - 327, 187, 327, 331, 331, 331, 331, 331, 185, 179, - 322, 333, 333, 333, 333, 333, 357, 333, 167, 331, - 371, 163, 159, 115, 115, 115, 115, 115, 115, 117, - 117, 117, 117, 117, 346, 346, 346, 346, 346, 151, - 149, 327, 371, 336, 336, 336, 336, 336, 117, 371, - 346, 360, 361, 146, 336, 117, 117, 117, 117, 117, - 117, 360, 361, 333, 365, 365, 365, 365, 365, 416, - 345, 345, 345, 345, 345, 367, 367, 367, 367, 367, - 143, 142, 416, 377, 117, 117, 117, 117, 117, 117, - 121, 121, 121, 121, 121, 336, 524, 416, 524, 141, - - 441, 121, 360, 361, 369, 369, 369, 369, 369, 121, - 377, 378, 379, 139, 441, 380, 121, 121, 121, 121, - 121, 121, 345, 355, 355, 355, 355, 355, 441, 355, - 527, 415, 527, 378, 379, 138, 355, 380, 377, 415, - 378, 379, 121, 395, 380, 121, 121, 121, 121, 121, - 121, 122, 122, 122, 122, 381, 369, 136, 395, 415, - 418, 381, 122, 359, 359, 359, 359, 359, 382, 391, - 122, 395, 391, 402, 359, 355, 359, 122, 122, 122, - 122, 122, 122, 381, 135, 401, 418, 133, 407, 418, - 382, 402, 132, 391, 407, 130, 405, 382, 391, 396, - - 401, 391, 402, 122, 128, 396, 122, 122, 122, 122, - 122, 122, 129, 401, 396, 359, 407, 406, 405, 129, - 129, 129, 129, 129, 129, 405, 537, 396, 537, 544, - 545, 544, 545, 396, 399, 399, 399, 399, 399, 406, - 126, 404, 408, 116, 113, 95, 406, 399, 129, 129, - 129, 129, 129, 129, 147, 147, 147, 147, 147, 404, - 408, 92, 81, 79, 410, 410, 410, 410, 410, 417, - 404, 408, 75, 147, 63, 410, 420, 61, 417, 421, - 147, 147, 147, 147, 147, 147, 399, 400, 400, 400, - 400, 400, 409, 409, 409, 409, 409, 417, 409, 60, - - 420, 421, 59, 400, 58, 420, 147, 51, 421, 147, - 147, 147, 147, 147, 147, 152, 410, 411, 411, 411, - 411, 411, 152, 152, 152, 152, 152, 152, 413, 413, - 413, 413, 413, 411, 45, 29, 28, 422, 27, 400, - 21, 413, 430, 19, 409, 435, 412, 412, 412, 412, - 412, 152, 152, 152, 152, 152, 152, 160, 160, 160, - 160, 160, 412, 422, 430, 18, 422, 432, 431, 411, - 435, 430, 433, 16, 435, 442, 160, 432, 468, 433, - 413, 442, 448, 160, 160, 160, 160, 160, 160, 423, - 423, 423, 423, 423, 431, 432, 443, 431, 412, 14, - - 433, 468, 423, 442, 448, 449, 7, 468, 443, 160, - 444, 448, 160, 160, 160, 160, 160, 160, 162, 162, - 162, 162, 162, 0, 443, 444, 0, 449, 425, 425, - 425, 425, 425, 450, 449, 0, 454, 162, 444, 0, - 451, 425, 450, 0, 162, 162, 162, 162, 162, 162, - 427, 427, 427, 427, 427, 436, 436, 436, 436, 436, - 0, 450, 451, 427, 454, 466, 0, 0, 436, 451, - 0, 466, 454, 162, 162, 162, 162, 162, 162, 169, - 425, 438, 438, 438, 438, 438, 169, 169, 169, 169, - 169, 169, 454, 466, 438, 0, 0, 0, 457, 0, - - 455, 460, 427, 476, 0, 0, 457, 436, 471, 455, - 460, 476, 472, 0, 473, 169, 169, 169, 169, 169, - 169, 176, 176, 176, 176, 176, 457, 176, 455, 460, - 471, 476, 0, 438, 472, 0, 0, 471, 473, 0, - 176, 472, 0, 473, 0, 0, 0, 176, 176, 176, - 176, 176, 176, 445, 445, 445, 445, 445, 465, 465, - 465, 465, 465, 0, 0, 0, 445, 0, 0, 0, - 0, 465, 0, 176, 0, 0, 176, 176, 176, 176, - 176, 176, 178, 469, 469, 469, 469, 469, 470, 178, - 178, 178, 178, 178, 178, 0, 469, 0, 0, 0, - - 0, 0, 475, 470, 0, 445, 0, 0, 0, 0, - 465, 0, 0, 0, 0, 0, 470, 475, 178, 178, - 178, 178, 178, 178, 180, 180, 180, 180, 180, 0, - 475, 0, 0, 0, 0, 469, 0, 0, 0, 0, - 0, 0, 0, 180, 0, 0, 0, 0, 0, 0, - 180, 180, 180, 180, 180, 180, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 180, - 180, 180, 180, 180, 180, 181, 181, 181, 181, 181, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 181, 0, 0, 0, 0, 0, - 0, 181, 181, 181, 181, 181, 181, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 181, 181, 181, 181, 181, 181, 183, 183, 183, 183, - 183, 0, 0, 0, 0, 0, 0, 183, 0, 0, - 0, 0, 0, 0, 0, 183, 0, 0, 0, 0, - 0, 0, 183, 183, 183, 183, 183, 183, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 183, 0, - - 0, 183, 183, 183, 183, 183, 183, 188, 188, 188, - 188, 188, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 188, 0, 0, 0, - 0, 0, 0, 188, 188, 188, 188, 188, 188, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 188, 188, 188, 188, 188, 188, 195, 0, - 0, 0, 0, 0, 0, 195, 195, 195, 195, 195, - 195, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 195, 195, 195, 195, 195, 195, - 200, 200, 200, 200, 200, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, - 0, 0, 0, 0, 0, 0, 200, 200, 200, 200, - 200, 200, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 200, 200, 200, 200, 200, - 200, 207, 0, 0, 0, 0, 0, 0, 207, 207, - 207, 207, 207, 207, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 207, 207, 207, - 207, 207, 207, 208, 208, 208, 208, 208, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 208, 0, 0, 0, 0, 0, 0, 208, - 208, 208, 208, 208, 208, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 208, 208, - 208, 208, 208, 208, 215, 0, 0, 0, 0, 0, - 0, 215, 215, 215, 215, 215, 215, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 215, 215, 215, 215, 215, 215, 218, 218, 218, 218, - 218, 0, 218, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 218, 0, 0, 0, 0, - 0, 0, 218, 218, 218, 218, 218, 218, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 218, 0, - 0, 218, 218, 218, 218, 218, 218, 220, 0, 0, - 0, 0, 0, 0, 220, 220, 220, 220, 220, 220, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 220, 220, 220, 220, 220, 220, 221, - 221, 221, 221, 221, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 221, 0, - 0, 0, 0, 0, 0, 221, 221, 221, 221, 221, - 221, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 221, 221, 221, 221, 221, 221, - 222, 222, 222, 222, 222, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 222, - - 0, 0, 0, 0, 0, 0, 222, 222, 222, 222, - 222, 222, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 222, 222, 222, 222, 222, - 222, 223, 223, 223, 223, 223, 0, 0, 0, 0, - 0, 0, 223, 0, 0, 0, 0, 0, 0, 0, - 223, 0, 0, 0, 0, 0, 0, 223, 223, 223, - 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 223, 0, 0, 223, 223, 223, 223, - - 223, 223, 227, 227, 227, 227, 227, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 227, 0, 0, 0, 0, 0, 0, 227, 227, - 227, 227, 227, 227, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 227, 227, 227, - 227, 227, 227, 230, 0, 0, 0, 0, 0, 0, - 230, 230, 230, 230, 230, 230, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, - - 230, 230, 230, 230, 230, 233, 233, 233, 233, 233, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 233, 0, 0, 0, 0, 0, - 0, 233, 233, 233, 233, 233, 233, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 233, 233, 233, 233, 233, 233, 240, 0, 0, 0, - 0, 0, 0, 240, 240, 240, 240, 240, 240, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 240, 240, 240, 240, 240, 240, 241, 241, - 241, 241, 241, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 241, 0, 0, - 0, 0, 0, 0, 241, 241, 241, 241, 241, 241, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 241, 241, 241, 241, 241, 241, 252, - 252, 252, 252, 252, 0, 252, 0, 0, 0, 0, - 252, 252, 252, 0, 0, 0, 0, 0, 252, 0, - 0, 0, 0, 0, 0, 252, 252, 252, 252, 252, - - 252, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 252, 0, 0, 252, 252, 252, 252, 252, 252, - 253, 0, 0, 0, 0, 0, 0, 253, 253, 253, - 253, 253, 253, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 253, 253, 253, 253, - 253, 253, 255, 255, 255, 255, 255, 0, 255, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 255, 0, 0, 0, 0, 0, 0, 255, 255, - - 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 255, 0, 0, 255, 255, 255, - 255, 255, 255, 257, 0, 0, 0, 0, 0, 0, - 257, 257, 257, 257, 257, 257, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 257, 0, 0, 257, - 257, 257, 257, 257, 257, 258, 258, 258, 258, 258, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 258, 0, 0, 0, 0, 0, - - 0, 258, 258, 258, 258, 258, 258, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 258, 0, 0, - 258, 258, 258, 258, 258, 258, 259, 259, 259, 259, - 259, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 259, 0, 0, 0, 0, - 0, 0, 259, 259, 259, 259, 259, 259, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 259, 259, 259, 259, 259, 259, 260, 260, 260, - - 260, 260, 0, 0, 0, 0, 0, 0, 260, 0, - 0, 0, 0, 0, 0, 0, 260, 0, 0, 0, - 0, 0, 0, 260, 260, 260, 260, 260, 260, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 260, - 0, 0, 260, 260, 260, 260, 260, 260, 261, 261, - 261, 261, 261, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 261, 0, 0, - 0, 0, 0, 0, 261, 261, 261, 261, 261, 261, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 261, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 261, 261, 261, 261, 261, 261, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 261, 262, 262, 262, 262, 262, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 262, 0, 0, 0, 0, 0, 0, 262, 262, - 262, 262, 262, 262, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 262, 262, 262, - 262, 262, 262, 263, 0, 0, 0, 0, 0, 0, - - 263, 263, 263, 263, 263, 263, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 263, - 263, 263, 263, 263, 263, 264, 264, 264, 264, 264, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 264, 0, 0, 0, 0, 0, - 0, 264, 264, 264, 264, 264, 264, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 264, 264, 264, 264, 264, 264, 266, 266, 266, 266, - - 266, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 266, 0, 0, 0, 0, - 0, 0, 266, 266, 266, 266, 266, 266, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 266, 266, 266, 266, 266, 266, 272, 0, 0, - 0, 0, 0, 0, 272, 272, 272, 272, 272, 272, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 272, 272, 272, 272, 272, 272, 273, - - 273, 273, 273, 273, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 273, 0, - 0, 0, 0, 0, 0, 273, 273, 273, 273, 273, - 273, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 273, 273, 273, 273, 273, 273, - 283, 283, 283, 283, 0, 0, 283, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 283, - 0, 0, 0, 0, 0, 0, 283, 283, 283, 283, - 283, 283, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 283, 0, 0, 283, 283, 283, 283, 283, - 283, 285, 285, 285, 285, 0, 0, 0, 0, 0, - 0, 0, 285, 0, 0, 0, 0, 0, 0, 0, - 285, 0, 0, 0, 0, 0, 0, 285, 285, 285, - 285, 285, 285, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 285, 0, 0, 285, 285, 285, 285, - 285, 285, 290, 290, 290, 290, 290, 0, 0, 0, - 0, 0, 0, 0, 0, 290, 0, 0, 0, 0, - - 0, 290, 0, 0, 0, 0, 0, 0, 290, 290, - 290, 290, 290, 290, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 290, 0, 0, 290, 290, 290, - 290, 290, 290, 291, 291, 291, 291, 291, 0, 291, - 0, 0, 0, 0, 291, 291, 291, 0, 0, 0, - 0, 0, 291, 0, 0, 0, 0, 0, 0, 291, - 291, 291, 291, 291, 291, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 291, 0, 0, 291, 291, - - 291, 291, 291, 291, 292, 0, 0, 0, 0, 0, - 0, 292, 292, 292, 292, 292, 292, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 292, 292, 292, 292, 292, 292, 294, 294, 294, 294, - 294, 0, 294, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 294, 0, 0, 0, 0, - 0, 0, 294, 294, 294, 294, 294, 294, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 294, 0, - - 0, 294, 294, 294, 294, 294, 294, 297, 297, 297, - 297, 297, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 297, 0, 0, 0, - 0, 0, 0, 297, 297, 297, 297, 297, 297, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 297, - 0, 0, 297, 297, 297, 297, 297, 297, 298, 298, - 298, 298, 298, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 298, 0, 0, - 0, 0, 0, 0, 298, 298, 298, 298, 298, 298, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 298, 298, 298, 298, 298, 298, 299, - 299, 299, 299, 299, 0, 0, 0, 0, 0, 0, - 299, 0, 0, 0, 0, 0, 0, 0, 299, 0, - 0, 0, 0, 0, 0, 299, 299, 299, 299, 299, - 299, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 299, 0, 0, 299, 299, 299, 299, 299, 299, - 300, 300, 300, 300, 300, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 300, 0, 0, 300, - 0, 0, 0, 0, 0, 0, 300, 300, 300, 300, - 300, 300, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 300, 300, 300, 300, 300, - 300, 301, 301, 301, 301, 301, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 301, 0, 0, 0, 0, 0, 0, 301, 301, 301, - 301, 301, 301, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 301, 301, 301, 301, - 301, 301, 302, 302, 302, 302, 302, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 302, 0, 0, 0, 0, 0, 0, 302, 302, - 302, 302, 302, 302, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 302, 302, 302, - 302, 302, 302, 304, 304, 304, 304, 304, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 304, 0, 0, 0, 0, 0, 0, 304, - - 304, 304, 304, 304, 304, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 304, 304, - 304, 304, 304, 304, 309, 0, 0, 0, 0, 0, - 0, 309, 309, 309, 309, 309, 309, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 309, 309, 309, 309, 309, 309, 310, 310, 310, 310, - 310, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 310, 0, 0, 0, 0, - - 0, 0, 310, 310, 310, 310, 310, 310, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 310, 310, 310, 310, 310, 310, 323, 323, 323, - 323, 323, 0, 323, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 323, 0, 0, 0, - 0, 0, 0, 323, 323, 323, 323, 323, 323, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 323, - 0, 0, 323, 323, 323, 323, 323, 323, 324, 324, - - 324, 324, 0, 0, 324, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 324, 0, 0, - 0, 0, 0, 0, 324, 324, 324, 324, 324, 324, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 324, 0, 0, 324, 324, 324, 324, 324, 324, 328, - 328, 328, 328, 328, 0, 0, 0, 0, 0, 0, - 328, 0, 0, 0, 0, 0, 0, 0, 328, 0, - 0, 0, 0, 0, 0, 328, 328, 328, 328, 328, - 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 328, 0, 0, 328, 328, 328, 328, 328, 328, - 329, 329, 329, 329, 0, 0, 0, 0, 0, 0, - 0, 329, 0, 0, 0, 0, 0, 0, 0, 329, - 0, 0, 0, 0, 0, 0, 329, 329, 329, 329, - 329, 329, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 329, 0, 0, 329, 329, 329, 329, 329, - 329, 330, 330, 330, 330, 330, 0, 0, 0, 0, - 0, 0, 0, 0, 330, 0, 0, 0, 0, 0, - - 330, 0, 0, 0, 0, 0, 0, 330, 330, 330, - 330, 330, 330, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 330, 0, 0, 330, 330, 330, 330, - 330, 330, 334, 0, 0, 0, 0, 0, 0, 334, - 334, 334, 334, 334, 334, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 334, 334, - 334, 334, 334, 334, 335, 0, 0, 0, 0, 0, - 0, 335, 335, 335, 335, 335, 335, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 335, 335, 335, 335, 335, 335, 338, 0, 0, 0, - 0, 0, 0, 338, 338, 338, 338, 338, 338, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 338, 338, 338, 338, 338, 338, 339, 339, - 339, 339, 339, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 339, 0, 0, - 0, 0, 0, 0, 339, 339, 339, 339, 339, 339, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 339, 339, 339, 339, 339, 339, 341, - 341, 341, 341, 341, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 341, 0, - 0, 0, 0, 0, 0, 341, 341, 341, 341, 341, - 341, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 341, 341, 341, 341, 341, 341, - 358, 0, 0, 0, 0, 0, 0, 358, 358, 358, - - 358, 358, 358, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 358, 358, 358, 358, - 358, 358, 362, 0, 0, 0, 0, 0, 0, 362, - 362, 362, 362, 362, 362, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 362, 362, - 362, 362, 362, 362, 363, 363, 363, 363, 363, 0, - 0, 0, 0, 0, 0, 0, 0, 363, 0, 0, - 0, 0, 0, 363, 0, 0, 0, 0, 0, 0, - - 363, 363, 363, 363, 363, 363, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 363, 0, 0, 363, - 363, 363, 363, 363, 363, 368, 0, 0, 0, 0, - 0, 0, 368, 0, 368, 0, 0, 0, 0, 368, - 368, 0, 0, 368, 0, 0, 0, 0, 368, 0, - 0, 0, 0, 0, 368, 0, 0, 0, 0, 0, - 368, 0, 368, 0, 0, 0, 0, 368, 368, 0, - 0, 368, 373, 0, 0, 0, 0, 0, 0, 373, - 373, 373, 373, 373, 373, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 373, 373, - 373, 373, 373, 373, 374, 0, 0, 0, 0, 0, - 0, 374, 374, 374, 374, 374, 374, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 374, 374, 374, 374, 374, 374, 375, 0, 0, 0, - 0, 0, 0, 375, 375, 375, 375, 375, 375, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 375, 375, 375, 375, 375, 375, 387, 0, - 0, 0, 0, 0, 0, 387, 387, 387, 387, 387, - 387, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 387, 387, 387, 387, 387, 387, - 388, 0, 0, 0, 0, 0, 0, 388, 388, 388, - 388, 388, 388, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 388, 388, 388, 388, - 388, 388, 389, 0, 0, 0, 0, 0, 0, 389, - - 389, 389, 389, 389, 389, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 389, 389, - 389, 389, 389, 389, 397, 0, 0, 0, 0, 0, - 0, 397, 397, 397, 397, 397, 397, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 397, 397, 397, 397, 397, 397, 398, 0, 0, 0, - 0, 0, 0, 398, 398, 398, 398, 398, 398, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 398, 398, 398, 398, 398, 398, 414, 0, - 0, 0, 0, 0, 0, 414, 414, 414, 414, 414, - 414, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 414, 414, 414, 414, 414, 414, - 426, 0, 0, 0, 0, 0, 0, 426, 426, 426, - 426, 426, 426, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 426, 426, 426, 426, - - 426, 426, 428, 428, 428, 428, 428, 0, 0, 0, - 0, 0, 0, 0, 0, 428, 0, 0, 0, 0, - 0, 428, 0, 0, 0, 0, 0, 0, 428, 428, - 428, 428, 428, 428, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 428, 0, 0, 428, 428, 428, - 428, 428, 428, 437, 437, 437, 437, 437, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 437, 0, 0, 0, 0, 0, 0, 437, - 437, 437, 437, 437, 437, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 437, 437, - 437, 437, 437, 437, 439, 0, 0, 0, 0, 0, - 0, 439, 439, 439, 439, 439, 439, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 439, 439, 439, 439, 439, 439, 446, 0, 0, 0, - 0, 0, 0, 446, 446, 446, 446, 446, 446, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 446, 446, 446, 446, 446, 446, 447, 0, - 0, 0, 0, 0, 0, 447, 447, 447, 447, 447, - 447, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 447, 447, 447, 447, 447, 447, - 452, 0, 0, 0, 0, 0, 0, 452, 452, 452, - 452, 452, 452, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 452, 452, 452, 452, - 452, 452, 453, 0, 0, 0, 0, 0, 0, 453, - - 453, 453, 453, 453, 453, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 453, 453, - 453, 453, 453, 453, 458, 0, 0, 0, 0, 0, - 0, 458, 458, 458, 458, 458, 458, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 458, 458, 458, 458, 458, 458, 459, 0, 0, 0, - 0, 0, 0, 459, 459, 459, 459, 459, 459, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 459, 459, 459, 459, 459, 459, 464, 0, - 0, 0, 0, 0, 0, 464, 464, 464, 464, 464, - 464, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 464, 464, 464, 464, 464, 464, - 479, 0, 0, 479, 479, 479, 479, 479, 479, 479, - 479, 479, 479, 480, 480, 0, 480, 480, 481, 0, - 0, 481, 481, 481, 481, 481, 481, 481, 481, 481, - 481, 482, 482, 0, 482, 482, 483, 0, 0, 483, - - 483, 484, 0, 484, 484, 0, 484, 484, 485, 485, - 485, 485, 485, 485, 485, 485, 485, 485, 486, 486, + 20, 20, 20, 20, 20, 20, 20, 20, 33, 32, + 35, 20, 32, 32, 36, 36, 36, 36, 36, 57, + + 43, 57, 33, 32, 35, 37, 37, 37, 37, 37, + 43, 43, 43, 43, 43, 43, 44, 84, 33, 55, + 32, 35, 55, 55, 57, 46, 44, 44, 44, 44, + 44, 44, 46, 55, 84, 46, 46, 46, 46, 46, + 46, 53, 37, 41, 41, 41, 41, 56, 66, 41, + 72, 53, 53, 53, 53, 53, 53, 70, 147, 86, + 72, 56, 41, 66, 147, 75, 86, 68, 56, 41, + 75, 73, 41, 41, 41, 41, 41, 41, 49, 49, + 49, 49, 68, 74, 74, 70, 73, 75, 63, 49, + 477, 75, 73, 68, 74, 78, 80, 49, 63, 63, + + 63, 63, 63, 63, 49, 83, 80, 49, 49, 49, + 49, 49, 49, 76, 81, 83, 76, 85, 78, 87, + 88, 89, 87, 88, 81, 81, 81, 81, 81, 81, + 93, 80, 85, 102, 108, 89, 90, 90, 90, 90, + 90, 124, 124, 143, 93, 140, 94, 102, 90, 97, + 143, 474, 109, 102, 108, 90, 94, 94, 94, 94, + 94, 94, 90, 97, 96, 90, 90, 90, 90, 90, + 90, 96, 109, 140, 118, 467, 98, 119, 96, 99, + 103, 98, 104, 105, 118, 97, 98, 98, 98, 98, + 98, 98, 119, 99, 103, 107, 104, 105, 120, 118, + + 107, 125, 127, 461, 150, 137, 127, 99, 137, 155, + 104, 150, 155, 120, 148, 125, 103, 105, 112, 125, + 107, 110, 110, 110, 110, 110, 132, 110, 112, 112, + 112, 112, 112, 112, 148, 158, 167, 192, 456, 160, + 110, 158, 157, 192, 167, 132, 159, 110, 160, 162, + 110, 110, 110, 110, 110, 110, 111, 111, 111, 111, + 157, 159, 111, 162, 190, 194, 116, 206, 344, 166, + 169, 190, 194, 344, 206, 111, 116, 116, 116, 116, + 116, 116, 111, 166, 169, 111, 111, 111, 111, 111, + 111, 114, 114, 114, 114, 114, 198, 205, 226, 207, + + 198, 117, 226, 170, 171, 173, 207, 440, 205, 203, + 114, 117, 117, 117, 117, 117, 117, 170, 171, 173, + 114, 114, 114, 114, 114, 114, 121, 121, 121, 121, + 121, 203, 212, 175, 236, 238, 131, 121, 238, 182, + 212, 392, 434, 429, 236, 121, 131, 131, 131, 131, + 131, 131, 121, 175, 182, 121, 121, 121, 121, 121, + 121, 122, 122, 122, 122, 216, 265, 244, 392, 268, + 269, 154, 122, 196, 184, 244, 268, 265, 269, 216, + 122, 154, 154, 154, 154, 154, 154, 122, 184, 196, + 122, 122, 122, 122, 122, 122, 129, 129, 129, 129, + + 129, 184, 276, 202, 340, 307, 161, 204, 307, 309, + 276, 419, 309, 385, 340, 129, 161, 161, 161, 161, + 161, 161, 129, 202, 204, 129, 129, 129, 129, 129, + 129, 152, 152, 152, 152, 152, 232, 165, 172, 229, + 313, 345, 420, 384, 165, 261, 345, 420, 313, 232, + 152, 165, 172, 235, 229, 237, 239, 152, 224, 261, + 152, 152, 152, 152, 152, 152, 163, 163, 163, 163, + 163, 370, 224, 250, 235, 237, 176, 239, 370, 172, + 435, 261, 364, 224, 435, 163, 176, 176, 176, 176, + 176, 176, 177, 250, 251, 163, 163, 163, 163, 163, + + 163, 178, 177, 177, 177, 177, 177, 177, 270, 251, + 272, 178, 178, 178, 178, 178, 178, 180, 180, 180, + 180, 180, 281, 281, 281, 281, 281, 181, 272, 285, + 270, 383, 348, 343, 383, 281, 180, 181, 181, 181, + 181, 181, 181, 183, 285, 332, 180, 180, 180, 180, + 180, 180, 187, 183, 183, 183, 183, 183, 183, 282, + 303, 306, 187, 187, 187, 187, 187, 187, 189, 189, + 189, 189, 189, 283, 283, 283, 283, 283, 199, 282, + 300, 327, 303, 306, 300, 318, 283, 189, 199, 199, + 199, 199, 199, 199, 300, 322, 327, 189, 189, 189, + + 189, 189, 189, 201, 201, 201, 201, 201, 319, 319, + 319, 319, 319, 208, 418, 322, 360, 418, 317, 316, + 326, 319, 201, 208, 208, 208, 208, 208, 208, 209, + 326, 360, 201, 201, 201, 201, 201, 201, 211, 209, + 209, 209, 209, 209, 209, 326, 356, 315, 211, 211, + 211, 211, 211, 211, 215, 215, 215, 215, 215, 218, + 215, 371, 337, 357, 361, 215, 356, 215, 371, 218, + 218, 218, 218, 218, 218, 219, 337, 321, 314, 361, + 215, 220, 321, 357, 366, 219, 219, 219, 219, 219, + 219, 220, 220, 220, 220, 220, 220, 221, 366, 378, + + 337, 366, 321, 222, 381, 407, 378, 221, 221, 221, + 221, 221, 221, 222, 222, 222, 222, 222, 222, 223, + 334, 334, 334, 334, 334, 227, 308, 381, 407, 223, + 223, 223, 223, 223, 223, 227, 227, 227, 227, 227, + 227, 228, 379, 380, 298, 422, 334, 233, 422, 379, + 380, 228, 228, 228, 228, 228, 228, 233, 233, 233, + 233, 233, 233, 234, 338, 338, 338, 338, 338, 241, + 432, 415, 441, 234, 234, 234, 234, 234, 234, 241, + 241, 241, 241, 241, 241, 242, 382, 441, 393, 432, + 338, 243, 415, 382, 393, 242, 242, 242, 242, 242, + + 242, 243, 243, 243, 243, 243, 243, 248, 248, 248, + 248, 248, 405, 248, 293, 390, 394, 395, 248, 405, + 248, 249, 249, 249, 249, 249, 255, 249, 377, 390, + 394, 395, 249, 248, 249, 402, 255, 255, 255, 255, + 255, 255, 377, 396, 404, 403, 402, 249, 253, 253, + 253, 253, 253, 403, 253, 404, 463, 396, 256, 253, + 253, 253, 377, 396, 280, 408, 463, 253, 256, 256, + 256, 256, 256, 256, 253, 257, 408, 253, 253, 253, + 253, 253, 253, 258, 416, 257, 257, 257, 257, 257, + 257, 259, 279, 258, 258, 258, 258, 258, 258, 260, + + 416, 259, 259, 259, 259, 259, 259, 262, 278, 260, + 260, 260, 260, 260, 260, 263, 277, 262, 262, 262, + 262, 262, 262, 266, 271, 263, 263, 263, 263, 263, + 263, 267, 264, 266, 266, 266, 266, 266, 266, 273, + 254, 267, 267, 267, 267, 267, 267, 274, 247, 273, + 273, 273, 273, 273, 273, 275, 406, 274, 274, 274, + 274, 274, 274, 406, 401, 275, 275, 275, 275, 275, + 275, 284, 284, 284, 284, 391, 443, 284, 401, 417, + 391, 431, 246, 391, 431, 287, 287, 287, 287, 287, + 284, 287, 245, 443, 240, 231, 287, 284, 287, 417, + + 284, 284, 284, 284, 284, 284, 286, 286, 286, 286, + 230, 287, 412, 412, 412, 412, 412, 286, 288, 288, + 288, 288, 288, 421, 288, 286, 430, 442, 412, 288, + 421, 288, 286, 430, 450, 286, 286, 286, 286, 286, + 286, 444, 225, 470, 288, 289, 289, 289, 289, 289, + 442, 289, 217, 475, 450, 444, 289, 470, 289, 290, + 290, 290, 290, 290, 294, 290, 448, 475, 462, 433, + 290, 289, 290, 448, 294, 294, 294, 294, 294, 294, + 425, 425, 425, 425, 425, 290, 291, 291, 291, 291, + 291, 433, 291, 425, 455, 462, 296, 291, 214, 291, + + 341, 341, 341, 341, 341, 291, 296, 296, 296, 296, + 296, 296, 291, 213, 455, 291, 291, 291, 291, 291, + 291, 292, 292, 292, 292, 292, 341, 292, 449, 451, + 200, 297, 292, 292, 292, 449, 451, 460, 195, 193, + 292, 297, 297, 297, 297, 297, 297, 292, 299, 191, + 292, 292, 292, 292, 292, 292, 301, 460, 299, 299, + 299, 299, 299, 299, 302, 466, 301, 301, 301, 301, + 301, 301, 304, 188, 302, 302, 302, 302, 302, 302, + 305, 457, 304, 304, 304, 304, 304, 304, 466, 185, + 305, 305, 305, 305, 305, 305, 310, 310, 310, 310, + + 310, 311, 457, 476, 468, 179, 174, 168, 310, 454, + 468, 311, 311, 311, 311, 311, 311, 312, 471, 454, + 164, 473, 310, 153, 476, 471, 473, 312, 312, 312, + 312, 312, 312, 323, 323, 323, 323, 323, 151, 323, + 454, 328, 328, 328, 328, 328, 323, 149, 472, 146, + 145, 144, 328, 142, 328, 472, 141, 139, 331, 323, + 324, 324, 324, 324, 324, 138, 324, 328, 331, 331, + 331, 331, 331, 331, 355, 355, 355, 355, 355, 324, + 355, 365, 365, 365, 365, 365, 324, 355, 136, 324, + 324, 324, 324, 324, 324, 325, 325, 325, 325, 135, + + 355, 325, 133, 130, 128, 333, 126, 365, 115, 367, + 367, 367, 367, 367, 325, 333, 333, 333, 333, 333, + 333, 325, 113, 106, 325, 325, 325, 325, 325, 325, + 329, 329, 329, 329, 329, 367, 95, 82, 79, 77, + 335, 329, 65, 369, 369, 369, 369, 369, 61, 329, + 335, 335, 335, 335, 335, 335, 329, 60, 59, 329, + 329, 329, 329, 329, 329, 330, 330, 330, 330, 369, + 58, 51, 45, 38, 29, 336, 330, 28, 24, 21, + 19, 18, 16, 14, 330, 336, 336, 336, 336, 336, + 336, 330, 339, 7, 330, 330, 330, 330, 330, 330, + + 342, 6, 339, 339, 339, 339, 339, 339, 5, 0, + 342, 342, 342, 342, 342, 342, 346, 346, 346, 346, + 346, 347, 0, 0, 0, 0, 0, 0, 346, 0, + 0, 347, 347, 347, 347, 347, 347, 358, 0, 0, + 0, 0, 346, 0, 0, 0, 0, 358, 358, 358, + 358, 358, 358, 359, 359, 359, 359, 359, 362, 0, + 0, 0, 0, 0, 359, 0, 359, 0, 362, 362, + 362, 362, 362, 362, 363, 0, 0, 368, 0, 359, + 0, 0, 0, 368, 363, 363, 363, 363, 363, 363, + 368, 0, 368, 372, 0, 0, 0, 368, 368, 373, + + 0, 368, 0, 372, 372, 372, 372, 372, 372, 373, + 373, 373, 373, 373, 373, 374, 0, 0, 0, 0, + 0, 375, 0, 0, 0, 374, 374, 374, 374, 374, + 374, 375, 375, 375, 375, 375, 375, 387, 0, 0, + 0, 0, 0, 388, 0, 0, 0, 387, 387, 387, + 387, 387, 387, 388, 388, 388, 388, 388, 388, 389, + 0, 0, 0, 0, 0, 397, 0, 0, 0, 389, + 389, 389, 389, 389, 389, 397, 397, 397, 397, 397, + 397, 398, 0, 0, 0, 0, 0, 399, 0, 0, + 0, 398, 398, 398, 398, 398, 398, 399, 399, 399, + + 399, 399, 399, 400, 400, 400, 400, 400, 0, 0, + 409, 0, 0, 0, 0, 0, 0, 0, 0, 400, + 409, 409, 409, 409, 409, 409, 410, 0, 0, 400, + 411, 411, 411, 411, 411, 0, 410, 410, 410, 410, + 410, 410, 0, 0, 0, 0, 411, 413, 0, 0, + 414, 414, 414, 414, 414, 0, 411, 413, 413, 413, + 413, 413, 413, 414, 423, 423, 423, 423, 423, 0, + 427, 427, 427, 427, 427, 0, 414, 423, 0, 0, + 0, 0, 0, 427, 0, 0, 0, 428, 0, 0, + 423, 424, 424, 424, 424, 424, 427, 428, 428, 428, + + 428, 428, 428, 0, 424, 436, 436, 436, 436, 436, + 424, 0, 0, 0, 0, 0, 0, 424, 436, 0, + 424, 424, 424, 424, 424, 424, 437, 0, 0, 0, + 0, 436, 0, 0, 0, 0, 437, 437, 437, 437, + 437, 437, 438, 438, 438, 438, 438, 445, 0, 0, + 446, 446, 446, 446, 446, 438, 0, 445, 445, 445, + 445, 445, 445, 446, 0, 0, 0, 447, 438, 439, + 439, 439, 439, 439, 0, 0, 446, 447, 447, 447, + 447, 447, 447, 0, 0, 0, 0, 0, 439, 0, + 0, 0, 0, 0, 452, 0, 0, 0, 439, 439, + + 439, 439, 439, 439, 452, 452, 452, 452, 452, 452, + 453, 0, 0, 0, 0, 0, 458, 0, 0, 0, + 453, 453, 453, 453, 453, 453, 458, 458, 458, 458, + 458, 458, 459, 0, 0, 0, 0, 0, 464, 0, + 0, 0, 459, 459, 459, 459, 459, 459, 464, 464, + 464, 464, 464, 464, 465, 0, 0, 0, 0, 0, + 469, 0, 0, 0, 465, 465, 465, 465, 465, 465, + 469, 469, 469, 469, 469, 469, 479, 0, 479, 479, + 479, 479, 479, 479, 479, 479, 479, 480, 480, 0, + 480, 480, 481, 0, 481, 481, 481, 481, 481, 481, + + 481, 481, 481, 482, 482, 0, 482, 482, 483, 0, + 0, 483, 483, 484, 484, 484, 484, 484, 484, 484, + 484, 484, 485, 0, 485, 485, 0, 485, 485, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, - 486, 488, 488, 0, 488, 488, 489, 489, 489, 489, - 489, 489, 489, 489, 489, 489, 490, 490, 490, 490, - 490, 490, 490, 490, 490, 490, 490, 490, 490, 491, - 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, - 491, 491, 491, 493, 493, 0, 493, 493, 494, 494, - 494, 494, 494, 494, 494, 494, 494, 494, 495, 495, - 0, 495, 495, 496, 496, 496, 496, 496, 496, 496, - - 496, 496, 496, 497, 497, 497, 497, 497, 497, 497, - 497, 497, 497, 498, 498, 498, 500, 500, 500, 500, - 500, 500, 500, 500, 500, 500, 501, 501, 0, 501, - 501, 501, 501, 501, 501, 501, 501, 501, 501, 502, + 487, 487, 487, 487, 487, 487, 487, 487, 487, 488, + 488, 0, 488, 488, 489, 489, 489, 489, 489, 489, + 489, 489, 489, 489, 489, 490, 490, 490, 490, 490, + 490, 490, 490, 490, 490, 490, 490, 491, 491, 492, + 492, 492, 492, 492, 492, 492, 492, 492, 493, 493, + 0, 493, 493, 494, 494, 494, 494, 494, 494, 494, + + 494, 494, 495, 495, 0, 495, 495, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 497, 497, 497, 497, + 497, 497, 497, 497, 497, 498, 498, 498, 498, 498, + 498, 498, 498, 498, 498, 498, 498, 499, 499, 499, + 499, 499, 499, 499, 499, 499, 500, 500, 500, 500, + 500, 500, 500, 500, 500, 501, 501, 501, 0, 501, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, - 502, 502, 503, 503, 503, 503, 503, 503, 503, 503, - 503, 503, 503, 503, 503, 503, 504, 504, 504, 504, - 504, 504, 504, 504, 504, 504, 504, 504, 504, 504, - 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, - 506, 506, 506, 506, 506, 506, 506, 506, 506, 506, - - 507, 507, 507, 507, 508, 0, 0, 508, 508, 508, - 508, 508, 508, 508, 508, 508, 508, 510, 510, 510, - 510, 510, 510, 510, 510, 510, 510, 510, 510, 510, - 510, 512, 512, 512, 512, 513, 513, 513, 513, 513, - 513, 0, 513, 513, 513, 513, 513, 513, 514, 514, - 514, 514, 514, 514, 514, 514, 514, 514, 514, 514, - 514, 516, 516, 516, 516, 516, 516, 516, 516, 516, - 516, 516, 516, 516, 516, 518, 518, 518, 518, 519, - 519, 519, 519, 519, 519, 0, 519, 519, 519, 519, - 519, 519, 520, 0, 0, 520, 520, 520, 520, 520, - - 520, 520, 520, 520, 520, 521, 0, 0, 521, 521, - 521, 521, 521, 521, 521, 521, 521, 521, 522, 522, - 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, - 522, 523, 523, 523, 523, 523, 523, 523, 523, 523, - 523, 523, 523, 523, 525, 525, 0, 525, 525, 526, - 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, - 526, 526, 528, 528, 528, 528, 529, 529, 529, 529, - 529, 529, 529, 529, 529, 529, 529, 529, 529, 530, - 0, 0, 530, 530, 530, 530, 530, 530, 530, 530, - 530, 530, 531, 531, 531, 531, 531, 531, 531, 531, - - 531, 531, 531, 531, 531, 532, 532, 532, 532, 532, - 0, 0, 532, 532, 532, 532, 532, 532, 533, 533, - 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, - 533, 534, 534, 534, 534, 534, 534, 534, 534, 534, - 534, 534, 534, 534, 535, 535, 0, 535, 535, 536, - 536, 536, 536, 536, 536, 536, 536, 536, 536, 536, - 536, 536, 538, 538, 538, 538, 539, 539, 0, 539, - 539, 539, 539, 539, 539, 539, 539, 539, 539, 540, - 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, - 540, 540, 541, 541, 0, 541, 541, 541, 541, 541, - - 541, 541, 541, 541, 541, 542, 542, 542, 542, 542, - 542, 542, 542, 542, 542, 542, 542, 542, 543, 543, - 543, 543, 543, 0, 0, 543, 543, 543, 543, 543, - 543, 546, 546, 546, 546, 0, 0, 0, 0, 546, - 0, 0, 546, 546, 547, 547, 547, 547, 0, 0, - 0, 547, 547, 547, 0, 547, 547, 548, 548, 548, - 548, 548, 548, 548, 548, 548, 548, 549, 549, 549, - 549, 549, 549, 549, 549, 549, 549, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 502, 502, 503, 503, 503, 0, 503, 504, 504, 504, + 504, 0, 504, 504, 504, 504, 504, 504, 505, 505, + 505, 0, 505, 506, 0, 506, 506, 506, 506, 506, + + 506, 506, 506, 506, 507, 0, 507, 507, 507, 507, + 507, 507, 507, 507, 507, 508, 508, 508, 508, 508, + 508, 508, 508, 508, 508, 508, 509, 509, 509, 0, + 509, 510, 510, 510, 510, 510, 510, 510, 510, 510, + 510, 510, 511, 511, 511, 511, 511, 511, 511, 511, + 511, 511, 511, 512, 512, 512, 0, 512, 513, 513, + 513, 0, 0, 0, 513, 0, 0, 513, 513, 514, + 514, 514, 514, 514, 514, 514, 514, 514, 515, 515, + 515, 0, 0, 515, 515, 515, 0, 515, 515, 516, + 516, 516, 516, 516, 516, 516, 516, 516, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478 + 478, 478, 478, 478, 478, 478, 478, 478, 478 } ; #line 1 "" @@ -1813,7 +878,7 @@ YY_DECL yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 6578 ); + while ( yy_base[yy_current_state] != 2399 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -2185,7 +1250,7 @@ YY_RULE_SETUP #line 110 "" ECHO; YY_BREAK -#line 2738 "" +#line 1761 "" case YY_STATE_EOF(INITIAL): case YY_END_OF_BUFFER: case YY_STATE_EOF(mediaquery): -- cgit v0.12 From 33cfbbe50e2da5b6cdebb169613a6d975c4b2a1a Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Tue, 19 May 2009 19:05:26 +0200 Subject: Mentioned the new fancy browser example in the changes-4.5.2. Reviewed-by: TrustMe --- dist/changes-4.5.2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index a132028..d467b95 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -24,6 +24,8 @@ General Improvements -------------------- - Documentation and Examples + * Added a new example (fancy browser) which shows how to use jQuery + in QtWebKit. Third party components ---------------------- -- cgit v0.12 From 25952e13fb840cd1af3e1adbf60369b587e91fba Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Tue, 19 May 2009 19:13:30 +0200 Subject: Revert commit a372fc602a3cb09379875ced99ec969c371917d7. This was accidentally committed. --- .../webkit/WebCore/generated/CSSPropertyNames.cpp | 5 +- .../webkit/WebCore/generated/CSSValueKeywords.c | 5 +- src/3rdparty/webkit/WebCore/generated/ColorData.c | 5 +- .../webkit/WebCore/generated/DocTypeStrings.cpp | 5 +- .../webkit/WebCore/generated/HTMLEntityNames.c | 5 +- .../webkit/WebCore/generated/tokenizer.cpp | 2315 ++++++++++++++------ 6 files changed, 1645 insertions(+), 695 deletions(-) diff --git a/src/3rdparty/webkit/WebCore/generated/CSSPropertyNames.cpp b/src/3rdparty/webkit/WebCore/generated/CSSPropertyNames.cpp index ca4ea5a..25313ac 100644 --- a/src/3rdparty/webkit/WebCore/generated/CSSPropertyNames.cpp +++ b/src/3rdparty/webkit/WebCore/generated/CSSPropertyNames.cpp @@ -1,4 +1,4 @@ -/* ANSI-C code produced by gperf version 3.0.2 */ +/* ANSI-C code produced by gperf version 3.0.3 */ /* Command-line: gperf -a -L ANSI-C -E -C -c -o -t --key-positions='*' -NfindProp -Hhash_prop -Wwordlist_prop -D -s 2 CSSPropertyNames.gperf */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ @@ -217,6 +217,9 @@ hash_prop (register const char *str, register unsigned int len) #ifdef __GNUC__ __inline +#ifdef __GNUC_STDC_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif #endif const struct props * findProp (register const char *str, register unsigned int len) diff --git a/src/3rdparty/webkit/WebCore/generated/CSSValueKeywords.c b/src/3rdparty/webkit/WebCore/generated/CSSValueKeywords.c index d0433e0..5ff0858 100644 --- a/src/3rdparty/webkit/WebCore/generated/CSSValueKeywords.c +++ b/src/3rdparty/webkit/WebCore/generated/CSSValueKeywords.c @@ -1,4 +1,4 @@ -/* ANSI-C code produced by gperf version 3.0.2 */ +/* ANSI-C code produced by gperf version 3.0.3 */ /* Command-line: gperf -L ANSI-C -E -C -n -o -t --key-positions='*' -NfindValue -Hhash_val -Wwordlist_value -D CSSValueKeywords.gperf */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ @@ -179,6 +179,9 @@ hash_val (register const char *str, register unsigned int len) #ifdef __GNUC__ __inline +#ifdef __GNUC_STDC_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif #endif const struct css_value * findValue (register const char *str, register unsigned int len) diff --git a/src/3rdparty/webkit/WebCore/generated/ColorData.c b/src/3rdparty/webkit/WebCore/generated/ColorData.c index 18d9926..478566c 100644 --- a/src/3rdparty/webkit/WebCore/generated/ColorData.c +++ b/src/3rdparty/webkit/WebCore/generated/ColorData.c @@ -1,5 +1,5 @@ #include // bogus -/* ANSI-C code produced by gperf version 3.0.2 */ +/* ANSI-C code produced by gperf version 3.0.3 */ /* Command-line: gperf -CDEot -L ANSI-C --key-positions='*' -N findColor -D -s 2 */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ @@ -141,6 +141,9 @@ hash (register const char *str, register unsigned int len) #ifdef __GNUC__ __inline +#ifdef __GNUC_STDC_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif #endif const struct NamedColor * findColor (register const char *str, register unsigned int len) diff --git a/src/3rdparty/webkit/WebCore/generated/DocTypeStrings.cpp b/src/3rdparty/webkit/WebCore/generated/DocTypeStrings.cpp index ad63b9e..686629c 100644 --- a/src/3rdparty/webkit/WebCore/generated/DocTypeStrings.cpp +++ b/src/3rdparty/webkit/WebCore/generated/DocTypeStrings.cpp @@ -1,5 +1,5 @@ #include // bogus -/* ANSI-C code produced by gperf version 3.0.2 */ +/* ANSI-C code produced by gperf version 3.0.3 */ /* Command-line: gperf -CEot -L ANSI-C --key-positions='*' -N findDoctypeEntry -F ,PubIDInfo::eAlmostStandards,PubIDInfo::eAlmostStandards */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ @@ -331,6 +331,9 @@ hash (register const char *str, register unsigned int len) #ifdef __GNUC__ __inline +#ifdef __GNUC_STDC_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif #endif const struct PubIDInfo * findDoctypeEntry (register const char *str, register unsigned int len) diff --git a/src/3rdparty/webkit/WebCore/generated/HTMLEntityNames.c b/src/3rdparty/webkit/WebCore/generated/HTMLEntityNames.c index 470c4cd..993e106 100644 --- a/src/3rdparty/webkit/WebCore/generated/HTMLEntityNames.c +++ b/src/3rdparty/webkit/WebCore/generated/HTMLEntityNames.c @@ -1,4 +1,4 @@ -/* ANSI-C code produced by gperf version 3.0.2 */ +/* ANSI-C code produced by gperf version 3.0.3 */ /* Command-line: gperf -a -L ANSI-C -C -G -c -o -t --key-positions='*' -N findEntity -D -s 2 */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ @@ -520,6 +520,9 @@ static const short lookup[] = #ifdef __GNUC__ __inline +#ifdef __GNUC_STDC_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif #endif const struct Entity * findEntity (register const char *str, register unsigned int len) diff --git a/src/3rdparty/webkit/WebCore/generated/tokenizer.cpp b/src/3rdparty/webkit/WebCore/generated/tokenizer.cpp index 1da1a0b..8462f51 100644 --- a/src/3rdparty/webkit/WebCore/generated/tokenizer.cpp +++ b/src/3rdparty/webkit/WebCore/generated/tokenizer.cpp @@ -78,42 +78,42 @@ static yyconst flex_int16_t yy_accept[479] = { 0, 0, 0, 0, 0, 0, 0, 69, 67, 2, 2, 67, 67, 67, 67, 67, 67, 67, 67, 67, 56, - 67, 67, 67, 67, 15, 15, 15, 67, 67, 66, + 67, 67, 15, 15, 15, 67, 67, 67, 67, 66, 15, 15, 15, 65, 15, 2, 0, 0, 0, 14, - 0, 0, 0, 0, 18, 18, 8, 0, 0, 9, - 0, 0, 0, 15, 15, 15, 57, 0, 55, 0, - 0, 56, 0, 54, 54, 54, 54, 54, 54, 54, - 54, 54, 54, 16, 54, 54, 51, 54, 0, 0, - 0, 35, 35, 35, 35, 35, 35, 35, 15, 15, - 7, 62, 15, 0, 0, 15, 15, 0, 15, 6, + 0, 0, 0, 18, 18, 0, 8, 0, 0, 9, + 0, 0, 15, 15, 15, 0, 57, 0, 55, 0, + 0, 56, 54, 54, 54, 54, 54, 54, 54, 54, + 54, 16, 54, 54, 51, 54, 0, 54, 0, 0, + 35, 35, 35, 35, 35, 35, 35, 0, 62, 15, + 0, 0, 15, 15, 0, 15, 15, 15, 7, 6, 5, 15, 15, 15, 15, 0, 0, 0, 14, 0, - 0, 0, 18, 18, 18, 0, 18, 0, 0, 14, - 0, 0, 4, 16, 15, 0, 0, 54, 54, 54, - 0, 54, 41, 54, 37, 39, 54, 52, 43, 54, - 42, 50, 54, 45, 44, 40, 54, 54, 0, 35, - 35, 35, 35, 0, 35, 35, 35, 35, 35, 35, - 15, 15, 15, 16, 15, 15, 63, 63, 15, 12, - 10, 15, 13, 0, 0, 0, 17, 18, 18, 18, - 17, 0, 0, 15, 0, 1, 54, 54, 54, 54, - 46, 54, 53, 16, 47, 54, 3, 35, 35, 35, - - 35, 35, 35, 35, 35, 35, 35, 15, 15, 58, - 0, 63, 63, 63, 62, 11, 0, 0, 0, 18, - 18, 18, 0, 15, 0, 0, 54, 54, 54, 48, - 49, 35, 35, 35, 35, 35, 35, 35, 35, 20, - 15, 15, 64, 63, 63, 63, 63, 0, 0, 0, - 0, 60, 0, 0, 0, 0, 18, 18, 18, 0, - 15, 54, 54, 38, 35, 35, 35, 35, 35, 35, - 21, 35, 15, 15, 64, 63, 63, 63, 63, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, - 0, 0, 0, 0, 17, 18, 18, 17, 0, 15, - - 54, 54, 35, 35, 35, 35, 35, 19, 35, 15, - 15, 64, 63, 63, 63, 63, 63, 63, 0, 59, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 18, 18, 0, 15, 54, 54, 35, - 35, 35, 23, 35, 35, 15, 64, 63, 63, 63, + 0, 0, 18, 18, 0, 18, 18, 0, 0, 14, + 0, 0, 4, 16, 15, 0, 0, 54, 0, 41, + 54, 37, 39, 54, 52, 43, 54, 42, 50, 54, + 45, 44, 40, 54, 54, 54, 54, 54, 0, 35, + 35, 0, 35, 35, 35, 35, 35, 35, 35, 35, + 15, 15, 16, 15, 15, 63, 63, 15, 15, 12, + 10, 15, 13, 0, 0, 0, 17, 17, 18, 18, + 18, 0, 0, 15, 0, 1, 54, 54, 46, 54, + 53, 16, 47, 54, 54, 54, 3, 35, 35, 35, + + 35, 35, 35, 35, 35, 35, 35, 15, 58, 0, + 63, 63, 63, 62, 15, 11, 0, 0, 0, 18, + 18, 18, 0, 15, 0, 0, 54, 48, 49, 54, + 54, 35, 35, 35, 35, 35, 35, 35, 20, 35, + 15, 64, 63, 63, 63, 63, 0, 0, 0, 0, + 60, 0, 15, 0, 0, 0, 18, 18, 18, 0, + 15, 54, 54, 38, 35, 35, 35, 35, 35, 21, + 35, 35, 15, 64, 63, 63, 63, 63, 63, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, + 0, 15, 0, 0, 17, 17, 18, 18, 0, 15, + + 54, 54, 35, 35, 35, 35, 19, 35, 35, 15, + 64, 63, 63, 63, 63, 63, 63, 0, 59, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 15, 0, 0, 18, 18, 0, 15, 54, 54, 35, + 35, 23, 35, 35, 35, 15, 64, 63, 63, 63, 63, 63, 63, 63, 0, 59, 0, 0, 0, 59, 0, 0, 0, 0, 18, 15, 54, 35, 35, 35, 35, 64, 0, 0, 0, 36, 15, 35, 35, 35, @@ -122,7 +122,7 @@ static yyconst flex_int16_t yy_accept[479] = 35, 35, 35, 35, 35, 35, 35, 35, 0, 0, 0, 0, 0, 0, 35, 35, 35, 35, 25, 35, - 35, 35, 0, 0, 0, 61, 0, 0, 26, 35, + 35, 35, 0, 61, 0, 0, 0, 0, 26, 35, 35, 35, 35, 27, 35, 0, 0, 0, 0, 31, 35, 35, 35, 35, 0, 0, 0, 35, 35, 35, 35, 0, 0, 35, 35, 29, 35, 0, 0, 35, @@ -138,437 +138,909 @@ static yyconst flex_int32_t yy_ec[256] = 1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 12, 18, 19, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 12, 22, 23, - 24, 25, 26, 27, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 12, 28, 12, 29, 30, 12, 31, 32, 33, 34, - - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 12, 59, 1, 60, 60, 60, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, - - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 60, 60, 60, 60 + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 12, 54, 12, 55, 56, 12, 57, 58, 59, 60, + + 61, 62, 63, 64, 65, 37, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 12, 84, 1, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, + + 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 85 } ; -static yyconst flex_int32_t yy_meta[61] = +static yyconst flex_int32_t yy_meta[86] = { 0, - 1, 2, 3, 3, 3, 4, 5, 5, 5, 5, - 5, 5, 5, 6, 7, 5, 5, 8, 5, 5, - 9, 5, 5, 5, 5, 10, 5, 11, 5, 11, - 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 5, 5, 5, 11 + 1, 2, 3, 4, 4, 5, 6, 7, 6, 6, + 6, 6, 7, 8, 9, 6, 6, 10, 6, 6, + 11, 6, 6, 6, 6, 12, 6, 13, 13, 13, + 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 6, 14, 13, 13, 13, 13, + 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 6, 6, 6, 14 } ; -static yyconst flex_int16_t yy_base[517] = +static yyconst flex_int16_t yy_base[550] = { 0, - 0, 0, 39, 41, 1573, 1566, 1594, 2399, 62, 71, - 76, 61, 69, 1560, 78, 1559, 89, 1561, 1565, 132, - 1573, 91, 123, 1555, 80, 104, 97, 1554, 1551, 2399, - 85, 176, 175, 2399, 177, 193, 204, 1531, 84, 2399, - 242, 110, 180, 196, 1545, 205, 2399, 113, 277, 2399, - 1547, 72, 221, 133, 206, 234, 181, 1555, 1548, 1530, - 1528, 0, 268, 118, 1515, 221, 60, 240, 92, 230, - 95, 223, 244, 267, 238, 286, 1512, 268, 1521, 279, - 294, 1510, 278, 190, 290, 232, 292, 293, 308, 335, - 2399, 2399, 317, 326, 1516, 351, 336, 356, 366, 2399, - - 2399, 320, 367, 369, 370, 1478, 393, 327, 345, 420, - 455, 398, 1495, 490, 1481, 446, 481, 372, 365, 386, - 525, 560, 2399, 325, 388, 1491, 387, 1477, 595, 1476, - 516, 399, 1475, 34, 1472, 1461, 378, 1438, 1430, 318, - 1429, 1426, 323, 1424, 1423, 1422, 231, 387, 1430, 377, - 1411, 630, 1396, 551, 382, 108, 415, 408, 419, 412, - 586, 436, 665, 1400, 624, 456, 419, 1382, 457, 490, - 491, 625, 492, 1362, 526, 656, 672, 681, 1378, 716, - 707, 527, 723, 561, 1374, 2399, 732, 1346, 767, 437, - 1322, 410, 1312, 445, 1311, 546, 2399, 469, 758, 1303, - - 802, 576, 482, 580, 470, 440, 472, 793, 809, 2399, - 818, 515, 1288, 1273, 853, 552, 1205, 839, 855, 861, - 877, 883, 899, 645, 1227, 483, 905, 921, 612, 1183, - 1168, 609, 927, 943, 626, 517, 628, 508, 629, 1167, - 949, 965, 971, 550, 1167, 1157, 1123, 1006, 1020, 666, - 682, 2399, 1047, 1091, 1006, 1038, 1055, 1063, 1071, 1079, - 632, 1087, 1095, 1105, 539, 1103, 1111, 542, 543, 681, - 1097, 683, 1119, 1127, 1135, 585, 1091, 1083, 1067, 1039, - 721, 752, 772, 1170, 717, 1205, 1184, 1217, 1244, 1258, - 1285, 1320, 984, 1244, 2399, 1276, 1311, 917, 1328, 767, - - 1336, 1344, 733, 1352, 1360, 734, 578, 899, 582, 1395, - 1381, 1397, 623, 853, 822, 794, 793, 760, 807, 2399, - 875, 788, 1432, 1459, 1494, 818, 769, 1440, 1529, 1564, - 1438, 702, 1485, 919, 1520, 1555, 849, 963, 1572, 587, - 1299, 1580, 706, 441, 614, 1615, 1601, 715, 2399, 2399, - 2399, 2399, 2399, 2399, 1473, 839, 856, 1617, 1652, 804, - 852, 1638, 1654, 633, 1480, 871, 1508, 1650, 1542, 644, - 834, 1673, 1679, 1695, 1701, 2399, 1015, 872, 915, 916, - 877, 959, 704, 616, 586, 2399, 1717, 1723, 1739, 1002, - 1148, 514, 961, 989, 990, 1016, 1745, 1761, 1767, 1802, - - 1137, 1008, 1018, 1017, 985, 1129, 878, 1038, 1790, 1806, - 1829, 1211, 1827, 1849, 944, 1057, 1152, 787, 584, 615, - 1196, 918, 1863, 1890, 1279, 2399, 1869, 1867, 516, 1199, - 1154, 943, 1242, 515, 653, 1904, 1906, 1941, 1968, 480, - 945, 1200, 1149, 1214, 1927, 1949, 1947, 1239, 1301, 1207, - 1302, 1974, 1990, 1392, 1267, 411, 1354, 1996, 2012, 1310, - 376, 1241, 1039, 2018, 2034, 1338, 348, 1377, 2040, 1216, - 1391, 1421, 1394, 324, 1226, 1376, 263, 2399, 2075, 2080, - 2091, 2096, 2101, 2110, 2117, 2128, 2137, 2142, 2153, 2165, - 2167, 2176, 2181, 2190, 2195, 2204, 2213, 2225, 2234, 2243, - - 2248, 2260, 2265, 2276, 2281, 2292, 2303, 2314, 2319, 2330, - 2341, 2346, 2357, 2366, 2377, 2386 + 0, 0, 64, 66, 54, 56, 1407, 6578, 93, 98, + 107, 83, 155, 1376, 77, 1350, 99, 1345, 1328, 207, + 1334, 275, 100, 108, 125, 326, 1315, 1313, 1312, 6578, + 141, 110, 151, 6578, 105, 197, 295, 89, 107, 6578, + 387, 120, 0, 429, 1281, 471, 6578, 117, 532, 6578, + 1283, 269, 137, 176, 281, 574, 283, 1289, 1292, 1246, + 1257, 0, 1221, 249, 135, 282, 276, 153, 91, 169, + 299, 308, 318, 266, 1219, 320, 616, 102, 1246, 348, + 1209, 316, 127, 359, 346, 347, 375, 658, 6578, 208, + 700, 1241, 400, 409, 1220, 397, 327, 761, 6578, 6578, + + 6578, 411, 419, 414, 424, 248, 368, 355, 356, 822, + 883, 0, 1191, 925, 967, 1190, 1028, 381, 421, 464, + 1089, 1150, 6578, 214, 456, 1225, 312, 1151, 1192, 1142, + 442, 1139, 1134, 452, 1131, 1104, 458, 1082, 1060, 358, + 1046, 1028, 1027, 462, 453, 1000, 1253, 469, 1023, 463, + 986, 1295, 492, 486, 500, 484, 502, 513, 969, 1356, + 425, 1417, 1001, 545, 494, 193, 993, 543, 1459, 544, + 554, 558, 555, 508, 398, 1520, 0, 1562, 956, 1623, + 1684, 570, 1745, 563, 993, 6578, 948, 1806, 935, 520, + 921, 498, 914, 546, 1848, 564, 6578, 585, 913, 1909, + + 568, 576, 586, 606, 631, 640, 1951, 2012, 6578, 0, + 203, 924, 907, 694, 2054, 565, 543, 2115, 0, 2157, + 2218, 2279, 2340, 669, 912, 505, 2401, 856, 840, 2443, + 612, 615, 2504, 608, 557, 639, 682, 668, 839, 2546, + 2607, 0, 288, 863, 841, 819, 741, 794, 573, 418, + 6578, 2668, 2710, 620, 2771, 0, 2813, 2874, 2935, 2996, + 3057, 3131, 3173, 3234, 670, 3295, 718, 719, 729, 763, + 684, 3337, 3398, 0, 456, 782, 777, 760, 742, 829, + 649, 834, 3459, 572, 3520, 854, 894, 915, 920, 3581, + 3642, 3684, 593, 3745, 6578, 697, 3806, 3867, 3928, 3989, + + 4050, 4111, 730, 4172, 731, 683, 672, 759, 4214, 4275, + 0, 762, 682, 429, 417, 414, 411, 859, 6578, 650, + 838, 957, 4336, 4397, 607, 926, 988, 4458, 4519, 4580, + 1002, 672, 1010, 4622, 4664, 1042, 752, 4706, 4767, 756, + 4828, 376, 812, 847, 1069, 1033, 0, 387, 6578, 6578, + 6578, 6578, 6578, 6578, 1122, 924, 963, 4870, 1162, 1049, + 1050, 4912, 4973, 678, 1063, 850, 1074, 5005, 1103, 841, + 989, 0, 5062, 5104, 5146, 6578, 1066, 1080, 1081, 1084, + 1108, 1137, 877, 328, 273, 6578, 5188, 5230, 5272, 641, + 1140, 884, 916, 836, 1105, 1161, 5314, 5356, 1233, 1286, + + 1147, 1138, 919, 1206, 1165, 1186, 1141, 1207, 1291, 1263, + 1316, 1345, 1327, 5398, 1086, 1029, 1225, 1133, 258, 1247, + 1248, 1310, 1388, 6578, 1427, 5440, 1449, 5501, 242, 1311, + 1341, 1324, 1326, 173, 1317, 1454, 5562, 1480, 5604, 170, + 1061, 1328, 1355, 1372, 1552, 5646, 5688, 1351, 1374, 1389, + 1409, 5730, 5772, 1419, 1456, 154, 1453, 5814, 5856, 1457, + 112, 897, 793, 5898, 1557, 1418, 109, 1348, 1582, 1550, + 1477, 1481, 1485, 90, 1564, 1458, 39, 6578, 5959, 5964, + 5977, 5982, 5987, 5994, 6004, 6017, 296, 6022, 6032, 6045, + 6059, 651, 6064, 6074, 6079, 6089, 6099, 6103, 571, 6112, + + 6125, 6138, 6152, 6166, 6176, 6186, 6191, 6203, 657, 6217, + 758, 6222, 6234, 6247, 801, 6261, 859, 6266, 6278, 6291, + 6304, 6317, 6330, 1086, 6335, 6348, 1120, 6353, 6365, 6378, + 6391, 6404, 6417, 6430, 6435, 6448, 1216, 6453, 6465, 6478, + 6491, 6504, 6517, 1219, 1220, 6530, 6543, 6553, 6563 } ; -static yyconst flex_int16_t yy_def[517] = +static yyconst flex_int16_t yy_def[550] = { 0, 478, 1, 1, 1, 1, 1, 478, 478, 478, 478, 478, 479, 480, 478, 481, 478, 482, 478, 478, 478, - 478, 483, 484, 478, 485, 485, 485, 478, 478, 478, - 485, 485, 485, 478, 485, 478, 478, 478, 479, 478, - 486, 480, 478, 487, 488, 488, 478, 481, 489, 478, - 478, 478, 484, 485, 485, 485, 20, 490, 478, 491, - 478, 20, 492, 493, 493, 493, 493, 493, 493, 493, - 493, 493, 493, 493, 493, 493, 493, 493, 478, 483, - 494, 495, 495, 495, 495, 495, 495, 495, 485, 485, - 478, 478, 485, 496, 478, 485, 485, 478, 485, 478, - - 478, 485, 485, 485, 485, 478, 479, 479, 479, 479, - 486, 478, 488, 46, 488, 497, 46, 481, 481, 481, - 481, 489, 478, 478, 485, 490, 498, 493, 493, 493, - 499, 493, 493, 493, 493, 493, 493, 493, 493, 493, + 478, 483, 484, 484, 484, 485, 478, 478, 478, 478, + 484, 484, 484, 478, 484, 478, 478, 478, 479, 478, + 486, 480, 487, 488, 488, 489, 478, 481, 490, 478, + 478, 478, 484, 484, 484, 485, 20, 491, 478, 492, + 478, 20, 493, 493, 493, 493, 493, 493, 493, 493, + 493, 493, 493, 493, 493, 493, 494, 493, 478, 483, + 495, 495, 495, 495, 495, 495, 495, 496, 478, 484, + 497, 478, 484, 484, 498, 484, 484, 484, 478, 478, + + 478, 484, 484, 484, 484, 478, 479, 479, 479, 479, + 486, 499, 488, 488, 500, 488, 114, 501, 501, 501, + 501, 502, 478, 478, 484, 503, 504, 493, 505, 493, + 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 478, 495, - 495, 495, 495, 500, 495, 495, 495, 495, 495, 495, - 90, 485, 90, 478, 485, 485, 501, 478, 485, 485, - 485, 485, 485, 478, 479, 110, 478, 114, 488, 114, - 46, 481, 121, 485, 502, 478, 129, 493, 129, 493, - 493, 493, 493, 493, 493, 493, 478, 495, 152, 495, - - 152, 495, 495, 495, 495, 495, 495, 90, 163, 478, - 478, 503, 478, 478, 504, 485, 478, 110, 478, 114, - 180, 46, 121, 485, 502, 498, 129, 189, 493, 493, - 493, 495, 152, 201, 495, 495, 495, 495, 495, 495, - 90, 163, 478, 505, 478, 478, 478, 504, 504, 506, - 507, 478, 508, 478, 110, 478, 114, 180, 46, 121, - 485, 129, 189, 493, 495, 152, 201, 495, 495, 495, - 495, 495, 90, 163, 478, 509, 478, 478, 478, 478, - 478, 506, 478, 510, 507, 511, 504, 504, 504, 504, - 504, 508, 478, 110, 478, 114, 180, 488, 121, 485, - - 129, 189, 495, 152, 201, 495, 495, 495, 495, 485, - 163, 478, 512, 478, 478, 478, 478, 478, 478, 478, - 506, 506, 506, 506, 510, 507, 507, 507, 507, 511, - 291, 478, 110, 488, 180, 121, 485, 493, 189, 495, - 495, 201, 495, 495, 495, 485, 478, 478, 478, 478, - 478, 478, 478, 478, 506, 506, 506, 324, 507, 507, - 507, 329, 291, 478, 488, 485, 493, 495, 495, 495, - 495, 478, 324, 329, 291, 478, 485, 495, 495, 495, - 495, 495, 495, 495, 495, 478, 324, 329, 291, 485, - 495, 495, 495, 495, 495, 495, 324, 329, 291, 513, - - 495, 495, 495, 495, 495, 495, 495, 495, 324, 329, - 513, 411, 514, 515, 495, 495, 495, 495, 495, 495, - 495, 495, 515, 515, 478, 478, 515, 516, 495, 495, - 495, 495, 495, 495, 495, 515, 424, 515, 424, 495, - 495, 495, 495, 495, 424, 515, 439, 495, 495, 495, - 495, 424, 439, 495, 495, 495, 495, 424, 439, 495, - 495, 495, 495, 424, 439, 495, 495, 495, 439, 495, + 495, 506, 495, 495, 495, 495, 495, 495, 495, 495, + 484, 98, 478, 484, 484, 507, 478, 484, 98, 484, + 484, 484, 484, 478, 508, 508, 509, 114, 488, 114, + 114, 501, 501, 484, 510, 478, 493, 147, 493, 493, + 493, 493, 493, 493, 147, 493, 478, 495, 495, 160, + + 495, 495, 495, 495, 495, 495, 160, 98, 478, 511, + 512, 478, 478, 513, 98, 484, 478, 514, 515, 114, + 114, 114, 501, 484, 510, 516, 147, 493, 493, 147, + 493, 495, 160, 495, 495, 495, 495, 495, 495, 160, + 98, 517, 518, 478, 478, 478, 519, 519, 520, 521, + 478, 522, 98, 478, 523, 524, 525, 525, 258, 526, + 98, 147, 147, 147, 495, 160, 495, 495, 495, 495, + 495, 160, 98, 527, 528, 478, 478, 478, 478, 478, + 520, 478, 529, 530, 531, 532, 532, 532, 532, 532, + 533, 98, 478, 534, 478, 535, 535, 297, 536, 98, + + 147, 301, 495, 160, 495, 495, 495, 495, 160, 98, + 537, 538, 478, 478, 478, 478, 478, 478, 478, 539, + 539, 539, 539, 540, 541, 541, 541, 541, 542, 543, + 300, 478, 534, 297, 298, 536, 300, 301, 301, 495, + 160, 495, 495, 495, 495, 300, 544, 478, 478, 478, + 478, 478, 478, 478, 539, 539, 539, 323, 541, 541, + 541, 328, 543, 478, 335, 300, 339, 495, 495, 495, + 495, 545, 323, 328, 363, 478, 300, 495, 495, 495, + 495, 495, 495, 495, 495, 478, 323, 328, 363, 300, + 495, 495, 495, 495, 495, 495, 323, 328, 543, 546, + + 495, 495, 495, 495, 495, 495, 495, 495, 539, 541, + 546, 546, 547, 548, 495, 495, 495, 495, 495, 495, + 495, 495, 478, 478, 547, 549, 547, 547, 495, 495, + 495, 495, 495, 495, 495, 547, 428, 547, 428, 495, + 495, 495, 495, 495, 547, 437, 428, 495, 495, 495, + 495, 437, 428, 495, 495, 495, 495, 437, 428, 495, + 495, 495, 495, 437, 547, 495, 495, 495, 547, 495, 495, 495, 495, 495, 495, 495, 495, 0, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478 + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478 } ; -static yyconst flex_int16_t yy_nxt[2460] = +static yyconst flex_int16_t yy_nxt[6664] = { 0, 8, 9, 10, 9, 9, 9, 11, 12, 13, 14, 8, 8, 15, 8, 8, 16, 8, 17, 18, 19, - 20, 8, 21, 8, 8, 8, 22, 23, 24, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 26, 25, 25, 25, 25, 25, 25, - 27, 25, 25, 25, 25, 25, 8, 28, 29, 25, - 30, 131, 30, 36, 36, 36, 36, 36, 40, 31, - 191, 31, 36, 36, 36, 36, 36, 37, 37, 37, - 37, 37, 32, 33, 32, 33, 42, 131, 41, 43, - 40, 40, 52, 92, 134, 34, 44, 34, 92, 46, - - 46, 46, 46, 46, 46, 49, 51, 94, 80, 52, - 92, 41, 94, 98, 38, 124, 53, 92, 81, 131, - 95, 96, 131, 83, 94, 40, 84, 478, 102, 85, - 478, 94, 55, 86, 87, 154, 88, 44, 139, 137, - 49, 56, 59, 90, 99, 131, 92, 132, 97, 60, - 61, 203, 62, 90, 90, 90, 90, 90, 90, 63, - 94, 64, 65, 65, 66, 67, 68, 65, 69, 70, - 71, 65, 72, 65, 73, 74, 65, 75, 65, 76, - 77, 78, 65, 65, 65, 65, 65, 65, 92, 92, - 92, 65, 95, 96, 36, 36, 36, 36, 36, 478, - - 112, 57, 94, 94, 94, 37, 37, 37, 37, 37, - 112, 112, 112, 112, 112, 112, 114, 154, 104, 92, - 103, 105, 95, 96, 65, 117, 114, 114, 114, 114, - 114, 114, 116, 94, 156, 117, 117, 117, 117, 117, - 117, 90, 38, 39, 39, 39, 107, 92, 131, 109, - 131, 90, 90, 90, 90, 90, 90, 131, 131, 154, - 140, 94, 110, 133, 195, 131, 158, 131, 125, 111, - 144, 131, 110, 110, 110, 110, 110, 110, 48, 48, - 48, 118, 135, 95, 143, 138, 141, 145, 129, 120, - 154, 146, 142, 136, 131, 131, 478, 121, 129, 129, - - 129, 129, 129, 129, 122, 154, 81, 121, 121, 121, - 121, 121, 121, 131, 152, 155, 147, 154, 148, 154, - 154, 92, 159, 160, 152, 152, 152, 152, 152, 152, - 92, 150, 157, 92, 40, 94, 89, 89, 89, 89, - 89, 95, 95, 194, 94, 131, 163, 94, 92, 92, - 131, 154, 40, 170, 41, 161, 163, 163, 163, 163, - 163, 163, 94, 94, 92, 161, 161, 161, 161, 161, - 161, 165, 41, 193, 48, 154, 167, 40, 94, 92, - 92, 168, 92, 92, 40, 166, 167, 167, 167, 167, - 167, 167, 49, 94, 94, 39, 94, 94, 40, 49, - - 40, 92, 127, 154, 154, 131, 186, 169, 192, 154, - 172, 198, 202, 49, 131, 94, 171, 173, 177, 184, - 41, 108, 175, 175, 175, 108, 131, 40, 177, 177, - 177, 177, 177, 177, 196, 154, 211, 131, 154, 154, - 176, 205, 154, 230, 213, 190, 154, 41, 207, 92, - 176, 176, 176, 176, 176, 176, 39, 39, 39, 107, - 204, 206, 109, 94, 131, 194, 180, 154, 154, 210, - 215, 229, 131, 370, 239, 110, 180, 180, 180, 180, - 180, 180, 111, 94, 94, 110, 110, 110, 110, 110, - 110, 113, 113, 113, 113, 113, 154, 154, 226, 154, - - 232, 181, 186, 92, 210, 92, 240, 154, 238, 154, - 178, 181, 181, 181, 181, 181, 181, 94, 94, 94, - 178, 178, 178, 178, 178, 178, 119, 182, 182, 182, - 119, 236, 211, 40, 269, 154, 189, 40, 271, 40, - 245, 154, 154, 154, 154, 183, 189, 189, 189, 189, - 189, 189, 49, 41, 49, 183, 183, 183, 183, 183, - 183, 48, 48, 48, 118, 92, 154, 211, 403, 154, - 154, 201, 120, 131, 92, 277, 306, 303, 307, 94, - 121, 201, 201, 201, 201, 201, 201, 122, 94, 231, - 121, 121, 121, 121, 121, 121, 128, 128, 128, 128, - - 128, 224, 211, 154, 368, 154, 208, 154, 344, 154, - 314, 154, 345, 154, 154, 187, 208, 208, 208, 208, - 208, 208, 131, 235, 237, 187, 187, 187, 187, 187, - 187, 151, 151, 151, 151, 151, 154, 92, 92, 131, - 211, 154, 154, 154, 165, 92, 371, 433, 349, 265, - 199, 94, 94, 154, 264, 154, 154, 154, 92, 94, - 199, 199, 199, 199, 199, 199, 162, 162, 162, 162, - 162, 154, 94, 283, 268, 270, 218, 272, 384, 216, - 154, 300, 376, 261, 444, 209, 218, 218, 218, 218, - 218, 218, 219, 284, 283, 209, 209, 209, 209, 209, - - 209, 220, 219, 219, 219, 219, 219, 219, 154, 286, - 154, 220, 220, 220, 220, 220, 220, 179, 179, 179, - 179, 179, 281, 281, 281, 281, 281, 222, 309, 283, - 308, 154, 211, 154, 396, 252, 221, 222, 222, 222, - 222, 222, 222, 223, 286, 364, 221, 221, 221, 221, - 221, 221, 227, 223, 223, 223, 223, 223, 223, 283, - 154, 154, 227, 227, 227, 227, 227, 227, 188, 188, - 188, 188, 188, 319, 319, 319, 319, 319, 233, 284, - 92, 283, 340, 343, 337, 354, 320, 228, 233, 233, - 233, 233, 233, 233, 94, 283, 286, 228, 228, 228, - - 228, 228, 228, 200, 200, 200, 200, 200, 319, 319, - 319, 319, 319, 241, 154, 284, 283, 432, 353, 352, - 285, 320, 234, 241, 241, 241, 241, 241, 241, 242, - 283, 286, 234, 234, 234, 234, 234, 234, 243, 242, - 242, 242, 242, 242, 242, 286, 283, 351, 243, 243, - 243, 243, 243, 243, 248, 248, 248, 248, 248, 255, - 250, 154, 92, 283, 283, 251, 284, 252, 385, 255, - 255, 255, 255, 255, 255, 256, 94, 282, 350, 286, - 253, 257, 283, 284, 92, 256, 256, 256, 256, 256, - 256, 257, 257, 257, 257, 257, 257, 258, 94, 154, - - 366, 377, 284, 259, 154, 154, 391, 258, 258, 258, - 258, 258, 258, 259, 259, 259, 259, 259, 259, 260, - 113, 113, 113, 113, 113, 262, 154, 394, 421, 260, - 260, 260, 260, 260, 260, 262, 262, 262, 262, 262, - 262, 263, 154, 154, 116, 154, 116, 266, 435, 392, - 393, 263, 263, 263, 263, 263, 263, 266, 266, 266, - 266, 266, 266, 267, 128, 128, 128, 128, 128, 273, - 154, 154, 154, 267, 267, 267, 267, 267, 267, 273, - 273, 273, 273, 273, 273, 274, 154, 448, 154, 442, - 131, 275, 429, 395, 404, 274, 274, 274, 274, 274, - - 274, 275, 275, 275, 275, 275, 275, 248, 248, 248, - 248, 248, 154, 250, 332, 400, 154, 154, 251, 419, - 252, 281, 281, 281, 281, 281, 294, 478, 92, 94, - 405, 406, 478, 253, 252, 154, 294, 294, 294, 294, - 294, 294, 94, 154, 154, 154, 416, 253, 281, 281, - 281, 281, 287, 417, 289, 418, 468, 407, 295, 289, - 289, 290, 390, 408, 318, 154, 154, 291, 295, 295, - 295, 295, 295, 295, 292, 296, 422, 291, 291, 291, - 291, 291, 291, 297, 154, 296, 296, 296, 296, 296, - 296, 298, 317, 297, 297, 297, 297, 297, 297, 299, - - 430, 298, 298, 298, 298, 298, 298, 301, 316, 299, - 299, 299, 299, 299, 299, 302, 315, 301, 301, 301, - 301, 301, 301, 304, 154, 302, 302, 302, 302, 302, - 302, 305, 131, 304, 304, 304, 304, 304, 304, 310, - 293, 305, 305, 305, 305, 305, 305, 311, 280, 310, - 310, 310, 310, 310, 310, 312, 154, 311, 311, 311, - 311, 311, 311, 420, 154, 312, 312, 312, 312, 312, - 312, 282, 282, 282, 321, 154, 154, 323, 415, 154, - 401, 154, 279, 402, 441, 281, 281, 281, 281, 281, - 324, 478, 278, 450, 154, 131, 478, 325, 252, 431, - - 324, 324, 324, 324, 324, 324, 285, 285, 285, 326, - 131, 253, 478, 478, 478, 478, 478, 328, 281, 281, - 281, 281, 281, 154, 478, 329, 154, 154, 478, 478, - 434, 252, 330, 440, 154, 329, 329, 329, 329, 329, - 329, 154, 226, 154, 253, 281, 281, 281, 281, 281, - 449, 478, 254, 154, 456, 451, 478, 472, 252, 281, - 281, 281, 281, 281, 333, 478, 154, 476, 154, 154, - 478, 253, 252, 454, 333, 333, 333, 333, 333, 333, - 425, 425, 425, 425, 425, 253, 287, 287, 287, 287, - 287, 443, 478, 426, 154, 467, 334, 478, 247, 252, - - 151, 151, 151, 151, 151, 331, 334, 334, 334, 334, - 334, 334, 253, 246, 462, 331, 331, 331, 331, 331, - 331, 281, 281, 281, 281, 287, 154, 289, 154, 154, - 154, 335, 289, 289, 290, 455, 457, 154, 131, 131, - 291, 335, 335, 335, 335, 335, 335, 292, 336, 131, - 291, 291, 291, 291, 291, 291, 338, 466, 336, 336, - 336, 336, 336, 336, 339, 154, 338, 338, 338, 338, - 338, 338, 341, 131, 339, 339, 339, 339, 339, 339, - 342, 154, 341, 341, 341, 341, 341, 341, 470, 226, - 342, 342, 342, 342, 342, 342, 89, 89, 89, 89, - - 89, 346, 463, 154, 154, 116, 217, 214, 92, 460, - 471, 346, 346, 346, 346, 346, 346, 347, 154, 154, - 164, 154, 94, 154, 477, 473, 475, 347, 347, 347, - 347, 347, 347, 355, 319, 319, 319, 355, 154, 283, - 461, 359, 319, 319, 319, 359, 356, 197, 154, 131, - 131, 131, 283, 131, 360, 474, 131, 131, 363, 284, - 322, 357, 357, 357, 322, 131, 283, 286, 363, 363, - 363, 363, 363, 363, 355, 319, 319, 319, 355, 358, - 283, 179, 179, 179, 179, 179, 284, 356, 131, 358, - 358, 358, 358, 358, 358, 282, 282, 282, 321, 131, - - 284, 323, 131, 131, 131, 39, 127, 116, 116, 188, - 188, 188, 188, 188, 324, 39, 39, 39, 39, 39, - 39, 325, 116, 174, 324, 324, 324, 324, 324, 324, - 327, 361, 361, 361, 327, 131, 164, 154, 149, 131, - 365, 283, 131, 200, 200, 200, 200, 200, 57, 362, - 365, 365, 365, 365, 365, 365, 286, 63, 59, 362, - 362, 362, 362, 362, 362, 285, 285, 285, 326, 154, - 127, 123, 116, 106, 101, 48, 328, 100, 91, 79, - 58, 57, 50, 47, 329, 48, 48, 48, 48, 48, - 48, 330, 367, 478, 329, 329, 329, 329, 329, 329, - - 369, 35, 367, 367, 367, 367, 367, 367, 35, 478, - 369, 369, 369, 369, 369, 369, 162, 162, 162, 162, - 162, 372, 478, 478, 478, 478, 478, 478, 92, 478, - 478, 372, 372, 372, 372, 372, 372, 373, 478, 478, - 478, 478, 94, 478, 478, 478, 478, 373, 373, 373, - 373, 373, 373, 359, 319, 319, 319, 359, 374, 478, - 478, 478, 478, 478, 283, 478, 360, 478, 374, 374, - 374, 374, 374, 374, 375, 478, 478, 154, 478, 286, - 478, 478, 478, 378, 375, 375, 375, 375, 375, 375, - 379, 478, 380, 386, 478, 478, 478, 381, 382, 387, - - 478, 383, 478, 386, 386, 386, 386, 386, 386, 387, - 387, 387, 387, 387, 387, 388, 478, 478, 478, 478, - 478, 389, 478, 478, 478, 388, 388, 388, 388, 388, - 388, 389, 389, 389, 389, 389, 389, 397, 478, 478, - 478, 478, 478, 398, 478, 478, 478, 397, 397, 397, - 397, 397, 397, 398, 398, 398, 398, 398, 398, 399, - 478, 478, 478, 478, 478, 409, 478, 478, 478, 399, - 399, 399, 399, 399, 399, 409, 409, 409, 409, 409, - 409, 410, 478, 478, 478, 478, 478, 249, 478, 478, - 478, 410, 410, 410, 410, 410, 410, 249, 249, 249, - - 249, 249, 249, 411, 411, 411, 411, 411, 478, 478, - 282, 478, 478, 478, 478, 478, 478, 478, 478, 412, - 282, 282, 282, 282, 282, 282, 285, 478, 478, 413, - 411, 411, 411, 411, 411, 478, 285, 285, 285, 285, - 285, 285, 478, 478, 478, 478, 412, 424, 478, 478, - 425, 425, 425, 425, 425, 478, 413, 424, 424, 424, - 424, 424, 424, 426, 425, 425, 425, 425, 425, 478, - 425, 425, 425, 425, 425, 478, 428, 426, 478, 478, - 478, 478, 478, 426, 478, 478, 478, 439, 478, 478, - 428, 436, 436, 436, 436, 436, 428, 439, 439, 439, - - 439, 439, 439, 478, 426, 425, 425, 425, 425, 425, - 437, 478, 478, 478, 478, 478, 478, 428, 426, 478, - 437, 437, 437, 437, 437, 437, 445, 478, 478, 478, - 478, 428, 478, 478, 478, 478, 445, 445, 445, 445, - 445, 445, 425, 425, 425, 425, 425, 452, 478, 478, - 425, 425, 425, 425, 425, 426, 478, 452, 452, 452, - 452, 452, 452, 426, 478, 478, 478, 453, 428, 446, - 446, 446, 446, 446, 478, 478, 428, 453, 453, 453, - 453, 453, 453, 478, 478, 478, 478, 478, 447, 478, - 478, 478, 478, 478, 458, 478, 478, 478, 447, 447, - - 447, 447, 447, 447, 458, 458, 458, 458, 458, 458, - 459, 478, 478, 478, 478, 478, 464, 478, 478, 478, - 459, 459, 459, 459, 459, 459, 464, 464, 464, 464, - 464, 464, 465, 478, 478, 478, 478, 478, 427, 478, - 478, 478, 465, 465, 465, 465, 465, 465, 427, 427, - 427, 427, 427, 427, 469, 478, 478, 478, 478, 478, - 427, 478, 478, 478, 469, 469, 469, 469, 469, 469, - 427, 427, 427, 427, 427, 427, 39, 478, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 45, 45, 478, - 45, 45, 48, 478, 48, 48, 48, 48, 48, 48, - - 48, 48, 48, 54, 54, 478, 54, 54, 82, 478, - 478, 82, 82, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 93, 478, 93, 93, 478, 93, 93, 108, + 20, 8, 21, 8, 8, 8, 22, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 24, 23, 23, 23, 23, 23, 23, 25, 23, 23, + 23, 23, 23, 26, 27, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 24, 23, + 23, 23, 23, 23, 23, 25, 23, 23, 23, 23, + 23, 8, 28, 29, 23, 30, 35, 30, 35, 40, + 40, 31, 152, 31, 36, 36, 36, 36, 36, 36, + + 36, 36, 36, 36, 32, 33, 32, 33, 37, 37, + 37, 37, 37, 89, 40, 35, 51, 35, 89, 52, + 31, 89, 31, 89, 92, 93, 92, 93, 106, 40, + 49, 136, 32, 33, 32, 33, 41, 478, 89, 54, + 478, 95, 38, 152, 129, 34, 105, 34, 55, 94, + 89, 103, 56, 91, 89, 129, 106, 148, 91, 136, + 41, 91, 152, 91, 89, 152, 131, 54, 154, 96, + 49, 38, 42, 46, 105, 43, 55, 94, 91, 103, + 152, 102, 44, 44, 44, 44, 44, 44, 129, 89, + 91, 104, 92, 93, 91, 131, 154, 96, 36, 36, + + 36, 36, 36, 137, 91, 135, 129, 152, 46, 102, + 210, 44, 44, 44, 44, 44, 44, 59, 212, 104, + 210, 89, 129, 152, 60, 61, 152, 62, 244, 91, + 92, 92, 137, 135, 63, 63, 64, 65, 66, 63, + 67, 68, 69, 63, 70, 63, 71, 72, 63, 73, + 63, 74, 75, 76, 63, 63, 63, 63, 63, 63, + 77, 91, 78, 63, 63, 64, 65, 66, 63, 67, + 68, 69, 70, 63, 71, 72, 63, 73, 63, 74, + 75, 76, 63, 63, 63, 63, 63, 63, 130, 52, + 174, 63, 80, 144, 89, 152, 37, 37, 37, 37, + + 37, 478, 129, 57, 82, 210, 112, 83, 112, 124, + 84, 152, 125, 276, 85, 86, 130, 87, 174, 129, + 134, 132, 144, 63, 92, 140, 152, 127, 88, 129, + 38, 186, 133, 82, 91, 129, 83, 124, 138, 84, + 89, 125, 85, 86, 139, 87, 98, 141, 134, 132, + 153, 63, 129, 98, 98, 98, 98, 98, 98, 38, + 133, 129, 40, 40, 142, 478, 138, 145, 143, 152, + 39, 129, 139, 129, 157, 40, 141, 156, 192, 153, + 91, 152, 98, 98, 98, 98, 98, 98, 39, 39, + 39, 107, 142, 40, 109, 145, 143, 150, 155, 152, + + 152, 88, 158, 157, 210, 40, 156, 110, 41, 41, + 89, 129, 152, 89, 110, 110, 110, 110, 110, 110, + 164, 41, 89, 478, 89, 150, 155, 89, 152, 152, + 282, 158, 89, 40, 49, 168, 354, 89, 89, 353, + 111, 170, 352, 110, 110, 110, 110, 110, 110, 114, + 91, 41, 172, 91, 351, 165, 114, 114, 114, 114, + 114, 114, 91, 168, 91, 171, 478, 91, 173, 89, + 170, 285, 91, 210, 49, 189, 40, 91, 91, 190, + 172, 313, 115, 165, 184, 114, 114, 114, 114, 114, + 114, 117, 193, 171, 198, 129, 173, 194, 117, 117, + + 117, 117, 117, 117, 189, 129, 129, 209, 190, 91, + 191, 129, 196, 184, 204, 129, 152, 49, 192, 201, + 226, 193, 129, 198, 186, 194, 202, 117, 117, 117, + 117, 117, 117, 48, 48, 48, 118, 152, 191, 152, + 196, 205, 203, 204, 120, 152, 206, 91, 201, 217, + 228, 129, 121, 152, 202, 152, 214, 89, 89, 121, + 121, 121, 121, 121, 121, 164, 152, 209, 89, 205, + 203, 89, 478, 129, 268, 206, 89, 217, 89, 228, + 282, 177, 40, 177, 282, 122, 229, 254, 121, 121, + 121, 121, 121, 121, 98, 231, 91, 91, 91, 129, + + 224, 98, 98, 98, 98, 98, 98, 91, 91, 216, + 152, 91, 234, 232, 229, 254, 91, 129, 91, 282, + 332, 152, 235, 49, 231, 285, 283, 236, 224, 152, + 98, 98, 98, 98, 98, 98, 147, 216, 152, 152, + 234, 237, 232, 147, 147, 147, 147, 147, 147, 332, + 235, 264, 265, 267, 400, 236, 282, 282, 90, 152, + 285, 152, 238, 63, 63, 129, 293, 219, 152, 219, + 237, 239, 147, 147, 147, 147, 147, 147, 160, 264, + 265, 267, 89, 269, 152, 160, 160, 160, 160, 160, + 160, 238, 152, 152, 293, 247, 247, 247, 247, 247, + + 239, 249, 283, 283, 261, 303, 250, 350, 251, 270, + 343, 269, 364, 271, 160, 160, 160, 160, 160, 160, + 162, 152, 91, 152, 376, 152, 308, 162, 162, 162, + 162, 162, 162, 261, 303, 152, 152, 152, 270, 343, + 364, 271, 247, 247, 247, 247, 247, 252, 249, 305, + 115, 306, 376, 250, 308, 251, 162, 162, 162, 162, + 162, 162, 97, 97, 97, 97, 97, 317, 242, 90, + 242, 152, 152, 368, 89, 307, 340, 342, 305, 210, + 306, 169, 152, 152, 152, 316, 344, 349, 169, 169, + 169, 169, 169, 169, 252, 280, 280, 280, 280, 280, + + 366, 478, 315, 307, 340, 342, 478, 314, 251, 152, + 468, 256, 152, 256, 91, 344, 152, 169, 169, 169, + 169, 169, 169, 108, 175, 175, 175, 108, 366, 40, + 280, 280, 280, 280, 280, 318, 318, 318, 318, 318, + 478, 370, 176, 251, 279, 282, 152, 252, 319, 176, + 176, 176, 176, 176, 176, 280, 280, 280, 280, 280, + 318, 318, 318, 318, 318, 152, 278, 90, 251, 274, + 370, 274, 384, 319, 405, 41, 371, 377, 176, 176, + 176, 176, 176, 176, 39, 39, 39, 107, 277, 152, + 109, 283, 152, 129, 152, 280, 280, 280, 280, 280, + + 152, 384, 405, 110, 396, 371, 377, 252, 251, 129, + 110, 110, 110, 110, 110, 110, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 478, 226, 478, 251, + 152, 282, 246, 396, 251, 403, 111, 152, 282, 110, + 110, 110, 110, 110, 110, 178, 404, 252, 467, 245, + 152, 417, 178, 178, 178, 178, 178, 178, 355, 318, + 318, 318, 355, 403, 282, 478, 152, 129, 252, 152, + 282, 356, 152, 252, 129, 404, 467, 283, 115, 285, + 417, 178, 178, 178, 178, 178, 178, 180, 129, 359, + 318, 318, 318, 359, 180, 180, 180, 180, 180, 180, + + 282, 129, 360, 97, 97, 97, 97, 97, 226, 115, + 283, 108, 175, 175, 175, 108, 283, 40, 213, 90, + 385, 163, 152, 180, 180, 180, 180, 180, 180, 116, + 116, 116, 116, 116, 161, 161, 161, 161, 161, 152, + 197, 285, 152, 119, 182, 182, 182, 119, 181, 385, + 90, 478, 478, 129, 40, 181, 181, 181, 181, 181, + 181, 282, 282, 41, 179, 179, 179, 179, 179, 430, + 159, 159, 159, 159, 159, 187, 187, 187, 187, 187, + 129, 129, 152, 90, 181, 181, 181, 181, 181, 181, + 119, 182, 182, 182, 119, 49, 295, 430, 295, 129, + + 448, 40, 285, 285, 199, 199, 199, 199, 199, 183, + 390, 391, 392, 129, 152, 393, 183, 183, 183, 183, + 183, 183, 152, 355, 318, 318, 318, 355, 448, 282, + 311, 429, 311, 152, 152, 129, 356, 152, 390, 152, + 391, 392, 49, 406, 393, 183, 183, 183, 183, 183, + 183, 48, 48, 48, 118, 394, 152, 129, 152, 429, + 432, 152, 120, 359, 318, 318, 318, 359, 395, 401, + 121, 406, 402, 416, 282, 283, 360, 121, 121, 121, + 121, 121, 121, 394, 129, 415, 152, 129, 421, 432, + 152, 152, 129, 152, 152, 129, 419, 395, 401, 407, + + 152, 402, 416, 122, 129, 408, 121, 121, 121, 121, + 121, 121, 188, 415, 152, 285, 421, 420, 152, 188, + 188, 188, 188, 188, 188, 419, 347, 407, 347, 372, + 386, 372, 386, 408, 286, 286, 286, 286, 286, 152, + 127, 418, 422, 115, 115, 167, 420, 251, 188, 188, + 188, 188, 188, 188, 146, 146, 146, 146, 146, 152, + 152, 163, 152, 149, 326, 361, 361, 361, 326, 431, + 418, 422, 129, 195, 129, 282, 433, 57, 152, 434, + 195, 195, 195, 195, 195, 195, 252, 411, 411, 411, + 411, 411, 321, 357, 357, 357, 321, 431, 282, 77, + + 152, 152, 59, 412, 127, 433, 129, 123, 434, 195, + 195, 195, 195, 195, 195, 200, 285, 411, 411, 411, + 411, 411, 200, 200, 200, 200, 200, 200, 423, 423, + 423, 423, 423, 412, 115, 101, 100, 435, 99, 414, + 79, 424, 440, 58, 283, 444, 478, 478, 478, 478, + 478, 200, 200, 200, 200, 200, 200, 159, 159, 159, + 159, 159, 478, 152, 152, 57, 435, 442, 441, 414, + 152, 440, 443, 50, 444, 449, 207, 152, 471, 152, + 426, 152, 454, 207, 207, 207, 207, 207, 207, 423, + 423, 423, 423, 423, 152, 442, 450, 441, 414, 47, + + 443, 152, 424, 449, 152, 455, 478, 471, 152, 152, + 451, 454, 207, 207, 207, 207, 207, 207, 161, 161, + 161, 161, 161, 478, 450, 152, 478, 152, 423, 423, + 423, 423, 423, 456, 455, 478, 460, 208, 451, 478, + 457, 424, 152, 478, 208, 208, 208, 208, 208, 208, + 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, + 478, 456, 152, 424, 461, 470, 478, 478, 424, 457, + 478, 152, 152, 208, 208, 208, 208, 208, 208, 215, + 426, 423, 423, 423, 423, 423, 215, 215, 215, 215, + 215, 215, 461, 470, 424, 478, 478, 478, 463, 478, + + 462, 466, 426, 477, 478, 478, 152, 426, 473, 152, + 152, 152, 474, 478, 475, 215, 215, 215, 215, 215, + 215, 108, 175, 175, 175, 108, 463, 40, 462, 466, + 152, 477, 478, 426, 152, 478, 478, 473, 152, 478, + 218, 474, 478, 475, 478, 478, 478, 218, 218, 218, + 218, 218, 218, 423, 423, 423, 423, 423, 438, 438, + 438, 438, 438, 478, 478, 478, 424, 478, 478, 478, + 478, 424, 478, 41, 478, 478, 218, 218, 218, 218, + 218, 218, 220, 445, 445, 445, 445, 445, 472, 220, + 220, 220, 220, 220, 220, 478, 424, 478, 478, 478, + + 478, 478, 476, 152, 478, 426, 478, 478, 478, 478, + 426, 478, 478, 478, 478, 478, 472, 152, 220, 220, + 220, 220, 220, 220, 179, 179, 179, 179, 179, 478, + 476, 478, 478, 478, 478, 426, 478, 478, 478, 478, + 478, 478, 478, 221, 478, 478, 478, 478, 478, 478, + 221, 221, 221, 221, 221, 221, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 221, + 221, 221, 221, 221, 221, 116, 116, 116, 116, 116, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + + 478, 478, 478, 478, 222, 478, 478, 478, 478, 478, + 478, 222, 222, 222, 222, 222, 222, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 222, 222, 222, 222, 222, 222, 119, 182, 182, 182, + 119, 478, 478, 478, 478, 478, 478, 40, 478, 478, + 478, 478, 478, 478, 478, 223, 478, 478, 478, 478, + 478, 478, 223, 223, 223, 223, 223, 223, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 49, 478, + + 478, 223, 223, 223, 223, 223, 223, 187, 187, 187, + 187, 187, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 227, 478, 478, 478, + 478, 478, 478, 227, 227, 227, 227, 227, 227, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 227, 227, 227, 227, 227, 227, 230, 478, + 478, 478, 478, 478, 478, 230, 230, 230, 230, 230, + 230, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + + 478, 478, 478, 478, 230, 230, 230, 230, 230, 230, + 199, 199, 199, 199, 199, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 233, + 478, 478, 478, 478, 478, 478, 233, 233, 233, 233, + 233, 233, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 233, 233, 233, 233, 233, + 233, 240, 478, 478, 478, 478, 478, 478, 240, 240, + 240, 240, 240, 240, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + + 478, 478, 478, 478, 478, 478, 478, 240, 240, 240, + 240, 240, 240, 161, 161, 161, 161, 161, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 241, 478, 478, 478, 478, 478, 478, 241, + 241, 241, 241, 241, 241, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 241, 241, + 241, 241, 241, 241, 253, 478, 478, 478, 478, 478, + 478, 253, 253, 253, 253, 253, 253, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 253, 253, 253, 253, 253, 253, 108, 175, 175, 175, + 108, 478, 40, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 255, 478, 478, 478, 478, + 478, 478, 255, 255, 255, 255, 255, 255, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 41, 478, + 478, 255, 255, 255, 255, 255, 255, 257, 478, 478, + 478, 478, 478, 478, 257, 257, 257, 257, 257, 257, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 257, 257, 257, 257, 257, 257, 179, + 179, 179, 179, 179, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 258, 478, + 478, 478, 478, 478, 478, 258, 258, 258, 258, 258, + 258, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 258, 258, 258, 258, 258, 258, + 116, 116, 116, 116, 116, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 259, + + 478, 478, 478, 478, 478, 478, 259, 259, 259, 259, + 259, 259, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 259, 259, 259, 259, 259, + 259, 119, 182, 182, 182, 119, 478, 478, 478, 478, + 478, 478, 40, 478, 478, 478, 478, 478, 478, 478, + 260, 478, 478, 478, 478, 478, 478, 260, 260, 260, + 260, 260, 260, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 49, 478, 478, 260, 260, 260, 260, + + 260, 260, 187, 187, 187, 187, 187, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 262, 478, 478, 478, 478, 478, 478, 262, 262, + 262, 262, 262, 262, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 262, 262, 262, + 262, 262, 262, 263, 478, 478, 478, 478, 478, 478, + 263, 263, 263, 263, 263, 263, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 263, + + 263, 263, 263, 263, 263, 199, 199, 199, 199, 199, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 266, 478, 478, 478, 478, 478, + 478, 266, 266, 266, 266, 266, 266, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 266, 266, 266, 266, 266, 266, 272, 478, 478, 478, + 478, 478, 478, 272, 272, 272, 272, 272, 272, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + + 478, 478, 272, 272, 272, 272, 272, 272, 161, 161, + 161, 161, 161, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 273, 478, 478, + 478, 478, 478, 478, 273, 273, 273, 273, 273, 273, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 273, 273, 273, 273, 273, 273, 280, + 280, 280, 280, 286, 478, 288, 478, 478, 478, 478, + 288, 288, 289, 478, 478, 478, 478, 478, 290, 478, + 478, 478, 478, 478, 478, 290, 290, 290, 290, 290, + + 290, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 291, 478, 478, 290, 290, 290, 290, 290, 290, + 292, 478, 478, 478, 478, 478, 478, 292, 292, 292, + 292, 292, 292, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 292, 292, 292, 292, + 292, 292, 108, 175, 175, 175, 108, 478, 40, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 294, 478, 478, 478, 478, 478, 478, 294, 294, + + 294, 294, 294, 294, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 41, 478, 478, 294, 294, 294, + 294, 294, 294, 296, 478, 478, 478, 478, 478, 478, + 296, 296, 296, 296, 296, 296, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 115, 478, 478, 296, + 296, 296, 296, 296, 296, 179, 179, 179, 179, 179, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 297, 478, 478, 478, 478, 478, + + 478, 297, 297, 297, 297, 297, 297, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 115, 478, 478, + 297, 297, 297, 297, 297, 297, 116, 116, 116, 116, + 116, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 298, 478, 478, 478, 478, + 478, 478, 298, 298, 298, 298, 298, 298, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 298, 298, 298, 298, 298, 298, 119, 182, 182, + + 182, 119, 478, 478, 478, 478, 478, 478, 40, 478, + 478, 478, 478, 478, 478, 478, 299, 478, 478, 478, + 478, 478, 478, 299, 299, 299, 299, 299, 299, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 49, + 478, 478, 299, 299, 299, 299, 299, 299, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 90, 478, 478, + 478, 478, 478, 478, 90, 90, 90, 90, 90, 90, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + + 478, 478, 478, 300, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 90, 90, 90, 90, 90, 90, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 300, 187, 187, 187, 187, 187, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 301, 478, 478, 478, 478, 478, 478, 301, 301, + 301, 301, 301, 301, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 301, 301, 301, + 301, 301, 301, 302, 478, 478, 478, 478, 478, 478, + + 302, 302, 302, 302, 302, 302, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 302, + 302, 302, 302, 302, 302, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 128, 478, 478, 478, 478, 478, + 478, 128, 128, 128, 128, 128, 128, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 128, 128, 128, 128, 128, 128, 199, 199, 199, 199, + + 199, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 304, 478, 478, 478, 478, + 478, 478, 304, 304, 304, 304, 304, 304, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 304, 304, 304, 304, 304, 304, 309, 478, 478, + 478, 478, 478, 478, 309, 309, 309, 309, 309, 309, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 309, 309, 309, 309, 309, 309, 161, + + 161, 161, 161, 161, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 310, 478, + 478, 478, 478, 478, 478, 310, 310, 310, 310, 310, + 310, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 310, 310, 310, 310, 310, 310, + 281, 281, 281, 320, 478, 478, 322, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 323, + 478, 478, 478, 478, 478, 478, 323, 323, 323, 323, + 323, 323, 478, 478, 478, 478, 478, 478, 478, 478, + + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 324, 478, 478, 323, 323, 323, 323, 323, + 323, 284, 284, 284, 325, 478, 478, 478, 478, 478, + 478, 478, 327, 478, 478, 478, 478, 478, 478, 478, + 328, 478, 478, 478, 478, 478, 478, 328, 328, 328, + 328, 328, 328, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 329, 478, 478, 328, 328, 328, 328, + 328, 328, 286, 286, 286, 286, 286, 478, 478, 478, + 478, 478, 478, 478, 478, 251, 478, 478, 478, 478, + + 478, 330, 478, 478, 478, 478, 478, 478, 330, 330, + 330, 330, 330, 330, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 252, 478, 478, 330, 330, 330, + 330, 330, 330, 280, 280, 280, 280, 286, 478, 288, + 478, 478, 478, 478, 288, 288, 289, 478, 478, 478, + 478, 478, 290, 478, 478, 478, 478, 478, 478, 290, + 290, 290, 290, 290, 290, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 291, 478, 478, 290, 290, + + 290, 290, 290, 290, 331, 478, 478, 478, 478, 478, + 478, 331, 331, 331, 331, 331, 331, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 331, 331, 331, 331, 331, 331, 108, 175, 175, 175, + 108, 478, 40, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 333, 478, 478, 478, 478, + 478, 478, 333, 333, 333, 333, 333, 333, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 41, 478, + + 478, 333, 333, 333, 333, 333, 333, 179, 179, 179, + 179, 179, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 334, 478, 478, 478, + 478, 478, 478, 334, 334, 334, 334, 334, 334, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 115, + 478, 478, 334, 334, 334, 334, 334, 334, 116, 116, + 116, 116, 116, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 335, 478, 478, + 478, 478, 478, 478, 335, 335, 335, 335, 335, 335, + + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 335, 335, 335, 335, 335, 335, 119, + 182, 182, 182, 119, 478, 478, 478, 478, 478, 478, + 40, 478, 478, 478, 478, 478, 478, 478, 336, 478, + 478, 478, 478, 478, 478, 336, 336, 336, 336, 336, + 336, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 49, 478, 478, 336, 336, 336, 336, 336, 336, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + + 478, 478, 478, 478, 478, 478, 337, 478, 478, 90, + 478, 478, 478, 478, 478, 478, 90, 90, 90, 90, + 90, 90, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 90, 90, 90, 90, 90, + 90, 187, 187, 187, 187, 187, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 338, 478, 478, 478, 478, 478, 478, 338, 338, 338, + 338, 338, 338, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + + 478, 478, 478, 478, 478, 478, 338, 338, 338, 338, + 338, 338, 146, 146, 146, 146, 146, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 339, 478, 478, 478, 478, 478, 478, 339, 339, + 339, 339, 339, 339, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 339, 339, 339, + 339, 339, 339, 199, 199, 199, 199, 199, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 341, 478, 478, 478, 478, 478, 478, 341, + + 341, 341, 341, 341, 341, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 341, 341, + 341, 341, 341, 341, 345, 478, 478, 478, 478, 478, + 478, 345, 345, 345, 345, 345, 345, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 345, 345, 345, 345, 345, 345, 161, 161, 161, 161, + 161, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 346, 478, 478, 478, 478, + + 478, 478, 346, 346, 346, 346, 346, 346, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 346, 346, 346, 346, 346, 346, 321, 357, 357, + 357, 321, 478, 282, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 358, 478, 478, 478, + 478, 478, 478, 358, 358, 358, 358, 358, 358, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 283, + 478, 478, 358, 358, 358, 358, 358, 358, 281, 281, + + 281, 320, 478, 478, 322, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 323, 478, 478, + 478, 478, 478, 478, 323, 323, 323, 323, 323, 323, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 324, 478, 478, 323, 323, 323, 323, 323, 323, 326, + 361, 361, 361, 326, 478, 478, 478, 478, 478, 478, + 282, 478, 478, 478, 478, 478, 478, 478, 362, 478, + 478, 478, 478, 478, 478, 362, 362, 362, 362, 362, + 362, 478, 478, 478, 478, 478, 478, 478, 478, 478, + + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 285, 478, 478, 362, 362, 362, 362, 362, 362, + 284, 284, 284, 325, 478, 478, 478, 478, 478, 478, + 478, 327, 478, 478, 478, 478, 478, 478, 478, 328, + 478, 478, 478, 478, 478, 478, 328, 328, 328, 328, + 328, 328, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 329, 478, 478, 328, 328, 328, 328, 328, + 328, 286, 286, 286, 286, 286, 478, 478, 478, 478, + 478, 478, 478, 478, 251, 478, 478, 478, 478, 478, + + 363, 478, 478, 478, 478, 478, 478, 363, 363, 363, + 363, 363, 363, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 252, 478, 478, 363, 363, 363, 363, + 363, 363, 365, 478, 478, 478, 478, 478, 478, 365, + 365, 365, 365, 365, 365, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 365, 365, + 365, 365, 365, 365, 113, 478, 478, 478, 478, 478, + 478, 113, 113, 113, 113, 113, 113, 478, 478, 478, + + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 113, 113, 113, 113, 113, 113, 367, 478, 478, 478, + 478, 478, 478, 367, 367, 367, 367, 367, 367, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 367, 367, 367, 367, 367, 367, 146, 146, + 146, 146, 146, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 128, 478, 478, + 478, 478, 478, 478, 128, 128, 128, 128, 128, 128, + + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 128, 128, 128, 128, 128, 128, 199, + 199, 199, 199, 199, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 369, 478, + 478, 478, 478, 478, 478, 369, 369, 369, 369, 369, + 369, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 369, 369, 369, 369, 369, 369, + 373, 478, 478, 478, 478, 478, 478, 373, 373, 373, + + 373, 373, 373, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 373, 373, 373, 373, + 373, 373, 374, 478, 478, 478, 478, 478, 478, 374, + 374, 374, 374, 374, 374, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 374, 374, + 374, 374, 374, 374, 286, 286, 286, 286, 286, 478, + 478, 478, 478, 478, 478, 478, 478, 251, 478, 478, + 478, 478, 478, 375, 478, 478, 478, 478, 478, 478, + + 375, 375, 375, 375, 375, 375, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 252, 478, 478, 375, + 375, 375, 375, 375, 375, 378, 478, 478, 478, 478, + 478, 478, 379, 478, 380, 478, 478, 478, 478, 381, + 382, 478, 478, 383, 478, 478, 478, 478, 152, 478, + 478, 478, 478, 478, 378, 478, 478, 478, 478, 478, + 379, 478, 380, 478, 478, 478, 478, 381, 382, 478, + 478, 383, 387, 478, 478, 478, 478, 478, 478, 387, + 387, 387, 387, 387, 387, 478, 478, 478, 478, 478, + + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 387, 387, + 387, 387, 387, 387, 388, 478, 478, 478, 478, 478, + 478, 388, 388, 388, 388, 388, 388, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 388, 388, 388, 388, 388, 388, 389, 478, 478, 478, + 478, 478, 478, 389, 389, 389, 389, 389, 389, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + + 478, 478, 389, 389, 389, 389, 389, 389, 397, 478, + 478, 478, 478, 478, 478, 397, 397, 397, 397, 397, + 397, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 397, 397, 397, 397, 397, 397, + 398, 478, 478, 478, 478, 478, 478, 398, 398, 398, + 398, 398, 398, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 398, 398, 398, 398, + 398, 398, 399, 478, 478, 478, 478, 478, 478, 399, + + 399, 399, 399, 399, 399, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 399, 399, + 399, 399, 399, 399, 409, 478, 478, 478, 478, 478, + 478, 409, 409, 409, 409, 409, 409, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 409, 409, 409, 409, 409, 409, 410, 478, 478, 478, + 478, 478, 478, 410, 410, 410, 410, 410, 410, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 410, 410, 410, 410, 410, 410, 428, 478, + 478, 478, 478, 478, 478, 428, 428, 428, 428, 428, + 428, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 428, 428, 428, 428, 428, 428, + 437, 478, 478, 478, 478, 478, 478, 437, 437, 437, + 437, 437, 437, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 437, 437, 437, 437, + + 437, 437, 438, 438, 438, 438, 438, 478, 478, 478, + 478, 478, 478, 478, 478, 424, 478, 478, 478, 478, + 478, 439, 478, 478, 478, 478, 478, 478, 439, 439, + 439, 439, 439, 439, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 426, 478, 478, 439, 439, 439, + 439, 439, 439, 445, 445, 445, 445, 445, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 446, 478, 478, 478, 478, 478, 478, 446, + 446, 446, 446, 446, 446, 478, 478, 478, 478, 478, + + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 446, 446, + 446, 446, 446, 446, 447, 478, 478, 478, 478, 478, + 478, 447, 447, 447, 447, 447, 447, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 447, 447, 447, 447, 447, 447, 452, 478, 478, 478, + 478, 478, 478, 452, 452, 452, 452, 452, 452, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + + 478, 478, 452, 452, 452, 452, 452, 452, 453, 478, + 478, 478, 478, 478, 478, 453, 453, 453, 453, 453, + 453, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 453, 453, 453, 453, 453, 453, + 458, 478, 478, 478, 478, 478, 478, 458, 458, 458, + 458, 458, 458, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 458, 458, 458, 458, + 458, 458, 459, 478, 478, 478, 478, 478, 478, 459, + + 459, 459, 459, 459, 459, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 459, 459, + 459, 459, 459, 459, 464, 478, 478, 478, 478, 478, + 478, 464, 464, 464, 464, 464, 464, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 464, 464, 464, 464, 464, 464, 465, 478, 478, 478, + 478, 478, 478, 465, 465, 465, 465, 465, 465, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 465, 465, 465, 465, 465, 465, 469, 478, + 478, 478, 478, 478, 478, 469, 469, 469, 469, 469, + 469, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 469, 469, 469, 469, 469, 469, + 39, 478, 478, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 45, 45, 478, 45, 45, 48, 478, + 478, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 53, 53, 478, 53, 53, 81, 478, 478, 81, + + 81, 90, 478, 90, 90, 478, 90, 90, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, - 113, 113, 113, 113, 113, 113, 113, 113, 113, 115, - 115, 478, 115, 115, 119, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 65, 65, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 130, 130, - 478, 130, 130, 151, 151, 151, 151, 151, 151, 151, - - 151, 151, 153, 153, 478, 153, 153, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 179, 179, 179, 179, - 179, 179, 179, 179, 179, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 188, 188, 188, - 188, 188, 188, 188, 188, 188, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 212, 212, 212, 478, 212, + 108, 113, 113, 478, 113, 113, 116, 116, 116, 116, + 116, 116, 116, 116, 116, 116, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 126, + 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 128, 128, 478, 128, 128, 146, 146, + 146, 146, 146, 146, 146, 146, 146, 146, 151, 151, + 478, 151, 151, 159, 159, 159, 159, 159, 159, 159, + + 159, 159, 159, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 166, 166, 166, 179, 179, 179, 179, + 179, 179, 179, 179, 179, 179, 48, 48, 478, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, + 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, + + 211, 211, 211, 211, 39, 478, 478, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, - 225, 225, 244, 244, 244, 478, 244, 249, 249, 249, - 249, 478, 249, 249, 249, 249, 249, 249, 276, 276, - 276, 478, 276, 282, 478, 282, 282, 282, 282, 282, - - 282, 282, 282, 282, 285, 478, 285, 285, 285, 285, - 285, 285, 285, 285, 285, 288, 288, 288, 288, 288, - 288, 288, 288, 288, 288, 288, 313, 313, 313, 478, - 313, 322, 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 327, 327, 327, 327, 327, 327, 327, 327, - 327, 327, 327, 348, 348, 348, 478, 348, 414, 414, - 414, 478, 478, 478, 414, 478, 478, 414, 414, 423, - 423, 423, 423, 423, 423, 423, 423, 423, 427, 427, - 427, 478, 478, 427, 427, 427, 478, 427, 427, 438, - 438, 438, 438, 438, 438, 438, 438, 438, 7, 478, + 225, 243, 243, 243, 243, 248, 248, 248, 248, 248, + 248, 478, 248, 248, 248, 248, 248, 248, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 275, 275, 275, 275, 248, + 248, 248, 248, 248, 248, 478, 248, 248, 248, 248, + 248, 248, 281, 478, 478, 281, 281, 281, 281, 281, + + 281, 281, 281, 281, 281, 284, 478, 478, 284, 284, + 284, 284, 284, 284, 284, 284, 284, 284, 287, 287, + 287, 287, 287, 287, 287, 287, 287, 287, 287, 287, + 287, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 113, 113, 478, 113, 113, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 312, 312, 312, 312, 321, 321, 321, 321, + 321, 321, 321, 321, 321, 321, 321, 321, 321, 284, + 478, 478, 284, 284, 284, 284, 284, 284, 284, 284, + 284, 284, 326, 326, 326, 326, 326, 326, 326, 326, + + 326, 326, 326, 326, 326, 248, 248, 248, 248, 248, + 478, 478, 248, 248, 248, 248, 248, 248, 287, 287, + 287, 287, 287, 287, 287, 287, 287, 287, 287, 287, + 287, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 113, 113, 478, 113, 113, 48, + 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 348, 348, 348, 348, 281, 281, 478, 281, + 281, 281, 281, 281, 281, 281, 281, 281, 281, 321, + 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, + 321, 321, 284, 284, 478, 284, 284, 284, 284, 284, + + 284, 284, 284, 284, 284, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, 248, 248, + 248, 248, 248, 478, 478, 248, 248, 248, 248, 248, + 248, 413, 413, 413, 413, 478, 478, 478, 478, 413, + 478, 478, 413, 413, 425, 425, 425, 425, 478, 478, + 478, 425, 425, 425, 478, 425, 425, 427, 427, 427, + 427, 427, 427, 427, 427, 427, 427, 436, 436, 436, + 436, 436, 436, 436, 436, 436, 436, 7, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478 + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478 } ; -static yyconst flex_int16_t yy_chk[2460] = +static yyconst flex_int16_t yy_chk[6664] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -576,270 +1048,733 @@ static yyconst flex_int16_t yy_chk[2460] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 3, 134, 4, 9, 9, 9, 9, 9, 12, 3, - 134, 4, 10, 10, 10, 10, 10, 11, 11, 11, - 11, 11, 3, 3, 4, 4, 13, 67, 12, 13, - 15, 39, 52, 25, 67, 3, 13, 4, 31, 13, - - 13, 13, 13, 13, 13, 15, 17, 25, 22, 17, - 27, 39, 31, 27, 11, 52, 17, 26, 22, 69, - 26, 26, 71, 22, 27, 48, 22, 42, 31, 22, - 42, 26, 17, 22, 22, 156, 22, 42, 71, 69, - 48, 17, 20, 23, 27, 64, 54, 64, 26, 20, - 20, 156, 20, 23, 23, 23, 23, 23, 23, 20, - 54, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 5, 4, 6, 15, + 12, 3, 477, 4, 9, 9, 9, 9, 9, 10, + + 10, 10, 10, 10, 3, 3, 4, 4, 11, 11, + 11, 11, 11, 23, 39, 5, 17, 6, 35, 17, + 3, 24, 4, 32, 24, 24, 32, 32, 38, 48, + 15, 69, 3, 3, 4, 4, 12, 42, 25, 17, + 42, 25, 11, 474, 69, 3, 35, 4, 17, 24, + 53, 32, 17, 23, 31, 78, 38, 78, 35, 69, + 39, 24, 467, 32, 33, 461, 65, 17, 83, 25, + 48, 11, 13, 42, 35, 13, 17, 24, 25, 32, + 83, 31, 13, 13, 13, 13, 13, 13, 65, 54, + 53, 33, 54, 54, 31, 65, 83, 25, 36, 36, + + 36, 36, 36, 70, 33, 68, 68, 456, 13, 31, + 166, 13, 13, 13, 13, 13, 13, 20, 166, 33, + 211, 90, 70, 440, 20, 20, 434, 20, 211, 54, + 124, 124, 70, 68, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 33, 32, - 35, 20, 32, 32, 36, 36, 36, 36, 36, 57, - - 43, 57, 33, 32, 35, 37, 37, 37, 37, 37, - 43, 43, 43, 43, 43, 43, 44, 84, 33, 55, - 32, 35, 55, 55, 57, 46, 44, 44, 44, 44, - 44, 44, 46, 55, 84, 46, 46, 46, 46, 46, - 46, 53, 37, 41, 41, 41, 41, 56, 66, 41, - 72, 53, 53, 53, 53, 53, 53, 70, 147, 86, - 72, 56, 41, 66, 147, 75, 86, 68, 56, 41, - 75, 73, 41, 41, 41, 41, 41, 41, 49, 49, - 49, 49, 68, 74, 74, 70, 73, 75, 63, 49, - 477, 75, 73, 68, 74, 78, 80, 49, 63, 63, - - 63, 63, 63, 63, 49, 83, 80, 49, 49, 49, - 49, 49, 49, 76, 81, 83, 76, 85, 78, 87, - 88, 89, 87, 88, 81, 81, 81, 81, 81, 81, - 93, 80, 85, 102, 108, 89, 90, 90, 90, 90, - 90, 124, 124, 143, 93, 140, 94, 102, 90, 97, - 143, 474, 109, 102, 108, 90, 94, 94, 94, 94, - 94, 94, 90, 97, 96, 90, 90, 90, 90, 90, - 90, 96, 109, 140, 118, 467, 98, 119, 96, 99, - 103, 98, 104, 105, 118, 97, 98, 98, 98, 98, - 98, 98, 119, 99, 103, 107, 104, 105, 120, 118, - - 107, 125, 127, 461, 150, 137, 127, 99, 137, 155, - 104, 150, 155, 120, 148, 125, 103, 105, 112, 125, - 107, 110, 110, 110, 110, 110, 132, 110, 112, 112, - 112, 112, 112, 112, 148, 158, 167, 192, 456, 160, - 110, 158, 157, 192, 167, 132, 159, 110, 160, 162, - 110, 110, 110, 110, 110, 110, 111, 111, 111, 111, - 157, 159, 111, 162, 190, 194, 116, 206, 344, 166, - 169, 190, 194, 344, 206, 111, 116, 116, 116, 116, - 116, 116, 111, 166, 169, 111, 111, 111, 111, 111, - 111, 114, 114, 114, 114, 114, 198, 205, 226, 207, - - 198, 117, 226, 170, 171, 173, 207, 440, 205, 203, - 114, 117, 117, 117, 117, 117, 117, 170, 171, 173, - 114, 114, 114, 114, 114, 114, 121, 121, 121, 121, - 121, 203, 212, 175, 236, 238, 131, 121, 238, 182, - 212, 392, 434, 429, 236, 121, 131, 131, 131, 131, - 131, 131, 121, 175, 182, 121, 121, 121, 121, 121, - 121, 122, 122, 122, 122, 216, 265, 244, 392, 268, - 269, 154, 122, 196, 184, 244, 268, 265, 269, 216, - 122, 154, 154, 154, 154, 154, 154, 122, 184, 196, - 122, 122, 122, 122, 122, 122, 129, 129, 129, 129, - - 129, 184, 276, 202, 340, 307, 161, 204, 307, 309, - 276, 419, 309, 385, 340, 129, 161, 161, 161, 161, - 161, 161, 129, 202, 204, 129, 129, 129, 129, 129, - 129, 152, 152, 152, 152, 152, 232, 165, 172, 229, - 313, 345, 420, 384, 165, 261, 345, 420, 313, 232, - 152, 165, 172, 235, 229, 237, 239, 152, 224, 261, - 152, 152, 152, 152, 152, 152, 163, 163, 163, 163, - 163, 370, 224, 250, 235, 237, 176, 239, 370, 172, - 435, 261, 364, 224, 435, 163, 176, 176, 176, 176, - 176, 176, 177, 250, 251, 163, 163, 163, 163, 163, - - 163, 178, 177, 177, 177, 177, 177, 177, 270, 251, - 272, 178, 178, 178, 178, 178, 178, 180, 180, 180, - 180, 180, 281, 281, 281, 281, 281, 181, 272, 285, - 270, 383, 348, 343, 383, 281, 180, 181, 181, 181, - 181, 181, 181, 183, 285, 332, 180, 180, 180, 180, - 180, 180, 187, 183, 183, 183, 183, 183, 183, 282, - 303, 306, 187, 187, 187, 187, 187, 187, 189, 189, - 189, 189, 189, 283, 283, 283, 283, 283, 199, 282, - 300, 327, 303, 306, 300, 318, 283, 189, 199, 199, - 199, 199, 199, 199, 300, 322, 327, 189, 189, 189, - - 189, 189, 189, 201, 201, 201, 201, 201, 319, 319, - 319, 319, 319, 208, 418, 322, 360, 418, 317, 316, - 326, 319, 201, 208, 208, 208, 208, 208, 208, 209, - 326, 360, 201, 201, 201, 201, 201, 201, 211, 209, - 209, 209, 209, 209, 209, 326, 356, 315, 211, 211, - 211, 211, 211, 211, 215, 215, 215, 215, 215, 218, - 215, 371, 337, 357, 361, 215, 356, 215, 371, 218, - 218, 218, 218, 218, 218, 219, 337, 321, 314, 361, - 215, 220, 321, 357, 366, 219, 219, 219, 219, 219, - 219, 220, 220, 220, 220, 220, 220, 221, 366, 378, - - 337, 366, 321, 222, 381, 407, 378, 221, 221, 221, - 221, 221, 221, 222, 222, 222, 222, 222, 222, 223, - 334, 334, 334, 334, 334, 227, 308, 381, 407, 223, - 223, 223, 223, 223, 223, 227, 227, 227, 227, 227, - 227, 228, 379, 380, 298, 422, 334, 233, 422, 379, - 380, 228, 228, 228, 228, 228, 228, 233, 233, 233, - 233, 233, 233, 234, 338, 338, 338, 338, 338, 241, - 432, 415, 441, 234, 234, 234, 234, 234, 234, 241, - 241, 241, 241, 241, 241, 242, 382, 441, 393, 432, - 338, 243, 415, 382, 393, 242, 242, 242, 242, 242, - - 242, 243, 243, 243, 243, 243, 243, 248, 248, 248, - 248, 248, 405, 248, 293, 390, 394, 395, 248, 405, - 248, 249, 249, 249, 249, 249, 255, 249, 377, 390, - 394, 395, 249, 248, 249, 402, 255, 255, 255, 255, - 255, 255, 377, 396, 404, 403, 402, 249, 253, 253, - 253, 253, 253, 403, 253, 404, 463, 396, 256, 253, - 253, 253, 377, 396, 280, 408, 463, 253, 256, 256, - 256, 256, 256, 256, 253, 257, 408, 253, 253, 253, - 253, 253, 253, 258, 416, 257, 257, 257, 257, 257, - 257, 259, 279, 258, 258, 258, 258, 258, 258, 260, - - 416, 259, 259, 259, 259, 259, 259, 262, 278, 260, - 260, 260, 260, 260, 260, 263, 277, 262, 262, 262, - 262, 262, 262, 266, 271, 263, 263, 263, 263, 263, - 263, 267, 264, 266, 266, 266, 266, 266, 266, 273, - 254, 267, 267, 267, 267, 267, 267, 274, 247, 273, - 273, 273, 273, 273, 273, 275, 406, 274, 274, 274, - 274, 274, 274, 406, 401, 275, 275, 275, 275, 275, - 275, 284, 284, 284, 284, 391, 443, 284, 401, 417, - 391, 431, 246, 391, 431, 287, 287, 287, 287, 287, - 284, 287, 245, 443, 240, 231, 287, 284, 287, 417, - - 284, 284, 284, 284, 284, 284, 286, 286, 286, 286, - 230, 287, 412, 412, 412, 412, 412, 286, 288, 288, - 288, 288, 288, 421, 288, 286, 430, 442, 412, 288, - 421, 288, 286, 430, 450, 286, 286, 286, 286, 286, - 286, 444, 225, 470, 288, 289, 289, 289, 289, 289, - 442, 289, 217, 475, 450, 444, 289, 470, 289, 290, - 290, 290, 290, 290, 294, 290, 448, 475, 462, 433, - 290, 289, 290, 448, 294, 294, 294, 294, 294, 294, - 425, 425, 425, 425, 425, 290, 291, 291, 291, 291, - 291, 433, 291, 425, 455, 462, 296, 291, 214, 291, - - 341, 341, 341, 341, 341, 291, 296, 296, 296, 296, - 296, 296, 291, 213, 455, 291, 291, 291, 291, 291, - 291, 292, 292, 292, 292, 292, 341, 292, 449, 451, - 200, 297, 292, 292, 292, 449, 451, 460, 195, 193, - 292, 297, 297, 297, 297, 297, 297, 292, 299, 191, - 292, 292, 292, 292, 292, 292, 301, 460, 299, 299, - 299, 299, 299, 299, 302, 466, 301, 301, 301, 301, - 301, 301, 304, 188, 302, 302, 302, 302, 302, 302, - 305, 457, 304, 304, 304, 304, 304, 304, 466, 185, - 305, 305, 305, 305, 305, 305, 310, 310, 310, 310, - - 310, 311, 457, 476, 468, 179, 174, 168, 310, 454, - 468, 311, 311, 311, 311, 311, 311, 312, 471, 454, - 164, 473, 310, 153, 476, 471, 473, 312, 312, 312, - 312, 312, 312, 323, 323, 323, 323, 323, 151, 323, - 454, 328, 328, 328, 328, 328, 323, 149, 472, 146, - 145, 144, 328, 142, 328, 472, 141, 139, 331, 323, - 324, 324, 324, 324, 324, 138, 324, 328, 331, 331, - 331, 331, 331, 331, 355, 355, 355, 355, 355, 324, - 355, 365, 365, 365, 365, 365, 324, 355, 136, 324, - 324, 324, 324, 324, 324, 325, 325, 325, 325, 135, - - 355, 325, 133, 130, 128, 333, 126, 365, 115, 367, - 367, 367, 367, 367, 325, 333, 333, 333, 333, 333, - 333, 325, 113, 106, 325, 325, 325, 325, 325, 325, - 329, 329, 329, 329, 329, 367, 95, 82, 79, 77, - 335, 329, 65, 369, 369, 369, 369, 369, 61, 329, - 335, 335, 335, 335, 335, 335, 329, 60, 59, 329, - 329, 329, 329, 329, 329, 330, 330, 330, 330, 369, - 58, 51, 45, 38, 29, 336, 330, 28, 24, 21, - 19, 18, 16, 14, 330, 336, 336, 336, 336, 336, - 336, 330, 339, 7, 330, 330, 330, 330, 330, 330, - - 342, 6, 339, 339, 339, 339, 339, 339, 5, 0, - 342, 342, 342, 342, 342, 342, 346, 346, 346, 346, - 346, 347, 0, 0, 0, 0, 0, 0, 346, 0, - 0, 347, 347, 347, 347, 347, 347, 358, 0, 0, - 0, 0, 346, 0, 0, 0, 0, 358, 358, 358, - 358, 358, 358, 359, 359, 359, 359, 359, 362, 0, - 0, 0, 0, 0, 359, 0, 359, 0, 362, 362, - 362, 362, 362, 362, 363, 0, 0, 368, 0, 359, - 0, 0, 0, 368, 363, 363, 363, 363, 363, 363, - 368, 0, 368, 372, 0, 0, 0, 368, 368, 373, - - 0, 368, 0, 372, 372, 372, 372, 372, 372, 373, - 373, 373, 373, 373, 373, 374, 0, 0, 0, 0, - 0, 375, 0, 0, 0, 374, 374, 374, 374, 374, - 374, 375, 375, 375, 375, 375, 375, 387, 0, 0, - 0, 0, 0, 388, 0, 0, 0, 387, 387, 387, - 387, 387, 387, 388, 388, 388, 388, 388, 388, 389, - 0, 0, 0, 0, 0, 397, 0, 0, 0, 389, - 389, 389, 389, 389, 389, 397, 397, 397, 397, 397, - 397, 398, 0, 0, 0, 0, 0, 399, 0, 0, - 0, 398, 398, 398, 398, 398, 398, 399, 399, 399, - - 399, 399, 399, 400, 400, 400, 400, 400, 0, 0, - 409, 0, 0, 0, 0, 0, 0, 0, 0, 400, - 409, 409, 409, 409, 409, 409, 410, 0, 0, 400, - 411, 411, 411, 411, 411, 0, 410, 410, 410, 410, - 410, 410, 0, 0, 0, 0, 411, 413, 0, 0, - 414, 414, 414, 414, 414, 0, 411, 413, 413, 413, - 413, 413, 413, 414, 423, 423, 423, 423, 423, 0, - 427, 427, 427, 427, 427, 0, 414, 423, 0, 0, - 0, 0, 0, 427, 0, 0, 0, 428, 0, 0, - 423, 424, 424, 424, 424, 424, 427, 428, 428, 428, - - 428, 428, 428, 0, 424, 436, 436, 436, 436, 436, - 424, 0, 0, 0, 0, 0, 0, 424, 436, 0, - 424, 424, 424, 424, 424, 424, 437, 0, 0, 0, - 0, 436, 0, 0, 0, 0, 437, 437, 437, 437, - 437, 437, 438, 438, 438, 438, 438, 445, 0, 0, - 446, 446, 446, 446, 446, 438, 0, 445, 445, 445, - 445, 445, 445, 446, 0, 0, 0, 447, 438, 439, - 439, 439, 439, 439, 0, 0, 446, 447, 447, 447, - 447, 447, 447, 0, 0, 0, 0, 0, 439, 0, - 0, 0, 0, 0, 452, 0, 0, 0, 439, 439, - - 439, 439, 439, 439, 452, 452, 452, 452, 452, 452, - 453, 0, 0, 0, 0, 0, 458, 0, 0, 0, - 453, 453, 453, 453, 453, 453, 458, 458, 458, 458, - 458, 458, 459, 0, 0, 0, 0, 0, 464, 0, - 0, 0, 459, 459, 459, 459, 459, 459, 464, 464, - 464, 464, 464, 464, 465, 0, 0, 0, 0, 0, - 469, 0, 0, 0, 465, 465, 465, 465, 465, 465, - 469, 469, 469, 469, 469, 469, 479, 0, 479, 479, - 479, 479, 479, 479, 479, 479, 479, 480, 480, 0, - 480, 480, 481, 0, 481, 481, 481, 481, 481, 481, - - 481, 481, 481, 482, 482, 0, 482, 482, 483, 0, - 0, 483, 483, 484, 484, 484, 484, 484, 484, 484, - 484, 484, 485, 0, 485, 485, 0, 485, 485, 486, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 90, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 64, 52, + 106, 20, 22, 74, 55, 429, 37, 37, 37, 37, + + 37, 57, 64, 57, 22, 243, 487, 22, 487, 52, + 22, 419, 55, 243, 22, 22, 64, 22, 106, 74, + 67, 66, 74, 57, 72, 72, 385, 127, 22, 67, + 37, 127, 66, 22, 55, 66, 22, 52, 71, 22, + 97, 55, 22, 22, 71, 22, 26, 73, 67, 66, + 82, 57, 71, 26, 26, 26, 26, 26, 26, 37, + 66, 72, 108, 109, 73, 80, 71, 76, 73, 82, + 107, 73, 71, 76, 86, 107, 73, 85, 140, 82, + 97, 384, 26, 26, 26, 26, 26, 26, 41, 41, + 41, 41, 73, 118, 41, 76, 73, 80, 84, 85, + + 86, 80, 87, 86, 348, 175, 85, 41, 108, 109, + 96, 140, 84, 93, 41, 41, 41, 41, 41, 41, + 93, 107, 94, 119, 102, 80, 84, 104, 87, 342, + 250, 87, 103, 119, 118, 96, 317, 105, 161, 316, + 41, 102, 315, 41, 41, 41, 41, 41, 41, 44, + 96, 175, 104, 93, 314, 94, 44, 44, 44, 44, + 44, 44, 94, 96, 102, 103, 120, 104, 105, 125, + 102, 250, 103, 275, 119, 131, 120, 105, 161, 134, + 104, 275, 44, 94, 125, 44, 44, 44, 44, 44, + 44, 46, 144, 103, 150, 131, 105, 145, 46, 46, + + 46, 46, 46, 46, 131, 134, 145, 165, 134, 125, + 137, 137, 148, 125, 156, 144, 150, 120, 192, 153, + 226, 144, 148, 150, 226, 145, 154, 46, 46, 46, + 46, 46, 46, 49, 49, 49, 49, 156, 137, 154, + 148, 157, 155, 156, 49, 153, 158, 165, 153, 174, + 190, 192, 49, 155, 154, 157, 168, 170, 164, 49, + 49, 49, 49, 49, 49, 164, 158, 171, 173, 157, + 155, 172, 182, 190, 235, 158, 184, 174, 216, 190, + 249, 499, 182, 499, 284, 49, 194, 217, 49, 49, + 49, 49, 49, 49, 56, 196, 168, 170, 164, 194, + + 184, 56, 56, 56, 56, 56, 56, 171, 173, 172, + 235, 172, 201, 198, 194, 217, 184, 196, 216, 325, + 293, 201, 202, 182, 196, 284, 249, 203, 184, 202, + 56, 56, 56, 56, 56, 56, 77, 172, 198, 203, + 201, 204, 198, 77, 77, 77, 77, 77, 77, 293, + 202, 231, 232, 234, 390, 203, 281, 320, 390, 204, + 325, 234, 205, 492, 492, 231, 254, 509, 232, 509, + 204, 206, 77, 77, 77, 77, 77, 77, 88, 231, + 232, 234, 224, 236, 205, 88, 88, 88, 88, 88, + 88, 205, 236, 206, 254, 214, 214, 214, 214, 214, + + 206, 214, 281, 320, 224, 265, 214, 313, 214, 237, + 306, 236, 332, 238, 88, 88, 88, 88, 88, 88, + 91, 238, 224, 265, 364, 307, 271, 91, 91, 91, + 91, 91, 91, 224, 265, 237, 306, 271, 237, 306, + 332, 238, 247, 247, 247, 247, 247, 214, 247, 267, + 296, 268, 364, 247, 271, 247, 91, 91, 91, 91, + 91, 91, 98, 98, 98, 98, 98, 279, 511, 337, + 511, 267, 268, 340, 98, 269, 303, 305, 267, 312, + 268, 98, 269, 303, 305, 278, 308, 312, 98, 98, + 98, 98, 98, 98, 247, 248, 248, 248, 248, 248, + + 337, 248, 277, 269, 303, 305, 248, 276, 248, 340, + 463, 515, 308, 515, 98, 308, 270, 98, 98, 98, + 98, 98, 98, 110, 110, 110, 110, 110, 337, 110, + 280, 280, 280, 280, 280, 282, 282, 282, 282, 282, + 321, 343, 110, 280, 246, 321, 463, 248, 282, 110, + 110, 110, 110, 110, 110, 286, 286, 286, 286, 286, + 318, 318, 318, 318, 318, 343, 245, 366, 286, 517, + 343, 517, 370, 318, 394, 110, 344, 366, 110, 110, + 110, 110, 110, 110, 111, 111, 111, 111, 244, 394, + 111, 321, 239, 229, 370, 287, 287, 287, 287, 287, + + 344, 370, 394, 111, 383, 344, 366, 286, 287, 228, + 111, 111, 111, 111, 111, 111, 288, 288, 288, 288, + 288, 289, 289, 289, 289, 289, 356, 225, 326, 288, + 383, 356, 213, 383, 289, 392, 111, 392, 326, 111, + 111, 111, 111, 111, 111, 114, 393, 287, 462, 212, + 462, 403, 114, 114, 114, 114, 114, 114, 322, 322, + 322, 322, 322, 392, 322, 357, 199, 193, 288, 393, + 357, 322, 403, 289, 191, 393, 462, 356, 114, 326, + 403, 114, 114, 114, 114, 114, 114, 115, 189, 327, + 327, 327, 327, 327, 115, 115, 115, 115, 115, 115, + + 327, 187, 327, 331, 331, 331, 331, 331, 185, 179, + 322, 333, 333, 333, 333, 333, 357, 333, 167, 331, + 371, 163, 159, 115, 115, 115, 115, 115, 115, 117, + 117, 117, 117, 117, 346, 346, 346, 346, 346, 151, + 149, 327, 371, 336, 336, 336, 336, 336, 117, 371, + 346, 360, 361, 146, 336, 117, 117, 117, 117, 117, + 117, 360, 361, 333, 365, 365, 365, 365, 365, 416, + 345, 345, 345, 345, 345, 367, 367, 367, 367, 367, + 143, 142, 416, 377, 117, 117, 117, 117, 117, 117, + 121, 121, 121, 121, 121, 336, 524, 416, 524, 141, + + 441, 121, 360, 361, 369, 369, 369, 369, 369, 121, + 377, 378, 379, 139, 441, 380, 121, 121, 121, 121, + 121, 121, 345, 355, 355, 355, 355, 355, 441, 355, + 527, 415, 527, 378, 379, 138, 355, 380, 377, 415, + 378, 379, 121, 395, 380, 121, 121, 121, 121, 121, + 121, 122, 122, 122, 122, 381, 369, 136, 395, 415, + 418, 381, 122, 359, 359, 359, 359, 359, 382, 391, + 122, 395, 391, 402, 359, 355, 359, 122, 122, 122, + 122, 122, 122, 381, 135, 401, 418, 133, 407, 418, + 382, 402, 132, 391, 407, 130, 405, 382, 391, 396, + + 401, 391, 402, 122, 128, 396, 122, 122, 122, 122, + 122, 122, 129, 401, 396, 359, 407, 406, 405, 129, + 129, 129, 129, 129, 129, 405, 537, 396, 537, 544, + 545, 544, 545, 396, 399, 399, 399, 399, 399, 406, + 126, 404, 408, 116, 113, 95, 406, 399, 129, 129, + 129, 129, 129, 129, 147, 147, 147, 147, 147, 404, + 408, 92, 81, 79, 410, 410, 410, 410, 410, 417, + 404, 408, 75, 147, 63, 410, 420, 61, 417, 421, + 147, 147, 147, 147, 147, 147, 399, 400, 400, 400, + 400, 400, 409, 409, 409, 409, 409, 417, 409, 60, + + 420, 421, 59, 400, 58, 420, 147, 51, 421, 147, + 147, 147, 147, 147, 147, 152, 410, 411, 411, 411, + 411, 411, 152, 152, 152, 152, 152, 152, 413, 413, + 413, 413, 413, 411, 45, 29, 28, 422, 27, 400, + 21, 413, 430, 19, 409, 435, 412, 412, 412, 412, + 412, 152, 152, 152, 152, 152, 152, 160, 160, 160, + 160, 160, 412, 422, 430, 18, 422, 432, 431, 411, + 435, 430, 433, 16, 435, 442, 160, 432, 468, 433, + 413, 442, 448, 160, 160, 160, 160, 160, 160, 423, + 423, 423, 423, 423, 431, 432, 443, 431, 412, 14, + + 433, 468, 423, 442, 448, 449, 7, 468, 443, 160, + 444, 448, 160, 160, 160, 160, 160, 160, 162, 162, + 162, 162, 162, 0, 443, 444, 0, 449, 425, 425, + 425, 425, 425, 450, 449, 0, 454, 162, 444, 0, + 451, 425, 450, 0, 162, 162, 162, 162, 162, 162, + 427, 427, 427, 427, 427, 436, 436, 436, 436, 436, + 0, 450, 451, 427, 454, 466, 0, 0, 436, 451, + 0, 466, 454, 162, 162, 162, 162, 162, 162, 169, + 425, 438, 438, 438, 438, 438, 169, 169, 169, 169, + 169, 169, 454, 466, 438, 0, 0, 0, 457, 0, + + 455, 460, 427, 476, 0, 0, 457, 436, 471, 455, + 460, 476, 472, 0, 473, 169, 169, 169, 169, 169, + 169, 176, 176, 176, 176, 176, 457, 176, 455, 460, + 471, 476, 0, 438, 472, 0, 0, 471, 473, 0, + 176, 472, 0, 473, 0, 0, 0, 176, 176, 176, + 176, 176, 176, 445, 445, 445, 445, 445, 465, 465, + 465, 465, 465, 0, 0, 0, 445, 0, 0, 0, + 0, 465, 0, 176, 0, 0, 176, 176, 176, 176, + 176, 176, 178, 469, 469, 469, 469, 469, 470, 178, + 178, 178, 178, 178, 178, 0, 469, 0, 0, 0, + + 0, 0, 475, 470, 0, 445, 0, 0, 0, 0, + 465, 0, 0, 0, 0, 0, 470, 475, 178, 178, + 178, 178, 178, 178, 180, 180, 180, 180, 180, 0, + 475, 0, 0, 0, 0, 469, 0, 0, 0, 0, + 0, 0, 0, 180, 0, 0, 0, 0, 0, 0, + 180, 180, 180, 180, 180, 180, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 180, + 180, 180, 180, 180, 180, 181, 181, 181, 181, 181, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 181, 0, 0, 0, 0, 0, + 0, 181, 181, 181, 181, 181, 181, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 181, 181, 181, 181, 181, 181, 183, 183, 183, 183, + 183, 0, 0, 0, 0, 0, 0, 183, 0, 0, + 0, 0, 0, 0, 0, 183, 0, 0, 0, 0, + 0, 0, 183, 183, 183, 183, 183, 183, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 183, 0, + + 0, 183, 183, 183, 183, 183, 183, 188, 188, 188, + 188, 188, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 188, 0, 0, 0, + 0, 0, 0, 188, 188, 188, 188, 188, 188, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 188, 188, 188, 188, 188, 188, 195, 0, + 0, 0, 0, 0, 0, 195, 195, 195, 195, 195, + 195, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 195, 195, 195, 195, 195, 195, + 200, 200, 200, 200, 200, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, + 0, 0, 0, 0, 0, 0, 200, 200, 200, 200, + 200, 200, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 200, 200, 200, 200, 200, + 200, 207, 0, 0, 0, 0, 0, 0, 207, 207, + 207, 207, 207, 207, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 207, 207, 207, + 207, 207, 207, 208, 208, 208, 208, 208, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 208, 0, 0, 0, 0, 0, 0, 208, + 208, 208, 208, 208, 208, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 208, 208, + 208, 208, 208, 208, 215, 0, 0, 0, 0, 0, + 0, 215, 215, 215, 215, 215, 215, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 215, 215, 215, 215, 215, 215, 218, 218, 218, 218, + 218, 0, 218, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 218, 0, 0, 0, 0, + 0, 0, 218, 218, 218, 218, 218, 218, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 218, 0, + 0, 218, 218, 218, 218, 218, 218, 220, 0, 0, + 0, 0, 0, 0, 220, 220, 220, 220, 220, 220, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 220, 220, 220, 220, 220, 220, 221, + 221, 221, 221, 221, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 221, 0, + 0, 0, 0, 0, 0, 221, 221, 221, 221, 221, + 221, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 221, 221, 221, 221, 221, 221, + 222, 222, 222, 222, 222, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 222, + + 0, 0, 0, 0, 0, 0, 222, 222, 222, 222, + 222, 222, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 222, 222, 222, 222, 222, + 222, 223, 223, 223, 223, 223, 0, 0, 0, 0, + 0, 0, 223, 0, 0, 0, 0, 0, 0, 0, + 223, 0, 0, 0, 0, 0, 0, 223, 223, 223, + 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 223, 0, 0, 223, 223, 223, 223, + + 223, 223, 227, 227, 227, 227, 227, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 227, 0, 0, 0, 0, 0, 0, 227, 227, + 227, 227, 227, 227, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 227, 227, 227, + 227, 227, 227, 230, 0, 0, 0, 0, 0, 0, + 230, 230, 230, 230, 230, 230, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, + + 230, 230, 230, 230, 230, 233, 233, 233, 233, 233, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 233, 0, 0, 0, 0, 0, + 0, 233, 233, 233, 233, 233, 233, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 233, 233, 233, 233, 233, 233, 240, 0, 0, 0, + 0, 0, 0, 240, 240, 240, 240, 240, 240, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 240, 240, 240, 240, 240, 240, 241, 241, + 241, 241, 241, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 241, 0, 0, + 0, 0, 0, 0, 241, 241, 241, 241, 241, 241, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 241, 241, 241, 241, 241, 241, 252, + 252, 252, 252, 252, 0, 252, 0, 0, 0, 0, + 252, 252, 252, 0, 0, 0, 0, 0, 252, 0, + 0, 0, 0, 0, 0, 252, 252, 252, 252, 252, + + 252, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 252, 0, 0, 252, 252, 252, 252, 252, 252, + 253, 0, 0, 0, 0, 0, 0, 253, 253, 253, + 253, 253, 253, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 253, 253, 253, 253, + 253, 253, 255, 255, 255, 255, 255, 0, 255, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 255, 0, 0, 0, 0, 0, 0, 255, 255, + + 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 0, 0, 255, 255, 255, + 255, 255, 255, 257, 0, 0, 0, 0, 0, 0, + 257, 257, 257, 257, 257, 257, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 257, 0, 0, 257, + 257, 257, 257, 257, 257, 258, 258, 258, 258, 258, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 258, 0, 0, 0, 0, 0, + + 0, 258, 258, 258, 258, 258, 258, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 258, 0, 0, + 258, 258, 258, 258, 258, 258, 259, 259, 259, 259, + 259, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 259, 0, 0, 0, 0, + 0, 0, 259, 259, 259, 259, 259, 259, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 259, 259, 259, 259, 259, 259, 260, 260, 260, + + 260, 260, 0, 0, 0, 0, 0, 0, 260, 0, + 0, 0, 0, 0, 0, 0, 260, 0, 0, 0, + 0, 0, 0, 260, 260, 260, 260, 260, 260, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 260, + 0, 0, 260, 260, 260, 260, 260, 260, 261, 261, + 261, 261, 261, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 261, 0, 0, + 0, 0, 0, 0, 261, 261, 261, 261, 261, 261, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 261, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 261, 261, 261, 261, 261, 261, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 261, 262, 262, 262, 262, 262, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 262, 0, 0, 0, 0, 0, 0, 262, 262, + 262, 262, 262, 262, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 262, 262, 262, + 262, 262, 262, 263, 0, 0, 0, 0, 0, 0, + + 263, 263, 263, 263, 263, 263, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 263, + 263, 263, 263, 263, 263, 264, 264, 264, 264, 264, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 264, 0, 0, 0, 0, 0, + 0, 264, 264, 264, 264, 264, 264, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 264, 264, 264, 264, 264, 264, 266, 266, 266, 266, + + 266, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 266, 0, 0, 0, 0, + 0, 0, 266, 266, 266, 266, 266, 266, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 266, 266, 266, 266, 266, 266, 272, 0, 0, + 0, 0, 0, 0, 272, 272, 272, 272, 272, 272, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 272, 272, 272, 272, 272, 272, 273, + + 273, 273, 273, 273, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 273, 0, + 0, 0, 0, 0, 0, 273, 273, 273, 273, 273, + 273, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 273, 273, 273, 273, 273, 273, + 283, 283, 283, 283, 0, 0, 283, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 283, + 0, 0, 0, 0, 0, 0, 283, 283, 283, 283, + 283, 283, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 283, 0, 0, 283, 283, 283, 283, 283, + 283, 285, 285, 285, 285, 0, 0, 0, 0, 0, + 0, 0, 285, 0, 0, 0, 0, 0, 0, 0, + 285, 0, 0, 0, 0, 0, 0, 285, 285, 285, + 285, 285, 285, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 285, 0, 0, 285, 285, 285, 285, + 285, 285, 290, 290, 290, 290, 290, 0, 0, 0, + 0, 0, 0, 0, 0, 290, 0, 0, 0, 0, + + 0, 290, 0, 0, 0, 0, 0, 0, 290, 290, + 290, 290, 290, 290, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 290, 0, 0, 290, 290, 290, + 290, 290, 290, 291, 291, 291, 291, 291, 0, 291, + 0, 0, 0, 0, 291, 291, 291, 0, 0, 0, + 0, 0, 291, 0, 0, 0, 0, 0, 0, 291, + 291, 291, 291, 291, 291, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 291, 0, 0, 291, 291, + + 291, 291, 291, 291, 292, 0, 0, 0, 0, 0, + 0, 292, 292, 292, 292, 292, 292, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 292, 292, 292, 292, 292, 292, 294, 294, 294, 294, + 294, 0, 294, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 294, 0, 0, 0, 0, + 0, 0, 294, 294, 294, 294, 294, 294, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 294, 0, + + 0, 294, 294, 294, 294, 294, 294, 297, 297, 297, + 297, 297, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 297, 0, 0, 0, + 0, 0, 0, 297, 297, 297, 297, 297, 297, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 297, + 0, 0, 297, 297, 297, 297, 297, 297, 298, 298, + 298, 298, 298, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 298, 0, 0, + 0, 0, 0, 0, 298, 298, 298, 298, 298, 298, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 298, 298, 298, 298, 298, 298, 299, + 299, 299, 299, 299, 0, 0, 0, 0, 0, 0, + 299, 0, 0, 0, 0, 0, 0, 0, 299, 0, + 0, 0, 0, 0, 0, 299, 299, 299, 299, 299, + 299, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 299, 0, 0, 299, 299, 299, 299, 299, 299, + 300, 300, 300, 300, 300, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 300, 0, 0, 300, + 0, 0, 0, 0, 0, 0, 300, 300, 300, 300, + 300, 300, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 300, 300, 300, 300, 300, + 300, 301, 301, 301, 301, 301, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 301, 0, 0, 0, 0, 0, 0, 301, 301, 301, + 301, 301, 301, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 301, 301, 301, 301, + 301, 301, 302, 302, 302, 302, 302, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 302, 0, 0, 0, 0, 0, 0, 302, 302, + 302, 302, 302, 302, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 302, 302, 302, + 302, 302, 302, 304, 304, 304, 304, 304, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 304, 0, 0, 0, 0, 0, 0, 304, + + 304, 304, 304, 304, 304, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 304, 304, + 304, 304, 304, 304, 309, 0, 0, 0, 0, 0, + 0, 309, 309, 309, 309, 309, 309, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 309, 309, 309, 309, 309, 309, 310, 310, 310, 310, + 310, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 310, 0, 0, 0, 0, + + 0, 0, 310, 310, 310, 310, 310, 310, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 310, 310, 310, 310, 310, 310, 323, 323, 323, + 323, 323, 0, 323, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 323, 0, 0, 0, + 0, 0, 0, 323, 323, 323, 323, 323, 323, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 323, + 0, 0, 323, 323, 323, 323, 323, 323, 324, 324, + + 324, 324, 0, 0, 324, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 324, 0, 0, + 0, 0, 0, 0, 324, 324, 324, 324, 324, 324, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 324, 0, 0, 324, 324, 324, 324, 324, 324, 328, + 328, 328, 328, 328, 0, 0, 0, 0, 0, 0, + 328, 0, 0, 0, 0, 0, 0, 0, 328, 0, + 0, 0, 0, 0, 0, 328, 328, 328, 328, 328, + 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 328, 0, 0, 328, 328, 328, 328, 328, 328, + 329, 329, 329, 329, 0, 0, 0, 0, 0, 0, + 0, 329, 0, 0, 0, 0, 0, 0, 0, 329, + 0, 0, 0, 0, 0, 0, 329, 329, 329, 329, + 329, 329, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 329, 0, 0, 329, 329, 329, 329, 329, + 329, 330, 330, 330, 330, 330, 0, 0, 0, 0, + 0, 0, 0, 0, 330, 0, 0, 0, 0, 0, + + 330, 0, 0, 0, 0, 0, 0, 330, 330, 330, + 330, 330, 330, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 330, 0, 0, 330, 330, 330, 330, + 330, 330, 334, 0, 0, 0, 0, 0, 0, 334, + 334, 334, 334, 334, 334, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 334, 334, + 334, 334, 334, 334, 335, 0, 0, 0, 0, 0, + 0, 335, 335, 335, 335, 335, 335, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 335, 335, 335, 335, 335, 335, 338, 0, 0, 0, + 0, 0, 0, 338, 338, 338, 338, 338, 338, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 338, 338, 338, 338, 338, 338, 339, 339, + 339, 339, 339, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 339, 0, 0, + 0, 0, 0, 0, 339, 339, 339, 339, 339, 339, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 339, 339, 339, 339, 339, 339, 341, + 341, 341, 341, 341, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 341, 0, + 0, 0, 0, 0, 0, 341, 341, 341, 341, 341, + 341, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 341, 341, 341, 341, 341, 341, + 358, 0, 0, 0, 0, 0, 0, 358, 358, 358, + + 358, 358, 358, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 358, 358, 358, 358, + 358, 358, 362, 0, 0, 0, 0, 0, 0, 362, + 362, 362, 362, 362, 362, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 362, 362, + 362, 362, 362, 362, 363, 363, 363, 363, 363, 0, + 0, 0, 0, 0, 0, 0, 0, 363, 0, 0, + 0, 0, 0, 363, 0, 0, 0, 0, 0, 0, + + 363, 363, 363, 363, 363, 363, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 363, 0, 0, 363, + 363, 363, 363, 363, 363, 368, 0, 0, 0, 0, + 0, 0, 368, 0, 368, 0, 0, 0, 0, 368, + 368, 0, 0, 368, 0, 0, 0, 0, 368, 0, + 0, 0, 0, 0, 368, 0, 0, 0, 0, 0, + 368, 0, 368, 0, 0, 0, 0, 368, 368, 0, + 0, 368, 373, 0, 0, 0, 0, 0, 0, 373, + 373, 373, 373, 373, 373, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 373, 373, + 373, 373, 373, 373, 374, 0, 0, 0, 0, 0, + 0, 374, 374, 374, 374, 374, 374, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 374, 374, 374, 374, 374, 374, 375, 0, 0, 0, + 0, 0, 0, 375, 375, 375, 375, 375, 375, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 375, 375, 375, 375, 375, 375, 387, 0, + 0, 0, 0, 0, 0, 387, 387, 387, 387, 387, + 387, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 387, 387, 387, 387, 387, 387, + 388, 0, 0, 0, 0, 0, 0, 388, 388, 388, + 388, 388, 388, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 388, 388, 388, 388, + 388, 388, 389, 0, 0, 0, 0, 0, 0, 389, + + 389, 389, 389, 389, 389, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 389, 389, + 389, 389, 389, 389, 397, 0, 0, 0, 0, 0, + 0, 397, 397, 397, 397, 397, 397, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 397, 397, 397, 397, 397, 397, 398, 0, 0, 0, + 0, 0, 0, 398, 398, 398, 398, 398, 398, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 398, 398, 398, 398, 398, 398, 414, 0, + 0, 0, 0, 0, 0, 414, 414, 414, 414, 414, + 414, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 414, 414, 414, 414, 414, 414, + 426, 0, 0, 0, 0, 0, 0, 426, 426, 426, + 426, 426, 426, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 426, 426, 426, 426, + + 426, 426, 428, 428, 428, 428, 428, 0, 0, 0, + 0, 0, 0, 0, 0, 428, 0, 0, 0, 0, + 0, 428, 0, 0, 0, 0, 0, 0, 428, 428, + 428, 428, 428, 428, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 428, 0, 0, 428, 428, 428, + 428, 428, 428, 437, 437, 437, 437, 437, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 437, 0, 0, 0, 0, 0, 0, 437, + 437, 437, 437, 437, 437, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 437, 437, + 437, 437, 437, 437, 439, 0, 0, 0, 0, 0, + 0, 439, 439, 439, 439, 439, 439, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 439, 439, 439, 439, 439, 439, 446, 0, 0, 0, + 0, 0, 0, 446, 446, 446, 446, 446, 446, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 446, 446, 446, 446, 446, 446, 447, 0, + 0, 0, 0, 0, 0, 447, 447, 447, 447, 447, + 447, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 447, 447, 447, 447, 447, 447, + 452, 0, 0, 0, 0, 0, 0, 452, 452, 452, + 452, 452, 452, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 452, 452, 452, 452, + 452, 452, 453, 0, 0, 0, 0, 0, 0, 453, + + 453, 453, 453, 453, 453, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 453, 453, + 453, 453, 453, 453, 458, 0, 0, 0, 0, 0, + 0, 458, 458, 458, 458, 458, 458, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 458, 458, 458, 458, 458, 458, 459, 0, 0, 0, + 0, 0, 0, 459, 459, 459, 459, 459, 459, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 459, 459, 459, 459, 459, 459, 464, 0, + 0, 0, 0, 0, 0, 464, 464, 464, 464, 464, + 464, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 464, 464, 464, 464, 464, 464, + 479, 0, 0, 479, 479, 479, 479, 479, 479, 479, + 479, 479, 479, 480, 480, 0, 480, 480, 481, 0, + 0, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 482, 482, 0, 482, 482, 483, 0, 0, 483, + + 483, 484, 0, 484, 484, 0, 484, 484, 485, 485, + 485, 485, 485, 485, 485, 485, 485, 485, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, - 487, 487, 487, 487, 487, 487, 487, 487, 487, 488, - 488, 0, 488, 488, 489, 489, 489, 489, 489, 489, - 489, 489, 489, 489, 489, 490, 490, 490, 490, 490, - 490, 490, 490, 490, 490, 490, 490, 491, 491, 492, - 492, 492, 492, 492, 492, 492, 492, 492, 493, 493, - 0, 493, 493, 494, 494, 494, 494, 494, 494, 494, - - 494, 494, 495, 495, 0, 495, 495, 496, 496, 496, - 496, 496, 496, 496, 496, 496, 497, 497, 497, 497, - 497, 497, 497, 497, 497, 498, 498, 498, 498, 498, - 498, 498, 498, 498, 498, 498, 498, 499, 499, 499, - 499, 499, 499, 499, 499, 499, 500, 500, 500, 500, - 500, 500, 500, 500, 500, 501, 501, 501, 0, 501, + 486, 488, 488, 0, 488, 488, 489, 489, 489, 489, + 489, 489, 489, 489, 489, 489, 490, 490, 490, 490, + 490, 490, 490, 490, 490, 490, 490, 490, 490, 491, + 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, + 491, 491, 491, 493, 493, 0, 493, 493, 494, 494, + 494, 494, 494, 494, 494, 494, 494, 494, 495, 495, + 0, 495, 495, 496, 496, 496, 496, 496, 496, 496, + + 496, 496, 496, 497, 497, 497, 497, 497, 497, 497, + 497, 497, 497, 498, 498, 498, 500, 500, 500, 500, + 500, 500, 500, 500, 500, 500, 501, 501, 0, 501, + 501, 501, 501, 501, 501, 501, 501, 501, 501, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, - 502, 502, 503, 503, 503, 0, 503, 504, 504, 504, - 504, 0, 504, 504, 504, 504, 504, 504, 505, 505, - 505, 0, 505, 506, 0, 506, 506, 506, 506, 506, - - 506, 506, 506, 506, 507, 0, 507, 507, 507, 507, - 507, 507, 507, 507, 507, 508, 508, 508, 508, 508, - 508, 508, 508, 508, 508, 508, 509, 509, 509, 0, - 509, 510, 510, 510, 510, 510, 510, 510, 510, 510, - 510, 510, 511, 511, 511, 511, 511, 511, 511, 511, - 511, 511, 511, 512, 512, 512, 0, 512, 513, 513, - 513, 0, 0, 0, 513, 0, 0, 513, 513, 514, - 514, 514, 514, 514, 514, 514, 514, 514, 515, 515, - 515, 0, 0, 515, 515, 515, 0, 515, 515, 516, - 516, 516, 516, 516, 516, 516, 516, 516, 478, 478, + 502, 502, 503, 503, 503, 503, 503, 503, 503, 503, + 503, 503, 503, 503, 503, 503, 504, 504, 504, 504, + 504, 504, 504, 504, 504, 504, 504, 504, 504, 504, + 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, + 506, 506, 506, 506, 506, 506, 506, 506, 506, 506, + + 507, 507, 507, 507, 508, 0, 0, 508, 508, 508, + 508, 508, 508, 508, 508, 508, 508, 510, 510, 510, + 510, 510, 510, 510, 510, 510, 510, 510, 510, 510, + 510, 512, 512, 512, 512, 513, 513, 513, 513, 513, + 513, 0, 513, 513, 513, 513, 513, 513, 514, 514, + 514, 514, 514, 514, 514, 514, 514, 514, 514, 514, + 514, 516, 516, 516, 516, 516, 516, 516, 516, 516, + 516, 516, 516, 516, 516, 518, 518, 518, 518, 519, + 519, 519, 519, 519, 519, 0, 519, 519, 519, 519, + 519, 519, 520, 0, 0, 520, 520, 520, 520, 520, + + 520, 520, 520, 520, 520, 521, 0, 0, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, 522, 522, + 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, + 522, 523, 523, 523, 523, 523, 523, 523, 523, 523, + 523, 523, 523, 523, 525, 525, 0, 525, 525, 526, + 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, + 526, 526, 528, 528, 528, 528, 529, 529, 529, 529, + 529, 529, 529, 529, 529, 529, 529, 529, 529, 530, + 0, 0, 530, 530, 530, 530, 530, 530, 530, 530, + 530, 530, 531, 531, 531, 531, 531, 531, 531, 531, + + 531, 531, 531, 531, 531, 532, 532, 532, 532, 532, + 0, 0, 532, 532, 532, 532, 532, 532, 533, 533, + 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, + 533, 534, 534, 534, 534, 534, 534, 534, 534, 534, + 534, 534, 534, 534, 535, 535, 0, 535, 535, 536, + 536, 536, 536, 536, 536, 536, 536, 536, 536, 536, + 536, 536, 538, 538, 538, 538, 539, 539, 0, 539, + 539, 539, 539, 539, 539, 539, 539, 539, 539, 540, + 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, + 540, 540, 541, 541, 0, 541, 541, 541, 541, 541, + + 541, 541, 541, 541, 541, 542, 542, 542, 542, 542, + 542, 542, 542, 542, 542, 542, 542, 542, 543, 543, + 543, 543, 543, 0, 0, 543, 543, 543, 543, 543, + 543, 546, 546, 546, 546, 0, 0, 0, 0, 546, + 0, 0, 546, 546, 547, 547, 547, 547, 0, 0, + 0, 547, 547, 547, 0, 547, 547, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, - 478, 478, 478, 478, 478, 478, 478, 478, 478 + 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, + 478, 478, 478 } ; #line 1 "" @@ -878,7 +1813,7 @@ YY_DECL yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 2399 ); + while ( yy_base[yy_current_state] != 6578 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1250,7 +2185,7 @@ YY_RULE_SETUP #line 110 "" ECHO; YY_BREAK -#line 1761 "" +#line 2738 "" case YY_STATE_EOF(INITIAL): case YY_END_OF_BUFFER: case YY_STATE_EOF(mediaquery): -- cgit v0.12 From eb4c00a469f473a33103652ed977eabb4fb9ce9b Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 19 May 2009 19:13:39 +0200 Subject: Testing 'dictionary' if it contains a value before using operator[]. T & QMap::operator[]: "If the map contains no item with key key, the function inserts a default-constructed value into the map with key key, and returns a reference to it" How many occurences of 'dictionary["foo"].startsWith("bar")' has that file by the way? --- tools/configure/configureapp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 2c20d51..a879e5d 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1886,14 +1886,14 @@ bool Configure::checkAvailability(const QString &part) else if (part == "SQL_DB2") available = findFile("sqlcli.h") && findFile("sqlcli1.h") && findFile("db2cli.lib"); else if (part == "SQL_SQLITE") - if (dictionary["XQMAKESPEC"].startsWith("symbian")) + if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) available = false; // In Symbian we only support system sqlite option else available = true; // Built in, we have a fork else if (part == "SQL_SQLITE_LIB") { if (dictionary[ "SQL_SQLITE_LIB" ] == "system") { // Symbian has multiple .lib/.dll files we need to find - if (dictionary["XQMAKESPEC"].startsWith("symbian")) { + if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) { available = true; // There is sqlite_symbian plugin which exports the necessary stuff dictionary[ "QT_LFLAGS_SQLITE" ] += "-lsqlite3"; } else { -- cgit v0.12 From 38c0b9100b5636e7f92185159cac5a5addbe4264 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 19 May 2009 19:14:55 +0200 Subject: Fresh build with commit eb4c00a469f473a33103652ed977eabb4fb9ce9b (MSVC 2008, No MS runtimes, UPXed) --- configure.exe | Bin 856064 -> 535040 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/configure.exe b/configure.exe index 5710503..30383d8 100755 Binary files a/configure.exe and b/configure.exe differ -- cgit v0.12 From c06dd76ca4b30fa71297e640a8eaf702d606e937 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Tue, 19 May 2009 19:17:08 +0200 Subject: Updated WebKit from /home/ariya/dev/webkit/qtwebkit-4.5 to origin/qtwebkit-4.5 ( 40b523e9eaaba38c182e5a9c319f0069ebf98330 ) Changes in WebKit since the last update: ++ b/WebCore/ChangeLog 2009-05-11 Yael Aharon Reviewed by Holger Freyther. Change Qt port to match the mac and windows ports, and unregister plugins when plugins are stopped. Not doing that can cause assersion failure. https://bugs.webkit.org/show_bug.cgi?id=25702 * plugins/qt/PluginViewQt.cpp: (WebCore::PluginView::stop): --- dist/changes-4.5.2 | 2 +- src/3rdparty/webkit/VERSION | 2 +- src/3rdparty/webkit/WebCore/ChangeLog | 11 +++++++++++ src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp | 3 +++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index d467b95..b3e808f 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -43,7 +43,7 @@ Third party components JavaScript (r39882, r40086, r40131, r40133) Rendering (r41285, r41296, r41659, r42887) Network (r41664, r42516) - Plugins (r41346) + Plugins (r41346, r43550) Clipboard (r41360) **************************************************************************** diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index 9f85d76..7adbd6f 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 - 7b8d6ab6f2b73862d11c2a41ab0223e55585d88f + 40b523e9eaaba38c182e5a9c319f0069ebf98330 diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog index 23f3ca6..a4cb62d 100644 --- a/src/3rdparty/webkit/WebCore/ChangeLog +++ b/src/3rdparty/webkit/WebCore/ChangeLog @@ -1,3 +1,14 @@ +2009-05-11 Yael Aharon + + Reviewed by Holger Freyther. + + Change Qt port to match the mac and windows ports, and unregister plugins when plugins are stopped. + Not doing that can cause assersion failure. + https://bugs.webkit.org/show_bug.cgi?id=25702 + + * plugins/qt/PluginViewQt.cpp: + (WebCore::PluginView::stop): + 2009-05-18 Ariya Hidayat Reviewed by Simon Hausmann. diff --git a/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp b/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp index c8dd0e5..43c772f 100644 --- a/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp @@ -58,6 +58,7 @@ #include "MouseEvent.h" #include "Page.h" #include "PlatformMouseEvent.h" +#include "PluginMainThreadScheduler.h" #include "RenderLayer.h" #include "Settings.h" @@ -225,6 +226,8 @@ void PluginView::stop() JSC::JSLock::DropAllLocks dropAllLocks(false); + PluginMainThreadScheduler::scheduler().unregisterPlugin(m_instance); + // Clear the window m_npWindow.window = 0; if (m_plugin->pluginFuncs()->setwindow && !m_plugin->quirks().contains(PluginQuirkDontSetNullWindowHandleOnDestroy)) { -- cgit v0.12 From 26e6d20ef0abee7b2d721637d6eaea67e932b907 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 19 May 2009 19:58:57 +0200 Subject: Stub for backgroundTexture() --- src/gui/styles/qs60style_simulated.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index 17c1ebe..5a88f9a 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -191,6 +191,25 @@ QVariant QS60StylePrivate::styleProperty_specific(const char *name) const return styleProperty(name); } +QPixmap QS60StylePrivate::backgroundTexture() +{ + static QPixmap result; + // Poor mans caching. + Making sure that there is always only one background image in memory at a time + +/* + TODO: 1) Hold the background QPixmap as pointer in a static class member. + Also add a deleteBackground() function and call that in ~QS60StylePrivate() + 2) Don't cache the background at all as soon as we have native pixmap support +*/ + + if (!m_backgroundValid) { + result = QPixmap(); + result = part(QS60StyleEnums::SP_QsnBgScreen, QApplication::activeWindow()->size()); + m_backgroundValid = true; + } + return result; +} + bool QS60StylePrivate::isTouchSupported() { #ifdef QT_KEYPAD_NAVIGATION -- cgit v0.12 From 1588c0fe43f2173e026d7b52bdea0cf85b18ea1d Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 19 May 2009 20:14:07 +0200 Subject: Softkeys also for non-S60. Currently only as stub. Will eventually go into a separate implementation file. --- src/gui/widgets/qsoftkeystack.cpp | 11 +++++++++++ src/gui/widgets/widgets.pri | 18 +++++++----------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index cd17171..32a2df9 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -164,3 +164,14 @@ void QSoftKeyStack::handleSoftKeyPress(int command) Q_D(QSoftKeyStack); d->handleSoftKeyPress(command); } + +#if !defined(Q_WS_S60) +void QSoftKeyStackPrivate::handleSoftKeyPress(int command) +{ + Q_UNUSED(command) +} + +void QSoftKeyStackPrivate::setNativeSoftKeys() +{ +} +#endif // !defined(Q_WS_S60) \ No newline at end of file diff --git a/src/gui/widgets/widgets.pri b/src/gui/widgets/widgets.pri index c9e68a1..0c0641a 100644 --- a/src/gui/widgets/widgets.pri +++ b/src/gui/widgets/widgets.pri @@ -78,8 +78,10 @@ HEADERS += \ widgets/qtoolbararealayout_p.h \ widgets/qplaintextedit.h \ widgets/qplaintextedit_p.h \ - widgets/qprintpreviewwidget.h - + widgets/qprintpreviewwidget.h \ + widgets/qsoftkeyaction.h \ + widgets/qsoftkeystack.h \ + widgets/qsoftkeystack_p.h SOURCES += \ widgets/qabstractbutton.cpp \ widgets/qabstractslider.cpp \ @@ -138,8 +140,9 @@ SOURCES += \ widgets/qwidgetanimator.cpp \ widgets/qtoolbararealayout.cpp \ widgets/qplaintextedit.cpp \ - widgets/qprintpreviewwidget.cpp - + widgets/qprintpreviewwidget.cpp \ + widgets/qsoftkeyaction.cpp \ + widgets/qsoftkeystack.cpp !embedded:mac { HEADERS += widgets/qmacnativewidget_mac.h \ @@ -162,14 +165,7 @@ wince*: { } symbian*: { - HEADERS += \ - widgets/qsoftkeyaction.h \ - widgets/qsoftkeystack.h \ - widgets/qsoftkeystack_p.h - SOURCES += \ widgets/qmenu_symbian.cpp \ - widgets/qsoftkeyaction.cpp \ - widgets/qsoftkeystack.cpp \ widgets/qsoftkeystack_s60.cpp } -- cgit v0.12 From ade1bdc75245bb233022b1cc0358b89df2180466 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 19 May 2009 20:14:58 +0200 Subject: Not using deprecated QString constructor --- src/gui/widgets/qsoftkeystack.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index 32a2df9..ae58e8d 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -129,8 +129,8 @@ void QSoftKeyStack::handleFocusChanged(QWidget *old, QWidget *now) Qt::ContextMenuPolicy policy = now->contextMenuPolicy(); if (policy != Qt::NoContextMenu && policy != Qt::PreventContextMenu ) { QList actionList; - QSoftKeyAction* menu = new QSoftKeyAction(QSoftKeyAction::Menu, QString("Menu"), now); - QSoftKeyAction* contextMenu = new QSoftKeyAction(QSoftKeyAction::ContextMenu, QString("ContextMenu"), now); + QSoftKeyAction* menu = new QSoftKeyAction(QSoftKeyAction::Menu, QString::fromLatin1("Menu"), now); + QSoftKeyAction* contextMenu = new QSoftKeyAction(QSoftKeyAction::ContextMenu, QString::fromLatin1("ContextMenu"), now); actionList.append(menu); actionList.append(contextMenu); softKeyStack->push(actionList); -- cgit v0.12 From 19845ac3f4f7e3288cfdf7add68754758cd3145b Mon Sep 17 00:00:00 2001 From: Bill King Date: Wed, 20 May 2009 10:54:06 +1000 Subject: Adds thread initialisation/cleanup code to mysql. Allows for cleaner multi-thread working for mysql clients. Task-number: 253407 --- src/sql/drivers/mysql/qsql_mysql.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp index fbefa0c..51fc306 100644 --- a/src/sql/drivers/mysql/qsql_mysql.cpp +++ b/src/sql/drivers/mysql/qsql_mysql.cpp @@ -1279,6 +1279,11 @@ bool QMYSQLDriver::open(const QString& db, d->preparedQuerysEnabled = false; #endif +#ifndef QT_NO_THREAD + mysql_thread_init(); +#endif + + setOpen(true); setOpenError(false); return true; @@ -1287,6 +1292,9 @@ bool QMYSQLDriver::open(const QString& db, void QMYSQLDriver::close() { if (isOpen()) { +#ifndef QT_NO_THREAD + mysql_thread_end(); +#endif mysql_close(d->mysql); d->mysql = NULL; setOpen(false); -- cgit v0.12 From 82a5d55502f465f17e1a6f16d9c64a19aa9dfe5e Mon Sep 17 00:00:00 2001 From: Stian Sandvik Thomassen Date: Wed, 20 May 2009 11:18:01 +1000 Subject: Added auto-test for QComboBox::setItemDelegate and task 253944 --- tests/auto/qcombobox/tst_qcombobox.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp index 6a87e3c..2fff6d0 100644 --- a/tests/auto/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/qcombobox/tst_qcombobox.cpp @@ -76,6 +76,7 @@ #endif #include #include "../../shared/util.h" +#include //TESTED_CLASS= //TESTED_FILES= @@ -141,6 +142,8 @@ private slots: void setModelColumn(); void noScrollbar_data(); void noScrollbar(); + void setItemDelegate(); + void task253944_itemDelegateIsReset(); protected slots: void onEditTextChanged( const QString &newString ); @@ -2206,5 +2209,26 @@ void tst_QComboBox::noScrollbar() } } +void tst_QComboBox::setItemDelegate() +{ + QComboBox comboBox; + QStyledItemDelegate *itemDelegate = new QStyledItemDelegate; + comboBox.setItemDelegate(itemDelegate); + QCOMPARE(comboBox.itemDelegate(), itemDelegate); +} + +void tst_QComboBox::task253944_itemDelegateIsReset() +{ + QComboBox comboBox; + QStyledItemDelegate *itemDelegate = new QStyledItemDelegate; + comboBox.setItemDelegate(itemDelegate); + + comboBox.setEditable(true); + QCOMPARE(comboBox.itemDelegate(), itemDelegate); + + comboBox.setStyleSheet("QComboBox { border: 1px solid gray; }"); + QCOMPARE(comboBox.itemDelegate(), itemDelegate); +} + QTEST_MAIN(tst_QComboBox) #include "tst_qcombobox.moc" -- cgit v0.12 From ccca1883cf621eb78768962e9e6476ae0ce57a70 Mon Sep 17 00:00:00 2001 From: Bill King Date: Wed, 20 May 2009 14:48:12 +1000 Subject: Fixes a memory leak in the interbase sql driver. As suggested in gitorius merge request 421, solution supplied by Harald. Reviewed-by: Harald Fernengel --- src/sql/drivers/ibase/qsql_ibase.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/sql/drivers/ibase/qsql_ibase.cpp b/src/sql/drivers/ibase/qsql_ibase.cpp index 4f3d79d..1645555 100644 --- a/src/sql/drivers/ibase/qsql_ibase.cpp +++ b/src/sql/drivers/ibase/qsql_ibase.cpp @@ -55,6 +55,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE @@ -583,7 +584,7 @@ QVariant QIBaseResultPrivate::fetchArray(int pos, ISC_QUAD *arr) int arraySize = 1, subArraySize; short dimensions = desc.array_desc_dimensions; - short *numElements = new short[dimensions]; + QVarLengthArray numElements(dimensions); for(int i = 0; i < dimensions; ++i) { subArraySize = (desc.array_desc_bounds[i].array_bound_upper - @@ -612,9 +613,7 @@ QVariant QIBaseResultPrivate::fetchArray(int pos, ISC_QUAD *arr) QSqlError::StatementError)) return list; - readArrayBuffer(list, ba.data(), 0, numElements, &desc, tc); - - delete[] numElements; + readArrayBuffer(list, ba.data(), 0, numElements.data(), &desc, tc); return QVariant(list); } -- cgit v0.12 From 96fbcbfe543e609cc6c244f605c8b7c9b51be535 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Tue, 19 May 2009 17:29:01 +0200 Subject: Optimize QIoDevice::readAll() to possibly do less (re)allocations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Olivier Goffart Reviewed-by: Peter Hartmann Reviewed-by: João Abecasis --- src/corelib/io/qiodevice.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp index c739054..efa4b25 100644 --- a/src/corelib/io/qiodevice.cpp +++ b/src/corelib/io/qiodevice.cpp @@ -945,9 +945,9 @@ QByteArray QIODevice::readAll() QByteArray tmp; if (d->isSequential() || size() == 0) { - // Read it in chunks, bytesAvailable() is unreliable for sequential - // devices. - const int chunkSize = 4096; + // Read it in chunks. Use bytesAvailable() as an unreliable hint for + // sequential devices, but try to read 4K as a minimum. + int chunkSize = qMax(qint64(4096), bytesAvailable()); qint64 totalRead = 0; forever { tmp.resize(tmp.size() + chunkSize); @@ -956,6 +956,7 @@ QByteArray QIODevice::readAll() if (readBytes <= 0) return tmp; totalRead += readBytes; + chunkSize = qMax(qint64(4096), bytesAvailable()); } } else { // Read it all in one go. -- cgit v0.12 From 6526b67bb64cc9d4db081101a5eb4a5c6f7c2456 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 20 May 2009 09:37:55 +0200 Subject: Fix a typo in the class documentation for QItemDelegate --- src/gui/itemviews/qitemdelegate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/itemviews/qitemdelegate.cpp b/src/gui/itemviews/qitemdelegate.cpp index bf9b5c5..3b7eb2d 100644 --- a/src/gui/itemviews/qitemdelegate.cpp +++ b/src/gui/itemviews/qitemdelegate.cpp @@ -218,7 +218,7 @@ QSizeF QItemDelegatePrivate::doTextLayout(int lineWidth) const editor widget, which is a widget that is placed on top of the view while editing takes place. Editors are created with a QItemEditorFactory; a default static instance provided by - QItemEditorFactory is installed on all item delagates. You can set + QItemEditorFactory is installed on all item delegates. You can set a custom factory using setItemEditorFactory() or set a new default factory with QItemEditorFactory::setDefaultFactory(). It is the data stored in the item model with the Qt::EditRole that is edited. -- cgit v0.12 From 23a0475c4676797de987c7a1e11e9593f57631a8 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 20 May 2009 09:42:26 +0200 Subject: Fix parsing method calls with null arguments in Java code In Java, "null" is represented as a keyword, not as the integer 0. The old code assumed the latter. Code such as translate("fooBar", "fooBar", null); would thus not be detected by lupdate when parsing Java files. Reviewed-by: ossi --- tools/linguist/shared/java.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tools/linguist/shared/java.cpp b/tools/linguist/shared/java.cpp index 912a8d7..4c244d2 100644 --- a/tools/linguist/shared/java.cpp +++ b/tools/linguist/shared/java.cpp @@ -58,7 +58,7 @@ enum { Tok_Eof, Tok_class, Tok_return, Tok_tr, Tok_Comment, Tok_String, Tok_Colon, Tok_Dot, Tok_LeftBrace, Tok_RightBrace, Tok_LeftParen, Tok_RightParen, Tok_Comma, Tok_Semicolon, - Tok_Integer, Tok_Plus, Tok_PlusPlus, Tok_PlusEq }; + Tok_Integer, Tok_Plus, Tok_PlusPlus, Tok_PlusEq, Tok_null }; class Scope { @@ -142,7 +142,11 @@ static int getToken() case 'c': if ( yyIdent == QLatin1String("class") ) return Tok_class; - break; + break; + case 'n': + if ( yyIdent == QLatin1String("null") ) + return Tok_null; + break; } } switch ( yyIdent.at(0).toLatin1() ) { @@ -382,9 +386,11 @@ static bool matchInteger( qlonglong *number) static bool matchStringOrNull(QString &s) { bool matches = matchString(s); - qlonglong num = 0; - if (!matches) matches = matchInteger(&num); - return matches && num == 0; + if (!matches) { + matches = (yyTok == Tok_null); + if (matches) yyTok = getToken(); + } + return matches; } /* -- cgit v0.12 From 023d03ca888cf0e335bcbd413ea57db92e2e2ab5 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 20 May 2009 17:48:10 +1000 Subject: Fix incorrect copyright year in some license headers. Reviewed-by: Trust Me --- doc/src/examples/trafficinfo.qdoc | 2 +- examples/xmlpatterns/trafficinfo/main.cpp | 2 +- examples/xmlpatterns/trafficinfo/mainwindow.cpp | 2 +- examples/xmlpatterns/trafficinfo/mainwindow.h | 2 +- examples/xmlpatterns/trafficinfo/stationdialog.cpp | 2 +- examples/xmlpatterns/trafficinfo/stationdialog.h | 2 +- examples/xmlpatterns/trafficinfo/stationquery.cpp | 2 +- examples/xmlpatterns/trafficinfo/stationquery.h | 2 +- examples/xmlpatterns/trafficinfo/timequery.cpp | 2 +- examples/xmlpatterns/trafficinfo/timequery.h | 2 +- tests/auto/utf8/tst_utf8.cpp | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/src/examples/trafficinfo.qdoc b/doc/src/examples/trafficinfo.qdoc index c9b6890..13181cd 100644 --- a/doc/src/examples/trafficinfo.qdoc +++ b/doc/src/examples/trafficinfo.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** ** This file is part of the documentation of the Qt Toolkit. diff --git a/examples/xmlpatterns/trafficinfo/main.cpp b/examples/xmlpatterns/trafficinfo/main.cpp index 97b2bf7..544260d 100644 --- a/examples/xmlpatterns/trafficinfo/main.cpp +++ b/examples/xmlpatterns/trafficinfo/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/examples/xmlpatterns/trafficinfo/mainwindow.cpp b/examples/xmlpatterns/trafficinfo/mainwindow.cpp index 1f754d5..47c51c9 100644 --- a/examples/xmlpatterns/trafficinfo/mainwindow.cpp +++ b/examples/xmlpatterns/trafficinfo/mainwindow.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/examples/xmlpatterns/trafficinfo/mainwindow.h b/examples/xmlpatterns/trafficinfo/mainwindow.h index d48109d..5362bcd 100644 --- a/examples/xmlpatterns/trafficinfo/mainwindow.h +++ b/examples/xmlpatterns/trafficinfo/mainwindow.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/examples/xmlpatterns/trafficinfo/stationdialog.cpp b/examples/xmlpatterns/trafficinfo/stationdialog.cpp index 9876bdb..54ed904 100644 --- a/examples/xmlpatterns/trafficinfo/stationdialog.cpp +++ b/examples/xmlpatterns/trafficinfo/stationdialog.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/examples/xmlpatterns/trafficinfo/stationdialog.h b/examples/xmlpatterns/trafficinfo/stationdialog.h index 5ac1635..0e87f61 100644 --- a/examples/xmlpatterns/trafficinfo/stationdialog.h +++ b/examples/xmlpatterns/trafficinfo/stationdialog.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/examples/xmlpatterns/trafficinfo/stationquery.cpp b/examples/xmlpatterns/trafficinfo/stationquery.cpp index ab42ad9..3db0fdb 100644 --- a/examples/xmlpatterns/trafficinfo/stationquery.cpp +++ b/examples/xmlpatterns/trafficinfo/stationquery.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/examples/xmlpatterns/trafficinfo/stationquery.h b/examples/xmlpatterns/trafficinfo/stationquery.h index 5cbf28a..d1e4d2f 100644 --- a/examples/xmlpatterns/trafficinfo/stationquery.h +++ b/examples/xmlpatterns/trafficinfo/stationquery.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/examples/xmlpatterns/trafficinfo/timequery.cpp b/examples/xmlpatterns/trafficinfo/timequery.cpp index bd63560..d6bf695 100644 --- a/examples/xmlpatterns/trafficinfo/timequery.cpp +++ b/examples/xmlpatterns/trafficinfo/timequery.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/examples/xmlpatterns/trafficinfo/timequery.h b/examples/xmlpatterns/trafficinfo/timequery.h index f88e62c..2435c71 100644 --- a/examples/xmlpatterns/trafficinfo/timequery.h +++ b/examples/xmlpatterns/trafficinfo/timequery.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. diff --git a/tests/auto/utf8/tst_utf8.cpp b/tests/auto/utf8/tst_utf8.cpp index 3aef69f..e21e5a3 100644 --- a/tests/auto/utf8/tst_utf8.cpp +++ b/tests/auto/utf8/tst_utf8.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** ** This file is part of the test suite of the Qt Toolkit. -- cgit v0.12 From 4a8c7e432931b27e7a5440a6d15bde999e962f35 Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Wed, 20 May 2009 11:25:32 +0200 Subject: Fix a crash where QCocoaWindow get events after its widget is dead MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The invariant that QCocoaWindow's lifetime is contained in a QWidget is simply not true. A top-level QWidget gets associated with a QCocoaWindow (which is reference counted). However, it can be the case that we've destroyed our QWidget, the link is removed, the window is hidden, but the window still gets an event. In that case we would crash with an eventual null pointer access. However, we don't really need to do anything in this case, so just call super and return. Task-number: 253402 Reviewed-by: Morten Sørvig --- src/gui/kernel/qcocoapanel_mac.mm | 11 +++++++++-- src/gui/kernel/qcocoawindow_mac.mm | 13 ++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/gui/kernel/qcocoapanel_mac.mm b/src/gui/kernel/qcocoapanel_mac.mm index c69826f..b2941fe 100644 --- a/src/gui/kernel/qcocoapanel_mac.mm +++ b/src/gui/kernel/qcocoapanel_mac.mm @@ -107,9 +107,16 @@ QT_USE_NAMESPACE - (void)sendEvent:(NSEvent *)event { - [self retain]; - QWidget *widget = [[QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) sharedDelegate] qt_qwidgetForWindow:self]; + + // Cocoa can hold onto the window after we've disavowed its knowledge. So, + // if we get sent an event afterwards just have it go through the super's + // version and don't do any stuff with Qt. + if (!widget) { + [super sendEvent:event]; + return; + } + [self retain]; QT_MANGLE_NAMESPACE(QCocoaView) *view = static_cast(qt_mac_nativeview_for(widget)); Qt::MouseButton mouseButton = cocoaButton2QtButton([event buttonNumber]); diff --git a/src/gui/kernel/qcocoawindow_mac.mm b/src/gui/kernel/qcocoawindow_mac.mm index 89f481f..8e62f02 100644 --- a/src/gui/kernel/qcocoawindow_mac.mm +++ b/src/gui/kernel/qcocoawindow_mac.mm @@ -128,12 +128,19 @@ QT_USE_NAMESPACE - (void)sendEvent:(NSEvent *)event { - [self retain]; - QWidget *widget = [[QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) sharedDelegate] qt_qwidgetForWindow:self]; + + // Cocoa can hold onto the window after we've disavowed its knowledge. So, + // if we get sent an event afterwards just have it go through the super's + // version and don't do any stuff with Qt. + if (!widget) { + [super sendEvent:event]; + return; + } + + [self retain]; QT_MANGLE_NAMESPACE(QCocoaView) *view = static_cast(qt_mac_nativeview_for(widget)); Qt::MouseButton mouseButton = cocoaButton2QtButton([event buttonNumber]); - // sometimes need to redirect mouse events to the popup. QWidget *popup = qAppInstance()->activePopupWidget(); if (popup && popup != widget) { -- cgit v0.12 From 387db114cf09e60b43b13c36c83ef8cf07ee6553 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 20 May 2009 11:59:54 +0200 Subject: qdoc: Moved qdoc comments from qmacstyle_mac.mm to qstyles.qdoc The .mm file is not read by qdoc for packages other than for the MAC. This problem is overcome by moving the qdoc comments from the .mm file to a .qdoc file in doc/src, because all these files are read by qdoc for each of the packages. #Task-number: 252566 --- .commit-template | 14 +-- doc/src/qstyles.qdoc | 261 ++++++++++++++++++++++++++++++++++++++++ src/gui/styles/qmacstyle_mac.mm | 158 +----------------------- 3 files changed, 273 insertions(+), 160 deletions(-) create mode 100644 doc/src/qstyles.qdoc diff --git a/.commit-template b/.commit-template index 589ca89..171b67b 100644 --- a/.commit-template +++ b/.commit-template @@ -1,10 +1,8 @@ -# ===[ Subject ]==========[ one line, please wrap at 72 characters ]===| +qdoc: Moved qdoc comments from qmacstyle_mac.mm to qstyles.qdoc -# ---[ Details ]---------[ remember extra blank line after subject ]---| +The .mm file is not read by qdoc for packages other than for the MAC. +This problem is overcome by moving the qdoc comments from the .mm file +to a .qdoc file in doc/src, because all these files are read by qdoc +for each of the packages. -# ---[ Fields ]-----------------[ uncomment and edit as applicable ]---| - -#Task-number: -#Reviewed-by: - -# ==================================[ please wrap at 72 characters ]===| +#Task-number: 252566 diff --git a/doc/src/qstyles.qdoc b/doc/src/qstyles.qdoc new file mode 100644 index 0000000..e17097a --- /dev/null +++ b/doc/src/qstyles.qdoc @@ -0,0 +1,261 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +/*! + \class QMacStyle + \brief The QMacStyle class provides a Mac OS X style using the Apple Appearance Manager. + + \ingroup appearance + + This class is implemented as a wrapper to the HITheme + APIs, allowing applications to be styled according to the current + theme in use on Mac OS X. This is done by having primitives + in QStyle implemented in terms of what Mac OS X would normally theme. + + \warning This style is only available on Mac OS X because it relies on the + HITheme APIs. + + There are additional issues that should be taken + into consideration to make an application compatible with the + \link http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/index.html + Apple Human Interface Guidelines \endlink. Some of these issues are outlined + below. + + \list + + \i Layout - The restrictions on window layout are such that some + aspects of layout that are style-dependent cannot be achieved + using QLayout. Changes are being considered (and feedback would be + appreciated) to make layouts QStyle-able. Some of the restrictions + involve horizontal and vertical widget alignment and widget size + (covered below). + + \i Widget size - Mac OS X allows widgets to have specific fixed sizes. Qt + does not fully implement this behavior so as to maintain cross-platform + compatibility. As a result some widgets sizes may be inappropriate (and + subsequently not rendered correctly by the HITheme APIs).The + QWidget::sizeHint() will return the appropriate size for many + managed widgets (widgets enumerated in \l QStyle::ContentsType). + + \i Effects - QMacStyle uses HITheme for performing most of the drawing, but + also uses emulation in a few cases where HITheme does not provide the + required functionality (for example, tab bars on Panther, the toolbar + separator, etc). We tried to make the emulation as close to the original as + possible. Please report any issues you see in effects or non-standard + widgets. + + \endlist + + There are other issues that need to be considered in the feel of + your application (including the general color scheme to match the + Aqua colors). The Guidelines mentioned above will remain current + with new advances and design suggestions for Mac OS X. + + Note that the functions provided by QMacStyle are + reimplementations of QStyle functions; see QStyle for their + documentation. + + \img qmacstyle.png + \sa QWindowsXPStyle, QWindowsStyle, QPlastiqueStyle, QCDEStyle, QMotifStyle +*/ + + +/*! + \enum QMacStyle::WidgetSizePolicy + + \value SizeSmall + \value SizeLarge + \value SizeMini + \value SizeDefault + \omitvalue SizeNone +*/ + +/*! \fn QMacStyle::QMacStyle() + Constructs a QMacStyle object. +*/ + +/*! \fn QMacStyle::~QMacStyle() + Destructs a QMacStyle object. +*/ + +/*! \fn void QMacStyle::polish(QPalette &pal) + \reimp +*/ + +/*! \fn void QMacStyle::polish(QApplication *) + \reimp +*/ + +/*! \fn void QMacStyle::unpolish(QApplication *) + \reimp +*/ + +/*! \fn void QMacStyle::polish(QWidget* w) + \reimp +*/ + +/*! \fn void QMacStyle::unpolish(QWidget* w) + \reimp +*/ + +/*! \fn int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QWidget *widget) const + \reimp +*/ + +/*! \fn QPalette QMacStyle::standardPalette() const + \reimp +*/ + +/*! \fn int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w, QStyleHintReturn *hret) const + \reimp +*/ + +/*! \fn QPixmap QMacStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const + \reimp +*/ + +/*! \fn QPixmap QMacStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget) const + \reimp +*/ + +/*! + \enum QMacStyle::FocusRectPolicy + + This type is used to signify a widget's focus rectangle policy. + + \value FocusEnabled show a focus rectangle when the widget has focus. + \value FocusDisabled never show a focus rectangle for the widget. + \value FocusDefault show a focus rectangle when the widget has + focus and the widget is a QSpinWidget, QDateTimeEdit, QLineEdit, + QListBox, QListView, editable QTextEdit, or one of their + subclasses. +*/ + +/*! \fn void QMacStyle::setFocusRectPolicy(QWidget *w, FocusRectPolicy policy) + \obsolete + Sets the focus rectangle policy of \a w. The \a policy can be one of + \l{QMacStyle::FocusRectPolicy}. + + This is now simply an interface to the Qt::WA_MacShowFocusRect attribute and the + FocusDefault value does nothing anymore. If you want to set a widget back + to its default value, you must save the old value of the attribute before + you change it. + + \sa focusRectPolicy() QWidget::setAttribute() +*/ + +/*! \fn QMacStyle::FocusRectPolicy QMacStyle::focusRectPolicy(const QWidget *w) + \obsolete + Returns the focus rectangle policy for the widget \a w. + + The focus rectangle policy can be one of \l{QMacStyle::FocusRectPolicy}. + + In 4.3 and up this function will simply test for the + Qt::WA_MacShowFocusRect attribute and will never return + QMacStyle::FocusDefault. + + \sa setFocusRectPolicy(), QWidget::testAttribute() +*/ + +/*! \fn void QMacStyle::setWidgetSizePolicy(const QWidget *widget, WidgetSizePolicy policy) + + \obsolete + + Call QWidget::setAttribute() with Qt::WA_MacMiniSize, Qt::WA_MacSmallSize, + or Qt::WA_MacNormalSize instead. +*/ + +/*! \fn QMacStyle::WidgetSizePolicy QMacStyle::widgetSizePolicy(const QWidget *widget) + \obsolete + + Call QWidget::testAttribute() with Qt::WA_MacMiniSize, Qt::WA_MacSmallSize, + or Qt::WA_MacNormalSize instead. +*/ + +/*! \fn void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w) const + + \reimp +*/ + +/*! \fn void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter *p, const QWidget *w) const + + \reimp +*/ + +/*! \fn QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt, const QWidget *widget) const + + \reimp +*/ + +/*! \fn void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *widget) const + \reimp +*/ + +/*! \fn QStyle::SubControl QMacStyle::hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *widget) const + \reimp +*/ + +/*! \fn QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget) const + \reimp +*/ + +/*! \fn QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &csz, const QWidget *widget) const + \reimp +*/ + +/*! \fn void QMacStyle::drawItemText(QPainter *p, const QRect &r, int flags, const QPalette &pal, bool enabled, const QString &text, QPalette::ColorRole textRole) const + \reimp +*/ + +/*! \fn bool QMacStyle::event(QEvent *e) + \reimp +*/ + +/*! \fn QIcon QMacStyle::standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *opt, const QWidget *widget) const + \internal +*/ + +/*! \fn int QMacStyle::layoutSpacingImplementation(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option, const QWidget *widget) const + + \internal +*/ + diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index 7a870fe..2e47526 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -39,6 +39,11 @@ ** ****************************************************************************/ +/*! + Note: The qdoc comments for QMacStyle are contained in + .../doc/src/qstyles.qdoc. +*/ + #include "qmacstyle_mac.h" #if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) @@ -1988,87 +1993,12 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD p->drawPixmap(int(macRect.origin.x), int(macRect.origin.y) + finalyoff, width, height, pm); } -/*! - \class QMacStyle - \brief The QMacStyle class provides a Mac OS X style using the Apple Appearance Manager. - - \ingroup appearance - - This class is implemented as a wrapper to the HITheme - APIs, allowing applications to be styled according to the current - theme in use on Mac OS X. This is done by having primitives - in QStyle implemented in terms of what Mac OS X would normally theme. - - \warning This style is only available on Mac OS X because it relies on the - HITheme APIs. - - There are additional issues that should be taken - into consideration to make an application compatible with the - \link http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/index.html - Apple Human Interface Guidelines \endlink. Some of these issues are outlined - below. - - \list - - \i Layout - The restrictions on window layout are such that some - aspects of layout that are style-dependent cannot be achieved - using QLayout. Changes are being considered (and feedback would be - appreciated) to make layouts QStyle-able. Some of the restrictions - involve horizontal and vertical widget alignment and widget size - (covered below). - - \i Widget size - Mac OS X allows widgets to have specific fixed sizes. Qt - does not fully implement this behavior so as to maintain cross-platform - compatibility. As a result some widgets sizes may be inappropriate (and - subsequently not rendered correctly by the HITheme APIs).The - QWidget::sizeHint() will return the appropriate size for many - managed widgets (widgets enumerated in \l QStyle::ContentsType). - - \i Effects - QMacStyle uses HITheme for performing most of the drawing, but - also uses emulation in a few cases where HITheme does not provide the - required functionality (for example, tab bars on Panther, the toolbar - separator, etc). We tried to make the emulation as close to the original as - possible. Please report any issues you see in effects or non-standard - widgets. - - \endlist - - There are other issues that need to be considered in the feel of - your application (including the general color scheme to match the - Aqua colors). The Guidelines mentioned above will remain current - with new advances and design suggestions for Mac OS X. - - Note that the functions provided by QMacStyle are - reimplementations of QStyle functions; see QStyle for their - documentation. - - \img qmacstyle.png - \sa QWindowsXPStyle, QWindowsStyle, QPlastiqueStyle, QCDEStyle, QMotifStyle -*/ - - -/*! - \enum QMacStyle::WidgetSizePolicy - - \value SizeSmall - \value SizeLarge - \value SizeMini - \value SizeDefault - \omitvalue SizeNone -*/ - -/*! - Constructs a QMacStyle object. -*/ QMacStyle::QMacStyle() : QWindowsStyle() { d = new QMacStylePrivate(this); } -/*! - Destructs a QMacStyle object. -*/ QMacStyle::~QMacStyle() { delete qt_mac_backgroundPattern; @@ -2142,7 +2072,6 @@ void qt_mac_fill_background(QPainter *painter, const QRegion &rgn, const QPoint } } -/*! \reimp */ void QMacStyle::polish(QPalette &pal) { if (!qt_mac_backgroundPattern) { @@ -2166,17 +2095,14 @@ void QMacStyle::polish(QPalette &pal) } } -/*! \reimp */ void QMacStyle::polish(QApplication *) { } -/*! \reimp */ void QMacStyle::unpolish(QApplication *) { } -/*! \reimp */ void QMacStyle::polish(QWidget* w) { d->addWidget(w); @@ -2240,7 +2166,6 @@ void QMacStyle::polish(QWidget* w) } } -/*! \reimp */ void QMacStyle::unpolish(QWidget* w) { d->removeWidget(w); @@ -2271,7 +2196,6 @@ void QMacStyle::unpolish(QWidget* w) QWindowsStyle::unpolish(w); } -/*! \reimp */ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QWidget *widget) const { int controlSize = getControlSize(opt, widget); @@ -2650,7 +2574,6 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW return ret; } -/*! \reimp */ QPalette QMacStyle::standardPalette() const { QPalette pal = QWindowsStyle::standardPalette(); @@ -2660,7 +2583,6 @@ QPalette QMacStyle::standardPalette() const return pal; } -/*! \reimp */ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w, QStyleHintReturn *hret) const { @@ -2955,7 +2877,6 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w return ret; } -/*! \reimp */ QPixmap QMacStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const { @@ -2981,7 +2902,6 @@ QPixmap QMacStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixm } -/*! \reimp */ QPixmap QMacStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget) const { @@ -3012,31 +2932,7 @@ QPixmap QMacStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOpt } return icon.pixmap(size, size); } -/*! - \enum QMacStyle::FocusRectPolicy - - This type is used to signify a widget's focus rectangle policy. - - \value FocusEnabled show a focus rectangle when the widget has focus. - \value FocusDisabled never show a focus rectangle for the widget. - \value FocusDefault show a focus rectangle when the widget has - focus and the widget is a QSpinWidget, QDateTimeEdit, QLineEdit, - QListBox, QListView, editable QTextEdit, or one of their - subclasses. -*/ - -/*! - \obsolete - Sets the focus rectangle policy of \a w. The \a policy can be one of - \l{QMacStyle::FocusRectPolicy}. - - This is now simply an interface to the Qt::WA_MacShowFocusRect attribute and the - FocusDefault value does nothing anymore. If you want to set a widget back - to its default value, you must save the old value of the attribute before - you change it. - \sa focusRectPolicy() QWidget::setAttribute() -*/ void QMacStyle::setFocusRectPolicy(QWidget *w, FocusRectPolicy policy) { switch (policy) { @@ -3049,29 +2945,11 @@ void QMacStyle::setFocusRectPolicy(QWidget *w, FocusRectPolicy policy) } } -/*! - \obsolete - Returns the focus rectangle policy for the widget \a w. - - The focus rectangle policy can be one of \l{QMacStyle::FocusRectPolicy}. - - In 4.3 and up this function will simply test for the - Qt::WA_MacShowFocusRect attribute and will never return - QMacStyle::FocusDefault. - - \sa setFocusRectPolicy(), QWidget::testAttribute() -*/ QMacStyle::FocusRectPolicy QMacStyle::focusRectPolicy(const QWidget *w) { return w->testAttribute(Qt::WA_MacShowFocusRect) ? FocusEnabled : FocusDisabled; } -/*! - \obsolete - - Call QWidget::setAttribute() with Qt::WA_MacMiniSize, Qt::WA_MacSmallSize, - or Qt::WA_MacNormalSize instead. -*/ void QMacStyle::setWidgetSizePolicy(const QWidget *widget, WidgetSizePolicy policy) { QWidget *wadget = const_cast(widget); @@ -3080,12 +2958,6 @@ void QMacStyle::setWidgetSizePolicy(const QWidget *widget, WidgetSizePolicy poli wadget->setAttribute(Qt::WA_MacMiniSize, policy == SizeMini); } -/*! - \obsolete - - Call QWidget::testAttribute() with Qt::WA_MacMiniSize, Qt::WA_MacSmallSize, - or Qt::WA_MacNormalSize instead. -*/ QMacStyle::WidgetSizePolicy QMacStyle::widgetSizePolicy(const QWidget *widget) { while (widget) { @@ -3101,7 +2973,6 @@ QMacStyle::WidgetSizePolicy QMacStyle::widgetSizePolicy(const QWidget *widget) return SizeDefault; } -/*! \reimp */ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w) const { @@ -3534,7 +3405,6 @@ static inline QPixmap darkenPixmap(const QPixmap &pixmap) -/*! \reimp */ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter *p, const QWidget *w) const { @@ -4558,7 +4428,7 @@ static void setLayoutItemMargins(int left, int top, int right, int bottom, QRect rect->adjust(left, top, right, bottom); } } -/*! \reimp */ + QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt, const QWidget *widget) const { @@ -4852,7 +4722,6 @@ static inline void drawToolbarButtonArrow(const QRect &toolButtonRect, ThemeDraw HIThemeDrawPopupArrow(&hirect, &padi, cg, kHIThemeOrientationNormal); } -/*! \reimp */ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *widget) const { @@ -5349,7 +5218,6 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex } } -/*! \reimp */ QStyle::SubControl QMacStyle::hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *widget) const @@ -5480,7 +5348,6 @@ QStyle::SubControl QMacStyle::hitTestComplexControl(ComplexControl cc, return sc; } -/*! \reimp */ QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget) const { @@ -5820,7 +5687,6 @@ QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *op return ret; } -/*! \reimp */ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &csz, const QWidget *widget) const { @@ -6107,9 +5973,6 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, return sz; } -/*! - \reimp -*/ void QMacStyle::drawItemText(QPainter *p, const QRect &r, int flags, const QPalette &pal, bool enabled, const QString &text, QPalette::ColorRole textRole) const { @@ -6118,9 +5981,6 @@ void QMacStyle::drawItemText(QPainter *p, const QRect &r, int flags, const QPale QWindowsStyle::drawItemText(p, r, flags, pal, enabled, text, textRole); } -/*! - \reimp -*/ bool QMacStyle::event(QEvent *e) { if(e->type() == QEvent::FocusIn) { @@ -6195,9 +6055,6 @@ void qt_mac_constructQIconFromIconRef(const IconRef icon, const IconRef overlayI } } -/*! - \internal -*/ QIcon QMacStyle::standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *opt, const QWidget *widget) const { @@ -6311,9 +6168,6 @@ QIcon QMacStyle::standardIconImplementation(StandardPixmap standardIcon, const Q return QWindowsStyle::standardIconImplementation(standardIcon, opt, widget); } -/*! - \internal -*/ int QMacStyle::layoutSpacingImplementation(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, -- cgit v0.12 From a9722dffb48559c27f2f4cd99ebc082f717a9e60 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Wed, 20 May 2009 11:57:52 +0200 Subject: make QSslSocket test work also for shadow builds ... by being able to load the certificates also in a shadow build directory Reviewed-by: Thiago --- tests/auto/qsslsocket/qsslsocket.pro | 6 ++++++ tests/auto/qsslsocket/tst_qsslsocket.cpp | 30 +++++++++++++++--------------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/tests/auto/qsslsocket/qsslsocket.pro b/tests/auto/qsslsocket/qsslsocket.pro index 147b40d..c29fc68 100644 --- a/tests/auto/qsslsocket/qsslsocket.pro +++ b/tests/auto/qsslsocket/qsslsocket.pro @@ -7,6 +7,12 @@ QT -= gui TARGET = tst_qsslsocket +!wince* { +DEFINES += SRCDIR=\\\"$$PWD/\\\" +} else { +DEFINES += SRCDIR=\\\"./\\\" +} + win32 { CONFIG(debug, debug|release) { DESTDIR = debug diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp index 5c99164..0aa93fe 100644 --- a/tests/auto/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp @@ -577,7 +577,7 @@ void tst_QSslSocket::connectToHostEncrypted() QSslSocketPtr socket = newSocket(); this->socket = socket; - socket->addCaCertificates(QLatin1String("certs/qt-test-server-cacert.pem")); + QVERIFY(socket->addCaCertificates(QLatin1String(SRCDIR "certs/qt-test-server-cacert.pem"))); #ifdef QSSLSOCKET_CERTUNTRUSTED_WORKAROUND connect(&socket, SIGNAL(sslErrors(QList)), this, SLOT(untrustedWorkaroundSlot(QList))); @@ -648,7 +648,7 @@ void tst_QSslSocket::peerCertificateChain() QSslSocketPtr socket = newSocket(); this->socket = socket; - QList caCertificates = QSslCertificate::fromPath(QLatin1String("certs/qt-test-server-cacert.pem")); + QList caCertificates = QSslCertificate::fromPath(QLatin1String(SRCDIR "certs/qt-test-server-cacert.pem")); QVERIFY(caCertificates.count() == 1); socket->addCaCertificates(caCertificates); @@ -709,7 +709,7 @@ void tst_QSslSocket::protocol() QSslSocketPtr socket = newSocket(); this->socket = socket; - QList certs = QSslCertificate::fromPath("certs/qt-test-server-cacert.pem"); + QList certs = QSslCertificate::fromPath(SRCDIR "certs/qt-test-server-cacert.pem"); // qDebug() << "certs:" << certs.at(0).issuerInfo(QSslCertificate::CommonName); socket->setCaCertificates(certs); @@ -792,7 +792,7 @@ void tst_QSslSocket::setCaCertificates() QSslSocket socket; QCOMPARE(socket.caCertificates(), QSslSocket::defaultCaCertificates()); - socket.setCaCertificates(QSslCertificate::fromPath("certs/qt-test-server-cacert.pem")); + socket.setCaCertificates(QSslCertificate::fromPath(SRCDIR "certs/qt-test-server-cacert.pem")); QCOMPARE(socket.caCertificates().size(), 1); socket.setCaCertificates(socket.defaultCaCertificates()); QCOMPARE(socket.caCertificates(), QSslSocket::defaultCaCertificates()); @@ -823,13 +823,13 @@ protected: socket = new QSslSocket(this); connect(socket, SIGNAL(sslErrors(const QList &)), this, SLOT(ignoreErrorSlot())); - QFile file("certs/fluke.key"); + QFile file(SRCDIR "certs/fluke.key"); QVERIFY(file.open(QIODevice::ReadOnly)); QSslKey key(file.readAll(), QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey); QVERIFY(!key.isNull()); socket->setPrivateKey(key); - QList localCert = QSslCertificate::fromPath("certs/fluke.cert"); + QList localCert = QSslCertificate::fromPath(SRCDIR "certs/fluke.cert"); QVERIFY(!localCert.isEmpty()); QVERIFY(localCert.first().handle()); socket->setLocalCertificate(localCert.first()); @@ -930,7 +930,7 @@ void tst_QSslSocket::addDefaultCaCertificate() // Reset the global CA chain QSslSocket::setDefaultCaCertificates(QSslSocket::systemCaCertificates()); - QList flukeCerts = QSslCertificate::fromPath("certs/qt-test-server-cacert.pem"); + QList flukeCerts = QSslCertificate::fromPath(SRCDIR "certs/qt-test-server-cacert.pem"); QCOMPARE(flukeCerts.size(), 1); QList globalCerts = QSslSocket::defaultCaCertificates(); QVERIFY(!globalCerts.contains(flukeCerts.first())); @@ -1014,7 +1014,7 @@ void tst_QSslSocket::wildcard() // responds with the wildcard, and QSslSocket should accept that as a // valid connection. This was broken in 4.3.0. QSslSocketPtr socket = newSocket(); - socket->addCaCertificates(QLatin1String("certs/qt-test-server-cacert.pem")); + socket->addCaCertificates(QLatin1String(SRCDIR "certs/qt-test-server-cacert.pem")); this->socket = socket; #ifdef QSSLSOCKET_CERTUNTRUSTED_WORKAROUND connect(socket, SIGNAL(sslErrors(QList)), @@ -1040,7 +1040,7 @@ protected: socket->ignoreSslErrors(); // Only set the certificate - QList localCert = QSslCertificate::fromPath("certs/fluke.cert"); + QList localCert = QSslCertificate::fromPath(SRCDIR "certs/fluke.cert"); QVERIFY(!localCert.isEmpty()); QVERIFY(localCert.first().handle()); socket->setLocalCertificate(localCert.first()); @@ -1199,13 +1199,13 @@ protected: socket = new QSslSocket(this); connect(socket, SIGNAL(sslErrors(const QList &)), this, SLOT(ignoreErrorSlot())); - QFile file("certs/fluke.key"); + QFile file(SRCDIR "certs/fluke.key"); QVERIFY(file.open(QIODevice::ReadOnly)); QSslKey key(file.readAll(), QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey); QVERIFY(!key.isNull()); socket->setPrivateKey(key); - QList localCert = QSslCertificate::fromPath("certs/fluke.cert"); + QList localCert = QSslCertificate::fromPath(SRCDIR "certs/fluke.cert"); QVERIFY(!localCert.isEmpty()); QVERIFY(localCert.first().handle()); socket->setLocalCertificate(localCert.first()); @@ -1363,8 +1363,8 @@ protected: { socket = new QSslSocket(this); - socket->setPrivateKey("certs/fluke.key"); - socket->setLocalCertificate("certs/fluke.cert"); + socket->setPrivateKey(SRCDIR "certs/fluke.key"); + socket->setLocalCertificate(SRCDIR "certs/fluke.cert"); socket->setSocketDescriptor(socketDescriptor); socket->startServerEncryption(); } @@ -1487,7 +1487,7 @@ void tst_QSslSocket::resetProxy() // make sure the connection works, and then set a nonsense proxy, and then // make sure it does not work anymore QSslSocket socket; - socket.addCaCertificates(QLatin1String("certs/qt-test-server-cacert.pem")); + socket.addCaCertificates(QLatin1String(SRCDIR "certs/qt-test-server-cacert.pem")); socket.setProxy(goodProxy); socket.connectToHostEncrypted(QtNetworkSettings::serverName(), 443); QVERIFY2(socket.waitForConnected(10000), qPrintable(socket.errorString())); @@ -1500,7 +1500,7 @@ void tst_QSslSocket::resetProxy() // set the nonsense proxy and make sure the connection does not work, // and then set the right proxy and make sure it works QSslSocket socket2; - socket2.addCaCertificates(QLatin1String("certs/qt-test-server-cacert.pem")); + socket2.addCaCertificates(QLatin1String(SRCDIR "certs/qt-test-server-cacert.pem")); socket2.setProxy(badProxy); socket2.connectToHostEncrypted(QtNetworkSettings::serverName(), 443); QVERIFY(! socket2.waitForConnected(10000)); -- cgit v0.12 From c02f3b1934a4ab300f593b91ee9fd302207a96f5 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 20 May 2009 12:04:37 +0200 Subject: qdoc: I overwrote the commit template. --- .commit-template | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.commit-template b/.commit-template index 171b67b..589ca89 100644 --- a/.commit-template +++ b/.commit-template @@ -1,8 +1,10 @@ -qdoc: Moved qdoc comments from qmacstyle_mac.mm to qstyles.qdoc +# ===[ Subject ]==========[ one line, please wrap at 72 characters ]===| -The .mm file is not read by qdoc for packages other than for the MAC. -This problem is overcome by moving the qdoc comments from the .mm file -to a .qdoc file in doc/src, because all these files are read by qdoc -for each of the packages. +# ---[ Details ]---------[ remember extra blank line after subject ]---| -#Task-number: 252566 +# ---[ Fields ]-----------------[ uncomment and edit as applicable ]---| + +#Task-number: +#Reviewed-by: + +# ==================================[ please wrap at 72 characters ]===| -- cgit v0.12 From b28e95cd2fbdd0f8ad5030e6fc3beede057548da Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Wed, 20 May 2009 12:16:11 +0200 Subject: Remove bad documentation about window modality and QMessageBox. QMessageBox is like QDialog. It doesn't have any extra magic with window modality on creation, so don't advertise that it does. The note about using message boxes as sheets is also updated. --- src/gui/dialogs/qmessagebox.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/gui/dialogs/qmessagebox.cpp b/src/gui/dialogs/qmessagebox.cpp index 5e59501..fb3bcb8 100644 --- a/src/gui/dialogs/qmessagebox.cpp +++ b/src/gui/dialogs/qmessagebox.cpp @@ -706,15 +706,10 @@ void QMessageBoxPrivate::_q_buttonClicked(QAbstractButton *button) Constructs a message box with no text and no buttons. \a parent is passed to the QDialog constructor. - If \a parent is 0, the message box is an \l{Qt::ApplicationModal} - {application modal} dialog box. If \a parent is a widget, the - message box is \l{Qt::WindowModal} {window modal} relative to \a - parent. - - On Mac OS X, if \a parent is not 0 and you want your message box - to appear as a Qt::Sheet of that parent, set the message box's - \l{setWindowModality()} {window modality} to Qt::WindowModal - (default). Otherwise, the message box will be a standard dialog. + On Mac OS X, if you want your message box to appear + as a Qt::Sheet of its \a parent, set the message box's + \l{setWindowModality()} {window modality} to Qt::WindowModal or use open(). + Otherwise, the message box will be a standard dialog. */ QMessageBox::QMessageBox(QWidget *parent) -- cgit v0.12 From b7e01ff7d994d704cbcd876a77bf32cbdf66c17b Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Wed, 20 May 2009 12:45:11 +0200 Subject: Revert focus apparance on itemviews for X11 We changed this primarily for the mac as active appearance on widgets in itemviews should depend on the window activation state and not on the focus widget. It was explicitly added back for windows only but has been reported as a bug on X11 as well so we might as well keep it mac-only for now. Reviewed-by: mortens --- src/gui/itemviews/qabstractitemview.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index 7a3d674..c77395a 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -3220,9 +3220,9 @@ QStyleOptionViewItem QAbstractItemView::viewOptions() const option.state &= ~QStyle::State_MouseOver; option.font = font(); -#ifdef Q_WS_WIN - // Note this is currently required on Windows - // do give non-focused item views inactive appearance +#ifndef Q_WS_MAC + // On mac the focus appearance follows window activation + // not widget activation if (!hasFocus()) option.state &= ~QStyle::State_Active; #endif -- cgit v0.12 From 3c988e8cdf2fff3782ac13ead72341dd0f6383a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Wed, 20 May 2009 13:48:20 +0300 Subject: S60Style: Incorrect frame part in toolbar graphics. --- src/gui/styles/qs60style_symbian.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/gui/styles/qs60style_symbian.cpp b/src/gui/styles/qs60style_symbian.cpp index 35dfe13..781fe56 100644 --- a/src/gui/styles/qs60style_symbian.cpp +++ b/src/gui/styles/qs60style_symbian.cpp @@ -161,7 +161,7 @@ const partMapEntry QS60StyleModeSpecifics::m_partMap[] = { /* SP_QsnCpScrollHandleMiddle */ {KAknsIIDQsnCpScrollHandleMiddle, EDrawIcon, ES60_AllReleases, -1,-1}, /* SP_QsnCpScrollHandleTop */ {KAknsIIDQsnCpScrollHandleTop, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbCornerTl */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbCornerTl */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, //todo: use "normal button" from 5.0 onwards /* SP_QsnFrButtonTbCornerTr */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, /* SP_QsnFrButtonTbCornerBl */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, /* SP_QsnFrButtonTbCornerBr */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, @@ -275,15 +275,15 @@ const partMapEntry QS60StyleModeSpecifics::m_partMap[] = { /* SP_QsnFrSctrlButtonCenter */ {KAknsIIDQsnFrButtonTbCenter, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2309}, /*KAknsIIDQgnFrSctrlButtonCenter*/ // No pressed state for toolbar button in 3.1/3.2. - /* SP_QsnFrSctrlButtonCornerTlPressed */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2621}, /*KAknsIIDQsnFrSctrlButtonCornerTlPressed*/ - /* SP_QsnFrSctrlButtonCornerTrPressed */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2622}, - /* SP_QsnFrSctrlButtonCornerBlPressed */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2623}, - /* SP_QsnFrSctrlButtonCornerBrPressed */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2624}, - /* SP_QsnFrSctrlButtonSideTPressed */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2625}, - /* SP_QsnFrSctrlButtonSideBPressed */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2626}, - /* SP_QsnFrSctrlButtonSideLPressed */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2627}, - /* SP_QsnFrSctrlButtonSideRPressed */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2628}, - /* SP_QsnFrSctrlButtonCenterPressed */ {KAknsIIDQsnFrButtonTbCenter, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2629} + /* SP_QsnFrSctrlButtonCornerTlPressed */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2621}, /*KAknsIIDQsnFrSctrlButtonCornerTlPressed*/ + /* SP_QsnFrSctrlButtonCornerTrPressed */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2622}, + /* SP_QsnFrSctrlButtonCornerBlPressed */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2623}, + /* SP_QsnFrSctrlButtonCornerBrPressed */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2624}, + /* SP_QsnFrSctrlButtonSideTPressed */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2625}, + /* SP_QsnFrSctrlButtonSideBPressed */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2626}, + /* SP_QsnFrSctrlButtonSideLPressed */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2627}, + /* SP_QsnFrSctrlButtonSideRPressed */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2628}, + /* SP_QsnFrSctrlButtonCenterPressed */ {KAknsIIDQsnFrButtonTbCenter, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2629} }; QPixmap QS60StyleModeSpecifics::skinnedGraphics( -- cgit v0.12 From 335cdc13bd19ea2bef3b2ecdf0015f452b576a53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Wed, 20 May 2009 13:52:21 +0300 Subject: S60Style: Set theme palette to widgets once theme changes. --- src/gui/styles/qs60style.cpp | 93 ++++++++++++++++++++---------------- src/gui/styles/qs60style_p.h | 1 + src/gui/styles/qs60style_symbian.cpp | 1 + 3 files changed, 53 insertions(+), 42 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index bf73494..f3a5d97 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -541,46 +541,10 @@ void QS60StylePrivate::setThemePalette(QApplication *app) const app->setPalette(widgetPalette); } -void QS60StylePrivate::setBackgroundTexture(QApplication *app) const -{ - if (!app) - return; - QPalette applicationPalette = app->palette(); - applicationPalette.setBrush(QPalette::Window, QS60StylePrivate::backgroundTexture()); - app->setPalette(applicationPalette); -} - -void QS60Style::polish(QApplication *application) +void QS60StylePrivate::setThemePalette(QWidget *widget) const { - Q_D(const QS60Style); - originalPalette = application->palette(); - d->setThemePalette(application); -} - -void QS60Style::polish(QWidget *widget) -{ - Q_D(const QS60Style); - QCommonStyle::polish(widget); - - if (!widget) + if(!widget) return; - - if (QS60StylePrivate::isSkinnableDialog(widget)) { - widget->setAttribute(Qt::WA_StyledBackground); - } else if (false -#ifndef QT_NO_MENU - || qobject_cast (widget) -#endif // QT_NO_MENU - ) { - widget->setAttribute(Qt::WA_StyledBackground); - } else if (false -#ifndef QT_NO_COMBOBOX - || qobject_cast(widget) -#endif //QT_NO_COMBOBOX - ) { - widget->setAttribute(Qt::WA_StyledBackground); - } - QPalette widgetPalette = widget->palette(); // widget specific colors and fonts @@ -589,16 +553,19 @@ void QS60Style::polish(QWidget *widget) QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnLineColors, 8, 0)); QApplication::setPalette(widgetPalette, "QSlider"); } else if (qobject_cast(widget)){ - const QFont suggestedFont = d->s60Font( + const QFont suggestedFont = s60Font( QS60StyleEnums::FC_Primary, widget->font().pointSizeF()); widget->setFont(suggestedFont); widgetPalette.setColor(QPalette::Active, QPalette::ButtonText, QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); widgetPalette.setColor(QPalette::Inactive, QPalette::ButtonText, QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); + const QStyleOption opt; + widgetPalette.setColor(QPalette::Disabled, QPalette::ButtonText, + QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, &opt)); QApplication::setPalette(widgetPalette, "QPushButton"); } else if (qobject_cast(widget)){ - const QFont suggestedFont = d->s60Font( + const QFont suggestedFont = s60Font( QS60StyleEnums::FC_Primary, widget->font().pointSizeF()); widget->setFont(suggestedFont); widgetPalette.setColor(QPalette::Active, QPalette::ButtonText, @@ -607,7 +574,7 @@ void QS60Style::polish(QWidget *widget) QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); QApplication::setPalette(widgetPalette, "QToolButton"); } else if (qobject_cast(widget)){ - const QFont suggestedFont = d->s60Font( + const QFont suggestedFont = s60Font( QS60StyleEnums::FC_Secondary, widget->font().pointSizeF()); widget->setFont(suggestedFont); widgetPalette.setColor(QPalette::Active, QPalette::ButtonText, @@ -630,7 +597,7 @@ void QS60Style::polish(QWidget *widget) QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 22, 0)); QApplication::setPalette(widgetPalette, "QTableView"); } else if (qobject_cast(widget)){ - const QFont suggestedFont = d->s60Font( + const QFont suggestedFont = s60Font( QS60StyleEnums::FC_Title, widget->font().pointSizeF()); widget->setFont(suggestedFont); } else if (qobject_cast(widget)) { @@ -647,6 +614,48 @@ void QS60Style::polish(QWidget *widget) } } +void QS60StylePrivate::setBackgroundTexture(QApplication *app) const +{ + if (!app) + return; + QPalette applicationPalette = app->palette(); + applicationPalette.setBrush(QPalette::Window, QS60StylePrivate::backgroundTexture()); + app->setPalette(applicationPalette); +} + +void QS60Style::polish(QApplication *application) +{ + Q_D(const QS60Style); + originalPalette = application->palette(); + d->setThemePalette(application); +} + +void QS60Style::polish(QWidget *widget) +{ + Q_D(const QS60Style); + QCommonStyle::polish(widget); + + if (!widget) + return; + + if (QS60StylePrivate::isSkinnableDialog(widget)) { + widget->setAttribute(Qt::WA_StyledBackground); + } else if (false +#ifndef QT_NO_MENU + || qobject_cast (widget) +#endif // QT_NO_MENU + ) { + widget->setAttribute(Qt::WA_StyledBackground); + } else if (false +#ifndef QT_NO_COMBOBOX + || qobject_cast(widget) +#endif //QT_NO_COMBOBOX + ) { + widget->setAttribute(Qt::WA_StyledBackground); + } + d->setThemePalette(widget); +} + void QS60Style::unpolish(QApplication *application) { application->setPalette(originalPalette); diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index da34efb..fc6bcd6 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -360,6 +360,7 @@ public: // calculates average color based on button skin graphics (minus borders). QColor colorFromFrameGraphics(QS60StylePrivate::SkinFrameElements frame) const; void setThemePalette(QApplication *application) const; + void setThemePalette(QWidget *application) const; void setBackgroundTexture(QApplication *application) const; static int focusRectPenWidth(); diff --git a/src/gui/styles/qs60style_symbian.cpp b/src/gui/styles/qs60style_symbian.cpp index 781fe56..0b5e2d9 100644 --- a/src/gui/styles/qs60style_symbian.cpp +++ b/src/gui/styles/qs60style_symbian.cpp @@ -1291,6 +1291,7 @@ void QS60Style::handleSkinChange() foreach (QWidget *topLevelWidget, QApplication::allWidgets()){ QEvent e(QEvent::StyleChange); QApplication::sendEvent(topLevelWidget, &e); + d->setThemePalette(topLevelWidget); topLevelWidget->ensurePolished(); } } -- cgit v0.12 From d68629e4cfb94776b8ef02cd01cf0b02bf430db8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Wed, 20 May 2009 13:57:26 +0300 Subject: S60Style: Support theme graphics for inactive (disabled) button. --- src/gui/styles/qs60style.cpp | 101 ++++++++++++++++++++--------------- src/gui/styles/qs60style_p.h | 17 ++++-- src/gui/styles/qs60style_symbian.cpp | 82 +++++++++++++++++++++++----- 3 files changed, 141 insertions(+), 59 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index f3a5d97..5e05dd4 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -109,6 +109,7 @@ const struct QS60StylePrivate::frameElementCenter QS60StylePrivate::m_frameEleme {SE_ToolBarButton, QS60StyleEnums::SP_QsnFrSctrlButtonCenter}, {SE_ToolBarButtonPressed, QS60StyleEnums::SP_QsnFrSctrlButtonCenterPressed}, {SE_PanelBackground, QS60StyleEnums::SP_QsnFrSetOptCenter}, + {SE_ButtonInactive, QS60StyleEnums::SP_QsnFrButtonCenterInactive}, }; static const int frameElementsCount = int(sizeof(QS60StylePrivate::m_frameElementsData)/sizeof(QS60StylePrivate::m_frameElementsData[0])); @@ -335,6 +336,9 @@ void QS60StylePrivate::drawSkinElement(SkinElements element, QPainter *painter, drawRow(QS60StyleEnums::SP_QsnCpScrollHandleTopPressed, QS60StyleEnums::SP_QsnCpScrollHandleMiddlePressed, QS60StyleEnums::SP_QsnCpScrollHandleBottomPressed, Qt::Vertical, painter, rect, flags | SF_PointNorth); break; + case SE_ButtonInactive: + drawFrame(SF_ButtonInactive, painter, rect, flags | SF_PointNorth); + break; default: break; } @@ -562,7 +566,7 @@ void QS60StylePrivate::setThemePalette(QWidget *widget) const QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); const QStyleOption opt; widgetPalette.setColor(QPalette::Disabled, QPalette::ButtonText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, &opt)); + QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, &opt)); QApplication::setPalette(widgetPalette, "QPushButton"); } else if (qobject_cast(widget)){ const QFont suggestedFont = s60Font( @@ -601,7 +605,7 @@ void QS60StylePrivate::setThemePalette(QWidget *widget) const QS60StyleEnums::FC_Title, widget->font().pointSizeF()); widget->setFont(suggestedFont); } else if (qobject_cast(widget)) { - widgetPalette.setColor(QPalette::All, QPalette::HighlightedText, + widgetPalette.setColor(QPalette::All, QPalette::HighlightedText, QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0)); QApplication::setPalette(widgetPalette, "QLineEdit"); } else if (qobject_cast (widget)) { @@ -826,18 +830,18 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom const QS60StylePrivate::SkinElements grooveElement = horizontal ? QS60StylePrivate::SE_ScrollBarGrooveHorizontal : QS60StylePrivate::SE_ScrollBarGrooveVertical; QS60StylePrivate::drawSkinElement(grooveElement, painter, grooveRect, flags); - - QStyle::SubControls subControls = optionSlider->subControls; - + + QStyle::SubControls subControls = optionSlider->subControls; + // select correct slider (horizontal/vertical/pressed) const bool sliderPressed = ((optionSlider->state & QStyle::State_Sunken) && (subControls & SC_ScrollBarSlider)); const QS60StylePrivate::SkinElements handleElement = - horizontal ? - ( sliderPressed ? - QS60StylePrivate::SE_ScrollBarHandlePressedHorizontal : - QS60StylePrivate::SE_ScrollBarHandleHorizontal ) : - ( sliderPressed ? - QS60StylePrivate::SE_ScrollBarHandlePressedVertical : + horizontal ? + ( sliderPressed ? + QS60StylePrivate::SE_ScrollBarHandlePressedHorizontal : + QS60StylePrivate::SE_ScrollBarHandleHorizontal ) : + ( sliderPressed ? + QS60StylePrivate::SE_ScrollBarHandlePressedVertical : QS60StylePrivate::SE_ScrollBarHandleVertical); QS60StylePrivate::drawSkinElement(handleElement, painter, scrollBarSlider, flags); } @@ -901,7 +905,7 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom if (sub & SC_ComboBoxArrow) { // Draw the little arrow - buttonOption.rect.adjust(1, 1, -1, -1); + buttonOption.rect.adjust(1, 1, -1, -1); painter->save(); painter->setPen(option->palette.buttonText().color()); drawPrimitive(PE_IndicatorSpinDown, &buttonOption, painter, widget); @@ -1206,17 +1210,30 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, break; case CE_PushButtonBevel: if (const QStyleOptionButton *button = qstyleoption_cast(option)) { - const bool isPressed = option->state & QStyle::State_Sunken; - if (button->features & QStyleOptionButton::Flat) { - const QS60StyleEnums::SkinParts skinPart = - isPressed ? QS60StyleEnums::SP_QsnFrButtonTbCenterPressed : QS60StyleEnums::SP_QsnFrButtonTbCenter; - QS60StylePrivate::drawSkinPart(skinPart, painter, option->rect, flags); + const bool isDisabled = !(option->state & QStyle::State_Enabled); + const bool isFlat = button->features & QStyleOptionButton::Flat; + QS60StyleEnums::SkinParts skinPart; + QS60StylePrivate::SkinElements skinElement; + if (!isDisabled) { + const bool isPressed = option->state & QStyle::State_Sunken; + if (isFlat) { + skinPart = + isPressed ? QS60StyleEnums::SP_QsnFrButtonTbCenterPressed : QS60StyleEnums::SP_QsnFrButtonTbCenter; + } else { + skinElement = + isPressed ? QS60StylePrivate::SE_ButtonPressed : QS60StylePrivate::SE_ButtonNormal; + } } else { - const QS60StylePrivate::SkinElements skinElement = - isPressed ? QS60StylePrivate::SE_ButtonPressed : QS60StylePrivate::SE_ButtonNormal; + if (isFlat) + skinPart =QS60StyleEnums::SP_QsnFrButtonCenterInactive; + else + skinElement = QS60StylePrivate::SE_ButtonInactive; + } + if (isFlat) + QS60StylePrivate::drawSkinPart(skinPart, painter, option->rect, flags); + else QS60StylePrivate::drawSkinElement(skinElement, painter, option->rect, flags); } - } break; case CE_PushButtonLabel: if (const QStyleOptionButton *button = qstyleoption_cast(option)) { @@ -1248,13 +1265,13 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, case CE_ToolButtonLabel: if (const QStyleOptionToolButton *toolBtn = qstyleoption_cast(option)) { QStyleOptionToolButton optionToolButton = *toolBtn; - - if (!optionToolButton.icon.isNull() && (optionToolButton.state & QStyle::State_Sunken) + + if (!optionToolButton.icon.isNull() && (optionToolButton.state & QStyle::State_Sunken) && (optionToolButton.state & State_Enabled)) { - + const QIcon::State state = optionToolButton.state & State_On ? QIcon::On : QIcon::Off; const QPixmap pm(optionToolButton.icon.pixmap(optionToolButton.rect.size().boundedTo(optionToolButton.iconSize), - QIcon::Normal, state)); + QIcon::Normal, state)); optionToolButton.icon = generatedIconPixmap(QIcon::Selected, pm, &optionToolButton); } @@ -1940,7 +1957,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti } else if (option->state & QStyle::State_Selected) { QRect tickRect = option->rect; const int frameBorderWidth = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth); - // adjust tickmark rect to exclude frame border + // adjust tickmark rect to exclude frame border tickRect.adjust(0,-frameBorderWidth,0,-frameBorderWidth); QS60StyleEnums::SkinParts skinPart = QS60StyleEnums::SP_QgnIndiMarkedAdd; QS60StylePrivate::drawSkinPart(skinPart, painter, tickRect, @@ -1996,7 +2013,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti skinPart = QS60StyleEnums::SP_QgnGrafScrollArrowRight; else if (element==PE_IndicatorArrowUp) skinPart = QS60StyleEnums::SP_QgnGrafScrollArrowUp; - + QS60StylePrivate::drawSkinPart(skinPart, painter, option->rect, flags); } break; @@ -2006,11 +2023,11 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti case PE_IndicatorSpinUp: if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast(option)) { QStyleOptionSpinBox optionSpinBox = *spinBox; - const QS60StyleEnums::SkinParts part = (element == PE_IndicatorSpinUp) ? - QS60StyleEnums::SP_QgnGrafScrollArrowUp : + const QS60StyleEnums::SkinParts part = (element == PE_IndicatorSpinUp) ? + QS60StyleEnums::SP_QgnGrafScrollArrowUp : QS60StyleEnums::SP_QgnGrafScrollArrowDown; const int adjustment = qMin(optionSpinBox.rect.width(), optionSpinBox.rect.height())/6; - optionSpinBox.rect.translate(0, (element == PE_IndicatorSpinDown) ? adjustment : -adjustment ); + optionSpinBox.rect.translate(0, (element == PE_IndicatorSpinDown) ? adjustment : -adjustment ); QS60StylePrivate::drawSkinPart(part, painter, optionSpinBox.rect,flags); } #ifndef QT_NO_COMBOBOX @@ -2019,11 +2036,11 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti const QS60StyleEnums::SkinParts part = QS60StyleEnums::SP_QgnGrafScrollArrowDown; QStyleOptionFrame comboBox = *cmb; const int adjustment = qMin(comboBox.rect.width(), comboBox.rect.height())/6; - comboBox.rect.translate(0, (element == PE_IndicatorSpinDown) ? adjustment : -adjustment ); + comboBox.rect.translate(0, (element == PE_IndicatorSpinDown) ? adjustment : -adjustment ); QS60StylePrivate::drawSkinPart(part, painter, comboBox.rect,flags); } #endif //QT_NO_COMBOBOX - break; + break; case PE_IndicatorSpinMinus: case PE_IndicatorSpinPlus: if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast(option)) { @@ -2170,25 +2187,25 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti QS60StylePrivate::drawSkinPart(skinPart, painter, option->rect, (flags | QS60StylePrivate::SF_ColorSkinned)); } - + if (option->state & State_Children) { - QS60StyleEnums::SkinParts skinPart = - (option->state & State_Open) ? QS60StyleEnums::SP_QgnIndiHlColSuper : QS60StyleEnums::SP_QgnIndiHlExpSuper; + QS60StyleEnums::SkinParts skinPart = + (option->state & State_Open) ? QS60StyleEnums::SP_QgnIndiHlColSuper : QS60StyleEnums::SP_QgnIndiHlExpSuper; int minDimension = qMin(option->rect.width(), option->rect.height()); const int resizeValue = minDimension >> 1; minDimension += resizeValue; // Adjust the icon bigger because of empty space in svg icon. QRect iconRect(option->rect.topLeft(), QSize(minDimension, minDimension)); int verticalMagic(0); // magic values for positioning svg icon. - if (option->rect.width() <= option->rect.height()) - verticalMagic = 3; + if (option->rect.width() <= option->rect.height()) + verticalMagic = 3; iconRect.translate(3, verticalMagic - resizeValue); - QS60StylePrivate::drawSkinPart(skinPart, painter, iconRect, flags); - } + QS60StylePrivate::drawSkinPart(skinPart, painter, iconRect, flags); + } + } } - } - break; - + break; + // todo: items are below with #ifdefs "just in case". in final version, remove all non-required cases case PE_FrameLineEdit: case PE_IndicatorButtonDropDown: @@ -2256,7 +2273,7 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt, case CT_PushButton: sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget); if (const QAbstractButton *buttonWidget = (qobject_cast(widget))) - if (buttonWidget->isCheckable()) + if (buttonWidget->isCheckable()) sz += QSize(pixelMetric(PM_IndicatorWidth) + pixelMetric(PM_CheckBoxLabelSpacing), 0); break; case CT_LineEdit: diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index fc6bcd6..cf850c6 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -113,7 +113,7 @@ public: SP_QgnPropFolderCurrent, SP_QgnPropFolderSmall, SP_QgnPropFolderSmallNew, - SP_QgnPropPhoneMemcLarge, + SP_QgnPropPhoneMemcLarge, SP_QsnCpScrollHandleBottomPressed, //ScrollBar handle, pressed state SP_QsnCpScrollHandleMiddlePressed, SP_QsnCpScrollHandleTopPressed, @@ -231,7 +231,16 @@ public: SP_QsnFrSctrlButtonSideBPressed, SP_QsnFrSctrlButtonSideLPressed, SP_QsnFrSctrlButtonSideRPressed, - SP_QsnFrSctrlButtonCenterPressed + SP_QsnFrSctrlButtonCenterPressed, + SP_QsnFrButtonCornerTlInactive, // Inactive button + SP_QsnFrButtonCornerTrInactive, + SP_QsnFrButtonCornerBlInactive, + SP_QsnFrButtonCornerBrInactive, + SP_QsnFrButtonSideTInactive, + SP_QsnFrButtonSideBInactive, + SP_QsnFrButtonSideLInactive, + SP_QsnFrButtonSideRInactive, + SP_QsnFrButtonCenterInactive }; enum ColorLists { @@ -292,6 +301,7 @@ public: SE_PanelBackground, SE_ScrollBarHandlePressedHorizontal, //only for 5.0+ SE_ScrollBarHandlePressedVertical, + SE_ButtonInactive, }; enum SkinFrameElements { @@ -307,7 +317,8 @@ public: SF_ToolBar, SF_ToolBarButton, SF_ToolBarButtonPressed, - SF_PanelBackground + SF_PanelBackground, + SF_ButtonInactive, }; enum SkinElementFlag { diff --git a/src/gui/styles/qs60style_symbian.cpp b/src/gui/styles/qs60style_symbian.cpp index 0b5e2d9..025ef93 100644 --- a/src/gui/styles/qs60style_symbian.cpp +++ b/src/gui/styles/qs60style_symbian.cpp @@ -80,6 +80,8 @@ public: const QSize &size, QS60StylePrivate::SkinElementFlags flags); static QColor colorValue(const TAknsItemID &colorGroup, int colorIndex); static QPixmap fromFbsBitmap(CFbsBitmap *icon, CFbsBitmap *mask, QS60StylePrivate::SkinElementFlags flags, QImage::Format format); + static bool disabledPartGraphic(QS60StyleEnums::SkinParts &part); + static bool disabledFrameGraphic(QS60StylePrivate::SkinFrameElements &frame); static QPixmap generateMissingThemeGraphic(QS60StyleEnums::SkinParts &part, const QSize &size, QS60StylePrivate::SkinElementFlags flags); private: @@ -283,7 +285,19 @@ const partMapEntry QS60StyleModeSpecifics::m_partMap[] = { /* SP_QsnFrSctrlButtonSideBPressed */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2626}, /* SP_QsnFrSctrlButtonSideLPressed */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2627}, /* SP_QsnFrSctrlButtonSideRPressed */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2628}, - /* SP_QsnFrSctrlButtonCenterPressed */ {KAknsIIDQsnFrButtonTbCenter, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2629} + /* SP_QsnFrSctrlButtonCenterPressed */ {KAknsIIDQsnFrButtonTbCenter, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2629}, + + // No inactive button graphics in 3.1/3.2 + /* SP_QsnFrButtonCornerTlInactive */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b1}, /*KAknsIIDQsnFrButtonCornerTlInactive*/ + /* SP_QsnFrButtonCornerTrInactive */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b2}, + /* SP_QsnFrButtonCornerBlInactive */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b3}, + /* SP_QsnFrButtonCornerTrInactive */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b4}, + /* SP_QsnFrButtonSideTInactive */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b5}, + /* SP_QsnFrButtonSideBInactive */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b6}, + /* SP_QsnFrButtonSideLInactive */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b7}, + /* SP_QsnFrButtonSideRInactive */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b8}, + /* SP_QsnFrButtonCenterInactive */ {KAknsIIDQsnFrButtonTbCenter, EDrawIcon,ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b9} + }; QPixmap QS60StyleModeSpecifics::skinnedGraphics( @@ -323,7 +337,7 @@ QPixmap QS60StyleModeSpecifics::colorSkinnedGraphics( } void QS60StyleModeSpecifics::fallbackInfo(const QS60StyleEnums::SkinParts &stylepart, TDes& fallbackFileName, TInt& fallbackIndex) -{ +{ switch(stylepart) { case QS60StyleEnums::SP_QgnGrafBarWait: fallbackFileName = KAvkonBitmapFile(); @@ -377,19 +391,19 @@ void QS60StyleModeSpecifics::fallbackInfo(const QS60StyleEnums::SkinParts &style fallbackFileName = KAvkonBitmapFile(); fallbackIndex = EMbmAvkonQgn_indi_checkbox_on; break; - case QS60StyleEnums::SP_QgnIndiHlColSuper: + case QS60StyleEnums::SP_QgnIndiHlColSuper: fallbackFileName = KAvkonBitmapFile(); fallbackIndex = 0x4456; /* EMbmAvkonQgn_indi_hl_col_super */ break; - case QS60StyleEnums::SP_QgnIndiHlExpSuper: + case QS60StyleEnums::SP_QgnIndiHlExpSuper: fallbackFileName = KAvkonBitmapFile(); fallbackIndex = 0x4458; /* EMbmAvkonQgn_indi_hl_exp_super */ break; - case QS60StyleEnums::SP_QgnIndiHlLineBranch: + case QS60StyleEnums::SP_QgnIndiHlLineBranch: fallbackFileName = KAvkonBitmapFile(); fallbackIndex = 0x445A; /* EMbmAvkonQgn_indi_hl_line_branch */ break; - case QS60StyleEnums::SP_QgnIndiHlLineEnd: + case QS60StyleEnums::SP_QgnIndiHlLineEnd: fallbackFileName = KAvkonBitmapFile(); fallbackIndex = 0x445C; /* EMbmAvkonQgn_indi_hl_line_end */ break; @@ -486,8 +500,8 @@ QPixmap QS60StyleModeSpecifics::colorSkinnedGraphicsL( TInt fallbackGraphicID = -1; HBufC* iconFile = HBufC::NewLC( KMaxFileName ); TPtr fileNamePtr = iconFile->Des(); - fallbackInfo(stylepart, fileNamePtr, fallbackGraphicID); - + fallbackInfo(stylepart, fileNamePtr, fallbackGraphicID); + TAknsItemID colorGroup = KAknsIIDQsnIconColors; int colorIndex = 0; colorGroupAndIndex(stylepart, colorGroup, colorIndex); @@ -991,6 +1005,46 @@ short QS60StylePrivate::pixelMetric(int metric) #endif // QT_S60STYLE_LAYOUTDATA_SIMULATED } +bool QS60StyleModeSpecifics::disabledPartGraphic(QS60StyleEnums::SkinParts &part) +{ + bool disabledGraphic = false; + switch(part){ + // inactive button graphics are available from 5.0 onwards + case QS60StyleEnums::SP_QsnFrButtonCornerTlInactive: + case QS60StyleEnums::SP_QsnFrButtonCornerTrInactive: + case QS60StyleEnums::SP_QsnFrButtonCornerBlInactive: + case QS60StyleEnums::SP_QsnFrButtonCornerBrInactive: + case QS60StyleEnums::SP_QsnFrButtonSideTInactive: + case QS60StyleEnums::SP_QsnFrButtonSideBInactive: + case QS60StyleEnums::SP_QsnFrButtonSideLInactive: + case QS60StyleEnums::SP_QsnFrButtonSideRInactive: + case QS60StyleEnums::SP_QsnFrButtonCenterInactive: + if (!(QSysInfo::s60Version()==QSysInfo::SV_S60_3_1 || + QSysInfo::s60Version()==QSysInfo::SV_S60_3_2)) + disabledGraphic = true; + break; + default: + break; + } + return disabledGraphic; +} + +bool QS60StyleModeSpecifics::disabledFrameGraphic(QS60StylePrivate::SkinFrameElements &frame) +{ + bool disabledGraphic = false; + switch(frame){ + // inactive button graphics are available from 5.0 onwards + case QS60StylePrivate::SF_ButtonInactive: + if (!(QSysInfo::s60Version()==QSysInfo::SV_S60_3_1 || + QSysInfo::s60Version()==QSysInfo::SV_S60_3_2)) + disabledGraphic = true; + break; + default: + break; + } + return disabledGraphic; +} + QPixmap QS60StyleModeSpecifics::generateMissingThemeGraphic(QS60StyleEnums::SkinParts &part, const QSize &size, QS60StylePrivate::SkinElementFlags flags) { @@ -1002,8 +1056,8 @@ QPixmap QS60StyleModeSpecifics::generateMissingThemeGraphic(QS60StyleEnums::Skin // AVKON UI has a abnormal handling for scrollbar graphics. It is possible that the root // skin does not contain mandatory graphics for scrollbar pressed states. Therefore, AVKON UI // creates dynamically these graphics by modifying the normal state scrollbar graphics slightly. - // S60Style needs to work similarly. Therefore if skingraphics call provides to be a miss - // (i.e. result is not valid), style needs to draw normal graphics instead and apply some + // S60Style needs to work similarly. Therefore if skingraphics call provides to be a miss + // (i.e. result is not valid), style needs to draw normal graphics instead and apply some // modifications (similar to generatedIconPixmap()) to the result. case QS60StyleEnums::SP_QsnCpScrollHandleBottomPressed: updatedPart = QS60StyleEnums::SP_QsnCpScrollHandleBottom; @@ -1024,7 +1078,7 @@ QPixmap QS60StyleModeSpecifics::generateMissingThemeGraphic(QS60StyleEnums::Skin // TODO: fix this QStyleOption opt; // opt.palette = q->standardPalette(); - + // For now, always generate new icon based on "selected". In the future possibly, expand // this to consist other possibilities as well. result = QApplication::style()->generatedIconPixmap(QIcon::Selected, result, &opt); @@ -1041,7 +1095,7 @@ QPixmap QS60StylePrivate::part(QS60StyleEnums::SkinParts part, : QS60StyleModeSpecifics::skinnedGraphics(part, size, flags); QS60WindowSurface::lockBitmapHeap(); - if (flags & SF_StateDisabled) { + if (flags & SF_StateDisabled && !QS60StyleModeSpecifics::disabledPartGraphic(part)) { // TODO: fix this QStyleOption opt; // opt.palette = q->standardPalette(); @@ -1050,7 +1104,7 @@ QPixmap QS60StylePrivate::part(QS60StyleEnums::SkinParts part, if (!result) result = QS60StyleModeSpecifics::generateMissingThemeGraphic(part, size, flags); - + return result; } @@ -1060,7 +1114,7 @@ QPixmap QS60StylePrivate::frame(SkinFrameElements frame, const QSize &size, Skin QPixmap result = QS60StyleModeSpecifics::skinnedGraphics(frame, size, flags); QS60WindowSurface::lockBitmapHeap(); - if (flags & SF_StateDisabled) { + if (flags & SF_StateDisabled && !QS60StyleModeSpecifics::disabledFrameGraphic(frame)) { // TODO: fix this QStyleOption opt; // opt.palette = q->standardPalette(); -- cgit v0.12 From 25f86fbab2e7d23832b0bb8ae8530289258e2aa5 Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Wed, 20 May 2009 12:59:41 +0200 Subject: Silence warning by MSVC. Reviewed-By: TrustMe --- src/xmlpatterns/expr/qpath.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xmlpatterns/expr/qpath.cpp b/src/xmlpatterns/expr/qpath.cpp index 33bfa0f..a60f622 100644 --- a/src/xmlpatterns/expr/qpath.cpp +++ b/src/xmlpatterns/expr/qpath.cpp @@ -170,7 +170,7 @@ Expression::Ptr Path::compress(const StaticContext::Ptr &context) /* We do this as late as we can, such that we pick up the most recent type * from the operand. */ - if(m_isLast && !m_kind == XSLTForEach && m_operand2->staticType()->itemType() == BuiltinTypes::item) + if(m_isLast && m_kind != XSLTForEach && m_operand2->staticType()->itemType() == BuiltinTypes::item) m_checkXPTY0018 = true; return me; -- cgit v0.12 From fdefbb820f1ebf9fbde0f683ea6d05923e8c04e4 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 20 May 2009 13:25:27 +0200 Subject: QComboBox: style change event should not resets custom item delegates Regression from 4.4 introduced while fixing task 167106 Autotest: tst_QComboBox::task253944_itemDelegateIsReset() Task-number: 253944 Reviewed-by: jbache --- src/gui/widgets/qcombobox.cpp | 22 ++++++++++++++++------ src/gui/widgets/qcombobox_p.h | 6 +++--- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp index 09a51fe..a5a98d4 100644 --- a/src/gui/widgets/qcombobox.cpp +++ b/src/gui/widgets/qcombobox.cpp @@ -947,7 +947,7 @@ QComboBoxPrivateContainer* QComboBoxPrivate::viewContainer() container = new QComboBoxPrivateContainer(new QComboBoxListView(q), q); container->itemView()->setModel(model); container->itemView()->setTextElideMode(Qt::ElideMiddle); - updateDelegate(); + updateDelegate(true); updateLayoutDirection(); QObject::connect(container, SIGNAL(itemSelected(QModelIndex)), q, SLOT(_q_itemSelected(QModelIndex))); @@ -1567,15 +1567,25 @@ bool QComboBox::isEditable() const return d->lineEdit != 0; } -void QComboBoxPrivate::updateDelegate() +/*! \internal + update the default delegate + depending on the style's SH_ComboBox_Popup hint, we use a different default delegate. + + but we do not change the delegate is the combobox use a custom delegate, + unless \a force is set to true. + */ +void QComboBoxPrivate::updateDelegate(bool force) { Q_Q(QComboBox); QStyleOptionComboBox opt; q->initStyleOption(&opt); - if (q->style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, q)) - q->setItemDelegate(new QComboMenuDelegate(q->view(), q)); - else - q->setItemDelegate(new QComboBoxDelegate(q->view(), q)); + if (q->style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, q)) { + if (force || qobject_cast(q->itemDelegate())) + q->setItemDelegate(new QComboMenuDelegate(q->view(), q)); + } else { + if (force || qobject_cast(q->itemDelegate())) + q->setItemDelegate(new QComboBoxDelegate(q->view(), q)); + } } QIcon QComboBoxPrivate::itemIcon(const QModelIndex &index) const diff --git a/src/gui/widgets/qcombobox_p.h b/src/gui/widgets/qcombobox_p.h index c39a231..a55b439 100644 --- a/src/gui/widgets/qcombobox_p.h +++ b/src/gui/widgets/qcombobox_p.h @@ -256,7 +256,7 @@ private: }; class QComboMenuDelegate : public QAbstractItemDelegate -{ +{ Q_OBJECT public: QComboMenuDelegate(QObject *parent, QComboBox *cmb) : QAbstractItemDelegate(parent), mCombo(cmb) {} @@ -285,7 +285,7 @@ private: // Vista does not use the new theme for combo boxes and there might // be other side effects from using the new class class QComboBoxDelegate : public QItemDelegate -{ +{ Q_OBJECT public: QComboBoxDelegate(QObject *parent, QComboBox *cmb) : QItemDelegate(parent), mCombo(cmb) {} @@ -367,7 +367,7 @@ public: int itemRole() const; void updateLayoutDirection(); void setCurrentIndex(const QModelIndex &index); - void updateDelegate(); + void updateDelegate(bool force = false); void keyboardSearchString(const QString &text); void modelChanged(); -- cgit v0.12 From b793f13f7787f63e496ab010252c92cf6f9d5567 Mon Sep 17 00:00:00 2001 From: Aleksandar Sasha Babic Date: Wed, 20 May 2009 13:48:26 +0200 Subject: Some time related values have been changed to compensate for Open C 1.5.3 pre-release having slow performance, at least as seen in the emulator. --- tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index acc1d42..555ab34 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -424,11 +424,19 @@ public: QTcpSocket *active = new QTcpSocket(this); active->connectToHost("127.0.0.1", server.serverPort()); +#ifndef Q_OS_SYMBIAN if (!active->waitForConnected(10)) return false; if (!server.waitForNewConnection(10)) return false; +#else + if (!active->waitForConnected(5000)) + return false; + + if (!server.waitForNewConnection(5000)) + return false; +#endif QTcpSocket *passive = server.nextPendingConnection(); passive->setParent(this); @@ -2327,8 +2335,13 @@ void tst_QNetworkReply::ioPutToFileFromLocalSocket() } QLocalSocket active; active.connectToServer(socketname); +#ifndef Q_OS_SYMBIAN QVERIFY2(server.waitForNewConnection(10), server.errorString().toLatin1().constData()); QVERIFY2(active.waitForConnected(10), active.errorString().toLatin1().constData()); +#else + QVERIFY2(server.waitForNewConnection(5000), server.errorString().toLatin1().constData()); + QVERIFY2(active.waitForConnected(5000), active.errorString().toLatin1().constData()); +#endif QVERIFY2(server.hasPendingConnections(), server.errorString().toLatin1().constData()); QLocalSocket *passive = server.nextPendingConnection(); @@ -2343,7 +2356,11 @@ void tst_QNetworkReply::ioPutToFileFromLocalSocket() passive->setParent(reply); connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); +#ifndef Q_OS_SYMBIAN QTestEventLoop::instance().enterLoop(10); +#else + QTestEventLoop::instance().enterLoop(30); +#endif QVERIFY(!QTestEventLoop::instance().timeout()); QCOMPARE(reply->url(), url); @@ -2652,7 +2669,11 @@ void tst_QNetworkReply::downloadProgress_data() QTest::newRow("empty") << 0; QTest::newRow("small") << 4; +#ifndef Q_OS_SYMBIAN QTest::newRow("big") << 4096; +#else + QTest::newRow("big") << 1024; +#endif } void tst_QNetworkReply::downloadProgress() -- cgit v0.12 From 675c41f92fa72753fea364b73639fd9e0c7cc0d5 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 20 May 2009 14:14:22 +0200 Subject: Doc: Fixed the paper sizes again. Task-number: 254179 Reviewed-by: Norwegian Rock Cat --- src/gui/painting/qprinter.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/gui/painting/qprinter.cpp b/src/gui/painting/qprinter.cpp index 5090b3a..ed72077 100644 --- a/src/gui/painting/qprinter.cpp +++ b/src/gui/painting/qprinter.cpp @@ -480,26 +480,26 @@ void QPrinterPrivate::addToManualSetList(QPrintEngine::PrintEnginePropertyKey ke \value A7 74 x 105 mm \value A8 52 x 74 mm \value A9 37 x 52 mm - \value B0 1030 x 1456 mm - \value B1 728 x 1030 mm - \value B10 32 x 45 mm - \value B2 515 x 728 mm - \value B3 364 x 515 mm - \value B4 257 x 364 mm - \value B5 182 x 257 mm, 7.17 x 10.13 inches - \value B6 128 x 182 mm - \value B7 91 x 128 mm - \value B8 64 x 91 mm - \value B9 45 x 64 mm + \value B0 1000 x 1414 mm + \value B1 707 x 1000 mm + \value B2 500 x 707 mm + \value B3 353 x 500 mm + \value B4 250 x 353 mm + \value B5 176 x 250 mm, 6.93 x 9.84 inches + \value B6 125 x 176 mm + \value B7 88 x 125 mm + \value B8 62 x 88 mm + \value B9 33 x 62 mm + \value B10 31 x 44 mm \value C5E 163 x 229 mm \value Comm10E 105 x 241 mm, U.S. Common 10 Envelope \value DLE 110 x 220 mm - \value Executive 7.5 x 10 inches, 191 x 254 mm + \value Executive 7.5 x 10 inches, 190.5 x 254 mm \value Folio 210 x 330 mm - \value Ledger 432 x 279 mm - \value Legal 8.5 x 14 inches, 216 x 356 mm - \value Letter 8.5 x 11 inches, 216 x 279 mm - \value Tabloid 279 x 432 mm + \value Ledger 431.8 x 279.4 mm + \value Legal 8.5 x 14 inches, 215.9 x 355.6 mm + \value Letter 8.5 x 11 inches, 215.9 x 279.4 mm + \value Tabloid 279.4 x 431.8 mm \value Custom Unknown, or a user defined size. With setFullPage(false) (the default), the metrics will be a bit -- cgit v0.12 From 27df3cb8c0e547d9174fd0571b16ed554eb2432d Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 20 May 2009 14:25:38 +0200 Subject: qdoc: Moved a qdoc comment to a file that is in all packages. Task-number: 252565 --- src/gui/dialogs/qpagesetupdialog.cpp | 6 ++++++ src/gui/dialogs/qpagesetupdialog_mac.mm | 3 --- src/gui/styles/qmacstyle_mac.mm | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gui/dialogs/qpagesetupdialog.cpp b/src/gui/dialogs/qpagesetupdialog.cpp index 63775d2..682071a 100644 --- a/src/gui/dialogs/qpagesetupdialog.cpp +++ b/src/gui/dialogs/qpagesetupdialog.cpp @@ -180,6 +180,12 @@ void QPageSetupDialog::open(QObject *receiver, const char *member) QDialog::open(); } +#if defined(Q_WS_MAC) || defined(Q_OS_WIN) +/*! \fn void QPageSetupDialog::setVisible(bool visible) + \reimp +*/ +#endif + QT_END_NAMESPACE #endif diff --git a/src/gui/dialogs/qpagesetupdialog_mac.mm b/src/gui/dialogs/qpagesetupdialog_mac.mm index 401d95f..24aef34 100644 --- a/src/gui/dialogs/qpagesetupdialog_mac.mm +++ b/src/gui/dialogs/qpagesetupdialog_mac.mm @@ -251,9 +251,6 @@ QPageSetupDialog::QPageSetupDialog(QWidget *parent) d->ep = static_cast(d->printer->paintEngine())->d_func(); } -/*! - \reimp -*/ void QPageSetupDialog::setVisible(bool visible) { Q_D(QPageSetupDialog); diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index 2e47526..e4829dc 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -39,7 +39,7 @@ ** ****************************************************************************/ -/*! +/* Note: The qdoc comments for QMacStyle are contained in .../doc/src/qstyles.qdoc. */ -- cgit v0.12 From 6e03459f72b090695767f263e1d51e5182f5f317 Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Wed, 20 May 2009 14:52:23 +0200 Subject: Don't draw an arrow for toolbuttons that are text only and have a menu. I made this change to make things look a bit better on the mac. However, a toolbutton with text only looks strange and as a bonus the arrow covers some of the text, which no one wants. It seems that similar consructions in Cocoa don't show the arrow for text button, so we shouldn't either. Task-number: 253339 Reviewed-by: Jens Bache-Wiig --- src/gui/styles/qmacstyle_mac.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index e4829dc..1be3d6e 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -5104,7 +5104,8 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex arrowOpt.state = tb->state; arrowOpt.palette = tb->palette; drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, p, widget); - } else if (tb->features & QStyleOptionToolButton::HasMenu) { + } else if ((tb->features & QStyleOptionToolButton::HasMenu) + && (tb->toolButtonStyle != Qt::ToolButtonTextOnly && !tb->icon.isNull())) { drawToolbarButtonArrow(tb->rect, tds, cg); } if (tb->state & State_On) { -- cgit v0.12 From f0d465e39eee9f819d0453b1bf66b3b0462383e2 Mon Sep 17 00:00:00 2001 From: Jedrzej Nowacki Date: Wed, 20 May 2009 15:01:04 +0200 Subject: I made test more stable. There was no sens to check hardcoded size of header + file. Now test check only size of the real file content, assuming that it is rather boring (9,5MB of '\0'). It simply skip header. Reviewed by Peter Hartmann --- tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp b/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp index f501e78..5ab5064 100644 --- a/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp +++ b/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp @@ -795,14 +795,14 @@ void tst_QSocks5SocketEngine::downloadBigFile() if (QTestEventLoop::instance().timeout()) QFAIL("Network operation timed out"); - QCOMPARE(bytesAvailable, qint64(10000309)); + QCOMPARE(bytesAvailable, qint64(10000000)); QVERIFY(tmpSocket->state() == QAbstractSocket::ConnectedState); - qDebug("\t\t%.1fMB/%.1fs: %.1fMB/s", + /*qDebug("\t\t%.1fMB/%.1fs: %.1fMB/s", bytesAvailable / (1024.0 * 1024.0), stopWatch.elapsed() / 1024.0, - (bytesAvailable / (stopWatch.elapsed() / 1000.0)) / (1024 * 1024)); + (bytesAvailable / (stopWatch.elapsed() / 1000.0)) / (1024 * 1024));*/ delete tmpSocket; tmpSocket = 0; @@ -816,7 +816,10 @@ void tst_QSocks5SocketEngine::exitLoopSlot() void tst_QSocks5SocketEngine::downloadBigFileSlot() { - bytesAvailable += tmpSocket->readAll().size(); + QByteArray tmp=tmpSocket->readAll(); + int correction=tmp.indexOf((char)0,0); //skip header + if (correction==-1) correction=0; + bytesAvailable += (tmp.size()-correction); if (bytesAvailable >= 10000000) QTestEventLoop::instance().exitLoop(); } -- cgit v0.12 From fafba0367c7998ddbd66f3c2941f9313eb06435c Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Wed, 20 May 2009 15:39:59 +0200 Subject: Fix building on other platforms. The order of things in SRC_SUBDIRS is important here because src_phonon should be built before src_webkit and src_plugins because those projects might link against Phonon. This should be fixed properly when we merge into 4.6 because Phonon might depend on OpenGL for rendering to a texture hence the comment. --- src/src.pro | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/src.pro b/src/src.pro index 3e63e6e..f131e4f 100644 --- a/src/src.pro +++ b/src/src.pro @@ -23,6 +23,9 @@ win32:{ !wince*: SRC_SUBDIRS += src_tools_idc } +# TODO the following line should be between opengl and webkit when the 'symbian' block is removed +contains(QT_CONFIG, phonon): SRC_SUBDIRS += src_phonon + !symbian { contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2): SRC_SUBDIRS += src_opengl contains(QT_CONFIG, xmlpatterns): SRC_SUBDIRS += src_xmlpatterns @@ -35,8 +38,6 @@ contains(QT_CONFIG, scripttools): SRC_SUBDIRS += src_scripttools SRC_SUBDIRS += src_plugins } -contains(QT_CONFIG, phonon): SRC_SUBDIRS += src_phonon - src_s60main.subdir = $$QT_SOURCE_TREE/src/s60main src_s60main.target = sub-s60main src_winmain.subdir = $$QT_SOURCE_TREE/src/winmain -- cgit v0.12 From ce7444677bdcdb14a167f9f87c4487d0d341c314 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 20 May 2009 16:32:08 +0200 Subject: Part cache key nitpick --- src/gui/styles/qs60style.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 1e2a889..a1ede1d 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -186,7 +186,7 @@ QPixmap QS60StylePrivate::cachedPart(QS60StyleEnums::SkinParts part, { QPixmap result; const QString cacheKey = - QString::fromLatin1("S60Style: SkinParts=%1 QSize=%2|%3 SkinElementFlags=%4") + QString::fromLatin1("S60Style: SkinParts=%1 QSize=%2|%3 SkinPartFlags=%4") .arg((int)part).arg(size.width()).arg(size.height()).arg((int)flags); if (!QPixmapCache::find(cacheKey, result)) { result = QS60StylePrivate::part(part, size, flags); -- cgit v0.12 From 164d3de4329019d34b10a802be16ea35aaafc5da Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 20 May 2009 16:32:33 +0200 Subject: Fixes --- src/gui/styles/qs60style_simulated.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index 5a88f9a..f10da2b 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -204,7 +204,8 @@ QPixmap QS60StylePrivate::backgroundTexture() if (!m_backgroundValid) { result = QPixmap(); - result = part(QS60StyleEnums::SP_QsnBgScreen, QApplication::activeWindow()->size()); + const QSize size = QApplication::activeWindow()?QApplication::activeWindow()->size():QSize(100, 100); + result = part(QS60StyleEnums::SP_QsnBgScreen, size); m_backgroundValid = true; } return result; @@ -285,8 +286,10 @@ QStringList QS60Style::colorListKeys() void QS60Style::setS60Theme(const QHash &parts, const QHash, QColor> &colors) { + Q_D(QS60Style); QS60StyleModeSpecifics::m_partPictures = parts; QS60StyleModeSpecifics::m_colors = colors; + d->clearCaches(); } QT_END_NAMESPACE -- cgit v0.12 From b3bc1174f027e35ff978bd3501ee1b6fc086a8b5 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 20 May 2009 16:32:08 +0200 Subject: Part cache key nitpick --- src/gui/styles/qs60style.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 5e05dd4..9a35760 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -187,7 +187,7 @@ QPixmap QS60StylePrivate::cachedPart(QS60StyleEnums::SkinParts part, { QPixmap result; const QString cacheKey = - QString::fromLatin1("S60Style: SkinParts=%1 QSize=%2|%3 SkinElementFlags=%4") + QString::fromLatin1("S60Style: SkinParts=%1 QSize=%2|%3 SkinPartFlags=%4") .arg((int)part).arg(size.width()).arg(size.height()).arg((int)flags); if (!QPixmapCache::find(cacheKey, result)) { result = QS60StylePrivate::part(part, size, flags); -- cgit v0.12 From a064fe66f5256c7ded6f3df87f503aa0fb8e341b Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 20 May 2009 16:32:33 +0200 Subject: Fixes --- src/gui/styles/qs60style_simulated.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index 5a88f9a..f10da2b 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -204,7 +204,8 @@ QPixmap QS60StylePrivate::backgroundTexture() if (!m_backgroundValid) { result = QPixmap(); - result = part(QS60StyleEnums::SP_QsnBgScreen, QApplication::activeWindow()->size()); + const QSize size = QApplication::activeWindow()?QApplication::activeWindow()->size():QSize(100, 100); + result = part(QS60StyleEnums::SP_QsnBgScreen, size); m_backgroundValid = true; } return result; @@ -285,8 +286,10 @@ QStringList QS60Style::colorListKeys() void QS60Style::setS60Theme(const QHash &parts, const QHash, QColor> &colors) { + Q_D(QS60Style); QS60StyleModeSpecifics::m_partPictures = parts; QS60StyleModeSpecifics::m_colors = colors; + d->clearCaches(); } QT_END_NAMESPACE -- cgit v0.12 From 81780cd10a0901966a34d2805e56d106464e124d Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Wed, 20 May 2009 16:41:38 +0200 Subject: Make the range controls accessible --- src/plugins/accessible/widgets/rangecontrols.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/accessible/widgets/rangecontrols.h b/src/plugins/accessible/widgets/rangecontrols.h index aea91e1..57073ee 100644 --- a/src/plugins/accessible/widgets/rangecontrols.h +++ b/src/plugins/accessible/widgets/rangecontrols.h @@ -60,6 +60,7 @@ class QDial; #ifndef QT_NO_SPINBOX class QAccessibleAbstractSpinBox: public QAccessibleWidgetEx, public QAccessibleValueInterface { + Q_ACCESSIBLE_OBJECT public: explicit QAccessibleAbstractSpinBox(QWidget *w); @@ -132,6 +133,7 @@ protected: class QAccessibleAbstractSlider: public QAccessibleWidgetEx, public QAccessibleValueInterface { + Q_ACCESSIBLE_OBJECT public: explicit QAccessibleAbstractSlider(QWidget *w, Role r = Slider); -- cgit v0.12 From d46fd15e337421c723d56fd62582ac4ccc76395a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Wed, 20 May 2009 17:07:06 +0200 Subject: Compile on Solaris with broken GL headers. Reviewed-by: Samuel --- demos/boxes/glextensions.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/demos/boxes/glextensions.h b/demos/boxes/glextensions.h index 74617d6..7ba3b32 100644 --- a/demos/boxes/glextensions.h +++ b/demos/boxes/glextensions.h @@ -120,8 +120,11 @@ glUnmapBuffer //#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A #endif +#ifndef GL_ARB_vertex_buffer_object +typedef ptrdiff_t GLsizeiptrARB; +#endif + #ifndef GL_VERSION_1_5 -typedef ptrdiff_t GLsizeiptr; #define GL_ARRAY_BUFFER 0x8892 #define GL_ELEMENT_ARRAY_BUFFER 0x8893 #define GL_READ_WRITE 0x88BA @@ -185,7 +188,7 @@ typedef void (APIENTRY *_glTexImage3D) (GLenum, GLint, GLenum, GLsizei, GLsizei, typedef void (APIENTRY *_glGenBuffers) (GLsizei, GLuint *); typedef void (APIENTRY *_glBindBuffer) (GLenum, GLuint); -typedef void (APIENTRY *_glBufferData) (GLenum, GLsizeiptr, const GLvoid *, GLenum); +typedef void (APIENTRY *_glBufferData) (GLenum, GLsizeiptrARB, const GLvoid *, GLenum); typedef void (APIENTRY *_glDeleteBuffers) (GLsizei, const GLuint *); typedef void *(APIENTRY *_glMapBuffer) (GLenum, GLenum); typedef GLboolean (APIENTRY *_glUnmapBuffer) (GLenum); -- cgit v0.12 From 3bcc706cabb61d58d7e6c005f5268747a5e65307 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Wed, 20 May 2009 17:39:21 +0200 Subject: Fix a wrong compiler define (was a typo). The typo was in commit 30f7edc0aab629499b74263391ae529ad31b2ff8. --- src/gui/painting/qtransform.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qtransform.h b/src/gui/painting/qtransform.h index 4ea1be3..4a33969 100644 --- a/src/gui/painting/qtransform.h +++ b/src/gui/painting/qtransform.h @@ -322,7 +322,7 @@ inline QTransform &QTransform::operator-=(qreal num) # if Q_CC_GNU_VERSION >= 0x040201 # pragma GCC diagnostic warning "-Wfloat-equal" # endif -# undef Q_GCC_GNU_VERSION +# undef Q_CC_GNU_VERSION #endif /****** stream functions *******************/ -- cgit v0.12 From 56a8e78869325453010fb6c41a5e2b9e6f8f1c95 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 20 May 2009 17:56:51 +0200 Subject: Fix a compile error on MSVC 64bits due to qhash casting a pointer. I tested it with 32 bits compilation and there is no warning any more. Task-number: 247325 Reviewed-by: ogoffart --- src/corelib/tools/qhash.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index a18b531..632c422 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -97,10 +97,7 @@ Q_CORE_EXPORT uint qHash(const QBitArray &key); #endif template inline uint qHash(const T *key) { - if (sizeof(const T *) > sizeof(uint)) - return qHash(reinterpret_cast(key)); - else - return uint(reinterpret_cast(key)); + return qHash(reinterpret_cast(key)); } #if defined(Q_CC_MSVC) #pragma warning( pop ) -- cgit v0.12 From 9e5daecead75e1c7a77679a04a14cee9fd616215 Mon Sep 17 00:00:00 2001 From: Thomas Sondergaard Date: Wed, 20 May 2009 21:22:00 +0200 Subject: Danish translations --- translations/assistant_da.ts | 1134 ++++++++ translations/qt_da.ts | 6317 ++++++++++++++++++++++++++++++++++++++++++ translations/qt_help_da.ts | 354 +++ 3 files changed, 7805 insertions(+) create mode 100644 translations/assistant_da.ts create mode 100644 translations/qt_da.ts create mode 100644 translations/qt_help_da.ts diff --git a/translations/assistant_da.ts b/translations/assistant_da.ts new file mode 100644 index 0000000..d039248 --- /dev/null +++ b/translations/assistant_da.ts @@ -0,0 +1,1134 @@ + + + + + + AboutDialog + + + &Close + &Luk + + + + BookmarkDialog + + + + + + + Bookmarks + Favoritter + + + + Add Bookmark + Føj til Favoritter + + + + Bookmark: + Favorit: + + + + Add in Folder: + Føj til mappen: + + + + + + + + + + New Folder + Ny mappe + + + + Delete Folder + Slet mappe + + + + Rename Folder + Omdøb mappe + + + + BookmarkManager + + + Bookmarks + Favoritter + + + + Remove + Fjern + + + You are going to delete a Folder, this will also<br>remove it's content. Are you sure to continue? + Ved at slette denne mappe fjernes hele mappens<br>indhold. Ønsker du alligevel at slette? + + + + + New Folder + Ny mappe + + + + You are about to delete a folder which means that its content<br>will also be removed. Do you want to continue? + Ved at slette denne mappe fjernes hele mappens indhold.<br>Ønsker du alligevel at slette? + + + + BookmarkWidget + + + Remove + Fjern + + + + Delete Folder + Slet mappe + + + + Rename Folder + Omdøb mappe + + + + Show Bookmark + Vis favorit + + + + Show Bookmark in New Tab + Vis favorit pÃ¥ ny fane + + + + Delete Bookmark + Slet favorit + + + + Rename Bookmark + Omdøb favorit + + + + Search for: + Søg efter: + + + + Add + Tilføj + + + + CentralWidget + + + Add new page + Tilføj ny side + + + + Close current page + Luk nuværende side + + + + Print Document + Udskriv dokument + + + + + unknown + ukendt + + + + Add New Page + Tilføj ny side + + + + Close This Page + Luk denne side + + + + Close Other Pages + Luk de andre sider + + + + Add Bookmark for this Page... + Føj denne side til Favoritter... + + + + Search + Søg + + + + ContentWindow + + + Open Link + Ã…bn link + + + + Open Link in New Tab + Ã…bn link pÃ¥ ny fane + + + + FilterNameDialogClass + + + FilterNameDialog + FilterNavnDialog + + + + Filter Name: + Filternavn: + + + + FindWidget + + + Previous + Forrige + + + + Next + Næste + + + + Case Sensitive + Der skelnes mellem store og smÃ¥ bogstaver + + + + Whole words + Hele ord + + + + <img src="%1">&nbsp;Search wrapped + <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped + <img src="%1">&nbsp;Søgning startet forfra + + + + FontPanel + + + Font + Skrifttype + + + + &Writing system + &Skrivesystem + + + + &Family + &Familie + + + + &Style + &Stil + + + + &Point size + &Punktstørrelse + + + + HelpViewer + + + Help + Hjælp + + + + OK + + + + + <title>Error 404...</title><div align="center"><br><br><h1>The page could not be found</h1><br><h3>'%1'</h3></div> + <title>Fejl 404...</title><div align="center"><br><br><h1>Siden blev ikke fundet</h1><br><h3>'%1'</h3></div> + + + + Copy &Link Location + Kopiér &linkets placering + + + + Open Link in New Tab Ctrl+LMB + Ã…bn link pÃ¥ ny fane Ctrl+LMB + + + + Open Link in New Tab + Ã…bn link pÃ¥ ny fane + + + + <b>Page not found:<p>%1.</p></b> + <b>Kunne ikke finde siden:<p>%1.</p></b> + + + + Unable to launch external application. + + Kunne ikke starte ekstern applikation. + + + + + IndexWindow + + + &Look for: + &Søg efter: + + + + Open Link + Ã…bn link + + + + Open Link in New Tab + Ã…bn link pÃ¥ ny fane + + + + InstallDialog + + + + Install Documentation + Installér dokumentation + + + + Downloading documentation info... + Downloader dokumentationsinformation... + + + + Download canceled. + Download blev annulleret. + + + + + + Done. + Færdig. + + + + The file %1 already exists. Do you want to overwrite it? + Filen %1 findes allerede. Ønsker du at overskrive? + + + + Unable to save the file %1: %2. + Kunne ikke gemme filen %1: %2. + + + + Downloading %1... + Downloader %1... + + + + + + Download failed: %1. + Download mislykkedes: %1. + + + + Documentation info file is corrupt! + Dokumentationsinformationsfilen er ødelagt! + + + + Download failed: Downloaded file is corrupted. + Download mislykkedes: Den downloadede fil er ødelagt. + + + + Installing documentation %1... + Installerer dokumentation %1... + + + + Error while installing documentation: +%1 + Der opstod fejl under installation af dokumentation: +%1 + + + + Available Documentation: + Tilgængeligt dokumentation: + + + + Install + Installér + + + + Cancel + Annuller + + + + Close + Luk + + + + Installation Path: + Installationssti: + + + + ... + + + + + MainWindow + + + + Index + Indeks + + + + + Contents + Indhold + + + + + Bookmarks + Favoritter + + + + + Search + Søg + + + + + + Qt Assistant + + + + + + Unfiltered + Ufiltreret + + + Page Set&up... + Side&opsætning... + + + Print Preview... + Vis udskrift... + + + &Print... + &Udskriv... + + + CTRL+P + Ctrl+U + + + + New &Tab + &Ny Fane + + + CTRL+T + Ctrl+N + + + + &Close Tab + &Luk fane + + + CTRL+W + Ctrl+L + + + + &Quit + &Afslut + + + CTRL+Q + Ctrl+A + + + &Copy selected Text + &Kopiér markeret tekst + + + Ctrl+C + Ctrl+K + + + + &Find in Text... + &Find i tekst... + + + + Ctrl+F + + + + + Find &Next + Find N&æste + + + + F3 + + + + + Find &Previous + Find fo&rrige + + + + Shift+F3 + + + + + Preferences... + Indstillinger... + + + + Zoom &in + Zoom &ind + + + + Ctrl++ + + + + + Zoom &out + Zoom u&d + + + + Ctrl+- + + + + + Normal &Size + Normal &størrelse + + + + Ctrl+0 + + + + + &Home + &Hjem + + + + Ctrl+Home + + + + + &Back + &Tilbage + + + + &Forward + Fr&em + + + Sync with Table of Contents + Synkronisér med Indholdsfortegnelse + + + + Next Page + Næste side + + + + Ctrl+Alt+Right + Ctrl+Alt+Højre + + + + Previous Page + Forrige side + + + + Ctrl+Alt+Left + Ctrl+Alt+Venstre + + + + Add Bookmark... + Føj til Favoritter... + + + + About... + Om... + + + + Navigation Toolbar + Navigationsværktøjslinie + + + + Toolbars + Værktøjslinier + + + + Filter Toolbar + Filtrer værktøjslinie + + + + Filtered by: + Filtreret efter: + + + + Address Toolbar + Adresseværktøjslinie + + + + Address: + Adresse: + + + + Could not find the associated content item. + Det tilhørende indholdselement kunne ikke findes. + + + + Open Source Edition + + + + + This version of Qt Assistant is part of the Qt Open Source Edition, for use in the development of Open Source applications. Qt is a comprehensive C++ framework for cross-platform application development. + Denne version af Qt Assistant er en del af Qt Open Source Edition til brug med henblik pÃ¥ udvikling af Open Source-applikationer. Qt er et omfattende C++ framework for cross-platform applikationsudvikling. + + + + This program is licensed to you under the terms of the Qt Commercial License Agreement. For details, see the file LICENSE that came with this software distribution. + Dette program er omfattet af Qt Commercial License Agreement. Se filen LICENCE, der var vedlagt denne software-distribution, for yderligere detaljer. + + + + About %1 + Om %1 + + + + Updating search index + Opdaterer søgeindeks + + + + Looking for Qt Documentation... + Søger efter Qt-dokumentation... + + + + &Window + &Vindue + + + + Minimize + Minimér + + + + Ctrl+M + Ctrl+M + + + + Zoom + + + + + &File + &Filer + + + + &Edit + &Redigér + + + + &View + &Vis + + + + &Go + &GÃ¥ til + + + + &Bookmarks + F&avoritter + + + + &Help + &Hjælp + + + + You need a commercial Qt license for development of proprietary (closed source) applications. Please see <a href="http://trolltech.com/company/about/businessmodel">http://trolltech.com/company/about/businessmodel</a> for an overview of Qt licensing. + + + + ALT+O + Alt+F + + + CTRL+D + Ctrl+Ø + + + Ctrl+P + Ctrl+U + + + + Ctrl+T + Ctrl+N + + + + Ctrl+W + Ctrl+L + + + + Ctrl+Q + Ctrl+A + + + + Alt+C + Alt+L + + + + Alt+I + + + + + Alt+O + Alt+F + + + + Alt+S + + + + + Ctrl+D + Ctrl+Ø + + + + PreferencesDialog + + + + + Add Documentation + Tilføj dokumentation + + + + Qt Compressed Help Files (*.qch) + Qt komprimeret hjælpefil (*.qch) + + + + The specified file is not a valid Qt Help File! + Den anførte fil er ikke en gyldig Qt hjælpefil! + + + + The namespace %1 is already registered! + Navnerummet %1 er allerede registreret! + + + + Use custom settings + Benyt brugerdefineret opsætning + + + + PreferencesDialogClass + + + Preferences + Indstillinger + + + + Fonts + Skrifttyper + + + + Font settings: + Indstillinger for skrifttype: + + + + Browser + + + + + Application + Applikation + + + + Filters + Filtre + + + + Filter: + Filter: + + + + Attributes: + Attributter: + + + + 1 + + + + + Add + Tilføj + + + + + Remove + Fjern + + + + Documentation + Dokumentation + + + + Registered Documentation: + Registreret dokumentation: + + + + Add... + Tilføj... + + + + Network + Netværk + + + + Use Http Proxy + Benyt Http Proxy + + + + Http Proxy: + + + + + Port: + + + + + QObject + + + The specified collection file does not exist! + Den angivne hjælpesamling findes ikke! + + + + Missing collection file! + Hjælpesamling mangler! + + + + Invalid URL! + Ugyldig URL! + + + + Missing URL! + URL mangler! + + + + + + Unknown widget: %1 + Ukendt widget: %1 + + + + + + Missing widget! + Widget mangler! + + + + + The specified Qt help file does not exist! + Den angivne Qt-hjælpefil findes ikke! + + + + + Missing help file! + Hjælpefilen mangler! + + + + Unknown option: %1 + Ukendt parameter: %1 + + + + + Qt Assistant + + + + + Could not register documentation file +%1 + +Reason: +%2 + Kunne ikke registrere dokumentationsfil +%1 + +Ã…rsag: +%2 + + + + Documentation successfully registered. + Dokumentationen blev registreret. + + + + Could not unregister documentation file +%1 + +Reason: +%2 + Kunne ikke afregistrere dokumentationsfil +%1 + +Ã…rsag: +%2 + + + + Documentation successfully unregistered. + Dokumentationen blev afregistreret. + + + + The specified collection file could not be read! + Den angivne hjælpesamling kunne ikke læses! + + + + + Bookmark + Favorit + + + + QtDocInstaller + + + The file %1 could not be registered successfully! + +Reason: %2 + Filen %1 kunne ikke registreres! + +Ã…rsag: %2 + + + + RemoteControl + + + Debugging Remote Control + + + + + Received Command: %1 %2 + Modtaget kommando: %1 %2 + + + + SearchWidget + + + &Copy + &Kopiér + + + + Copy &Link Location + Kopiér &linkets placering + + + + + Open Link in New Tab + Ã…bn link pÃ¥ ny fane + + + + Select All + Markér alt + + + + Open Link + Ã…bn link + + + + TopicChooser + + + Choose a topic for <b>%1</b>: + Vælg et emne for <b>%1</b>: + + + + Choose Topic + Vælg emne + + + + &Topics + &Emner + + + + &Display + &Vis + + + + &Close + &Luk + + + TopicChooser + Emnevælger + + + unnamed + unavngivet + + + diff --git a/translations/qt_da.ts b/translations/qt_da.ts new file mode 100644 index 0000000..9350687 --- /dev/null +++ b/translations/qt_da.ts @@ -0,0 +1,6317 @@ + + + + + AudioOutput + + + <html>The audio playback device <b>%1</b> does not work.<br/>Falling back to <b>%2</b>.</html> + <html>Audio-playback-enheden<b>%1</b> virker ikke.<br/>Falder tilbage til <b>%2</b>.</html> + + + <html>Switching to the audio playback device <b>%1</b><br/>which just became available and has higher preference.</html> + <html>Skifter til audio-playback-enheden, <b>%1</b><br/>der lige er blevet tilgængeligt og har en højere præference.</html> + + + Revert back to device '%1' + GÃ¥ tilbage til enheden '%1' + + + + CloseButton + + + Close Tab + Luk fane + + + + Phonon:: + + + Notifications + Meddelelser + + + Music + Musik + + + Video + + + + Communication + Kommunikation + + + Games + Spil + + + Accessibility + Tilgængelighed + + + + Phonon::Gstreamer::Backend + + + Warning: You do not seem to have the package gstreamer0.10-plugins-good installed. + Some video features have been disabled. + Advarsel: Det ser ikke ud til, at gstreamer0.10-plugins-good pakken er installeret. + Nogle videofunktioner er deaktiveret. + + + Warning: You do not seem to have the base GStreamer plugins installed. + All audio and video support has been disabled + Advarsel: Det ser ikke ud til, at base GStreamer plugins er installeret. + Al audio- og videosupport er deaktiveret + + + + Phonon::Gstreamer::MediaObject + + + Cannot start playback. + +Check your Gstreamer installation and make sure you +have libgstreamer-plugins-base installed. + Kan ikke starte playback. + +Tjek Gstreamer-installationen og kontrollér, at +libgstreamer-plugins-base er installeret. + + + A required codec is missing. You need to install the following codec(s) to play this content: %0 + Der mangler et codec. Følgende codecs skal installeres for at afspille dette indhold: %0 + + + Could not open media source. + Kunne ikke Ã¥bne mediekilden. + + + Invalid source type. + Ugyldig kilde. + + + Could not locate media source. + Kunne ikke lokalisere mediekilden. + + + Could not open audio device. The device is already in use. + Kunne ikke Ã¥bne lydenheden. Enheden er allerede i brug. + + + Could not decode media source. + Kunne ikke afkode mediekilden. + + + + Phonon::VolumeSlider + + Volume: %1% + + + + Use this slider to adjust the volume. The leftmost position is 0%, the rightmost is %1% + Anvend denne skyder til at indstille lydstyrken. Længst til venstre er 0% og længst til højre er %1% + + + + Q3Accel + + + %1, %2 not defined + %1, %2 ikke definerede + + + Ambiguous %1 not handled + Tvetydig %1 ikke behandlet + + + + Q3DataTable + + + True + Sandt + + + False + Falsk + + + Insert + Indsæt + + + Update + Opdater + + + Delete + Slet + + + + Q3FileDialog + + + Copy or Move a File + Kopiér eller flyt en fil + + + Read: %1 + Læs: %1 + + + Write: %1 + Skriv: %1 + + + Cancel + Annuller + + + + All Files (*) + Alle filer (*) + + + Name + Navn + + + Size + Størrelse + + + Type + + + + Date + Dato + + + Attributes + Attributter + + + &OK + &OK + + + Look &in: + Kig &i: + + + File &name: + Fil&navn: + + + File &type: + Fil&type: + + + Back + Tilbage + + + One directory up + En mappe op + + + Create New Folder + Opret ny folder + + + List View + Listevisning + + + Detail View + Detaljevisning + + + Preview File Info + Vis filinformation + + + Preview File Contents + Vis filindhold + + + Read-write + Læs-skriv + + + Read-only + Skrivebeskyttet + + + Write-only + Write-only + + + Inaccessible + Utilgængelig + + + Symlink to File + Symlink til Fil + + + Symlink to Directory + Symlink til katalog + + + Symlink to Special + Symlink til Speciel + + + File + Fil + + + Dir + Katalog + + + Special + Speciel + + + + Open + Ã…bn + + + + Save As + Gem som + + + &Open + &Ã…bn + + + &Save + &Gem + + + &Rename + &Omdøb + + + &Delete + &Slet + + + R&eload + Gen&indlæs + + + Sort by &Name + Sortér efter n&avn + + + Sort by &Size + Sortér efter s&tørrelse + + + Sort by &Date + Sortér efter &dato + + + &Unsorted + &Usorteret + + + Sort + Sortér + + + Show &hidden files + Vis s&kjulte filer + + + the file + filen + + + the directory + kataloget + + + the symlink + symlinket + + + Delete %1 + Slet %1 + + + <qt>Are you sure you wish to delete %1 "%2"?</qt> + <qt>Er du sikker pÃ¥, at du vil slette %1 "%2"?</qt> + + + &Yes + &Ja + + + &No + &Nej + + + New Folder 1 + Ny folder 1 + + + New Folder + Ny folder + + + New Folder %1 + Ny folder %1 + + + Find Directory + Find katalog + + + Directories + Kataloger + + + Directory: + Katalog: + + + Error + Fejl + + + %1 +File not found. +Check path and filename. + %1 +Filen blev ikke fundet. +Kontrollér sti og filnavn. + + + All Files (*.*) + Alle filer (*.*) + + + Open + Ã…bn + + + Select a Directory + Vælg et katalog + + + + Q3LocalFs + + Could not read directory +%1 + Kunne ikke læse katalog +%1 + + + Could not create directory +%1 + Kunne ikke oprette katalog +%1 + + + Could not remove file or directory +%1 + Kunne ikke fjerne fil eller katalog +%1 + + + Could not rename +%1 +to +%2 + Kunne ikke omdøbe +%1 +to +%2 + + + Could not open +%1 + Kunne ikke Ã¥bne +%1 + + + Could not write +%1 + Kunne ikke skrive +%1 + + + + Q3MainWindow + + + Line up + Linie op + + + Customize... + Tilpas... + + + + Q3NetworkProtocol + + + Operation stopped by the user + Brugeren stoppede handlingen + + + + Q3ProgressDialog + + Cancel + Annuller + + + + Q3TabDialog + + OK + + + + Apply + Udfør + + + Help + Hjælp + + + Defaults + Standarder + + + Cancel + Annuller + + + + Q3TextEdit + + + &Undo + &Fortryd + + + &Redo + &Gendan + + + Cu&t + &Klip + + + &Copy + K&opiér + + + &Paste + &Sæt ind + + + Clear + Ryd + + + Select All + Markér alt + + + + Q3TitleBar + + + System + + + + Restore up + Gendan op + + + Minimize + Minimer + + + Restore down + Gendan ned + + + Maximize + Maksimér + + + Close + Luk + + + Contains commands to manipulate the window + Indeholder kommandoer til indstilling af vinduet + + + Puts a minimized back to normal + Sætter et minimeret vindue til normal størrelse + + + Moves the window out of the way + Flytter vinduet væk + + + Puts a maximized window back to normal + Sætter et maksimeret vindue til normal størrelse + + + Makes the window full screen + Gør vinduet til fuld skærm + + + Closes the window + Lukker vinduet + + + Displays the name of the window and contains controls to manipulate it + Viser vinduets navn og indeholder kontroller til indstilling af vinduet + + + + Q3ToolBar + + + More... + Mere... + + + + Q3UrlOperator + + The protocol `%1' is not supported + Protokollen '%1' understøttes ikke + + + The protocol `%1' does not support listing directories + Protokollen '%1' understøtter ikke opremsning af kataloger + + + The protocol `%1' does not support creating new directories + Protokollen '%1' understøtter ikke oprettelse af nye kataloger + + + The protocol `%1' does not support removing files or directories + Protokollen '%1' understøtter ikke, at filer eller kataloger fjernes + + + The protocol `%1' does not support renaming files or directories + Protokollen '%1' understøtter ikke, at filer eller kataloger omdøbes + + + The protocol `%1' does not support getting files + Protokollen '%1' understøtter ikke hentning af filer + + + The protocol `%1' does not support putting files + Protokollen '%1' understøtter ikke upload af filer + + + The protocol `%1' does not support copying or moving files or directories + Protokollen '%1' understøtter ikke kopiering eller flytning af filer eller kataloger + + + (unknown) + (ukendt) + + + + Q3Wizard + + + &Cancel + &Annuller + + + < &Back + < &Tilbage + + + &Next > + &Næste > + + + &Finish + &Udfør + + + &Help + &Hjælp + + + + QAbstractSocket + + Host not found + Host blev ikke fundet + + + + Connection refused + Forbindelse afvist + + + Connection timed out + Forbindelsen timed out + + + Operation on socket is not supported + Socket-operation ikke understøttet + + + Socket operation timed out + Socket-operation timed out + + + Socket is not connected + Socket ikke forbundet + + + Network unreachable + Netværket er ikke tilgængeligt + + + + QAbstractSpinBox + + + &Step up + &Trin op + + + Step &down + Trin &ned + + + &Select All + &Vælg alle + + + + QApplication + + + Activate + Aktivér + + + + Executable '%1' requires Qt %2, found Qt %3. + Eksekverbar '%1' kræver Qt %2, ikke fundet Qt %3. + + + Incompatible Qt Library Error + Inkompatibel Qt Library fejl + + + + QT_LAYOUT_DIRECTION + Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. + + + + + Activates the program's main window + Aktiverer programmets hovedvindue + + + + QAxSelect + + Select ActiveX Control + Vælg ActiveX-kontrol + + + OK + + + + &Cancel + &Annuller + + + COM &Object: + COM &Objekt: + + + + QCheckBox + + + Uncheck + Fjern markering + + + Check + Kryds af + + + Toggle + SlÃ¥ til/fra + + + + QColorDialog + + + Hu&e: + Ton&e: + + + &Sat: + &Mæt: + + + &Val: + &Vær: + + + &Red: + &Rød: + + + &Green: + &Grøn: + + + Bl&ue: + Bl&Ã¥: + + + A&lpha channel: + Al&fa-kanal: + + + Select Color + Vælg farve + + + &Basic colors + &Basisfarver + + + &Custom colors + &Egne farver + + + &Add to Custom Colors + &Føj til egne farver + + + + QComboBox + + Open + Ã…bn + + + + False + Falsk + + + True + Sandt + + + + Close + Luk + + + + QCoreApplication + + + %1: key is empty + QSystemSemaphore + %1: nøgle er tom + + + %1: unable to make key + QSystemSemaphore + %1: kunne ikke lave nøgle + + + %1: ftok failed + QSystemSemaphore + %1: ftok mislykkedes + + + + QDB2Driver + + + Unable to connect + Kunne ikke skabe forbindelse + + + Unable to commit transaction + Kunne ikke gennemføre transaktion + + + Unable to rollback transaction + Kunne ikke tilbagetrække transaktion + + + Unable to set autocommit + Kunne ikke aktivere autocommit + + + + QDB2Result + + Unable to execute statement + Kunne ikke udføre statement + + + Unable to prepare statement + Kunne ikke forberede udsagn + + + Unable to bind variable + Kunne ikke binde variabel + + + Unable to fetch record %1 + Kunne ikke hente post %1 + + + Unable to fetch next + Kunne ikke hente næste + + + Unable to fetch first + Kunne ikke hente første + + + + QDateTimeEdit + + + AM + + + + am + + + + PM + + + + pm + + + + + QDial + + + QDial + + + + SpeedoMeter + Speedometer + + + SliderHandle + + + + + QDialog + + + What's This? + Hvad er dette? + + + Done + Udført + + + + QDialogButtonBox + + + OK + + + + + &OK + + + + &Save + &Gem + + + Save + Gem + + + Open + Ã…bn + + + &Cancel + &Annuller + + + Cancel + Annuller + + + &Close + &Luk + + + Close + Luk + + + Apply + Udfør + + + Reset + Nulstil + + + Help + Hjælp + + + Don't Save + Gem ikke + + + Discard + Kassér + + + &Yes + &Ja + + + Yes to &All + Ja til &alle + + + &No + &Nej + + + N&o to All + Ne&j til alle + + + Save All + Gem alle + + + Abort + Afbryd + + + Retry + Prøv igen + + + Ignore + Ignorer + + + Restore Defaults + Gendan standardværdier + + + Close without Saving + Luk uden at gemme + + + + QDirModel + + + Name + Navn + + + Size + Størrelse + + + Kind + Match OS X Finder + Type + + + Type + All other platforms + + + + Date Modified + Ændringsdato + + + + QDockWidget + + + Close + Luk + + + Dock + LÃ¥st + + + Float + Flydende + + + + QDoubleSpinBox + + More + Mere + + + Less + Mindre + + + + QErrorMessage + + + Debug Message: + Debug-besked: + + + Warning: + Advarsel: + + + Fatal Error: + Fatal fejl: + + + &Show this message again + &Vis denne besked igen + + + &OK + + + + + QFile + + Destination file exists + Destinationsfil findes + + + Cannot open %1 for input + Kan ikke Ã¥bne %1 til input + + + Cannot open for output + Kan ikke Ã¥bne til output + + + Failure to write block + Kunne ikke skrive blok + + + Cannot create %1 for output + Kunne ikke oprette %1 til output + + + + QFileDialog + + All Files (*) + Alle filer (*) + + + Directories + Kataloger + + + &Open + &Ã…bn + + + &Save + &Gem + + + Open + Ã…bn + + + %1 already exists. +Do you want to replace it? + %1 findes allerede. +Ønsker du at erstatte den? + + + %1 +File not found. +Please verify the correct file name was given. + %1 +Filen kunne ikke findes. +Kontrollér, at det rigtige filnavn er indtastet. + + + + My Computer + Min computer + + + &Rename + &Omdøb + + + &Delete + &Slet + + + Show &hidden files + Vis s&kjulte filer + + + Back + Tilbage + + + Parent Directory + Ovenliggende katalog + + + List View + Listevisning + + + Detail View + Detaljevisning + + + Files of type: + Filer af typen: + + + Directory: + Katalog: + + + %1 +Directory not found. +Please verify the correct directory name was given. + %1 +Katalog kunne ikke findes. +Kontrollér, at det rigtige katalognavn er indtastet. + + + '%1' is write protected. +Do you want to delete it anyway? + '%1' er skrivebeskyttet. +Ønsker du alligevel at slette? + + + Are sure you want to delete '%1'? + Er du sikker pÃ¥, at '%1' skal slettes? + + + Could not delete directory. + Kunne ikke slette kataloget. + + + Recent Places + Aktuelle steder + + + + All Files (*.*) + Alle filer (*.*) + + + Save As + Gem som + + + + Drive + Drev + + + File + Fil + + + Unknown + Ukendt + + + Find Directory + Find katalog + + + Show + Vis + + + Forward + Frem + + + + New Folder + Ny folder + + + &New Folder + &Ny folder + + + &Choose + &Vælg + + + + Remove + Fjern + + + File &name: + &Filnavn: + + + Look in: + Søg i: + + + Create New Folder + Opret ny folder + + + + QFileSystemModel + + + Invalid filename + Ugyldigt filnavn + + + <b>The name "%1" can not be used.</b><p>Try using another name, with fewer characters or no punctuations marks. + <b>Navnet, %1, kan ikke benyttes.</b><p>Brug et andet navn med færre tegn og ingen kommatering. + + + Name + Navn + + + Size + Størrelse + + + Kind + Match OS X Finder + Type + + + Type + All other platforms + + + + Date Modified + Ændringsdato + + + + My Computer + Min computer + + + Computer + + + + %1 TB + %1 TB + + + %1 GB + %1 GB + + + %1 MB + %1 MB + + + %1 KB + %1 KB' + + + %1 bytes + %1 bytes + + + + QFontDatabase + + Normal + + + + Bold + Fed + + + Demi Bold + + + + Black + Sort + + + Demi + + + + Light + Lys + + + Italic + Kursiv + + + Oblique + SkrÃ¥t + + + Any + Alle + + + Latin + + + + Greek + Græsk + + + Cyrillic + Kyrillisk + + + Armenian + Armensk + + + Hebrew + Hebræisk + + + Arabic + Arabisk + + + Syriac + Syrisk + + + Thaana + + + + Devanagari + + + + Bengali + Bengalsk + + + Gurmukhi + + + + Gujarati + + + + Oriya + + + + Tamil + + + + Telugu + + + + Kannada + + + + Malayalam + + + + Sinhala + + + + Thai + Thailandsk + + + Lao + + + + Tibetan + Tibetansk + + + Myanmar + + + + Georgian + georgisk + + + Khmer + + + + Simplified Chinese + Forenklet kinesisk + + + Traditional Chinese + Traditionelt kinesisk + + + Japanese + Japansk + + + Korean + Koreansk + + + Vietnamese + Vietnamesisk + + + Symbol + + + + Ogham + + + + Runic + + + + + QFontDialog + + + &Font + S&krifttype + + + Font st&yle + S&til + + + &Size + &Størrelse + + + Effects + Effekter + + + Stri&keout + &Overstreget + + + &Underline + &Understreg + + + Sample + Eksempel + + + Wr&iting System + Skr&ivesystem + + + Select Font + Vælg skrifttype + + + + QFtp + + + Not connected + Ingen forbindelse + + + + Host %1 not found + Vært %1 ikke fundet + + + + Connection refused to host %1 + Forbindelse til vært %1 afvist + + + Connection timed out to host %1 + Forbindelsen timed out til host %1 + + + Connected to host %1 + Tilsluttet vært %1 + + + Connection refused for data connection + Dataforbindelse afvist + + + Unknown error + Ukendt fejl + + + + Connecting to host failed: +%1 + Forbindelse til vært mislykkedes: +%1 + + + + Login failed: +%1 + Login mislykkedes: +%1 + + + + Listing directory failed: +%1 + Opremsning af katalogindhold mislykkedes: +%1 + + + + Changing directory failed: +%1 + Ændring af katalog mislykkedes: +%1 + + + + Downloading file failed: +%1 + Downloading af fil mislykkedes: +%1 + + + + Uploading file failed: +%1 + Uploading af fil mislykkedes: +%1 + + + + Removing file failed: +%1 + Det mislykkedes at fjerne fil: +%1 + + + + Creating directory failed: +%1 + Oprettelse af katalog mislykkedes: +%1 + + + + Removing directory failed: +%1 + Det mislykkedes at fjerne katalog: +%1 + + + Connection closed + Forbindelse lukket + + + Host %1 found + Vært %1 fundet + + + Connection to %1 closed + Forbindelse til %1 lukket + + + Host found + Vært fundet + + + Connected to host + Tilsluttet vært + + + + QHostInfo + + + Unknown error + Ukendt fejl + + + + QHostInfoAgent + + Host not found + Vært ikke fundet + + + Unknown address type + Ukendt adressetype + + + Unknown error + Ukendt fejl + + + + QHttp + + Unknown error + Ukendt fejl + + + Request aborted + Forespørgsel blev annulleret + + + + No server set to connect to + Ingen server at forbinde til + + + + Wrong content length + Forkert indholdslængde + + + + Server closed connection unexpectedly + Serveren afsluttede uventet forbindelsen + + + Error writing response to device + Skrivefejl mens der blev skrevet til enheden + + + + Connection refused + Forbindelse afvist + + + + Host %1 not found + Vært %1 ikke fundet + + + + HTTP request failed + HTTP anmodning mislykkedes + + + + Invalid HTTP response header + Ugyldig HTTP-svar-header + + + Invalid HTTP chunked body + Ugyldig HTTP chunked body + + + + Host %1 found + Vært %1 fundet + + + Connected to host %1 + Tilsluttet vært %1 + + + Connection to %1 closed + Forbindelse til %1 lukket + + + Host found + Vært fundet + + + Connected to host + Tilsluttet vært + + + + Connection closed + Forbindelse lukket + + + Proxy authentication required + Kræver proxy-autentificering + + + Authentication required + Autentificering pÃ¥krævet + + + Connection refused (or timed out) + Forbindelse blev afvist (eller tid udløb) + + + + Proxy requires authentication + Proxy kræver autentificering + + + Host requires authentication + Vært kræver autentificering + + + Data corrupted + Data er ødelagt + + + Unknown protocol specified + En ukendt protokol blev angivet + + + SSL handshake failed + SSL handshake mislykkedes + + + HTTPS connection requested but SSL support not compiled in + Der blevet anmodet om en HTTPS-forbindelse, men SSL understøttelse er ikke kompileret ind + + + + QHttpSocketEngine + + Did not receive HTTP response from proxy + Modtog ikke HTTP-svar fra proxy + + + Error parsing authentication request from proxy + Fejl under fortolking af autentificeringsanmodning fra proxy + + + Authentication required + Autentificering pÃ¥krævet + + + Proxy denied connection + Proxy nægtede forbindelse + + + Error communicating with HTTP proxy + Fejl under kommunikation med HTTP-proxy + + + Proxy server not found + Proxy-server kunne ikke findes + + + Proxy connection refused + Proxy-forbindelse nægtede + + + Proxy server connection timed out + Proxy-serverforbindelse timed out + + + Proxy connection closed prematurely + Proxy-forbindelse afsluttede i utide + + + + QIBaseDriver + + + Error opening database + Der opstod fejl ved Ã¥bning af database + + + Could not start transaction + Kunne ikke pÃ¥begynde transaktionen + + + Unable to commit transaction + Kunne ikke gennemføre transaktionen + + + Unable to rollback transaction + Kunne ikke tilbagetrække transaktionen + + + + QIBaseResult + + Unable to create BLOB + Kunne ikke oprette BLOB + + + Unable to write BLOB + Kunne ikke skrive BLOB + + + Unable to open BLOB + Kunne ikke Ã¥bne BLOB + + + Unable to read BLOB + Kunne ikke læse BLOB + + + Could not find array + Kunne ikke finde array + + + Could not get array data + Kunne ikke hente arraydata + + + Could not get query info + Kunne ikke hente forespørgselsinfo + + + Could not start transaction + Kunne ikke pÃ¥begynde transaktionen + + + Unable to commit transaction + Kunne ikke gennemføre transaktionen + + + Could not allocate statement + Kunne ikke allokere statement + + + Could not prepare statement + Kunne ikke forberede udsagn + + + Could not describe input statement + Kunne ikke beskrive input-statement + + + Could not describe statement + Kunne ikke beskrive statement + + + Unable to close statement + Kunne ikke lukke udsagn + + + Unable to execute query + Kunne ikke udføre forespørgsel + + + Could not fetch next item + Kunne ikke hente næste element + + + Could not get statement info + Kunne ikke hente udsagnsinformation + + + + QIODevice + + + Permission denied + Tilladelse nægtet + + + Too many open files + Der er for mange Ã¥bne filer + + + No such file or directory + Fil eller katalog findes ikke + + + No space left on device + Ingen plads tilbage pÃ¥ enheden + + + + Unknown error + Ukendt fejl + + + + QInputContext + + + XIM + + + + XIM input method + XIM input-metode + + + Windows input method + Windows input-metode + + + Mac OS X input method + Mac OS X input-metode + + + + QInputDialog + + + Enter a value: + Indtast en værdi: + + + + QLibrary + + + Could not mmap '%1': %2 + + + + Plugin verification data mismatch in '%1' + Plugin-verifikationsdata er sat forkert sammen i '%1' + + + Could not unmap '%1': %2 + Der var ikke muligt at lave unmap pÃ¥ '%1': %2 + + + The plugin '%1' uses incompatible Qt library. (%2.%3.%4) [%5] + Plugin '%1' bruger inkompatibelt Qt-bibliotek. (%2.%3.%4) [%5] + + + The plugin '%1' uses incompatible Qt library. Expected build key "%2", got "%3" + Plugin '%1' bruger inkompatibelt Qt-bibliotek. Forventet build key "%2", hentede "%3"' + + + Unknown error + Ukendt fejl' + + + + The shared library was not found. + DSO blev ikke fundet. + + + The file '%1' is not a valid Qt plugin. + Filen '%1' er ikke et gyldigt Qt-plugin. + + + The plugin '%1' uses incompatible Qt library. (Cannot mix debug and release libraries.) + Plugin '%1' bruger inkompatibelt Qt-bibliotek. (Ikke muligt at mikse debug og release-biblioteker) + + + + Cannot load library %1: %2 + Kan ikke indlæse bibliotek %1: %2 + + + + Cannot unload library %1: %2 + Kan ikke afregistrere bibliotek %1: %2 + + + + Cannot resolve symbol "%1" in %2: %3 + Kan ikke løse symbol "%1" i %2: %3 + + + + QLineEdit + + + &Undo + &Fortryd + + + &Redo + &Gendan + + + Cu&t + K&lip + + + &Copy + &Kopiér + + + &Paste + &Sæt ind + + + Delete + Slet + + + Select All + Markér alt + + + + QLocalServer + + + %1: Name error + %1: Navnefejl + + + %1: Permission denied + %1: Tilladelse nægtet + + + %1: Address in use + %1: Adresse i brug + + + + %1: Unknown error %2 + %1: Ukendt fejl %2 + + + + QLocalSocket + + + %1: Connection refused + %1: Forbindelse afvist + + + + %1: Remote closed + %1: Den anden ende lukkede + + + %1: Invalid name + %1: Ugyldigt navn + + + + %1: Socket access error + %1: Fejl i socket-adgang + + + + %1: Socket resource error + %1: Fejl i socket-ressource + + + + %1: Socket operation timed out + %1: Socket-handling timed out + + + + %1: Datagram too large + %1: Datagram er for stort + + + %1: Connection error + %1: Forbindelsesfejl + + + + %1: The socket operation is not supported + %1: Socket-handlingen understøttes ikke + + + %1: Unknown error + %1: Ukendt fejl + + + + %1: Unknown error %2 + %1: Ukendt fejl %2 + + + + QMYSQLDriver + + + Unable to open database ' + Kunne ikke Ã¥bne databasen ' + + + Unable to connect + Kunne ikke forbinde + + + Unable to begin transaction + Kunne ikke pÃ¥begynde transaktionen + + + Unable to commit transaction + Kunne ikke gennemføre transaktionen + + + Unable to rollback transaction + Kunne ikke tilbagetrække transaktionen + + + + QMYSQLResult + + Unable to fetch data + Kunne ikke hente data + + + Unable to execute query + Kunne ikke udføre forespørgsel + + + Unable to store result + Kunne ikke gemme resultatet + + + Unable to prepare statement + Kunne ikke forberede udsagn + + + Unable to reset statement + Kunne ikke nulstille udsagn + + + Unable to bind value + Kunne ikke tildele værdi + + + Unable to execute statement + Kunne ikke udføre udsagn + + + Unable to bind outvalues + Kunne ikke binde udværdier + + + Unable to store statement results + Kunne ikke gemme udsagnsresultater + + + Unable to execute next query + Kunne ikke udføre næste forespørgsel + + + Unable to store next result + Kunne ikke gemme næste resultat + + + + QMdiArea + + + (Untitled) + (Uden titel) + + + + QMdiSubWindow + + + %1 - [%2] + + + + Close + Luk + + + Minimize + Minimér + + + Restore Down + Gendan Ned + + + &Restore + &Gendan + + + &Move + &Flyt + + + &Size + &Størrelse + + + Mi&nimize + Mi&nimér + + + Ma&ximize + Ma&ksimér + + + Stay on &Top + Bliv &oppe + + + &Close + &Luk + + + - [%1] + + + + Maximize + Maksimér + + + Unshade + Fjern skygge + + + Shade + Skygge + + + Restore + Gendan + + + Help + Hjælp + + + Menu + + + + + QMenu + + Close + Luk + + + Open + Ã…bn + + + Execute + Udfør + + + + QMessageBox + + Help + Hjælp + + + OK + + + + About Qt + Om Qt + + + <p>This program uses Qt version %1.</p> + <p>Dette program bruger Qt-version %1.</p> + + + Show Details... + Vis detaljer... + + + Hide Details... + Skjul detaljer... + + + <h3>About Qt</h3>%1<p>Qt is a C++ toolkit for cross-platform application development.</p><p>Qt provides single-source portability across MS&nbsp;Windows, Mac&nbsp;OS&nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.</p><p>Qt is a Nokia product. See <a href="http://qtsoftware.com/qt/">qtsoftware.com/qt/</a> for more information.</p> + <h3>Om Qt</h3>%1<p>Qt er et C++ toolkit til cross-platform applikationsudvikling.</p><p>Qt tilbyder single-source portabilitet til MS&nbsp;Windows, Mac&nbsp;OS&nbsp;X, Linux, og alle større kommercielle Unix-varianter. Qt er ogsÃ¥ tilgængeligt til indlejrede systemer som Qt for Embedded Linux and Qt for Windows CE.</p><p>Qt er et Nokia produkt. Se <a href="http://qtsoftware.com/qt/">qtsoftware.com/qt/</a> for yderligere information.</p> + + + <p>This program uses Qt Open Source Edition version %1.</p><p>Qt Open Source Edition is intended for the development of Open Source applications. You need a commercial Qt license for development of proprietary (closed source) applications.</p><p>Please see <a href="http://qtsoftware.com/company/model/">qtsoftware.com/company/model/</a> for an overview of Qt licensing.</p> + <p>Dette program bruger Qt Open Source Edition version %1.</p><p>Qt Open Source Edition er beregnet til udvikling af Open Source applikationer. En kommerciel Qt licens er nødvendig til udvikling af proprietære (lukket sourcekode) applikationer.</p><p>Se venligst <a href="http://qtsoftware.com/company/model/">qtsoftware.com/company/model/</a> for et overblik over Qt licensforhold.</p> + + + + QMultiInputContext + + + Select IM + Markér IM + + + + QMultiInputContextPlugin + + + Multiple input method switcher + Multiple input metode-switcher + + + Multiple input method switcher that uses the context menu of the text widgets + Multiple input metode-switcher, der benytter tekstkontrollernes kontekstmenuer + + + + QNativeSocketEngine + + + The remote host closed the connection + Fjern-hosten lukkede forbindelsen + + + Network operation timed out + Netværksoperationen timed out + + + Out of resources + Ikke flere ressourcer + + + Unsupported socket operation + Socket-operation ikke understøttet + + + Protocol type not supported + Protokoltypen understøttes ikke + + + Invalid socket descriptor + Ugyldig socket-deskriptor + + + Network unreachable + Netværket er ikke tilgængeligt + + + Permission denied + Tilladelse nægtet + + + Connection timed out + Forbindelsen timed out + + + Connection refused + Forbindelse afvist + + + The bound address is already in use + Den bundne adresse er allerede i brug + + + The address is not available + Adressen er ikke tilgængelig + + + The address is protected + Adressen er beskyttet + + + Unable to send a message + Kunne ikke sende en besked + + + Unable to receive a message + Kunne ikke modtage en besked + + + Unable to write + Kunne ikke skrive + + + Network error + Netværksfejl + + + Another socket is already listening on the same port + En anden socket lytter allerede pÃ¥ samme port + + + Unable to initialize non-blocking socket + Kunne ikke initialisere non-blocking socket + + + Unable to initialize broadcast socket + Kunne ikke initialisere broadcast-socket + + + Attempt to use IPv6 socket on a platform with no IPv6 support + Forsøg pÃ¥ at bruge IPv6-socket pÃ¥ en platform uden IPv6-support + + + Host unreachable + Vært er ikke tilgængelig + + + Datagram was too large to send + Datagrammet var for stort til at blive sendt + + + Operation on non-socket + Handling pÃ¥ non-socket + + + Unknown error + Ukendt fejl + + + The proxy type is invalid for this operation + Proxytypen er ugyldig til denne handling + + + + QNetworkAccessCacheBackend + + + Error opening %1 + Der opstod fejl i at Ã¥bne %1 + + + + QNetworkAccessFileBackend + + + Request for opening non-local file %1 + Anmodning om at Ã¥bne ikke-lokal fil %1 + + + Error opening %1: %2 + Der opstod fejl i at Ã¥bne %1: %2 + + + Write error writing to %1: %2 + Skrivefejl mens der blev skrevet til %1: %2 + + + Cannot open %1: Path is a directory + Kan ikke Ã¥bne %1: Stien er et katalog + + + Read error reading from %1: %2 + Læsefejl mens der blev læst fra %1: %2 + + + + QNetworkAccessFtpBackend + + + No suitable proxy found + Ingen passende proxy blev fundet + + + Cannot open %1: is a directory + Kan ikke Ã¥bne %1: Er et katalog + + + Logging in to %1 failed: authentication required + Der opstod fejl i at logge pÃ¥ %1: Autentificering kræves + + + Error while downloading %1: %2 + Der opstod fejl i at downloade %1: %2 + + + Error while uploading %1: %2 + Der opstod fejl i at uploade %1: %2 + + + + QNetworkAccessHttpBackend + + + No suitable proxy found + Ingen passende proxy blev fundet + + + + QNetworkReply + + Error downloading %1 - server replied: %2 + Der opstod fejl i at downloade %1 - serveren svarede: %2 + + + + Protocol "%1" is unknown + Protokollen "%1" er ukendt + + + + QNetworkReplyImpl + + Operation canceled + Handling blev annulleret + + + + QOCIDriver + + + Unable to logon + Kunne ikke logge pÃ¥ + + + Unable to initialize + QOCIDriver + Kunne ikke initialisere + + + Unable to begin transaction + Kunne ikke pÃ¥begynde transaktionen + + + Unable to commit transaction + Kunne ikke gennemføre transaktionen + + + Unable to rollback transaction + Kunne ikke tilbagetrække transaktionen + + + + QOCIResult + + Unable to bind column for batch execute + Kunne ikke tildele kolonne til batch-udførsel + + + Unable to execute batch statement + Kunne ikke udføre batch-udsagn + + + Unable to goto next + Kunne ikke gÃ¥ til den næste + + + Unable to alloc statement + Kunne ikke allokere udsagn + + + Unable to prepare statement + Kunne ikke forberede udsagn + + + Unable to bind value + Kunne ikke tildele værdi + + + Unable to execute select statement + Kunne ikke udføre det valgte udsagn + + + Unable to execute statement + Kunne ikke udføre udsagn + + + + QODBCDriver + + + Unable to connect + Kunne ikke forbinde + + + Unable to connect - Driver doesn't support all needed functionality + Kunne ikke forbinde. Driveren understøtter ikke alle de nødvendige funktionaliteter + + + Unable to disable autocommit + Kunne ikke slÃ¥ auto-udfør fra + + + Unable to commit transaction + Kunne ikke gennemføre transaktionen + + + Unable to rollback transaction + Kunne ikke tilbagetrække transaktionen + + + Unable to enable autocommit + Kunne ikke slÃ¥ auto-udfør til + + + + QODBCResult + + QODBCResult::reset: Unable to set 'SQL_CURSOR_STATIC' as statement attribute. Please check your ODBC driver configuration + QODBCResult::reset: Kunne ikke indstille 'SQL_CURSOR_STATIC' til udsagnsattribut. Kontrollér ODBC-driver-konfigurationen + + + Unable to execute statement + Kunne ikke udføre udsagn + + + Unable to fetch next + Kunne ikke hente den næste + + + Unable to prepare statement + Kunne ikke forberede udsagn + + + Unable to bind variable + Kunne ikke tildele variabel + + + Unable to fetch last + Kunne ikke hente den sidste + + + Unable to fetch + Kunne ikke hente + + + Unable to fetch first + Kunne ikke hente den første + + + Unable to fetch previous + Kunne ikke hente den forrige + + + + QObject + + + Home + Hjem + + + + Operation not supported on %1 + Handling blev ikke understøttet pÃ¥ %1 + + + Invalid URI: %1 + Ugyldig URI: %1 + + + + Write error writing to %1: %2 + Skrivefejl mens der blev skrevet til %1: %2 + + + Read error reading from %1: %2 + Læsefejl mens der blev læst fra %1: %2 + + + Socket error on %1: %2 + Socket-fejl pÃ¥ %1: %2 + + + Remote host closed the connection prematurely on %1 + Fjern-host lukkede forbindelsen for tidligt pÃ¥ %1 + + + Protocol error: packet of size 0 received + Protokolfejl: Pakke pÃ¥ størrelsen 0 modtaget + + + No host name given + Hostnavn mangler + + + + QPPDOptionsModel + + + Name + Navn + + + Value + Værdi + + + + QPSQLDriver + + + Unable to connect + Kunne ikke skabe forbindelse + + + Could not begin transaction + Kunne ikke pÃ¥begynde transaktion + + + Could not commit transaction + Kunne ikke gennemføre transaktion + + + Could not rollback transaction + Kunne ikke tilbagetrække transaktion + + + Unable to subscribe + Kunne ikke tilmelde + + + Unable to unsubscribe + Kunne ikke afmelde + + + + QPSQLResult + + Unable to create query + Kunne ikke oprette forespørgsel + + + Unable to prepare statement + Kunne ikke forberede udsagn + + + + QPageSetupWidget + + + Centimeters (cm) + Centimeter (cm) + + + Millimeters (mm) + Millimeter (mm) + + + Inches (in) + + + + Points (pt) + Point (pt) + + + Form + + + + Paper + Papir + + + Page size: + Sidestørrelse: + + + Width: + Vidde: + + + Height: + Højde: + + + Paper source: + Papirkilde: + + + Orientation + + + + Portrait + Portræt + + + Landscape + Landskab + + + Reverse landscape + Omvendt landskab + + + Reverse portrait + Omvendt portræt + + + Margins + Margener + + + top margin + Margen - øverst + + + left margin + Margen - venstre + + + right margin + Margen - højre + + + bottom margin + Margen - bund + + + + QPluginLoader + + + Unknown error + Ukendt fejl + + + The plugin was not loaded. + Plugin blev ikke indlæst. + + + + QPrintDialog + + + locally connected + lokalt forbundet + + + Aliases: %1 + Aliasser: %1 + + + unknown + Ukendt + + + + A0 (841 x 1189 mm) + + + + A1 (594 x 841 mm) + + + + A2 (420 x 594 mm) + + + + A3 (297 x 420 mm) + + + + A4 (210 x 297 mm, 8.26 x 11.7 inches) + + + + A5 (148 x 210 mm) + + + + A6 (105 x 148 mm) + + + + A7 (74 x 105 mm) + + + + A8 (52 x 74 mm) + + + + A9 (37 x 52 mm) + + + + B0 (1000 x 1414 mm) + + + + B1 (707 x 1000 mm) + + + + B2 (500 x 707 mm) + + + + B3 (353 x 500 mm) + + + + B4 (250 x 353 mm) + + + + B5 (176 x 250 mm, 6.93 x 9.84 inches) + + + + B6 (125 x 176 mm) + + + + B7 (88 x 125 mm) + + + + B8 (62 x 88 mm) + + + + B9 (44 x 62 mm) + + + + B10 (31 x 44 mm) + + + + C5E (163 x 229 mm) + + + + DLE (110 x 220 mm) + + + + Executive (7.5 x 10 inches, 191 x 254 mm) + + + + Folio (210 x 330 mm) + + + + Ledger (432 x 279 mm) + + + + Legal (8.5 x 14 inches, 216 x 356 mm) + + + + Letter (8.5 x 11 inches, 216 x 279 mm) + + + + Tabloid (279 x 432 mm) + + + + US Common #10 Envelope (105 x 241 mm) + + + + + OK + + + + Print + Udskriv + + + Print To File ... + Udskriv til fil... + + + + Print range + UdskriftsomrÃ¥de + + + Print all + Udskriv alle + + + + File %1 is not writable. +Please choose a different file name. + Filen %1 kan ikke skrives. +Vælg et andet filnavn. + + + %1 already exists. +Do you want to overwrite it? + %1 findes allerede. +Ønsker du at overskrive? + + + File exists + Fil findes + + + <qt>Do you want to overwrite it?</qt> + <qt>Ønsker du at overskrive?</qt> + + + Print selection + Udskriv markerede + + + %1 is a directory. +Please choose a different file name. + %1 er et katalog. +Vælg et andet filnavn. + + + A0 + + + + A1 + + + + A2 + + + + A3 + + + + A4 + + + + A5 + + + + A6 + + + + A7 + + + + A8 + + + + A9 + + + + B0 + + + + B1 + + + + B2 + + + + B3 + + + + B4 + + + + B5 + + + + B6 + + + + B7 + + + + B8 + + + + B9 + + + + B10 + + + + C5E + + + + DLE + + + + Executive + + + + Folio + + + + Ledger + + + + Legal + + + + Letter + + + + Tabloid + + + + US Common #10 Envelope + + + + Custom + Brugerdefineret + + + &Options >> + &Indstillinger>> + + + &Print + &Udskriv + + + &Options << + &Indstillinger<< + + + Print to File (PDF) + Udskriv til fil (PDF) + + + Print to File (Postscript) + Udskriv til fil (Postscript) + + + Local file + Lokal fil + + + Write %1 file + Skriv %1 fil + + + + The 'From' value cannot be greater than the 'To' value. + 'Fra'-værdien kan ikke være større end 'til'-værdien. + + + + QPrintPreviewDialog + + Page Setup + Sideopsætning + + + + %1% + + + + Print Preview + Vis udskrift + + + Next page + Næste side + + + Previous page + Forrige side + + + First page + Første side + + + Last page + Sidste side + + + Fit width + Tilpas bredde + + + Fit page + Tilpas siden + + + Zoom in + Zoom ind + + + Zoom out + Zoom ud + + + Portrait + Portræt + + + Landscape + Landskab + + + Show single page + Vis enkelt side + + + Show facing pages + Vis sideopslag + + + Show overview of all pages + Vis oversigt af alle sider + + + Print + Udskriv + + + Page setup + Sideopsætning + + + Close + Luk + + + Export to PDF + Eksportér til PDF + + + Export to PostScript + Eksportér til PostScript + + + + QPrintPropertiesWidget + + Form + Form + + + Page + Side + + + Advanced + Avanceret + + + + QPrintSettingsOutput + + Form + + + + Copies + Kopier + + + Print range + Udskriv sider + + + Print all + Udskriv alle + + + Pages from + Sider fra + + + to + til + + + Selection + Valg + + + Output Settings + Udskriftsindstillinger + + + Copies: + Kopier: + + + Collate + Samordne + + + Reverse + Omvendt + + + Options + Valgmuligheder + + + Color Mode + Farvetilstand + + + Color + Farve + + + Grayscale + GrÃ¥skala + + + Duplex Printing + Dobbelsidet + + + None + Ingen + + + Long side + Bog + + + Short side + Tavle + + + + QPrintWidget + + Form + + + + Printer + ' + + + &Name: + &Navn: + + + P&roperties + &Egenskaber + + + Location: + Placering: + + + Preview + Vis udskrift + + + Type: + + + + Output &file: + Udskrifts&fil: + + + ... + + + + + QProcess + + + Could not open input redirection for reading + Kunne ikke Ã¥bne input redirection for læsning + + + + Could not open output redirection for writing + Kunne ikke Ã¥bne output redirection for skrivning + + + Resource error (fork failure): %1 + Ressource fejl (fork fejl): %1 + + + Process operation timed out + Proces-operation time out + + + Error reading from process + Fejl ved læsning fra proces + + + + Error writing to process + Fejl ved skrivning til proces + + + Process crashed + Proces crashede + + + Process failed to start + Processen kunne ikke starte + + + + QProgressDialog + + + Cancel + Annuller + + + + QPushButton + + Open + Ã…bn + + + + QRadioButton + + Check + Kontrollér + + + + QRegExp + + + no error occurred + der opstod ingen fejl + + + disabled feature used + deaktiveret funktion blev brugt + + + bad char class syntax + dÃ¥rlig char class syntaks + + + bad lookahead syntax + dÃ¥rlig lookahead syntaks + + + bad repetition syntax + dÃ¥rlig gentagelsessyntaks + + + invalid octal value + ugyldigt oktal-tal + + + missing left delim + Manglende venstre delimiter + + + unexpected end + uventet afslutning + + + met internal limit + nÃ¥ede interne grænse + + + + QSQLite2Driver + + + Error to open database + Der opstod fejl ved Ã¥bning af database + + + Unable to begin transaction + Kunne ikke pÃ¥begynde transaktionen + + + Unable to commit transaction + Kunne ikke gennemføre transaktionen + + + Unable to rollback Transaction + Kunne ikke tilbagetrække transaktion + + + + QSQLite2Result + + Unable to fetch results + Kunne ikke hente resultater + + + Unable to execute statement + Kunne ikke udføre statement + + + + QSQLiteDriver + + + Error opening database + Der opstod fejl ved Ã¥bning af database + + + Error closing database + Der opstod fejl ved lukning af database + + + Unable to begin transaction + Kunne ikke pÃ¥begynde transaktionen + + + Unable to commit transaction + Kunne ikke gennemføre transaktion + + + Unable to rollback transaction + Kunne ikke tilbagetrække transaktion + + + + QSQLiteResult + + Unable to fetch row + Kunne ikke hente række + + + Unable to execute statement + Kunne ikke udføre udsagn + + + Unable to reset statement + Kunne ikke nulstille udsagn + + + Unable to bind parameters + Unable to bind parameters + + + Parameter count mismatch + Misforhold i parametertælling + + + No query + Ingen forespørgesel + + + + QScrollBar + + + Scroll here + Scroll her + + + Left edge + Venstre kant + + + Top + Øverst + + + Right edge + Højre kant + + + Bottom + Bund + + + Page left + Side venstre + + + + Page up + Side øverst + + + Page right + Side højre + + + + Page down + Side ned + + + Scroll left + Scroll til venstre + + + Scroll up + Scroll op + + + Scroll right + Scroll til højre + + + Scroll down + Scroll ned + + + Line up + Linie op + + + Position + Placering + + + Line down + Linie ned + + + + QSharedMemory + + + %1: unable to set key on lock + %1: Kunne ikke oprette nøgle + + + %1: create size is less then 0 + %1: create size is less then 0 + + + + %1: unable to lock + %1: Kunne ikke lÃ¥se + + + %1: unable to unlock + %1: Kunne ikke oprette nøgle + + + + %1: permission denied + %1: Tilladelse nægtet + + + %1: already exists + %1: Findes allerede + + + + %1: doesn't exists + %1: Findes ikke + + + + %1: out of resources + %1: Ikke flere ressourcer + + + + %1: unknown error %2 + %1: ukendt fejl %2 + + + %1: key is empty + %1: nøgle er tom + + + %1: unix key file doesn't exists + %1: Kunne ikke oprette nøgle + + + %1: ftok failed + %1: ftok mislykkedes + + + + %1: unable to make key + %1: Kunne ikke oprette nøgle + + + %1: system-imposed size restrictions + %1: System-pÃ¥lagte størrelsesrestriktioner + + + %1: not attached + %1: Ikke vedhæftet + + + %1: invalid size + %1: Ugyldig størrelse + + + %1: key error + %1: Nøglefejl + + + %1: size query failed + %1: Størrelsesforespørgsel mislykkedes + + + + QShortcut + + + Space + + + + Esc + + + + Tab + + + + Backtab + Tilbage-tabulator + + + Backspace + Tilbage + + + Return + + + + Enter + + + + Ins + + + + Del + + + + Pause + + + + Print + Udskriv + + + SysReq + + + + Home + + + + End + + + + Left + Venstre + + + Up + Op + + + Right + Højre + + + Down + Ned + + + PgUp + + + + PgDown + + + + CapsLock + ' + + + NumLock + + + + ScrollLock + + + + Menu + + + + Help + Hjælp + + + Back + Tilbage + + + Forward + Frem + + + Stop + + + + Refresh + Opdater + + + Volume Down + Lydstyrke ned + + + Volume Mute + Lydstyrke mute + + + Volume Up + Lydstyrke op + + + Bass Boost + + + + Bass Up + Bass op + + + Bass Down + Bass ned + + + Treble Up + Diskant op + + + Treble Down + Diskant ned + + + Media Play + + + + Media Stop + + + + Media Previous + Media forrige + + + Media Next + Media næste + + + Media Record + + + + Favorites + + + + Search + Søg + + + Standby + + + + Open URL + Ã…bn URL + + + Launch Mail + Start mail + + + Launch Media + Start Media + + + Launch (0) + Start (0) + + + Launch (1) + Start (1) + + + Launch (2) + Start (2) + + + Launch (3) + Start (3) + + + Launch (4) + Start (4) + + + Launch (5) + Start (5) + + + Launch (6) + Start (6) + + + Launch (7) + Start (7) + + + Launch (8) + Start (8) + + + Launch (9) + Start (9) + + + Launch (A) + Start (A) + + + Launch (B) + Start (B) + + + Launch (C) + Start (C) + + + Launch (D) + Start (D) + + + Launch (E) + Start (E) + + + Launch (F) + Start (F) + + + Print Screen + + + + Page Up + + + + Page Down + + + + Caps Lock + + + + Num Lock + + + + Number Lock + + + + Scroll Lock + + + + Insert + + + + Delete + + + + Escape + + + + System Request + + + + Select + Væg + + + Yes + Ja + + + No + Nej + + + Context1 + Kontekst1 + + + Context2 + Kontekst2 + + + Context3 + Kontekst3 + + + Context4 + Kontekst4 + + + Call + Ring til + + + Hangup + Læg pÃ¥ + + + Flip + Vend + + + Ctrl + + + + Shift + + + + Alt + + + + Meta + + + + + + + + + F%1 + + + + Home Page + Startside + + + + QSlider + + + Page left + Side venstre + + + Page up + Side op + + + Position + Placering + + + Page right + Side højre + + + Page down + Side ned + + + + QSocks5SocketEngine + + Connection to proxy refused + Proxy-forbindelse nægtede + + + Connection to proxy closed prematurely + Proxy-forbindelse afsluttede i utide + + + Proxy host not found + Proxy-host kunne ikke findes + + + Connection to proxy timed out + Proxy-serverforbindelse timed out + + + Proxy authentication failed + Proxy autentificering mislykkedes + + + Proxy authentication failed: %1 + Proxy autentificering mislykkedes: %1 + + + SOCKS version 5 protocol error + SOCKS version 5 protokolfejl + + + General SOCKSv5 server failure + General SOCKSv5 serverfejl + + + Connection not allowed by SOCKSv5 server + Forbindelse ikke tilladt a SOCKSv5-server + + + TTL expired + TTL udløbet + + + SOCKSv5 command not supported + SOCKSv5-kommando ikke understøttet + + + Address type not supported + Adressetype understøttes ikke + + + Unknown SOCKSv5 proxy error code 0x%1 + Ukendt SOCKSv5 proxy fejlkode 0x%1 + + + Network operation timed out + Netværksoperationen timed out + + + + QSpinBox + + More + Mere + + + Less + Mindre + + + + QSql + + + Delete + Slet + + + Delete this record? + Slet denne post? + + + Yes + Ja + + + No + Nej + + + Insert + Indsæt + + + Update + Opdater + + + Save edits? + Gem ændringer? + + + Cancel + Annuller + + + Confirm + Bekræft + + + Cancel your edits? + Skal dine ændringer annulleres? + + + + QSslSocket + + + Unable to write data: %1 + Kunne ikke skrive data: %1 + + + Error while reading: %1 + Der opstod en fejl under læsning af: %1 + + + Error during SSL handshake: %1 + Der opstod en fejl under SSL handshake: %1 + + + Error creating SSL context (%1) + Der opstod fejl under oprettelse af SSL-kontekst (%1) + + + Invalid or empty cipher list (%1) + Ugyldig eller tom chifferliste (%1) + + + Error creating SSL session, %1 + Der opstod fejl under oprettelse af SSL-session, %1 + + + Error creating SSL session: %1 + Der opstod fejl under oprettelse af SSL-session, %1 + + + Cannot provide a certificate with no key, %1 + Kan ikke give et certifikat uden nøgle, %1 + + + Error loading local certificate, %1 + Der opstod fejl under indlæsning af lokalt certifikat, %1 + + + Error loading private key, %1 + Der opstod fejl under indlæsning af privat nøgle, %1 + + + Private key does not certificate public key, %1 + Privat-nøgle autoriserer ikke offentlig-nøgle, %1 + + + + QSystemSemaphore + + + %1: out of resources + %1: Ikke flere ressourcer + + + + %1: permission denied + %1: Tilladelse nægtet + + + %1: already exists + %1: Findes allerede + + + %1: does not exist + %1: Findes ikke + + + + %1: unknown error %2 + %1: Ukendt fejl %2 + + + + QTDSDriver + + + Unable to open connection + Kunne ikke etablere forbindelsen + + + Unable to use database + Kunne ikke bruge databasen + + + + QTabBar + + Scroll Left + Scroll til venstre + + + Scroll Right + Scroll til højre + + + + QTcpServer + + + Operation on socket is not supported + Socket-operation ikke understøttet + + + + QTextControl + + + &Undo + &Fortryd + + + &Redo + &Gendan + + + Cu&t + K&lip + + + &Copy + &Kopiér + + + Copy &Link Location + Kopiér l&ink + + + &Paste + &Sæt ind + + + Delete + Slet + + + Select All + Markér alt + + + + QToolButton + + Press + Tryk pÃ¥ + + + Open + Ã…bn + + + + QUdpSocket + + + This platform does not support IPv6 + Denne platform understøtter ikke IPv6 + + + + QUndoGroup + + + Undo + Fortryd + + + Redo + Gendan + + + + QUndoModel + + + <empty> + <tom> + + + + QUndoStack + + + Undo + Fortryd + + + Redo + Gendan + + + + QUnicodeControlCharacterMenu + + + LRM Left-to-right mark + + + + RLM Right-to-left mark + + + + ZWJ Zero width joiner + + + + ZWNJ Zero width non-joiner + + + + ZWSP Zero width space + + + + LRE Start of left-to-right embedding + + + + RLE Start of right-to-left embedding + + + + LRO Start of left-to-right override + + + + RLO Start of right-to-left override + + + + PDF Pop directional formatting + + + + Insert Unicode control character + + + + + QWebFrame + + + Request cancelled + Anmodning annulleret + + + Request blocked + Anmodning blokeret + + + Cannot show URL + Kan ikke vise URL + + + Frame load interruped by policy change + Billedindlæsning afbrudt af ændringer i retningslinier + + + Cannot show mimetype + Kan ikke vise MIME-type + + + File does not exist + Filen findes ikke + + + + QWebPage + + + Bad HTTP request + DÃ¥rlig HTTP-anmodning + + + + Submit + default label for Submit buttons in forms on web pages + Send + + + Submit + Submit (input element) alt text for <input> elements with no alt, title, or value + Send + + + Reset + default label for Reset buttons in forms on web pages + Nulstil + + + This is a searchable index. Enter search keywords: + text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index' + Dette er et søgeindeks. Indtast søgeord: + + + Choose File + title for file button used in HTML forms + Vælg fil + + + No file selected + text to display in file button used in HTML forms when no file is selected + Der er ikke valgt en fil + + + Open in New Window + Open in New Window context menu item + Ã…bn i nyt vindue + + + Save Link... + Download Linked File context menu item + Gem link... + + + Copy Link + Copy Link context menu item + Kopiér link + + + Open Image + Open Image in New Window context menu item + Ã…bn billede + + + Save Image + Download Image context menu item + Gem billede + + + Copy Image + Copy Link context menu item + Kopiér billede + + + Open Frame + Open Frame in New Window context menu item + Ã…bn faneblad + + + Copy + Copy context menu item + Kopiér + + + Go Back + Back context menu item + GÃ¥ tilbage + + + Go Forward + Forward context menu item + GÃ¥ frem + + + Stop + Stop context menu item + Stop + + + Reload + Reload context menu item + Genindlæs + + + Cut + Cut context menu item + Klip + + + Paste + Paste context menu item + Sæt ind + + + No Guesses Found + No Guesses Found context menu item + Der er ikke fundet nogen gæt + + + Ignore + Ignore Spelling context menu item + Ignorér + + + Add To Dictionary + Learn Spelling context menu item + Tilføj til ordbog + + + Search The Web + Search The Web context menu item + Søg pÃ¥ nettet + + + Look Up In Dictionary + Look Up in Dictionary context menu item + SlÃ¥ op i ordbog + + + Open Link + Open Link context menu item + Ã…bn link + + + Ignore + Ignore Grammar context menu item + Ignorér + + + Spelling + Spelling and Grammar context sub-menu item + Stavekontrol + + + Show Spelling and Grammar + menu item title + Vis stave- og grammatikkontrol + + + Hide Spelling and Grammar + menu item title + Skjul stave- og grammatikkontrol + + + Check Spelling + Check spelling context menu item + Kør stavekontrol + + + Check Spelling While Typing + Check spelling while typing context menu item + Kør stavekontrol mens der tastes + + + Check Grammar With Spelling + Check grammar with spelling context menu item + Kør grammatikkontrol sammen med stavekontrol + + + Fonts + Font context sub-menu item + Skrifttyper + + + Bold + Bold context menu item + Fed + + + Italic + Italic context menu item + Kursiv + + + Underline + Underline context menu item + Understreget + + + Outline + Outline context menu item + Kontur + + + Direction + Writing direction context sub-menu item + Retning + + + Text Direction + Text direction context sub-menu item + Tekstretning + + + Default + Default writing direction context menu item + Standard + + + LTR + Left to Right context menu item + + + + RTL + Right to Left context menu item + + + + Inspect + Inspect Element context menu item + Inspicér + + + No recent searches + Label for only item in menu that appears when clicking on the search field image, when no searches have been performed + Ingen aktuelle søgninger + + + Recent searches + label for first item in the menu that appears when clicking on the search field image, used as embedded menu title + Aktuelle søgninger + + + Clear recent searches + menu item in Recent Searches menu that empties menu's contents + Ryd aktuelle søgninger + + + Unknown + Unknown filesize FTP directory listing item + Ukendt + + + %1 (%2x%3 pixels) + Title string for images + %1 (%2x%3 pixels) + + + + Web Inspector - %2 + Web-inspektør - %2 + + + + Scroll here + Scroll her + + + Left edge + Venstre kant + + + Top + + + + Right edge + Højre kant + + + Bottom + Bund + + + Page left + Side venstre + + + Page up + Side øverst + + + Page right + Side højre + + + Page down + Side ned + + + Scroll left + Scroll til venstre + + + Scroll up + Scroll op + + + Scroll right + Scroll til højre + + + Scroll down + Scroll ned + + + + %n file(s) + number of chosen file + + %n fil + %n filer + + + + + JavaScript Alert - %1 + JavaScript alert - %1 + + + JavaScript Confirm - %1 + JavaScript Bekræft - %1 + + + JavaScript Prompt - %1 + JavaScript Prompt - %1 + + + Move the cursor to the next character + Flyt markør til næste tegn + + + Move the cursor to the previous character + Flyt markør til forrige tegn + + + Move the cursor to the next word + Flyt markør til næste ord + + + Move the cursor to the previous word + Flyt markør til forrige ord + + + Move the cursor to the next line + Flyt markør til næste linie + + + Move the cursor to the previous line + Flyt markør til forrige linie + + + Move the cursor to the start of the line + Flyt markør til starten af linien + + + Move the cursor to the end of the line + Flyt markør til slutningen af linien + + + Move the cursor to the start of the block + Flyt markør til starten af sektionen + + + Move the cursor to the end of the block + Flyt markør til slutningen af sektionen + + + Move the cursor to the start of the document + Flyt markør til starten af dokumentet + + + Move the cursor to the end of the document + Flyt markør til slutningen af dokumentet + + + Select to the next character + Vælg til næste tegn + + + Select to the previous character + Vælg til forrige tegn + + + Select to the next word + Vælg til næste ord + + + Select to the previous word + Vælg til forrige ord + + + Select to the next line + Vælg til næste linie + + + Select to the previous line + Vælg til forrige linie + + + Select to the start of the line + Vælg til starten af linien + + + Select to the end of the line + Vælg til slutningen af linien + + + Select to the start of the block + Vælg til starten af sektionen + + + Select to the end of the block + Vælg til slutningen af sektionen + + + Select to the start of the document + Vælg til starten af dokumentet + + + Select to the end of the document + Vælg til slutningen af dokumentet + + + Delete to the start of the word + Slet til starten af ordet + + + Delete to the end of the word + Slet til slutningen af ordet + + + + QWhatsThisAction + + + What's This? + Hvad er dette? + + + + QWidget + + + * + + + + + QWizard + + + Go Back + GÃ¥ tilbage + + + Continue + Fortsæt + + + Commit + Udfør + + + Done + Færdig + + + Help + Hjælp + + + < &Back + < &Tilbage + + + &Finish + &Afslut + + + Cancel + Annuller + + + &Help + &Hjælp + + + &Next + &Næste + + + &Next > + &Næste > + + + + QWorkspace + + + &Restore + &Gendan + + + &Move + &Flyt + + + &Size + &Størrelse + + + Mi&nimize + Mi&nimér + + + Ma&ximize + Ma&ksimér + + + &Close + &Luk + + + Stay on &Top + Bliv pÃ¥ &toppen + + + Sh&ade + Sk&ygge + + + %1 - [%2] + + + + Minimize + Minimer + + + Restore Down + Gendan ned + + + Close + Luk + + + &Unshade + &Fjern skygge + + + + QXml + + + no error occurred + der opstod ingen fejl + + + error triggered by consumer + + + + unexpected end of file + uventet afslutning pÃ¥ fil + + + more than one document type definition + mere end én definition pÃ¥ dokumenttype + + + error occurred while parsing element + der opstod fejl under fortolking af element + + + tag mismatch + + + + error occurred while parsing content + der opstod fejl under fortolking af indhold + + + unexpected character + uventet tegn + + + invalid name for processing instruction + + + + version expected while reading the XML declaration + version forventet under læsning af XML-deklaration + + + wrong value for standalone declaration + + + + encoding declaration or standalone declaration expected while reading the XML declaration + + + + standalone declaration expected while reading the XML declaration + + + + error occurred while parsing document type definition + der opstod fejl under fortolking af dokumenttypedefinition + + + letter is expected + + + + error occurred while parsing comment + der opstod fejl under fortolking af kommentar + + + error occurred while parsing reference + der opstod fejl under fortolking af reference + + + internal general entity reference not allowed in DTD + + + + external parsed general entity reference not allowed in attribute value + + + + external parsed general entity reference not allowed in DTD + + + + unparsed entity reference in wrong context + ufortolket enhedsreference i forkert kontekst + + + recursive entities + + + + error in the text declaration of an external entity + fejl i tekstdeklaration pÃ¥ en ekstern enhed + + + + QXmlStream + + + Extra content at end of document. + Ekstra indhold sidst i dokumentet. + + + Invalid entity value. + Ugyldig enhedsværdi. + + + Invalid XML character. + Ugyldigt XML-tegn. + + + Sequence ']]>' not allowed in content. + Sekvens ']]>' ikke tilladt i indhold. + + + Namespace prefix '%1' not declared + Navnerumspræfiks '%1' ikke deklareret + + + Attribute redefined. + + + + Unexpected character '%1' in public id literal. + + + + Invalid XML version string. + Ugyldigt XML-versionsstreng. + + + Unsupported XML version. + XML-version understøttes ikke. + + + %1 is an invalid encoding name. + + + + Encoding %1 is unsupported + + + + Standalone accepts only yes or no. + + + + Invalid attribute in XML declaration. + + + + Premature end of document. + + + + Invalid document. + Ugyldigt dokument. + + + Expected + Forventet + + + , but got ' + , men fik ' + + + Unexpected ' + Uventet ' + + + Expected character data. + Forventet tegndata. + + + Recursive entity detected. + + + + Start tag expected. + Start-tag forventet. + + + XML declaration not at start of document. + XML-deklaration ikke i starten af dokumentet. + + + NDATA in parameter entity declaration. + + + + %1 is an invalid processing instruction name. + + + + Invalid processing instruction name. + + + + Illegal namespace declaration. + Ulovligt navnerumsdeklaration. + + + + Invalid XML name. + Ugyldigt XML-navn. + + + Opening and ending tag mismatch. + Ã…bner og afslutter tag-mismatch. + + + Reference to unparsed entity '%1'. + Reference to ufortolket enhed '%1'. + + + Entity '%1' not declared. + Enheden '%1' ikke deklareret. + + + Reference to external entity '%1' in attribute value. + Reference til ekstern enhed '%1' i attributværdi. + + + Invalid character reference. + Ugyldig tegnreference. + + + Encountered incorrectly encoded content. + + + + The standalone pseudo attribute must appear after the encoding. + + + + + %1 is an invalid PUBLIC identifier. + + + + + QtXmlPatterns + + + An %1-attribute with value %2 has already been declared. + + + + An %1-attribute must have a valid %2 as value, which %3 isn't. + + + + + Network timeout. + + + + + Element %1 can't be serialized because it appears outside the document element. + + + + + Year %1 is invalid because it begins with %2. + + + + Day %1 is outside the range %2..%3. + + + + Month %1 is outside the range %2..%3. + + + + Overflow: Can't represent date %1. + + + + Day %1 is invalid for month %2. + + + + Time 24:%1:%2.%3 is invalid. Hour is 24, but minutes, seconds, and milliseconds are not all 0; + + + + Time %1:%2:%3.%4 is invalid. + + + + Overflow: Date can't be represented. + + + + At least one component must be present. + + + + At least one time component must appear after the %1-delimiter. + + + + + No operand in an integer division, %1, can be %2. + + + + The first operand in an integer division, %1, cannot be infinity (%2). + + + + The second operand in a division, %1, cannot be zero (%2). + + + + + %1 is not a valid value of type %2. + + + + + When casting to %1 from %2, the source value cannot be %3. + + + + + Integer division (%1) by zero (%2) is undefined. + + + + Division (%1) by zero (%2) is undefined. + + + + Modulus division (%1) by zero (%2) is undefined. + + + + Dividing a value of type %1 by %2 (not-a-number) is not allowed. + + + + Dividing a value of type %1 by %2 or %3 (plus or minus zero) is not allowed. + + + + Multiplication of a value of type %1 by %2 or %3 (plus or minus infinity) is not allowed. + + + + + A value of type %1 cannot have an Effective Boolean Value. + + + + + Effective Boolean Value cannot be calculated for a sequence containing two or more atomic values. + + + + + Value %1 of type %2 exceeds maximum (%3). + + + + Value %1 of type %2 is below minimum (%3). + + + + + A value of type %1 must contain an even number of digits. The value %2 does not. + + + + %1 is not valid as a value of type %2. + + + + + Operator %1 cannot be used on type %2. + + + + Operator %1 cannot be used on atomic values of type %2 and %3. + + + + + The namespace URI in the name for a computed attribute cannot be %1. + + + + The name for a computed attribute cannot have the namespace URI %1 with the local name %2. + + + + + Type error in cast, expected %1, received %2. + + + + When casting to %1 or types derived from it, the source value must be of the same type, or it must be a string literal. Type %2 is not allowed. + + + + + No casting is possible with %1 as the target type. + + + + It is not possible to cast from %1 to %2. + + + + Casting to %1 is not possible because it is an abstract type, and can therefore never be instantiated. + + + + It's not possible to cast the value %1 of type %2 to %3 + + + + Failure when casting from %1 to %2: %3 + + + + + A comment cannot contain %1 + + + + A comment cannot end with a %1. + + + + + No comparisons can be done involving the type %1. + + + + Operator %1 is not available between atomic values of type %2 and %3. + + + + + An attribute node cannot be a child of a document node. Therefore, the attribute %1 is out of place. + + + + + A library module cannot be evaluated directly. It must be imported from a main module. + + + + No template by name %1 exists. + + + + + A value of type %1 cannot be a predicate. A predicate must have either a numeric type or an Effective Boolean Value type. + + + + A positional predicate must evaluate to a single numeric value. + + + + + The target name in a processing instruction cannot be %1 in any combination of upper and lower case. Therefore, is %2 invalid. + + + + %1 is not a valid target name in a processing instruction. It must be a %2 value, e.g. %3. + + + + + The last step in a path must contain either nodes or atomic values. It cannot be a mixture between the two. + + + + + The data of a processing instruction cannot contain the string %1 + + + + + No namespace binding exists for the prefix %1 + + + + + No namespace binding exists for the prefix %1 in %2 + + + + + %1 is an invalid %2 + + + + + %1 takes at most %n argument(s). %2 is therefore invalid. + + + + + + + %1 requires at least %n argument(s). %2 is therefore invalid. + + + + + + + + The first argument to %1 cannot be of type %2. It must be a numeric type, xs:yearMonthDuration or xs:dayTimeDuration. + + + + The first argument to %1 cannot be of type %2. It must be of type %3, %4, or %5. + + + + The second argument to %1 cannot be of type %2. It must be of type %3, %4, or %5. + + + + + %1 is not a valid XML 1.0 character. + + + + + The first argument to %1 cannot be of type %2. + + + + + If both values have zone offsets, they must have the same zone offset. %1 and %2 are not the same. + + + + + %1 was called. + + + + + %1 must be followed by %2 or %3, not at the end of the replacement string. + + + + In the replacement string, %1 must be followed by at least one digit when not escaped. + + + + In the replacement string, %1 can only be used to escape itself or %2, not %3 + + + + + %1 matches newline characters + + + + %1 and %2 match the start and end of a line. + + + + Matches are case insensitive + + + + Whitespace characters are removed, except when they appear in character classes + + + + %1 is an invalid regular expression pattern: %2 + + + + %1 is an invalid flag for regular expressions. Valid flags are: + + + + + If the first argument is the empty sequence or a zero-length string (no namespace), a prefix cannot be specified. Prefix %1 was specified. + + + + + It will not be possible to retrieve %1. + + + + + The root node of the second argument to function %1 must be a document node. %2 is not a document node. + + + + + The default collection is undefined + + + + %1 cannot be retrieved + + + + + The normalization form %1 is unsupported. The supported forms are %2, %3, %4, and %5, and none, i.e. the empty string (no normalization). + + + + + A zone offset must be in the range %1..%2 inclusive. %3 is out of range. + + + + %1 is not a whole number of minutes. + + + + + Required cardinality is %1; got cardinality %2. + + + + + The item %1 did not match the required type %2. + + + + %1 is an unknown schema type. + + + + Only one %1 declaration can occur in the query prolog. + + + + The initialization of variable %1 depends on itself + + + + No variable by name %1 exists + + + + + The variable %1 is unused + + + + + Version %1 is not supported. The supported XQuery version is 1.0. + + + + The encoding %1 is invalid. It must contain Latin characters only, must not contain whitespace, and must match the regular expression %2. + + + + No function with signature %1 is available + + + + A default namespace declaration must occur before function, variable, and option declarations. + + + + Namespace declarations must occur before function, variable, and option declarations. + + + + Module imports must occur before function, variable, and option declarations. + + + + It is not possible to redeclare prefix %1. + + + + Prefix %1 is already declared in the prolog. + + + + The name of an option must have a prefix. There is no default namespace for options. + + + + The Schema Import feature is not supported, and therefore %1 declarations cannot occur. + + + + The target namespace of a %1 cannot be empty. + + + + The module import feature is not supported + + + + No value is available for the external variable by name %1. + + + + A construct was encountered which only is allowed in XQuery. + + + + A template by name %1 has already been declared. + + + + The keyword %1 cannot occur with any other mode name. + + + + The value of attribute %1 must of type %2, which %3 isn't. + + + + The prefix %1 can not be bound. By default, it is already bound to the namespace %2. + + + + A variable by name %1 has already been declared. + + + + A stylesheet function must have a prefixed name. + + + + The namespace for a user defined function cannot be empty (try the predefined prefix %1 which exists for cases like this) + + + + The namespace %1 is reserved; therefore user defined functions may not use it. Try the predefined prefix %2, which exists for these cases. + + + + The namespace of a user defined function in a library module must be equivalent to the module namespace. In other words, it should be %1 instead of %2 + + + + A function already exists with the signature %1. + + + + No external functions are supported. All supported functions can be used directly, without first declaring them as external + + + + An argument by name %1 has already been declared. Every argument name must be unique. + + + + When function %1 is used for matching inside a pattern, the argument must be a variable reference or a string literal. + + + + In an XSL-T pattern, the first argument to function %1 must be a string literal, when used for matching. + + + + In an XSL-T pattern, the first argument to function %1 must be a literal or a variable reference, when used for matching. + + + + In an XSL-T pattern, function %1 cannot have a third argument. + + + + In an XSL-T pattern, only function %1 and %2, not %3, can be used for matching. + + + + In an XSL-T pattern, axis %1 cannot be used, only axis %2 or %3 can. + + + + %1 is an invalid template mode name. + + + + The name of a variable bound in a for-expression must be different from the positional variable. Hence, the two variables named %1 collide. + + + + The Schema Validation Feature is not supported. Hence, %1-expressions may not be used. + + + + None of the pragma expressions are supported. Therefore, a fallback expression must be present + + + + Each name of a template parameter must be unique; %1 is duplicated. + + + + The %1-axis is unsupported in XQuery + + + + %1 is not a valid name for a processing-instruction. + + + + %1 is not a valid numeric literal. + + + + No function by name %1 is available. + + + + The namespace URI cannot be the empty string when binding to a prefix, %1. + + + + %1 is an invalid namespace URI. + + + + It is not possible to bind to the prefix %1 + + + + Namespace %1 can only be bound to %2 (and it is, in either case, pre-declared). + + + + Prefix %1 can only be bound to %2 (and it is, in either case, pre-declared). + + + + Two namespace declaration attributes have the same name: %1. + + + + The namespace URI must be a constant and cannot use enclosed expressions. + + + + An attribute by name %1 has already appeared on this element. + + + + A direct element constructor is not well-formed. %1 is ended with %2. + + + + The name %1 does not refer to any schema type. + + + + %1 is an complex type. Casting to complex types is not possible. However, casting to atomic types such as %2 works. + + + + %1 is not an atomic type. Casting is only possible to atomic types. + + + + %1 is not in the in-scope attribute declarations. Note that the schema import feature is not supported. + + + + The name of an extension expression must be in a namespace. + + + + + empty + + + + zero or one + + + + exactly one + + + + one or more + + + + zero or more + + + + + Required type is %1, but %2 was found. + + + + Promoting %1 to %2 may cause loss of precision. + + + + The focus is undefined. + + + + + It's not possible to add attributes after any other kind of node. + + + + An attribute by name %1 has already been created. + + + + + Only the Unicode Codepoint Collation is supported(%1). %2 is unsupported. + + + + + Attribute %1 can't be serialized because it appears at the top level. + + + + + %1 is an unsupported encoding. + + + + %1 contains octets which are disallowed in the requested encoding %2. + + + + The codepoint %1, occurring in %2 using encoding %3, is an invalid XML character. + + + + + Ambiguous rule match. + + + + + In a namespace constructor, the value for a namespace value cannot be an empty string. + + + + The prefix must be a valid %1, which %2 is not. + + + + The prefix %1 cannot be bound. + + + + Only the prefix %1 can be bound to %2 and vice versa. + + + + + Circularity detected + + + + + The parameter %1 is required, but no corresponding %2 is supplied. + + + + The parameter %1 is passed, but no corresponding %2 exists. + + + + + The URI cannot have a fragment + + + + + Element %1 is not allowed at this location. + + + + Text nodes are not allowed at this location. + + + + Parse error: %1 + + + + The value of the XSL-T version attribute must be a value of type %1, which %2 isn't. + + + + Running an XSL-T 1.0 stylesheet with a 2.0 processor. + + + + Unknown XSL-T attribute %1. + + + + Attribute %1 and %2 are mutually exclusive. + + + + In a simplified stylesheet module, attribute %1 must be present. + + + + If element %1 has no attribute %2, it cannot have attribute %3 or %4. + + + + Element %1 must have at least one of the attributes %2 or %3. + + + + At least one mode must be specified in the %1-attribute on element %2. + + + + + Attribute %1 cannot appear on the element %2. Only the standard attributes can appear. + + + + Attribute %1 cannot appear on the element %2. Only %3 is allowed, and the standard attributes. + + + + Attribute %1 cannot appear on the element %2. Allowed is %3, %4, and the standard attributes. + + + + Attribute %1 cannot appear on the element %2. Allowed is %3, and the standard attributes. + + + + XSL-T attributes on XSL-T elements must be in the null namespace, not in the XSL-T namespace which %1 is. + + + + The attribute %1 must appear on element %2. + + + + The element with local name %1 does not exist in XSL-T. + + + + + Element %1 must come last. + + + + At least one %1-element must occur before %2. + + + + Only one %1-element can appear. + + + + At least one %1-element must occur inside %2. + + + + When attribute %1 is present on %2, a sequence constructor cannot be used. + + + + Element %1 must have either a %2-attribute or a sequence constructor. + + + + When a parameter is required, a default value cannot be supplied through a %1-attribute or a sequence constructor. + + + + Element %1 cannot have children. + + + + Element %1 cannot have a sequence constructor. + + + + The attribute %1 cannot appear on %2, when it is a child of %3. + + + + A parameter in a function cannot be declared to be a tunnel. + + + + This processor is not Schema-aware and therefore %1 cannot be used. + + + + Top level stylesheet elements must be in a non-null namespace, which %1 isn't. + + + + The value for attribute %1 on element %2 must either be %3 or %4, not %5. + + + + Attribute %1 cannot have the value %2. + + + + The attribute %1 can only appear on the first %2 element. + + + + At least one %1 element must appear as child of %2. + + + + + VolumeSlider + + + Muted + + + + Volume: %1% + Lydstyrke: %1% + + + diff --git a/translations/qt_help_da.ts b/translations/qt_help_da.ts new file mode 100644 index 0000000..0e4a362 --- /dev/null +++ b/translations/qt_help_da.ts @@ -0,0 +1,354 @@ + + + + + QCLuceneResultWidget + + + Search Results + Søgeresultater + + + + Note: + Bemærk: + + + + The search results may not be complete since the documentation is still being indexed! + Søgeresultaterne kan være ufuldstændige, fordi dokumentationen stadig indekseres! + + + + Your search did not match any documents. + Søgningen matchede ikke nogen dokumenter. + + + + (The reason for this might be that the documentation is still being indexed.) + (Ã…rsagen kan være, at dokumentationen stadig indekseres.) + + + + QHelpCollectionHandler + + + The collection file is not set up yet! + Hjælpesamlingen er ikke konfigureret endnu! + + + + Cannot open collection file: %1 + Kan ikke Ã¥bne hjælpesamlingen: %1 + + + + Cannot create tables in file %1! + Kan ikke oprette tabler i filen %1! + + + + The specified collection file already exists! + Den angivne hjælpesamling findes allerede! + + + + Cannot create directory: %1 + Kan ikke oprette kataloget: %1 + + + + Cannot copy collection file: %1 + Kan ikke kopiere hjælpesamling: %1 + + + + Unknown filter! + Ukendt filter! + + + + Cannot register filter %1! + Kan ikke registrere filteret %1! + + + + Cannot open documentation file %1! + Kan ikke Ã¥bne dokumentationsfilen %1! + + + + Invalid documentation file! + Ugyldig dokumentationsfil! + + + + The namespace %1 was not registered! + Navnerummet %1 blev ikke registreret! + + + + Namespace %1 already exists! + Navnerummet %1 findes allerede! + + + + Cannot register namespace! + Kan ikke registrere navnerummet! + + + + Cannot open database to optimize! + Kan ikke Ã¥bne den database, der skal optimeres! + + + + QHelpDBReader + + + Cannot open DB! + Kan ikke Ã¥bne DB! + + + + QHelpEngineCore + + + The specified namespace does not exist! + Det angivne navnerum findes ikke! + + + + QHelpEngineCorePrivate + + + Cannot open collection file %1! + Kan ikke Ã¥bne hjælpesamlingen %1! + + + + Cannot open documentation file %1! + Kan ikke Ã¥bne dokumentationsfilen %1! + + + + QHelpGenerator + + + Invalid help data! + Ugyldigt hjælpedata! + + + + No output file name specified! + Der er ikke anført et output-filnavn! + + + + The file %1 already exists! + Filen %1 findes allerede! + + + + Building up file structure... + Bygger filstruktur... + + + + Cannot open DB! + Kan ikke Ã¥bne DB! + + + + Cannot register namespace %1! + Kan ikke registrere navnerummet %1! + + + + Insert custom filters... + Indsæt brugerdefinerede filtre... + + + + Insert help data for filter section (%1 of %2)... + Indsæt hjælpedata til filtersektion (%1 af %2)... + + + + Documentation successfully generated. + Dokumentationen blev genereret. + + + + Some tables already exist! + Nogle af tabellerne findes allerede! + + + + Cannot create tables! + Kan ikke oprette tabeller! + + + + Cannot register virtual folder! + Kan ikke registrere virtuel mappe! + + + + Insert files... + Indsæt filer... + + + + The file %1 does not exist! Skipping it. + Filen %1 findes ikke, og den springes over. + + + + Cannot open file %1! Skipping it. + Kan ikke Ã¥bne filen %1, og den springes over. + + + + Cannot insert file data into database! + Kan ikke indsætte fildata i databasen! + + + + The filter %1 is already registered! + Filtret %1 er allerede registreret! + + + + Cannot register filter %1! + Kan ikke registrere filtret %1! + + + + Insert indices... + Indsæt indeks... + + + + Insert contents... + Indsæt indhold... + + + + Cannot insert contents! + Kan ikke indsætte indhold! + + + + Cannot register contents! + Kan ikke registrere indhold! + + + + QHelpSearchQueryWidget + + + Search for: + Søg efter: + + + + Search + Søg + + + + Advanced search + Avanceret søgning + + + + words <B>similar</B> to: + ord <B>tilsvarende</B>: + + + + <B>without</B> the words: + <B>uden</B> ordene: + + + + with <B>exact phrase</B>: + med den <B>eksakte sætning</B>: + + + + with <B>all</B> of the words: + med <B>alle</B> ordene: + + + + with <B>at least one</B> of the words: + med <B>mindst ét</B> af ordene: + + + + QHelpSearchResultWidget + + + 0 - 0 of 0 Hits + 0 - 0 af 0 Hits + + + + QHelpSearchResultWidgetPrivate + + + %1 - %2 of %3 Hits + %1 - %2 af %3 Hits + + + + QObject + + + Untitled + Ingen titel + + + + Unknown token at line %1. + Ukendt symbol pÃ¥ linie %1. + + + + Unknown token at line %1. Expected "QtHelpProject"! + Ukendt symbol pÃ¥ linie %1. Forventet "QtHelpProject"! + + + + A virtual folder must not contain a '/' character! + En virtuel mappe mÃ¥ ikke indholde tegnet '/'! + + + + A namespace must not contain a '/' character! + Et navnerum mÃ¥ ikke indeholde tegnet '/'! + + + + Missing namespace in QtHelpProject. + Navnerum i +++ mangler. + + + + Missing virtual folder in QtHelpProject + Virtuel mappe i QtHelpProject mangler + + + + Missing attribute in keyword at line %1. + Attribut i nøgleord pÃ¥ linie %1 mangler. + + + + The input file %1 could not be opened! + Input-filen %1 kunne ikke Ã¥bnes! + + + -- cgit v0.12 From d94ed47b7748826fc2b9fba774cce51a54c24880 Mon Sep 17 00:00:00 2001 From: Bill King Date: Thu, 21 May 2009 11:44:19 +1000 Subject: Fixes conditional jump on uninitialised value As found by valgrind. Also add error reporting that was missing. Reviewed-by: Justin McPherson --- src/sql/drivers/oci/qsql_oci.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/sql/drivers/oci/qsql_oci.cpp b/src/sql/drivers/oci/qsql_oci.cpp index d63c482..a7031b1 100644 --- a/src/sql/drivers/oci/qsql_oci.cpp +++ b/src/sql/drivers/oci/qsql_oci.cpp @@ -1789,7 +1789,7 @@ bool QOCIResult::prepare(const QString& query) bool QOCIResult::exec() { int r = 0; - ub2 stmtType; + ub2 stmtType=0; ub4 iters; ub4 mode; QList tmpStorage; @@ -1803,6 +1803,16 @@ bool QOCIResult::exec() OCI_ATTR_STMT_TYPE, d->err); + if (r != OCI_SUCCESS && r != OCI_SUCCESS_WITH_INFO) { + qOraWarning("QOCIResult::exec: Unable to get statement type:", d->err); + setLastError(qMakeError(QCoreApplication::translate("QOCIResult", + "Unable to get statement type"), QSqlError::StatementError, d->err)); +#ifdef QOCI_DEBUG + qDebug() << "lastQuery()" << lastQuery(); +#endif + return false; + } + if (stmtType == OCI_STMT_SELECT) { iters = 0; mode = OCI_DEFAULT; -- cgit v0.12 From 2cb36aed053147ecc91f72ed76074962a66b76f0 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Thu, 21 May 2009 14:08:02 +1000 Subject: Fix build regression caused by ba5fb9f05c891feac8ab69006189de1aaafebc18. The previous "fix" caused the effect of the line before the change to be discarded, which breaks the mac binary package builds. When reviewing changes, please read the lines of context given in the patch - they are included for a reason. Acked-by: Lincoln Ramsay Acked-by: Rohan McGovern --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 20bf457..c882b29 100755 --- a/configure +++ b/configure @@ -2717,7 +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}" + CFG_MAC_ARCHS_GCC_FORMAT="${CFG_MAC_ARCHS_GCC_FORMAT/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 7383e03bfd473f6e79718f3da7d504977a677541 Mon Sep 17 00:00:00 2001 From: Bill King Date: Thu, 21 May 2009 14:27:27 +1000 Subject: Fixes one of the fields of mysql bound params not initialised. Found by valgrind, value isn't set but is used, fixes this. Reviewed-by: Justin McPherson --- src/sql/drivers/mysql/qsql_mysql.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp index 51fc306..53645c9 100644 --- a/src/sql/drivers/mysql/qsql_mysql.cpp +++ b/src/sql/drivers/mysql/qsql_mysql.cpp @@ -927,6 +927,7 @@ bool QMYSQLResult::exec() nullVector[i] = static_cast(val.isNull()); currBind->is_null = &nullVector[i]; currBind->length = 0; + currBind->is_unsigned = 0; switch (val.type()) { case QVariant::ByteArray: @@ -973,7 +974,6 @@ bool QMYSQLResult::exec() currBind->buffer_type = MYSQL_TYPE_DOUBLE; currBind->buffer = data; currBind->buffer_length = sizeof(double); - currBind->is_unsigned = 0; break; case QVariant::LongLong: case QVariant::ULongLong: @@ -989,7 +989,6 @@ bool QMYSQLResult::exec() currBind->buffer_type = MYSQL_TYPE_STRING; currBind->buffer = const_cast(ba.constData()); currBind->buffer_length = ba.length(); - currBind->is_unsigned = 0; break; } } } -- cgit v0.12 From 0987e68043e174a2a033b58d065c6069c0cf8a1a Mon Sep 17 00:00:00 2001 From: Aleksandar Sasha Babic Date: Thu, 21 May 2009 09:14:08 +0200 Subject: Need some longer timeout values in test cases. --- tests/auto/qtcpsocket/tst_qtcpsocket.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp index da3f19a..f2ea2d9 100644 --- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp @@ -961,7 +961,11 @@ protected: { bool timedOut = false; while (!quit) { +#ifndef Q_OS_SYMBIAN if (server->waitForNewConnection(500, &timedOut)) +#else + if (server->waitForNewConnection(5000, &timedOut)) +#endif break; if (!timedOut) return; @@ -972,7 +976,7 @@ protected: #ifndef Q_OS_SYMBIAN if (socket->waitForDisconnected(500)) #else - if (socket->waitForDisconnected(1000)) + if (socket->waitForDisconnected(5000)) #endif break; if (socket->error() != QAbstractSocket::SocketTimeoutError) @@ -1024,7 +1028,7 @@ void tst_QTcpSocket::disconnectWhileConnectingNoEventLoop() #ifndef Q_OS_SYMBIAN QVERIFY2(socket->waitForDisconnected(10000), "Network timeout"); #else - QVERIFY2(socket->waitForDisconnected(20000), "Network timeout"); + QVERIFY2(socket->waitForDisconnected(30000), "Network timeout"); #endif QVERIFY(socket->state() == QAbstractSocket::UnconnectedState); if (!closeDirectly) { @@ -1035,7 +1039,7 @@ void tst_QTcpSocket::disconnectWhileConnectingNoEventLoop() delete socket; // check if the other side received everything ok - QVERIFY(thread.wait(10000)); + QVERIFY(thread.wait(30000)); QVERIFY(thread.ok); QCOMPARE(thread.receivedData, data); } @@ -1074,7 +1078,7 @@ void tst_QTcpSocket::disconnectWhileLookingUp() #ifndef Q_OS_SYMBIAN QTimer::singleShot(50, &loop, SLOT(quit())); #else - QTimer::singleShot(500, &loop, SLOT(quit())); + QTimer::singleShot(5000, &loop, SLOT(quit())); #endif loop.exec(); @@ -1321,11 +1325,19 @@ void tst_QTcpSocket::dontCloseOnTimeout() QTcpSocket *socket = newSocket(); socket->connectToHost(serverAddress, server.serverPort()); +#ifndef Q_OS_SYMBIAN QVERIFY(!socket->waitForReadyRead(100)); +#else + QVERIFY(!socket->waitForReadyRead(5000)); +#endif QCOMPARE(socket->error(), QTcpSocket::SocketTimeoutError); QVERIFY(socket->isOpen()); +#ifndef Q_OS_SYMBIAN QVERIFY(!socket->waitForDisconnected(100)); +#else + QVERIFY(!socket->waitForDisconnected(5000)); +#endif QCOMPARE(socket->error(), QTcpSocket::SocketTimeoutError); QVERIFY(socket->isOpen()); -- cgit v0.12 From 3bcec82fe724f0e6b48557d3ac4cd48fb8426696 Mon Sep 17 00:00:00 2001 From: Aleksandar Sasha Babic Date: Thu, 21 May 2009 14:46:26 +0200 Subject: Resolving some merge issues. --- tests/auto/network-settings.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/network-settings.h b/tests/auto/network-settings.h index 7204b27..88e9fb7 100644 --- a/tests/auto/network-settings.h +++ b/tests/auto/network-settings.h @@ -1,6 +1,4 @@ /**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** ** This file is part of the test suite of the Qt Toolkit. @@ -308,12 +306,14 @@ private: } #endif +/* #ifdef QT_NETWORK_LIB static QHostAddress serverIP() { return QHostInfo::fromName(serverName()).addresses().first(); } #endif +*/ }; #ifdef Q_OS_SYMBIAN -- cgit v0.12 From 1a58ac0a27c6e006b9d86827d7e4b1000f56ae38 Mon Sep 17 00:00:00 2001 From: Aleksandar Sasha Babic Date: Thu, 21 May 2009 16:40:37 +0200 Subject: Long time when waiting in test case will not help in this case. --- tests/auto/qlocalsocket/tst_qlocalsocket.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp index 5d73c98..b272716 100644 --- a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp @@ -492,11 +492,11 @@ void tst_QLocalSocket::sendData() // test creating a connection socket.connectToServer(name); bool timedOut = true; + QCOMPARE(server.waitForNewConnection(3000, &timedOut), canListen); -#if defined(QT_LOCALSOCKET_TCP) + +#if defined(QT_LOCALSOCKET_TCP) || defined(Q_OS_SYMBIAN) QTest::qWait(250); -#elif defined(Q_OS_SYMBIAN) - QTest::qWait(10000); #endif QVERIFY(!timedOut); QCOMPARE(spyConnected.count(), canListen ? 1 : 0); @@ -530,7 +530,9 @@ void tst_QLocalSocket::sendData() QCOMPARE(spyReadyRead.count(), 1); QVERIFY(testLine.startsWith(in.readLine())); + QVERIFY(wrote || serverSocket->waitForBytesWritten(1000)); + QCOMPARE(serverSocket->errorString(), QString("Unknown error")); QCOMPARE(socket.errorString(), QString("Unknown error")); } -- cgit v0.12 From 16064f14487c81ce9e75962625885bf90c958db8 Mon Sep 17 00:00:00 2001 From: Aleksandar Sasha Babic Date: Thu, 21 May 2009 18:14:08 +0200 Subject: This is ugly hack to make snedData test case in qlocalsocket to pass. This definitely has to be reviewed and changed, especially when generic problem with socket notifier and sync operations on sockets is solved. --- src/network/socket/qlocalserver.cpp | 4 ++++ src/network/socket/qlocalsocket_unix.cpp | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/network/socket/qlocalserver.cpp b/src/network/socket/qlocalserver.cpp index d6b1507..35701a7 100644 --- a/src/network/socket/qlocalserver.cpp +++ b/src/network/socket/qlocalserver.cpp @@ -276,6 +276,10 @@ QLocalSocket *QLocalServer::nextPendingConnection() if (d->pendingConnections.isEmpty()) return 0; QLocalSocket *nextSocket = d->pendingConnections.dequeue(); +#ifdef Q_OS_SYMBIAN + if(!d->socketNotifier) + return nextSocket; +#endif #ifndef Q_OS_WIN d->socketNotifier->setEnabled(d->pendingConnections.size() <= d->maxPendingConnections); diff --git a/src/network/socket/qlocalsocket_unix.cpp b/src/network/socket/qlocalsocket_unix.cpp index 2471043..9e3cbde 100644 --- a/src/network/socket/qlocalsocket_unix.cpp +++ b/src/network/socket/qlocalsocket_unix.cpp @@ -237,7 +237,7 @@ void QLocalSocket::connectToServer(const QString &name, OpenMode openMode) QLatin1String("QLocalSocket::connectToServer")); return; } - +#ifndef Q_OS_SYMBIAN // set non blocking so we can try to connect and it wont wait int flags = fcntl(d->connectingSocket, F_GETFL, 0); if (-1 == flags @@ -246,6 +246,7 @@ void QLocalSocket::connectToServer(const QString &name, OpenMode openMode) QLatin1String("QLocalSocket::connectToServer")); return; } +#endif // _q_connectToSocket does the actual connecting d->connectingName = name; -- cgit v0.12 From 4ea52386e0281700e6143e0ba946314e7dd30608 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Thu, 21 May 2009 16:03:41 -0700 Subject: Removed warning Explicitly cast to integer. Reviewed-by: Shane McLaughlin --- src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index 989a37a..a68bc8f 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -383,7 +383,7 @@ void QDirectFBPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op) { Q_D(QDirectFBPaintEngine); d->dirtyClip = true; - const QPoint bottom = d->transform.map(QPoint(0, path.controlPointRect().y2)); + const QPoint bottom = d->transform.map(QPoint(0, int(path.controlPointRect().y2))); if (bottom.y() >= d->lastLockedHeight) d->lock(); QRasterPaintEngine::clip(path, op); -- cgit v0.12 From b8232cc81efdf524820252fc519dd3547b33a1bd Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 22 May 2009 09:19:51 +0300 Subject: Removed checking for file existence from exporting sqlite3 binaries in Symbian, as SBS toolchain already contains logic for that. --- src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro index bacf23b..0574341 100644 --- a/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro +++ b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro @@ -2,7 +2,5 @@ TEMPLATE = subdirs # We just want to extract the zip file containing sqlite binaries for Symbian -!exists($${EPOCROOT}epoc32/release/armv5/urel/sqlite3.dll): { - BLD_INF_RULES.prj_exports += ":zip SQLite3_v9.2.zip" -} +BLD_INF_RULES.prj_exports += ":zip SQLite3_v9.2.zip" -- cgit v0.12 From d98d592503ea4da14b99eca54ef0c62c62bc3172 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Fri, 22 May 2009 10:09:44 +0300 Subject: Added documentation for ICON keyword in qmake-manual. Task: 250370 - ICON keyword documentation is missing --- doc/src/qmake-manual.qdoc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/src/qmake-manual.qdoc b/doc/src/qmake-manual.qdoc index ff56dad..c26d5f2 100644 --- a/doc/src/qmake-manual.qdoc +++ b/doc/src/qmake-manual.qdoc @@ -1474,7 +1474,14 @@ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 34 See also \l{#SOURCES}{SOURCES}. - + + \target ICON + \section1 ICON + + This variable is used only in MAC and S60 to set the application icon. + Please see \l{Setting the Application Icon}{the application icon documentation} + for more information. + \target INCLUDEPATH \section1 INCLUDEPATH -- cgit v0.12 From c8e632f96a942590ab9936d136dcf2f7eb17fef8 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Fri, 22 May 2009 10:01:35 +0200 Subject: configure script fix, -h should display help and not just h. Reviewed-by:cduclos --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index c882b29..32efd86 100755 --- a/configure +++ b/configure @@ -202,7 +202,7 @@ earlyArgParse() VAL=$1 fi ;; - h|help|--help|-help) + -h|help|--help|-help) if [ "$VAL" = "yes" ]; then OPT_HELP="$VAL" COMMERCIAL_USER="no" #doesn't matter we will display the help -- cgit v0.12 From 5cd9be6c2702ce1f4292003ac3e864f08a0311f3 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Fri, 22 May 2009 10:49:32 +0200 Subject: Fix toolbutton text incorrectly clipped on windows In 4.5 the toolbutton icon rendering was changed somewhat and the bottom line of text for tool buttons icons with TextUnderIcon set is incorrectly clipped on Windows. The style reserves only 5 pixels but tries to use 6 pixels for text and icon spacing, hence we adjust the text rect one pixel up. This should be safe considering the fact that we have a margin on both sides of the icon already and avoids actually moving the icon positioning. Task-number: 252554 Reviewed-by: trond --- src/gui/styles/qcommonstyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp index 3cae08a..f3d1537 100644 --- a/src/gui/styles/qcommonstyle.cpp +++ b/src/gui/styles/qcommonstyle.cpp @@ -1693,7 +1693,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, if (toolbutton->toolButtonStyle == Qt::ToolButtonTextUnderIcon) { pr.setHeight(pmSize.height() + 6); - tr.adjust(0, pr.height(), 0, -3); + tr.adjust(0, pr.height() - 1, 0, -3); pr.translate(shiftX, shiftY); if (!hasArrow) { drawItemPixmap(p, pr, Qt::AlignCenter, pm); -- cgit v0.12 From 308a105bf6ae6eb5702440728428a96b5806b085 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Fri, 22 May 2009 11:08:38 +0200 Subject: Revert "Ignore GCC warning of unsafe floating point comparisons." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 30f7edc0aab629499b74263391ae529ad31b2ff8. There is no way to restore float-equal warning using the pragma trick. This means (as it was mentioned in the said commit log) anyone that includes qtransform.h will be forced to deal with float-equal. Reviewed-by: Samuel Rødal --- src/gui/painting/qtransform.h | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/gui/painting/qtransform.h b/src/gui/painting/qtransform.h index 4a33969..c76409b 100644 --- a/src/gui/painting/qtransform.h +++ b/src/gui/painting/qtransform.h @@ -255,13 +255,6 @@ 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.) @@ -318,13 +311,6 @@ 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_CC_GNU_VERSION -#endif - /****** stream functions *******************/ Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTransform &); Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTransform &); -- cgit v0.12 From 815a8c4a297cde2b8f778c4afa36958e324f8ead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Fri, 22 May 2009 11:17:29 +0200 Subject: Fixed an issue with text drawing to QImages on Mac/Cocoa. We currently don't support subpixel hinting when drawing text to a QImage on Mac. The alpha map that is returned by the font engine is a plain 8 bit gray mask, which means we have to switch off subpixel hinting when we draw the glyph for caching. Task-number: 249178 Reviewed-by: Samuel --- src/gui/text/qfontengine_mac.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm index 425cab2..d397e4a 100644 --- a/src/gui/text/qfontengine_mac.mm +++ b/src/gui/text/qfontengine_mac.mm @@ -553,7 +553,9 @@ QImage QCoreTextFontEngine::alphaMapForGlyph(glyph_t glyph) 8, im.bytesPerLine(), colorspace, cgflags); CGContextSetFontSize(ctx, fontDef.pixelSize); - CGContextSetShouldAntialias(ctx, fontDef.pointSize > qt_antialiasing_threshold && !(fontDef.styleStrategy & QFont::NoAntialias)); + CGContextSetShouldAntialias(ctx, fontDef.pointSize > qt_antialiasing_threshold + && !(fontDef.styleStrategy & QFont::NoAntialias)); + CGContextSetShouldSmoothFonts(ctx, false); CGAffineTransform oldTextMatrix = CGContextGetTextMatrix(ctx); CGAffineTransform cgMatrix = CGAffineTransformMake(1, 0, 0, 1, 0, 0); -- cgit v0.12 From 6c1d7e57ee8d7988ab9592e4112b1f28fd1d03ce Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 4 May 2009 20:49:41 +0200 Subject: Fixed strict aliasing breaks with sockaddr_XXX structs. This case it was possible to fix by using a union of the types when we actually declare the variable. Besides, this avoids a bunch of #ifdef for IPv6 functionality. Reviewed-By: Oswald Buddenhagen --- src/network/socket/qnativesocketengine_p.h | 9 ++++ src/network/socket/qnativesocketengine_unix.cpp | 61 ++++++++----------------- 2 files changed, 29 insertions(+), 41 deletions(-) diff --git a/src/network/socket/qnativesocketengine_p.h b/src/network/socket/qnativesocketengine_p.h index 3366f2d..825c333 100644 --- a/src/network/socket/qnativesocketengine_p.h +++ b/src/network/socket/qnativesocketengine_p.h @@ -90,6 +90,15 @@ static inline int qt_socket_socket(int domain, int type, int protocol) #endif +union qt_sockaddr { + sockaddr a; + sockaddr_in a4; +#if !defined(QT_NO_IPV6) + sockaddr_in6 a6; +#endif + sockaddr_storage storage; +}; + class QNativeSocketEnginePrivate; class Q_AUTOTEST_EXPORT QNativeSocketEngine : public QAbstractSocketEngine diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp index cc372a6..2b11e8e 100644 --- a/src/network/socket/qnativesocketengine_unix.cpp +++ b/src/network/socket/qnativesocketengine_unix.cpp @@ -114,36 +114,34 @@ static void qt_ignore_sigpipe() Extracts the port and address from a sockaddr, and stores them in \a port and \a addr if they are non-null. */ -static inline void qt_socket_getPortAndAddress(struct sockaddr *sa, quint16 *port, QHostAddress *addr) +static inline void qt_socket_getPortAndAddress(const qt_sockaddr *s, quint16 *port, QHostAddress *addr) { #if !defined(QT_NO_IPV6) - if (sa->sa_family == AF_INET6) { - struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *)sa; + if (s->a.sa_family == AF_INET6) { Q_IPV6ADDR tmp; - memcpy(&tmp, &sa6->sin6_addr.s6_addr, sizeof(tmp)); + memcpy(&tmp, &s->a6.sin6_addr.s6_addr, sizeof(tmp)); if (addr) { QHostAddress tmpAddress; tmpAddress.setAddress(tmp); *addr = tmpAddress; #ifndef QT_NO_IPV6IFNAME char scopeid[IFNAMSIZ]; - if (::if_indextoname(sa6->sin6_scope_id, scopeid) > 0) { + if (::if_indextoname(s->a6.sin6_scope_id, scopeid) > 0) { addr->setScopeId(QLatin1String(scopeid)); } else #endif - addr->setScopeId(QString::number(sa6->sin6_scope_id)); + addr->setScopeId(QString::number(s->a6.sin6_scope_id)); } if (port) - *port = ntohs(sa6->sin6_port); + *port = ntohs(s->a6.sin6_port); return; } #endif - struct sockaddr_in *sa4 = (struct sockaddr_in *)sa; if (port) - *port = ntohs(sa4->sin_port); + *port = ntohs(s->a4.sin_port); if (addr) { QHostAddress tmpAddress; - tmpAddress.setAddress(ntohl(sa4->sin_addr.s_addr)); + tmpAddress.setAddress(ntohl(s->a4.sin_addr.s_addr)); *addr = tmpAddress; } } @@ -521,26 +519,16 @@ qint64 QNativeSocketEnginePrivate::nativeBytesAvailable() const bool QNativeSocketEnginePrivate::nativeHasPendingDatagrams() const { // Create a sockaddr struct and reset its port number. -#if !defined(QT_NO_IPV6) - struct sockaddr_storage storage; - sockaddr_in6 *storagePtrIPv6 = reinterpret_cast(&storage); - storagePtrIPv6->sin6_port = 0; -#else - struct sockaddr storage; -#endif - sockaddr *storagePtr = reinterpret_cast(&storage); - storagePtr->sa_family = 0; - - sockaddr_in *storagePtrIPv4 = reinterpret_cast(&storage); - storagePtrIPv4->sin_port = 0; + qt_sockaddr storage; QT_SOCKLEN_T storageSize = sizeof(storage); + memset(&storage, 0, storageSize); // Peek 0 bytes into the next message. The size of the message may // well be 0, so we can't check recvfrom's return value. ssize_t readBytes; do { char c; - readBytes = ::recvfrom(socketDescriptor, &c, 1, MSG_PEEK, storagePtr, &storageSize); + readBytes = ::recvfrom(socketDescriptor, &c, 1, MSG_PEEK, &storage.a, &storageSize); } while (readBytes == -1 && errno == EINTR); // If there's no error, or if our buffer was too small, there must be a @@ -583,11 +571,7 @@ qint64 QNativeSocketEnginePrivate::nativePendingDatagramSize() const qint64 QNativeSocketEnginePrivate::nativeReceiveDatagram(char *data, qint64 maxSize, QHostAddress *address, quint16 *port) { -#if !defined(QT_NO_IPV6) - struct sockaddr_storage aa; -#else - struct sockaddr_in aa; -#endif + qt_sockaddr aa; memset(&aa, 0, sizeof(aa)); QT_SOCKLEN_T sz; sz = sizeof(aa); @@ -596,13 +580,13 @@ qint64 QNativeSocketEnginePrivate::nativeReceiveDatagram(char *data, qint64 maxS do { char c; recvFromResult = ::recvfrom(socketDescriptor, maxSize ? data : &c, maxSize ? maxSize : 1, - 0, (struct sockaddr *)&aa, &sz); + 0, &aa.a, &sz); } while (recvFromResult == -1 && errno == EINTR); if (recvFromResult == -1) { setError(QAbstractSocket::NetworkError, ReceiveDatagramErrorString); } else if (port || address) { - qt_socket_getPortAndAddress((struct sockaddr *) &aa, port, address); + qt_socket_getPortAndAddress(&aa, port, address); } #if defined (QNATIVESOCKETENGINE_DEBUG) @@ -682,21 +666,16 @@ bool QNativeSocketEnginePrivate::fetchConnectionParameters() if (socketDescriptor == -1) return false; -#if !defined(QT_NO_IPV6) - struct sockaddr_storage sa; -#else - struct sockaddr_in sa; -#endif - struct sockaddr *sockAddrPtr = (struct sockaddr *) &sa; + qt_sockaddr sa; QT_SOCKLEN_T sockAddrSize = sizeof(sa); // Determine local address memset(&sa, 0, sizeof(sa)); - if (::getsockname(socketDescriptor, sockAddrPtr, &sockAddrSize) == 0) { - qt_socket_getPortAndAddress(sockAddrPtr, &localPort, &localAddress); + if (::getsockname(socketDescriptor, &sa.a, &sockAddrSize) == 0) { + qt_socket_getPortAndAddress(&sa, &localPort, &localAddress); // Determine protocol family - switch (sockAddrPtr->sa_family) { + switch (sa.a.sa_family) { case AF_INET: socketProtocol = QAbstractSocket::IPv4Protocol; break; @@ -716,8 +695,8 @@ bool QNativeSocketEnginePrivate::fetchConnectionParameters() } // Determine the remote address - if (!::getpeername(socketDescriptor, sockAddrPtr, &sockAddrSize)) - qt_socket_getPortAndAddress(sockAddrPtr, &peerPort, &peerAddress); + if (!::getpeername(socketDescriptor, &sa.a, &sockAddrSize)) + qt_socket_getPortAndAddress(&sa, &peerPort, &peerAddress); // Determine the socket type (UDP/TCP) int value = 0; -- cgit v0.12 From 5a62f2add2cba756a132f94a114d770285f01d9c Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 19 May 2009 18:10:06 +0200 Subject: Add an autotest to check that the network test server works MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This test verifies that the network test server is behaving as expected. I think I caught all the services we need testing in the server, but there's still some work to be done: 1) verify that the FTP files are there where they're supposed to be 2) verify that FTP writable areas are writable 3) verify that the HTTP server has the correct files too 4) verify that the HTTP server requests credentials for the protected area 5) attempt to do NTLM authentication to verify the password (probably can't be done with netChat) 6) add Windows SMB tests (//qt-test-server/etc.) 7) add SQL tests (connecting to the SQL server ports) It would be good as well if we could not use QtNetwork. If you break QtNetwork, this test breaks too, so we don't know where the fault is. However, rewriting networking code will add another source of bugs (same for the NTLM authentication). Reviewed-By: João Abecasis --- tests/auto/_networkselftest/_networkselftest.pro | 6 + .../auto/_networkselftest/tst_networkselftest.cpp | 592 +++++++++++++++++++++ tests/auto/auto.pro | 3 +- 3 files changed, 600 insertions(+), 1 deletion(-) create mode 100644 tests/auto/_networkselftest/_networkselftest.pro create mode 100644 tests/auto/_networkselftest/tst_networkselftest.cpp diff --git a/tests/auto/_networkselftest/_networkselftest.pro b/tests/auto/_networkselftest/_networkselftest.pro new file mode 100644 index 0000000..9e2ad0e --- /dev/null +++ b/tests/auto/_networkselftest/_networkselftest.pro @@ -0,0 +1,6 @@ +load(qttest_p4) + +SOURCES += tst_networkselftest.cpp +QT = core network +DEFINES += SRCDIR=\\\"$$PWD\\\" + diff --git a/tests/auto/_networkselftest/tst_networkselftest.cpp b/tests/auto/_networkselftest/tst_networkselftest.cpp new file mode 100644 index 0000000..dab4433 --- /dev/null +++ b/tests/auto/_networkselftest/tst_networkselftest.cpp @@ -0,0 +1,592 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include "../network-settings.h" + +class tst_NetworkSelfTest: public QObject +{ + Q_OBJECT +private slots: + void hostTest(); + void dnsResolution_data(); + void dnsResolution(); + void serverReachability(); + void remotePortsOpen_data(); + void remotePortsOpen(); + + // specific protocol tests + void ftpServer(); + void imapServer(); + void httpServer(); + void httpsServer(); + void httpProxy(); + void httpProxyBasicAuth(); + void httpProxyNtlmAuth(); + void socks5Proxy(); + void socks5ProxyAuth(); +}; + +class Chat +{ +public: + enum Type { + Reconnect, + Send, + Expect, + SkipBytes, + DiscardUntil, + DiscardUntilDisconnect, + Disconnect, + RemoteDisconnect, + StartEncryption + }; + Chat(Type t, const QByteArray &d) + : data(d), type(t) + { + } + Chat(Type t, int val = 0) + : value(val), type(t) + { + } + + static inline Chat send(const QByteArray &data) + { return Chat(Send, data); } + static inline Chat expect(const QByteArray &data) + { return Chat(Expect, data); } + static inline Chat discardUntil(const QByteArray &data) + { return Chat(DiscardUntil, data); } + static inline Chat skipBytes(int count) + { return Chat(SkipBytes, count); } + + QByteArray data; + int value; + Type type; +}; + +static QString prettyByteArray(const QByteArray &array) +{ + // any control chars? + QString result; + result.reserve(array.length() + array.length() / 3); + for (int i = 0; i < array.length(); ++i) { + char c = array.at(i); + switch (c) { + case '\n': + result += "\\n"; + continue; + case '\r': + result += "\\r"; + continue; + case '\t': + result += "\\t"; + continue; + case '"': + result += "\\\""; + continue; + default: + break; + } + + if (c < 0x20 || uchar(c) >= 0x7f) { + result += '\\'; + result += QString::number(uchar(c), 8); + } else { + result += c; + } + } + return result; +} + +static bool doSocketRead(QTcpSocket *socket, int minBytesAvailable, int timeout = 2000) +{ + QTime timer; + timer.start(); + forever { + if (socket->bytesAvailable() >= minBytesAvailable) + return true; + if (socket->state() == QAbstractSocket::UnconnectedState + || timer.elapsed() >= timeout) + return false; + if (!socket->waitForReadyRead(timeout - timer.elapsed())) + return false; + } +} + +static bool doSocketFlush(QTcpSocket *socket, int timeout = 2000) +{ +#ifndef QT_NO_OPENSSL + QSslSocket *sslSocket = qobject_cast(socket); +#endif + QTime timer; + timer.start(); + forever { + if (socket->bytesToWrite() == 0 +#ifndef QT_NO_OPENSSL + && sslSocket->encryptedBytesToWrite() == 0 +#endif + ) + return true; + if (socket->state() == QAbstractSocket::UnconnectedState + || timer.elapsed() >= timeout) + return false; + if (!socket->waitForBytesWritten(timeout - timer.elapsed())) + return false; + } +} + +static void netChat(int port, const QList &chat) +{ +#ifndef QT_NO_OPENSSL + QSslSocket socket; +#else + QTcpSocket socket; +#endif + + socket.connectToHost(QtNetworkSettings::serverName(), port); + qDebug() << 0 << "Connecting to server on port" << port; + QVERIFY2(socket.waitForConnected(10000), + QString("Failed to connect to server in step 0: %1").arg(socket.errorString()).toLocal8Bit()); + + // now start the chat + QList::ConstIterator it = chat.constBegin(); + for (int i = 1; it != chat.constEnd(); ++it, ++i) { + if (it->type != Chat::Reconnect + && socket.state() != QAbstractSocket::ConnectedState + && socket.state() != QAbstractSocket::ClosingState) + QFAIL(QString("Internal error: socket is in invalid state %1 in step %2") + .arg(socket.state()).arg(i).toLocal8Bit()); + + switch (it->type) { + case Chat::Expect: { + qDebug() << i << "Expecting" << prettyByteArray(it->data); + if (!doSocketRead(&socket, it->data.length())) + QFAIL(QString("Failed to receive data in step %1: timeout").arg(i).toLocal8Bit()); + + // pop that many bytes off the socket + QByteArray received = socket.read(it->data.length()); + + // is it what we expected? + QVERIFY2(received == it->data, + QString("Did not receive expected data in step %1: data received was:\n%2") + .arg(i).arg(prettyByteArray(received)).toLocal8Bit()); + + break; + } + + case Chat::DiscardUntil: + qDebug() << i << "Discarding until" << prettyByteArray(it->data); + while (true) { + // scan the buffer until we have our string + if (!doSocketRead(&socket, it->data.length())) + QFAIL(QString("Failed to receive data in step %1: timeout").arg(i).toLocal8Bit()); + + QByteArray buffer; + buffer.resize(socket.bytesAvailable()); + socket.peek(buffer.data(), socket.bytesAvailable()); + + int pos = buffer.indexOf(it->data); + if (pos == -1) { + // data not found, keep trying + continue; + } + + buffer = socket.read(pos + it->data.length()); + qDebug() << i << "Discarded" << prettyByteArray(buffer); + break; + } + break; + + case Chat::SkipBytes: { + qDebug() << i << "Skipping" << it->value << "bytes"; + if (!doSocketRead(&socket, it->value)) + QFAIL(QString("Failed to receive data in step %1: timeout").arg(i).toLocal8Bit()); + + // now discard the bytes + QByteArray buffer = socket.read(it->value); + qDebug() << i << "Skipped" << prettyByteArray(buffer); + break; + } + + case Chat::Send: { + qDebug() << i << "Sending" << prettyByteArray(it->data); + socket.write(it->data); + if (!doSocketFlush(&socket)) { + QVERIFY2(socket.state() == QAbstractSocket::ConnectedState, + QString("Socket disconnected while sending data in step %1").arg(i).toLocal8Bit()); + QFAIL(QString("Failed to send data in step %1: timeout").arg(i).toLocal8Bit()); + } + break; + } + + case Chat::Disconnect: + qDebug() << i << "Disconnecting from host"; + socket.disconnectFromHost(); + + // is this the last command? + if (it + 1 != chat.constEnd()) + break; + + // fall through: + case Chat::RemoteDisconnect: + case Chat::DiscardUntilDisconnect: + qDebug() << i << "Waiting for remote disconnect"; + if (socket.state() != QAbstractSocket::UnconnectedState) + socket.waitForDisconnected(10000); + QVERIFY2(socket.state() == QAbstractSocket::UnconnectedState, + QString("Socket did not disconnect as expected in step %1").arg(i).toLocal8Bit()); + + // any data left? + if (it->type == Chat::DiscardUntilDisconnect) { + QByteArray buffer = socket.readAll(); + qDebug() << i << "Discarded in the process:" << prettyByteArray(buffer); + } + + if (socket.bytesAvailable() != 0) + QFAIL(QString("Unexpected bytes still on buffer when disconnecting in step %1:\n%2") + .arg(i).arg(prettyByteArray(socket.readAll())).toLocal8Bit()); + break; + + case Chat::Reconnect: + qDebug() << i << "Reconnecting to server on port" << port; + socket.connectToHost(QtNetworkSettings::serverName(), port); + QVERIFY2(socket.waitForConnected(10000), + QString("Failed to reconnect to server in step %1: %2").arg(i).arg(socket.errorString()).toLocal8Bit()); + break; + + case Chat::StartEncryption: +#ifdef QT_NO_OPENSSL + QFAIL("Internal error: SSL required for this test"); +#else + qDebug() << i << "Starting client encryption"; + socket.ignoreSslErrors(); + socket.startClientEncryption(); + QVERIFY2(socket.waitForEncrypted(5000), + QString("Failed to start client encryption in step %1: %2").arg(i) + .arg(socket.errorString()).toLocal8Bit()); + break; +#endif + } + } +} + +void tst_NetworkSelfTest::hostTest() +{ + // this is a localhost self-test + QHostInfo localhost = QHostInfo::fromName("localhost"); + QCOMPARE(localhost.error(), QHostInfo::NoError); + QVERIFY(!localhost.addresses().isEmpty()); + + QTcpServer server; + QVERIFY(server.listen()); + + QTcpSocket socket; + socket.connectToHost("127.0.0.1", server.serverPort()); + QVERIFY(socket.waitForConnected(10000)); +} + +void tst_NetworkSelfTest::dnsResolution_data() +{ + QTest::addColumn("hostName"); + QTest::newRow("local-name") << QtNetworkSettings::serverLocalName(); + QTest::newRow("fqdn") << QtNetworkSettings::serverName(); +} + +void tst_NetworkSelfTest::dnsResolution() +{ + QFETCH(QString, hostName); + QHostInfo resolved = QHostInfo::fromName(hostName); + QVERIFY2(resolved.error() == QHostInfo::NoError, + QString("Failed to resolve hostname %1: %2").arg(hostName, resolved.errorString()).toLocal8Bit()); +} + +void tst_NetworkSelfTest::serverReachability() +{ + // check that we get a proper error connecting to port 1 + QTcpSocket socket; + socket.connectToHost(QtNetworkSettings::serverName(), 1); + socket.waitForConnected(10000); + QVERIFY2(socket.state() == QAbstractSocket::UnconnectedState, "Socket connected unexpectedly!"); + QVERIFY2(socket.error() == QAbstractSocket::ConnectionRefusedError, + QString("Could not reach server: %1").arg(socket.errorString()).toLocal8Bit()); +} + +void tst_NetworkSelfTest::remotePortsOpen_data() +{ + QTest::addColumn("portNumber"); + QTest::newRow("ftp") << 21; + QTest::newRow("ssh") << 22; + QTest::newRow("imap") << 143; + QTest::newRow("http") << 80; + QTest::newRow("https") << 443; + QTest::newRow("http-proxy") << 3128; + QTest::newRow("http-proxy-auth-basic") << 3129; + QTest::newRow("http-proxy-auth-ntlm") << 3130; + QTest::newRow("socks5-proxy") << 1080; + QTest::newRow("socks5-proxy-auth") << 1081; +} + +void tst_NetworkSelfTest::remotePortsOpen() +{ + QFETCH(int, portNumber); + QTcpSocket socket; + socket.connectToHost(QtNetworkSettings::serverName(), portNumber); + + if (!socket.waitForConnected(10000)) { + if (socket.error() == QAbstractSocket::SocketTimeoutError) + QFAIL(QString("Network timeout connecting to the server on port %1").arg(portNumber).toLocal8Bit()); + else + QFAIL(QString("Error connecting to server on port %1: %2").arg(portNumber).arg(socket.errorString()).toLocal8Bit()); + } + QVERIFY(socket.state() == QAbstractSocket::ConnectedState); +} + +static QList ftpChat() +{ + return QList() << Chat::expect("220") + << Chat::discardUntil("\r\n") + << Chat::send("USER anonymous\r\n") + << Chat::expect("331") + << Chat::discardUntil("\r\n") + << Chat::send("PASS user@hostname\r\n") + << Chat::expect("230") + << Chat::discardUntil("\r\n") + << Chat::send("QUIT\r\n") + << Chat::expect("221") + << Chat::discardUntil("\r\n") + << Chat::RemoteDisconnect; +} + +void tst_NetworkSelfTest::ftpServer() +{ + netChat(21, ftpChat()); +} + +void tst_NetworkSelfTest::imapServer() +{ + netChat(143, QList() + << Chat::expect("* OK ") + << Chat::discardUntil("\r\n") + << Chat::send("1 CAPABILITY\r\n") + << Chat::expect("* CAPABILITY ") + << Chat::discardUntil("1 OK") + << Chat::discardUntil("\r\n") + << Chat::send("2 LOGOUT\r\n") + << Chat::discardUntil("2 OK") + << Chat::discardUntil("\r\n") + << Chat::RemoteDisconnect); +} + +void tst_NetworkSelfTest::httpServer() +{ + netChat(80, QList() + // HTTP/0.9 chat: + << Chat::send("GET /\r\n") + << Chat::DiscardUntilDisconnect + + // HTTP/1.0 chat: + << Chat::Reconnect + << Chat::send("GET / HTTP/1.0\r\n" + "Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n" + "Connection: close\r\n" + "\r\n") + << Chat::expect("HTTP/1.") + << Chat::discardUntil(" ") + << Chat::expect("200 ") + << Chat::DiscardUntilDisconnect + + // HTTP/1.0 POST: + << Chat::Reconnect + << Chat::send("POST / HTTP/1.0\r\n" + "Content-Length: 5\r\n" + "Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n" + "Connection: close\r\n" + "\r\n" + "Hello") + << Chat::expect("HTTP/1.") + << Chat::discardUntil(" ") + << Chat::expect("200 ") + << Chat::DiscardUntilDisconnect + ); +} + +void tst_NetworkSelfTest::httpsServer() +{ +#ifndef QT_NO_OPENSSL + netChat(443, QList() + << Chat::StartEncryption + << Chat::send("GET / HTTP/1.0\r\n" + "Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n" + "Connection: close\r\n" + "\r\n") + << Chat::expect("HTTP/1.") + << Chat::discardUntil(" ") + << Chat::expect("200 ") + << Chat::DiscardUntilDisconnect); +#else + QSKIP("SSL not enabled, cannot test"); +#endif +} + +void tst_NetworkSelfTest::httpProxy() +{ + netChat(3128, QList() + // proxy GET + << Chat::send("GET http://" + QtNetworkSettings::serverName().toLatin1() + "/ HTTP/1.0\r\n" + "Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n" + "Proxy-connection: close\r\n" + "\r\n") + << Chat::expect("HTTP/1.") + << Chat::discardUntil(" ") + << Chat::expect("200 ") + << Chat::DiscardUntilDisconnect + + // proxy CONNECT + << Chat::Reconnect + << Chat::send("CONNECT " + QtNetworkSettings::serverName().toLatin1() + ":21 HTTP/1.0\r\n" + "\r\n") + << Chat::expect("HTTP/1.") + << Chat::discardUntil(" ") + << Chat::expect("200 ") + << Chat::discardUntil("\r\n\r\n") + << ftpChat()); +} + +void tst_NetworkSelfTest::httpProxyBasicAuth() +{ + netChat(3129, QList() + // test auth required response + << Chat::send("GET http://" + QtNetworkSettings::serverName().toLatin1() + "/ HTTP/1.0\r\n" + "Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n" + "Proxy-connection: close\r\n" + "\r\n") + << Chat::expect("HTTP/1.") + << Chat::discardUntil(" ") + << Chat::expect("407 ") + << Chat::discardUntil("\r\nProxy-Authenticate: Basic realm=\"") + << Chat::DiscardUntilDisconnect + + // now try sending our credentials + << Chat::Reconnect + << Chat::send("GET http://" + QtNetworkSettings::serverName().toLatin1() + "/ HTTP/1.0\r\n" + "Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n" + "Proxy-connection: close\r\n" + "Proxy-Authorization: Basic cXNvY2tzdGVzdDpwYXNzd29yZA==\r\n" + "\r\n") + << Chat::expect("HTTP/1.") + << Chat::discardUntil(" ") + << Chat::expect("200 ") + << Chat::DiscardUntilDisconnect); +} + +void tst_NetworkSelfTest::httpProxyNtlmAuth() +{ + netChat(3130, QList() + // test auth required response + << Chat::send("GET http://" + QtNetworkSettings::serverName().toLatin1() + "/ HTTP/1.0\r\n" + "Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n" + "Proxy-connection: keep-alive\r\n" // NTLM auth will disconnect + "\r\n") + << Chat::expect("HTTP/1.") + << Chat::discardUntil(" ") + << Chat::expect("407 ") + << Chat::discardUntil("\r\nProxy-Authenticate: NTLM\r\n") + << Chat::DiscardUntilDisconnect + ); +} + +// SOCKSv5 is a binary protocol +static const char handshakeNoAuth[] = "\5\1\0"; +static const char handshakeOkNoAuth[] = "\5\0"; +static const char handshakeAuthPassword[] = "\5\1\2\1\12qsockstest\10password"; +static const char handshakeOkPasswdAuth[] = "\5\2\1\0"; +static const char handshakeAuthNotOk[] = "\5\377"; +static const char connect1[] = "\5\1\0\1\177\0\0\1\0\25"; // Connect IPv4 127.0.0.1 port 21 +static const char connect2[] = "\5\1\0\3\11localhost\0\25"; // Connect hostname localhost 21 +static const char connected[] = "\5\0\0"; + +void tst_NetworkSelfTest::socks5Proxy() +{ + netChat(1080, QList() + // IP address connection + << Chat::send(QByteArray(handshakeNoAuth, -1 + sizeof handshakeNoAuth)) + << Chat::expect(QByteArray(handshakeOkNoAuth, -1 + sizeof handshakeOkNoAuth)) + << Chat::send(QByteArray(connect1, -1 + sizeof connect1)) + << Chat::expect(QByteArray(connected, -1 + sizeof connected)) + << Chat::expect("\1") // IPv4 address following + << Chat::skipBytes(6) // the server's local address and port + << ftpChat() + + // hostname connection + << Chat::Reconnect + << Chat::send(QByteArray(handshakeNoAuth, -1 + sizeof handshakeNoAuth)) + << Chat::expect(QByteArray(handshakeOkNoAuth, -1 + sizeof handshakeOkNoAuth)) + << Chat::send(QByteArray(connect2, -1 + sizeof connect2)) + << Chat::expect(QByteArray(connected, -1 + sizeof connected)) + << Chat::expect("\1") // IPv4 address following + << Chat::skipBytes(6) // the server's local address and port + << ftpChat() + ); +} + +void tst_NetworkSelfTest::socks5ProxyAuth() +{ + netChat(1081, QList() + // unauthenticated connect -- will get error + << Chat::send(QByteArray(handshakeNoAuth, -1 + sizeof handshakeNoAuth)) + << Chat::expect(QByteArray(handshakeAuthNotOk, -1 + sizeof handshakeAuthNotOk)) + << Chat::RemoteDisconnect + + // now try to connect with authentication + << Chat::Reconnect + << Chat::send(QByteArray(handshakeAuthPassword, -1 + sizeof handshakeAuthPassword)) + << Chat::expect(QByteArray(handshakeOkPasswdAuth, -1 + sizeof handshakeOkPasswdAuth)) + << Chat::send(QByteArray(connect1, -1 + sizeof connect1)) + << Chat::expect(QByteArray(connected, -1 + sizeof connected)) + << Chat::expect("\1") // IPv4 address following + << Chat::skipBytes(6) // the server's local address and port + << ftpChat() + ); +} + +QTEST_MAIN(tst_NetworkSelfTest) +#include "tst_networkselftest.moc" diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 60e6657..1cdb840 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -4,7 +4,8 @@ TEMPLATE = subdirs !wince*:SUBDIRS += \ headers -SUBDIRS += bic \ +SUBDIRS += _networkselftest \ + bic \ collections \ compile \ compilerwarnings \ -- cgit v0.12 From 0babd12eb7e982f47b379fe70f011daffbb8c6e8 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Fri, 22 May 2009 12:57:57 +0200 Subject: Updated WebKit from /home/ariya/dev/webkit/qtwebkit-4.5 to origin/qtwebkit-4.5 ( 4ee8af9348b3f57d3c0f3575ae0a58336cf07a92 ) Changes in WebKit since the last update: ++ b/LayoutTests/ChangeLog 2009-05-20 Holger Hans Peter Freyther Reviewed by Anders Carlsson. https://bugs.webkit.org/show_bug.cgi?id=24510 Add a test case that Netscape Plugin can properly determine if a given object has a specific method and property. The test will ask the plugin to call hasproperty and hasmethod and will compare the result with what is expected. This approach is taken from netscape-get-property-return-value.html * plugins/netscape-invoke-browserfuncs-expected.txt: Added. * plugins/netscape-invoke-browserfuncs.html: Added. ++ b/WebCore/ChangeLog 2009-05-19 Kenneth Rohde Christiansen Reviewed by Simon Hausmann. Do not call the parent implementation (Widget::) in show() and hide() of the PluginViewQt, as it always changes the visible state of the platformWidget (equal to the platformPluginWidget in the Qt port), thus ignoring the isParentVisible() test. * plugins/qt/PluginViewQt.cpp: (WebCore::PluginView::show): (WebCore::PluginView::hide): 2009-04-22 Tamas Szirbucz Reviewed by Ariya Hidayat. https://bugs.webkit.org/show_bug.cgi?id=25023 Delete reply in QNetworkReplyHandler::abort() to avoid leak. * platform/network/qt/QNetworkReplyHandler.cpp: (WebCore::QNetworkReplyHandler::abort): 2009-05-20 Holger Hans Peter Freyther Reviewed by Anders Carlsson. https://bugs.webkit.org/show_bug.cgi?id=24510 Fix a bug where the browserfuncs were not properly assigned, make hasproperty use _NP_HasProperty and hasmethod _NP_HasMethod. Test: plugins/netscape-invoke-browserfuncs.html * plugins/gtk/PluginPackageGtk.cpp: (WebCore::PluginPackage::load): Fix assignment * plugins/qt/PluginPackageQt.cpp: (WebCore::PluginPackage::load): Fix assignment ++ b/WebKit/qt/ChangeLog 2009-05-19 Kenneth Rohde Christiansen Reviewed by Simon Hausmann. Fix a plugin bug in the WebKit code, similar to the one in WebCore. The problem is when a non visible QtPluginWidget would show it self in a sibling frame. The problem was due to our clipping. In Qt, if setMask is set with an empty QRegion, no clipping will be performed, so in that case we hide the PluginContainer * WebCoreSupport/FrameLoaderClientQt.cpp: (WebCore::): ++ b/WebKitTools/ChangeLog 2009-05-14 Holger Hans Peter Freyther Reviewed by Anders Carlsson. https://bugs.webkit.org/show_bug.cgi?id=24510 where Add testHasProperty and testHasMethod to the existing functions of the PluginObject to be able to test the browser hasproperty and hasmethod implementation. Invoke them from pluginInvoke. Change the defines to an enum to avoid manually updating NUM_METHOD_IDENTIFIERS and assigning numbers. * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp: (testHasProperty): test hasproperty (testHasMethod): test hasmethod (pluginInvoke): invoke the two --- src/3rdparty/webkit/VERSION | 2 +- src/3rdparty/webkit/WebCore/ChangeLog | 39 ++++++++++++++++++++++ .../platform/network/qt/QNetworkReplyHandler.cpp | 1 + .../webkit/WebCore/plugins/qt/PluginPackageQt.cpp | 4 +-- .../webkit/WebCore/plugins/qt/PluginViewQt.cpp | 8 +++-- src/3rdparty/webkit/WebKit/qt/ChangeLog | 14 ++++++++ .../qt/WebCoreSupport/FrameLoaderClientQt.cpp | 8 ++++- 7 files changed, 70 insertions(+), 6 deletions(-) diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index 7adbd6f..7d5d1c5 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 - 40b523e9eaaba38c182e5a9c319f0069ebf98330 + 4ee8af9348b3f57d3c0f3575ae0a58336cf07a92 diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog index a4cb62d..072beee 100644 --- a/src/3rdparty/webkit/WebCore/ChangeLog +++ b/src/3rdparty/webkit/WebCore/ChangeLog @@ -1,3 +1,42 @@ +2009-05-19 Kenneth Rohde Christiansen + + Reviewed by Simon Hausmann. + + Do not call the parent implementation (Widget::) in show() and hide() + of the PluginViewQt, as it always changes the visible state of the + platformWidget (equal to the platformPluginWidget in the Qt port), + thus ignoring the isParentVisible() test. + + * plugins/qt/PluginViewQt.cpp: + (WebCore::PluginView::show): + (WebCore::PluginView::hide): + +2009-04-22 Tamas Szirbucz + + Reviewed by Ariya Hidayat. + + https://bugs.webkit.org/show_bug.cgi?id=25023 + Delete reply in QNetworkReplyHandler::abort() to avoid leak. + + * platform/network/qt/QNetworkReplyHandler.cpp: + (WebCore::QNetworkReplyHandler::abort): + +2009-05-20 Holger Hans Peter Freyther + + Reviewed by Anders Carlsson. + + https://bugs.webkit.org/show_bug.cgi?id=24510 + + Fix a bug where the browserfuncs were not properly assigned, + make hasproperty use _NP_HasProperty and hasmethod _NP_HasMethod. + + Test: plugins/netscape-invoke-browserfuncs.html + + * plugins/gtk/PluginPackageGtk.cpp: + (WebCore::PluginPackage::load): Fix assignment + * plugins/qt/PluginPackageQt.cpp: + (WebCore::PluginPackage::load): Fix assignment + 2009-05-11 Yael Aharon Reviewed by Holger Freyther. diff --git a/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp b/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp index 2c730a6..3e9b239 100644 --- a/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp +++ b/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp @@ -174,6 +174,7 @@ void QNetworkReplyHandler::abort() if (m_reply) { QNetworkReply* reply = release(); reply->abort(); + reply->deleteLater(); deleteLater(); } } diff --git a/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp b/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp index 4387813..13f5394 100644 --- a/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp @@ -151,8 +151,8 @@ bool PluginPackage::load() m_browserFuncs.getproperty = _NPN_GetProperty; m_browserFuncs.setproperty = _NPN_SetProperty; m_browserFuncs.removeproperty = _NPN_RemoveProperty; - m_browserFuncs.hasproperty = _NPN_HasMethod; - m_browserFuncs.hasmethod = _NPN_HasProperty; + m_browserFuncs.hasproperty = _NPN_HasProperty; + m_browserFuncs.hasmethod = _NPN_HasMethod; m_browserFuncs.setexception = _NPN_SetException; m_browserFuncs.enumerate = _NPN_Enumerate; m_browserFuncs.construct = _NPN_Construct; diff --git a/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp b/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp index 43c772f..e856f92 100644 --- a/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp @@ -113,7 +113,9 @@ void PluginView::show() if (isParentVisible() && platformPluginWidget()) platformPluginWidget()->setVisible(true); - Widget::show(); + // do not call parent impl. here as it will set the platformWidget + // (same as platformPluginWidget in the Qt port) to visible, even + // when parent isn't visible. } void PluginView::hide() @@ -123,7 +125,9 @@ void PluginView::hide() if (isParentVisible() && platformPluginWidget()) platformPluginWidget()->setVisible(false); - Widget::hide(); + // do not call parent impl. here as it will set the platformWidget + // (same as platformPluginWidget in the Qt port) to invisible, even + // when parent isn't visible. } void PluginView::paint(GraphicsContext* context, const IntRect& rect) diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog index 2aeb8da..d9f925a 100644 --- a/src/3rdparty/webkit/WebKit/qt/ChangeLog +++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog @@ -1,3 +1,17 @@ +2009-05-19 Kenneth Rohde Christiansen + + Reviewed by Simon Hausmann. + + Fix a plugin bug in the WebKit code, similar to the one in WebCore. + + The problem is when a non visible QtPluginWidget would show it self + in a sibling frame. The problem was due to our clipping. In Qt, + if setMask is set with an empty QRegion, no clipping will + be performed, so in that case we hide the PluginContainer + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::): + 2009-03-27 Erik L. Bunce Reviewed by Simon Hausmann. diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp index c421d42..a2b33c0 100644 --- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp +++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp @@ -1058,7 +1058,13 @@ public: IntRect clipRect(static_cast(parentScrollView)->windowClipRect()); clipRect.move(-windowRect.x(), -windowRect.y()); clipRect.intersect(platformWidget()->rect()); - platformWidget()->setMask(QRegion(clipRect.x(), clipRect.y(), clipRect.width(), clipRect.height())); + + QRegion clipRegion = QRegion(clipRect); + platformWidget()->setMask(clipRegion); + + // if setMask is set with an empty QRegion, no clipping will + // be performed, so in that case we hide the platformWidget + platformWidget()->setVisible(!clipRegion.isEmpty()); } }; -- cgit v0.12 From ec8c6b9f5a25f9d4c437fbb13f073aeebc09cb3f Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Fri, 22 May 2009 13:09:17 +0200 Subject: Updates QtWebKit sections in changes-4.5.2 after commit 0babd12e. --- dist/changes-4.5.2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index b3e808f..1e00208 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -42,8 +42,8 @@ Third party components Memory (r41527, r43764, r43828, r43830) JavaScript (r39882, r40086, r40131, r40133) Rendering (r41285, r41296, r41659, r42887) - Network (r41664, r42516) - Plugins (r41346, r43550) + Network (r41664, r42516, r42747) + Plugins (r41346, r43550, r43915, r43917, r43923) Clipboard (r41360) **************************************************************************** -- cgit v0.12 From e7f7d1f20ed691a274dcf07801baa17f7a8aabf9 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 22 May 2009 13:18:59 +0200 Subject: Added helper softKeyStackOfWidget. It returns the stack of the MainWindow of a widget (which might want to push its actions to the stack) --- src/gui/widgets/qsoftkeystack.cpp | 16 ++++++++++++++++ src/gui/widgets/qsoftkeystack.h | 3 +++ 2 files changed, 19 insertions(+) diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index ae58e8d..723b9bf 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -165,6 +165,22 @@ void QSoftKeyStack::handleSoftKeyPress(int command) d->handleSoftKeyPress(command); } +QMainWindow *QSoftKeyStack::mainWindowOfWidget(QWidget *widget) +{ + QWidget *widgetParent = widget; + while (widgetParent = widgetParent->parentWidget()) + if (QMainWindow *mainWindow = qobject_cast(widgetParent)) + return mainWindow; + + return 0; +} + +QSoftKeyStack *QSoftKeyStack::softKeyStackOfWidget(QWidget *widget) +{ + QMainWindow *mainWindow = mainWindowOfWidget(widget); + return mainWindow ? mainWindow->softKeyStack() : 0; +} + #if !defined(Q_WS_S60) void QSoftKeyStackPrivate::handleSoftKeyPress(int command) { diff --git a/src/gui/widgets/qsoftkeystack.h b/src/gui/widgets/qsoftkeystack.h index c9a05c3..7c955da 100644 --- a/src/gui/widgets/qsoftkeystack.h +++ b/src/gui/widgets/qsoftkeystack.h @@ -69,6 +69,9 @@ public: void handleSoftKeyPress(int command); + static QMainWindow *mainWindowOfWidget(QWidget *widget); + static QSoftKeyStack *softKeyStackOfWidget(QWidget *widget); + private Q_SLOTS: void handleFocusChanged(QWidget *old, QWidget *now); -- cgit v0.12 From b52451f6074446ec77f3bca712cdaeae46a50066 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 22 May 2009 13:44:56 +0200 Subject: compile --- src/gui/widgets/qsoftkeystack.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/widgets/qsoftkeystack.h b/src/gui/widgets/qsoftkeystack.h index 7c955da..2a63ab8 100644 --- a/src/gui/widgets/qsoftkeystack.h +++ b/src/gui/widgets/qsoftkeystack.h @@ -54,6 +54,7 @@ QT_MODULE(Gui) class QSoftKeyStackPrivate; class QSoftKeyAction; +class QMainWindow; class Q_GUI_EXPORT QSoftKeyStack : public QObject { -- cgit v0.12 From b23dc7fb8bc8de6617684249411b5399f1d06631 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 22 May 2009 13:45:49 +0200 Subject: Cleanup. --- src/gui/widgets/qsoftkeystack.cpp | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index 723b9bf..05fe397 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -134,29 +134,7 @@ void QSoftKeyStack::handleFocusChanged(QWidget *old, QWidget *now) actionList.append(menu); actionList.append(contextMenu); softKeyStack->push(actionList); - } - -/* if (!now) - return; - bool nowInOurMainWindow = false; - const QMainWindow *ourMainWindow = qobject_cast(parent()); - Q_ASSERT(ourMainWindow); - - // "ourMainWindow" in parent chain of "now"? Isn't there a helper in Qt for this? - QWidget *nowParent = now; - while (nowParent = nowParent->parentWidget()) { - if (nowParent == ourMainWindow) { - nowInOurMainWindow = true; - break; - } } - - if (!nowInOurMainWindow) - return; - - QList actions = now->actions(); - // Do something with these actions. -*/ } void QSoftKeyStack::handleSoftKeyPress(int command) @@ -190,4 +168,4 @@ void QSoftKeyStackPrivate::handleSoftKeyPress(int command) void QSoftKeyStackPrivate::setNativeSoftKeys() { } -#endif // !defined(Q_WS_S60) \ No newline at end of file +#endif // !defined(Q_WS_S60) -- cgit v0.12 From a98e9e2377974f306ad1ad73a7aa19807400cd80 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 22 May 2009 14:50:10 +0300 Subject: Fixes to release package creation script --- bin/build_release_package.pl | 60 +++++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/bin/build_release_package.pl b/bin/build_release_package.pl index 0a35062..0df5995 100644 --- a/bin/build_release_package.pl +++ b/bin/build_release_package.pl @@ -16,57 +16,58 @@ if (@ARGV) my $cert = shift(@ARGV); my $certKey = shift(@ARGV); my $releaseDir = shift(@ARGV); + my $qtRootDir = shift(@ARGV); my $epocroot = shift(@ARGV); if ($build eq "") { print("HW build parameter required!\n"); - exit; + exit 1; } if ($cert eq "") { print("Signing certificate parameter required!\n"); - exit; + exit 2; } if ($certKey eq "") { print("Signing certificate key parameter required!\n"); - exit; + exit 3; } if ($releaseDir eq "") { print("Release directory parameter required!\n"); - exit; + exit 4; } - if ($epocroot eq "") + if ($qtRootDir eq "") { - $epocroot = "\\"; + $qtRootDir = cwd(); + $qtRootDir =~ s/\//\\/g; } - if ($epocroot =~ m/.*[^\\]$/) - { - $epocroot = "${epocroot}\\"; - } + # Lose the ending separator is any + $qtRootDir =~ s/\\$//; + $epocroot =~ s/\\$//; + chdir($qtRootDir); + + # Lose the drive designator from epocroot $epocroot =~ s/.://; my $releaseDirQt = "${releaseDir}\\qt"; my $releaseDirEpocroot = "${releaseDir}\\epocroot"; - my $releaseDirSis = "${releaseDir}\\sis"; - - my $qtRootDir = cwd(); - $qtRootDir =~ s/\//\\/g; # Fix dir separators + my $releaseDirSis = $releaseDirQt; # Put sis files to Qt source dir root my $qtRootDirForMatch = $qtRootDir; # Double backslashes so that variable can be used in matching - $qtRootDirForMatch =~ s/\\/\\\\/; + $qtRootDirForMatch =~ s/\\/\\\\/g; my $pkgFileName = "src\\s60installs\\qt_libs_${platform}_${build}.pkg"; - my $hwBuildDir = "${epocroot}epoc32\\release\\$platform\\$build"; + my $hwBuildDir = "${epocroot}\\epoc32\\release\\$platform\\$build"; my $armDbgDir = "epoc32\\release\\armv5\\udeb"; my $armRelDir = "epoc32\\release\\armv5\\urel"; my $gcceDbgDir = "epoc32\\release\\gcce\\udeb"; @@ -76,21 +77,23 @@ if (@ARGV) # clean up old stuff system("rd /S /Q ${releaseDir} 2> NUL"); - system("rd /S /Q ${epocroot}epoc32\\build 2> NUL"); # Just in case env is not clean + system("rd /S /Q ${epocroot}\\epoc32\\build 2> NUL"); # Just in case env is not clean # Copy the whole thing over to the release dir before it gets polluted print("Copying clean tree...\n"); my $tempExcludeFile = "${releaseDir}\\__temp_exclude.txt"; system("mkdir ${releaseDir} 2>NUL"); - runSystemCmd("echo \\.git\\ > ${tempExcludeFile}"); + runSystemCmd("echo ${qtRootDir}\\.git\\ > ${tempExcludeFile}"); + runSystemCmd("echo ${qtRootDir}\\tests\\ >> ${tempExcludeFile}"); + runSystemCmd("echo ${qtRootDir}\\util\\ >> ${tempExcludeFile}"); runSystemCmd("xcopy ${qtRootDir} ${releaseDirQt} /E /I /H /Q /EXCLUDE:${tempExcludeFile}"); system("del /F /Q ${tempExcludeFile} 2> NUL"); # Clear archive flag from all items in \epoc32\release\armv5\urel and \epoc32\release\armv5\lib # as those will have the binaries used for all platforms and builds. runSystemCmd("attrib -A ${hwBuildDir}\\*"); - runSystemCmd("attrib -A ${epocroot}${armLibDir}\\*"); - runSystemCmd("attrib -A ${epocroot}${winscwDbgDir}\\*"); + runSystemCmd("attrib -A ${epocroot}\\${armLibDir}\\*"); + runSystemCmd("attrib -A ${epocroot}\\${winscwDbgDir}\\*"); # Build Qt runSystemCmd("configure -platform win32-mwc -xplatform symbian-abld -openssl-linked -qt-sql-sqlite -system-sqlite -nokia-developer"); @@ -168,8 +171,8 @@ if (@ARGV) system("del /F /Q ${releaseDirEpocroot}\\${armRelDir}\\*.sym 2> NUL"); runSystemCmd("xcopy ${releaseDirEpocroot}\\${armDbgDir}\\* ${releaseDirEpocroot}\\${gcceDbgDir} /F /R /Y /I /D"); runSystemCmd("xcopy ${releaseDirEpocroot}\\${armRelDir}\\* ${releaseDirEpocroot}\\${gcceRelDir} /F /R /Y /I /D"); - runSystemCmd("xcopy ${epocroot}${armLibDir}\\* ${releaseDirEpocroot}\\${armLibDir} /A /F /R /Y /I /D"); - runSystemCmd("xcopy ${epocroot}${winscwDbgDir}\\* ${releaseDirEpocroot}\\${winscwDbgDir} /A /F /R /Y /I /D"); + runSystemCmd("xcopy ${epocroot}\\${armLibDir}\\* ${releaseDirEpocroot}\\${armLibDir} /A /F /R /Y /I /D"); + runSystemCmd("xcopy ${epocroot}\\${winscwDbgDir}\\* ${releaseDirEpocroot}\\${winscwDbgDir} /A /F /R /Y /I /D"); # Create unsigned sis and Rnd signed sisx my @pkgPathElements = split(/\\/, $pkgFileName); @@ -177,20 +180,21 @@ if (@ARGV) my @pkgSuffixElements = split(/\./, $pathlessPkgFile); pop(@pkgSuffixElements); my $sisFileName = join("", @pkgSuffixElements).".sis"; + my $rndSisFileName = join("", @pkgSuffixElements)."_rnd.sisx"; system("mkdir ${releaseDirSis}"); runSystemCmd("makesis ${pkgFileName} ${releaseDirSis}\\${sisFileName}"); - runSystemCmd("signsis ${releaseDirSis}\\${sisFileName} ${releaseDirSis}\\${sisFileName}x ${cert} ${certKey}"); + runSystemCmd("signsis ${releaseDirSis}\\${sisFileName} ${releaseDirSis}\\${rndSisFileName} ${cert} ${certKey}"); } else { print("Usage:\n"); - print("build_release_package.pl [EPOCROOT]\n"); - print("EPOCROOT is optional, defaults to '\\'\n"); + print("build_release_package.pl [QTROOT] [EPOCROOT]\n"); + print("QTROOT and EPOCROOT are optional; QTROOT defaults to current dir and EPOCROOT defaults to '\\'\n"); print("1) Clean up the env. (abld reallyclean & delete \\my\\epoc\\root\\build folder)\n"); - print("2) Run \"build_release_package.pl armv5 udeb \\rd.cer \\rd-key.pem \\my_release_dir [\\my\\epoc\\root\\]>\"\n"); + print("2) Run \"build_release_package.pl armv5 udeb \\rd.cer \\rd-key.pem \\my_release_dir [\\my\\qt\\root\\] [\\my\\epoc\\root\\]>\"\n"); print(" to build Qt and create the release package structure and sis file.\n"); print(" Note: Run in the Qt root directory.\n"); - print("3) Optional: Get the sis signed with commercial certificate\n"); + print("3) Optional: Get the sis signed with commercial certificate (can be found in qt directory under release directory)\n"); print("4) Zip up the release directory contents\n"); } @@ -200,6 +204,6 @@ sub runSystemCmd if ($error_code != 0) { print("'$_[0]' call failed: error code == $error_code\n"); - exit; + exit 5; } } -- cgit v0.12 From bc498cd027dff6ff16032868c6bb00e634749cd6 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Fri, 22 May 2009 13:52:47 +0200 Subject: Fix Qt does not compile when glibc < 2.3.2 on linux Rather than try to resolve functions or impose configure time limitations we simply remove the dependancy entirely and rely on the fallbac for all platforms. Task-number: 250731 Reviewed-by: thiago --- src/gui/styles/gtksymbols.cpp | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/src/gui/styles/gtksymbols.cpp b/src/gui/styles/gtksymbols.cpp index 0842ec7..d8a67c2 100644 --- a/src/gui/styles/gtksymbols.cpp +++ b/src/gui/styles/gtksymbols.cpp @@ -633,31 +633,14 @@ GtkStyle* QGtk::gtkStyle(const QString &path) return 0; } -#ifdef Q_OS_LINUX -QT_END_NAMESPACE - -int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); -int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); - -QT_BEGIN_NAMESPACE -#endif - void QGtk::initGtkWidgets() { // From gtkmain.c - - uid_t ruid, rgid, euid, egid, suid, sgid; - -#ifdef Q_OS_LINUX - if (getresuid (&ruid, &euid, &suid) != 0 || getresgid (&rgid, &egid, &sgid) != 0) -#endif - { - suid = ruid = getuid (); - sgid = rgid = getgid (); - euid = geteuid (); - egid = getegid (); - } - if (ruid != euid || ruid != suid || rgid != egid || rgid != sgid) { + uid_t ruid = getuid (); + uid_t rgid = getgid (); + uid_t euid = geteuid (); + uid_t egid = getegid (); + if (ruid != euid || rgid != egid) { qWarning("\nThis process is currently running setuid or setgid.\nGTK+ does not allow this " "therefore Qt cannot use the GTK+ integration.\nTry launching your app using \'gksudo\', " "\'kdesudo\' or a similar tool.\n\n" -- cgit v0.12 From b89efc8e7f3289ff85a5076297e4357283dd24a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 22 May 2009 12:27:48 +0200 Subject: Fixed text shaping bugs with ligatures and multiple font engines. If Harfbuzz shaping adds or merges glyphs we need to move the remaining glyphs in the glyph layout to compensate. Task-number: 253783 Reviewed-by: Simon Hausmann --- src/gui/text/qtextengine.cpp | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 80a5425..da1ab25 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -1099,6 +1099,16 @@ void QTextEngine::shapeTextWithCE(int item) const } #endif +static inline void moveGlyphData(const QGlyphLayout &destination, const QGlyphLayout &source, int num) +{ + if (num > 0 && destination.glyphs != source.glyphs) { + memmove(destination.glyphs, source.glyphs, num * sizeof(HB_Glyph)); + memmove(destination.attributes, source.attributes, num * sizeof(HB_GlyphAttributes)); + memmove(destination.advances_x, source.advances_x, num * sizeof(HB_Fixed)); + memmove(destination.offsets, source.offsets, num * sizeof(HB_FixedPoint)); + } +} + /// take the item from layoutData->items and void QTextEngine::shapeTextWithHarfbuzz(int item) const { @@ -1189,7 +1199,7 @@ void QTextEngine::shapeTextWithHarfbuzz(int item) const - int initial_glyph_pos = 0; + int remaining_glyphs = entire_shaper_item.num_glyphs; int glyph_pos = 0; // for each item shape using harfbuzz and store the results in our layoutData's glyphs array. for (int k = 0; k < itemBoundaries.size(); k += 2) { // for the +2, see the comment at the definition of itemBoundaries @@ -1209,7 +1219,7 @@ void QTextEngine::shapeTextWithHarfbuzz(int item) const QFontEngine *actualFontEngine = font; uint engineIdx = 0; if (font->type() == QFontEngine::Multi) { - engineIdx = uint(initialGlyphs.glyphs[itemBoundaries[k + 1]] >> 24); + engineIdx = uint(initialGlyphs.glyphs[glyph_pos] >> 24); actualFontEngine = static_cast(font)->engine(engineIdx); } @@ -1219,16 +1229,18 @@ void QTextEngine::shapeTextWithHarfbuzz(int item) const shaper_item.glyphIndicesPresent = true; + remaining_glyphs -= shaper_item.initialGlyphCount; + do { - ensureSpace(glyph_pos + shaper_item.num_glyphs); - initialGlyphs = availableGlyphs(&si).mid(0, entire_shaper_item.num_glyphs); - shaper_item.num_glyphs = layoutData->glyphLayout.numGlyphs - layoutData->used - glyph_pos; + ensureSpace(glyph_pos + shaper_item.num_glyphs + remaining_glyphs); - const QGlyphLayout g = availableGlyphs(&si); - shaper_item.glyphs = g.glyphs + glyph_pos; - shaper_item.attributes = g.attributes + glyph_pos; - shaper_item.advances = reinterpret_cast(g.advances_x + glyph_pos); - shaper_item.offsets = reinterpret_cast(g.offsets + glyph_pos); + const QGlyphLayout g = availableGlyphs(&si).mid(glyph_pos); + moveGlyphData(g.mid(shaper_item.num_glyphs), g.mid(shaper_item.initialGlyphCount), remaining_glyphs); + + shaper_item.glyphs = g.glyphs; + shaper_item.attributes = g.attributes; + shaper_item.advances = reinterpret_cast(g.advances_x); + shaper_item.offsets = reinterpret_cast(g.offsets); if (shaper_item.glyphIndicesPresent) { for (hb_uint32 i = 0; i < shaper_item.initialGlyphCount; ++i) @@ -1241,18 +1253,18 @@ void QTextEngine::shapeTextWithHarfbuzz(int item) const } while (!qShapeItem(&shaper_item)); // this does the actual shaping via harfbuzz. QGlyphLayout g = availableGlyphs(&si).mid(glyph_pos, shaper_item.num_glyphs); + moveGlyphData(g.mid(shaper_item.num_glyphs), g.mid(shaper_item.initialGlyphCount), remaining_glyphs); - for (hb_uint32 i = 0; i < shaper_item.item.length; ++i) { + for (hb_uint32 i = 0; i < shaper_item.num_glyphs; ++i) g.glyphs[i] = g.glyphs[i] | (engineIdx << 24); + + for (hb_uint32 i = 0; i < shaper_item.item.length; ++i) shaper_item.log_clusters[i] += glyph_pos; - } if (kerningEnabled && !shaper_item.kerning_applied) font->doKerning(&g, option.useDesignMetrics() ? QFlag(QTextEngine::DesignMetrics) : QFlag(0)); glyph_pos += shaper_item.num_glyphs; - - initial_glyph_pos += shaper_item.initialGlyphCount; } // qDebug(" -> item: script=%d num_glyphs=%d", shaper_item.script, shaper_item.num_glyphs); -- cgit v0.12 From 759b7ee720fa365f93fe02ecb5b842adce81d02d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 22 May 2009 14:14:31 +0200 Subject: Fixed potential bug caused by change b89efc8e7f32. If ensureSpace causes the layoutData to reallocate then the initialGlyphs pointers will no longer be valid. Reviewed-by: Simon Hausmann --- src/gui/text/qtextengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index da1ab25..d41d414 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -1219,7 +1219,7 @@ void QTextEngine::shapeTextWithHarfbuzz(int item) const QFontEngine *actualFontEngine = font; uint engineIdx = 0; if (font->type() == QFontEngine::Multi) { - engineIdx = uint(initialGlyphs.glyphs[glyph_pos] >> 24); + engineIdx = uint(availableGlyphs(&si).glyphs[glyph_pos] >> 24); actualFontEngine = static_cast(font)->engine(engineIdx); } -- cgit v0.12 From 1cfb5bcaa2cab142479ee975e25d9f605f852dad Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 22 May 2009 14:30:01 +0200 Subject: Don't loop around sigaction because it can't return EINTR. Asked by Oswald. Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qprocess_unix.cpp | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index 33d4a47..1fedd55 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -140,15 +140,6 @@ static void qt_native_close(int fd) } while (ret == -1 && errno == EINTR); } -static void qt_native_sigaction(int signum, const struct sigaction *act, - struct sigaction *oldact) -{ - int ret; - do { - ret = ::sigaction(signum, act, oldact); - } while (ret == -1 && errno == EINTR); -} - static void qt_native_dup2(int oldfd, int newfd) { int ret; @@ -255,7 +246,7 @@ QProcessManager::QProcessManager() memset(&action, 0, sizeof(action)); action.sa_handler = qt_sa_sigchld_handler; action.sa_flags = SA_NOCLDSTOP; - qt_native_sigaction(SIGCHLD, &action, &oldAction); + ::sigaction(SIGCHLD, &action, &oldAction); if (oldAction.sa_handler != qt_sa_sigchld_handler) qt_sa_old_sigchld_handler = oldAction.sa_handler; } @@ -282,9 +273,9 @@ QProcessManager::~QProcessManager() memset(&action, 0, sizeof(action)); action.sa_handler = qt_sa_old_sigchld_handler; action.sa_flags = SA_NOCLDSTOP; - qt_native_sigaction(SIGCHLD, &action, &oldAction); + ::sigaction(SIGCHLD, &action, &oldAction); if (oldAction.sa_handler != qt_sa_sigchld_handler) { - qt_native_sigaction(SIGCHLD, &oldAction, 0); + ::sigaction(SIGCHLD, &oldAction, 0); } } @@ -900,7 +891,7 @@ static void qt_ignore_sigpipe() struct sigaction noaction; memset(&noaction, 0, sizeof(noaction)); noaction.sa_handler = SIG_IGN; - qt_native_sigaction(SIGPIPE, &noaction, 0); + ::sigaction(SIGPIPE, &noaction, 0); } } @@ -1270,7 +1261,7 @@ bool QProcessPrivate::startDetached(const QString &program, const QStringList &a struct sigaction noaction; memset(&noaction, 0, sizeof(noaction)); noaction.sa_handler = SIG_IGN; - qt_native_sigaction(SIGPIPE, &noaction, 0); + ::sigaction(SIGPIPE, &noaction, 0); ::setsid(); @@ -1316,7 +1307,7 @@ bool QProcessPrivate::startDetached(const QString &program, const QStringList &a struct sigaction noaction; memset(&noaction, 0, sizeof(noaction)); noaction.sa_handler = SIG_IGN; - qt_native_sigaction(SIGPIPE, &noaction, 0); + ::sigaction(SIGPIPE, &noaction, 0); // '\1' means execv failed char c = '\1'; @@ -1327,7 +1318,7 @@ bool QProcessPrivate::startDetached(const QString &program, const QStringList &a struct sigaction noaction; memset(&noaction, 0, sizeof(noaction)); noaction.sa_handler = SIG_IGN; - qt_native_sigaction(SIGPIPE, &noaction, 0); + ::sigaction(SIGPIPE, &noaction, 0); // '\2' means internal error char c = '\2'; -- cgit v0.12 From 562adecf4f938f593674f03b425a79b89e238518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 15 Apr 2009 14:17:20 +0200 Subject: Don't block copy sequential files in QFile::rename Block copying a sequential file is potentially a destructive operation, because there is no guarantee copy+remove will succeed. In these cases the fallback should not be tried. The user is better equipped to decide how to handle such failures and to ensure no data losses occur, e.g., copy without removing the original file. Reviewed-by: MariusSO Reviewed-by: Peter Hartmann Reviewed-by: Thiago --- src/corelib/io/qfile.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index d7da800..4110494 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -718,6 +718,11 @@ QFile::rename(const QString &newName) return true; } + if (isSequential()) { + d->setError(QFile::RenameError, tr("Will not rename sequential file using block copy")); + return false; + } + QFile in(fileName()); QFile out(newName); if (in.open(QIODevice::ReadOnly)) { -- cgit v0.12 From f1e9c0f3d22d611bfaa14c30a34e6042500a0cb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 15 Apr 2009 14:24:43 +0200 Subject: Allow renaming QTemporaryFiles on windows Changed the fallback implementation to use 'this' instead of a new QFile. This allows a QTemporaryFile to be block-copied to the destination and the source to be removed (QTemporaryFile is special because it isn't really closed). Reviewed-by: Peter Hartmann Reviewed-by: Thiago --- src/corelib/io/qfile.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index 4110494..d3cee9a 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -723,26 +723,25 @@ QFile::rename(const QString &newName) return false; } - QFile in(fileName()); QFile out(newName); - if (in.open(QIODevice::ReadOnly)) { + if (open(QIODevice::ReadOnly)) { if (out.open(QIODevice::WriteOnly | QIODevice::Truncate)) { bool error = false; char block[4096]; - qint64 read; - while ((read = in.read(block, sizeof(block))) > 0) { - if (read != out.write(block, read)) { + qint64 bytes; + while ((bytes = read(block, sizeof(block))) > 0) { + if (bytes != out.write(block, bytes)) { d->setError(QFile::RenameError, out.errorString()); error = true; break; } } - if (read == -1) { - d->setError(QFile::RenameError, in.errorString()); + if (bytes == -1) { + d->setError(QFile::RenameError, errorString()); error = true; } if(!error) { - if (!in.remove()) { + if (!remove()) { d->setError(QFile::RenameError, tr("Cannot remove source file")); error = true; } @@ -751,10 +750,12 @@ QFile::rename(const QString &newName) out.remove(); else setFileName(newName); + close(); return !error; } + close(); } - d->setError(QFile::RenameError, out.isOpen() ? in.errorString() : out.errorString()); + d->setError(QFile::RenameError, out.isOpen() ? errorString() : out.errorString()); } return false; } -- cgit v0.12 From fd7cb7faa765835de6e7beb24f018c417d9ad7d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 13 May 2009 17:13:48 +0200 Subject: QFile::copy: close source file when using fallback mechanism Also added check in test case for rename fallback. Task-number: 165920 Reviewed-by: Thiago --- src/corelib/io/qfile.cpp | 1 + tests/auto/qfile/copy-fallback.qrc | 5 +++++ tests/auto/qfile/test/test.pro | 2 +- tests/auto/qfile/tst_qfile.cpp | 30 ++++++++++++++++++++++++++++++ 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 tests/auto/qfile/copy-fallback.qrc diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index d3cee9a..a0bd8b4 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -914,6 +914,7 @@ QFile::copy(const QString &newName) out.setAutoRemove(false); #endif } + close(); } if(!error) { QFile::setPermissions(newName, permissions()); diff --git a/tests/auto/qfile/copy-fallback.qrc b/tests/auto/qfile/copy-fallback.qrc new file mode 100644 index 0000000..864491f --- /dev/null +++ b/tests/auto/qfile/copy-fallback.qrc @@ -0,0 +1,5 @@ + + + copy-fallback.qrc + + diff --git a/tests/auto/qfile/test/test.pro b/tests/auto/qfile/test/test.pro index 68f4c05..8d26f5e 100644 --- a/tests/auto/qfile/test/test.pro +++ b/tests/auto/qfile/test/test.pro @@ -17,7 +17,7 @@ QT = core network DEFINES += SRCDIR=\\\"$$PWD/../\\\" } -RESOURCES += ../qfile.qrc ../rename-fallback.qrc +RESOURCES += ../qfile.qrc ../rename-fallback.qrc ../copy-fallback.qrc TARGET = ../tst_qfile diff --git a/tests/auto/qfile/tst_qfile.cpp b/tests/auto/qfile/tst_qfile.cpp index 98e1859..7e28d12 100644 --- a/tests/auto/qfile/tst_qfile.cpp +++ b/tests/auto/qfile/tst_qfile.cpp @@ -125,6 +125,7 @@ private slots: void copy(); void copyRemovesTemporaryFile() const; void copyShouldntOverwrite(); + void copyFallback(); void link(); void linkToDir(); void absolutePathLinkToRelativePath(); @@ -213,6 +214,9 @@ void tst_QFile::cleanup() // TODO: Add cleanup code here. // This will be executed immediately after each test is run. + // for copyFallback() + QFile::remove("file-copy-destination.txt"); + // for renameFallback() QFile::remove("file-rename-destination.txt"); @@ -907,6 +911,31 @@ void tst_QFile::copyShouldntOverwrite() QFile::remove("tst_qfile.cpy"); } +void tst_QFile::copyFallback() +{ + // Using a resource file to trigger QFile::copy's fallback handling + QFile file(":/copy-fallback.qrc"); + QFile::remove("file-copy-destination.txt"); + + QVERIFY2(file.exists(), "test precondition"); + QVERIFY2(!QFile::exists("file-copy-destination.txt"), "test precondition"); + + // Fallback copy of closed file. + QVERIFY(file.copy("file-copy-destination.txt")); + QVERIFY(QFile::exists("file-copy-destination.txt")); + QVERIFY(!file.isOpen()); + + QVERIFY(QFile::remove("file-copy-destination.txt")); + + // Fallback copy of open file. + QVERIFY(file.open(QIODevice::ReadOnly)); + QVERIFY(file.copy("file-copy-destination.txt")); + QVERIFY(QFile::exists("file-copy-destination.txt")); + QVERIFY(!file.isOpen()); + + QFile::remove("file-copy-destination.txt"); +} + #ifdef Q_OS_WIN #include #include @@ -2081,6 +2110,7 @@ void tst_QFile::renameFallback() QVERIFY(!file.rename("file-rename-destination.txt")); QVERIFY(!QFile::exists("file-rename-destination.txt")); + QVERIFY(!file.isOpen()); } void tst_QFile::renameMultiple() -- cgit v0.12 From 3580f5b4d002cca714d443054f8cdd6aefca3287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 15 Apr 2009 14:30:47 +0200 Subject: QFile::rename fallback: reset permissions and error state on success Fallback implementation for rename operation should try to copy permissions from the original file to the destination file. Note that failures at this point are not treated as errors. Errors previously set by the native fileEngine are also reset before returning. Reviewed-by: Peter Hartmann Reviewed-by: Thiago --- src/corelib/io/qfile.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index a0bd8b4..10b812b 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -748,8 +748,11 @@ QFile::rename(const QString &newName) } if (error) out.remove(); - else + else { + setPermissions(permissions()); + unsetError(); setFileName(newName); + } close(); return !error; } -- cgit v0.12 From 3672deb3b35fc0660c58a8ecc741b989dd0bfc8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Tue, 19 May 2009 14:02:12 +0200 Subject: Fix auto test When copying a resource file to the native file system the (read-only) permissions also get copied. On Windows platforms, this was preventing a test file from being deleted. Reviewed-by: Peter Hartmann Reviewed-by: Thiago --- tests/auto/qfile/tst_qfile.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/auto/qfile/tst_qfile.cpp b/tests/auto/qfile/tst_qfile.cpp index 7e28d12..9ee4d7c 100644 --- a/tests/auto/qfile/tst_qfile.cpp +++ b/tests/auto/qfile/tst_qfile.cpp @@ -215,7 +215,11 @@ void tst_QFile::cleanup() // This will be executed immediately after each test is run. // for copyFallback() - QFile::remove("file-copy-destination.txt"); + if (QFile::exists("file-copy-destination.txt")) { + QFile::setPermissions("file-copy-destination.txt", + QFile::ReadOwner | QFile::WriteOwner); + QFile::remove("file-copy-destination.txt"); + } // for renameFallback() QFile::remove("file-rename-destination.txt"); @@ -925,6 +929,9 @@ void tst_QFile::copyFallback() QVERIFY(QFile::exists("file-copy-destination.txt")); QVERIFY(!file.isOpen()); + // Need to reset permissions on Windows to be able to delete + QVERIFY(QFile::setPermissions("file-copy-destination.txt", + QFile::ReadOwner | QFile::WriteOwner)); QVERIFY(QFile::remove("file-copy-destination.txt")); // Fallback copy of open file. -- cgit v0.12 From 662e8997e9777c6661dde2134e43e35963a12cb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 15 Apr 2009 14:34:57 +0200 Subject: QTemporaryFile: don't clear filePath if remove fails Reviewed-by: MariusSO Reviewed-by: Peter Hartmann Reviewed-by: Thiago --- src/corelib/io/qtemporaryfile.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp index 6a9125c..b0809c6 100644 --- a/src/corelib/io/qtemporaryfile.cpp +++ b/src/corelib/io/qtemporaryfile.cpp @@ -364,9 +364,11 @@ bool QTemporaryFileEngine::remove() // Since the QTemporaryFileEngine::close() does not really close the file, // we must explicitly call QFSFileEngine::close() before we remove it. QFSFileEngine::close(); - bool removed = QFSFileEngine::remove(); - d->filePath.clear(); - return removed; + if (QFSFileEngine::remove()) { + d->filePath.clear(); + return true; + } + return false; } bool QTemporaryFileEngine::close() -- cgit v0.12 From cfa01206e38d120c0ddb17aec7358aadff30b6f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Mon, 18 May 2009 12:40:01 +0200 Subject: QTemporaryFile would forget fileName while file was "closed" Note: this showed even if the file descriptor was kept open. Reviewed-by: Peter Hartmann Reviewed-by: Thiago --- src/corelib/io/qtemporaryfile.cpp | 3 ++- tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp index b0809c6..11e88e2 100644 --- a/src/corelib/io/qtemporaryfile.cpp +++ b/src/corelib/io/qtemporaryfile.cpp @@ -603,7 +603,8 @@ void QTemporaryFile::setAutoRemove(bool b) QString QTemporaryFile::fileName() const { - if(!isOpen()) + Q_D(const QTemporaryFile); + if(d->fileName.isEmpty()) return QString(); return fileEngine()->fileName(QAbstractFileEngine::DefaultName); } diff --git a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp index 2daa0f6..c6a43ff 100644 --- a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp +++ b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp @@ -77,6 +77,7 @@ private slots: void fileTemplate_data(); void getSetCheck(); void fileName(); + void fileNameIsEmpty(); void autoRemove(); void write(); void openCloseOpenClose(); @@ -189,6 +190,27 @@ void tst_QTemporaryFile::fileName() QCOMPARE(absoluteFilePath, absoluteTempPath); } +void tst_QTemporaryFile::fileNameIsEmpty() +{ + QString filename; + { + QTemporaryFile file; + QVERIFY(file.fileName().isEmpty()); + + QVERIFY(file.open()); + QVERIFY(!file.fileName().isEmpty()); + + filename = file.fileName(); + QVERIFY(QFile::exists(filename)); + + file.close(); + QVERIFY(!file.isOpen()); + QVERIFY(QFile::exists(filename)); + QVERIFY(!file.fileName().isEmpty()); + } + QVERIFY(!QFile::exists(filename)); +} + void tst_QTemporaryFile::autoRemove() { // Test auto remove @@ -358,6 +380,7 @@ void tst_QTemporaryFile::rename() QVERIFY(file.rename("temporary-file.txt")); QVERIFY(!dir.exists(tempname)); QVERIFY(dir.exists("temporary-file.txt")); + QCOMPARE(file.fileName(), QString("temporary-file.txt")); } QVERIFY(!dir.exists(tempname)); -- cgit v0.12 From 70f616238e77d866420f2c6e12afe04b529fe808 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 20 May 2009 20:13:51 +0200 Subject: Documentation fix We souldn't be returning an empty string for the fileName, just because the file is closed. E.g., after a rename, the file will be closed, but should still have a name. Reviewed-by: Thiago --- src/corelib/io/qtemporaryfile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp index 11e88e2..e83d7e9 100644 --- a/src/corelib/io/qtemporaryfile.cpp +++ b/src/corelib/io/qtemporaryfile.cpp @@ -432,8 +432,8 @@ QTemporaryFilePrivate::~QTemporaryFilePrivate() file will exist and be kept open internally by QTemporaryFile. The file name of the temporary file can be found by calling fileName(). - Note that this is only defined while the file is open; the function returns - an empty string before the file is opened and after it is closed. + Note that this is only defined after the file is first opened; the function + returns an empty string before this. A temporary file will have some static part of the name and some part that is calculated to be unique. The default filename \c -- cgit v0.12 From 5cb1ed45ba55dbc9752e0f6f47cc6d1525464646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Mon, 18 May 2009 13:01:52 +0200 Subject: QTemporaryFile: handle failures from QFSFileEngine::open(mode, fd) For now, this only happens if Append mode is requested and we're unable to seek to the end of the file. Theoretically, this could change in the future so it's better to err on the safe side. Reviewed-by: Thiago --- src/corelib/io/qtemporaryfile.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp index e83d7e9..b6eff94 100644 --- a/src/corelib/io/qtemporaryfile.cpp +++ b/src/corelib/io/qtemporaryfile.cpp @@ -322,7 +322,6 @@ bool QTemporaryFileEngine::open(QIODevice::OpenMode openMode) qfilename += QLatin1String(".XXXXXX"); int suffixLength = qfilename.length() - (qfilename.lastIndexOf(QLatin1String("XXXXXX"), -1, Qt::CaseSensitive) + 6); - d->closeFileHandle = true; char *filename = qstrdup(qfilename.toLocal8Bit()); #ifndef Q_WS_WIN @@ -330,16 +329,19 @@ bool QTemporaryFileEngine::open(QIODevice::OpenMode openMode) if (fd != -1) { // First open the fd as an external file descriptor to // initialize the engine properly. - QFSFileEngine::open(openMode, fd); + if (QFSFileEngine::open(openMode, fd)) { - // Allow the engine to close the handle even if it's "external". - d->closeFileHandle = true; + // Allow the engine to close the handle even if it's "external". + d->closeFileHandle = true; - // Restore the file names (open() resets them). - d->filePath = QString::fromLocal8Bit(filename); //changed now! - d->nativeInitFileName(); - delete [] filename; - return true; + // Restore the file names (open() resets them). + d->filePath = QString::fromLocal8Bit(filename); //changed now! + d->nativeInitFileName(); + delete [] filename; + return true; + } + + QT_CLOSE(fd); } delete [] filename; setError(errno == EMFILE ? QFile::ResourceError : QFile::OpenError, qt_error_string(errno)); -- cgit v0.12 From f1793cbff8aa9b4adcb5fd511e495f7e96811e2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Mon, 18 May 2009 14:58:44 +0200 Subject: Unconditionally open temporary files in ReadWrite mode Although QTemporaryFile hides QFile::open(OpenMode), this function is still available when accessing instance methods through the base class. Unconditionally setting ReadWrite allows the temporary file to be re-opened with different flags. Task-number: 248223 Reviewed-by: Thiago --- src/corelib/io/qtemporaryfile.cpp | 1 + tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp index b6eff94..3f8f978 100644 --- a/src/corelib/io/qtemporaryfile.cpp +++ b/src/corelib/io/qtemporaryfile.cpp @@ -720,6 +720,7 @@ bool QTemporaryFile::open(OpenMode flags) return true; } + flags |= QIODevice::ReadWrite; if (QFile::open(flags)) { d->fileName = d->fileEngine->fileName(QAbstractFileEngine::DefaultName); return true; diff --git a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp index c6a43ff..26f5f40 100644 --- a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp +++ b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp @@ -87,6 +87,8 @@ private slots: void stressTest(); void rename(); void renameFdLeak(); + void reOpenThroughQFile(); + public: }; @@ -424,5 +426,18 @@ void tst_QTemporaryFile::renameFdLeak() #endif } +void tst_QTemporaryFile::reOpenThroughQFile() +{ + QByteArray data("abcdefghij"); + + QTemporaryFile file; + QVERIFY(((QFile &)file).open(QIODevice::WriteOnly)); + QCOMPARE(file.write(data), (qint64)data.size()); + + file.close(); + QVERIFY(file.open()); + QCOMPARE(file.readAll(), data); +} + QTEST_MAIN(tst_QTemporaryFile) #include "tst_qtemporaryfile.moc" -- cgit v0.12 From 27369e563263e82a9c5747da54370eb0a225b3d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Mon, 18 May 2009 18:40:03 +0200 Subject: QTemporaryFile: really (re)open file if it has been really closed... In some circumstances, the file descriptor in QTemporaryFile is actually closed and setOpenMode alone won't give us reOpen semantics. Added function to QTemporaryFileEngine that checks if we have open file handles. On open, if we currently hold no handles, re-open the file. Trying to open a new file while we hold open handles would lead to leaks, so added an assert there, to be on the safe side. Reviewed-by: Thiago --- src/corelib/io/qtemporaryfile.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp index 3f8f978..5e08ed8 100644 --- a/src/corelib/io/qtemporaryfile.cpp +++ b/src/corelib/io/qtemporaryfile.cpp @@ -294,6 +294,7 @@ public: QTemporaryFileEngine(const QString &file) : QFSFileEngine(file) { } ~QTemporaryFileEngine(); + bool isReallyOpen(); void setFileName(const QString &file); bool open(QIODevice::OpenMode flags); @@ -306,6 +307,21 @@ QTemporaryFileEngine::~QTemporaryFileEngine() QFSFileEngine::close(); } +bool QTemporaryFileEngine::isReallyOpen() +{ + Q_D(QFSFileEngine); + + if (!((0 == d->fh) && (-1 == d->fd) +#if defined Q_OS_WIN + && (INVALID_HANDLE_VALUE == d->fileHandle) +#endif + )) + return true; + + return false; + +} + void QTemporaryFileEngine::setFileName(const QString &file) { // Really close the file, so we don't leak @@ -316,6 +332,7 @@ void QTemporaryFileEngine::setFileName(const QString &file) bool QTemporaryFileEngine::open(QIODevice::OpenMode openMode) { Q_D(QFSFileEngine); + Q_ASSERT(!isReallyOpen()); QString qfilename = d->filePath; if(!qfilename.contains(QLatin1String("XXXXXX"))) @@ -716,8 +733,10 @@ bool QTemporaryFile::open(OpenMode flags) { Q_D(QTemporaryFile); if (!d->fileName.isEmpty()) { - setOpenMode(flags); - return true; + if (static_cast(fileEngine())->isReallyOpen()) { + setOpenMode(flags); + return true; + } } flags |= QIODevice::ReadWrite; -- cgit v0.12 From 84cbe8ffa4a7189c46efca9bb6387e80ab889c5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 15 Apr 2009 14:37:35 +0200 Subject: QTemporaryFile: there's no need to keep another pointer to the engine here Lifetime of the engine is already handled by the native engine. Reviewed-by: Thiago --- src/corelib/io/qtemporaryfile.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp index 5e08ed8..ec539d4 100644 --- a/src/corelib/io/qtemporaryfile.cpp +++ b/src/corelib/io/qtemporaryfile.cpp @@ -409,17 +409,14 @@ protected: bool autoRemove; QString templateName; - mutable QTemporaryFileEngine *fileEngine; }; -QTemporaryFilePrivate::QTemporaryFilePrivate() : autoRemove(true), fileEngine(0) +QTemporaryFilePrivate::QTemporaryFilePrivate() : autoRemove(true) { } QTemporaryFilePrivate::~QTemporaryFilePrivate() { - delete fileEngine; - fileEngine = 0; } //************* QTemporaryFile -- cgit v0.12 From 1044e75822270d702a3e9f14a87954321984c942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Mon, 18 May 2009 20:24:20 +0200 Subject: QTemporaryFileEngine now tracks if a fileName has been generated With recent changes to QTemporaryFile, allowing the file to be closed, the engine has to keep track of whether a fileName has already been generated, so we don't generate new files after the first one. If the file is closed but we already have a name for it, then just forward the call to the base file engine. Reviewed-by: Thiago --- src/corelib/io/qtemporaryfile.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp index ec539d4..564ec59 100644 --- a/src/corelib/io/qtemporaryfile.cpp +++ b/src/corelib/io/qtemporaryfile.cpp @@ -291,7 +291,11 @@ class QTemporaryFileEngine : public QFSFileEngine { Q_DECLARE_PRIVATE(QFSFileEngine) public: - QTemporaryFileEngine(const QString &file) : QFSFileEngine(file) { } + QTemporaryFileEngine(const QString &file, bool fileIsTemplate = true) + : QFSFileEngine(file), filePathIsTemplate(fileIsTemplate) + { + } + ~QTemporaryFileEngine(); bool isReallyOpen(); @@ -300,6 +304,8 @@ public: bool open(QIODevice::OpenMode flags); bool remove(); bool close(); + + bool filePathIsTemplate; }; QTemporaryFileEngine::~QTemporaryFileEngine() @@ -334,6 +340,9 @@ bool QTemporaryFileEngine::open(QIODevice::OpenMode openMode) Q_D(QFSFileEngine); Q_ASSERT(!isReallyOpen()); + if (!filePathIsTemplate) + return QFSFileEngine::open(openMode); + QString qfilename = d->filePath; if(!qfilename.contains(QLatin1String("XXXXXX"))) qfilename += QLatin1String(".XXXXXX"); @@ -353,6 +362,7 @@ bool QTemporaryFileEngine::open(QIODevice::OpenMode openMode) // Restore the file names (open() resets them). d->filePath = QString::fromLocal8Bit(filename); //changed now! + filePathIsTemplate = false; d->nativeInitFileName(); delete [] filename; return true; @@ -370,6 +380,7 @@ bool QTemporaryFileEngine::open(QIODevice::OpenMode openMode) } d->filePath = QString::fromLocal8Bit(filename); + filePathIsTemplate = false; d->nativeInitFileName(); d->closeFileHandle = true; delete [] filename; @@ -714,8 +725,12 @@ QTemporaryFile *QTemporaryFile::createLocalFile(QFile &file) QAbstractFileEngine *QTemporaryFile::fileEngine() const { Q_D(const QTemporaryFile); - if(!d->fileEngine) - d->fileEngine = new QTemporaryFileEngine(d->templateName); + if(!d->fileEngine) { + if (d->fileName.isEmpty()) + d->fileEngine = new QTemporaryFileEngine(d->templateName); + else + d->fileEngine = new QTemporaryFileEngine(d->fileName, false); + } return d->fileEngine; } -- cgit v0.12 From ba706d2564f1181fa4cc596a46bb2a041c62c28f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Mon, 18 May 2009 13:08:04 +0200 Subject: QTemporaryFile: really close files before renaming This gets temporary file renaming working on Windows, without requiring block-copying. While we could #ifdef this behavior for Windows, it's preferrable to maintain consistency in the exposed interface. Reviewed-by: Thiago --- src/corelib/io/qtemporaryfile.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp index 564ec59..7c0b018 100644 --- a/src/corelib/io/qtemporaryfile.cpp +++ b/src/corelib/io/qtemporaryfile.cpp @@ -303,6 +303,7 @@ public: bool open(QIODevice::OpenMode flags); bool remove(); + bool rename(const QString &newName); bool close(); bool filePathIsTemplate; @@ -401,6 +402,12 @@ bool QTemporaryFileEngine::remove() return false; } +bool QTemporaryFileEngine::rename(const QString &newName) +{ + QFSFileEngine::close(); + return QFSFileEngine::rename(newName); +} + bool QTemporaryFileEngine::close() { // Don't close the file, just seek to the front. -- cgit v0.12 From a0396c8c68aca446e68434e516bd46d749093b0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Mon, 18 May 2009 11:51:12 +0200 Subject: Reset openMode to NotOpen when returning false from QFile::open() When connecting to an open file descriptor, set the openMode in the file system engine, as is done for file handles. Reviewed-by: Thiago --- src/corelib/io/qfsfileengine.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp index 61ea7cc..1c8f0e9 100644 --- a/src/corelib/io/qfsfileengine.cpp +++ b/src/corelib/io/qfsfileengine.cpp @@ -312,6 +312,10 @@ bool QFSFileEnginePrivate::openFh(QIODevice::OpenMode openMode, FILE *fh) if (ret == -1) { q->setError(errno == EMFILE ? QFile::ResourceError : QFile::OpenError, qt_error_string(int(errno))); + + this->openMode = QIODevice::NotOpen; + this->fh = 0; + return false; } } @@ -335,6 +339,7 @@ bool QFSFileEngine::open(QIODevice::OpenMode openMode, int fd) if ((openMode & QFile::WriteOnly) && !(openMode & (QFile::ReadOnly | QFile::Append))) openMode |= QFile::Truncate; + d->openMode = openMode; d->lastFlushFailed = false; d->closeFileHandle = false; d->nativeFilePath.clear(); @@ -367,6 +372,10 @@ bool QFSFileEnginePrivate::openFd(QIODevice::OpenMode openMode, int fd) if (ret == -1) { q->setError(errno == EMFILE ? QFile::ResourceError : QFile::OpenError, qt_error_string(int(errno))); + + this->openMode = QIODevice::NotOpen; + this->fd = -1; + return false; } } -- cgit v0.12 From 8b2a16bd7f434a159e34e93dbffc983927a0a143 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Fri, 22 May 2009 13:20:10 +0200 Subject: Fixed compilation with -qtnamespace Task-number: 254333 Reviewed-by: Andy Shaw --- src/corelib/io/qtemporaryfile.cpp | 4 +++- src/corelib/kernel/qsharedmemory_unix.cpp | 4 ++-- src/corelib/kernel/qsystemsemaphore_p.h | 4 ++-- src/corelib/kernel/qtranslator.cpp | 4 ++-- src/network/access/qhttp.cpp | 4 ++-- src/network/kernel/qnetworkproxy.cpp | 4 ++-- src/network/kernel/qurlinfo.cpp | 4 ++-- src/network/socket/qhttpsocketengine.cpp | 4 ++-- src/scripttools/debugging/qscriptenginedebugger.cpp | 13 ++++++++++--- 9 files changed, 27 insertions(+), 18 deletions(-) diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp index 7c0b018..b4d8a48 100644 --- a/src/corelib/io/qtemporaryfile.cpp +++ b/src/corelib/io/qtemporaryfile.cpp @@ -766,6 +766,8 @@ bool QTemporaryFile::open(OpenMode flags) return false; } +QT_END_NAMESPACE + #endif // QT_NO_TEMPORARYFILE -QT_END_NAMESPACE + diff --git a/src/corelib/kernel/qsharedmemory_unix.cpp b/src/corelib/kernel/qsharedmemory_unix.cpp index 487c653..61d56f4 100644 --- a/src/corelib/kernel/qsharedmemory_unix.cpp +++ b/src/corelib/kernel/qsharedmemory_unix.cpp @@ -49,10 +49,10 @@ #include -QT_BEGIN_NAMESPACE - #ifndef QT_NO_SHAREDMEMORY +QT_BEGIN_NAMESPACE + #include #include #include diff --git a/src/corelib/kernel/qsystemsemaphore_p.h b/src/corelib/kernel/qsystemsemaphore_p.h index 81d4f10..a4a7389 100644 --- a/src/corelib/kernel/qsystemsemaphore_p.h +++ b/src/corelib/kernel/qsystemsemaphore_p.h @@ -101,9 +101,9 @@ public: QSystemSemaphore::SystemSemaphoreError error; }; -#endif // QT_NO_SYSTEMSEMAPHORE +QT_END_NAMESPACE +#endif // QT_NO_SYSTEMSEMAPHORE -QT_END_NAMESPACE #endif // QSYSTEMSEMAPHORE_P_H diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp index 77d6599..3e4b467 100644 --- a/src/corelib/kernel/qtranslator.cpp +++ b/src/corelib/kernel/qtranslator.cpp @@ -819,6 +819,6 @@ bool QTranslator::isEmpty() const Use translate(\a context, \a sourceText, \a comment) instead. */ -#endif // QT_NO_TRANSLATION - QT_END_NAMESPACE + +#endif // QT_NO_TRANSLATION diff --git a/src/network/access/qhttp.cpp b/src/network/access/qhttp.cpp index 7d14ab6..30befb3 100644 --- a/src/network/access/qhttp.cpp +++ b/src/network/access/qhttp.cpp @@ -64,10 +64,10 @@ # include "qtimer.h" #endif -QT_BEGIN_NAMESPACE - #ifndef QT_NO_HTTP +QT_BEGIN_NAMESPACE + class QHttpNormalRequest; class QHttpRequest { diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp index 62bdfc7..fd3a85a 100644 --- a/src/network/kernel/qnetworkproxy.cpp +++ b/src/network/kernel/qnetworkproxy.cpp @@ -1258,6 +1258,6 @@ QList QNetworkProxyFactory::proxyForQuery(const QNetworkProxyQuer return globalNetworkProxy()->proxyForQuery(query); } -#endif // QT_NO_NETWORKPROXY - QT_END_NAMESPACE + +#endif // QT_NO_NETWORKPROXY diff --git a/src/network/kernel/qurlinfo.cpp b/src/network/kernel/qurlinfo.cpp index 255c9ea..d90c480 100644 --- a/src/network/kernel/qurlinfo.cpp +++ b/src/network/kernel/qurlinfo.cpp @@ -726,6 +726,6 @@ bool QUrlInfo::isValid() const return d != 0; } -#endif // QT_NO_URLINFO - QT_END_NAMESPACE + +#endif // QT_NO_URLINFO diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp index 540c443..5a2a746 100644 --- a/src/network/socket/qhttpsocketengine.cpp +++ b/src/network/socket/qhttpsocketengine.cpp @@ -768,6 +768,6 @@ QAbstractSocketEngine *QHttpSocketEngineHandler::createSocketEngine(int, QObject return 0; } -#endif - QT_END_NAMESPACE + +#endif diff --git a/src/scripttools/debugging/qscriptenginedebugger.cpp b/src/scripttools/debugging/qscriptenginedebugger.cpp index e35bd1d..0f8b600 100644 --- a/src/scripttools/debugging/qscriptenginedebugger.cpp +++ b/src/scripttools/debugging/qscriptenginedebugger.cpp @@ -63,16 +63,23 @@ #include #include +// this has to be outside the namespace +static void initScriptEngineDebuggerResources() +{ + Q_INIT_RESOURCE(scripttools_debugging); +} + +QT_BEGIN_NAMESPACE + class QtScriptDebuggerResourceInitializer { public: QtScriptDebuggerResourceInitializer() { - Q_INIT_RESOURCE(scripttools_debugging); + // call outside-the-namespace function + initScriptEngineDebuggerResources(); } }; -QT_BEGIN_NAMESPACE - /*! \since 4.5 \class QScriptEngineDebugger -- cgit v0.12 From d85e7bbbabf4383337bd3592f32d337246224175 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Fri, 22 May 2009 15:41:27 +0300 Subject: Fixed qsslsocket auto test compilation for Symbian. --- tests/auto/qsslsocket/qsslsocket.pro | 26 +++++++++++++------------- tests/auto/qsslsocket/tst_qsslsocket.cpp | 10 +++++++--- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/tests/auto/qsslsocket/qsslsocket.pro b/tests/auto/qsslsocket/qsslsocket.pro index f288866..8f61318 100644 --- a/tests/auto/qsslsocket/qsslsocket.pro +++ b/tests/auto/qsslsocket/qsslsocket.pro @@ -7,12 +7,6 @@ QT -= gui TARGET = tst_qsslsocket -!wince* { -DEFINES += SRCDIR=\\\"$$PWD/\\\" -} else { -DEFINES += SRCDIR=\\\"./\\\" -} - win32 { CONFIG(debug, debug|release) { DESTDIR = debug @@ -21,14 +15,20 @@ win32 { } } - -symbian:{ +wince* { + DEFINES += SRCDIR=\\\"./\\\" + + certFiles.sources = certs ssl.tar.gz + certFiles.path = . + DEPLOYMENT += certFiles +} else:symbian { DEFINES += QSSLSOCKET_CERTUNTRUSTED_WORKAROUND TARGET.EPOCHEAPSIZE="0x100 0x1000000" TARGET.CAPABILITY="ALL -TCB" -} -wince*|symbian: { - certFiles.sources = certs ssl.tar.gz - certFiles.path = . - DEPLOYMENT += certFiles + + certFiles.sources = certs ssl.tar.gz + certFiles.path = . + DEPLOYMENT += certFiles +} else { + DEFINES += SRCDIR=\\\"$$PWD/\\\" } diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp index 59857e5..6147551 100644 --- a/tests/auto/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp @@ -76,6 +76,10 @@ Q_DECLARE_METATYPE(QSslError) #define QSSLSOCKET_CERTUNTRUSTED_WORKAROUND #endif +#ifdef Q_OS_SYMBIAN +#define SRCDIR "" +#endif + #ifndef QT_NO_OPENSSL class QSslSocketPtr: public QSharedPointer { @@ -528,17 +532,17 @@ void tst_QSslSocket::sslErrors() socket->connectToHostEncrypted(host, port); socket->waitForEncrypted(5000); - SslErrorList list; + SslErrorList output; foreach (QSslError error, socket->sslErrors()) { //printf("error = %s\n", error.errorString().toAscii().data()); - list << error.error(); + output << error.error(); } #ifdef QSSLSOCKET_CERTUNTRUSTED_WORKAROUND if (output.last() == QSslError::CertificateUntrusted) output.takeLast(); #endif - QCOMPARE(list, errors); + QCOMPARE(output, expected); } void tst_QSslSocket::addCaCertificate() -- cgit v0.12 From 751e0f1b70cb0c80e88f99e5137329d6f4b76562 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 22 May 2009 14:58:06 +0200 Subject: qdoc: Moved some qdoc comments into the .cpp file common to all packages. Task-number: 252494 --- src/corelib/io/qfsfileengine.cpp | 113 +++++++++++++++++++++++++++++++++++ src/corelib/io/qfsfileengine_win.cpp | 83 ------------------------- 2 files changed, 113 insertions(+), 83 deletions(-) diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp index 61ea7cc..99c1909 100644 --- a/src/corelib/io/qfsfileengine.cpp +++ b/src/corelib/io/qfsfileengine.cpp @@ -868,6 +868,119 @@ bool QFSFileEngine::supportsExtension(Extension extension) const return false; } +/*! \fn bool QFSFileEngine::caseSensitive() const + Returns true for Windows, false for Unix. +*/ + +/*! \fn bool QFSFileEngine::copy(const QString ©Name) + + For windows, copy the file to file \a copyName. + + Not implemented for Unix. +*/ + +/*! \fn QString QFSFileEngine::currentPath(const QString &fileName) + For Unix, returns the current working directory for the file + engine. + + For Windows, returns the canonicalized form of the current path used + by the file engine for the drive specified by \a fileName. On + Windows, each drive has its own current directory, so a different + path is returned for file names that include different drive names + (e.g. A: or C:). + + \sa setCurrentPath() +*/ + +/*! \fn QFileInfoList QFSFileEngine::drives() + For Windows, returns the list of drives in the file system as a list + of QFileInfo objects. On unix, Mac OS X and Windows CE, only the + root path is returned. On Windows, this function returns all drives + (A:\, C:\, D:\, etc.). + + For Unix, the list contains just the root path "/". +*/ + +/*! \fn QString QFSFileEngine::fileName(FileName file) const + \reimp +*/ + +/*! \fn QDateTime QFSFileEngine::fileTime(FileTime time) const + \reimp +*/ + +/*! \fn QString QFSFileEngine::homePath() + Returns the home path of the current user. + + \sa rootPath() +*/ + +/*! \fn bool QFSFileEngine::isRelativePath() const + \reimp +*/ + +/*! \fn bool QFSFileEngine::link(const QString &newName) + + Creates a link from the file currently specified by fileName() to + \a newName. What a link is depends on the underlying filesystem + (be it a shortcut on Windows or a symbolic link on Unix). Returns + true if successful; otherwise returns false. +*/ + +/*! \fn bool QFSFileEngine::mkdir(const QString &name, bool createParentDirectories) const + \reimp +*/ + +/*! \fn uint QFSFileEngine::ownerId(FileOwner own) const + In Unix, if stat() is successful, the \c uid is returned if + \a own is the owner. Otherwise the \c gid is returned. If stat() + is unsuccessful, -2 is reuturned. + + For Windows, -2 is always returned. +*/ + +/*! \fn QString QFSFileEngine::owner() const + \reimp +*/ + +/*! \fn bool QFSFileEngine::remove() + \reimp +*/ + +/*! \fn bool QFSFileEngine::rename(const QString &newName) + \reimp +*/ + +/*! \fn bool QFSFileEngine::rmdir(const QString &name, bool recurseParentDirectories) const + \reimp +*/ + +/*! \fn QString QFSFileEngine::rootPath() + Returns the root path. + + \sa homePath() +*/ + +/*! \fn bool QFSFileEngine::setCurrentPath(const QString &path) + Sets the current path (e.g., for QDir), to \a path. Returns true if the + new path exists; otherwise this function does nothing, and returns false. + + \sa currentPath() +*/ + +/*! \fn bool QFSFileEngine::setPermissions(uint perms) + \reimp +*/ + +/*! \fn bool QFSFileEngine::setSize(qint64 size) + \reimp +*/ + +/*! \fn QString QFSFileEngine::tempPath() + Returns the temporary path (i.e., a path in which it is safe + to store temporary files). +*/ + QT_END_NAMESPACE #endif // QT_NO_FSFILEENGINE diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index 63506c2..b22d6c7 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -946,9 +946,6 @@ bool QFSFileEnginePrivate::nativeIsSequential() const return false; } -/*! - \reimp -*/ bool QFSFileEngine::remove() { Q_D(QFSFileEngine); @@ -959,9 +956,6 @@ bool QFSFileEngine::remove() }); } -/*! - \reimp -*/ bool QFSFileEngine::copy(const QString ©Name) { Q_D(QFSFileEngine); @@ -974,9 +968,6 @@ bool QFSFileEngine::copy(const QString ©Name) }); } -/*! - \reimp -*/ bool QFSFileEngine::rename(const QString &newName) { Q_D(QFSFileEngine); @@ -1017,9 +1008,6 @@ static inline bool mkDir(const QString &path) }); } -/*! - \reimp -*/ static inline bool rmDir(const QString &path) { QT_WA({ @@ -1029,9 +1017,6 @@ static inline bool rmDir(const QString &path) }); } -/*! - \reimp -*/ static inline bool isDirPath(const QString &dirPath, bool *existed) { QString path = dirPath; @@ -1054,9 +1039,6 @@ static inline bool isDirPath(const QString &dirPath, bool *existed) return fileAttrib & FILE_ATTRIBUTE_DIRECTORY; } -/*! - \reimp -*/ bool QFSFileEngine::mkdir(const QString &name, bool createParentDirectories) const { QString dirName = name; @@ -1097,9 +1079,6 @@ bool QFSFileEngine::mkdir(const QString &name, bool createParentDirectories) con return mkDir(name); } -/*! - \reimp -*/ bool QFSFileEngine::rmdir(const QString &name, bool recurseParentDirectories) const { QString dirName = name; @@ -1120,20 +1099,11 @@ bool QFSFileEngine::rmdir(const QString &name, bool recurseParentDirectories) co return rmDir(name); } -/*! - \reimp -*/ bool QFSFileEngine::caseSensitive() const { return false; } -/*! - Sets the current path (e.g., for QDir), to \a path. Returns true if the - new path exists; otherwise this function does nothing, and returns false. - - \sa currentPath() -*/ bool QFSFileEngine::setCurrentPath(const QString &path) { if (!QDir(path).exists()) @@ -1153,16 +1123,6 @@ bool QFSFileEngine::setCurrentPath(const QString &path) #endif } -/*! - Returns the canonicalized form of the current path used by the file - engine for the drive specified by \a fileName. - - On Windows, each drive has its own current directory, so a different - path is returned for file names that include different drive names - (e.g. A: or C:). - - \sa setCurrentPath() -*/ QString QFSFileEngine::currentPath(const QString &fileName) { #if !defined(Q_OS_WINCE) @@ -1219,11 +1179,6 @@ QString QFSFileEngine::currentPath(const QString &fileName) #endif } -/*! - Returns the home path of the current user. - - \sa rootPath() -*/ QString QFSFileEngine::homePath() { QString ret; @@ -1277,11 +1232,6 @@ QString QFSFileEngine::homePath() return QDir::fromNativeSeparators(ret); } -/*! - Returns the root path. - - \sa homePath() -*/ QString QFSFileEngine::rootPath() { #if defined(Q_OS_WINCE) @@ -1299,10 +1249,6 @@ QString QFSFileEngine::rootPath() return ret; } -/*! - Returns the temporary path (i.e., a path in which it is safe to store - temporary files). -*/ QString QFSFileEngine::tempPath() { QString ret; @@ -1330,11 +1276,6 @@ QString QFSFileEngine::tempPath() return ret; } -/*! - Returns the list of drives in the file system as a list of QFileInfo - objects. On unix, Mac OS X and Windows CE, only the root path is returned. - On Windows, this function returns all drives (A:\, C:\, D:\, etc.). -*/ QFileInfoList QFSFileEngine::drives() { QFileInfoList ret; @@ -1556,9 +1497,6 @@ QString QFSFileEnginePrivate::getLink() const return readLink(filePath); } -/*! - \reimp -*/ bool QFSFileEngine::link(const QString &newName) { #if !defined(Q_OS_WINCE) @@ -1816,9 +1754,6 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(QAbstractFileEngine::Fil return ret; } -/*! - \reimp -*/ QString QFSFileEngine::fileName(FileName file) const { Q_D(const QFSFileEngine); @@ -1912,9 +1847,6 @@ QString QFSFileEngine::fileName(FileName file) const return d->filePath; } -/*! - \reimp -*/ bool QFSFileEngine::isRelativePath() const { Q_D(const QFSFileEngine); @@ -1924,18 +1856,12 @@ bool QFSFileEngine::isRelativePath() const || (d->filePath.at(0) == QLatin1Char('/') && d->filePath.at(1) == QLatin1Char('/'))))); // drive, e.g. a: } -/*! - \reimp -*/ uint QFSFileEngine::ownerId(FileOwner /*own*/) const { static const uint nobodyID = (uint) -2; return nobodyID; } -/*! - \reimp -*/ QString QFSFileEngine::owner(FileOwner own) const { #if !defined(QT_NO_LIBRARY) @@ -1974,9 +1900,6 @@ QString QFSFileEngine::owner(FileOwner own) const return QString(QLatin1String("")); } -/*! - \reimp -*/ bool QFSFileEngine::setPermissions(uint perms) { Q_D(QFSFileEngine); @@ -2003,9 +1926,6 @@ bool QFSFileEngine::setPermissions(uint perms) return ret; } -/*! - \reimp -*/ bool QFSFileEngine::setSize(qint64 size) { Q_D(QFSFileEngine); @@ -2075,9 +1995,6 @@ static inline QDateTime fileTimeToQDateTime(const FILETIME *time) return ret; } -/*! - \reimp -*/ QDateTime QFSFileEngine::fileTime(FileTime time) const { Q_D(const QFSFileEngine); -- cgit v0.12 From 327d94ce8054718d0ce157604594e470e90d6cb4 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Fri, 22 May 2009 15:14:11 +0200 Subject: Fixes a potential crash when changing system palette with QGtkStyle The problem was that we installed an eventfilter regardless if the gtk symbols were defined or not. Instead we now initialize and check for the symbols before we install the filter. Task-number: 254342 Reviewed-by: ogoffart --- src/gui/styles/qgtkstyle.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index ca71da2..86653df 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -140,10 +140,7 @@ static const char * const dock_widget_restore_xpm[] = class QGtkStyleFilter : public QObject { public: - QGtkStyleFilter() { - qApp->installEventFilter(this); - } - + QGtkStyleFilter() {} private: bool eventFilter(QObject *obj, QEvent *e); }; @@ -167,7 +164,12 @@ class QGtkStylePrivate : public QCleanlooksStylePrivate public: QGtkStylePrivate() : QCleanlooksStylePrivate() - {} + { + QGtk::initGtkWidgets(); + if (QGtk::isThemeAvailable()) + qApp->installEventFilter(&filter); + + } QGtkStyleFilter filter; }; @@ -243,7 +245,6 @@ static QString uniqueName(const QString &key, const QStyleOption *option, const QGtkStyle::QGtkStyle() : QCleanlooksStyle(*new QGtkStylePrivate) { - QGtk::initGtkWidgets(); } /*! -- cgit v0.12 From 3c6166983d07b6e81992b8a6080942041e37f615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 22 May 2009 16:16:48 +0300 Subject: S60Style: Make 'checkable' buttons just 'pressed down' when checked. --- src/gui/styles/qs60style.cpp | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 9a35760..a13f396 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -1184,21 +1184,6 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, QStyleOptionButton subopt = *btn; subopt.rect = subElementRect(SE_PushButtonContents, btn, widget); - if (const QAbstractButton *buttonWidget = (qobject_cast(widget))) { - if (buttonWidget->isCheckable()) { - QStyleOptionButton checkopt = subopt; - - const int indicatorHeight(pixelMetric(PM_IndicatorHeight)); - const int verticalAdjust = (option->rect.height() - indicatorHeight) >> 1; - - checkopt.rect.adjust(pixelMetric(PM_ButtonMargin), verticalAdjust, 0, 0); - checkopt.rect.setWidth(pixelMetric(PM_IndicatorWidth)); - checkopt.rect.setHeight(indicatorHeight); - - drawPrimitive(PE_IndicatorCheckBox, &checkopt, painter, widget); - } - } - drawControl(CE_PushButtonLabel, &subopt, painter, widget); if (btn->state & State_HasFocus) { QStyleOptionFocusRect fropt; @@ -1215,7 +1200,8 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, QS60StyleEnums::SkinParts skinPart; QS60StylePrivate::SkinElements skinElement; if (!isDisabled) { - const bool isPressed = option->state & QStyle::State_Sunken; + const bool isPressed = (option->state & QStyle::State_Sunken) || + (option->state & QStyle::State_On); if (isFlat) { skinPart = isPressed ? QS60StyleEnums::SP_QsnFrButtonTbCenterPressed : QS60StyleEnums::SP_QsnFrButtonTbCenter; @@ -1238,14 +1224,6 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, case CE_PushButtonLabel: if (const QStyleOptionButton *button = qstyleoption_cast(option)) { QStyleOptionButton optionButton = *button; - - if (const QAbstractButton *buttonWidget = (qobject_cast(widget))) { - if (buttonWidget->isCheckable()) { - // space for check box. - optionButton.rect.adjust(pixelMetric(PM_IndicatorWidth) - + pixelMetric(PM_ButtonMargin) + pixelMetric(PM_CheckBoxLabelSpacing), 0, 0, 0); - } - } QCommonStyle::drawControl(element, &optionButton, painter, widget); } break; -- cgit v0.12 From 93106a55db7bd781cde889425912ebc4a277eb8f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 22 Apr 2009 19:03:52 +0200 Subject: Fix syntax of the fcntl system call: this is not setsockopt Reviewed-By: Oswald Buddenhagen --- src/corelib/io/qfsfileengine_unix.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp index 18b92e2..459725c 100644 --- a/src/corelib/io/qfsfileengine_unix.cpp +++ b/src/corelib/io/qfsfileengine_unix.cpp @@ -273,9 +273,8 @@ qint64 QFSFileEnginePrivate::nativeRead(char *data, qint64 len) int oldFlags = fcntl(QT_FILENO(fh), F_GETFL); for (int i = 0; i < 2; ++i) { // Unix: Make the underlying file descriptor non-blocking - int v = 1; if ((oldFlags & O_NONBLOCK) == 0) - fcntl(QT_FILENO(fh), F_SETFL, oldFlags | O_NONBLOCK, &v, sizeof(v)); + fcntl(QT_FILENO(fh), F_SETFL, oldFlags | O_NONBLOCK); // Cross platform stdlib read size_t read = 0; @@ -293,8 +292,7 @@ qint64 QFSFileEnginePrivate::nativeRead(char *data, qint64 len) // Unix: Restore the blocking state of the underlying socket if ((oldFlags & O_NONBLOCK) == 0) { - int v = 1; - fcntl(QT_FILENO(fh), F_SETFL, oldFlags, &v, sizeof(v)); + fcntl(QT_FILENO(fh), F_SETFL, oldFlags); if (readBytes == 0) { int readByte = 0; do { @@ -311,8 +309,7 @@ qint64 QFSFileEnginePrivate::nativeRead(char *data, qint64 len) } // Unix: Restore the blocking state of the underlying socket if ((oldFlags & O_NONBLOCK) == 0) { - int v = 1; - fcntl(QT_FILENO(fh), F_SETFL, oldFlags, &v, sizeof(v)); + fcntl(QT_FILENO(fh), F_SETFL, oldFlags); } if (readBytes == 0 && !feof(fh)) { // if we didn't read anything and we're not at EOF, it must be an error -- cgit v0.12 From 049135667302482af66eeaf9a2323d5ee1551132 Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Fri, 22 May 2009 15:42:31 +0200 Subject: Doc - updating the screenshot Reviewed-By: TrustMe --- doc/src/images/inputdialogs.png | Bin 4244 -> 30369 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/doc/src/images/inputdialogs.png b/doc/src/images/inputdialogs.png index 135c2f6..8bda185 100644 Binary files a/doc/src/images/inputdialogs.png and b/doc/src/images/inputdialogs.png differ -- cgit v0.12 From a8b0c84daf6cba6d557245954568b32cb690583f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 22 May 2009 17:33:09 +0300 Subject: S60Style: If table has defined a new background brush use that instead of drawing themed background. --- src/gui/styles/qs60style.cpp | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index a13f396..baaab59 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -213,6 +213,8 @@ void QS60StylePrivate::refreshUI() { foreach (QWidget *topLevelWidget, QApplication::allWidgets()) { topLevelWidget->updateGeometry(); + //todo: study how we can get rid of this. Apparently scrollbars cache pixelmetrics values, and we need them to update themselves + // maybe styleChanged event is enough? QCoreApplication::postEvent(topLevelWidget, new QResizeEvent(topLevelWidget->size(), topLevelWidget->size())); } } @@ -1334,21 +1336,24 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, const QRect iconRect = subElementRect(SE_ItemViewItemDecoration, &voptAdj, widget); QRect textRect = subElementRect(SE_ItemViewItemText, &voptAdj, widget); - // draw the background - const QStyleOptionViewItemV4 *tableOption = qstyleoption_cast(option); - const QTableView *table = qobject_cast(widget); - if (table && tableOption) { - const QModelIndex index = tableOption->index; - //todo: Draw cell background only once - for the first cell. - QStyleOptionViewItemV4 voptAdj2 = voptAdj2; - const QModelIndex indexFirst = table->model()->index(0,0); - const QModelIndex indexLast = table->model()->index( - table->model()->rowCount()-1,table->model()->columnCount()-1); - if (table->viewport()) - voptAdj2.rect = QRect( table->visualRect(indexFirst).topLeft(), - table->visualRect(indexLast).bottomRight()).intersect(table->viewport()->rect()); - drawPrimitive(PE_PanelItemViewItem, &voptAdj2, painter, widget); - } + // draw themed background for table unless background brush has been defined. + if (vopt->backgroundBrush == Qt::NoBrush) { + // draw the background + const QStyleOptionViewItemV4 *tableOption = qstyleoption_cast(option); + const QTableView *table = qobject_cast(widget); + if (table && tableOption) { + const QModelIndex index = tableOption->index; + //todo: Draw cell background only once - for the first cell. + QStyleOptionViewItemV4 voptAdj2 = voptAdj2; + const QModelIndex indexFirst = table->model()->index(0,0); + const QModelIndex indexLast = table->model()->index( + table->model()->rowCount()-1,table->model()->columnCount()-1); + if (table->viewport()) + voptAdj2.rect = QRect( table->visualRect(indexFirst).topLeft(), + table->visualRect(indexLast).bottomRight()).intersect(table->viewport()->rect()); + drawPrimitive(PE_PanelItemViewItem, &voptAdj2, painter, widget); + } + } else { QCommonStyle::drawPrimitive(PE_PanelItemViewItem, option, painter, widget);} // draw the focus rect if (isSelected) -- cgit v0.12 From 514cbf7302059e779e11dbc4a3b06355d9ecd096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 22 May 2009 17:44:28 +0300 Subject: S60Style: Fix palette-polution to other styles, when style is switched runtime. --- src/gui/styles/qs60style.cpp | 4 +++- src/gui/styles/qs60style_symbian.cpp | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index baaab59..7b045ab 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -664,7 +664,9 @@ void QS60Style::polish(QWidget *widget) void QS60Style::unpolish(QApplication *application) { - application->setPalette(originalPalette); + QPalette newPalette = qApp->style()->standardPalette(); + application->setPalette(newPalette); + QApplicationPrivate::setSystemPalette(originalPalette); } void QS60Style::unpolish(QWidget *widget) diff --git a/src/gui/styles/qs60style_symbian.cpp b/src/gui/styles/qs60style_symbian.cpp index 025ef93..a769eda 100644 --- a/src/gui/styles/qs60style_symbian.cpp +++ b/src/gui/styles/qs60style_symbian.cpp @@ -688,7 +688,6 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL( CleanupStack::PushL(background); User::LeaveIfError(background->Create(targetSize, EColor16MA)); - // todo: push background into CleanupStack CFbsBitmapDevice* dev = CFbsBitmapDevice::NewL(background); CleanupStack::PushL(dev); CFbsBitGc* gc = NULL; @@ -821,7 +820,7 @@ void QS60StyleModeSpecifics::frameIdAndCenterId(QS60StylePrivate::SkinFrameEleme switch(frameElement) { case QS60StylePrivate::SF_ToolTip: - if (QSysInfo::s60Version()==QSysInfo::SV_S60_5_0 || QSysInfo::s60Version()==QSysInfo::SV_S60_3_2) { + if (QSysInfo::s60Version()!=QSysInfo::SV_S60_3_1) { centerId.Set(EAknsMajorGeneric, 0x19c2); frameId.Set(EAknsMajorSkin, 0x5300); } else { -- cgit v0.12 From fc7a43cceba63b79a40183334ab97527483113e3 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 22 May 2009 16:55:28 +0200 Subject: Fix compilation breakage on Windows caused by 6c1d7e57. On Windows, QT_NO_IPV6 isn't defined, but the necessary includes were missing. So #include winsock2.h and also use our own structures. Reviewed-By: Trust Me --- src/network/socket/qnativesocketengine_p.h | 36 +++++++++++++++++++++---- src/network/socket/qnativesocketengine_unix.cpp | 2 +- src/network/socket/qnativesocketengine_win.cpp | 35 ------------------------ 3 files changed, 32 insertions(+), 41 deletions(-) diff --git a/src/network/socket/qnativesocketengine_p.h b/src/network/socket/qnativesocketengine_p.h index 825c333..eb031d3 100644 --- a/src/network/socket/qnativesocketengine_p.h +++ b/src/network/socket/qnativesocketengine_p.h @@ -56,7 +56,9 @@ #include "QtNetwork/qhostaddress.h" #include "private/qabstractsocketengine_p.h" #ifndef Q_OS_WIN -#include "qplatformdefs.h" +# include "qplatformdefs.h" +#else +# include #endif QT_BEGIN_NAMESPACE @@ -90,13 +92,37 @@ static inline int qt_socket_socket(int domain, int type, int protocol) #endif +// Use our own defines and structs which we know are correct +# define QT_SS_MAXSIZE 128 +# define QT_SS_ALIGNSIZE (sizeof(qint64)) +# define QT_SS_PAD1SIZE (QT_SS_ALIGNSIZE - sizeof (short)) +# define QT_SS_PAD2SIZE (QT_SS_MAXSIZE - (sizeof (short) + QT_SS_PAD1SIZE + QT_SS_ALIGNSIZE)) +struct qt_sockaddr_storage { + short ss_family; + char __ss_pad1[QT_SS_PAD1SIZE]; + qint64 __ss_align; + char __ss_pad2[QT_SS_PAD2SIZE]; +}; + +// sockaddr_in6 size changed between old and new SDK +// Only the new version is the correct one, so always +// use this structure. +struct qt_in6_addr { + quint8 qt_s6_addr[16]; +}; +struct qt_sockaddr_in6 { + short sin6_family; /* AF_INET6 */ + quint16 sin6_port; /* Transport level port number */ + quint32 sin6_flowinfo; /* IPv6 flow information */ + struct qt_in6_addr sin6_addr; /* IPv6 address */ + quint32 sin6_scope_id; /* set of interfaces for a scope */ +}; + union qt_sockaddr { sockaddr a; sockaddr_in a4; -#if !defined(QT_NO_IPV6) - sockaddr_in6 a6; -#endif - sockaddr_storage storage; + qt_sockaddr_in6 a6; + qt_sockaddr_storage storage; }; class QNativeSocketEnginePrivate; diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp index 2b11e8e..75b5a64 100644 --- a/src/network/socket/qnativesocketengine_unix.cpp +++ b/src/network/socket/qnativesocketengine_unix.cpp @@ -119,7 +119,7 @@ static inline void qt_socket_getPortAndAddress(const qt_sockaddr *s, quint16 *po #if !defined(QT_NO_IPV6) if (s->a.sa_family == AF_INET6) { Q_IPV6ADDR tmp; - memcpy(&tmp, &s->a6.sin6_addr.s6_addr, sizeof(tmp)); + memcpy(&tmp, &s->a6.sin6_addr, sizeof(tmp)); if (addr) { QHostAddress tmpAddress; tmpAddress.setAddress(tmp); diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp index d140be2..b08d7b0 100644 --- a/src/network/socket/qnativesocketengine_win.cpp +++ b/src/network/socket/qnativesocketengine_win.cpp @@ -149,41 +149,6 @@ static QByteArray qt_prettyDebug(const char *data, int len, int maxLength) #endif -#if !defined (QT_NO_IPV6) - -// Use our own defines and structs which we know are correct -# define QT_SS_MAXSIZE 128 -# define QT_SS_ALIGNSIZE (sizeof(__int64)) -# define QT_SS_PAD1SIZE (QT_SS_ALIGNSIZE - sizeof (short)) -# define QT_SS_PAD2SIZE (QT_SS_MAXSIZE - (sizeof (short) + QT_SS_PAD1SIZE + QT_SS_ALIGNSIZE)) -struct qt_sockaddr_storage { - short ss_family; - char __ss_pad1[QT_SS_PAD1SIZE]; - __int64 __ss_align; - char __ss_pad2[QT_SS_PAD2SIZE]; -}; - -// sockaddr_in6 size changed between old and new SDK -// Only the new version is the correct one, so always -// use this structure. -struct qt_in6_addr { - u_char qt_s6_addr[16]; -}; -typedef struct { - short sin6_family; /* AF_INET6 */ - u_short sin6_port; /* Transport level port number */ - u_long sin6_flowinfo; /* IPv6 flow information */ - struct qt_in6_addr sin6_addr; /* IPv6 address */ - u_long sin6_scope_id; /* set of interfaces for a scope */ -} qt_sockaddr_in6; - -#else - -typedef void * qt_sockaddr_in6 ; - - -#endif - #ifndef AF_INET6 #define AF_INET6 23 /* Internetwork Version 6 */ #endif -- cgit v0.12 From 701bdcbc8b7751834f6d24844bcb91a23cbdc409 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 22 May 2009 15:48:23 +0200 Subject: Pressing enter in a QPlainTextEdit embedded on a itemview should insert a newline Do the same special case as for QTextEdit (yes, this is a pitty that we have special cases like that Reviewed-by: Thierry Task-number: 252532 --- src/gui/itemviews/qitemdelegate.cpp | 3 +- src/gui/itemviews/qstyleditemdelegate.cpp | 3 +- tests/auto/qitemdelegate/tst_qitemdelegate.cpp | 78 ++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 2 deletions(-) diff --git a/src/gui/itemviews/qitemdelegate.cpp b/src/gui/itemviews/qitemdelegate.cpp index 3b7eb2d..a748199 100644 --- a/src/gui/itemviews/qitemdelegate.cpp +++ b/src/gui/itemviews/qitemdelegate.cpp @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -1194,7 +1195,7 @@ bool QItemDelegate::eventFilter(QObject *object, QEvent *event) case Qt::Key_Enter: case Qt::Key_Return: #ifndef QT_NO_TEXTEDIT - if (qobject_cast(editor)) + if (qobject_cast(editor) || qobject_cast(editor)) return false; // don't filter enter key events for QTextEdit // We want the editor to be able to process the key press // before committing the data (e.g. so it can do diff --git a/src/gui/itemviews/qstyleditemdelegate.cpp b/src/gui/itemviews/qstyleditemdelegate.cpp index be0971b..7f2c8ed 100644 --- a/src/gui/itemviews/qstyleditemdelegate.cpp +++ b/src/gui/itemviews/qstyleditemdelegate.cpp @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -646,7 +647,7 @@ bool QStyledItemDelegate::eventFilter(QObject *object, QEvent *event) case Qt::Key_Enter: case Qt::Key_Return: #ifndef QT_NO_TEXTEDIT - if (qobject_cast(editor)) + if (qobject_cast(editor) || qobject_cast(editor)) return false; // don't filter enter key events for QTextEdit // We want the editor to be able to process the key press // before committing the data (e.g. so it can do diff --git a/tests/auto/qitemdelegate/tst_qitemdelegate.cpp b/tests/auto/qitemdelegate/tst_qitemdelegate.cpp index 27741e0..615ac01 100644 --- a/tests/auto/qitemdelegate/tst_qitemdelegate.cpp +++ b/tests/auto/qitemdelegate/tst_qitemdelegate.cpp @@ -59,6 +59,8 @@ #include #include +#include +#include Q_DECLARE_METATYPE(QAbstractItemDelegate::EndEditHint) @@ -226,6 +228,8 @@ private slots: void decoration(); void editorEvent_data(); void editorEvent(); + void enterKey_data(); + void enterKey(); }; @@ -1048,6 +1052,80 @@ void tst_QItemDelegate::editorEvent() QCOMPARE(index.data(Qt::CheckStateRole).toInt(), expectedCheckState); } +void tst_QItemDelegate::enterKey_data() +{ + QTest::addColumn("widget"); + QTest::addColumn("key"); + QTest::addColumn("expectedFocus"); + + QTest::newRow("lineedit enter") << 1 << int(Qt::Key_Enter) << false; + QTest::newRow("textedit enter") << 2 << int(Qt::Key_Enter) << true; + QTest::newRow("plaintextedit enter") << 3 << int(Qt::Key_Enter) << true; + QTest::newRow("plaintextedit return") << 3 << int(Qt::Key_Return) << true; + QTest::newRow("plaintextedit tab") << 3 << int(Qt::Key_Tab) << false; + QTest::newRow("lineedit tab") << 1 << int(Qt::Key_Tab) << false; +} + +void tst_QItemDelegate::enterKey() +{ + QFETCH(int, widget); + QFETCH(int, key); + QFETCH(bool, expectedFocus); + + QStandardItemModel model; + model.appendRow(new QStandardItem()); + + QListView view; + view.setModel(&model); + view.show(); + QApplication::setActiveWindow(&view); + view.setFocus(); + QTest::qWait(30); + + struct TestDelegate : public QItemDelegate + { + int widgetType; + virtual QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& /*option*/, const QModelIndex& /*index*/) const + { + QWidget *editor = 0; + switch(widgetType) { + case 1: + editor = new QLineEdit(parent); + break; + case 2: + editor = new QTextEdit(parent); + break; + case 3: + editor = new QPlainTextEdit(parent); + break; + } + editor->setObjectName(QString::fromLatin1("TheEditor")); + return editor; + } + } delegate; + + delegate.widgetType = widget; + + view.setItemDelegate(&delegate); + QModelIndex index = model.index(0, 0); + view.setCurrentIndex(index); // the editor will only selectAll on the current index + view.edit(index); + QTest::qWait(30); + + QList lineEditors = qFindChildren(view.viewport(), QString::fromLatin1("TheEditor")); + QCOMPARE(lineEditors.count(), 1); + + QWidget *editor = lineEditors.at(0); + QCOMPARE(editor->hasFocus(), true); + + QTest::keyClick(editor, Qt::Key(key)); + QApplication::processEvents(); + + QCOMPARE(editor->hasFocus(), expectedFocus); +} + + + // ### _not_ covered: // editing with a custom editor factory -- cgit v0.12 From a75186dc1cad674e825f2949c51dbbb655b4a359 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Sat, 23 May 2009 13:54:49 +0300 Subject: S60Style: Build break fix. Missing include added. --- src/gui/styles/qs60style.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 7b045ab..10784f3 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -41,6 +41,7 @@ #include "private/qtoolbarextension_p.h" #include "private/qcombobox_p.h" #include "private/qwidget_p.h" +#include "private/qapplication_p.h" #if !defined(QT_NO_STYLE_S60) || defined(QT_PLUGIN) -- cgit v0.12 From a5104ef77f71b068228ffe6d7c64845889c18c81 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 23 May 2009 13:18:23 +0200 Subject: Fix another compilation breakage introduced by the fix to the compilation breakage introduced in 6c1d7e57. The fix in fc7a43cce did fix the failure, but created another one because qhostinfo_win.cpp also had a copy of qt_sockaddr_in6 Reviewed-by: Jason McDonald --- src/network/kernel/qhostinfo_win.cpp | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/network/kernel/qhostinfo_win.cpp b/src/network/kernel/qhostinfo_win.cpp index 0a34e2b..472bc4b 100644 --- a/src/network/kernel/qhostinfo_win.cpp +++ b/src/network/kernel/qhostinfo_win.cpp @@ -72,21 +72,6 @@ struct qt_addrinfo qt_addrinfo *ai_next; }; -// sockaddr_in6 size changed between old and new SDK -// Only the new version is the correct one, so always -// use this structure. -struct qt_in6_addr { - uchar qt_s6_addr[16]; -}; - -struct qt_sockaddr_in6 { - short sin6_family; /* AF_INET6 */ - u_short sin6_port; /* Transport level port number */ - u_long sin6_flowinfo; /* IPv6 flow information */ - struct qt_in6_addr sin6_addr; /* IPv6 address */ - u_long sin6_scope_id; /* set of interfaces for a scope */ -}; - //### #define QT_SOCKLEN_T int #ifndef NI_MAXHOST // already defined to 1025 in ws2tcpip.h? -- cgit v0.12 From b0c2155f3b78403e5473379a52195ceaf3468ffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Sat, 23 May 2009 14:45:06 +0300 Subject: S60Style: Draw radiobutton and checkbox indicators with correct color. --- src/gui/styles/qs60style_symbian.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style_symbian.cpp b/src/gui/styles/qs60style_symbian.cpp index a769eda..76c94ad 100644 --- a/src/gui/styles/qs60style_symbian.cpp +++ b/src/gui/styles/qs60style_symbian.cpp @@ -1311,12 +1311,15 @@ void QS60StyleModeSpecifics::colorGroupAndIndex( case QS60StyleEnums::SP_QgnIndiHlLineBranch: case QS60StyleEnums::SP_QgnIndiHlLineEnd: case QS60StyleEnums::SP_QgnIndiHlLineStraight: + colorGroup = KAknsIIDQsnIconColors; + colorIndex = EAknsCIQsnIconColorsCG1; + break; case QS60StyleEnums::SP_QgnIndiRadiobuttOff: case QS60StyleEnums::SP_QgnIndiRadiobuttOn: case QS60StyleEnums::SP_QgnIndiCheckboxOff: case QS60StyleEnums::SP_QgnIndiCheckboxOn: colorGroup = KAknsIIDQsnIconColors; - colorIndex = EAknsCIQsnIconColorsCG1; + colorIndex = EAknsCIQsnIconColorsCG14; break; default: break; -- cgit v0.12 From e49b60c990ed5f07ea24d4e8b73beafdb2a93a3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Sat, 23 May 2009 15:21:54 +0300 Subject: S60Style: QScrollArea background is not continuous with main theme background. --- src/gui/styles/qs60style.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 10784f3..38c85b0 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -618,6 +618,9 @@ void QS60StylePrivate::setThemePalette(QWidget *widget) const widgetPalette.setColor(QPalette::Dark, color.darker()); widgetPalette.setColor(QPalette::Light, color.lighter()); QApplication::setPalette(widgetPalette, "QDial"); + } else if (qobject_cast(widget)) { + widgetPalette.setBrush(QPalette::Window, QBrush()); + QApplication::setPalette(widgetPalette, "QScrollArea"); } } -- cgit v0.12 From bdab465426195f70f7276a768cea49715d585828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Sat, 23 May 2009 15:22:23 +0300 Subject: S60Style: QScrollArea background is not continuous with main theme background (part2). --- src/gui/styles/qs60style.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 38c85b0..cc4582b 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -30,6 +30,7 @@ #include "qmenubar.h" #include "qmessagebox.h" #include "qpushbutton.h" +#include "qscrollarea.h" #include "qscrollbar.h" #include "qtabbar.h" #include "qtablewidget.h" -- cgit v0.12 From 26302d22f4dbf3482aacad89ad65bf5b7ed6ae53 Mon Sep 17 00:00:00 2001 From: axasia Date: Sat, 23 May 2009 23:33:49 +0900 Subject: Update japanese translation of Qt Assistant 4.5 --- translations/assistant_ja.ts | 395 ++++++++++++++++++++++--------------------- 1 file changed, 203 insertions(+), 192 deletions(-) diff --git a/translations/assistant_ja.ts b/translations/assistant_ja.ts index 1853155..5e4d2c9 100644 --- a/translations/assistant_ja.ts +++ b/translations/assistant_ja.ts @@ -1,12 +1,12 @@ - + AboutDialog &Close - + é–‰ã˜ã‚‹(&C) @@ -14,18 +14,19 @@ Warning - + 警告 Unable to launch external application. - + 外部アプリケーションを起動ã§ãã¾ã›ã‚“。 + OK - + OK @@ -37,42 +38,42 @@ Bookmarks - + ブックマーク Add Bookmark - + ブックマークã®è¿½åŠ  Bookmark: - + ブックマーク: Add in Folder: - + 追加先フォルダ: + - + + New Folder - + æ–°ã—ã„フォルダ Delete Folder - + フォルダを削除 Rename Folder - + フォルダã®åå‰å¤‰æ›´ @@ -80,23 +81,23 @@ Bookmarks - + ブックマーク Remove - + 削除 You are going to delete a Folder, this will also<br>remove it's content. Are you sure to continue? - + フォルダを削除ã™ã‚‹ã¨ä¸­èº«ã‚‚削除ã•ã‚Œã¾ã™ãŒã€ç¶šã‘ã¦ã‚ˆã‚ã—ã„ã§ã™ã‹? New Folder - + æ–°ã—ã„フォルダ @@ -104,47 +105,47 @@ Filter: - + フィルタ: Remove - + 削除 Delete Folder - + フォルダを削除 Rename Folder - + フォルダã®åå‰å¤‰æ›´ Show Bookmark - + ブックマークを開ã Show Bookmark in New Tab - + ブックマークを新ã—ã„タブã§é–‹ã Delete Bookmark - + ブックマークを削除 Rename Bookmark - + ブックマークã®åå‰å¤‰æ›´ Add - + 追加 @@ -152,48 +153,48 @@ Add new page - + æ–°ã—ã„ページã®è¿½åŠ  Close current page - + ç¾åœ¨ã®ãƒšãƒ¼ã‚¸ã‚’é–‰ã˜ã‚‹ Print Document - + ドキュメントをå°åˆ· unknown - + ä¸æ˜Ž Add New Page - + æ–°ã—ã„ページã®è¿½åŠ  Close This Page - + ã“ã®ãƒšãƒ¼ã‚¸ã‚’é–‰ã˜ã‚‹ Close Other Pages - + ä»–ã®ãƒšãƒ¼ã‚¸ã‚’é–‰ã˜ã‚‹ Add Bookmark for this Page... - + ã“ã®ãƒšãƒ¼ã‚¸ã‚’ブックマークã«è¿½åŠ ... Search - + 検索 @@ -201,12 +202,12 @@ Open Link - + リンクを開ã Open Link in New Tab - + リンクを新ã—ã„タブã§é–‹ã @@ -214,12 +215,12 @@ Add Filter Name - + フィルタåを追加 Filter Name: - + フィルタå: @@ -227,27 +228,27 @@ Previous - + 戻る Next - + 進む Case Sensitive - + 大文字/å°æ–‡å­—を区別ã™ã‚‹ Whole words - + å˜èªžå˜ä½ã§æ¤œç´¢ã™ã‚‹ <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped - + <img src=":/trolltech/assistant/images/wrap.png">&nbsp;見ã¤ã‹ã‚‰ãªã‘ã‚Œã°å…ˆé ­ã‹ã‚‰æ¤œç´¢ã™ã‚‹ @@ -255,27 +256,27 @@ Font - + フォント &Writing system - + 文字セット(&W) &Family - + フォントå(&F) &Style - + スタイル(&S) &Point size - + サイズ(&P) @@ -283,38 +284,39 @@ Help - + ヘルプ OK - + OK <title>Error 404...</title><div align="center"><br><br><h1>The page could not be found</h1><br><h3>'%1'</h3></div> - + <title>Error 404...</title><div align="center"><br><br><h1>ページãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“ã§ã—ãŸ</h1><br><h3>'%1'</h3></div> Copy &Link Location - + リンクã®URLをコピー(&L) Open Link in New Tab Ctrl+LMB - + リンクを新ã—ã„タブã§é–‹ã Ctrl+LMB Open Link in New Tab - + リンクを新ã—ã„タブã§é–‹ã Unable to launch external application. - + 外部アプリケーションを起動ã§ãã¾ã›ã‚“。 + @@ -322,17 +324,17 @@ &Look for: - + 検索文字列(&L): Open Link - + リンクを開ã Open Link in New Tab - + リンクを新ã—ã„タブã§é–‹ã @@ -341,97 +343,98 @@ Install Documentation - + ドキュメントã®ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ« Downloading documentation info... - + ドキュメント情報をダウンロード中... Download canceled. - + ダウンロードを中止ã—ã¾ã—ãŸã€‚ Done. - + 完了. The file %1 already exists. Do you want to overwrite it? - + %1 ã¯æ—¢ã«å­˜åœ¨ã—ã¾ã™ã€‚上書ãã—ã¾ã™ã‹? Unable to save the file %1: %2. - + ファイルをä¿å­˜ã§ãã¾ã›ã‚“。%1: %2. Downloading %1... - + %1 をダウンロード中... Download failed: %1. - + ダウンロード失敗: %1. Documentation info file is corrupt! - + ドキュメント情報ファイルãŒä¸æ­£ã§ã™! Download failed: Downloaded file is corrupted. - + ダウンロード失敗: ダウンロードã—ãŸãƒ•ã‚¡ã‚¤ãƒ«ãŒä¸æ­£ã§ã™ã€‚ Installing documentation %1... - + %1 ã®ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã‚’インストール中... Error while installing documentation: %1 - + ドキュメントã®ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ä¸­ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸ: +%1 Available Documentation: - + 使用å¯èƒ½ãªãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆ: Install - + インストール Cancel - + キャンセル Close - + é–‰ã˜ã‚‹ Installation Path: - + インストール先ã®ãƒ‘ス: ... - + ... @@ -440,298 +443,298 @@ Index - + インデックス Contents - + コンテンツ Bookmarks - + ブックマーク Search - + 検索 Qt Assistant - + Qt Assistant Unfiltered - + フィルタãªã— Page Set&up... - + ページ設定(&U)... Print Preview... - + å°åˆ·ãƒ—レビュー... &Print... - + å°åˆ·(&P)... New &Tab - + æ–°ã—ã„タブ(&T) &Close Tab - + タブを閉ã˜ã‚‹(&C) &Quit - + 終了(&Q) CTRL+Q - + CTRL+Q &Copy selected Text - + é¸æŠžä¸­ã®æ–‡å­—をコピー(&C) &Find in Text... - + 検索(&F)... Find &Next - + 次を検索(&N) Find &Previous - + å‰ã‚’検索(&P) Preferences... - + 設定... Zoom &in - + 拡大(&I) Zoom &out - + 縮å°(&O) Normal &Size - + 普通ã®å¤§ãã•(&S) Ctrl+0 - + Ctrl+0 ALT+C - + ALT+C ALT+I - + ALT+I ALT+S - + ALT+S &Home - + ホーム(&H) Ctrl+Home - + Ctrl+Home &Back - + 戻る(&B) &Forward - + 進む(&F) Sync with Table of Contents - + 内容ã¨ç›®æ¬¡ã‚’åŒæœŸã™ã‚‹ Next Page - + 次ã®ãƒšãƒ¼ã‚¸ Ctrl+Alt+Right - + Ctrl+Alt+Right Previous Page - + å‰ã®ãƒšãƒ¼ã‚¸ Ctrl+Alt+Left - + Ctrl+Alt+Left Add Bookmark... - + ブックマークã®è¿½åŠ ... About... - + Qt Assistant ã«ã¤ã„ã¦... Navigation Toolbar - + ナビゲーション ツールãƒãƒ¼ Toolbars - + ツールãƒãƒ¼ Filter Toolbar - + フィルター ツールãƒãƒ¼ Filtered by: - + フィルタæ¡ä»¶: Address Toolbar - + アドレス ツールãƒãƒ¼ Address: - + アドレス: Could not find the associated content item. - + 関連付ã„ãŸå†…容ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。 About %1 - + %1 ã«ã¤ã„㦠Updating search index - + 検索インデックスを更新中 Looking for Qt Documentation... - + Qt ドキュメントを探ã—ã¦ã„ã¾ã™... &Window - + ウィンドウ(&W) Minimize - + 最å°åŒ– Ctrl+M - + Ctrl+M Zoom - + ズーム &File - + ファイル(&F) &Edit - + 編集(&E) &View - + 表示(&V) &Go - + ジャンプ(&G) &Bookmarks - + ブックマーク(&B) &Help - + ヘルプ(&H) ALT+O - + ALT+O CTRL+D - + CTRL+D @@ -741,47 +744,47 @@ Add Documentation - + ドキュメントã®è¿½åŠ  Qt Compressed Help Files (*.qch) - + 圧縮済㿠Qt ヘルプファイル (*.qch) The specified file is not a valid Qt Help File! - + 指定ã•ã‚ŒãŸãƒ•ã‚¡ã‚¤ãƒ«ã¯æœ‰åŠ¹ãª Qt ヘルプ ファイルã§ã¯ã‚ã‚Šã¾ã›ã‚“! The namespace %1 is already registered! - + ãƒãƒ¼ãƒ ã‚¹ãƒšãƒ¼ã‚¹ %1 ã¯æ—¢ã«ç™»éŒ²æ¸ˆã¿ã§ã™! Remove Documentation - + ドキュメントã®é™¤åŽ» Some documents currently opened in Assistant reference the documentation you are attempting to remove. Removing the documentation will close those documents. - + 除去ã—よã†ã¨ã—ã¦ã„ã‚‹ã„ãã¤ã‹ã®ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã¯ Assistant 上ã§å‚ç…§ã•ã‚Œã¦ã„ã¾ã™ã€‚除去ã™ã‚‹ã¨ã€ã“れらã®ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã¯é–‰ã˜ã‚‰ã‚Œã¾ã™ã€‚ Cancel - + キャンセル OK - + OK Use custom settings - + 独自設定を使用ã™ã‚‹ @@ -789,92 +792,92 @@ Preferences - + 設定 Fonts - + フォント Font settings: - + フォント設定: Browser - + ブラウザー Application - + アプリケーション Filters - + フィルタ Filter: - + フィルタ: Attributes: - + 属性: 1 - + 1 Add - + 追加 Remove - + 削除 Documentation - + ドキュメント Registered Documentation: - + 登録済ã¿ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆ: Add... - + 追加... Options - + オプション Current Page - + ç¾åœ¨ã®ãƒšãƒ¼ã‚¸ Restore to default - + デフォルト設定ã«æˆ»ã™ Homepage - + ホームページ @@ -882,64 +885,64 @@ The specified collection file does not exist! - + 指定ã•ã‚ŒãŸã‚³ãƒ¬ã‚¯ã‚·ãƒ§ãƒ³ãƒ•ã‚¡ã‚¤ãƒ«ã¯å­˜åœ¨ã—ã¾ã›ã‚“! Missing collection file! - + コレクションファイルãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“! Invalid URL! - + ä¸æ­£ãªURLã§ã™! Missing URL! - + URLãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“! Unknown widget: %1 - + ä¸æ˜Žãªã‚¦ã‚£ã‚¸ã‚§ãƒƒãƒˆ: %1 Missing widget! - + ウィジェットãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“! The specified Qt help file does not exist! - + 指定ã•ã‚ŒãŸ Qt ヘルプ ファイルãŒå­˜åœ¨ã—ã¾ã›ã‚“! Missing help file! - + ヘルプファイルãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“! Missing filter argument! - + フィルタ引数ãŒä¸è¶³ã—ã¦ã„ã¾ã™! Unknown option: %1 - + ä¸æ˜Žãªã‚ªãƒ—ション: %1 Qt Assistant - + Qt Assistant @@ -948,12 +951,16 @@ Reason: %2 - + ドキュメントファイルを登録ã§ãã¾ã›ã‚“ã§ã—ãŸã€‚ +%1 + +原因: +%2 Documentation successfully registered. - + ドキュメントã®ç™»éŒ²ã«æˆåŠŸã—ã¾ã—ãŸã€‚ @@ -962,28 +969,32 @@ Reason: Reason: %2 - + ドキュメントファイルを解除ã§ãã¾ã›ã‚“ã§ã—ãŸã€‚ +%1 + +原因: +%2 Documentation successfully unregistered. - + ドキュメントã®è§£æ”¾ã«æˆåŠŸã—ã¾ã—ãŸã€‚ Cannot load sqlite database driver! - + SQLite データベース ドライãƒãƒ¼ã‚’ロードã§ãã¾ã›ã‚“! The specified collection file could not be read! - + 指定ã•ã‚ŒãŸã‚³ãƒ¬ã‚¯ã‚·ãƒ§ãƒ³ãƒ•ã‚¡ã‚¤ãƒ«ã¯èª­ã¿è¾¼ã‚ã¾ã›ã‚“! Bookmark - + ブックマーク @@ -991,12 +1002,12 @@ Reason: Debugging Remote Control - + リモート コントロールをデãƒãƒƒã‚°ä¸­ Received Command: %1 %2 - + å—ä¿¡ã—ãŸã‚³ãƒžãƒ³ãƒ‰: %1 %2 @@ -1004,28 +1015,28 @@ Reason: &Copy - + コピー(&C) Copy &Link Location - + リンクã®URLをコピー(&L) Open Link in New Tab - + リンクを新ã—ã„タブã§é–‹ã Select All - + ã™ã¹ã¦ã‚’é¸æŠž Open Link - + リンクを開ã @@ -1033,27 +1044,27 @@ Reason: Choose a topic for <b>%1</b>: - + <b>%1</b> ã®æ¤œç´¢å…ˆãƒˆãƒ”ックをé¸æŠžã—ã¦ãã ã•ã„: Choose Topic - + トピックをé¸æŠž &Topics - + トピック(&T) &Display - + 表示(&D) &Close - + é–‰ã˜ã‚‹(&C) -- cgit v0.12 From 531274c741aed51946398a30a7be691ef98999bf Mon Sep 17 00:00:00 2001 From: Lincoln Ramsay Date: Mon, 25 May 2009 15:46:50 +1000 Subject: BT: Clean up Mac -arch handling Instead of the multiple character-string replacements, just check for the discrete -arch values that we want to find. This makes the code clearer and should reduce the chance of subtle errors. Reviewed-by: Jason McDonald --- configure | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/configure b/configure index 32efd86..4cf7499 100755 --- a/configure +++ b/configure @@ -2703,23 +2703,24 @@ fi if [ "$PLATFORM_MAC" = "yes" ]; then # check -arch arguments for validity. ALLOWED="x86 ppc x86_64 ppc64 i386" - for i in $CFG_MAC_ARCHS + # Save the list so we can re-write it using only valid values + CFG_MAC_ARCHS_IN="$CFG_MAC_ARCHS" + CFG_MAC_ARCHS= + for i in $CFG_MAC_ARCHS_IN do if echo "$ALLOWED" | grep -w -v "$i" > /dev/null 2>&1; then echo "Unknown architecture: \"$i\". Supported architectures: x86[i386] ppc x86_64 ppc64"; exit 2; fi - done - -# replace "i386" with "x86" to support configuring with -arch i386 as an alias for x86. - CFG_MAC_ARCHS="${CFG_MAC_ARCHS/i386/x86}" - -# 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_GCC_FORMAT/i386_64/x86_64}" - for ARCH in $CFG_MAC_ARCHS_GCC_FORMAT; do - MAC_ARCHS_COMMANDLINE="$MAC_ARCHS_COMMANDLINE -arch $ARCH" + if [ "$i" = "i386" -o "$i" = "x86" ]; then + # These are synonymous values + # CFG_MAC_ARCHS requires x86 while GCC requires i386 + CFG_MAC_ARCHS="$CFG_MAC_ARCHS x86" + MAC_ARCHS_COMMANDLINE="$MAC_ARCHS_COMMANDLINE -arch i386" + else + CFG_MAC_ARCHS="$CFG_MAC_ARCHS $i" + MAC_ARCHS_COMMANDLINE="$MAC_ARCHS_COMMANDLINE -arch $i" + fi done fi @@ -4129,14 +4130,14 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ]; EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(CARBON_CFLAGS)" EXTRA_OBJS="qsettings_mac.o qcore_mac.o" EXTRA_SRCS="\"$relpath/src/corelib/io/qsettings_mac.cpp\" \"$relpath/src/corelib/kernel/qcore_mac.cpp\"" - if echo "$CFG_MAC_ARCHS" | grep x86 > /dev/null 2>&1; then + if echo "$CFG_MAC_ARCHS" | grep x86 > /dev/null 2>&1; then # matches both x86 and x86_64 X86_CFLAGS="-arch i386" X86_LFLAGS="-arch i386" EXTRA_CFLAGS="$X86_CFLAGS $EXTRA_CFLAGS" EXTRA_CXXFLAGS="$X86_CFLAGS $EXTRA_CXXFLAGS" EXTRA_LFLAGS="$EXTRA_LFLAGS $X86_LFLAGS" fi - if echo "$CFG_MAC_ARCHS" | grep ppc > /dev/null 2>&1; then + if echo "$CFG_MAC_ARCHS" | grep ppc > /dev/null 2>&1; then # matches both ppc and ppc64 PPC_CFLAGS="-arch ppc" PPC_LFLAGS="-arch ppc" EXTRA_CFLAGS="$PPC_CFLAGS $EXTRA_CFLAGS" -- cgit v0.12 From fc8673c8a0e3ef11aa1eb8c932e0fcd843c11465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Mon, 25 May 2009 10:16:53 +0300 Subject: S60Style: Reorganize methods in source files to match header file order. --- src/gui/styles/qs60style.cpp | 605 ++++++++++++++++++----------------- src/gui/styles/qs60style_p.h | 20 +- src/gui/styles/qs60style_symbian.cpp | 73 +++-- 3 files changed, 355 insertions(+), 343 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index cc4582b..2af80f0 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -118,109 +118,6 @@ static const int frameElementsCount = const int KNotFound = -1; -void QS60StylePrivate::drawPart(QS60StyleEnums::SkinParts skinPart, - QPainter *painter, const QRect &rect, SkinElementFlags flags) -{ - static const bool doCache = -#if defined(Q_WS_S60) - // Freezes on 3.1. Anyways, caching is only really needed on touch UI - !(QSysInfo::s60Version() == QSysInfo::SV_S60_3_1 || QSysInfo::s60Version() == QSysInfo::SV_S60_3_2); -#else - true; -#endif - const QPixmap skinPartPixMap((doCache ? cachedPart : part)(skinPart, rect.size(), flags)); - if (!skinPartPixMap.isNull()) - painter->drawPixmap(rect.topLeft(), skinPartPixMap); -} - -void QS60StylePrivate::drawFrame(SkinFrameElements frameElement, QPainter *painter, const QRect &rect, SkinElementFlags flags) -{ - static const bool doCache = -#if defined(Q_WS_S60) - // Freezes on 3.1. Anyways, caching is only really needed on touch UI - !(QSysInfo::s60Version() == QSysInfo::SV_S60_3_1 || QSysInfo::s60Version() == QSysInfo::SV_S60_3_2); -#else - true; -#endif - const QPixmap frameElementPixMap((doCache ? cachedFrame : frame)(frameElement, rect.size(), flags)); - if (!frameElementPixMap.isNull()) - painter->drawPixmap(rect.topLeft(), frameElementPixMap); -} - -void QS60StylePrivate::drawRow(QS60StyleEnums::SkinParts start, - QS60StyleEnums::SkinParts middle, QS60StyleEnums::SkinParts end, - Qt::Orientation orientation, QPainter *painter, const QRect &rect, - SkinElementFlags flags) -{ - QSize startEndSize(partSize(start, flags)); - startEndSize.scale(rect.size(), Qt::KeepAspectRatio); - - QRect startRect = QRect(rect.topLeft(), startEndSize); - QRect middleRect = rect; - QRect endRect; - - if (orientation == Qt::Horizontal) { - startRect.setWidth(qMin(rect.width() / 2 - 1, startRect.width())); - endRect = startRect.translated(rect.width() - startRect.width(), 0); - middleRect.adjust(startRect.width(), 0, -startRect.width(), 0); - } else { - startRect.setHeight(qMin(rect.height() / 2 - 1, startRect.height())); - endRect = startRect.translated(0, rect.height() - startRect.height()); - middleRect.adjust(0, startRect.height(), 0, -startRect.height()); - } - -#if 0 - painter->save(); - painter->setOpacity(.3); - painter->fillRect(startRect, Qt::red); - painter->fillRect(middleRect, Qt::green); - painter->fillRect(endRect, Qt::blue); - painter->restore(); -#else - drawPart(start, painter, startRect, flags); - if (middleRect.isValid()) - drawPart(middle, painter, middleRect, flags); - drawPart(end, painter, endRect, flags); -#endif -} - -QPixmap QS60StylePrivate::cachedPart(QS60StyleEnums::SkinParts part, - const QSize &size, SkinElementFlags flags) -{ - QPixmap result; - const QString cacheKey = - QString::fromLatin1("S60Style: SkinParts=%1 QSize=%2|%3 SkinPartFlags=%4") - .arg((int)part).arg(size.width()).arg(size.height()).arg((int)flags); - if (!QPixmapCache::find(cacheKey, result)) { - result = QS60StylePrivate::part(part, size, flags); - QPixmapCache::insert(cacheKey, result); - } - return result; -} - -QPixmap QS60StylePrivate::cachedFrame(SkinFrameElements frame, const QSize &size, SkinElementFlags flags) -{ - QPixmap result; - const QString cacheKey = - QString::fromLatin1("S60Style: SkinFrameElements=%1 QSize=%2|%3 SkinElementFlags=%4") - .arg((int)frame).arg(size.width()).arg(size.height()).arg((int)flags); - if (!QPixmapCache::find(cacheKey, result)) { - result = QS60StylePrivate::frame(frame, size, flags); - QPixmapCache::insert(cacheKey, result); - } - return result; -} - -void QS60StylePrivate::refreshUI() -{ - foreach (QWidget *topLevelWidget, QApplication::allWidgets()) { - topLevelWidget->updateGeometry(); - //todo: study how we can get rid of this. Apparently scrollbars cache pixelmetrics values, and we need them to update themselves - // maybe styleChanged event is enough? - QCoreApplication::postEvent(topLevelWidget, new QResizeEvent(topLevelWidget->size(), topLevelWidget->size())); - } -} - void QS60StylePrivate::drawSkinElement(SkinElements element, QPainter *painter, const QRect &rect, SkinElementFlags flags) { @@ -348,73 +245,6 @@ void QS60StylePrivate::drawSkinElement(SkinElements element, QPainter *painter, } } -QSize QS60StylePrivate::partSize(QS60StyleEnums::SkinParts part, SkinElementFlags flags) -{ - QSize result(20, 20); - switch (part) - { - case QS60StyleEnums::SP_QgnGrafBarProgress: - result.setWidth(pixelMetric(QStyle::PM_ProgressBarChunkWidth)); - break; - case QS60StyleEnums::SP_QgnGrafTabActiveM: - case QS60StyleEnums::SP_QgnGrafTabPassiveM: - case QS60StyleEnums::SP_QgnGrafTabActiveR: - case QS60StyleEnums::SP_QgnGrafTabPassiveR: - case QS60StyleEnums::SP_QgnGrafTabPassiveL: - case QS60StyleEnums::SP_QgnGrafTabActiveL: - break; - case QS60StyleEnums::SP_QgnIndiSliderEdit: - result.scale(pixelMetric(QStyle::PM_SliderLength), - pixelMetric(QStyle::PM_SliderControlThickness), Qt::IgnoreAspectRatio); - break; - - case QS60StyleEnums::SP_QsnCpScrollHandleBottomPressed: - case QS60StyleEnums::SP_QsnCpScrollHandleTopPressed: - case QS60StyleEnums::SP_QsnCpScrollHandleMiddlePressed: - case QS60StyleEnums::SP_QsnCpScrollBgBottom: - case QS60StyleEnums::SP_QsnCpScrollBgMiddle: - case QS60StyleEnums::SP_QsnCpScrollBgTop: - case QS60StyleEnums::SP_QsnCpScrollHandleBottom: - case QS60StyleEnums::SP_QsnCpScrollHandleMiddle: - case QS60StyleEnums::SP_QsnCpScrollHandleTop: - result.setHeight(pixelMetric(QStyle::PM_ScrollBarExtent)); - result.setWidth(pixelMetric(QStyle::PM_ScrollBarExtent)); - break; - default: - // Generic frame part size gathering. - for (int i = 0; i < frameElementsCount; ++i) - { - switch (m_frameElementsData[i].center - part) { - case 8: /* CornerTl */ - case 7: /* CornerTr */ - case 6: /* CornerBl */ - case 5: /* CornerBr */ - result.setWidth(pixelMetric(PM_Custom_FrameCornerWidth)); - // Falltrough intended... - case 4: /* SideT */ - case 3: /* SideB */ - result.setHeight(pixelMetric(PM_Custom_FrameCornerHeight)); - break; - case 2: /* SideL */ - case 1: /* SideR */ - result.setWidth(pixelMetric(PM_Custom_FrameCornerWidth)); - break; - case 0: /* center */ - default: - break; - } - } - break; - } - if (flags & (QS60StylePrivate::SF_PointEast | QS60StylePrivate::SF_PointWest)) { - const int temp = result.width(); - result.setWidth(result.height()); - result.setHeight(temp); - } - return result; -} - - void QS60StylePrivate::drawSkinPart(QS60StyleEnums::SkinParts part, QPainter *painter, const QRect &rect, SkinElementFlags flags) { @@ -440,6 +270,96 @@ void QS60StylePrivate::setStyleProperty(const char *name, const QVariant &value) } } +QVariant QS60StylePrivate::styleProperty(const char *name) const +{ + if (name == propertyKeyLayouts) { +#if !defined(QT_WS_S60) || defined(QT_S60STYLE_LAYOUTDATA_SIMULATED) + static QStringList layouts; + if (layouts.isEmpty()) + for (int i = 0; i < QS60StylePrivate::m_numberOfLayouts; i++) + layouts.append(QS60StylePrivate::m_layoutHeaders[i].layoutName); + return layouts; +#else + qFatal("Cannot return list of 'canned' static layouts. Dynamic layouts are used!"); +#endif + } + return QVariant(); +} + +QColor QS60StylePrivate::stateColor(const QColor& color, const QStyleOption *option) +{ + QColor retColor (color); + if (option && !(option->state & QStyle::State_Enabled)) { + QColor hsvColor = retColor.toHsv(); + int colorSat = hsvColor.saturation(); + int colorVal = hsvColor.value(); + colorSat = (colorSat!=0) ? (colorSat>>1) : 128; + colorVal = (colorVal!=0) ? (colorVal>>1) : 128; + hsvColor.setHsv(hsvColor.hue(), colorSat, colorVal); + retColor = hsvColor.toRgb(); + } + return retColor; +} + +QColor QS60StylePrivate::lighterColor(const QColor &baseColor) +{ + QColor result(baseColor); + bool modifyColor = false; + if (result.saturation() == 0) { + result.setHsv(result.hue(), 128, result.value()); + modifyColor = true; + } + if (result.value() == 0) { + result.setHsv(result.hue(), result.saturation(), 128); + modifyColor = true; + } + if (modifyColor) + result = result.lighter(175); + else + result = result.lighter(225); + return result; +} + +bool QS60StylePrivate::isSkinnableDialog(const QWidget *widget) +{ + return (qobject_cast (widget) || + qobject_cast (widget)); +} + +QFont QS60StylePrivate::s60Font( + QS60StyleEnums::FontCategories fontCategory, int pointSize) const +{ + QFont result; + int actualPointSize = pointSize; + if (actualPointSize <= 0) { + const QFont appFont = QApplication::font(); + actualPointSize = appFont.pointSize(); + if (actualPointSize <= 0) + actualPointSize = appFont.pixelSize() * 72 / qt_defaultDpiY(); + } + Q_ASSERT(actualPointSize > 0); + const QPair key(fontCategory, actualPointSize); + if (!m_mappedFontsCache.contains(key)) { + result = s60Font_specific(fontCategory, actualPointSize); + m_mappedFontsCache.insert(key, result); + } else { + result = m_mappedFontsCache.value(key); + if (result.pointSize() != actualPointSize) + result.setPointSize(actualPointSize); + } + return result; +} + +//todo: you could pass a reason to clear cache here, so that we could +// deduce whether or not the specific cache needs to be cleared +void QS60StylePrivate::clearCaches() +{ + m_colorCache.clear(); + m_mappedFontsCache.clear(); + QPixmapCache::clear(); + m_backgroundValid = false; +} + // Since S60Style has 'button' and 'tooltip' as a graphic, we don't have any native color which to use // for QPalette::Button and QPalette::ToolTipBase. Therefore we need to guesstimate // this by calculating average rgb values for button pixels. @@ -502,11 +422,6 @@ QColor QS60StylePrivate::colorFromFrameGraphics(QS60StylePrivate::SkinFrameEleme } -int QS60StylePrivate::focusRectPenWidth() -{ - return pixelMetric(QS60Style::PM_DefaultFrameWidth); -} - void QS60StylePrivate::setThemePalette(QApplication *app) const { if (!app) @@ -634,166 +549,187 @@ void QS60StylePrivate::setBackgroundTexture(QApplication *app) const app->setPalette(applicationPalette); } -void QS60Style::polish(QApplication *application) +int QS60StylePrivate::focusRectPenWidth() { - Q_D(const QS60Style); - originalPalette = application->palette(); - d->setThemePalette(application); + return pixelMetric(QS60Style::PM_DefaultFrameWidth); } -void QS60Style::polish(QWidget *widget) +#if !defined(QT_WS_S60) || defined(QT_S60STYLE_LAYOUTDATA_SIMULATED) +void QS60StylePrivate::setCurrentLayout(int index) { - Q_D(const QS60Style); - QCommonStyle::polish(widget); - - if (!widget) - return; - - if (QS60StylePrivate::isSkinnableDialog(widget)) { - widget->setAttribute(Qt::WA_StyledBackground); - } else if (false -#ifndef QT_NO_MENU - || qobject_cast (widget) -#endif // QT_NO_MENU - ) { - widget->setAttribute(Qt::WA_StyledBackground); - } else if (false -#ifndef QT_NO_COMBOBOX - || qobject_cast(widget) -#endif //QT_NO_COMBOBOX - ) { - widget->setAttribute(Qt::WA_StyledBackground); - } - d->setThemePalette(widget); + m_pmPointer = data[index]; } +#endif -void QS60Style::unpolish(QApplication *application) -{ - QPalette newPalette = qApp->style()->standardPalette(); - application->setPalette(newPalette); - QApplicationPrivate::setSystemPalette(originalPalette); -} -void QS60Style::unpolish(QWidget *widget) +void QS60StylePrivate::drawPart(QS60StyleEnums::SkinParts skinPart, + QPainter *painter, const QRect &rect, SkinElementFlags flags) { - if (QS60StylePrivate::isSkinnableDialog(widget)) { - widget->setAttribute(Qt::WA_StyledBackground, false); - } else if (false -#ifndef QT_NO_MENU - || qobject_cast (widget) -#endif // QT_NO_MENU - ) { - widget->setAttribute(Qt::WA_StyledBackground, false); - } else if (false -#ifndef QT_NO_COMBOBOX - || qobject_cast(widget) -#endif //QT_NO_COMBOBOX - ) { - widget->setAttribute(Qt::WA_StyledBackground, false); - } - - if (widget) { - widget->setPalette(QPalette()); - } - - QCommonStyle::unpolish(widget); + static const bool doCache = +#if defined(Q_WS_S60) + // Freezes on 3.1. Anyways, caching is only really needed on touch UI + !(QSysInfo::s60Version() == QSysInfo::SV_S60_3_1 || QSysInfo::s60Version() == QSysInfo::SV_S60_3_2); +#else + true; +#endif + const QPixmap skinPartPixMap((doCache ? cachedPart : part)(skinPart, rect.size(), flags)); + if (!skinPartPixMap.isNull()) + painter->drawPixmap(rect.topLeft(), skinPartPixMap); } -QVariant QS60StylePrivate::styleProperty(const char *name) const -{ - if (name == propertyKeyLayouts) { -#if !defined(QT_WS_S60) || defined(QT_S60STYLE_LAYOUTDATA_SIMULATED) - static QStringList layouts; - if (layouts.isEmpty()) - for (int i = 0; i < QS60StylePrivate::m_numberOfLayouts; i++) - layouts.append(QS60StylePrivate::m_layoutHeaders[i].layoutName); - return layouts; +void QS60StylePrivate::drawFrame(SkinFrameElements frameElement, QPainter *painter, const QRect &rect, SkinElementFlags flags) +{ + static const bool doCache = +#if defined(Q_WS_S60) + // Freezes on 3.1. Anyways, caching is only really needed on touch UI + !(QSysInfo::s60Version() == QSysInfo::SV_S60_3_1 || QSysInfo::s60Version() == QSysInfo::SV_S60_3_2); #else - qFatal("Cannot return list of 'canned' static layouts. Dynamic layouts are used!"); + true; #endif - } - return QVariant(); + const QPixmap frameElementPixMap((doCache ? cachedFrame : frame)(frameElement, rect.size(), flags)); + if (!frameElementPixMap.isNull()) + painter->drawPixmap(rect.topLeft(), frameElementPixMap); } -QFont QS60StylePrivate::s60Font( - QS60StyleEnums::FontCategories fontCategory, int pointSize) const +void QS60StylePrivate::drawRow(QS60StyleEnums::SkinParts start, + QS60StyleEnums::SkinParts middle, QS60StyleEnums::SkinParts end, + Qt::Orientation orientation, QPainter *painter, const QRect &rect, + SkinElementFlags flags) { - QFont result; - int actualPointSize = pointSize; - if (actualPointSize <= 0) { - const QFont appFont = QApplication::font(); - actualPointSize = appFont.pointSize(); - if (actualPointSize <= 0) - actualPointSize = appFont.pixelSize() * 72 / qt_defaultDpiY(); - } - Q_ASSERT(actualPointSize > 0); - const QPair key(fontCategory, actualPointSize); - if (!m_mappedFontsCache.contains(key)) { - result = s60Font_specific(fontCategory, actualPointSize); - m_mappedFontsCache.insert(key, result); + QSize startEndSize(partSize(start, flags)); + startEndSize.scale(rect.size(), Qt::KeepAspectRatio); + + QRect startRect = QRect(rect.topLeft(), startEndSize); + QRect middleRect = rect; + QRect endRect; + + if (orientation == Qt::Horizontal) { + startRect.setWidth(qMin(rect.width() / 2 - 1, startRect.width())); + endRect = startRect.translated(rect.width() - startRect.width(), 0); + middleRect.adjust(startRect.width(), 0, -startRect.width(), 0); } else { - result = m_mappedFontsCache.value(key); - if (result.pointSize() != actualPointSize) - result.setPointSize(actualPointSize); + startRect.setHeight(qMin(rect.height() / 2 - 1, startRect.height())); + endRect = startRect.translated(0, rect.height() - startRect.height()); + middleRect.adjust(0, startRect.height(), 0, -startRect.height()); } - return result; -} -//todo: you could pass a reason to clear cache here, so that we could -// deduce whether or not the specific cache needs to be cleared -void QS60StylePrivate::clearCaches() -{ - m_colorCache.clear(); - m_mappedFontsCache.clear(); - QPixmapCache::clear(); - m_backgroundValid = false; +#if 0 + painter->save(); + painter->setOpacity(.3); + painter->fillRect(startRect, Qt::red); + painter->fillRect(middleRect, Qt::green); + painter->fillRect(endRect, Qt::blue); + painter->restore(); +#else + drawPart(start, painter, startRect, flags); + if (middleRect.isValid()) + drawPart(middle, painter, middleRect, flags); + drawPart(end, painter, endRect, flags); +#endif } -QColor QS60StylePrivate::lighterColor(const QColor &baseColor) +QPixmap QS60StylePrivate::cachedPart(QS60StyleEnums::SkinParts part, + const QSize &size, SkinElementFlags flags) { - QColor result(baseColor); - bool modifyColor = false; - if (result.saturation() == 0) { - result.setHsv(result.hue(), 128, result.value()); - modifyColor = true; - } - if (result.value() == 0) { - result.setHsv(result.hue(), result.saturation(), 128); - modifyColor = true; + QPixmap result; + const QString cacheKey = + QString::fromLatin1("S60Style: SkinParts=%1 QSize=%2|%3 SkinPartFlags=%4") + .arg((int)part).arg(size.width()).arg(size.height()).arg((int)flags); + if (!QPixmapCache::find(cacheKey, result)) { + result = QS60StylePrivate::part(part, size, flags); + QPixmapCache::insert(cacheKey, result); } - if (modifyColor) - result = result.lighter(175); - else - result = result.lighter(225); return result; } -bool QS60StylePrivate::isSkinnableDialog(const QWidget *widget) +QPixmap QS60StylePrivate::cachedFrame(SkinFrameElements frame, const QSize &size, SkinElementFlags flags) { - return (qobject_cast (widget) || - qobject_cast (widget)); + QPixmap result; + const QString cacheKey = + QString::fromLatin1("S60Style: SkinFrameElements=%1 QSize=%2|%3 SkinElementFlags=%4") + .arg((int)frame).arg(size.width()).arg(size.height()).arg((int)flags); + if (!QPixmapCache::find(cacheKey, result)) { + result = QS60StylePrivate::frame(frame, size, flags); + QPixmapCache::insert(cacheKey, result); + } + return result; } -#if !defined(QT_WS_S60) || defined(QT_S60STYLE_LAYOUTDATA_SIMULATED) -void QS60StylePrivate::setCurrentLayout(int index) +void QS60StylePrivate::refreshUI() { - m_pmPointer = data[index]; + foreach (QWidget *topLevelWidget, QApplication::allWidgets()) { + topLevelWidget->updateGeometry(); + //todo: study how we can get rid of this. Apparently scrollbars cache pixelmetrics values, and we need them to update themselves + // maybe styleChanged event is enough? + //QCoreApplication::postEvent(topLevelWidget, new QEvent(QEvent::StyleChange)); + QCoreApplication::postEvent(topLevelWidget, new QResizeEvent(topLevelWidget->size(), topLevelWidget->size())); + } } -#endif -QColor QS60StylePrivate::stateColor(const QColor& color, const QStyleOption *option) +QSize QS60StylePrivate::partSize(QS60StyleEnums::SkinParts part, SkinElementFlags flags) { - QColor retColor (color); - if (option && !(option->state & QStyle::State_Enabled)) { - QColor hsvColor = retColor.toHsv(); - int colorSat = hsvColor.saturation(); - int colorVal = hsvColor.value(); - colorSat = (colorSat!=0) ? (colorSat>>1) : 128; - colorVal = (colorVal!=0) ? (colorVal>>1) : 128; - hsvColor.setHsv(hsvColor.hue(), colorSat, colorVal); - retColor = hsvColor.toRgb(); + QSize result(20, 20); + switch (part) + { + case QS60StyleEnums::SP_QgnGrafBarProgress: + result.setWidth(pixelMetric(QStyle::PM_ProgressBarChunkWidth)); + break; + case QS60StyleEnums::SP_QgnGrafTabActiveM: + case QS60StyleEnums::SP_QgnGrafTabPassiveM: + case QS60StyleEnums::SP_QgnGrafTabActiveR: + case QS60StyleEnums::SP_QgnGrafTabPassiveR: + case QS60StyleEnums::SP_QgnGrafTabPassiveL: + case QS60StyleEnums::SP_QgnGrafTabActiveL: + break; + case QS60StyleEnums::SP_QgnIndiSliderEdit: + result.scale(pixelMetric(QStyle::PM_SliderLength), + pixelMetric(QStyle::PM_SliderControlThickness), Qt::IgnoreAspectRatio); + break; + + case QS60StyleEnums::SP_QsnCpScrollHandleBottomPressed: + case QS60StyleEnums::SP_QsnCpScrollHandleTopPressed: + case QS60StyleEnums::SP_QsnCpScrollHandleMiddlePressed: + case QS60StyleEnums::SP_QsnCpScrollBgBottom: + case QS60StyleEnums::SP_QsnCpScrollBgMiddle: + case QS60StyleEnums::SP_QsnCpScrollBgTop: + case QS60StyleEnums::SP_QsnCpScrollHandleBottom: + case QS60StyleEnums::SP_QsnCpScrollHandleMiddle: + case QS60StyleEnums::SP_QsnCpScrollHandleTop: + result.setHeight(pixelMetric(QStyle::PM_ScrollBarExtent)); + result.setWidth(pixelMetric(QStyle::PM_ScrollBarExtent)); + break; + default: + // Generic frame part size gathering. + for (int i = 0; i < frameElementsCount; ++i) + { + switch (m_frameElementsData[i].center - part) { + case 8: /* CornerTl */ + case 7: /* CornerTr */ + case 6: /* CornerBl */ + case 5: /* CornerBr */ + result.setWidth(pixelMetric(PM_Custom_FrameCornerWidth)); + // Falltrough intended... + case 4: /* SideT */ + case 3: /* SideB */ + result.setHeight(pixelMetric(PM_Custom_FrameCornerHeight)); + break; + case 2: /* SideL */ + case 1: /* SideR */ + result.setWidth(pixelMetric(PM_Custom_FrameCornerWidth)); + break; + case 0: /* center */ + default: + break; + } + } + break; } - return retColor; + if (flags & (QS60StylePrivate::SF_PointEast | QS60StylePrivate::SF_PointWest)) { + const int temp = result.width(); + result.setWidth(result.height()); + result.setHeight(temp); + } + return result; } /*! @@ -2674,6 +2610,71 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con return ret; } +void QS60Style::polish(QWidget *widget) +{ + Q_D(const QS60Style); + QCommonStyle::polish(widget); + + if (!widget) + return; + + if (QS60StylePrivate::isSkinnableDialog(widget)) { + widget->setAttribute(Qt::WA_StyledBackground); + } else if (false +#ifndef QT_NO_MENU + || qobject_cast (widget) +#endif // QT_NO_MENU + ) { + widget->setAttribute(Qt::WA_StyledBackground); + } else if (false +#ifndef QT_NO_COMBOBOX + || qobject_cast(widget) +#endif //QT_NO_COMBOBOX + ) { + widget->setAttribute(Qt::WA_StyledBackground); + } + d->setThemePalette(widget); +} + +void QS60Style::unpolish(QWidget *widget) +{ + if (QS60StylePrivate::isSkinnableDialog(widget)) { + widget->setAttribute(Qt::WA_StyledBackground, false); + } else if (false +#ifndef QT_NO_MENU + || qobject_cast (widget) +#endif // QT_NO_MENU + ) { + widget->setAttribute(Qt::WA_StyledBackground, false); + } else if (false +#ifndef QT_NO_COMBOBOX + || qobject_cast(widget) +#endif //QT_NO_COMBOBOX + ) { + widget->setAttribute(Qt::WA_StyledBackground, false); + } + + if (widget) { + widget->setPalette(QPalette()); + } + + QCommonStyle::unpolish(widget); +} + +void QS60Style::polish(QApplication *application) +{ + Q_D(const QS60Style); + originalPalette = application->palette(); + d->setThemePalette(application); +} + +void QS60Style::unpolish(QApplication *application) +{ + QPalette newPalette = qApp->style()->standardPalette(); + application->setPalette(newPalette); + QApplicationPrivate::setSystemPalette(originalPalette); +} + void QS60Style::setStyleProperty(const char *name, const QVariant &value) { Q_D(QS60Style); diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index cf850c6..1df202d 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -355,14 +355,19 @@ public: int index, const QStyleOption *option); // gets state specific color static QColor stateColor(const QColor &color, const QStyleOption *option); + // gets lighter color than base color static QColor lighterColor(const QColor &baseColor); + //deduces if the given widget should have separately themeable background + //todo: change method name static bool isSkinnableDialog(const QWidget *widget); // gets layout static const QHash &s60StyleLayout(); QFont s60Font(QS60StyleEnums::FontCategories fontCategory, int pointSize = -1) const; + // clears all style caches (fonts, colors, pixmaps) void clearCaches(); + // returns themed background texture static QPixmap backgroundTexture(); static bool isTouchSupported(); @@ -371,7 +376,7 @@ public: // calculates average color based on button skin graphics (minus borders). QColor colorFromFrameGraphics(QS60StylePrivate::SkinFrameElements frame) const; void setThemePalette(QApplication *application) const; - void setThemePalette(QWidget *application) const; + void setThemePalette(QWidget *widget) const; void setBackgroundTexture(QApplication *application) const; static int focusRectPenWidth(); @@ -409,19 +414,20 @@ private: static void drawFrame(SkinFrameElements frame, QPainter *painter, const QRect &rect, SkinElementFlags flags = KDefaultSkinElementFlags); - static QSize partSize(QS60StyleEnums::SkinParts part, - SkinElementFlags flags = KDefaultSkinElementFlags); - static QPixmap part(QS60StyleEnums::SkinParts part, const QSize &size, - SkinElementFlags flags = KDefaultSkinElementFlags); static QPixmap cachedPart(QS60StyleEnums::SkinParts part, const QSize &size, SkinElementFlags flags = KDefaultSkinElementFlags); static QPixmap cachedFrame(SkinFrameElements frame, const QSize &size, SkinElementFlags flags = KDefaultSkinElementFlags); + + static void refreshUI(); + + static QSize partSize(QS60StyleEnums::SkinParts part, + SkinElementFlags flags = KDefaultSkinElementFlags); + static QPixmap part(QS60StyleEnums::SkinParts part, const QSize &size, + SkinElementFlags flags = KDefaultSkinElementFlags); static QFont s60Font_specific(QS60StyleEnums::FontCategories fontCategory, int pointSize); - static void refreshUI(); - static QSize screenSize(); static bool m_backgroundValid; diff --git a/src/gui/styles/qs60style_symbian.cpp b/src/gui/styles/qs60style_symbian.cpp index 76c94ad..fd96a2b 100644 --- a/src/gui/styles/qs60style_symbian.cpp +++ b/src/gui/styles/qs60style_symbian.cpp @@ -667,6 +667,7 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL( HBufC* iconFile = HBufC::NewLC( KMaxFileName ); TPtr fileNamePtr = iconFile->Des(); fallbackInfo(part, fileNamePtr, fallbackGraphicID); + // todo: could we instead use AknIconUtils::AvkonIconFileName(); to avoid allocating each time? CFbsBitmap *icon = 0; CFbsBitmap *iconMask = 0; @@ -990,6 +991,23 @@ QS60StylePrivate::~QS60StylePrivate() m_backgroundValid = false; } +void QS60StylePrivate::setStyleProperty_specific(const char *name, const QVariant &value) +{ + if (name == QLatin1String("foo")) { + // BaR + } else { + setStyleProperty(name, value); + } +} + +QVariant QS60StylePrivate::styleProperty_specific(const char *name) const +{ + if (name == QLatin1String("foo")) + return QLatin1String("Bar"); + else + return styleProperty(name); +} + short QS60StylePrivate::pixelMetric(int metric) { #ifdef QT_S60STYLE_LAYOUTDATA_SIMULATED @@ -1004,6 +1022,24 @@ short QS60StylePrivate::pixelMetric(int metric) #endif // QT_S60STYLE_LAYOUTDATA_SIMULATED } +QColor QS60StylePrivate::s60Color(QS60StyleEnums::ColorLists list, + int index, const QStyleOption *option) +{ + static const TAknsItemID *idMap[] = { + &KAknsIIDQsnHighlightColors, + &KAknsIIDQsnIconColors, + &KAknsIIDQsnLineColors, + &KAknsIIDQsnOtherColors, + &KAknsIIDQsnParentColors, + &KAknsIIDQsnTextColors + }; + Q_ASSERT((int)list <= (int)sizeof(idMap)/sizeof(idMap[0])); + const QColor color = QS60StyleModeSpecifics::colorValue(*idMap[(int) list], index - 1); + return option ? QS60StylePrivate::stateColor(color, option) : color; +} + +// In some cases, the AVKON UI themegraphic is already in 'disabled state'. +// If so, return true for these parts. bool QS60StyleModeSpecifics::disabledPartGraphic(QS60StyleEnums::SkinParts &part) { bool disabledGraphic = false; @@ -1028,6 +1064,8 @@ bool QS60StyleModeSpecifics::disabledPartGraphic(QS60StyleEnums::SkinParts &part return disabledGraphic; } +// In some cases, the AVKON UI themegraphic is already in 'disabled state'. +// If so, return true for these frames. bool QS60StyleModeSpecifics::disabledFrameGraphic(QS60StylePrivate::SkinFrameElements &frame) { bool disabledGraphic = false; @@ -1076,7 +1114,7 @@ QPixmap QS60StyleModeSpecifics::generateMissingThemeGraphic(QS60StyleEnums::Skin QPixmap result = skinnedGraphics(updatedPart, size, flags); // TODO: fix this QStyleOption opt; - // opt.palette = q->standardPalette(); + //opt.palette = q->standardPalette(); // For now, always generate new icon based on "selected". In the future possibly, expand // this to consist other possibilities as well. @@ -1122,39 +1160,6 @@ QPixmap QS60StylePrivate::frame(SkinFrameElements frame, const QSize &size, Skin return result; } -void QS60StylePrivate::setStyleProperty_specific(const char *name, const QVariant &value) -{ - if (name == QLatin1String("foo")) { - // BaR - } else { - setStyleProperty(name, value); - } -} - -QVariant QS60StylePrivate::styleProperty_specific(const char *name) const -{ - if (name == QLatin1String("foo")) - return QLatin1String("Bar"); - else - return styleProperty(name); -} - -QColor QS60StylePrivate::s60Color(QS60StyleEnums::ColorLists list, - int index, const QStyleOption *option) -{ - static const TAknsItemID *idMap[] = { - &KAknsIIDQsnHighlightColors, - &KAknsIIDQsnIconColors, - &KAknsIIDQsnLineColors, - &KAknsIIDQsnOtherColors, - &KAknsIIDQsnParentColors, - &KAknsIIDQsnTextColors - }; - Q_ASSERT((int)list <= (int)sizeof(idMap)/sizeof(idMap[0])); - const QColor color = QS60StyleModeSpecifics::colorValue(*idMap[(int) list], index - 1); - return option ? QS60StylePrivate::stateColor(color, option) : color; -} - // If the public SDK returns compressed images, please let us also uncompress those! void QS60StyleModeSpecifics::unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap* aTrgBitmap, CFbsBitmap* aSrcBitmap) { -- cgit v0.12 From 377a0ece82b91e00e4fc8935a73dc18cd218abf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Mon, 25 May 2009 10:28:56 +0300 Subject: S60Style: Change IsSkinnableDialog method name to drawsOwnThemeBackground. --- src/gui/styles/qs60style.cpp | 8 ++++---- src/gui/styles/qs60style_p.h | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 2af80f0..f690f1d 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -320,7 +320,7 @@ QColor QS60StylePrivate::lighterColor(const QColor &baseColor) return result; } -bool QS60StylePrivate::isSkinnableDialog(const QWidget *widget) +bool QS60StylePrivate::drawsOwnThemeBackground(const QWidget *widget) { return (qobject_cast (widget) || qobject_cast (widget)); @@ -2014,7 +2014,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti } break; case PE_Widget: - if (QS60StylePrivate::isSkinnableDialog(widget) || + if (QS60StylePrivate::drawsOwnThemeBackground(widget) || qobject_cast(widget) || qobject_cast (widget)) { QS60StylePrivate::SkinElements skinElement = QS60StylePrivate::SE_OptionsMenu; @@ -2618,7 +2618,7 @@ void QS60Style::polish(QWidget *widget) if (!widget) return; - if (QS60StylePrivate::isSkinnableDialog(widget)) { + if (QS60StylePrivate::drawsOwnThemeBackground(widget)) { widget->setAttribute(Qt::WA_StyledBackground); } else if (false #ifndef QT_NO_MENU @@ -2638,7 +2638,7 @@ void QS60Style::polish(QWidget *widget) void QS60Style::unpolish(QWidget *widget) { - if (QS60StylePrivate::isSkinnableDialog(widget)) { + if (QS60StylePrivate::drawsOwnThemeBackground(widget)) { widget->setAttribute(Qt::WA_StyledBackground, false); } else if (false #ifndef QT_NO_MENU diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index 1df202d..37c6ec7 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -358,8 +358,7 @@ public: // gets lighter color than base color static QColor lighterColor(const QColor &baseColor); //deduces if the given widget should have separately themeable background - //todo: change method name - static bool isSkinnableDialog(const QWidget *widget); + static bool drawsOwnThemeBackground(const QWidget *widget); // gets layout static const QHash &s60StyleLayout(); -- cgit v0.12 From 662494c7a20d6612948a672e5e9c87b9173d9560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Mon, 25 May 2009 10:53:00 +0300 Subject: S60Style: Change QTreeView elements to be non-color-skinnable. --- src/gui/styles/qs60style.cpp | 6 ++---- src/gui/styles/qs60style_symbian.cpp | 5 ----- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index f690f1d..e65d98f 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2109,10 +2109,8 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti drawSkinPart = true; } - if ( drawSkinPart ) { - QS60StylePrivate::drawSkinPart(skinPart, painter, option->rect, - (flags | QS60StylePrivate::SF_ColorSkinned)); - } + if ( drawSkinPart ) + QS60StylePrivate::drawSkinPart(skinPart, painter, option->rect, flags); if (option->state & State_Children) { QS60StyleEnums::SkinParts skinPart = diff --git a/src/gui/styles/qs60style_symbian.cpp b/src/gui/styles/qs60style_symbian.cpp index fd96a2b..92e806a 100644 --- a/src/gui/styles/qs60style_symbian.cpp +++ b/src/gui/styles/qs60style_symbian.cpp @@ -1311,11 +1311,6 @@ void QS60StyleModeSpecifics::colorGroupAndIndex( { switch(skinID) { case QS60StyleEnums::SP_QgnIndiSubMenu: - case QS60StyleEnums::SP_QgnIndiHlColSuper: - case QS60StyleEnums::SP_QgnIndiHlExpSuper: - case QS60StyleEnums::SP_QgnIndiHlLineBranch: - case QS60StyleEnums::SP_QgnIndiHlLineEnd: - case QS60StyleEnums::SP_QgnIndiHlLineStraight: colorGroup = KAknsIIDQsnIconColors; colorIndex = EAknsCIQsnIconColorsCG1; break; -- cgit v0.12 From 878ccb0645e7f1416daeddd6acdc37fea16b5e25 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 25 May 2009 10:12:27 +0200 Subject: qdoc: Added some missing qdoc comments. Task-number: 252493 --- src/gui/painting/qcolormap_mac.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gui/painting/qcolormap_mac.cpp b/src/gui/painting/qcolormap_mac.cpp index 96da90f..afe0378 100644 --- a/src/gui/painting/qcolormap_mac.cpp +++ b/src/gui/painting/qcolormap_mac.cpp @@ -55,11 +55,17 @@ public: }; static QColormap *qt_mac_global_map = 0; +/*! + Creates the class's internal colormap. + */ void QColormap::initialize() { qt_mac_global_map = new QColormap; } +/*! + Deletes the class's internal colormap. + */ void QColormap::cleanup() { delete qt_mac_global_map; -- cgit v0.12 From 60eb2c290774b639f6fb9b7133e50699c649128a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Mon, 25 May 2009 11:35:54 +0300 Subject: S60Style: Use smaller corner size for tooltip. --- src/gui/styles/qs60style_symbian.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/gui/styles/qs60style_symbian.cpp b/src/gui/styles/qs60style_symbian.cpp index 92e806a..d29e678 100644 --- a/src/gui/styles/qs60style_symbian.cpp +++ b/src/gui/styles/qs60style_symbian.cpp @@ -849,17 +849,19 @@ void QS60StyleModeSpecifics::frameIdAndCenterId(QS60StylePrivate::SkinFrameEleme TRect QS60StyleModeSpecifics::innerRectFromElement(QS60StylePrivate::SkinFrameElements frameElement, const TRect &outerRect) { - TInt widthShrink = 0; - TInt heightShrink = 0; + TInt widthShrink = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth); + TInt heightShrink = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerHeight); switch(frameElement) { case QS60StylePrivate::SF_PanelBackground: // panel should have slightly slimmer border to enable thin line of background graphics between closest component - widthShrink = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth)-2; - heightShrink = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerHeight)-2; + widthShrink = widthShrink-2; + heightShrink = heightShrink-2; + break; + case QS60StylePrivate::SF_ToolTip: + widthShrink = widthShrink>>1; + heightShrink = heightShrink>>1; break; default: - widthShrink = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth); - heightShrink = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerHeight); break; } TRect innerRect(outerRect); -- cgit v0.12 From 2e3826fef5abfece022fbd1f0a1f4fbaf8c5a719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Mon, 25 May 2009 11:38:52 +0300 Subject: S60Style: Set WA_OpaquePaintEvent off for scrollbars to draw transparency correctly. --- src/gui/styles/qs60style.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index e65d98f..f8cf885 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -1145,7 +1145,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, QS60StyleEnums::SkinParts skinPart; QS60StylePrivate::SkinElements skinElement; if (!isDisabled) { - const bool isPressed = (option->state & QStyle::State_Sunken) || + const bool isPressed = (option->state & QStyle::State_Sunken) || (option->state & QStyle::State_On); if (isFlat) { skinPart = @@ -1280,7 +1280,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, QRect textRect = subElementRect(SE_ItemViewItemText, &voptAdj, widget); // draw themed background for table unless background brush has been defined. - if (vopt->backgroundBrush == Qt::NoBrush) { + if (vopt->backgroundBrush == Qt::NoBrush) { // draw the background const QStyleOptionViewItemV4 *tableOption = qstyleoption_cast(option); const QTableView *table = qobject_cast(widget); @@ -2616,6 +2616,14 @@ void QS60Style::polish(QWidget *widget) if (!widget) return; + if (false +#ifndef QT_NO_SCROLLBAR + || qobject_cast(widget) +#endif + ) { + widget->setAttribute(Qt::WA_OpaquePaintEvent, false); + } + if (QS60StylePrivate::drawsOwnThemeBackground(widget)) { widget->setAttribute(Qt::WA_StyledBackground); } else if (false @@ -2636,6 +2644,14 @@ void QS60Style::polish(QWidget *widget) void QS60Style::unpolish(QWidget *widget) { + if (false + #ifndef QT_NO_SCROLLBAR + || qobject_cast(widget) + #endif + ) { + widget->setAttribute(Qt::WA_OpaquePaintEvent); + } + if (QS60StylePrivate::drawsOwnThemeBackground(widget)) { widget->setAttribute(Qt::WA_StyledBackground, false); } else if (false @@ -2670,7 +2686,7 @@ void QS60Style::unpolish(QApplication *application) { QPalette newPalette = qApp->style()->standardPalette(); application->setPalette(newPalette); - QApplicationPrivate::setSystemPalette(originalPalette); + QApplicationPrivate::setSystemPalette(originalPalette); } void QS60Style::setStyleProperty(const char *name, const QVariant &value) -- cgit v0.12 From fa2371e705621b95307f0dbc1988ba048cec6520 Mon Sep 17 00:00:00 2001 From: axasia Date: Sat, 23 May 2009 23:33:49 +0900 Subject: Update japanese translation of Qt Assistant 4.5 --- translations/assistant_ja.ts | 395 ++++++++++++++++++++++--------------------- 1 file changed, 203 insertions(+), 192 deletions(-) diff --git a/translations/assistant_ja.ts b/translations/assistant_ja.ts index 1853155..5e4d2c9 100644 --- a/translations/assistant_ja.ts +++ b/translations/assistant_ja.ts @@ -1,12 +1,12 @@ - + AboutDialog &Close - + é–‰ã˜ã‚‹(&C) @@ -14,18 +14,19 @@ Warning - + 警告 Unable to launch external application. - + 外部アプリケーションを起動ã§ãã¾ã›ã‚“。 + OK - + OK @@ -37,42 +38,42 @@ Bookmarks - + ブックマーク Add Bookmark - + ブックマークã®è¿½åŠ  Bookmark: - + ブックマーク: Add in Folder: - + 追加先フォルダ: + - + + New Folder - + æ–°ã—ã„フォルダ Delete Folder - + フォルダを削除 Rename Folder - + フォルダã®åå‰å¤‰æ›´ @@ -80,23 +81,23 @@ Bookmarks - + ブックマーク Remove - + 削除 You are going to delete a Folder, this will also<br>remove it's content. Are you sure to continue? - + フォルダを削除ã™ã‚‹ã¨ä¸­èº«ã‚‚削除ã•ã‚Œã¾ã™ãŒã€ç¶šã‘ã¦ã‚ˆã‚ã—ã„ã§ã™ã‹? New Folder - + æ–°ã—ã„フォルダ @@ -104,47 +105,47 @@ Filter: - + フィルタ: Remove - + 削除 Delete Folder - + フォルダを削除 Rename Folder - + フォルダã®åå‰å¤‰æ›´ Show Bookmark - + ブックマークを開ã Show Bookmark in New Tab - + ブックマークを新ã—ã„タブã§é–‹ã Delete Bookmark - + ブックマークを削除 Rename Bookmark - + ブックマークã®åå‰å¤‰æ›´ Add - + 追加 @@ -152,48 +153,48 @@ Add new page - + æ–°ã—ã„ページã®è¿½åŠ  Close current page - + ç¾åœ¨ã®ãƒšãƒ¼ã‚¸ã‚’é–‰ã˜ã‚‹ Print Document - + ドキュメントをå°åˆ· unknown - + ä¸æ˜Ž Add New Page - + æ–°ã—ã„ページã®è¿½åŠ  Close This Page - + ã“ã®ãƒšãƒ¼ã‚¸ã‚’é–‰ã˜ã‚‹ Close Other Pages - + ä»–ã®ãƒšãƒ¼ã‚¸ã‚’é–‰ã˜ã‚‹ Add Bookmark for this Page... - + ã“ã®ãƒšãƒ¼ã‚¸ã‚’ブックマークã«è¿½åŠ ... Search - + 検索 @@ -201,12 +202,12 @@ Open Link - + リンクを開ã Open Link in New Tab - + リンクを新ã—ã„タブã§é–‹ã @@ -214,12 +215,12 @@ Add Filter Name - + フィルタåを追加 Filter Name: - + フィルタå: @@ -227,27 +228,27 @@ Previous - + 戻る Next - + 進む Case Sensitive - + 大文字/å°æ–‡å­—を区別ã™ã‚‹ Whole words - + å˜èªžå˜ä½ã§æ¤œç´¢ã™ã‚‹ <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped - + <img src=":/trolltech/assistant/images/wrap.png">&nbsp;見ã¤ã‹ã‚‰ãªã‘ã‚Œã°å…ˆé ­ã‹ã‚‰æ¤œç´¢ã™ã‚‹ @@ -255,27 +256,27 @@ Font - + フォント &Writing system - + 文字セット(&W) &Family - + フォントå(&F) &Style - + スタイル(&S) &Point size - + サイズ(&P) @@ -283,38 +284,39 @@ Help - + ヘルプ OK - + OK <title>Error 404...</title><div align="center"><br><br><h1>The page could not be found</h1><br><h3>'%1'</h3></div> - + <title>Error 404...</title><div align="center"><br><br><h1>ページãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“ã§ã—ãŸ</h1><br><h3>'%1'</h3></div> Copy &Link Location - + リンクã®URLをコピー(&L) Open Link in New Tab Ctrl+LMB - + リンクを新ã—ã„タブã§é–‹ã Ctrl+LMB Open Link in New Tab - + リンクを新ã—ã„タブã§é–‹ã Unable to launch external application. - + 外部アプリケーションを起動ã§ãã¾ã›ã‚“。 + @@ -322,17 +324,17 @@ &Look for: - + 検索文字列(&L): Open Link - + リンクを開ã Open Link in New Tab - + リンクを新ã—ã„タブã§é–‹ã @@ -341,97 +343,98 @@ Install Documentation - + ドキュメントã®ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ« Downloading documentation info... - + ドキュメント情報をダウンロード中... Download canceled. - + ダウンロードを中止ã—ã¾ã—ãŸã€‚ Done. - + 完了. The file %1 already exists. Do you want to overwrite it? - + %1 ã¯æ—¢ã«å­˜åœ¨ã—ã¾ã™ã€‚上書ãã—ã¾ã™ã‹? Unable to save the file %1: %2. - + ファイルをä¿å­˜ã§ãã¾ã›ã‚“。%1: %2. Downloading %1... - + %1 をダウンロード中... Download failed: %1. - + ダウンロード失敗: %1. Documentation info file is corrupt! - + ドキュメント情報ファイルãŒä¸æ­£ã§ã™! Download failed: Downloaded file is corrupted. - + ダウンロード失敗: ダウンロードã—ãŸãƒ•ã‚¡ã‚¤ãƒ«ãŒä¸æ­£ã§ã™ã€‚ Installing documentation %1... - + %1 ã®ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã‚’インストール中... Error while installing documentation: %1 - + ドキュメントã®ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ä¸­ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸ: +%1 Available Documentation: - + 使用å¯èƒ½ãªãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆ: Install - + インストール Cancel - + キャンセル Close - + é–‰ã˜ã‚‹ Installation Path: - + インストール先ã®ãƒ‘ス: ... - + ... @@ -440,298 +443,298 @@ Index - + インデックス Contents - + コンテンツ Bookmarks - + ブックマーク Search - + 検索 Qt Assistant - + Qt Assistant Unfiltered - + フィルタãªã— Page Set&up... - + ページ設定(&U)... Print Preview... - + å°åˆ·ãƒ—レビュー... &Print... - + å°åˆ·(&P)... New &Tab - + æ–°ã—ã„タブ(&T) &Close Tab - + タブを閉ã˜ã‚‹(&C) &Quit - + 終了(&Q) CTRL+Q - + CTRL+Q &Copy selected Text - + é¸æŠžä¸­ã®æ–‡å­—をコピー(&C) &Find in Text... - + 検索(&F)... Find &Next - + 次を検索(&N) Find &Previous - + å‰ã‚’検索(&P) Preferences... - + 設定... Zoom &in - + 拡大(&I) Zoom &out - + 縮å°(&O) Normal &Size - + 普通ã®å¤§ãã•(&S) Ctrl+0 - + Ctrl+0 ALT+C - + ALT+C ALT+I - + ALT+I ALT+S - + ALT+S &Home - + ホーム(&H) Ctrl+Home - + Ctrl+Home &Back - + 戻る(&B) &Forward - + 進む(&F) Sync with Table of Contents - + 内容ã¨ç›®æ¬¡ã‚’åŒæœŸã™ã‚‹ Next Page - + 次ã®ãƒšãƒ¼ã‚¸ Ctrl+Alt+Right - + Ctrl+Alt+Right Previous Page - + å‰ã®ãƒšãƒ¼ã‚¸ Ctrl+Alt+Left - + Ctrl+Alt+Left Add Bookmark... - + ブックマークã®è¿½åŠ ... About... - + Qt Assistant ã«ã¤ã„ã¦... Navigation Toolbar - + ナビゲーション ツールãƒãƒ¼ Toolbars - + ツールãƒãƒ¼ Filter Toolbar - + フィルター ツールãƒãƒ¼ Filtered by: - + フィルタæ¡ä»¶: Address Toolbar - + アドレス ツールãƒãƒ¼ Address: - + アドレス: Could not find the associated content item. - + 関連付ã„ãŸå†…容ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“。 About %1 - + %1 ã«ã¤ã„㦠Updating search index - + 検索インデックスを更新中 Looking for Qt Documentation... - + Qt ドキュメントを探ã—ã¦ã„ã¾ã™... &Window - + ウィンドウ(&W) Minimize - + 最å°åŒ– Ctrl+M - + Ctrl+M Zoom - + ズーム &File - + ファイル(&F) &Edit - + 編集(&E) &View - + 表示(&V) &Go - + ジャンプ(&G) &Bookmarks - + ブックマーク(&B) &Help - + ヘルプ(&H) ALT+O - + ALT+O CTRL+D - + CTRL+D @@ -741,47 +744,47 @@ Add Documentation - + ドキュメントã®è¿½åŠ  Qt Compressed Help Files (*.qch) - + 圧縮済㿠Qt ヘルプファイル (*.qch) The specified file is not a valid Qt Help File! - + 指定ã•ã‚ŒãŸãƒ•ã‚¡ã‚¤ãƒ«ã¯æœ‰åŠ¹ãª Qt ヘルプ ファイルã§ã¯ã‚ã‚Šã¾ã›ã‚“! The namespace %1 is already registered! - + ãƒãƒ¼ãƒ ã‚¹ãƒšãƒ¼ã‚¹ %1 ã¯æ—¢ã«ç™»éŒ²æ¸ˆã¿ã§ã™! Remove Documentation - + ドキュメントã®é™¤åŽ» Some documents currently opened in Assistant reference the documentation you are attempting to remove. Removing the documentation will close those documents. - + 除去ã—よã†ã¨ã—ã¦ã„ã‚‹ã„ãã¤ã‹ã®ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã¯ Assistant 上ã§å‚ç…§ã•ã‚Œã¦ã„ã¾ã™ã€‚除去ã™ã‚‹ã¨ã€ã“れらã®ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã¯é–‰ã˜ã‚‰ã‚Œã¾ã™ã€‚ Cancel - + キャンセル OK - + OK Use custom settings - + 独自設定を使用ã™ã‚‹ @@ -789,92 +792,92 @@ Preferences - + 設定 Fonts - + フォント Font settings: - + フォント設定: Browser - + ブラウザー Application - + アプリケーション Filters - + フィルタ Filter: - + フィルタ: Attributes: - + 属性: 1 - + 1 Add - + 追加 Remove - + 削除 Documentation - + ドキュメント Registered Documentation: - + 登録済ã¿ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆ: Add... - + 追加... Options - + オプション Current Page - + ç¾åœ¨ã®ãƒšãƒ¼ã‚¸ Restore to default - + デフォルト設定ã«æˆ»ã™ Homepage - + ホームページ @@ -882,64 +885,64 @@ The specified collection file does not exist! - + 指定ã•ã‚ŒãŸã‚³ãƒ¬ã‚¯ã‚·ãƒ§ãƒ³ãƒ•ã‚¡ã‚¤ãƒ«ã¯å­˜åœ¨ã—ã¾ã›ã‚“! Missing collection file! - + コレクションファイルãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“! Invalid URL! - + ä¸æ­£ãªURLã§ã™! Missing URL! - + URLãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“! Unknown widget: %1 - + ä¸æ˜Žãªã‚¦ã‚£ã‚¸ã‚§ãƒƒãƒˆ: %1 Missing widget! - + ウィジェットãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“! The specified Qt help file does not exist! - + 指定ã•ã‚ŒãŸ Qt ヘルプ ファイルãŒå­˜åœ¨ã—ã¾ã›ã‚“! Missing help file! - + ヘルプファイルãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“! Missing filter argument! - + フィルタ引数ãŒä¸è¶³ã—ã¦ã„ã¾ã™! Unknown option: %1 - + ä¸æ˜Žãªã‚ªãƒ—ション: %1 Qt Assistant - + Qt Assistant @@ -948,12 +951,16 @@ Reason: %2 - + ドキュメントファイルを登録ã§ãã¾ã›ã‚“ã§ã—ãŸã€‚ +%1 + +原因: +%2 Documentation successfully registered. - + ドキュメントã®ç™»éŒ²ã«æˆåŠŸã—ã¾ã—ãŸã€‚ @@ -962,28 +969,32 @@ Reason: Reason: %2 - + ドキュメントファイルを解除ã§ãã¾ã›ã‚“ã§ã—ãŸã€‚ +%1 + +原因: +%2 Documentation successfully unregistered. - + ドキュメントã®è§£æ”¾ã«æˆåŠŸã—ã¾ã—ãŸã€‚ Cannot load sqlite database driver! - + SQLite データベース ドライãƒãƒ¼ã‚’ロードã§ãã¾ã›ã‚“! The specified collection file could not be read! - + 指定ã•ã‚ŒãŸã‚³ãƒ¬ã‚¯ã‚·ãƒ§ãƒ³ãƒ•ã‚¡ã‚¤ãƒ«ã¯èª­ã¿è¾¼ã‚ã¾ã›ã‚“! Bookmark - + ブックマーク @@ -991,12 +1002,12 @@ Reason: Debugging Remote Control - + リモート コントロールをデãƒãƒƒã‚°ä¸­ Received Command: %1 %2 - + å—ä¿¡ã—ãŸã‚³ãƒžãƒ³ãƒ‰: %1 %2 @@ -1004,28 +1015,28 @@ Reason: &Copy - + コピー(&C) Copy &Link Location - + リンクã®URLをコピー(&L) Open Link in New Tab - + リンクを新ã—ã„タブã§é–‹ã Select All - + ã™ã¹ã¦ã‚’é¸æŠž Open Link - + リンクを開ã @@ -1033,27 +1044,27 @@ Reason: Choose a topic for <b>%1</b>: - + <b>%1</b> ã®æ¤œç´¢å…ˆãƒˆãƒ”ックをé¸æŠžã—ã¦ãã ã•ã„: Choose Topic - + トピックをé¸æŠž &Topics - + トピック(&T) &Display - + 表示(&D) &Close - + é–‰ã˜ã‚‹(&C) -- cgit v0.12 From 34c81262dc0b79220e6b99051ce09065bf6d83d6 Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Mon, 25 May 2009 10:51:48 +0200 Subject: Factor Symbian specific code into its own file, qlocale_symbian.cpp. Reviewed-by: Miikka Heikkinen --- src/corelib/tools/qlocale.cpp | 797 +------------------------------- src/corelib/tools/qlocale_symbian.cpp | 840 ++++++++++++++++++++++++++++++++++ src/corelib/tools/tools.pri | 1 + 3 files changed, 844 insertions(+), 794 deletions(-) create mode 100644 src/corelib/tools/qlocale_symbian.cpp diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index ee3e530..4d042ae 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -78,11 +78,6 @@ QT_END_NAMESPACE #include #include -#if defined(Q_OS_SYMBIAN) -#include -#include "private/qcore_symbian_p.h" -#endif - #if defined(Q_OS_LINUX) && !defined(__UCLIBC__) # include #endif @@ -303,7 +298,7 @@ static bool splitLocaleName(const QString &name, QChar *lang_begin, QChar *cntry return lang_len == 2 || lang_len == 3; } -static void getLangAndCountry(const QString &name, QLocale::Language &lang, QLocale::Country &cntry) +void getLangAndCountry(const QString &name, QLocale::Language &lang, QLocale::Country &cntry) { lang = QLocale::C; cntry = QLocale::AnyCountry; @@ -1282,794 +1277,8 @@ QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const } return QVariant(); } -#elif defined(Q_OS_SYMBIAN) - -static TExtendedLocale _s60Locale; - -// Type definitions for runtime resolved function pointers -typedef void (*FormatFunc)(TTime&, TDes&, const TDesC&, const TLocale&); -typedef TPtrC (*FormatSpecFunc)(TExtendedLocale&); - -// Runtime resolved functions -static FormatFunc ptrTimeFormatL = NULL; -static FormatSpecFunc ptrGetTimeFormatSpec = NULL; -static FormatSpecFunc ptrGetLongDateFormatSpec = NULL; -static FormatSpecFunc ptrGetShortDateFormatSpec = NULL; - -// Default functions if functions cannot be resolved -static void defaultTimeFormatL(TTime&, TDes& des, const TDesC&, const TLocale&) -{ - des.Zero(); -} - -static TPtrC defaultFormatSpec(TExtendedLocale&) -{ - return TPtrC(KNullDesC); -} - -/*! - Definition of struct for mapping Symbian to ISO locale -*/ -struct symbianToISO { - int symbian_language; - char iso_name[8]; -}; - -/*! - Mapping from Symbian to ISO locale -*/ -static const symbianToISO symbian_to_iso_list[] = { - { ELangEnglish, "en_GB" }, - { ELangFrench, "fr_FR" }, - { ELangGerman, "de_DE" }, - { ELangSpanish, "es_ES" }, - { ELangItalian, "it_IT" }, - { ELangSwedish, "sv_SE" }, - { ELangDanish, "da_DK" }, - { ELangNorwegian, "no_NO" }, - { ELangFinnish, "fi_FI" }, - { ELangAmerican, "en_US" }, - { ELangPortuguese, "pt_PT" }, - { ELangTurkish, "tr_TR" }, - { ELangIcelandic, "is_IS" }, - { ELangRussian, "ru_RU" }, - { ELangHungarian, "hu_HU" }, - { ELangDutch, "nl_NL" }, - { ELangBelgianFlemish, "nl_BE" }, - { ELangCzech, "cs_CZ" }, - { ELangSlovak, "sk_SK" }, - { ELangPolish, "pl_PL" }, - { ELangSlovenian, "sl_SI" }, - { ELangTaiwanChinese, "zh_TW" }, - { ELangHongKongChinese, "zh_HK" }, - { ELangPrcChinese, "zh_CN" }, - { ELangJapanese, "ja_JP" }, - { ELangThai, "th_TH" }, - { ELangArabic, "ar_AE" }, - { ELangTagalog, "tl_PH" }, - { ELangBulgarian, "bg_BG" }, - { ELangCatalan, "ca_ES" }, - { ELangCroatian, "hr_HR" }, - { ELangEstonian, "et_EE" }, - { ELangFarsi, "fa_IR" }, - { ELangCanadianFrench, "fr_CA" }, - { ELangGreek, "el_GR" }, - { ELangHebrew, "he_IL" }, - { ELangHindi, "hi_IN" }, - { ELangIndonesian, "id_ID" }, - { ELangLatvian, "lv_LV" }, - { ELangLithuanian, "lt_LT" }, - { ELangMalay, "ms_MY" }, - { ELangBrazilianPortuguese, "pt_BR" }, - { ELangRomanian, "ro_RO" }, - { ELangSerbian, "sr_YU" }, - { ELangLatinAmericanSpanish, "es" }, - { ELangUkrainian, "uk_UA" }, - { ELangUrdu, "ur_PK" }, // India/Pakistan - { ELangVietnamese, "vi_VN" }, -#ifdef __E32LANG_H__ -// 5.0 - { ELangBasque, "eu_ES" }, - { ELangGalician, "gl_ES" }, -#endif -#if !defined(__SERIES60_31__) - { ELangEnglish_Apac, "en" }, - { ELangEnglish_Taiwan, "en_TW" }, - { ELangEnglish_HongKong, "en_HK" }, - { ELangEnglish_Prc, "en_CN" }, - { ELangEnglish_Japan, "en_JP"}, - { ELangEnglish_Thailand, "en_TH" }, - { ELangMalay_Apac, "ms" } -#endif -}; - -/*! - Returns ISO name corresponding to the Symbian locale code \a sys_fmt. -*/ -static QByteArray symbianLocaleName(int code) -{ - //Number of Symbian to ISO locale mappings - static const int symbian_to_iso_count - = sizeof(symbian_to_iso_list)/sizeof(symbianToISO); - - int cmp = code - symbian_to_iso_list[0].symbian_language; - if (cmp < 0) - return 0; - - if (cmp == 0) - return symbian_to_iso_list[0].iso_name; - - int begin = 0; - int end = symbian_to_iso_count; - - while (end - begin > 1) { - uint mid = (begin + end)/2; - - const symbianToISO *elt = symbian_to_iso_list + mid; - int cmp = code - elt->symbian_language; - if (cmp < 0) - end = mid; - else if (cmp > 0) - begin = mid; - else - return elt->iso_name; - } - - return 0; -} - - -// order is: normal, abbr, nmode, nmode+abbr -static const char *us_locale_dep[] = { - "MM", "dd", "yyyy", "MM", "dd", - "M", "d", "yy", "M", "d", - "MMMM", "dd", "yyyy", "MMMM", "dd", - "MMM", "d", "yy", "MMM", "d" }; - -static const char *eu_locale_dep[] = { - "dd", "MM", "yyyy", "dd", "MM", - "d", "M", "yy", "d", "M", - "dd", "MMMM", "yyyy", "dd", "MMMM", - "d", "MMM", "yy", "d", "MMM" }; - -static const char *jp_locale_dep[] = { - "yyyy", "MM", "dd", "MM", "dd", - "yy", "M", "d", "M", "d", - "yyyy", "MMMM", "dd", "MMMM", "dd", - "yy", "MMM", "d", "MMM", "d" }; - -/*! - Returns a Qt version of the given \a sys_fmt Symbian locale format string. -*/ -static QString s60ToQtFormat(const QString &sys_fmt) -{ - TLocale *locale = _s60Locale.GetLocale(); - - QString result; - QString other; - QString qtformatchars = QString::fromLatin1("adhmsyzAHM"); - - QChar c; - int i = 0; - bool open_escape = false; - bool abbrev_next = false; - bool locale_indep_ordering = false; - bool minus_mode = false; - bool plus_mode = false; - bool n_mode = false; - TTimeFormat tf = locale->TimeFormat(); - - while (i < sys_fmt.size()) { - - c = sys_fmt.at(i); - - // let formatting thru - if (c.unicode() == '%') { - // if we have gathered string, concat it - if (!other.isEmpty()) { - result += other; - other.clear(); - } - // if we have open escape, end it - if (open_escape) { - result += QLatin1Char('\''); - open_escape = false; - } - - ++i; - if (i >= sys_fmt.size()) - break; - - c = sys_fmt.at(i); - - // process specials - abbrev_next = c.unicode() == '*'; - plus_mode = c.unicode() == '+'; - minus_mode = c.unicode() == '-'; - - if (abbrev_next || plus_mode || minus_mode) { - ++i; - if (i >= sys_fmt.size()) - break; - - c = sys_fmt.at(i); - - if (plus_mode || minus_mode) { - // break on undefined plus/minus mode - if (c.unicode() != 'A' && c.unicode() != 'B') - break; - } - } - - switch (c.unicode()) { - case 'F': - // locale indep mode on - locale_indep_ordering = true; - break; - - case '/': - // date sep 0-3 - ++i; - if (i >= sys_fmt.size()) - break; - - c = sys_fmt.at(i); - if (c.isDigit() && c.digitValue() <= 3) { - TChar s = locale->DateSeparator(c.digitValue()); - TUint val = s; - // some indexes return zero for empty - if (val > 0) - result += QChar(val); - } - break; - - case 'D': - if (!locale_indep_ordering) - break; - - if (!abbrev_next) - result += QLatin1String("dd"); - else - result += QLatin1Char('d'); - - break; - - case 'M': - if (!locale_indep_ordering) - break; - - if (!n_mode) { - if (!abbrev_next) - result += QLatin1String("MM"); - else - result += QLatin1String("M"); - } else { - if (!abbrev_next) - result += QLatin1String("MMMM"); - else - result += QLatin1String("MMM"); - } - - break; - - case 'N': - n_mode = true; - - if (!locale_indep_ordering) - break; - - if (!abbrev_next) - result += QLatin1String("MMMM"); - else - result += QLatin1String("MMM"); - - break; - - case 'Y': - if (!locale_indep_ordering) - break; - - if (!abbrev_next) - result += QLatin1String("yyyy"); - else - result += QLatin1String("yy"); - - break; - - case 'E': - if (!abbrev_next) - result += QLatin1String("dddd"); - else - result += QLatin1String("ddd"); - - break; - - case ':': - // timesep 0-3 - ++i; - if (i >= sys_fmt.size()) - break; - - c = sys_fmt.at(i); - if (c.isDigit() && c.digitValue() <= 3) { - TChar s = locale->TimeSeparator(c.digitValue()); - TUint val = s; - // some indexes return zero for empty - if (val > 0) - result += QChar(val); - } - - break; - - case 'J': - if (tf == ETime24 && !abbrev_next) - result += QLatin1String("hh"); - else - result += QLatin1Char('h'); - - break; - - case 'H': - if (!abbrev_next) - result += QLatin1String("hh"); - else - result += QLatin1Char('h'); - - break; - - case 'I': - result += QLatin1Char('h'); - break; - - case 'T': - if (!abbrev_next) - result += QLatin1String("mm"); - else - result += QLatin1Char('m'); - - break; - - case 'S': - if (!abbrev_next) - result += QLatin1String("ss"); - else - result += QLatin1Char('s'); - - break; - - case 'B': - // only done for 12h clock - if (tf == ETime24) - break; - - // fallthru to A - case 'A': { - // quickie to get capitalization, can't use s60 string as is because Qt 'hh' format's am/pm logic - TAmPmName ampm = TAmPmName(); - TChar first(ampm[0]); - QString qtampm = QString::fromLatin1(first.IsUpper() ? "AP" : "ap"); - - int pos = locale->AmPmSymbolPosition(); - - if ((minus_mode && pos != ELocaleBefore) || - (plus_mode && pos != ELocaleAfter)) - break; - - if (!abbrev_next && locale->AmPmSpaceBetween()) { - if (pos == ELocaleBefore) - qtampm.append(QLatin1Char(' ')); - else - qtampm.prepend(QLatin1Char(' ')); - } - - result += qtampm; - } - break; - - case '.': { - // decimal sep - TChar s = locale->DecimalSeparator(); - TUint val = s; - if (val > 0) - result += QChar(val); - } - break; - - case 'C': - // six digits in s60, three digits in qt - if (!abbrev_next) { - result += QLatin1String("zzz"); - } else { - // next char is number from 0-6, how many digits to display - ++i; - if (i >= sys_fmt.size()) - break; - - c = sys_fmt.at(i); - - if (c.isDigit()) { - // try to match wanted digits - QChar val(c.digitValue()); - - if (val >= 3) { - result += QLatin1String("zzz"); - } else if (val > 0) { - result += QLatin1Char('z'); - } - } - } - break; - - // these cases fallthru - case '1': - case '2': - case '3': - case '4': - case '5': - - // shouldn't parse these with %F - if (locale_indep_ordering) - break; - - TDateFormat df = locale->DateFormat(); - - const char **locale_dep; - switch (df) { - default: // fallthru to american - case EDateAmerican: - locale_dep = us_locale_dep; - break; - case EDateEuropean: - locale_dep = eu_locale_dep; - break; - case EDateJapanese: - locale_dep = jp_locale_dep; - break; - } - int offset = 0; - if (abbrev_next) - offset += 5; - if (n_mode) - offset += 10; - - result += QLatin1String(locale_dep[offset + (c.digitValue()-1)]); - break; - - case '%': // fallthru percent - // any junk gets copied as is - default: - result += c; - break; - - case 'Z': // Qt doesn't support these :( - case 'X': - case 'W': - break; - } - } else { - // double any single quotes, don't begin escape - if (c.unicode() == '\'') { - // end open escape - if (open_escape) { - result += other; - other.clear(); - result += QLatin1Char('\''); - open_escape = false; - } - - other += c; - } - - // gather chars and escape them in one go if any format chars are found - if (!open_escape && qtformatchars.indexOf(c) != -1) { - result += QLatin1Char('\''); - open_escape = true; - } - other += c; - } - - ++i; - } - - if (!other.isEmpty()) - result += other; - if (open_escape) - result += QLatin1Char('\''); - - return result; -} - -/*! - Retrieves Symbian locale decimal separator. -*/ -static QString symbianDecimalPoint() -{ - TLocale *locale = _s60Locale.GetLocale(); - - TChar decPoint = locale->DecimalSeparator(); - int val = decPoint; - return QChar(val); -} - -/*! - Retrieves Symbian locale group separator. -*/ -static QString symbianGroupSeparator() -{ - TLocale *locale = _s60Locale.GetLocale(); - - TChar grpSep = locale->ThousandsSeparator(); - int val = grpSep; - return QChar(val); -} - -/*! - Retrieves Symbian locale zero digit. -*/ -static QString symbianZeroDigit() -{ - TLocale *locale = _s60Locale.GetLocale(); - - // TDigitType enumeration value returned by TLocale - // will always correspond to zero digit unicode value. - TDigitType digit = locale->DigitType(); - return QChar(digit); -} - -/*! - Retrieves a day name from Symbian locale. The \a day is an integer - from 1 to 7. When \a short_format is true the method returns - the day in short format. Otherwise it returns the day in a long format. -*/ -static QString symbianDayName(int day, bool short_format) -{ - day -= 1; - - if (day < 0 || day > 6) - return QString(); - - if (short_format) { - return qt_TDes2QStringL(TDayNameAbb(TDay(day))); - } else { - return qt_TDes2QStringL(TDayName(TDay(day))); - } -} - -/*! - Retrieves a month name from Symbian locale. The \a month is an integer - from 1 to 12. When \a short_format is true the method returns - the month in short format. Otherwise it returns the month in a long format. -*/ -static QString symbianMonthName(int month, bool short_format) -{ - month -= 1; - if (month < 0 || month > 11) - return QString(); - - if (short_format) { - return qt_TDes2QStringL(TMonthNameAbb(TMonth(month))); - } else { - return qt_TDes2QStringL(TMonthName(TMonth(month))); - } -} - -/*! - Retrieves date format from Symbian locale and - transforms it to Qt format. - - When \a short_format is true the method returns - short date format. Otherwise it returns the long format. -*/ -static QString symbianDateFormat(bool short_format) -{ - TPtrC dateFormat; - - if (short_format) { - dateFormat.Set(ptrGetShortDateFormatSpec(_s60Locale)); - } else { - dateFormat.Set(ptrGetLongDateFormatSpec(_s60Locale)); - } - - return s60ToQtFormat(qt_TDesC2QStringL(dateFormat)); -} - -/*! - Retrieves time format from Symbian locale and - transforms it to Qt format. -*/ -static QString symbianTimeFormat() -{ - return s60ToQtFormat(qt_TDesC2QStringL(ptrGetTimeFormatSpec(_s60Locale))); -} - -/*! - Returns localized string representation of given \a date - formatted with Symbian locale date format. - - If \a short_format is true the format will be a short version. - Otherwise it uses a longer version. -*/ -static QString symbianDateToString(const QDate &date, bool short_format) -{ - int month = date.month() - 1; - int day = date.day() - 1; - int year = date.year(); - - TDateTime dateTime; - dateTime.Set(year, TMonth(month), day, 0, 0, 0, 0); - - TTime timeStr(dateTime); - TBuf buffer; - - TPtrC dateFormat; - if (short_format) { - dateFormat.Set(ptrGetShortDateFormatSpec(_s60Locale)); - } else { - dateFormat.Set(ptrGetLongDateFormatSpec(_s60Locale)); - } - - TRAPD(err, ptrTimeFormatL(timeStr, buffer, dateFormat, *_s60Locale.GetLocale());) - - if (err == KErrNone) - return qt_TDes2QStringL(buffer); - else - return QString(); -} - -/*! - Returns localized string representation of given \a time - formatted with Symbian locale time format. -*/ -static QString symbianTimeToString(const QTime &time) -{ - int hour = time.hour(); - int minute = time.minute(); - int second = time.second(); - int milliseconds = 0; - - TDateTime dateTime; - dateTime.Set(0, TMonth(0), 0, hour, minute, second, milliseconds); - - TTime timeStr(dateTime); - TBuf buffer; - - TRAPD(err, ptrTimeFormatL( - timeStr, - buffer, - ptrGetTimeFormatSpec(_s60Locale), - *_s60Locale.GetLocale()); - ) - - if (err == KErrNone) - return qt_TDes2QStringL(buffer); - else - return QString(); -} - -/*! - Returns the measurement system stored in Symbian locale - - \sa QLocale::MeasurementSystem -*/ -static QLocale::MeasurementSystem symbianMeasurementSystem() -{ - TLocale *locale = _s60Locale.GetLocale(); - - TUnitsFormat unitFormat = locale->UnitsGeneral(); - if (unitFormat == EUnitsImperial) - return QLocale::ImperialSystem; - else - return QLocale::MetricSystem; -} - -QLocale QSystemLocale::fallbackLocale() const -{ - // load system data before query calls - static bool initDone = false; - if (!initDone) { - _s60Locale.LoadSystemSettings(); - - // Initialize platform version dependent function pointers - ptrTimeFormatL = reinterpret_cast - (qt_resolveS60PluginFunc(S60Plugin_TimeFormatL)); - ptrGetTimeFormatSpec = reinterpret_cast - (qt_resolveS60PluginFunc(S60Plugin_GetTimeFormatSpec)); - ptrGetLongDateFormatSpec = reinterpret_cast - (qt_resolveS60PluginFunc(S60Plugin_GetLongDateFormatSpec)); - ptrGetShortDateFormatSpec = reinterpret_cast - (qt_resolveS60PluginFunc(S60Plugin_GetShortDateFormatSpec)); - if (!ptrTimeFormatL) - ptrTimeFormatL = &defaultTimeFormatL; - if (!ptrGetTimeFormatSpec) - ptrGetTimeFormatSpec = &defaultFormatSpec; - if (!ptrGetLongDateFormatSpec) - ptrGetLongDateFormatSpec = &defaultFormatSpec; - if (!ptrGetShortDateFormatSpec) - ptrGetShortDateFormatSpec = &defaultFormatSpec; - } - - TLanguage lang = User::Language(); - QString locale = symbianLocaleName(lang); - return QLocale(locale); -} - -/*! - Generic query method for locale data. Provides indirection. - Denotes the \a type of the query - with \a in as input data depending on the query. - - \sa QSystemLocale::QueryType -*/ -QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const -{ - switch(type) { - case DecimalPoint: - return symbianDecimalPoint(); - case GroupSeparator: - return symbianGroupSeparator(); - - case ZeroDigit: - return symbianZeroDigit(); - - case DayNameLong: - case DayNameShort: - return symbianDayName(in.toInt(), (type == DayNameShort) ); - - case MonthNameLong: - case MonthNameShort: - return symbianMonthName(in.toInt(), (type == MonthNameShort) ); - - case DateFormatLong: - case DateFormatShort: - return symbianDateFormat( (type == DateFormatShort) ); - case TimeFormatLong: - case TimeFormatShort: - return symbianTimeFormat(); - case DateTimeFormatLong: - case DateTimeFormatShort: - return symbianDateFormat( (type == DateTimeFormatShort) ) + QLatin1Char(' ') + symbianTimeFormat(); - case DateToStringShort: - case DateToStringLong: - return symbianDateToString(in.toDate(), (type == DateToStringShort) ); - case TimeToStringShort: - case TimeToStringLong: - return symbianTimeToString(in.toTime()); - case DateTimeToStringShort: - case DateTimeToStringLong: { - const QDateTime dt = in.toDateTime(); - return symbianDateToString(dt.date(), (type == DateTimeToStringShort) ) - + QLatin1Char(' ') + symbianTimeToString(dt.time()); - } - case MeasurementSystem: - return static_cast(symbianMeasurementSystem()); - case LanguageId: - case CountryId: { - TLanguage language = User::Language(); - QString locale = symbianLocaleName(language); - QLocale::Language lang; - QLocale::Country cntry; - getLangAndCountry(locale, lang, cntry); - if (type == LanguageId) - return lang; - // few iso codes have no country and will use this - if (cntry == QLocale::AnyCountry) - return fallbackLocale().country(); - - return cntry; - } - case NegativeSign: - case PositiveSign: - case AMText: - case PMText: - break; - default: - break; - } - return QVariant(); -} - -#elif defined(Q_OS_UNIX) +#elif defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) static uint unixGetSystemMeasurementSystem() { @@ -2113,7 +1322,7 @@ QVariant QSystemLocale::query(QueryType type, QVariant /* in */) const } } -#else +#elif !defined(Q_OS_SYMBIAN) /*! Returns a fallback locale, that will get used for everything that diff --git a/src/corelib/tools/qlocale_symbian.cpp b/src/corelib/tools/qlocale_symbian.cpp new file mode 100644 index 0000000..b58a5d5 --- /dev/null +++ b/src/corelib/tools/qlocale_symbian.cpp @@ -0,0 +1,840 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include + +#include +#include "private/qcore_symbian_p.h" + +// Located in qlocale.cpp +extern void getLangAndCountry(const QString &name, QLocale::Language &lang, QLocale::Country &cntry); + +QT_BEGIN_NAMESPACE + +static TExtendedLocale _s60Locale; + +// Type definitions for runtime resolved function pointers +typedef void (*FormatFunc)(TTime&, TDes&, const TDesC&, const TLocale&); +typedef TPtrC (*FormatSpecFunc)(TExtendedLocale&); + +// Runtime resolved functions +static FormatFunc ptrTimeFormatL = NULL; +static FormatSpecFunc ptrGetTimeFormatSpec = NULL; +static FormatSpecFunc ptrGetLongDateFormatSpec = NULL; +static FormatSpecFunc ptrGetShortDateFormatSpec = NULL; + +// Default functions if functions cannot be resolved +static void defaultTimeFormatL(TTime&, TDes& des, const TDesC&, const TLocale&) +{ + des.Zero(); +} + +static TPtrC defaultFormatSpec(TExtendedLocale&) +{ + return TPtrC(KNullDesC); +} + +/*! + Definition of struct for mapping Symbian to ISO locale +*/ +struct symbianToISO { + int symbian_language; + char iso_name[8]; +}; + + +/*! + Mapping from Symbian to ISO locale +*/ +static const symbianToISO symbian_to_iso_list[] = { + { ELangEnglish, "en_GB" }, + { ELangFrench, "fr_FR" }, + { ELangGerman, "de_DE" }, + { ELangSpanish, "es_ES" }, + { ELangItalian, "it_IT" }, + { ELangSwedish, "sv_SE" }, + { ELangDanish, "da_DK" }, + { ELangNorwegian, "no_NO" }, + { ELangFinnish, "fi_FI" }, + { ELangAmerican, "en_US" }, + { ELangPortuguese, "pt_PT" }, + { ELangTurkish, "tr_TR" }, + { ELangIcelandic, "is_IS" }, + { ELangRussian, "ru_RU" }, + { ELangHungarian, "hu_HU" }, + { ELangDutch, "nl_NL" }, + { ELangBelgianFlemish, "nl_BE" }, + { ELangCzech, "cs_CZ" }, + { ELangSlovak, "sk_SK" }, + { ELangPolish, "pl_PL" }, + { ELangSlovenian, "sl_SI" }, + { ELangTaiwanChinese, "zh_TW" }, + { ELangHongKongChinese, "zh_HK" }, + { ELangPrcChinese, "zh_CN" }, + { ELangJapanese, "ja_JP" }, + { ELangThai, "th_TH" }, + { ELangArabic, "ar_AE" }, + { ELangTagalog, "tl_PH" }, + { ELangBulgarian, "bg_BG" }, + { ELangCatalan, "ca_ES" }, + { ELangCroatian, "hr_HR" }, + { ELangEstonian, "et_EE" }, + { ELangFarsi, "fa_IR" }, + { ELangCanadianFrench, "fr_CA" }, + { ELangGreek, "el_GR" }, + { ELangHebrew, "he_IL" }, + { ELangHindi, "hi_IN" }, + { ELangIndonesian, "id_ID" }, + { ELangLatvian, "lv_LV" }, + { ELangLithuanian, "lt_LT" }, + { ELangMalay, "ms_MY" }, + { ELangBrazilianPortuguese, "pt_BR" }, + { ELangRomanian, "ro_RO" }, + { ELangSerbian, "sr_YU" }, + { ELangLatinAmericanSpanish, "es" }, + { ELangUkrainian, "uk_UA" }, + { ELangUrdu, "ur_PK" }, // India/Pakistan + { ELangVietnamese, "vi_VN" }, +#ifdef __E32LANG_H__ +// 5.0 + { ELangBasque, "eu_ES" }, + { ELangGalician, "gl_ES" }, +#endif +#if !defined(__SERIES60_31__) + { ELangEnglish_Apac, "en" }, + { ELangEnglish_Taiwan, "en_TW" }, + { ELangEnglish_HongKong, "en_HK" }, + { ELangEnglish_Prc, "en_CN" }, + { ELangEnglish_Japan, "en_JP"}, + { ELangEnglish_Thailand, "en_TH" }, + { ELangMalay_Apac, "ms" } +#endif +}; + +/*! + Returns ISO name corresponding to the Symbian locale code \a sys_fmt. +*/ +static QByteArray symbianLocaleName(int code) +{ + //Number of Symbian to ISO locale mappings + static const int symbian_to_iso_count + = sizeof(symbian_to_iso_list)/sizeof(symbianToISO); + + int cmp = code - symbian_to_iso_list[0].symbian_language; + if (cmp < 0) + return 0; + + if (cmp == 0) + return symbian_to_iso_list[0].iso_name; + + int begin = 0; + int end = symbian_to_iso_count; + + while (end - begin > 1) { + uint mid = (begin + end)/2; + + const symbianToISO *elt = symbian_to_iso_list + mid; + int cmp = code - elt->symbian_language; + if (cmp < 0) + end = mid; + else if (cmp > 0) + begin = mid; + else + return elt->iso_name; + } + + return 0; +} + + +// order is: normal, abbr, nmode, nmode+abbr +static const char *us_locale_dep[] = { + "MM", "dd", "yyyy", "MM", "dd", + "M", "d", "yy", "M", "d", + "MMMM", "dd", "yyyy", "MMMM", "dd", + "MMM", "d", "yy", "MMM", "d" }; + +static const char *eu_locale_dep[] = { + "dd", "MM", "yyyy", "dd", "MM", + "d", "M", "yy", "d", "M", + "dd", "MMMM", "yyyy", "dd", "MMMM", + "d", "MMM", "yy", "d", "MMM" }; + +static const char *jp_locale_dep[] = { + "yyyy", "MM", "dd", "MM", "dd", + "yy", "M", "d", "M", "d", + "yyyy", "MMMM", "dd", "MMMM", "dd", + "yy", "MMM", "d", "MMM", "d" }; + +/*! + Returns a Qt version of the given \a sys_fmt Symbian locale format string. +*/ +static QString s60ToQtFormat(const QString &sys_fmt) +{ + TLocale *locale = _s60Locale.GetLocale(); + + QString result; + QString other; + QString qtformatchars = QString::fromLatin1("adhmsyzAHM"); + + QChar c; + int i = 0; + bool open_escape = false; + bool abbrev_next = false; + bool locale_indep_ordering = false; + bool minus_mode = false; + bool plus_mode = false; + bool n_mode = false; + TTimeFormat tf = locale->TimeFormat(); + + while (i < sys_fmt.size()) { + + c = sys_fmt.at(i); + + // let formatting thru + if (c.unicode() == '%') { + // if we have gathered string, concat it + if (!other.isEmpty()) { + result += other; + other.clear(); + } + // if we have open escape, end it + if (open_escape) { + result += QLatin1Char('\''); + open_escape = false; + } + + ++i; + if (i >= sys_fmt.size()) + break; + + c = sys_fmt.at(i); + + // process specials + abbrev_next = c.unicode() == '*'; + plus_mode = c.unicode() == '+'; + minus_mode = c.unicode() == '-'; + + if (abbrev_next || plus_mode || minus_mode) { + ++i; + if (i >= sys_fmt.size()) + break; + + c = sys_fmt.at(i); + + if (plus_mode || minus_mode) { + // break on undefined plus/minus mode + if (c.unicode() != 'A' && c.unicode() != 'B') + break; + } + } + + switch (c.unicode()) { + case 'F': + // locale indep mode on + locale_indep_ordering = true; + break; + + case '/': + // date sep 0-3 + ++i; + if (i >= sys_fmt.size()) + break; + + c = sys_fmt.at(i); + if (c.isDigit() && c.digitValue() <= 3) { + TChar s = locale->DateSeparator(c.digitValue()); + TUint val = s; + // some indexes return zero for empty + if (val > 0) + result += QChar(val); + } + break; + + case 'D': + if (!locale_indep_ordering) + break; + + if (!abbrev_next) + result += QLatin1String("dd"); + else + result += QLatin1Char('d'); + + break; + + case 'M': + if (!locale_indep_ordering) + break; + + if (!n_mode) { + if (!abbrev_next) + result += QLatin1String("MM"); + else + result += QLatin1String("M"); + } else { + if (!abbrev_next) + result += QLatin1String("MMMM"); + else + result += QLatin1String("MMM"); + } + + break; + + case 'N': + n_mode = true; + + if (!locale_indep_ordering) + break; + + if (!abbrev_next) + result += QLatin1String("MMMM"); + else + result += QLatin1String("MMM"); + + break; + + case 'Y': + if (!locale_indep_ordering) + break; + + if (!abbrev_next) + result += QLatin1String("yyyy"); + else + result += QLatin1String("yy"); + + break; + + case 'E': + if (!abbrev_next) + result += QLatin1String("dddd"); + else + result += QLatin1String("ddd"); + + break; + + case ':': + // timesep 0-3 + ++i; + if (i >= sys_fmt.size()) + break; + + c = sys_fmt.at(i); + if (c.isDigit() && c.digitValue() <= 3) { + TChar s = locale->TimeSeparator(c.digitValue()); + TUint val = s; + // some indexes return zero for empty + if (val > 0) + result += QChar(val); + } + + break; + + case 'J': + if (tf == ETime24 && !abbrev_next) + result += QLatin1String("hh"); + else + result += QLatin1Char('h'); + + break; + + case 'H': + if (!abbrev_next) + result += QLatin1String("hh"); + else + result += QLatin1Char('h'); + + break; + + case 'I': + result += QLatin1Char('h'); + break; + + case 'T': + if (!abbrev_next) + result += QLatin1String("mm"); + else + result += QLatin1Char('m'); + + break; + + case 'S': + if (!abbrev_next) + result += QLatin1String("ss"); + else + result += QLatin1Char('s'); + + break; + + case 'B': + // only done for 12h clock + if (tf == ETime24) + break; + + // fallthru to A + case 'A': { + // quickie to get capitalization, can't use s60 string as is because Qt 'hh' format's am/pm logic + TAmPmName ampm = TAmPmName(); + TChar first(ampm[0]); + QString qtampm = QString::fromLatin1(first.IsUpper() ? "AP" : "ap"); + + int pos = locale->AmPmSymbolPosition(); + + if ((minus_mode && pos != ELocaleBefore) || + (plus_mode && pos != ELocaleAfter)) + break; + + if (!abbrev_next && locale->AmPmSpaceBetween()) { + if (pos == ELocaleBefore) + qtampm.append(QLatin1Char(' ')); + else + qtampm.prepend(QLatin1Char(' ')); + } + + result += qtampm; + } + break; + + case '.': { + // decimal sep + TChar s = locale->DecimalSeparator(); + TUint val = s; + if (val > 0) + result += QChar(val); + } + break; + + case 'C': + // six digits in s60, three digits in qt + if (!abbrev_next) { + result += QLatin1String("zzz"); + } else { + // next char is number from 0-6, how many digits to display + ++i; + if (i >= sys_fmt.size()) + break; + + c = sys_fmt.at(i); + + if (c.isDigit()) { + // try to match wanted digits + QChar val(c.digitValue()); + + if (val >= 3) { + result += QLatin1String("zzz"); + } else if (val > 0) { + result += QLatin1Char('z'); + } + } + } + break; + + // these cases fallthru + case '1': + case '2': + case '3': + case '4': + case '5': + + // shouldn't parse these with %F + if (locale_indep_ordering) + break; + + TDateFormat df = locale->DateFormat(); + + const char **locale_dep; + switch (df) { + default: // fallthru to american + case EDateAmerican: + locale_dep = us_locale_dep; + break; + case EDateEuropean: + locale_dep = eu_locale_dep; + break; + case EDateJapanese: + locale_dep = jp_locale_dep; + break; + } + int offset = 0; + if (abbrev_next) + offset += 5; + if (n_mode) + offset += 10; + + result += QLatin1String(locale_dep[offset + (c.digitValue()-1)]); + break; + + case '%': // fallthru percent + // any junk gets copied as is + default: + result += c; + break; + + case 'Z': // Qt doesn't support these :( + case 'X': + case 'W': + break; + } + } else { + // double any single quotes, don't begin escape + if (c.unicode() == '\'') { + // end open escape + if (open_escape) { + result += other; + other.clear(); + result += QLatin1Char('\''); + open_escape = false; + } + + other += c; + } + + // gather chars and escape them in one go if any format chars are found + if (!open_escape && qtformatchars.indexOf(c) != -1) { + result += QLatin1Char('\''); + open_escape = true; + } + other += c; + } + + ++i; + } + + if (!other.isEmpty()) + result += other; + if (open_escape) + result += QLatin1Char('\''); + + return result; +} + +/*! + Retrieves Symbian locale decimal separator. +*/ +static QString symbianDecimalPoint() +{ + TLocale *locale = _s60Locale.GetLocale(); + + TChar decPoint = locale->DecimalSeparator(); + int val = decPoint; + return QChar(val); +} + +/*! + Retrieves Symbian locale group separator. +*/ +static QString symbianGroupSeparator() +{ + TLocale *locale = _s60Locale.GetLocale(); + + TChar grpSep = locale->ThousandsSeparator(); + int val = grpSep; + return QChar(val); +} + +/*! + Retrieves Symbian locale zero digit. +*/ +static QString symbianZeroDigit() +{ + TLocale *locale = _s60Locale.GetLocale(); + + // TDigitType enumeration value returned by TLocale + // will always correspond to zero digit unicode value. + TDigitType digit = locale->DigitType(); + return QChar(digit); +} + +/*! + Retrieves a day name from Symbian locale. The \a day is an integer + from 1 to 7. When \a short_format is true the method returns + the day in short format. Otherwise it returns the day in a long format. +*/ +static QString symbianDayName(int day, bool short_format) +{ + day -= 1; + + if (day < 0 || day > 6) + return QString(); + + if (short_format) { + return qt_TDes2QStringL(TDayNameAbb(TDay(day))); + } else { + return qt_TDes2QStringL(TDayName(TDay(day))); + } +} + +/*! + Retrieves a month name from Symbian locale. The \a month is an integer + from 1 to 12. When \a short_format is true the method returns + the month in short format. Otherwise it returns the month in a long format. +*/ +static QString symbianMonthName(int month, bool short_format) +{ + month -= 1; + if (month < 0 || month > 11) + return QString(); + + if (short_format) { + return qt_TDes2QStringL(TMonthNameAbb(TMonth(month))); + } else { + return qt_TDes2QStringL(TMonthName(TMonth(month))); + } +} + +/*! + Retrieves date format from Symbian locale and + transforms it to Qt format. + + When \a short_format is true the method returns + short date format. Otherwise it returns the long format. +*/ +static QString symbianDateFormat(bool short_format) +{ + TPtrC dateFormat; + + if (short_format) { + dateFormat.Set(ptrGetShortDateFormatSpec(_s60Locale)); + } else { + dateFormat.Set(ptrGetLongDateFormatSpec(_s60Locale)); + } + + return s60ToQtFormat(qt_TDesC2QStringL(dateFormat)); +} + +/*! + Retrieves time format from Symbian locale and + transforms it to Qt format. +*/ +static QString symbianTimeFormat() +{ + return s60ToQtFormat(qt_TDesC2QStringL(ptrGetTimeFormatSpec(_s60Locale))); +} + +/*! + Returns localized string representation of given \a date + formatted with Symbian locale date format. + + If \a short_format is true the format will be a short version. + Otherwise it uses a longer version. +*/ +static QString symbianDateToString(const QDate &date, bool short_format) +{ + int month = date.month() - 1; + int day = date.day() - 1; + int year = date.year(); + + TDateTime dateTime; + dateTime.Set(year, TMonth(month), day, 0, 0, 0, 0); + + TTime timeStr(dateTime); + TBuf buffer; + + TPtrC dateFormat; + if (short_format) { + dateFormat.Set(ptrGetShortDateFormatSpec(_s60Locale)); + } else { + dateFormat.Set(ptrGetLongDateFormatSpec(_s60Locale)); + } + + TRAPD(err, ptrTimeFormatL(timeStr, buffer, dateFormat, *_s60Locale.GetLocale());) + + if (err == KErrNone) + return qt_TDes2QStringL(buffer); + else + return QString(); +} + +/*! + Returns localized string representation of given \a time + formatted with Symbian locale time format. +*/ +static QString symbianTimeToString(const QTime &time) +{ + int hour = time.hour(); + int minute = time.minute(); + int second = time.second(); + int milliseconds = 0; + + TDateTime dateTime; + dateTime.Set(0, TMonth(0), 0, hour, minute, second, milliseconds); + + TTime timeStr(dateTime); + TBuf buffer; + + TRAPD(err, ptrTimeFormatL( + timeStr, + buffer, + ptrGetTimeFormatSpec(_s60Locale), + *_s60Locale.GetLocale()); + ) + + if (err == KErrNone) + return qt_TDes2QStringL(buffer); + else + return QString(); +} + +/*! + Returns the measurement system stored in Symbian locale + + \sa QLocale::MeasurementSystem +*/ +static QLocale::MeasurementSystem symbianMeasurementSystem() +{ + TLocale *locale = _s60Locale.GetLocale(); + + TUnitsFormat unitFormat = locale->UnitsGeneral(); + if (unitFormat == EUnitsImperial) + return QLocale::ImperialSystem; + else + return QLocale::MetricSystem; +} + +QLocale QSystemLocale::fallbackLocale() const +{ + // load system data before query calls + static bool initDone = false; + if (!initDone) { + _s60Locale.LoadSystemSettings(); + + // Initialize platform version dependent function pointers + ptrTimeFormatL = reinterpret_cast + (qt_resolveS60PluginFunc(S60Plugin_TimeFormatL)); + ptrGetTimeFormatSpec = reinterpret_cast + (qt_resolveS60PluginFunc(S60Plugin_GetTimeFormatSpec)); + ptrGetLongDateFormatSpec = reinterpret_cast + (qt_resolveS60PluginFunc(S60Plugin_GetLongDateFormatSpec)); + ptrGetShortDateFormatSpec = reinterpret_cast + (qt_resolveS60PluginFunc(S60Plugin_GetShortDateFormatSpec)); + if (!ptrTimeFormatL) + ptrTimeFormatL = &defaultTimeFormatL; + if (!ptrGetTimeFormatSpec) + ptrGetTimeFormatSpec = &defaultFormatSpec; + if (!ptrGetLongDateFormatSpec) + ptrGetLongDateFormatSpec = &defaultFormatSpec; + if (!ptrGetShortDateFormatSpec) + ptrGetShortDateFormatSpec = &defaultFormatSpec; + } + + TLanguage lang = User::Language(); + QString locale = symbianLocaleName(lang); + return QLocale(locale); +} + +/*! + Generic query method for locale data. Provides indirection. + Denotes the \a type of the query + with \a in as input data depending on the query. + + \sa QSystemLocale::QueryType +*/ +QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const +{ + switch(type) { + case DecimalPoint: + return symbianDecimalPoint(); + case GroupSeparator: + return symbianGroupSeparator(); + + case ZeroDigit: + return symbianZeroDigit(); + + case DayNameLong: + case DayNameShort: + return symbianDayName(in.toInt(), (type == DayNameShort) ); + + case MonthNameLong: + case MonthNameShort: + return symbianMonthName(in.toInt(), (type == MonthNameShort) ); + + case DateFormatLong: + case DateFormatShort: + return symbianDateFormat( (type == DateFormatShort) ); + case TimeFormatLong: + case TimeFormatShort: + return symbianTimeFormat(); + case DateTimeFormatLong: + case DateTimeFormatShort: + return symbianDateFormat( (type == DateTimeFormatShort) ) + QLatin1Char(' ') + symbianTimeFormat(); + case DateToStringShort: + case DateToStringLong: + return symbianDateToString(in.toDate(), (type == DateToStringShort) ); + case TimeToStringShort: + case TimeToStringLong: + return symbianTimeToString(in.toTime()); + case DateTimeToStringShort: + case DateTimeToStringLong: { + const QDateTime dt = in.toDateTime(); + return symbianDateToString(dt.date(), (type == DateTimeToStringShort) ) + + QLatin1Char(' ') + symbianTimeToString(dt.time()); + } + case MeasurementSystem: + return static_cast(symbianMeasurementSystem()); + case LanguageId: + case CountryId: { + TLanguage language = User::Language(); + QString locale = symbianLocaleName(language); + QLocale::Language lang; + QLocale::Country cntry; + getLangAndCountry(locale, lang, cntry); + if (type == LanguageId) + return lang; + // few iso codes have no country and will use this + if (cntry == QLocale::AnyCountry) + return fallbackLocale().country(); + + return cntry; + } + case NegativeSign: + case PositiveSign: + case AMText: + case PMText: + break; + default: + break; + } + return QVariant(); +} + +QT_END_NAMESPACE diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri index 45e92bf..c2381ce 100644 --- a/src/corelib/tools/tools.pri +++ b/src/corelib/tools/tools.pri @@ -65,6 +65,7 @@ SOURCES += \ tools/qvector.cpp \ tools/qvsnprintf.cpp +symbian:SOURCES+=tools/qlocale_symbian.cpp #zlib support contains(QT_CONFIG, zlib) { -- cgit v0.12 From e5615b9cf4c981bb8d0fec48eacd6c11c124a3b0 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 25 May 2009 11:57:30 +0200 Subject: qdoc: Added some missing qdoc comments. Task-number: 252491 --- src/corelib/io/qfsfileengine.cpp | 2 +- src/gui/painting/qcolor.cpp | 8 +++++++ src/gui/painting/qcolormap_mac.cpp | 6 ----- src/gui/painting/qcolormap_x11.cpp | 4 ---- src/opengl/qgl.cpp | 48 +++++++++++++++++++++++++++++++++----- src/opengl/qgl_win.cpp | 16 +++---------- src/opengl/qgl_wince.cpp | 3 --- src/opengl/qgl_x11.cpp | 30 +++++------------------- 8 files changed, 60 insertions(+), 57 deletions(-) diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp index e79d867..07f3c9c 100644 --- a/src/corelib/io/qfsfileengine.cpp +++ b/src/corelib/io/qfsfileengine.cpp @@ -948,7 +948,7 @@ bool QFSFileEngine::supportsExtension(Extension extension) const For Windows, -2 is always returned. */ -/*! \fn QString QFSFileEngine::owner() const +/*! \fn QString QFSFileEngine::owner(FileOwner own) const \reimp */ diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp index 1723a19..c50004e 100644 --- a/src/gui/painting/qcolor.cpp +++ b/src/gui/painting/qcolor.cpp @@ -2241,4 +2241,12 @@ QDataStream &operator>>(QDataStream &stream, QColor &color) \sa QColor::rgb(), QColor::rgba() */ +/*! \fn void QColormap::initialize() + \internal +*/ + +/*! \fn void QColormap::cleanup() + \internal +*/ + QT_END_NAMESPACE diff --git a/src/gui/painting/qcolormap_mac.cpp b/src/gui/painting/qcolormap_mac.cpp index afe0378..96da90f 100644 --- a/src/gui/painting/qcolormap_mac.cpp +++ b/src/gui/painting/qcolormap_mac.cpp @@ -55,17 +55,11 @@ public: }; static QColormap *qt_mac_global_map = 0; -/*! - Creates the class's internal colormap. - */ void QColormap::initialize() { qt_mac_global_map = new QColormap; } -/*! - Deletes the class's internal colormap. - */ void QColormap::cleanup() { delete qt_mac_global_map; diff --git a/src/gui/painting/qcolormap_x11.cpp b/src/gui/painting/qcolormap_x11.cpp index ccf6955..c9186b1 100644 --- a/src/gui/painting/qcolormap_x11.cpp +++ b/src/gui/painting/qcolormap_x11.cpp @@ -337,8 +337,6 @@ static void init_direct(QColormapPrivate *d, bool ownColormap) static QColormap **cmaps = 0; -/*! \internal -*/ void QColormap::initialize() { Display *display = QX11Info::display(); @@ -578,8 +576,6 @@ void QColormap::initialize() } } -/*! \internal -*/ void QColormap::cleanup() { Display *display = QX11Info::display(); diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 8f963f8..ca5c732 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -2504,6 +2504,42 @@ const QGLContext* QGLContext::currentContext() visual. On other platforms it may work differently. */ +/*! \fn int QGLContext::choosePixelFormat(void* dummyPfd, HDC pdc) + + \bold{Win32 only:} This virtual function chooses a pixel format + that matches the OpenGL \link setFormat() format\endlink. + Reimplement this function in a subclass if you need a custom + context. + + \warning The \a dummyPfd pointer and \a pdc are used as a \c + PIXELFORMATDESCRIPTOR*. We use \c void to avoid using + Windows-specific types in our header files. + + \sa chooseContext() +*/ + +/*! \fn void *QGLContext::chooseVisual() + + \bold{X11 only:} This virtual function tries to find a visual that + matches the format, reducing the demands if the original request + cannot be met. + + The algorithm for reducing the demands of the format is quite + simple-minded, so override this method in your subclass if your + application has spcific requirements on visual selection. + + \sa chooseContext() +*/ + +/*! \fn void *QGLContext::tryVisual(const QGLFormat& f, int bufDepth) + \internal + + \bold{X11 only:} This virtual function chooses a visual that matches + the OpenGL \link format() format\endlink. Reimplement this function + in a subclass if you need a custom visual. + + \sa chooseContext() +*/ /*! \fn void QGLContext::reset() @@ -3020,11 +3056,10 @@ void QGLWidget::setFormat(const QGLFormat &format) */ /* - \obsolete - \fn void QGLWidget::setContext(QGLContext *context, - const QGLContext* shareContext, - bool deleteOldContext) + const QGLContext* shareContext, + bool deleteOldContext) + \obsolete Sets a new context for this widget. The QGLContext \a context must be created using \e new. QGLWidget will delete \a context when @@ -3174,9 +3209,10 @@ void QGLWidget::resizeOverlayGL(int, int) { } - +/*! \fn bool QGLWidget::event(QEvent *e) + \reimp +*/ #if !defined(Q_OS_WINCE) && !defined(Q_WS_QWS) -/*! \reimp */ bool QGLWidget::event(QEvent *e) { Q_D(QGLWidget); diff --git a/src/opengl/qgl_win.cpp b/src/opengl/qgl_win.cpp index bd8569a..217b0fc 100644 --- a/src/opengl/qgl_win.cpp +++ b/src/opengl/qgl_win.cpp @@ -884,19 +884,9 @@ static bool qLogEq(bool a, bool b) return (((!a) && (!b)) || (a && b)); } -/*! - \bold{Win32 only:} This virtual function chooses a pixel - format that matches the OpenGL \link setFormat() format\endlink. - Reimplement this function in a subclass if you need a custom - context. - - \warning The \a dummyPfd pointer and \a pdc are used as a \c - PIXELFORMATDESCRIPTOR*. We use \c void to avoid using - Windows-specific types in our header files. - - \sa chooseContext() -*/ - +/* + See qgl.cpp for qdoc comment. + */ int QGLContext::choosePixelFormat(void* dummyPfd, HDC pdc) { Q_D(QGLContext); diff --git a/src/opengl/qgl_wince.cpp b/src/opengl/qgl_wince.cpp index cb51598..7429071 100644 --- a/src/opengl/qgl_wince.cpp +++ b/src/opengl/qgl_wince.cpp @@ -552,9 +552,6 @@ void QGLWidgetPrivate::updateColormap() ReleaseDC(q->winId(), hdc); } -/*! - \reimp -\*/ bool QGLWidget::event(QEvent *e) { Q_D(QGLWidget); diff --git a/src/opengl/qgl_x11.cpp b/src/opengl/qgl_x11.cpp index 28c34de..7ed7a23 100644 --- a/src/opengl/qgl_x11.cpp +++ b/src/opengl/qgl_x11.cpp @@ -443,19 +443,9 @@ bool QGLContext::chooseContext(const QGLContext* shareContext) return true; } - -/*! - \bold{X11 only:} This virtual function tries to find a - visual that matches the format, reducing the demands if the original - request cannot be met. - - The algorithm for reducing the demands of the format is quite - simple-minded, so override this method in your subclass if your - application has spcific requirements on visual selection. - - \sa chooseContext() -*/ - +/* + See qgl.cpp for qdoc comment. + */ void *QGLContext::chooseVisual() { Q_D(QGLContext); @@ -519,17 +509,9 @@ void *QGLContext::chooseVisual() return vis; } - -/*! - \internal - - \bold{X11 only:} This virtual function chooses a visual - that matches the OpenGL \link format() format\endlink. Reimplement this - function in a subclass if you need a custom visual. - - \sa chooseContext() -*/ - +/* + See qgl.cpp for qdoc comment. + */ void *QGLContext::tryVisual(const QGLFormat& f, int bufDepth) { Q_D(QGLContext); -- cgit v0.12 From 44d992ca150d9448cb7b9114b2bc489b441c7b76 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 25 May 2009 12:25:28 +0200 Subject: qdoc: Added some missing qdoc comments. Task-number: 252489 --- src/gui/text/qfont.cpp | 14 ++++++++++++++ src/gui/text/qfont_x11.cpp | 11 ----------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index f73ffb5..c5096bf 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -1897,6 +1897,20 @@ void QFont::insertSubstitutions(const QString &familyName, } } +/*! \fn void QFont::initialize() + \internal + + Internal function that initializes the font system. The font cache + and font dict do not alloc the keys. The key is a QString which is + shared between QFontPrivate and QXFontName. +*/ + +/*! \fn void QFont::cleanup() + \internal + + Internal function that cleans up the font system. +*/ + // ### mark: should be called removeSubstitutions() /*! Removes all the substitutions for \a familyName. diff --git a/src/gui/text/qfont_x11.cpp b/src/gui/text/qfont_x11.cpp index 710792c..6b0e46c 100644 --- a/src/gui/text/qfont_x11.cpp +++ b/src/gui/text/qfont_x11.cpp @@ -129,13 +129,6 @@ Q_GUI_EXPORT void qt_x11_set_fallback_font_family(int script, const QString &fam int QFontPrivate::defaultEncodingID = -1; -/*! - Internal function that initializes the font system. - - \internal - The font cache and font dict do not alloc the keys. The key is a QString - which is shared between QFontPrivate and QXFontName. -*/ void QFont::initialize() { extern int qt_encoding_id_for_mib(int mib); // from qfontdatabase_x11.cpp @@ -184,10 +177,6 @@ void QFont::initialize() QFontPrivate::defaultEncodingID = qt_encoding_id_for_mib(mib); } -/*! \internal - - Internal function that cleans up the font system. -*/ void QFont::cleanup() { QFontCache::cleanup(); -- cgit v0.12 From ea4960511135786e36480b6841ed06bdb3bbc1d6 Mon Sep 17 00:00:00 2001 From: axis Date: Mon, 25 May 2009 12:53:44 +0200 Subject: Revert "Enable symbol visibility when compiling with RVCT." This reverts commit c33abd370470a0097cc1fbb858e1218ba110e0df. We will need this patch in the end, but right now it's causing too much trouble with the compiler. To return soon! --- mkspecs/common/symbian/symbian.conf | 2 +- src/corelib/global/qglobal.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf index 2fe93d2..968a6bc 100644 --- a/mkspecs/common/symbian/symbian.conf +++ b/mkspecs/common/symbian/symbian.conf @@ -29,7 +29,7 @@ QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses QMAKE_CXX = g++ QMAKE_CXXFLAGS = $$QMAKE_CFLAGS QMAKE_CXXFLAGS.CW = -QMAKE_CXXFLAGS.ARMCC = --visibility_inlines_hidden +QMAKE_CXXFLAGS.ARMCC = --no_hide_all QMAKE_CXXFLAGS_DEPS = $$QMAKE_CFLAGS_DEPS QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 15b2d53..27aaac1 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1118,7 +1118,7 @@ class QDataStream; #ifndef Q_DECL_EXPORT # ifdef Q_OS_WIN # define Q_DECL_EXPORT __declspec(dllexport) -# elif defined(Q_CC_NOKIAX86) || defined(Q_CC_RVCT) +# elif defined(Q_CC_NOKIAX86) # define Q_DECL_EXPORT __declspec(dllexport) # elif defined(QT_VISIBILITY_AVAILABLE) # define Q_DECL_EXPORT __attribute__((visibility("default"))) @@ -1130,7 +1130,7 @@ class QDataStream; #ifndef Q_DECL_IMPORT # if defined(Q_OS_WIN) # define Q_DECL_IMPORT __declspec(dllimport) -# elif defined(Q_CC_NOKIAX86) || defined(Q_CC_RVCT) +# elif defined(Q_CC_NOKIAX86) # define Q_DECL_IMPORT __declspec(dllimport) # else # define Q_DECL_IMPORT -- cgit v0.12 From 4fed80ce97654adec3baf73d26c21b0967937e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Mon, 25 May 2009 13:56:50 +0300 Subject: S60Style: Try to guesstime resolution, if no exact match is found. --- src/gui/styles/qs60style_symbian.cpp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/gui/styles/qs60style_symbian.cpp b/src/gui/styles/qs60style_symbian.cpp index d29e678..48b759a 100644 --- a/src/gui/styles/qs60style_symbian.cpp +++ b/src/gui/styles/qs60style_symbian.cpp @@ -962,9 +962,8 @@ QFont QS60StylePrivate::s60Font_specific( #ifdef QT_S60STYLE_LAYOUTDATA_SIMULATED void QS60StylePrivate::setActiveLayout() { - //todo: how to find layouts that are of same size (QVGA1 vs. QVGA2) const QSize activeScreenSize(screenSize()); - int activeLayoutIndex = 0; + int activeLayoutIndex = -1; const bool mirrored = !QApplication::isLeftToRight(); const short screenHeight = (short)activeScreenSize.height(); const short screenWidth = (short)activeScreenSize.width(); @@ -976,6 +975,28 @@ void QS60StylePrivate::setActiveLayout() break; } } + + //not found, lets try without mirroring info + if (activeLayoutIndex==-1){ + for (int i=0; i Date: Mon, 25 May 2009 09:30:20 +0200 Subject: BT: Mac: Crash when using QFontDialog If creating a native QFontDialog and delete it, the native dialog will still show. And worse, it will call the deleted QDialog counterpart. This fix will clean up (and close the native dialog) when the QDialog is deleted. Task-number: 254397 Reviewed-by: Trenton Schulz --- src/gui/dialogs/qfontdialog.cpp | 8 ++++++++ src/gui/dialogs/qfontdialog_mac.mm | 1 + 2 files changed, 9 insertions(+) diff --git a/src/gui/dialogs/qfontdialog.cpp b/src/gui/dialogs/qfontdialog.cpp index 4c5bf4f..aa1c553 100644 --- a/src/gui/dialogs/qfontdialog.cpp +++ b/src/gui/dialogs/qfontdialog.cpp @@ -337,6 +337,14 @@ void QFontDialogPrivate::init() QFontDialog::~QFontDialog() { +#ifdef Q_WS_MAC + Q_D(QFontDialog); + if (d->delegate) { + QFontDialogPrivate::closeCocoaFontPanel(d->delegate); + QFontDialogPrivate::sharedFontPanelAvailable = true; + return; + } +#endif } /*! diff --git a/src/gui/dialogs/qfontdialog_mac.mm b/src/gui/dialogs/qfontdialog_mac.mm index 50917a1..13f7149 100644 --- a/src/gui/dialogs/qfontdialog_mac.mm +++ b/src/gui/dialogs/qfontdialog_mac.mm @@ -566,6 +566,7 @@ void *QFontDialogPrivate::openCocoaFontPanel(const QFont &initial, void QFontDialogPrivate::closeCocoaFontPanel(void *delegate) { + QMacCocoaAutoReleasePool pool; QCocoaFontPanelDelegate *theDelegate = static_cast(delegate); NSWindow *ourPanel = [theDelegate actualPanel]; [ourPanel close]; -- cgit v0.12 From 230357435d35a5b379c697723302108dd114585d Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 25 May 2009 14:05:27 +0200 Subject: qdoc: Moved some qdoc comments to a common cpp file. Task-number: 252488 --- src/gui/image/qpixmap.cpp | 95 +++++++++++++++++++++++++++++++++++++++++++ src/gui/image/qpixmap_qws.cpp | 14 ------- src/gui/image/qpixmap_win.cpp | 45 -------------------- src/gui/image/qpixmap_x11.cpp | 28 ------------- 4 files changed, 95 insertions(+), 87 deletions(-) diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 0f6b649..7fcb2b9 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -2014,4 +2014,99 @@ QPixmapData* QPixmap::pixmapData() const return data; } +/*! + \enum QPixmap::HBitmapFormat + + \bold{Win32 only:} This enum defines how the conversion between \c + HBITMAP and QPixmap is performed. + + \warning This enum is only available on Windows. + + \value NoAlpha The alpha channel is ignored and always treated as + being set to fully opaque. This is preferred if the \c HBITMAP is + used with standard GDI calls, such as \c BitBlt(). + + \value PremultipliedAlpha The \c HBITMAP is treated as having an + alpha channel and premultiplied colors. This is preferred if the + \c HBITMAP is accessed through the \c AlphaBlend() GDI function. + + \value Alpha The \c HBITMAP is treated as having a plain alpha + channel. This is the preferred format if the \c HBITMAP is going + to be used as an application icon or systray icon. + + \sa fromWinHBITMAP(), toWinHBITMAP() +*/ + +/*! \fn HBITMAP QPixmap::toWinHBITMAP(HBitmapFormat format) const + \bold{Win32 only:} Creates a \c HBITMAP equivalent to the QPixmap, + based on the given \a format. Returns the \c HBITMAP handle. + + It is the caller's responsibility to free the \c HBITMAP data + after use. + + \warning This function is only available on Windows. + + \sa fromWinHBITMAP() +*/ + +/*! \fn QPixmap QPixmap::fromWinHBITMAP(HBITMAP bitmap, HBitmapFormat format) + \bold{Win32 only:} Returns a QPixmap that is equivalent to the + given \a bitmap. The conversion is based on the specified \a + format. + + \warning This function is only available on Windows. + + \sa toWinHBITMAP(), {QPixmap#Pixmap Conversion}{Pixmap Conversion} + +*/ + +/*! \fn const QX11Info &QPixmap::x11Info() const + \bold{X11 only:} Returns information about the configuration of + the X display used to display the widget. + + \warning This function is only available on X11. + + \sa {QPixmap#Pixmap Information}{Pixmap Information} +*/ + +/*! \fn Qt::HANDLE QPixmap::x11PictureHandle() const + \bold{X11 only:} Returns the X11 Picture handle of the pixmap for + XRender support. + + This function will return 0 if XRender support is not compiled + into Qt, if the XRender extension is not supported on the X11 + display, or if the handle could not be created. Use of this + function is not portable. + + \warning This function is only available on X11. + + \sa {QPixmap#Pixmap Information}{Pixmap Information} +*/ + +/*! \fn int QPixmap::x11SetDefaultScreen(int screen) + \internal +*/ + +/*! \fn void QPixmap::x11SetScreen(int screen) + \internal +*/ + +/*! \fn QRgb* QPixmap::clut() const + \internal +*/ + +/*! \fn int QPixmap::numCols() const + \internal +*/ + +/*! \fn const uchar* QPixmap::qwsBits() const + \internal + \since 4.1 +*/ + +/*! \fn int QPixmap::qwsBytesPerLine() const + \internal + \since 4.1 +*/ + QT_END_NAMESPACE diff --git a/src/gui/image/qpixmap_qws.cpp b/src/gui/image/qpixmap_qws.cpp index 6cc7981..7e383ab 100644 --- a/src/gui/image/qpixmap_qws.cpp +++ b/src/gui/image/qpixmap_qws.cpp @@ -109,9 +109,6 @@ QPixmap QPixmap::grabWindow(WId window, int x, int y, int w, int h) return QPixmap::fromImage(img); } -/*! - \internal -*/ QRgb* QPixmap::clut() const { if (data->classId() == QPixmapData::RasterClass) { @@ -122,9 +119,6 @@ QRgb* QPixmap::clut() const return 0; } -/*! - \internal -*/ int QPixmap::numCols() const { if (data->classId() == QPixmapData::RasterClass) { @@ -135,10 +129,6 @@ int QPixmap::numCols() const return 0; } -/*! - \internal - \since 4.1 -*/ const uchar* QPixmap::qwsBits() const { if (data->classId() == QPixmapData::RasterClass) { @@ -149,10 +139,6 @@ const uchar* QPixmap::qwsBits() const return 0; } -/*! - \internal - \since 4.1 -*/ int QPixmap::qwsBytesPerLine() const { if (data->classId() == QPixmapData::RasterClass) { diff --git a/src/gui/image/qpixmap_win.cpp b/src/gui/image/qpixmap_win.cpp index cbe9004..6a8b38a 100644 --- a/src/gui/image/qpixmap_win.cpp +++ b/src/gui/image/qpixmap_win.cpp @@ -119,42 +119,6 @@ QPixmap QPixmap::grabWindow(WId winId, int x, int y, int w, int h ) return pixmap; } - - -/*! - \enum QPixmap::HBitmapFormat - - This enum defines how the conversion between \c HBITMAP - and QPixmap is performed. - - \warning This enum is only available on Windows. - - \value NoAlpha The alpha channel is ignored and always treated as - being set to fully opaque. This is preferred if the \c HBITMAP is - used with standard GDI calls, such as \c BitBlt(). - - \value PremultipliedAlpha The \c HBITMAP is treated as having an - alpha channel and premultiplied colors. This is preferred if the - \c HBITMAP is accessed through the \c AlphaBlend() GDI function. - - \value Alpha The \c HBITMAP is treated as having a plain alpha - channel. This is the preferred format if the \c HBITMAP is going - to be used as an application icon or systray icon. - - \sa fromWinHBITMAP(), toWinHBITMAP() -*/ - -/*! - Creates a \c HBITMAP equivalent to the QPixmap, based on the given - \a format. Returns the \c HBITMAP handle. - - It is the caller's responsibility to free the \c HBITMAP data - after use. - - \warning This function is only available on Windows. - - \sa fromWinHBITMAP() -*/ HBITMAP QPixmap::toWinHBITMAP(HBitmapFormat format) const { HBITMAP bitmap = 0; @@ -209,15 +173,6 @@ HBITMAP QPixmap::toWinHBITMAP(HBitmapFormat format) const return bitmap; } -/*! - Returns a QPixmap that is equivalent to the given \a bitmap. The - conversion is based on the specified \a format. - - \warning This function is only available on Windows. - - \sa toWinHBITMAP(), {QPixmap#Pixmap Conversion}{Pixmap Conversion} - -*/ QPixmap QPixmap::fromWinHBITMAP(HBITMAP bitmap, HBitmapFormat format) { // Verify size diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp index 38916c7..d2e8d84 100644 --- a/src/gui/image/qpixmap_x11.cpp +++ b/src/gui/image/qpixmap_x11.cpp @@ -1914,9 +1914,6 @@ QPixmap QX11PixmapData::transformed(const QTransform &transform, } } -/*! - \internal -*/ int QPixmap::x11SetDefaultScreen(int screen) { int old = defaultScreen; @@ -1924,9 +1921,6 @@ int QPixmap::x11SetDefaultScreen(int screen) return old; } -/*! - \internal -*/ void QPixmap::x11SetScreen(int screen) { if (paintingActive()) { @@ -2034,14 +2028,6 @@ bool QX11PixmapData::hasAlphaChannel() const return d == 32; } -/*! - Returns information about the configuration of the X display used to display - the widget. - - \warning This function is only available on X11. - - \sa {QPixmap#Pixmap Information}{Pixmap Information} -*/ const QX11Info &QPixmap::x11Info() const { if (data->classId() == QPixmapData::X11Class) @@ -2098,20 +2084,6 @@ QPaintEngine* QX11PixmapData::paintEngine() const return that->pengine; } -/*! - Returns the X11 Picture handle of the pixmap for XRender - support. - - This function will return 0 if XRender support is not compiled - into Qt, if the XRender extension is not supported on the X11 - display, or if the handle could not be created. Use of this - function is not portable. - - \warning This function is only available on X11. - - \sa {QPixmap#Pixmap Information}{Pixmap Information} -*/ - Qt::HANDLE QPixmap::x11PictureHandle() const { #ifndef QT_NO_XRENDER -- cgit v0.12 From 1a477dcad1171d2d195422072fce62fc936e56cb Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 25 May 2009 14:46:20 +0200 Subject: Changed qdoc program to display version from QT_VERSION_STR. Task-number: 251486 --- tools/qdoc3/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/qdoc3/main.cpp b/tools/qdoc3/main.cpp index 3e6f832..5c247fa 100644 --- a/tools/qdoc3/main.cpp +++ b/tools/qdoc3/main.cpp @@ -43,6 +43,7 @@ main.cpp */ +#include #include #include #include "apigenerator.h" @@ -136,7 +137,8 @@ static void printHelp() */ static void printVersion() { - Location::information(tr("qdoc version 4.4.1")); + QString s = QString(tr("qdoc version ")) + QString(QT_VERSION_STR); + Location::information(s); } /*! -- cgit v0.12 From e77f2e595d9b9a6f078f37894733c52bbcfeb695 Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Mon, 25 May 2009 14:55:33 +0200 Subject: BT: Prevent crash in Designer when using a scroll wheel to change a property. There was some strangeness happening here with parents, but the main problem was the fact that wheel was getting sent to the focusframe and not to the widget below. However, the focusframe has the "transparent for mouse events" flag set and wheel events probably should be transparent as well. Task-number: 253539 Reviewed-by: Richard Moe Gustavsen --- src/gui/kernel/qcocoaview_mac.mm | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 4ceae3f..f1a7f39 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -789,10 +789,22 @@ extern "C" { bool wheelOK = false; Qt::KeyboardModifiers keyMods = qt_cocoaModifiers2QtModifiers([theEvent modifierFlags]); + QWidget *widgetToGetMouse = qwidget; + if (widgetToGetMouse->testAttribute(Qt::WA_TransparentForMouseEvents)) { + // Simulate passing the event through since Cocoa doesn't do that for us. + // Start by building a tree up. + NSView *candidateView = [self viewUnderTransparentForMouseView:self + widget:widgetToGetMouse + withWindowPoint:windowPoint]; + if (candidateView != nil) { + widgetToGetMouse = QWidget::find(WId(candidateView)); + } + } + // Mouse wheel deltas seem to tick in at increments of 0.1. Qt widgets - // expect the delta to be a multiple of 120. + // expect the delta to be a multiple of 120. const int ScrollFactor = 10 * 120; - // The qMax(...) factor reduces the + // The qMax(...) factor reduces the // acceleration for large wheel deltas. int deltaX = [theEvent deltaX] * ScrollFactor * qMax(0.6, 1.1 - qAbs([theEvent deltaX])); int deltaY = [theEvent deltaY] * ScrollFactor * qMax(0.6, 1.1 - qAbs([theEvent deltaY])); @@ -800,10 +812,10 @@ extern "C" { if (deltaX != 0) { QWheelEvent qwe(qlocal, qglobal, deltaX, buttons, keyMods, Qt::Horizontal); - qt_sendSpontaneousEvent(qwidget, &qwe); + qt_sendSpontaneousEvent(widgetToGetMouse, &qwe); wheelOK = qwe.isAccepted(); if (!wheelOK && QApplicationPrivate::focus_widget - && QApplicationPrivate::focus_widget != qwidget) { + && QApplicationPrivate::focus_widget != widgetToGetMouse) { QWheelEvent qwe2(QApplicationPrivate::focus_widget->mapFromGlobal(qglobal), qglobal, deltaX, buttons, keyMods, Qt::Horizontal); qt_sendSpontaneousEvent(QApplicationPrivate::focus_widget, &qwe2); @@ -813,10 +825,10 @@ extern "C" { if (deltaY) { QWheelEvent qwe(qlocal, qglobal, deltaY, buttons, keyMods, Qt::Vertical); - qt_sendSpontaneousEvent(qwidget, &qwe); + qt_sendSpontaneousEvent(widgetToGetMouse, &qwe); wheelOK = qwe.isAccepted(); if (!wheelOK && QApplicationPrivate::focus_widget - && QApplicationPrivate::focus_widget != qwidget) { + && QApplicationPrivate::focus_widget != widgetToGetMouse) { QWheelEvent qwe2(QApplicationPrivate::focus_widget->mapFromGlobal(qglobal), qglobal, deltaY, buttons, keyMods, Qt::Vertical); qt_sendSpontaneousEvent(QApplicationPrivate::focus_widget, &qwe2); @@ -828,10 +840,10 @@ extern "C" { // Qt doesn't explicitly support wheels with a Z component. In a misguided attempt to // try to be ahead of the pack, I'm adding this extra value. QWheelEvent qwe(qlocal, qglobal, deltaZ, buttons, keyMods, (Qt::Orientation)3); - qt_sendSpontaneousEvent(qwidget, &qwe); + qt_sendSpontaneousEvent(widgetToGetMouse, &qwe); wheelOK = qwe.isAccepted(); if (!wheelOK && QApplicationPrivate::focus_widget - && QApplicationPrivate::focus_widget != qwidget) { + && QApplicationPrivate::focus_widget != widgetToGetMouse) { QWheelEvent qwe2(QApplicationPrivate::focus_widget->mapFromGlobal(qglobal), qglobal, deltaZ, buttons, keyMods, (Qt::Orientation)3); qt_sendSpontaneousEvent(QApplicationPrivate::focus_widget, &qwe2); -- cgit v0.12 From b57d3f8169c6f1a1aab7203d79043a5f691b7e3e Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 25 May 2009 15:06:49 +0200 Subject: Changed qdoc to simplify the output for overloaded functions. Task-number: 249222 --- tools/qdoc3/doc.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp index 61d0ed6..397fbfa 100644 --- a/tools/qdoc3/doc.cpp +++ b/tools/qdoc3/doc.cpp @@ -1265,9 +1265,7 @@ void DocParser::parse(const QString& source, } else { append(Atom::ParaLeft); - append(Atom::String, - "This is an overloaded member function, " - "provided for convenience."); + append(Atom::String,"This is an overloaded function."); append(Atom::ParaRight); x = getMetaCommandArgument(cmdStr); } -- cgit v0.12 From 565463fb1e7066a1aff4bc6fc4db0678c1747a2d Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Mon, 25 May 2009 15:58:23 +0200 Subject: Compile on Qt/Symbian. The 'in' variable was removed in f1e9c0f3d2 so we don't need this line anymore. --- src/corelib/io/qfile.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index 4277779..551485d 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -741,7 +741,6 @@ QFile::rename(const QString &newName) error = true; } if(!error) { - in.close(); if (!remove()) { d->setError(QFile::RenameError, tr("Cannot remove source file")); error = true; -- cgit v0.12 From 46bb023374dfd8684cefbe1d1c4ffc37f64f1239 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Mon, 25 May 2009 16:25:41 +0200 Subject: Adding details to QSettings functions Adding details to the documentation of custom storage format and related functions. Task-number: 207865 Rev-by: David Boddie Rev-by: Marius Storm-Olsen --- src/corelib/io/qsettings.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index 14fc2d4..6152518 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -3468,7 +3468,7 @@ void QSettings::setPath(Format format, Scope scope, const QString &path) \typedef QSettings::SettingsMap Typedef for QMap. - + \sa registerFormat() */ @@ -3479,6 +3479,11 @@ void QSettings::setPath(Format format, Scope scope, const QString &path) \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 27 + \c ReadFunc is used in \c registerFormat() as a pointer to a function + that reads a set of key/value pairs. \c ReadFunc should read all the + options in one pass, and return all the settings in the \c SettingsMap + container, which is initially empty. + \sa WriteFunc, registerFormat() */ @@ -3489,6 +3494,10 @@ void QSettings::setPath(Format format, Scope scope, const QString &path) \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 28 + \c WriteFunc is used in \c registerFormat() as a pointer to a function + that writes a set of key/value pairs. \c WriteFunc is only called once, + so you need to output the settings in one go. + \sa ReadFunc, registerFormat() */ @@ -3504,7 +3513,7 @@ void QSettings::setPath(Format format, Scope scope, const QString &path) extension associated to the format (without the '.'). The \a readFunc and \a writeFunc parameters are pointers to - functions that read and write a set of (key, value) pairs. The + functions that read and write a set of key/value pairs. The QIODevice parameter to the read and write functions is always opened in binary mode (i.e., without the QIODevice::Text flag). -- cgit v0.12 From 9021113c583cc6b54b3b764e8e74d1448474c773 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Mon, 25 May 2009 16:32:25 +0200 Subject: startup crash on WinCE need to deploy the sqlite plugin, otherwise no model gets created, but referenced causing a crash. Task-number: 254435 Reviewed-by: joerg BT: yes --- examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro b/examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro index 1881fce..c216a30 100644 --- a/examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro +++ b/examples/sql/sqlwidgetmapper/sqlwidgetmapper.pro @@ -8,3 +8,6 @@ target.path = $$[QT_INSTALL_EXAMPLES]/sql/sqlwidgetmapper sources.files = $$SOURCES $$HEADERS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/sql/sqlwidgetmapper INSTALLS += target sources + +wince*: DEPLOYMENT_PLUGIN += qsqlite + -- cgit v0.12 From 3d560a498803fadfec9163d7a9695aee60cca8d4 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 25 May 2009 16:26:13 +0200 Subject: BT: fix systray balloon crash bug on Windows CE Its the context menu handling code... again. Problem is, that during execution of translateMouseEvent, the widget is closed and a modal message box is shown. After that, there's no widget at globalPos and thus, alienWidget is null. This patch just adds a null check for alienWidget. Task-number: 254425 Reviewed-by: mauricek BT: yes --- src/gui/kernel/qapplication_win.cpp | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index f14ad6f..239ee14 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -1675,20 +1675,23 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam // send the context menu event is a different one if (!alienWidget->testAttribute(Qt::WA_NativeWindow) && !alienWidget->testAttribute(Qt::WA_PaintOnScreen)) { alienWidget = QApplication::widgetAt(globalPos); - pos = alienWidget->mapFromGlobal(globalPos); + if (alienWidget) + pos = alienWidget->mapFromGlobal(globalPos); } - SHRGINFO shrg; - shrg.cbSize = sizeof(shrg); - shrg.hwndClient = hwnd; - shrg.ptDown.x = GET_X_LPARAM(lParam); - shrg.ptDown.y = GET_Y_LPARAM(lParam); - shrg.dwFlags = SHRG_RETURNCMD | SHRG_NOANIMATION; - resolveAygLibs(); - if (ptrRecognizeGesture && (ptrRecognizeGesture(&shrg) == GN_CONTEXTMENU)) { - if (qApp->activePopupWidget()) - qApp->activePopupWidget()->close(); - QContextMenuEvent e(QContextMenuEvent::Mouse, pos, globalPos); - result = qt_sendSpontaneousEvent(alienWidget, &e); + if (alienWidget) { + SHRGINFO shrg; + shrg.cbSize = sizeof(shrg); + shrg.hwndClient = hwnd; + shrg.ptDown.x = GET_X_LPARAM(lParam); + shrg.ptDown.y = GET_Y_LPARAM(lParam); + shrg.dwFlags = SHRG_RETURNCMD | SHRG_NOANIMATION; + resolveAygLibs(); + if (ptrRecognizeGesture && (ptrRecognizeGesture(&shrg) == GN_CONTEXTMENU)) { + if (qApp->activePopupWidget()) + qApp->activePopupWidget()->close(); + QContextMenuEvent e(QContextMenuEvent::Mouse, pos, globalPos); + result = qt_sendSpontaneousEvent(alienWidget, &e); + } } } } -- cgit v0.12 From 0f0fc963a7f1691038ee36a27bb63ff3165eefba Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Mon, 25 May 2009 16:45:57 +0200 Subject: BT:Fix a clipping issue in tabbar tabs On XP and Vista where tabs use taboverlap, the currently dragged would loose the outline. We need to compensate for the taboverlap when creating the draggable widget, otherwise the outline will be clipped. Task-number: 254453 Reviewed-by: nrc --- src/gui/widgets/qtabbar.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp index 69221ba..785d772 100644 --- a/src/gui/widgets/qtabbar.cpp +++ b/src/gui/widgets/qtabbar.cpp @@ -1536,9 +1536,10 @@ void QTabBar::paintEvent(QPaintEvent *) } if (!d->dragInProgress) p.drawControl(QStyle::CE_TabBarTab, tab); - else - d->movingTab->setGeometry(tab.rect); - + else { + int taboverlap = style()->pixelMetric(QStyle::PM_TabBarTabOverlap, 0, this); + d->movingTab->setGeometry(tab.rect.adjusted(-taboverlap, 0, taboverlap, 0)); + } } // Only draw the tear indicator if necessary. Most of the time we don't need too. @@ -1805,7 +1806,9 @@ void QTabBarPrivate::setupMovableTab() if (!movingTab) movingTab = new QWidget(q); + int taboverlap = q->style()->pixelMetric(QStyle::PM_TabBarTabOverlap, 0 ,q); QRect grabRect = q->tabRect(pressedIndex); + grabRect.adjust(-taboverlap, 0, taboverlap, 0); QPixmap grabImage(grabRect.size()); grabImage.fill(Qt::transparent); @@ -1813,7 +1816,7 @@ void QTabBarPrivate::setupMovableTab() QStyleOptionTabV3 tab; q->initStyleOption(&tab, pressedIndex); - tab.rect.moveTopLeft(QPoint(0, 0)); + tab.rect.moveTopLeft(QPoint(taboverlap, 0)); p.drawControl(QStyle::CE_TabBarTab, tab); p.end(); -- cgit v0.12 From 313e2719ac75eb6c6ff2d84f5cef9f70433d5943 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Mon, 25 May 2009 16:57:43 +0200 Subject: add deployment rules... WinCE needs those files to be able to do something useful Task-number: 254430 Task-number: 254437 Task-number: 254428 Reviewed-by: joerg BT: yes --- examples/itemviews/puzzle/puzzle.pro | 5 +++++ examples/qtconcurrent/imagescaling/imagescaling.pro | 2 ++ examples/widgets/movie/movie.pro | 8 ++++++++ 3 files changed, 15 insertions(+) diff --git a/examples/itemviews/puzzle/puzzle.pro b/examples/itemviews/puzzle/puzzle.pro index deed112..4f5aaad 100644 --- a/examples/itemviews/puzzle/puzzle.pro +++ b/examples/itemviews/puzzle/puzzle.pro @@ -12,3 +12,8 @@ target.path = $$[QT_INSTALL_EXAMPLES]/itemviews/puzzle sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.jpg sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/puzzle INSTALLS += target sources + +wince* { + DEPLOYMENT_PLUGIN += qjpeg qgif qtiff +} + diff --git a/examples/qtconcurrent/imagescaling/imagescaling.pro b/examples/qtconcurrent/imagescaling/imagescaling.pro index fbf864a..0a25efb 100644 --- a/examples/qtconcurrent/imagescaling/imagescaling.pro +++ b/examples/qtconcurrent/imagescaling/imagescaling.pro @@ -11,3 +11,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/imagescaling sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png sources.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/imagescaling INSTALLS += target sources + +wince*: DEPLOYMENT_PLUGIN += qgif qjpeg qtiff diff --git a/examples/widgets/movie/movie.pro b/examples/widgets/movie/movie.pro index 1c7cbae..6aa5780 100644 --- a/examples/widgets/movie/movie.pro +++ b/examples/widgets/movie/movie.pro @@ -7,3 +7,11 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/movie sources.files = $$SOURCES $$HEADERS $$RESOURCES movie.pro animation.mng sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/movie INSTALLS += target sources + +wince*: { + addFiles.sources += *.mng + addFiles.path = . + DEPLOYMENT += addFiles + DEPLOYMENT_PLUGIN += qmng +} + -- cgit v0.12 From a731cb5c1765bc3ab71469e86ec0533e5a5c18a5 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 25 May 2009 17:40:35 +0200 Subject: don't build examples/qtconcurrent/qtconcurrent.pro by default on Win CE This examples doesn't make much sense on most Windows CE devices. Task-number: 254433 Reviewed-by: mauricek BT: yes --- examples/qtconcurrent/qtconcurrent.pro | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/qtconcurrent/qtconcurrent.pro b/examples/qtconcurrent/qtconcurrent.pro index 53008f0..5d73533 100644 --- a/examples/qtconcurrent/qtconcurrent.pro +++ b/examples/qtconcurrent/qtconcurrent.pro @@ -1,10 +1,13 @@ TEMPLATE = subdirs SUBDIRS = imagescaling \ map \ - progressdialog \ runfunction \ wordcount +!wince* { + SUBDIRS += progressdialog +} + # install target.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS qtconcurrent.pro README -- cgit v0.12 From 305ce9ea67c11826d91c032ead55edfd5e15462f Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 25 May 2009 18:10:08 +0200 Subject: fix warning in QtSvg if qreal == float Reviewed-by: mauricek --- src/svg/qsvggenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/svg/qsvggenerator.cpp b/src/svg/qsvggenerator.cpp index e822da5..fd4c875 100644 --- a/src/svg/qsvggenerator.cpp +++ b/src/svg/qsvggenerator.cpp @@ -261,7 +261,7 @@ public: constantAlpha &= (stops.at(i).second.alpha() == alpha); if (!constantAlpha) { - const qreal spacing = 0.02; + const qreal spacing = qreal(0.02); QGradientStops newStops; QRgb fromColor = PREMUL(stops.at(0).second.rgba()); QRgb toColor; -- cgit v0.12 From 3868c7dacde57c3e929ad72b9c9c42f8ddf4dc62 Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Mon, 25 May 2009 18:42:16 +0200 Subject: BT: Namespace compile fixes. This broke again. I Need to get a way to automate this, I'll discuss with QA. --- src/gui/kernel/qcocoaapplicationdelegate_mac.mm | 2 +- src/gui/kernel/qcocoaview_mac_p.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm index 9a24645..2ca6a3d 100644 --- a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm +++ b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm @@ -90,6 +90,7 @@ QT_BEGIN_NAMESPACE extern void onApplicationChangedActivation(bool); // qapplication_mac.mm +extern void qt_release_apple_event_handler(); //qapplication_mac.mm QT_END_NAMESPACE QT_FORWARD_DECLARE_CLASS(QDesktopWidgetImplementation) @@ -207,7 +208,6 @@ static void cleanupCocoaApplicationDelegate() { Q_UNUSED(aNotification); inLaunch = false; - extern void qt_release_apple_event_handler(); //qapplication_mac.mm qt_release_apple_event_handler(); } diff --git a/src/gui/kernel/qcocoaview_mac_p.h b/src/gui/kernel/qcocoaview_mac_p.h index 983c762..527b1a6 100644 --- a/src/gui/kernel/qcocoaview_mac_p.h +++ b/src/gui/kernel/qcocoaview_mac_p.h @@ -59,6 +59,7 @@ QT_FORWARD_DECLARE_CLASS(QWidgetPrivate); QT_FORWARD_DECLARE_CLASS(QWidget); QT_FORWARD_DECLARE_CLASS(QEvent); QT_FORWARD_DECLARE_CLASS(QCocoaDropData); +QT_FORWARD_DECLARE_CLASS(QStringList); QT_BEGIN_NAMESPACE struct DnDParams -- cgit v0.12 From a4fd37805642f092942b7a761cd50991cc6d7d34 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Mon, 25 May 2009 18:14:39 +0200 Subject: Providing a translated default text for standard roles. --- src/gui/widgets/qsoftkeyaction.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/gui/widgets/qsoftkeyaction.cpp b/src/gui/widgets/qsoftkeyaction.cpp index 583cf65..302850c 100644 --- a/src/gui/widgets/qsoftkeyaction.cpp +++ b/src/gui/widgets/qsoftkeyaction.cpp @@ -55,12 +55,40 @@ public: this->role = role; } + static QString roleText(QSoftKeyAction::StandardRole role); + QSoftKeyAction::StandardRole role; QString roleName; int nativePosition; int qtContextKey; }; +QString QSoftKeyActionPrivate::roleText(QSoftKeyAction::StandardRole role) +{ + switch (role) { + case QSoftKeyAction::Options: + return QSoftKeyAction::tr("Options"); + case QSoftKeyAction::Select: + return QSoftKeyAction::tr("Select"); + case QSoftKeyAction::Back: + return QSoftKeyAction::tr("Back"); + case QSoftKeyAction::Next: + return QSoftKeyAction::tr("Next"); + case QSoftKeyAction::Previous: + return QSoftKeyAction::tr("Previous"); + case QSoftKeyAction::Ok: + return QSoftKeyAction::tr("Ok"); + case QSoftKeyAction::Cancel: + return QSoftKeyAction::tr("Cancel"); + case QSoftKeyAction::Edit: + return QSoftKeyAction::tr("Edit"); + case QSoftKeyAction::View: + return QSoftKeyAction::tr("View"); + default: + return QString(); + }; +} + /*! \enum QSoftKeyAction::StandardRole This enum defines the standard role for a QSoftKeyAction. @@ -92,6 +120,7 @@ QSoftKeyAction::QSoftKeyAction(StandardRole role, QObject *parent) { Q_D(QSoftKeyAction); d->role = role; + setText(QSoftKeyActionPrivate::roleText(role)); } QSoftKeyAction::QSoftKeyAction(const QString &text, QObject* parent) -- cgit v0.12 From b94416a8fe3fae0e9ab01dea9d5a78a21c4affc0 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 25 May 2009 19:43:12 +0200 Subject: Doc: Fixed terminology. Reviewed-by: Trust Me --- src/corelib/tools/qcryptographichash.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp index 7232626..e438179 100644 --- a/src/corelib/tools/qcryptographichash.cpp +++ b/src/corelib/tools/qcryptographichash.cpp @@ -74,7 +74,7 @@ public: QCryptographicHash can be used to generate cryptographic hashes of binary or text data. - Currently MD4, MD5, and SHA1 are supported. + Currently MD4, MD5, and SHA-1 are supported. */ /*! -- cgit v0.12 From 4bee6cac20b52761f39b139c61d5861fe7b68c6f Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 25 May 2009 19:52:30 +0200 Subject: Doc: Fixed links to resources on the qtsoftware.com Web site. Task-number: 254463 Reviewed-by: Denis Dzyubenko --- doc/src/index.qdoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc index 4ead9e4..5bf3661 100644 --- a/doc/src/index.qdoc +++ b/doc/src/index.qdoc @@ -207,10 +207,10 @@ -- cgit v0.12 From 152d5fb2d97432d92b6b84e6e81c0236d278ac5d Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 25 May 2009 20:00:12 +0200 Subject: Doc: Removed documentation about the non-existent QKeyEvent::standardKey() function. Task-number: 254074 Reviewed-by: Trust Me --- src/gui/kernel/qkeysequence.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp index 352d26a..3bcf9e3 100644 --- a/src/gui/kernel/qkeysequence.cpp +++ b/src/gui/kernel/qkeysequence.cpp @@ -629,8 +629,6 @@ const uint QKeySequencePrivate::numberOfKeyBindings = sizeof(QKeySequencePrivate This enum represent standard key bindings. They can be used to assign platform dependent keyboard shortcuts to a QAction. - QKeyEvent also provides the function QKeyEvent::standardKey() to - query if it matches an existing key binding. Note that the key bindings are platform dependent. The currently bound shortcuts can be queried using keyBindings(). -- cgit v0.12 From 8b34bd541c6aa201c4d872210228bce8217a5e03 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 25 May 2009 20:10:25 +0200 Subject: Doc: Miscellaneous documentation fixes for Qt 4.5.x and later. Reviewed-by: Trust Me --- doc/src/snippets/picture/picture.cpp | 2 +- src/corelib/tools/qstringlist.cpp | 2 -- src/gui/painting/qpainterpath.cpp | 8 ++++---- src/gui/text/qfontmetrics.cpp | 12 ++++++------ src/network/ssl/qsslcertificate.cpp | 2 +- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/doc/src/snippets/picture/picture.cpp b/doc/src/snippets/picture/picture.cpp index 07cedbf..be171c6 100644 --- a/doc/src/snippets/picture/picture.cpp +++ b/doc/src/snippets/picture/picture.cpp @@ -66,7 +66,7 @@ int main() QPicture picture; picture.load("drawing.pic"); // load picture QPainter painter; - painter.begin(&myWidget); // paint in myWidget + painter.begin(&myImage); // paint in myImage painter.drawPicture(0, 0, picture); // draw the picture at (0,0) painter.end(); // painting done //! [1] diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp index e22f122..cf1bff8 100644 --- a/src/corelib/tools/qstringlist.cpp +++ b/src/corelib/tools/qstringlist.cpp @@ -621,8 +621,6 @@ int QtPrivate::QStringList_lastIndexOf(const QStringList *that, QRegExp &rx, int the list, searching forward from index position \a from. Returns -1 if no item matched. - By default, this function is case sensitive. - \sa lastIndexOf(), contains(), QList::indexOf() */ diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index 9ce16d3..1b2c4e3 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -2695,7 +2695,7 @@ qreal QPainterPath::length() const /*! Returns percentage of the whole path at the specified length \a len. - Note that similarly to other percent methods, the percentage measurment + Note that similarly to other percent methods, the percentage measurement is not linear with regards to the length, if curves are present in the path. When curves are present the percentage argument is mapped to the t parameter of the Bezier equations. @@ -2812,7 +2812,7 @@ static inline QBezier bezierAtT(const QPainterPath &path, qreal t, qreal *starti Returns the point at at the percentage \a t of the current path. The argument \a t has to be between 0 and 1. - Note that similarly to other percent methods, the percentage measurment + Note that similarly to other percent methods, the percentage measurement is not linear with regards to the length, if curves are present in the path. When curves are present the percentage argument is mapped to the t parameter of the Bezier equations. @@ -2843,7 +2843,7 @@ QPointF QPainterPath::pointAtPercent(qreal t) const Positive values for the angles mean counter-clockwise while negative values mean the clockwise direction. Zero degrees is at the 3 o'clock position. - Note that similarly to the other percent methods, the percentage measurment + Note that similarly to the other percent methods, the percentage measurement is not linear with regards to the length if curves are present in the path. When curves are present the percentage argument is mapped to the t parameter of the Bezier equations. @@ -2875,7 +2875,7 @@ qreal QPainterPath::angleAtPercent(qreal t) const Returns the slope of the path at the percentage \a t. The argument \a t has to be between 0 and 1. - Note that similarly to other percent methods, the percentage measurment + Note that similarly to other percent methods, the percentage measurement is not linear with regards to the length, if curves are present in the path. When curves are present the percentage argument is mapped to the t parameter of the Bezier equations. diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp index 88d0610..87da628 100644 --- a/src/gui/text/qfontmetrics.cpp +++ b/src/gui/text/qfontmetrics.cpp @@ -670,8 +670,8 @@ QRect QFontMetrics::boundingRect(const QString &text) const Returns the rectangle that is covered by ink if character \a ch were to be drawn at the origin of the coordinate system. - Note that the bounding rectangle may extend to the left of (0, 0), - e.g. for italicized fonts, and that the text output may cover \e + Note that the bounding rectangle may extend to the left of (0, 0) + (e.g., for italicized fonts), and that the text output may cover \e all pixels in the bounding rectangle. For a space character the rectangle will usually be empty. @@ -724,7 +724,7 @@ QRect QFontMetrics::boundingRect(QChar ch) const \o Qt::AlignCenter (== \c{Qt::AlignHCenter | Qt::AlignVCenter}) \o Qt::TextSingleLine ignores newline characters in the text. \o Qt::TextExpandTabs expands tabs (see below) - \o Qt::TextShowMnemonic interprets "&x" as \underline{x}, i.e. underlined. + \o Qt::TextShowMnemonic interprets "&x" as \underline{x}; i.e., underlined. \o Qt::TextWordWrap breaks the text to fit the rectangle. \endlist @@ -781,7 +781,7 @@ QRect QFontMetrics::boundingRect(const QRect &rect, int flags, const QString &te \list \o Qt::TextSingleLine ignores newline characters. \o Qt::TextExpandTabs expands tabs (see below) - \o Qt::TextShowMnemonic interprets "&x" as \underline{x}, i.e. underlined. + \o Qt::TextShowMnemonic interprets "&x" as \underline{x}; i.e., underlined. \o Qt::TextWordBreak breaks the text to fit the rectangle. \endlist @@ -1500,7 +1500,7 @@ QRectF QFontMetricsF::boundingRect(QChar ch) const \o Qt::AlignCenter (== \c{Qt::AlignHCenter | Qt::AlignVCenter}) \o Qt::TextSingleLine ignores newline characters in the text. \o Qt::TextExpandTabs expands tabs (see below) - \o Qt::TextShowMnemonic interprets "&x" as \underline{x}, i.e. underlined. + \o Qt::TextShowMnemonic interprets "&x" as \underline{x}; i.e., underlined. \o Qt::TextWordWrap breaks the text to fit the rectangle. \endlist @@ -1559,7 +1559,7 @@ QRectF QFontMetricsF::boundingRect(const QRectF &rect, int flags, const QString& \list \o Qt::TextSingleLine ignores newline characters. \o Qt::TextExpandTabs expands tabs (see below) - \o Qt::TextShowMnemonic interprets "&x" as \underline{x}, i.e. underlined. + \o Qt::TextShowMnemonic interprets "&x" as \underline{x}; i.e., underlined. \o Qt::TextWordBreak breaks the text to fit the rectangle. \endlist diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp index a2ba644..7b554dc 100644 --- a/src/network/ssl/qsslcertificate.cpp +++ b/src/network/ssl/qsslcertificate.cpp @@ -267,7 +267,7 @@ QByteArray QSslCertificate::serialNumber() const /*! Returns a cryptographic digest of this certificate. By default, - and MD5 digest will be generated, but you can also specify a + an MD5 digest will be generated, but you can also specify a custom \a algorithm. */ QByteArray QSslCertificate::digest(QCryptographicHash::Algorithm algorithm) const -- cgit v0.12 From 23820c30052ea23ecf2226c300fc4819dd294306 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 25 May 2009 20:13:34 +0200 Subject: Doc: Fixed custom graphics item snippet. As reported on qt-interest: http://lists.trolltech.com/pipermail/qt-interest/2009-May/007036.html Reviewed-by: Trust Me --- doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp b/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp index a57de9d..d9e38ed 100644 --- a/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp +++ b/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp @@ -6,7 +6,7 @@ public: { qreal penWidth = 1; return QRectF(-10 - penWidth / 2, -10 - penWidth / 2, - 20 + penWidth / 2, 20 + penWidth / 2); + 20 + penWidth, 20 + penWidth); } void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, -- cgit v0.12 From bbefe9e67366151e2286a2ff6bee0d1009b2a12c Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 25 May 2009 20:24:22 +0200 Subject: Doc: Removed the incorrect figures for Thumb builds of libraries. We need to resolve the issues around the use of Thumb code in Qt and automate the building and comparison of libraries. Reviewed-by: Trust Me --- doc/src/installation.qdoc | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/src/installation.qdoc b/doc/src/installation.qdoc index 925a195..6a689f9 100644 --- a/doc/src/installation.qdoc +++ b/doc/src/installation.qdoc @@ -738,8 +738,6 @@ in the \l{Qt for Windows CE Requirements} document. \header \o Minimal \o Normal \o Minimal \o Normal \o Minimal \o Normal \o Minimal \o Normal \row \o linux-x86-g++ \o GCC 4.2.4 \o 1.7M \o 2.7M \o 3.3M \o 9.9M \o 653K \o 1.1M \o N/A \o 17M \row \o linux-arm-g++ \o GCC 4.1.1 \o 1.9M \o 3.2M \o 4.1M \o 11M \o 507K \o 1.0M \o N/A \o 17M - \row \o linux-arm-g++ (thumb) - \o GCC 4.1.1 \o 1.7M \o 2.8M \o 4.0M \o 9.8M \o 409K \o 796K \o N/A \o 17M \row \o linux-mips-g++ (MIPS32) \o GCC 4.2.4 \o 2.0M \o 3.2M \o 4.5M \o 12M \o 505K \o 1003K \o N/A \o 21M \endtable -- cgit v0.12 From a4ca38bab521e1f0095b9c90c4623ca9d41d219b Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 25 May 2009 20:27:19 +0200 Subject: Doc: Clarified what close(), abort() and disconnectFromHost() really do to the socket connection. (Reviewed - see below.) Also included corrections to the description of how to send SocketError and SocketState values via signals. (Trust me - as part of an earlier revision of the custom types documentation.) Task-number: 222907 Reviewed-by: Andy Shaw --- src/network/socket/qabstractsocket.cpp | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 336a7e7..4bb12e6 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -99,7 +99,7 @@ the client has read the data). Note that Qt does not limit the write buffer size. You can monitor its size by listening to this signal. - + The readyRead() signal is emitted every time a new chunk of data has arrived. bytesAvailable() then returns the number of bytes that are available for reading. Typically, you would connect the @@ -199,9 +199,10 @@ parameter describes the type of error that occurred. QAbstractSocket::SocketError is not a registered metatype, so for queued - connections, you will have to register it with Q_REGISTER_METATYPE. + connections, you will have to register it with Q_DECLARE_METATYPE() and + qRegisterMetaType(). - \sa error(), errorString() + \sa error(), errorString(), {Creating Custom Qt Types} */ /*! @@ -211,9 +212,10 @@ The \a socketState parameter is the new state. QAbstractSocket::SocketState is not a registered metatype, so for queued - connections, you will have to register it with Q_REGISTER_METATYPE. + connections, you will have to register it with Q_REGISTER_METATYPE() and + qRegisterMetaType(). - \sa state() + \sa state(), {Creating Custom Qt Types} */ /*! @@ -1864,9 +1866,9 @@ bool QAbstractSocket::waitForDisconnected(int msecs) } /*! - Aborts the current connection and resets the socket. Unlike - disconnectFromHost(), this function immediately closes the socket, discarding - any pending data in the write buffer. + Aborts the current connection and resets the socket. Unlike disconnectFromHost(), + this function immediately closes the socket, discarding any pending data in the + write buffer. \sa disconnectFromHost(), close() */ @@ -2163,7 +2165,12 @@ void QAbstractSocket::setPeerName(const QString &name) } /*! - Disconnects the socket's connection with the host. + Closes the I/O device for the socket, disconnects the socket's connection with the + host, closes the socket, and resets the name, address, port number and underlying + socket descriptor. + + See QIODevice::close() for a description of the actions that occur when an I/O + device is closed. \sa abort() */ @@ -2456,7 +2463,8 @@ QNetworkProxy QAbstractSocket::proxy() const #endif // QT_NO_NETWORKPROXY #ifdef QT3_SUPPORT -/*! \enum QAbstractSocket::Error +/*! + \enum QAbstractSocket::Error \compat Use QAbstractSocket::SocketError instead. -- cgit v0.12 From 2248d63c1a32ae84bb6d0bde9021a8074db1b4c9 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Tue, 26 May 2009 10:46:54 +1000 Subject: Fixed qmake writing targets into the root of the current drive when DESTDIR=./ and using Windows, nmake and shadow builds. qmake would canonicalize the DESTDIR of "./" to "". Then it would check if the original DESTDIR ended with "/", and if so, append it to the new DESTDIR, resulting in a DESTDIR of "/" - the root of the current drive. Don't do that. This bug doesn't occur with in-source builds because qmake detects that the source and build directories are the same directory and replaces the DESTDIR of "./" with "" before it reaches the buggy code. Autotest: included Reviewed-by: Lincoln Ramsay --- qmake/generators/win32/winmakefile.cpp | 2 +- tests/auto/qmake/tst_qmake.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index 87f55cf..c7f00dd 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -626,7 +626,7 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t) // do this here so we can set DEST_TARGET to be the complete path to the final target if it is needed. QString orgDestDir = var("DESTDIR"); QString destDir = Option::fixPathToTargetOS(orgDestDir, false); - if (orgDestDir.endsWith('/') || orgDestDir.endsWith(Option::dir_sep)) + if (!destDir.isEmpty() && (orgDestDir.endsWith('/') || orgDestDir.endsWith(Option::dir_sep))) destDir += Option::dir_sep; QString target = QString(project->first("TARGET")+project->first("TARGET_EXT")); target.remove("\""); diff --git a/tests/auto/qmake/tst_qmake.cpp b/tests/auto/qmake/tst_qmake.cpp index 70f1f3c..1178c81 100644 --- a/tests/auto/qmake/tst_qmake.cpp +++ b/tests/auto/qmake/tst_qmake.cpp @@ -63,6 +63,7 @@ public slots: private slots: void simple_app(); + void simple_app_shadowbuild(); void simple_lib(); void simple_dll(); void subdirs(); @@ -143,6 +144,21 @@ void tst_qmake::simple_app() QVERIFY( test_compiler.removeMakefile( workDir ) ); } +void tst_qmake::simple_app_shadowbuild() +{ + QString workDir = base_path + "/testdata/simple_app"; + QString buildDir = base_path + "/testdata/simple_app_build"; + + QVERIFY( test_compiler.qmake( workDir, "simple_app", buildDir )); + QVERIFY( test_compiler.make( buildDir )); + QVERIFY( test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); + QVERIFY( test_compiler.makeClean( buildDir )); + QVERIFY( test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); // Should still exist after a make clean + QVERIFY( test_compiler.makeDistClean( buildDir )); + QVERIFY( !test_compiler.exists( buildDir, "simple_app", Exe, "1.0.0" )); // Should not exist after a make distclean + QVERIFY( test_compiler.removeMakefile( buildDir ) ); +} + void tst_qmake::simple_dll() { QString workDir = base_path + "/testdata/simple_dll"; -- cgit v0.12 From 682b854872c26d7408d79131217825fb8ddace6a Mon Sep 17 00:00:00 2001 From: Michael Goddard Date: Tue, 26 May 2009 10:39:36 +1000 Subject: BT:Fix access of deleted memory with a static QCursor. If a QCursor with a predefined shape is declared static, it could be destroyed after the application dtor has already cleaned up QCursor memory. Task-number: 254467 Reviewed-by: Rhys Weatherley --- src/gui/kernel/qcursor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp index ed7e020..598f4ba 100644 --- a/src/gui/kernel/qcursor.cpp +++ b/src/gui/kernel/qcursor.cpp @@ -375,7 +375,9 @@ void QCursorData::cleanup() return; for (int shape = 0; shape <= Qt::LastCursor; ++shape) { - delete qt_cursorTable[shape]; + // In case someone has a static QCursor defined with this shape + if (!qt_cursorTable[shape]->ref.deref()) + delete qt_cursorTable[shape]; qt_cursorTable[shape] = 0; } QCursorData::initialized = false; -- cgit v0.12 From 31014eeeb8b994eeddc504636135682f77c7e4a6 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 26 May 2009 09:34:02 +0300 Subject: Commented out include that was needed only by commented out code and causing build problems for symbian. --- tests/auto/network-settings.h | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/tests/auto/network-settings.h b/tests/auto/network-settings.h index 88e9fb7..22d8886 100644 --- a/tests/auto/network-settings.h +++ b/tests/auto/network-settings.h @@ -37,7 +37,12 @@ ** ****************************************************************************/ #include + +/* +#ifdef QT_NETWORK_LIB #include +#endif +*/ #ifdef Q_OS_SYMBIAN #include @@ -48,10 +53,10 @@ #if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86) // In emulator we use WINSOCK connectivity by default. Unfortunately winsock // does not work very well with UDP sockets. This defines skips some test -// cases which have known problems. +// cases which have known problems. // NOTE: Prefer to use WINPCAP based connectivity in S60 emulator when running -// network tests. WINPCAP connectivity uses Symbian OS IP stack, +// network tests. WINPCAP connectivity uses Symbian OS IP stack, // correspondingly as HW does. When using WINPCAP disable this define //#define SYMBIAN_WINSOCK_CONNECTIVITY #endif @@ -138,7 +143,7 @@ public: #endif return "10.10.14.172"; } - + static QByteArray expectedReplyIMAP() { #ifdef Q_OS_SYMBIAN @@ -160,7 +165,7 @@ public: QByteArray expected( "* OK [CAPABILITY IMAP4 IMAP4REV1] " ); expected = expected.append(QtNetworkSettings::serverLocalName().toAscii()); expected = expected.append(" Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n"); - + return expected; } @@ -182,12 +187,12 @@ public: return expected; } } - + static QByteArray expectedReplyFtp() { QByteArray expected( "220 (vsFTPd 2.0.5)\r\n221 Goodbye.\r\n" ); return expected; - } + } #ifdef Q_OS_SYMBIAN static void setDefaultIap() @@ -250,7 +255,7 @@ private: position += QString("=").length(); //create record - QtNetworkSettingsRecord *entry = + QtNetworkSettingsRecord *entry = new QtNetworkSettingsRecord( QString("iap.default"), line.mid(position).trimmed() ); entries.insert(entry->recordName(), entry); break; -- cgit v0.12 From 5839b16a73c36ff7636c13f841d26e6a5e0c5435 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Tue, 28 Apr 2009 17:37:52 +0200 Subject: fix double slash prepending causing troubles on WinCE Before adding a / to the path one should check if it doesn't end with one already. Otherwise one might get paths like //My Documents on WinCE causing the native call to crash the filesystem service on that system. Reviewed-by: alexis --- src/gui/dialogs/qfilesystemmodel_p.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/gui/dialogs/qfilesystemmodel_p.h b/src/gui/dialogs/qfilesystemmodel_p.h index 0a1265a..61e8b4c 100644 --- a/src/gui/dialogs/qfilesystemmodel_p.h +++ b/src/gui/dialogs/qfilesystemmodel_p.h @@ -164,9 +164,12 @@ public: QHash::const_iterator iterator; for(iterator = children.constBegin() ; iterator != children.constEnd() ; ++iterator) { //On windows the root (My computer) has no path so we don't want to add a / for nothing (e.g. /C:/) - if (!path.isEmpty()) - iterator.value()->updateIcon(iconProvider, path + QLatin1Char('/') + iterator.value()->fileName); - else + if (!path.isEmpty()) { + if (path.endsWith(QLatin1Char('/'))) + iterator.value()->updateIcon(iconProvider, path + iterator.value()->fileName); + else + iterator.value()->updateIcon(iconProvider, path + QLatin1Char('/') + iterator.value()->fileName); + } else iterator.value()->updateIcon(iconProvider, iterator.value()->fileName); } } @@ -177,9 +180,12 @@ public: QHash::const_iterator iterator; for(iterator = children.constBegin() ; iterator != children.constEnd() ; ++iterator) { //On windows the root (My computer) has no path so we don't want to add a / for nothing (e.g. /C:/) - if (!path.isEmpty()) - iterator.value()->retranslateStrings(iconProvider, path + QLatin1Char('/') + iterator.value()->fileName); - else + if (!path.isEmpty()) { + if (path.endsWith(QLatin1Char('/'))) + iterator.value()->retranslateStrings(iconProvider, path + iterator.value()->fileName); + else + iterator.value()->retranslateStrings(iconProvider, path + QLatin1Char('/') + iterator.value()->fileName); + } else iterator.value()->retranslateStrings(iconProvider, iterator.value()->fileName); } } -- cgit v0.12 From 269ae27faccb81ba3aacd1723edad13885b991d4 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 26 May 2009 11:06:18 +0300 Subject: Fixed qlibrary autotest compilation error in symbian-abld --- tests/auto/qlibrary/lib2/lib2.pro | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/auto/qlibrary/lib2/lib2.pro b/tests/auto/qlibrary/lib2/lib2.pro index 724077a..436d7ba 100644 --- a/tests/auto/qlibrary/lib2/lib2.pro +++ b/tests/auto/qlibrary/lib2/lib2.pro @@ -27,10 +27,11 @@ unix:!symbian: { symbian-abld: { TARGET.CAPABILITY=ALL -TCB + FIXEDROOT = $$replace(EPOCROOT,/,\\) QMAKE_POST_LINK = \ - copy /Y $${EPOCROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dll $${EPOCROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dl2 && \ - copy /Y $${EPOCROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dll $${EPOCROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\system.trolltech.test.mylib.dll && \ - IF NOT "$(PLATFORM)==WINSCW" copy /Y $${EPOCROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dll ..\tst\mylib.dl2 + copy /Y $${FIXEDROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dll $${FIXEDROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dl2 && \ + copy /Y $${FIXEDROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dll $${FIXEDROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\system.trolltech.test.mylib.dll && \ + IF NOT "$(PLATFORM)==WINSCW" copy /Y $${FIXEDROOT}epoc32\release\\$(PLATFORM)\\$(CFG)\mylib.dll ..\tst\mylib.dl2 } symbian-sbsv2: { -- cgit v0.12 From ff0418c46ffe5270365b6d53298e3ea9014d14ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Tue, 26 May 2009 11:10:56 +0300 Subject: S60Style: Add reason for clearing style specific caches. --- src/gui/styles/qs60style.cpp | 31 +++++++++++++++++-------------- src/gui/styles/qs60style_p.h | 9 ++++++++- src/gui/styles/qs60style_simulated.cpp | 2 +- src/gui/styles/qs60style_symbian.cpp | 4 ++-- 4 files changed, 28 insertions(+), 18 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index f8cf885..5026d5c 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -350,14 +350,24 @@ QFont QS60StylePrivate::s60Font( return result; } -//todo: you could pass a reason to clear cache here, so that we could -// deduce whether or not the specific cache needs to be cleared -void QS60StylePrivate::clearCaches() +void QS60StylePrivate::clearCaches(QS60StylePrivate::CacheClearReason reason) { - m_colorCache.clear(); - m_mappedFontsCache.clear(); - QPixmapCache::clear(); - m_backgroundValid = false; + switch(reason){ + case CC_LayoutChange: + // when layout changes, the colors remain in cache + m_mappedFontsCache.clear(); //todo: can font change, when layout changes? + m_backgroundValid = false; + QPixmapCache::clear(); + break; + case CC_ThemeChange: //todo: can font change when theme changes? + case CC_UndefinedChange: + default: + m_colorCache.clear(); + m_mappedFontsCache.clear(); + QPixmapCache::clear(); + m_backgroundValid = false; + break; + } } // Since S60Style has 'button' and 'tooltip' as a graphic, we don't have any native color which to use @@ -381,7 +391,6 @@ QColor QS60StylePrivate::colorFromFrameGraphics(QS60StylePrivate::SkinFrameEleme const int pixels = frameImage.numBytes()/sizeof(QRgb); const int bytesPerLine = frameImage.bytesPerLine(); Q_ASSERT(bytesPerLine); - const int rows = frameImage.numBytes()/(sizeof(QRgb)*bytesPerLine); int estimatedRed = 0; int estimatedGreen = 0; @@ -761,8 +770,6 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom const QS60StylePrivate::SkinElementFlags flags = (option->state & State_Enabled) ? QS60StylePrivate::SF_StateEnabled : QS60StylePrivate::SF_StateDisabled; SubControls sub = option->subControls; - Q_D(const QS60Style); - switch (control) { #ifndef QT_NO_SCROLLBAR case CC_ScrollBar: @@ -2413,7 +2420,6 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple //slightly indent text and boxes, so that dialog border does not mess with them. const int horizontalSpacing = QS60StylePrivate::pixelMetric(QStyle::PM_LayoutHorizontalSpacing); - const int bottomMargin = QS60StylePrivate::pixelMetric(QStyle::PM_LayoutBottomMargin); ret.adjust(2,horizontalSpacing-3,0,0); break; case SC_GroupBoxFrame: { @@ -2518,13 +2524,10 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con } } else if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast(opt)) { const bool checkable = menuItem->checkType != QStyleOptionMenuItem::NotCheckable; - const bool subMenu = menuItem->menuItemType == QStyleOptionMenuItem::SubMenu; int indicatorWidth = checkable ? pixelMetric(PM_ListViewIconSize, opt, widget) : pixelMetric(PM_SmallIconSize, opt, widget); ret = menuItem->rect; - const int verticalSpacing = - QS60StylePrivate::pixelMetric(QStyle::PM_LayoutVerticalSpacing); if (element == SE_ItemViewItemDecoration) { if (menuItem->direction == Qt::RightToLeft) diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index 37c6ec7..ba7dca3 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -331,6 +331,13 @@ public: SF_StateDisabled = 0x0020, SF_ColorSkinned = 0x0040, }; + + enum CacheClearReason { + CC_UndefinedChange = 0, + CC_LayoutChange, + CC_ThemeChange + }; + Q_DECLARE_FLAGS(SkinElementFlags, SkinElementFlag) // draws skin element @@ -365,7 +372,7 @@ public: QFont s60Font(QS60StyleEnums::FontCategories fontCategory, int pointSize = -1) const; // clears all style caches (fonts, colors, pixmaps) - void clearCaches(); + void clearCaches(CacheClearReason reason = CC_UndefinedChange); // returns themed background texture static QPixmap backgroundTexture(); diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index f10da2b..65336ae 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -289,7 +289,7 @@ void QS60Style::setS60Theme(const QHash &parts, Q_D(QS60Style); QS60StyleModeSpecifics::m_partPictures = parts; QS60StyleModeSpecifics::m_colors = colors; - d->clearCaches(); + d->clearCaches(QS60StylePrivate::CC_ThemeChange); } QT_END_NAMESPACE diff --git a/src/gui/styles/qs60style_symbian.cpp b/src/gui/styles/qs60style_symbian.cpp index 48b759a..3fc4c8c 100644 --- a/src/gui/styles/qs60style_symbian.cpp +++ b/src/gui/styles/qs60style_symbian.cpp @@ -1352,7 +1352,7 @@ void QS60StyleModeSpecifics::colorGroupAndIndex( void QS60Style::handleDynamicLayoutVariantSwitch() { Q_D(QS60Style); - d->clearCaches(); + d->clearCaches(QS60StylePrivate::CC_LayoutChange); #ifdef QT_S60STYLE_LAYOUTDATA_SIMULATED d->setActiveLayout(); #endif // QT_S60STYLE_LAYOUTDATA_SIMULATED @@ -1365,7 +1365,7 @@ void QS60Style::handleDynamicLayoutVariantSwitch() void QS60Style::handleSkinChange() { Q_D(QS60Style); - d->clearCaches(); + d->clearCaches(QS60StylePrivate::CC_ThemeChange); d->setThemePalette(qApp); foreach (QWidget *topLevelWidget, QApplication::allWidgets()){ QEvent e(QEvent::StyleChange); -- cgit v0.12 From e7a607f0f1f7837a26bf95248504497b0534e357 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 26 May 2009 10:19:02 +0200 Subject: qdoc: Indicate that qAbs(T& v) compares v to a 0 of type T. Task-number: 246789 --- doc/src/index.qdoc | 1 + src/corelib/global/qglobal.cpp | 49 +++++++++++++++++++++++++++++++----------- 2 files changed, 38 insertions(+), 12 deletions(-) diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc index 4ead9e4..9846ac4 100644 --- a/doc/src/index.qdoc +++ b/doc/src/index.qdoc @@ -153,6 +153,7 @@
  • All Overviews and HOWTOs
  • Qt Widget Gallery
  • Class Chart
  • +
  • Qt Global Declarations
  • diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 8324d05..f767bb9 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -125,7 +125,8 @@ QT_BEGIN_NAMESPACE If you want to use QFlags for your own enum types, use the Q_DECLARE_FLAGS() and Q_DECLARE_OPERATORS_FOR_FLAGS(). - For example: + + Example: \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 1 @@ -442,14 +443,18 @@ QT_BEGIN_NAMESPACE function. You can retrieve the minimum and maximum of two given objects using qMin() and qMax() respectively. All these functions return a corresponding template type; the template types can be - replaced by any other type. For example: + replaced by any other type. + + Example: \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 3 also contains functions that generate messages from the given string argument: qCritical(), qDebug(), qFatal() and qWarning(). These functions call the message handler with the - given message. For example: + given message. + + Example: \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 4 @@ -694,7 +699,9 @@ QT_BEGIN_NAMESPACE \relates Wraps the signed 64-bit integer \a literal in a - platform-independent way. For example: + platform-independent way. + + Example: \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 8 @@ -705,7 +712,9 @@ QT_BEGIN_NAMESPACE \relates Wraps the unsigned 64-bit integer \a literal in a - platform-independent way. For example: + platform-independent way. + + Example: \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 9 @@ -734,7 +743,11 @@ QT_BEGIN_NAMESPACE /*! \fn const T &qAbs(const T &value) \relates - Returns the absolute value of \a value. For example: + Compares \a value to the 0 of type T and returns the absolute + value. Thus if T is \e {double}, then \a value is compared to + \e{(double) 0}. + + Example: \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 10 */ @@ -742,7 +755,9 @@ QT_BEGIN_NAMESPACE /*! \fn int qRound(qreal value) \relates - Rounds \a value to the nearest integer. For example: + Rounds \a value to the nearest integer. + + Example: \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 11 */ @@ -750,7 +765,9 @@ QT_BEGIN_NAMESPACE /*! \fn qint64 qRound64(qreal value) \relates - Rounds \a value to the nearest 64-bit integer. For example: + Rounds \a value to the nearest 64-bit integer. + + Example: \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 12 */ @@ -758,7 +775,9 @@ QT_BEGIN_NAMESPACE /*! \fn const T &qMin(const T &value1, const T &value2) \relates - Returns the minimum of \a value1 and \a value2. For example: + Returns the minimum of \a value1 and \a value2. + + Example: \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 13 @@ -768,7 +787,9 @@ QT_BEGIN_NAMESPACE /*! \fn const T &qMax(const T &value1, const T &value2) \relates - Returns the maximum of \a value1 and \a value2. For example: + Returns the maximum of \a value1 and \a value2. + + Example: \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 14 @@ -779,7 +800,9 @@ QT_BEGIN_NAMESPACE \relates Returns \a value bounded by \a min and \a max. This is equivalent - to qMax(\a min, qMin(\a value, \a max)). For example: + to qMax(\a min, qMin(\a value, \a max)). + + Example: \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 15 @@ -925,7 +948,9 @@ QT_BEGIN_NAMESPACE 4.1.2, the QT_VERSION macro will expand to 0x040102. You can use QT_VERSION to use the latest Qt features where - available. For example: + available. + + Example: \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 16 -- cgit v0.12 From 2a390bb481a2433a239a9198e463c9337a26db59 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 25 May 2009 18:32:46 +0200 Subject: Fixed: QSortFilterProxyModel setDynamicSortFilter doesn't works when setting the model initially This was caused by two different bug: - In the QSortFilterProxyModel, we need to re-sort when setting the source model change the sorting column (happen when setting a model initially) - In the treeview, we need to activate the sorting even if there is no column yet (because the initial model is empty Task-number: 254234 Reviewed-by: Thierry BT: --- src/gui/itemviews/qheaderview.cpp | 4 ++- src/gui/itemviews/qsortfilterproxymodel.cpp | 3 ++- src/gui/itemviews/qtreeview.cpp | 8 +++--- .../tst_qsortfilterproxymodel.cpp | 10 ++++++++ tests/auto/qtreeview/tst_qtreeview.cpp | 29 +++++++++++++++++++++- 5 files changed, 48 insertions(+), 6 deletions(-) diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp index dc63b25..86ece40 100644 --- a/src/gui/itemviews/qheaderview.cpp +++ b/src/gui/itemviews/qheaderview.cpp @@ -1267,8 +1267,10 @@ void QHeaderView::setSortIndicator(int logicalIndex, Qt::SortOrder order) d->sortIndicatorSection = logicalIndex; d->sortIndicatorOrder = order; - if (logicalIndex >= d->sectionCount) + if (logicalIndex >= d->sectionCount) { + emit sortIndicatorChanged(logicalIndex, order); return; // nothing to do + } if (old != logicalIndex && ((logicalIndex >= 0 && resizeMode(logicalIndex) == ResizeToContents) diff --git a/src/gui/itemviews/qsortfilterproxymodel.cpp b/src/gui/itemviews/qsortfilterproxymodel.cpp index 43feda8..92dfd19 100644 --- a/src/gui/itemviews/qsortfilterproxymodel.cpp +++ b/src/gui/itemviews/qsortfilterproxymodel.cpp @@ -1518,7 +1518,8 @@ void QSortFilterProxyModel::setSourceModel(QAbstractItemModel *sourceModel) d->clear_mapping(); reset(); - d->update_source_sort_column(); + if (d->update_source_sort_column() && d->dynamic_sortfilter) + d->sort(); } /*! diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp index 62c1277..1070648 100644 --- a/src/gui/itemviews/qtreeview.cpp +++ b/src/gui/itemviews/qtreeview.cpp @@ -246,7 +246,7 @@ void QTreeView::setModel(QAbstractItemModel *model) connect(d->model, SIGNAL(modelAboutToBeReset()), SLOT(_q_modelAboutToBeReset())); if (d->sortingEnabled) - sortByColumn(header()->sortIndicatorSection(), header()->sortIndicatorOrder()); + d->_q_sortIndicatorChanged(header()->sortIndicatorSection(), header()->sortIndicatorOrder()); } /*! @@ -846,17 +846,19 @@ void QTreeView::setExpanded(const QModelIndex &index, bool expanded) void QTreeView::setSortingEnabled(bool enable) { Q_D(QTreeView); - d->sortingEnabled = enable; header()->setSortIndicatorShown(enable); header()->setClickable(enable); if (enable) { + //sortByColumn has to be called before we connect or set the sortingEnabled flag + // because otherwise it will not call sort on the model. + sortByColumn(header()->sortIndicatorSection(), header()->sortIndicatorOrder()); connect(header(), SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)), this, SLOT(_q_sortIndicatorChanged(int, Qt::SortOrder))); - sortByColumn(header()->sortIndicatorSection(), header()->sortIndicatorOrder()); } else { disconnect(header(), SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)), this, SLOT(_q_sortIndicatorChanged(int, Qt::SortOrder))); } + d->sortingEnabled = enable; } bool QTreeView::isSortingEnabled() const diff --git a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp index bd66fdf..80d90a6 100644 --- a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp +++ b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp @@ -2585,6 +2585,16 @@ void tst_QSortFilterProxyModel::task248868_dynamicSorting() QModelIndex index = proxy1.index(row, 0, QModelIndex()); QCOMPARE(proxy1.data(index, Qt::DisplayRole).toString(), expected.at(row)); } + + //set up the sorting before seting the model up + QSortFilterProxyModel proxy2; + proxy2.setDynamicSortFilter(true); + proxy2.sort(0); + proxy2.setSourceModel(&model2); + for (int row = 0; row < proxy2.rowCount(QModelIndex()); ++row) { + QModelIndex index = proxy2.index(row, 0, QModelIndex()); + QCOMPARE(proxy2.data(index, Qt::DisplayRole).toString(), expected.at(row)); + } } class QtTestModel: public QAbstractItemModel diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp index 655ea4e..54d6619 100644 --- a/tests/auto/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/qtreeview/tst_qtreeview.cpp @@ -225,6 +225,7 @@ private slots: void task238873_avoidAutoReopening(); void task244304_clickOnDecoration(); void task246536_scrollbarsNotWorking(); + void task254234_proxySort(); }; class QtTestModel: public QAbstractItemModel @@ -2493,7 +2494,6 @@ void tst_QTreeView::sortByColumn() QCOMPARE(view.header()->sortIndicatorSection(), 0); QCOMPARE(view.model()->data(view.model()->index(0,0)).toString(), QString::fromLatin1("a")); QCOMPARE(view.model()->data(view.model()->index(1,0)).toString(), QString::fromLatin1("b")); - } /* @@ -3272,5 +3272,32 @@ void tst_QTreeView::task246536_scrollbarsNotWorking() QVERIFY(o.count > 0); } +void tst_QTreeView::task254234_proxySort() +{ + //based on tst_QTreeView::sortByColumn + // it used not to work when setting the source of a proxy after enabling sorting + QTreeView view; + QStandardItemModel model(4,2); + model.setItem(0,0,new QStandardItem("b")); + model.setItem(1,0,new QStandardItem("d")); + model.setItem(2,0,new QStandardItem("c")); + model.setItem(3,0,new QStandardItem("a")); + model.setItem(0,1,new QStandardItem("e")); + model.setItem(1,1,new QStandardItem("g")); + model.setItem(2,1,new QStandardItem("h")); + model.setItem(3,1,new QStandardItem("f")); + + view.sortByColumn(1); + view.setSortingEnabled(true); + + QSortFilterProxyModel proxy; + proxy.setDynamicSortFilter(true); + view.setModel(&proxy); + proxy.setSourceModel(&model); + QCOMPARE(view.header()->sortIndicatorSection(), 1); + QCOMPARE(view.model()->data(view.model()->index(0,1)).toString(), QString::fromLatin1("h")); + QCOMPARE(view.model()->data(view.model()->index(1,1)).toString(), QString::fromLatin1("g")); +} + QTEST_MAIN(tst_QTreeView) #include "tst_qtreeview.moc" -- cgit v0.12 From a83bc9473e340cce2ff84c614a1d6b42ced9dfa2 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 26 May 2009 11:26:39 +0300 Subject: Disabled building two versions of same library in qlibrary autotest for Symbian, as version tests are disabled in Symbian anyway. --- tests/auto/qlibrary/qlibrary.pro | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/auto/qlibrary/qlibrary.pro b/tests/auto/qlibrary/qlibrary.pro index 9ba49ee..fd5790b 100644 --- a/tests/auto/qlibrary/qlibrary.pro +++ b/tests/auto/qlibrary/qlibrary.pro @@ -1,9 +1,16 @@ QT -= gui TEMPLATE = subdirs CONFIG += ordered -SUBDIRS = lib \ - lib2 \ - tst + +symbian: { +# Can't build two versions of lib with same name in symbian, so just build one +SUBDIRS = lib2 \ + tst +} else { +SUBDIRS = lib \ + lib2 \ + tst +} TARGET = tst_qlibrary # no special install rule for subdir -- cgit v0.12 From 86598234d8c055fe8dbc474d292619d453cc9f56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Tue, 26 May 2009 11:03:24 +0200 Subject: BT: Google suggest example not launching from the Qt Demo app. The example was installed in the wrong directory. Task-number: 254452 Reviewed-by: Kim --- examples/network/googlesuggest/googlesuggest.pro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/network/googlesuggest/googlesuggest.pro b/examples/network/googlesuggest/googlesuggest.pro index afd600f..33b79de 100644 --- a/examples/network/googlesuggest/googlesuggest.pro +++ b/examples/network/googlesuggest/googlesuggest.pro @@ -3,7 +3,7 @@ SOURCES = main.cpp searchbox.cpp googlesuggest.cpp HEADERS = searchbox.h googlesuggest.h # install -target.path = $$[QT_INSTALL_EXAMPLES]/webkit/googlesuggest +target.path = $$[QT_INSTALL_EXAMPLES]/network/googlesuggest sources.files = $$SOURCES $$HEADERS *.pro -sources.path = $$[QT_INSTALL_EXAMPLES]/webkit/googlesuggest +sources.path = $$[QT_INSTALL_EXAMPLES]/network/googlesuggest INSTALLS += target sources -- cgit v0.12 From 5f87463105f534cf357feba50f97c3f31ba7344f Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Tue, 26 May 2009 12:55:04 +0300 Subject: Fixed tst_QLocalSocket::processConnection test case for Symbian. --- tests/auto/qlocalsocket/lackey/lackey.pro | 2 +- tests/auto/qlocalsocket/test/test.pro | 3 ++- tests/auto/qlocalsocket/tst_qlocalsocket.cpp | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/auto/qlocalsocket/lackey/lackey.pro b/tests/auto/qlocalsocket/lackey/lackey.pro index 7460d8c..f073e7a 100644 --- a/tests/auto/qlocalsocket/lackey/lackey.pro +++ b/tests/auto/qlocalsocket/lackey/lackey.pro @@ -15,4 +15,4 @@ DEFINES += QLOCALSOCKET_DEBUG SOURCES += main.cpp TARGET = lackey - +symbian:TARGET.CAPABILITY = ALL -TCB \ No newline at end of file diff --git a/tests/auto/qlocalsocket/test/test.pro b/tests/auto/qlocalsocket/test/test.pro index c58bfee..b3f0a69 100644 --- a/tests/auto/qlocalsocket/test/test.pro +++ b/tests/auto/qlocalsocket/test/test.pro @@ -3,7 +3,7 @@ load(qttest_p4) DEFINES += QLOCALSERVER_DEBUG DEFINES += QLOCALSOCKET_DEBUG -symbian* { +symbian { # nothing } else:wince* { DEFINES += QT_LOCALSOCKET_TCP @@ -34,5 +34,6 @@ wince* | symbian* { scriptFiles.path = lackey/scripts DEPLOYMENT = additionalFiles scriptFiles QT += script # for easy deployment of QtScript + DEFINES += SYMBIAN_SRCDIR_UID=$$lower($$replace(TARGET.UID3,"0x","")) } diff --git a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp index b272716..97058d3 100644 --- a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp @@ -53,7 +53,9 @@ //TESTED_CLASS=QLocalServer, QLocalSocket //TESTED_FILES=network/socket/qlocalserver.cpp network/socket/qlocalsocket.cpp #ifdef Q_OS_SYMBIAN - #define SRCDIR "" + #define STRINGIFY(x) #x + #define TOSTRING(x) STRINGIFY(x) + #define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/" #endif Q_DECLARE_METATYPE(QLocalSocket::LocalSocketError) Q_DECLARE_METATYPE(QLocalSocket::LocalSocketState) -- cgit v0.12 From 72ecfb3eb9b65ed2617942510fa0c9af5075f209 Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Tue, 26 May 2009 12:03:13 +0200 Subject: Doc - more screenshots and adding better description Details: Work in progress --- doc/src/designer-manual.qdoc | 28 ++++++++++++++------------- doc/src/images/designer-choosing-form.png | Bin 38078 -> 39080 bytes doc/src/images/rgbController-arrangement.png | Bin 0 -> 10813 bytes 3 files changed, 15 insertions(+), 13 deletions(-) create mode 100644 doc/src/images/rgbController-arrangement.png diff --git a/doc/src/designer-manual.qdoc b/doc/src/designer-manual.qdoc index 03b74e6..77b208b 100644 --- a/doc/src/designer-manual.qdoc +++ b/doc/src/designer-manual.qdoc @@ -235,6 +235,7 @@ \page designer-to-know.html \contentspage {Qt Designer Manual}{Contents} + \title Getting to Know Qt Designer \tableofcontents @@ -408,6 +409,7 @@ \page designer-quick-start.html \contentspage {Qt Designer Manual}{Contents} + \title A Quick Start to Qt Designer Using \QD involves \bold four basic steps: @@ -419,16 +421,14 @@ \o Preview the form \endlist - \omit \image rgbController-screenshot.png - \endomit - Suppose you would like to design a small widget (see screenshot above) - that contains the controls needed to manipulate Red, Green and Blue (RGB) - values -- a type of widget that can be seen everywhere in image - manipulation programs. + Suppose you would like to design a small widget (see screenshot above) that + contains the controls needed to manipulate Red, Green and Blue (RGB) values + -- a type of widget that can be seen everywhere in image manipulation + programs. - \table + \table \row \i \inlineimage designer-choosing-form.png \i \bold{Choosing a Form} @@ -436,20 +436,22 @@ You start by choosing \gui Widget from the \gui{New Form} dialog. \endtable - Then you drag three labels, three spin boxes and three vertical sliders - on to your form. You can roughly arrange them according to how you would - like them to be laid out. + Then you drag three labels, three spin boxes and three vertical sliders on + to your form. To change the label's default text, simply double-click on + it. The screenshot below shows the form after all three labels have been + renamed. + + You can roughly arrange them according to how you would like them to be + laid out. - \omit \table \row \o \inlineimage rgbController-widgetBox.png \o \inlineimage rgbController-arrangement.png \endtable - \endomit To ensure that they are laid out exactly like this in your program, you need to place these widgets into a layout. We will do this in groups of - three. Select the "RED" label. Then, hold down \key Shift while you select + three. Select the "RED" label. Then, hold down \key Ctrl while you select its corresponding spin box and slider. In the \gui{Form} menu, select \gui{Lay Out in a Grid}. diff --git a/doc/src/images/designer-choosing-form.png b/doc/src/images/designer-choosing-form.png index fa6e470..bee4b29 100644 Binary files a/doc/src/images/designer-choosing-form.png and b/doc/src/images/designer-choosing-form.png differ diff --git a/doc/src/images/rgbController-arrangement.png b/doc/src/images/rgbController-arrangement.png new file mode 100644 index 0000000..d9e8bab Binary files /dev/null and b/doc/src/images/rgbController-arrangement.png differ -- cgit v0.12 From 57df8bc3ddd2bc5aaf5c25cf3e311fe56ad50ffb Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 26 May 2009 12:07:01 +0200 Subject: qdoc: Indicate what iterator_categor means for container classes. Task-number: 245501 --- doc/src/qset.qdoc | 9 +++++---- src/corelib/tools/qlistdata.cpp | 6 ++++-- src/corelib/tools/qmap.cpp | 6 ++++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/doc/src/qset.qdoc b/doc/src/qset.qdoc index afbedc3..6326219 100644 --- a/doc/src/qset.qdoc +++ b/doc/src/qset.qdoc @@ -685,11 +685,12 @@ */ /*! - \typedef QSet::iterator::iterator_category - \typedef QSet::const_iterator::iterator_category + \typedef QSet::iterator::iterator_category + \typedef QSet::const_iterator::iterator_category - \internal -*/ + Synonyms for \e {std::bidirectional_iterator_tag} indicating + these iterators are bidirectional iterators. + */ /*! \typedef QSet::iterator::difference_type diff --git a/src/corelib/tools/qlistdata.cpp b/src/corelib/tools/qlistdata.cpp index d40b6b6..34a5d80 100644 --- a/src/corelib/tools/qlistdata.cpp +++ b/src/corelib/tools/qlistdata.cpp @@ -1173,7 +1173,8 @@ void **QListData::erase(void **xi) /*! \typedef QList::iterator::iterator_category - \internal + A synonym for \e {std::random_access_iterator_tag} indicating + this iterator is a random access iterator. */ /*! \typedef QList::iterator::difference_type @@ -1432,7 +1433,8 @@ void **QListData::erase(void **xi) /*! \typedef QList::const_iterator::iterator_category - \internal + A synonym for \e {std::random_access_iterator_tag} indicating + this iterator is a random access iterator. */ /*! \typedef QList::const_iterator::difference_type diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp index 0699400..07df28d 100644 --- a/src/corelib/tools/qmap.cpp +++ b/src/corelib/tools/qmap.cpp @@ -902,7 +902,8 @@ void QMapData::dump() /*! \typedef QMap::iterator::iterator_category - \internal + A synonym for \e {std::bidirectional_iterator_tag} indicating + this iterator is a bidirectional iterator. */ /*! \typedef QMap::iterator::pointer @@ -1123,7 +1124,8 @@ void QMapData::dump() /*! \typedef QMap::const_iterator::iterator_category - \internal + A synonym for \e {std::bidirectional_iterator_tag} indicating + this iterator is a bidirectional iterator. */ /*! \typedef QMap::const_iterator::pointer -- cgit v0.12 From 337ffb38e35ca43e4119ac0634499b226137692e Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 26 May 2009 12:08:45 +0200 Subject: Doc: Removed irrelevant links from the Qt for Windows CE documentation. Reviewed-by: Maurice Kalinowski --- doc/src/topics.qdoc | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/src/topics.qdoc b/doc/src/topics.qdoc index 301f0d4..6ef3a89 100644 --- a/doc/src/topics.qdoc +++ b/doc/src/topics.qdoc @@ -286,11 +286,9 @@ including ARM, Intel x86, MIPS and SH-4. \o \l {Qt for Windows CE Requirements} \o \l {Installing Qt on Windows CE} \o \l {Windows CE - Introduction to using Qt}{Introduction to using Qt} - \o \l {Qt Examples#Qt for Embedded Linux}{Examples} \endlist \o \list - \o \l {Qt for Embedded Linux Classes}{Classes} \o \l {Windows CE - Using shadow builds}{Using shadow builds} \o \l {Windows CE - Working with Custom SDKs}{Working with Custom SDKs} \endlist -- cgit v0.12 From bd9a63d4aca1d78c76a884ee8ef71ba51260d623 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 26 May 2009 13:27:29 +0300 Subject: Made more space available for code section in QtGui library in symbian-sbsv2 builds. --- src/gui/gui.pro | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/gui.pro b/src/gui/gui.pro index d3b7388..30aaa51 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -42,4 +42,7 @@ QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtGui.dynlist DEFINES += Q_INTERNAL_QAPP_SRC -symbian:TARGET.UID3=0x2001B2DD \ No newline at end of file +symbian:TARGET.UID3=0x2001B2DD + +# ro-section in gui can exceed default allocated space, so more rw-section little further +symbian-sbsv2: MMP_RULES += "LINKEROPTION armcc --rw-base 0x800000" \ No newline at end of file -- cgit v0.12 From 3037e466ebf21aa4a47a722a1e2ff497690cbef5 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Tue, 26 May 2009 12:31:23 +0200 Subject: Fix a crash in Phonon::EffectWidget When creating a UI based on double types we only assigned the control pointer in certain cases. This would crash because the tooltip did not check for the pointer, but the real issue was that we didnt assign the control in the first place. Task-number: 249710 Reviewed-by: Richard Moe Gustavsen --- src/3rdparty/phonon/phonon/effectwidget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/phonon/phonon/effectwidget.cpp b/src/3rdparty/phonon/phonon/effectwidget.cpp index da5a51a..d5c6c81 100644 --- a/src/3rdparty/phonon/phonon/effectwidget.cpp +++ b/src/3rdparty/phonon/phonon/effectwidget.cpp @@ -165,6 +165,7 @@ void EffectWidgetPrivate::autogenerateUi() if (minValue == -1. && maxValue == 1.) { //Special case values between -1 and 1.0 to use a slider for improved usability QSlider *slider = new QSlider(Qt::Horizontal, q); + control = slider; slider->setRange(-SLIDER_RANGE, +SLIDER_RANGE); slider->setValue(int(SLIDER_RANGE * value.toDouble())); slider->setTickPosition(QSlider::TicksBelow); @@ -188,10 +189,10 @@ void EffectWidgetPrivate::autogenerateUi() break; } + if (control) { #ifndef QT_NO_TOOLTIP control->setToolTip(para.description()); #endif - if (control) { #ifndef QT_NO_SHORTCUT label->setBuddy(control); #endif -- cgit v0.12 From 54f92419b23b425e32ad573db17f608a67936df1 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Tue, 26 May 2009 12:40:02 +0200 Subject: Clearifying QWebFrame docs Adding docs to toHtml() and toPlainText() Task-number: 253088 Rev-by: Ariya Hidayat Rev-by: David Boddie --- src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp index 5dc6363..e565476 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp @@ -268,7 +268,7 @@ void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object } /*! - Returns the frame's content, converted to HTML. + Returns the frame's content as HTML, enclosed in HTML and BODY tags. \sa setHtml(), toPlainText() */ @@ -280,7 +280,8 @@ QString QWebFrame::toHtml() const } /*! - Returns the content of this frame converted to plain text. + Returns the content of this frame converted to plain text, completely + stripped of all HTML formatting. \sa toHtml() */ -- cgit v0.12 From f640eca34f63631f938817b1254d0caf92cc9143 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 26 May 2009 10:04:53 +0200 Subject: Carbon, QFontDialog::getFont() ignore the "initial" parameter Seems like no code was written to handle other font engines than CoreText. Unfortunatly the engine on Carbon is ATSUI. This patch adds general code for converting a QFont to an NSFont so the dialog can support other engines than CoreText Task-number: 251957 Reviewed-by: Trenton Schulz --- src/gui/dialogs/qfontdialog_mac.mm | 39 ++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/src/gui/dialogs/qfontdialog_mac.mm b/src/gui/dialogs/qfontdialog_mac.mm index 13f7149..3be53db 100644 --- a/src/gui/dialogs/qfontdialog_mac.mm +++ b/src/gui/dialogs/qfontdialog_mac.mm @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #import @@ -123,16 +124,16 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont) QFont newFont; if (cocoaFont) { int pSize = qRound([cocoaFont pointSize]); - QString family(QCFString::toQString(reinterpret_cast([cocoaFont familyName]))); - QString typeface(QCFString::toQString(reinterpret_cast([cocoaFont fontName]))); -// qDebug() << "original family" << family << "typeface" << typeface << "psize" << pSize; + QString family(qt_mac_NSStringToQString([cocoaFont familyName])); + QString typeface(qt_mac_NSStringToQString([cocoaFont fontName])); + int hyphenPos = typeface.indexOf(QLatin1Char('-')); if (hyphenPos != -1) { typeface.remove(0, hyphenPos + 1); } else { typeface = QLatin1String("Normal"); } -// qDebug() << " massaged family" << family << "typeface" << typeface << "psize" << pSize; + newFont = QFontDatabase().font(family, typeface, pSize); newFont.setUnderline(resolveFont.underline()); newFont.setStrikeOut(resolveFont.strikeOut()); @@ -598,15 +599,37 @@ QFont QFontDialogPrivate::execCocoaFontPanel(bool *ok, const QFont &initial, } } -void QFontDialogPrivate::setFont(void * delegate, const QFont &font) +void QFontDialogPrivate::setFont(void *delegate, const QFont &font) { + QMacCocoaAutoReleasePool pool; QFontEngine *fe = font.d->engineForScript(QUnicodeTables::Common); + NSFontManager *mgr = [NSFontManager sharedFontManager]; + NSFont *nsFont = 0; + #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 if (qstrcmp(fe->name(), "CoreText") == 0) { - const NSFont *nsFont = reinterpret_cast(static_cast(fe)->ctfont); - [[NSFontManager sharedFontManager] setSelectedFont:nsFont isMultiple:NO]; - } + nsFont = reinterpret_cast(static_cast(fe)->ctfont); + } else #endif + { + int weight = 5; + NSFontTraitMask mask = 0; + if (font.style() == QFont::StyleItalic) { + mask |= NSItalicFontMask; + } + if (font.weight() == QFont::Bold) { + weight = 9; + mask |= NSBoldFontMask; + } + + NSFontManager *mgr = [NSFontManager sharedFontManager]; + nsFont = [mgr fontWithFamily:qt_mac_QStringToNSString(font.family()) + traits:mask + weight:weight + size:font.pointSize()]; + } + + [mgr setSelectedFont:nsFont isMultiple:NO]; [static_cast(delegate) setQtFont:font]; } -- cgit v0.12 From c37c8370e4897d2e6191df2d1ccde43830ffb8d0 Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Tue, 26 May 2009 13:42:33 +0200 Subject: Doc - more screenshots and better description --- doc/src/designer-manual.qdoc | 35 ++++++++--------------- doc/src/images/rgbController-final-layout.png | Bin 0 -> 11275 bytes doc/src/images/rgbController-form-gridLayout.png | Bin 0 -> 11235 bytes doc/src/images/rgbController-selectForLayout.png | Bin 0 -> 20981 bytes 4 files changed, 12 insertions(+), 23 deletions(-) create mode 100644 doc/src/images/rgbController-final-layout.png create mode 100644 doc/src/images/rgbController-form-gridLayout.png create mode 100644 doc/src/images/rgbController-selectForLayout.png diff --git a/doc/src/designer-manual.qdoc b/doc/src/designer-manual.qdoc index 77b208b..452782f 100644 --- a/doc/src/designer-manual.qdoc +++ b/doc/src/designer-manual.qdoc @@ -436,41 +436,32 @@ You start by choosing \gui Widget from the \gui{New Form} dialog. \endtable - Then you drag three labels, three spin boxes and three vertical sliders on - to your form. To change the label's default text, simply double-click on - it. The screenshot below shows the form after all three labels have been - renamed. - - You can roughly arrange them according to how you would like them to be - laid out. \table - \row \o \inlineimage rgbController-widgetBox.png - \o \inlineimage rgbController-arrangement.png - \endtable + \row + \i \inlineimage rgbController-arrangement.png + \i \bold{Placing Widgets on a Form} + Drag three labels, three spin boxes and three vertical sliders on to your + form. To change the label's default text, simply double-click on it. You + can arrange them according to how you would like them to be laid out. + \endtable + To ensure that they are laid out exactly like this in your program, you need to place these widgets into a layout. We will do this in groups of three. Select the "RED" label. Then, hold down \key Ctrl while you select its corresponding spin box and slider. In the \gui{Form} menu, select \gui{Lay Out in a Grid}. - \omit \table \row \i \inlineimage rgbController-form-gridLayout.png \i \inlineimage rgbController-selectForLayout.png \endtable - \endomit Repeat the step for the other two labels along with their corresponding - spin boxes and sliders as well. Your form will now look similar to the - screenshot below. - - \omit - \image rgbController-almostLaidOut.png - \endomit + spin boxes and sliders as well. The next step is to combine all three layouts into one \bold{main layout}. It is important that your form has a main layout; otherwise, the widgets @@ -478,7 +469,9 @@ layout, \gui{Right click} anywhere on your form, outside of the three separate layouts, and select \gui{Lay Out Horizontally}. Alternatively, you could also select \gui{Lay Out in a Grid} -- you will still see the same - arrangement. + arrangement (shown below). + + \image rgbController-final-layout.png \note Main layouts cannot be seen on the form. To check if you have a main layout installed, try resizing your form; your widgets should resize @@ -495,7 +488,6 @@ pressing \key{F4} or something \gui{Edit Signals/Slots} from the \gui{Edit} menu. - \omit \table \row \i \inlineimage rgbController-signalsAndSlots.png @@ -505,11 +497,8 @@ \gui{Configure Connection} dialog, shown below, will pop up. Select the correct signal and slot and click \gui OK. \endtable - \endomit - \omit \image rgbController-configureConnection.png - \endomit Repeat the step (in reverse order), clicking on the spin box and dragging the cursor towards the slider, to connect the spin box's diff --git a/doc/src/images/rgbController-final-layout.png b/doc/src/images/rgbController-final-layout.png new file mode 100644 index 0000000..d32a93e Binary files /dev/null and b/doc/src/images/rgbController-final-layout.png differ diff --git a/doc/src/images/rgbController-form-gridLayout.png b/doc/src/images/rgbController-form-gridLayout.png new file mode 100644 index 0000000..c8f3dcf Binary files /dev/null and b/doc/src/images/rgbController-form-gridLayout.png differ diff --git a/doc/src/images/rgbController-selectForLayout.png b/doc/src/images/rgbController-selectForLayout.png new file mode 100644 index 0000000..7a8e184 Binary files /dev/null and b/doc/src/images/rgbController-selectForLayout.png differ -- cgit v0.12 From aec18b0eea741da58a02f7ad95ab5ee9dccfce6c Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Tue, 26 May 2009 13:44:35 +0200 Subject: Doc - whitespace cleaning --- doc/src/designer-manual.qdoc | 48 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/doc/src/designer-manual.qdoc b/doc/src/designer-manual.qdoc index 452782f..9c13d79 100644 --- a/doc/src/designer-manual.qdoc +++ b/doc/src/designer-manual.qdoc @@ -299,12 +299,12 @@ \row \i \inlineimage designer-widget-box.png \i \bold{Qt Designer's Widget Box} - + The widget box provides a selection of standard Qt widgets, layouts, and other objects that can be used to create user interfaces on forms. Each of the categories in the widget box contain widgets with similar uses or related features. - + \note Since Qt 4.4, new widgets have been included, e.g., QPlainTextEdit, QCommandLinkButton, QScrollArea, QMdiArea, and QWebView. @@ -358,7 +358,7 @@ using a grid. The coordinates on the screenshot show the position of each widget within the grid. - \image addressbook-tutorial-part3-labeled-layout.png + \image addressbook-tutorial-part3-labeled-layout.png \note Inside the grid, the QPushButton objects are actually nested. The buttons on the right are first placed in a QVBoxLayout; the buttons at the @@ -367,7 +367,7 @@ To visualize, imagine the layout as a box that shrinks as much as possible, attempting to \e squeeze your widgets in a neat arrangement, and, at the - same time, maximize the use of available space. + same time, maximize the use of available space. Qt's layouts help when you: @@ -446,7 +446,7 @@ form. To change the label's default text, simply double-click on it. You can arrange them according to how you would like them to be laid out. \endtable - + To ensure that they are laid out exactly like this in your program, you need to place these widgets into a layout. We will do this in groups of three. Select the "RED" label. Then, hold down \key Ctrl while you select @@ -779,11 +779,11 @@ have a \c text property that can also be edited by double-clicking on the widget or by pressing \gui F2. \QD interprets the backslash (\\) character specially, enabling newline (\\n) characters to be - inserted into the text; the \\\\ character sequence is used to + inserted into the text; the \\\\ character sequence is used to insert a single backslash into the text. A context menu can also be opened while editing, providing another way to insert special characters and newlines into the text. - \endlist + \endlist \section2 Dynamic Properties @@ -795,12 +795,12 @@ \image designer-property-editor-toolbar.png - To add a dynamic property, clcik on the \gui Add button + To add a dynamic property, clcik on the \gui Add button \inlineimage designer-property-editor-add-dynamic.png - . To remove it, click on the \gui Remove button + . To remove it, click on the \gui Remove button \inlineimage designer-property-editor-remove-dynamic.png instead. You can also sort the properties alphabetically and change the - color groups by clickinig on the \gui Configure button + color groups by clickinig on the \gui Configure button \inlineimage designer-property-editor-configure.png . @@ -902,7 +902,7 @@ \section2 Horizontal and Vertical Layouts - + The simplest way to arrange objects on a form is to place them in a horizontal or vertical layout. Horizontal layouts ensure that the widgets within are aligned horizontally; vertical layouts ensure that they are @@ -1129,7 +1129,7 @@ spacers just provide spacing hints to layouts, so they cannot be connected to other objects. - + \target HighlightedObjects \table \row @@ -1168,7 +1168,7 @@ \image designer-connection-dialog.png - To complete the connection, select a signal from the source object and a + To complete the connection, select a signal from the source object and a slot from the destination object, then click \key OK. Click \key Cancel if you wish to abandon the connection. @@ -1711,22 +1711,22 @@ \i \bold{Resource Files} Within the resource browser, you can open existing resource files or - create new ones. Click the \gui{Edit Resources} button + create new ones. Click the \gui{Edit Resources} button \inlineimage designer-edit-resources-button.png to edit your resources. To reload resources, click on the \gui Reload - button + button \inlineimage designer-reload-resources-button.png . \endtable Once a resource file is loaded, you can create or remove entries in it - using the given \gui{Add Files} - \inlineimage designer-add-resource-entry-button.png - and \gui{Remove Files} + using the given \gui{Add Files} + \inlineimage designer-add-resource-entry-button.png + and \gui{Remove Files} \inlineimage designer-remove-resource-entry-button.png buttons, and specify resources (e.g., images) using the \gui{Add Files} - button + button \inlineimage designer-add-files-button.png . Note that these resources must reside within the current resource file's directory or one of its subdirectories. @@ -1738,15 +1738,15 @@ \i \inlineimage designer-edit-resource.png \i \bold{Editing Resource Files} - Press the + Press the \inlineimage designer-add-resource-entry-button.png button to add a new resource entry to the file. Then use the - \gui{Add Files} button + \gui{Add Files} button \inlineimage designer-add-files-button.png to specify the resource. You can remove resources by selecting the corresponding entry in the - resource editor, and pressing the + resource editor, and pressing the \inlineimage designer-remove-resource-entry-button.png button. \endtable @@ -2554,7 +2554,7 @@ pixmap property in the property editor. QDesignerTaskMenuExtension is useful for custom widgets. It provides an extension that allows you to add custom menu entries to \QD's task menu. - + The \l{designer/taskmenuextension}{Task Menu Extension} example illustrates how to use this class. @@ -2655,7 +2655,7 @@ pixmap property in the property editor. function, making it able to create your extension, such as a \l{designer/containerextension}{MultiPageWidget} container extension. - You can either create a new QExtensionFactory and reimplement the + You can either create a new QExtensionFactory and reimplement the QExtensionFactory::createExtension() function: \snippet doc/src/snippets/code/doc_src_designer-manual.qdoc 8 -- cgit v0.12 From 946d6a6b5ce2348384be64f9573c06369aed16b5 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 26 May 2009 15:03:36 +0300 Subject: Reduced number of processes in one qprocess test case to avoid running out of process handles. --- tests/auto/qprocess/tst_qprocess.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/auto/qprocess/tst_qprocess.cpp b/tests/auto/qprocess/tst_qprocess.cpp index 2610af9..8101708 100644 --- a/tests/auto/qprocess/tst_qprocess.cpp +++ b/tests/auto/qprocess/tst_qprocess.cpp @@ -1623,12 +1623,10 @@ void tst_QProcess::spaceArgsTest() //----------------------------------------------------------------------------- void tst_QProcess::exitCodeTest() { -#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86) - // WINSCW builds in Symbian panic somewhere deep inside Symbian codes - // when eventdispather is deleted if too many test iterations are used. - // Reason for this is unclear. - // TODO: Remove special case when eventdispatcher is fixed. - for (int i = 0; i < 25; ++i) { +#if defined(Q_OS_SYMBIAN) + // Kernel will run out of process handles on some hw, as there is some + // delay before they are recycled, so limit the amount of processes. + for (int i = 0; i < 50; ++i) { #else for (int i = 0; i < 255; ++i) { #endif -- cgit v0.12 From 2c8348f5ccf62be31479dcd78282395a98eed76f Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 26 May 2009 14:13:21 +0200 Subject: BT: opening datetimepicker in a cell in spreadsheet demo resets the date That was a bug in the exemple. Reviewed-by: Kavindra Palaraja --- demos/spreadsheet/spreadsheetdelegate.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/demos/spreadsheet/spreadsheetdelegate.cpp b/demos/spreadsheet/spreadsheetdelegate.cpp index 465c92f..2916757 100644 --- a/demos/spreadsheet/spreadsheetdelegate.cpp +++ b/demos/spreadsheet/spreadsheetdelegate.cpp @@ -51,7 +51,7 @@ QWidget *SpreadSheetDelegate::createEditor(QWidget *parent, { if (index.column() == 1) { QDateTimeEdit *editor = new QDateTimeEdit(parent); - editor->setDisplayFormat("dd/M/yyy"); + editor->setDisplayFormat("dd/M/yyyy"); editor->setCalendarPopup(true); return editor; } @@ -93,7 +93,7 @@ void SpreadSheetDelegate::setEditorData(QWidget *editor, if (dateEditor) { dateEditor->setDate(QDate::fromString( index.model()->data(index, Qt::EditRole).toString(), - "d/M/yy")); + "d/M/yyyy")); } } } @@ -107,7 +107,7 @@ void SpreadSheetDelegate::setModelData(QWidget *editor, } else { QDateTimeEdit *dateEditor = qobject_cast(editor); if (dateEditor) { - model->setData(index, dateEditor->date().toString("dd/M/yyy")); + model->setData(index, dateEditor->date().toString("dd/M/yyyy")); } } } -- cgit v0.12 From 1536b02ed1633555e306bec02398a2a7c1bdabf7 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 26 May 2009 14:19:27 +0200 Subject: Test for QDate::fromDate with string format. Note that two digit years are always in the year 19xx This is excepted for compatibility reason as discussed with Peter --- tests/auto/qdate/tst_qdate.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/auto/qdate/tst_qdate.cpp b/tests/auto/qdate/tst_qdate.cpp index d4273d0..4d6c80c 100644 --- a/tests/auto/qdate/tst_qdate.cpp +++ b/tests/auto/qdate/tst_qdate.cpp @@ -82,6 +82,8 @@ private slots: void operator_gt_eq(); void fromString_data(); void fromString(); + void fromString_format_data(); + void fromString_format(); void toString_format_data(); void toString_format(); void isLeapYear(); @@ -618,6 +620,30 @@ void tst_QDate::fromString() QCOMPARE( QDate::fromString( str2, Qt::ISODate ), d1 ); } +void tst_QDate::fromString_format_data() +{ + QTest::addColumn("string"); + QTest::addColumn("format"); + QTest::addColumn("date"); + + //year with yy is always 19xx for compatibility + QTest::newRow( "data0" ) << QString("21052006") << QString("ddMMyyyy") << QDate(2006,5,21); + QTest::newRow( "data1" ) << QString("210506") << QString("ddMMyy") << QDate(1906,5,21); + QTest::newRow( "data2" ) << QString("21/5/2006") << QString("d/M/yyyy") << QDate(2006,5,21); + QTest::newRow( "data3" ) << QString("21/5/06") << QString("d/M/yy") << QDate(1906,5,21); + QTest::newRow( "data4" ) << QString("20060521") << QString("yyyyMMdd") << QDate(2006,5,21); + QTest::newRow( "data5" ) << QString("060521") << QString("yyMMdd") << QDate(1906,5,21); +} + +void tst_QDate::fromString_format() +{ + QFETCH( QString, string ); + QFETCH( QString, format ); + QFETCH( QDate, date ); + + QCOMPARE( QDate::fromString( string, format ), date ); +} + void tst_QDate::toString_format_data() { QTest::addColumn("t"); -- cgit v0.12 From 8a2ca9b0d8ed23cec44e40f61c0f4983fbc55282 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Tue, 26 May 2009 14:06:56 +0200 Subject: Correcting bugs in classic.css Correcting invalid padding values. none is not a valid padding value. Rev-by: David Boddie --- tools/qdoc3/test/classic.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/qdoc3/test/classic.css b/tools/qdoc3/test/classic.css index 6cf7377..f22a77a 100644 --- a/tools/qdoc3/test/classic.css +++ b/tools/qdoc3/test/classic.css @@ -77,10 +77,10 @@ table.annotated td { table tr pre { - padding-top: none; - padding-bottom: none; - padding-left: none; - padding-right: none; + padding-top: 0px; + padding-bottom: 0px; + padding-left: 0px; + padding-right: 0px; border: none; background: none } -- cgit v0.12 From 871b730da203cef773e159960532888522f16a0b Mon Sep 17 00:00:00 2001 From: Trond Kjernaasen Date: Tue, 26 May 2009 14:20:34 +0200 Subject: BT: Fixed GL textdrawing in the Boxes demo. Reworked the 85f98acaa3a38079071bea711e43c9a86edec1f6 fix, since it broke glyph positioning in the GL engine under Windows. Instead of changing the glyph cache margin, which impacts where the glyph is positioned, we just make the image the glyph is drawn into 4 pixels bigger in width/heigth. The margin in QImageTextureGlyphCache needs to be reworked.. Task-number: 254450 Reviewed-by: Eskil --- src/gui/painting/qtextureglyphcache.cpp | 8 ++++++-- src/gui/text/qfontengine_win.cpp | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index 3fd1ffb..89df869 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -92,8 +92,8 @@ void QTextureGlyphCache::populate(const QTextItemInt &ti, int glyph_height = metrics.height.ceil().toInt(); if (glyph_height == 0 || glyph_width == 0) continue; - glyph_width += margin * 2 + 2; - glyph_height += margin * 2 + 2; + glyph_width += margin * 2 + 4; + glyph_height += margin * 2 + 4; // align to 8-bit boundary if (m_type == QFontEngineGlyphCache::Raster_Mono) glyph_width = (glyph_width+7)&~7; @@ -189,7 +189,11 @@ void QImageTextureGlyphCache::createTextureData(int width, int height) int QImageTextureGlyphCache::glyphMargin() const { +#ifdef Q_WS_MAC return 2; +#else + return m_type == QFontEngineGlyphCache::Raster_RGBMask ? 2 : 0; +#endif } void QImageTextureGlyphCache::fillTexture(const Coord &c, glyph_t g) diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp index bf3a176..7341665 100644 --- a/src/gui/text/qfontengine_win.cpp +++ b/src/gui/text/qfontengine_win.cpp @@ -1406,8 +1406,8 @@ QNativeImage *QFontEngineWin::drawGDIGlyph(HFONT font, glyph_t glyph, int margin #endif #endif - QNativeImage *ni = new QNativeImage(iw + 2 * margin + 2, - ih + 2 * margin + 2, + QNativeImage *ni = new QNativeImage(iw + 2 * margin + 4, + ih + 2 * margin + 4, QNativeImage::systemFormat(), true); ni->image.fill(0xffffffff); @@ -1449,7 +1449,7 @@ QImage QFontEngineWin::alphaMapForGlyph(glyph_t glyph, const QTransform &xform) font = CreateFontIndirectW(&lf); } - QNativeImage *mask = drawGDIGlyph(font, glyph, 2, xform); + QNativeImage *mask = drawGDIGlyph(font, glyph, 0, xform); if (mask == 0) return QImage(); -- cgit v0.12 From 62743959699d78a63057e98b43fe3c79ace87234 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Tue, 26 May 2009 14:32:50 +0200 Subject: Implemented popandPush method. This is needed to optimize popping and pushing. This avoid unnecessary screen redraw and setting of native softkeys. One such case occurs when focused widge changes. --- src/gui/widgets/qsoftkeystack.cpp | 54 ++++++++++++++++++++++++++++++++++++--- src/gui/widgets/qsoftkeystack.h | 2 ++ src/gui/widgets/qsoftkeystack_p.h | 2 ++ 3 files changed, 55 insertions(+), 3 deletions(-) diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index 05fe397..a7fa3f1 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -44,6 +44,22 @@ #include "qapplication.h" #include "qmainwindow.h" +static bool isSame(const QSoftkeySet& a, const QSoftkeySet& b) +{ + bool isSame=true; + if ( a.count() != b.count()) + return false; + int index=0; + while (indexrole() != b.at(index)->role()) + return false; + if (a.at(index)->text().compare(b.at(index)->text())!=0) + return false; + index++; + } + return true; +} + QSoftKeyStackPrivate::QSoftKeyStackPrivate() { @@ -75,6 +91,25 @@ void QSoftKeyStackPrivate::pop() setNativeSoftKeys(); } +void QSoftKeyStackPrivate::popandPush(QSoftKeyAction *softKey) +{ + QSoftkeySet oldSoftKeySet = softKeyStack.pop(); + QSoftkeySet newSoftKeySet; + newSoftKeySet.append(newSoftKeySet); + softKeyStack.push(newSoftKeySet); + if( !isSame(oldSoftKeySet, newSoftKeySet)) + setNativeSoftKeys(); +} + +void QSoftKeyStackPrivate::popandPush(const QList &softkeys) +{ + QSoftkeySet oldSoftKeySet = softKeyStack.pop(); + QSoftkeySet newSoftKeySet(softkeys); + softKeyStack.push(newSoftKeySet); + if( !isSame(oldSoftKeySet, newSoftKeySet)) + setNativeSoftKeys(); +} + const QSoftkeySet& QSoftKeyStackPrivate::top() { return softKeyStack.top(); @@ -108,6 +143,18 @@ void QSoftKeyStack::pop() d->pop(); } +void QSoftKeyStack::popandPush(QSoftKeyAction *softKey) +{ + Q_D(QSoftKeyStack); + d->popandPush(softKey); +} + +void QSoftKeyStack::popandPush(const QList &softkeys) +{ + Q_D(QSoftKeyStack); + d->popandPush(softkeys); +} + const QSoftkeySet& QSoftKeyStack::top() { Q_D(QSoftKeyStack); @@ -123,8 +170,6 @@ void QSoftKeyStack::handleFocusChanged(QWidget *old, QWidget *now) if( !mainWindow) return; QSoftKeyStack* softKeyStack = mainWindow->softKeyStack(); - if (old) - softKeyStack->pop(); Qt::ContextMenuPolicy policy = now->contextMenuPolicy(); if (policy != Qt::NoContextMenu && policy != Qt::PreventContextMenu ) { @@ -133,7 +178,10 @@ void QSoftKeyStack::handleFocusChanged(QWidget *old, QWidget *now) QSoftKeyAction* contextMenu = new QSoftKeyAction(QSoftKeyAction::ContextMenu, QString::fromLatin1("ContextMenu"), now); actionList.append(menu); actionList.append(contextMenu); - softKeyStack->push(actionList); + if (old) + softKeyStack->popandPush(actionList); + else + softKeyStack->push(actionList); } } diff --git a/src/gui/widgets/qsoftkeystack.h b/src/gui/widgets/qsoftkeystack.h index 2a63ab8..10d9153 100644 --- a/src/gui/widgets/qsoftkeystack.h +++ b/src/gui/widgets/qsoftkeystack.h @@ -66,6 +66,8 @@ public: void push(QSoftKeyAction *softKey); void push(const QList &softkeys); void pop(); + void popandPush(QSoftKeyAction *softKey); + void popandPush(const QList &softkeys); const QSoftkeySet& top(); void handleSoftKeyPress(int command); diff --git a/src/gui/widgets/qsoftkeystack_p.h b/src/gui/widgets/qsoftkeystack_p.h index 2469648..57475bd 100644 --- a/src/gui/widgets/qsoftkeystack_p.h +++ b/src/gui/widgets/qsoftkeystack_p.h @@ -77,6 +77,8 @@ public: void push(QSoftKeyAction *softKey); void push(const QList &softKeys); void pop(); + void popandPush(QSoftKeyAction *softKey); + void popandPush(const QList &softkeys); const QSoftkeySet& top(); void handleSoftKeyPress(int command); -- cgit v0.12 From c17f27a9a14c353c6149f2c15f6a0ff6afe3dedd Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Tue, 26 May 2009 13:22:00 +0200 Subject: SSL: Remove broken system certificate loading code Task-number: 254365 Reviewed-by: Peter Hartmann --- src/network/ssl/qsslsocket_openssl.cpp | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index 6f8cf42..cb101af 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -482,30 +482,7 @@ void QSslSocketPrivate::resetDefaultCiphers() QList QSslSocketPrivate::systemCaCertificates() { -#ifdef QQ_OS_UNIX - // Check known locations for the system's default bundle. ### On Windows, - // we should use CAPI to find the bundle, and not rely on default unix - // locations. - const char *standardLocations[] = {"/etc/ssl/certs/", -#if 0 - // KDE uses KConfig for its SSL store, - // but it also stores the bundle at - // this location - "$HOME/.kde/share/apps/kssl/ca-bundle.crt", -#endif - 0}; - const char **it = standardLocations; - QStringList nameFilter; - nameFilter << QLatin1String("*.pem") << QLatin1String("*.crt"); - while (*it) { - if (QDirIterator(QLatin1String(*it), nameFilter).hasNext()) - return certificatesFromPath(QLatin1String(*it)); - ++it; - } -#endif - - // Qt provides a default bundle when we cannot detect the system's default - // bundle. + // Qt provides a default bundle of certificates QFile caBundle(QLatin1String(":/trolltech/network/ssl/qt-ca-bundle.crt")); if (caBundle.open(QIODevice::ReadOnly | QIODevice::Text)) return QSslCertificate::fromDevice(&caBundle); -- cgit v0.12 From ba552dae4daab3db8596e20f8491393e4479e7b0 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Tue, 26 May 2009 14:40:36 +0200 Subject: Added method isEmpty() to interface. This can be used to query if stack actually has any items in it --- src/gui/widgets/qsoftkeystack.cpp | 11 +++++++++++ src/gui/widgets/qsoftkeystack.h | 1 + src/gui/widgets/qsoftkeystack_p.h | 1 + 3 files changed, 13 insertions(+) diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index a7fa3f1..0054c6b 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -115,6 +115,11 @@ const QSoftkeySet& QSoftKeyStackPrivate::top() return softKeyStack.top(); } +bool QSoftKeyStackPrivate::isEmpty() +{ + return softKeyStack.isEmpty(); +} + QSoftKeyStack::QSoftKeyStack(QWidget *parent) : QObject(*new QSoftKeyStackPrivate, parent) { @@ -161,6 +166,12 @@ const QSoftkeySet& QSoftKeyStack::top() return d->top(); } +bool QSoftKeyStack::isEmpty() +{ + Q_D(QSoftKeyStack); + return d->isEmpty(); +} + void QSoftKeyStack::handleFocusChanged(QWidget *old, QWidget *now) { if (!now) diff --git a/src/gui/widgets/qsoftkeystack.h b/src/gui/widgets/qsoftkeystack.h index 10d9153..2606bd1 100644 --- a/src/gui/widgets/qsoftkeystack.h +++ b/src/gui/widgets/qsoftkeystack.h @@ -69,6 +69,7 @@ public: void popandPush(QSoftKeyAction *softKey); void popandPush(const QList &softkeys); const QSoftkeySet& top(); + bool isEmpty(); void handleSoftKeyPress(int command); diff --git a/src/gui/widgets/qsoftkeystack_p.h b/src/gui/widgets/qsoftkeystack_p.h index 57475bd..b698178 100644 --- a/src/gui/widgets/qsoftkeystack_p.h +++ b/src/gui/widgets/qsoftkeystack_p.h @@ -80,6 +80,7 @@ public: void popandPush(QSoftKeyAction *softKey); void popandPush(const QList &softkeys); const QSoftkeySet& top(); + bool isEmpty(); void handleSoftKeyPress(int command); private: -- cgit v0.12 From a86927b9463d15893d45c11af912b70383c4ee2d Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Tue, 26 May 2009 14:41:14 +0200 Subject: Fixed crash when building menu while softkeystack is empty --- src/gui/widgets/qmenu_symbian.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index 1cff1bf..491c78e 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -185,20 +185,21 @@ static void rebuildMenu() QWidget *w = qApp->activeWindow(); QMainWindow *mainWindow = qobject_cast(w); QSoftKeyStack* softKeyStack = mainWindow->softKeyStack(); - const QSoftkeySet& softKeyTop = softKeyStack->top(); - - int index=0; - bool found=false; - while( indexrole(); - if(softAction->role() == QSoftKeyAction::ContextMenu) { - widgetWithContextMenu = softAction->parentWidget(); - found=true; - } - index++; + if (!softKeyStack->isEmpty()) { + const QSoftkeySet& softKeyTop = softKeyStack->top(); + int index=0; + bool found=false; + while( indexrole(); + if(softAction->role() == QSoftKeyAction::ContextMenu) { + widgetWithContextMenu = softAction->parentWidget(); + found=true; + } + index++; + } } - + if (w) { mb = menubars()->value(w); qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM; -- cgit v0.12 From 7c383fc79510276439deeb706d48ad5543fb54e7 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Tue, 26 May 2009 14:46:15 +0200 Subject: Fix a painting issue in the QGtkStyle statusbar We should use the "statusbar" string when we draw the sizegrip. Since gtkstatusbar is the only gtk widget using the paint_resize_grip and it uses the "statusbar" string itself it should be safe to assume this. Task-number: 254535 Reviewed-by: rosch --- src/gui/styles/qgtkstyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index 86653df..14be518 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -2344,7 +2344,7 @@ void QGtkStyle::drawControl(ControlElement element, case CE_SizeGrip: { GtkWidget *gtkStatusbar = QGtk::gtkWidget(QLS("GtkStatusbar.GtkFrame")); QRect gripRect = option->rect.adjusted(0, 0, -gtkStatusbar->style->xthickness, -gtkStatusbar->style->ythickness); - gtkPainter.paintResizeGrip( gtkStatusbar, "window", gripRect, GTK_STATE_NORMAL, + gtkPainter.paintResizeGrip( gtkStatusbar, "statusbar", gripRect, GTK_STATE_NORMAL, GTK_SHADOW_OUT, QApplication::isRightToLeft() ? GDK_WINDOW_EDGE_SOUTH_WEST : GDK_WINDOW_EDGE_SOUTH_EAST, gtkStatusbar->style); -- cgit v0.12 From 1164e61393349fc3d6bf06d0789fa6ea2cfb5909 Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Tue, 26 May 2009 15:37:45 +0200 Subject: Doc - more images and additional description --- doc/src/designer-manual.qdoc | 24 +++++++++++---------- .../images/rgbController-configure-connection1.png | Bin 0 -> 29210 bytes .../images/rgbController-configure-connection2.png | Bin 0 -> 28655 bytes doc/src/images/rgbController-property-editing.png | Bin 0 -> 9158 bytes doc/src/images/rgbController-screenshot.png | Bin 0 -> 8995 bytes doc/src/images/rgbController-signalsAndSlots.png | Bin 0 -> 10050 bytes 6 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 doc/src/images/rgbController-configure-connection1.png create mode 100644 doc/src/images/rgbController-configure-connection2.png create mode 100644 doc/src/images/rgbController-property-editing.png create mode 100644 doc/src/images/rgbController-screenshot.png create mode 100644 doc/src/images/rgbController-signalsAndSlots.png diff --git a/doc/src/designer-manual.qdoc b/doc/src/designer-manual.qdoc index 9c13d79..58d0f71 100644 --- a/doc/src/designer-manual.qdoc +++ b/doc/src/designer-manual.qdoc @@ -478,11 +478,12 @@ accordingly. When you click on the slider and drag it to a certain value, you want the - spin box to display the slider's position. To do this, you need to connect - the slider's \l{QAbstractSlider::}{valueChanged()} signal to the spin box's - \l{QSpinBox::}{setValue()} slot. You also need to make the reverse - connections, e.g., connect the spin box's \l{QSpinBox::}{valueChanged()} - signal to the slider's \l{QAbstractSlider::value()}{setValue()} slot. + spin box to display the slider's position. To accomplish this behavior, you + need to connect the slider's \l{QAbstractSlider::}{valueChanged()} signal + to the spin box's \l{QSpinBox::}{setValue()} slot. You also need to make + the reverse connections, e.g., connect the spin box's \l{QSpinBox::} + {valueChanged()} signal to the slider's \l{QAbstractSlider::value()} + {setValue()} slot. To do this, you have to switch to \gui{Edit Signals/Slots} mode, either by pressing \key{F4} or something \gui{Edit Signals/Slots} from the \gui{Edit} @@ -498,13 +499,18 @@ correct signal and slot and click \gui OK. \endtable - \image rgbController-configureConnection.png + \image rgbController-configureConnection1.png Repeat the step (in reverse order), clicking on the spin box and dragging the cursor towards the slider, to connect the spin box's \l{QSpinBox::}{valueChanged()} signal to the slider's \l{QAbstractSlider::value()}{setValue()} slot. + You can use the screenshot below as a guide to selecting the correct signal + and slot. + + \image rgbController-configure-connection2.png + Now that you have successfully connected the objects for the "RED" component of the RGB Controller, do the same for the "GREEN" and "BLUE" components as well. @@ -512,7 +518,6 @@ Since RGB values range between 0 and 255, we need to limit the spin box and slider to that particular range. - \omit \table \row \i \inlineimage rgbController-property-editing.png @@ -523,17 +528,14 @@ \l{QSpinBox::}{maximum} property. Then, click on the first vertical slider, you will see \l{QAbstractSlider}'s properties. Enter "255" for the \l{QAbstractSlider::}{maximum} property as well. Repeat this - process for the remaining spin boxes and sliders. + process for the remaining spin boxes and sliders. \endtable - \endomit Now, we preview your form to see how it would look in your application. To preview your form, press \key{Ctrl + R} or select \gui Preview from the \gui Form menu. - \omit \image rgbController-preview.png - \endomit Try dragging the slider - the spin box will mirror its value too (and vice versa). Also, you can resize it to see how the layouts used to manage the diff --git a/doc/src/images/rgbController-configure-connection1.png b/doc/src/images/rgbController-configure-connection1.png new file mode 100644 index 0000000..0798184 Binary files /dev/null and b/doc/src/images/rgbController-configure-connection1.png differ diff --git a/doc/src/images/rgbController-configure-connection2.png b/doc/src/images/rgbController-configure-connection2.png new file mode 100644 index 0000000..f3fcc62 Binary files /dev/null and b/doc/src/images/rgbController-configure-connection2.png differ diff --git a/doc/src/images/rgbController-property-editing.png b/doc/src/images/rgbController-property-editing.png new file mode 100644 index 0000000..64fc500 Binary files /dev/null and b/doc/src/images/rgbController-property-editing.png differ diff --git a/doc/src/images/rgbController-screenshot.png b/doc/src/images/rgbController-screenshot.png new file mode 100644 index 0000000..6019233 Binary files /dev/null and b/doc/src/images/rgbController-screenshot.png differ diff --git a/doc/src/images/rgbController-signalsAndSlots.png b/doc/src/images/rgbController-signalsAndSlots.png new file mode 100644 index 0000000..2ba3aba Binary files /dev/null and b/doc/src/images/rgbController-signalsAndSlots.png differ -- cgit v0.12 From f2b486bfc332ecfe37831ef9468b953acfab2b45 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 26 May 2009 16:39:52 +0300 Subject: Increased few timeouts in qtimer test to compensate for delays caused by Symbian emulator startup. --- tests/auto/qtimer/tst_qtimer.cpp | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/tests/auto/qtimer/tst_qtimer.cpp b/tests/auto/qtimer/tst_qtimer.cpp index 0051a9b..694ea33 100644 --- a/tests/auto/qtimer/tst_qtimer.cpp +++ b/tests/auto/qtimer/tst_qtimer.cpp @@ -146,6 +146,13 @@ void tst_QTimer::singleShotTimeout() QCOMPARE(helper.count, 1); } +#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86) +// Increase wait as emulator startup can cause unexpected delays +#define TIMEOUT_TIMEOUT 2000 +#else +#define TIMEOUT_TIMEOUT 200 +#endif + void tst_QTimer::timeout() { TimerHelper helper; @@ -156,11 +163,11 @@ void tst_QTimer::timeout() QCOMPARE(helper.count, 0); - QTest::qWait(200); + QTest::qWait(TIMEOUT_TIMEOUT); QVERIFY(helper.count > 0); int oldCount = helper.count; - QTest::qWait(200); + QTest::qWait(TIMEOUT_TIMEOUT); QVERIFY(helper.count > oldCount); } @@ -391,29 +398,38 @@ void tst_QTimer::deleteLaterOnQTimer() QVERIFY(pointer.isNull()); } +#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86) +// Increase wait as emulator startup can cause unexpected delays +#define MOVETOTHREAD_TIMEOUT 200 +#define MOVETOTHREAD_WAIT 5000 +#else +#define MOVETOTHREAD_TIMEOUT 200 +#define MOVETOTHREAD_WAIT 300 +#endif + void tst_QTimer::moveToThread() { QTimer ti1; QTimer ti2; - ti1.start(200); - ti2.start(200); + ti1.start(MOVETOTHREAD_TIMEOUT); + ti2.start(MOVETOTHREAD_TIMEOUT); QVERIFY((ti1.timerId() & 0xffffff) != (ti2.timerId() & 0xffffff)); QThread tr; ti1.moveToThread(&tr); connect(&ti1,SIGNAL(timeout()), &tr, SLOT(quit())); tr.start(); QTimer ti3; - ti3.start(200); + ti3.start(MOVETOTHREAD_TIMEOUT); QVERIFY((ti3.timerId() & 0xffffff) != (ti2.timerId() & 0xffffff)); QVERIFY((ti3.timerId() & 0xffffff) != (ti1.timerId() & 0xffffff)); - QTest::qWait(300); + QTest::qWait(MOVETOTHREAD_WAIT); QVERIFY(tr.wait()); ti2.stop(); QTimer ti4; - ti4.start(200); + ti4.start(MOVETOTHREAD_TIMEOUT); ti3.stop(); - ti2.start(200); - ti3.start(200); + ti2.start(MOVETOTHREAD_TIMEOUT); + ti3.start(MOVETOTHREAD_TIMEOUT); QVERIFY((ti4.timerId() & 0xffffff) != (ti2.timerId() & 0xffffff)); QVERIFY((ti3.timerId() & 0xffffff) != (ti2.timerId() & 0xffffff)); QVERIFY((ti3.timerId() & 0xffffff) != (ti1.timerId() & 0xffffff)); @@ -533,4 +549,4 @@ void tst_QTimer::timerFiresOnlyOncePerProcessEvents() QTEST_MAIN(tst_QTimer) #include "tst_qtimer.moc" -\ + -- cgit v0.12 From a088a3e5698881b0466cd072380fc7347ea68fba Mon Sep 17 00:00:00 2001 From: kh Date: Tue, 26 May 2009 15:53:52 +0200 Subject: Fix broken search inside search results. Reviewed-by: kh --- tools/assistant/tools/assistant/centralwidget.cpp | 131 ++++++++++------------ tools/assistant/tools/assistant/centralwidget.h | 5 +- 2 files changed, 66 insertions(+), 70 deletions(-) diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp index b78f346..98245c0 100644 --- a/tools/assistant/tools/assistant/centralwidget.cpp +++ b/tools/assistant/tools/assistant/centralwidget.cpp @@ -848,60 +848,64 @@ void CentralWidget::keyPressEvent(QKeyEvent *e) QWidget::keyPressEvent(e); } -void CentralWidget::find(QString ttf, bool forward, bool backward) +void CentralWidget::find(const QString &ttf, bool forward, bool backward) { - QTextCursor cursor; - QTextDocument *doc = 0; - QTextBrowser *browser = 0; - - HelpViewer *viewer = currentHelpViewer(); QPalette p = findWidget->editFind->palette(); p.setColor(QPalette::Active, QPalette::Base, Qt::white); -#if !defined(QT_NO_WEBKIT) - Q_UNUSED(forward) - Q_UNUSED(doc) - Q_UNUSED(browser) - - if (viewer) { - QWebPage::FindFlags options; - if (backward) - options |= QWebPage::FindBackward; + if (!ttf.isEmpty()) { + HelpViewer *viewer = currentHelpViewer(); - if (findWidget->checkCase->isChecked()) - options |= QWebPage::FindCaseSensitively; + bool found = false; +#if !defined(QT_NO_WEBKIT) + if (viewer) { + QWebPage::FindFlags options; + if (backward) + options |= QWebPage::FindBackward; - bool found = viewer->findText(ttf, options); - findWidget->labelWrapped->hide(); + if (findWidget->checkCase->isChecked()) + options |= QWebPage::FindCaseSensitively; - if (!found) { - options |= QWebPage::FindWrapsAroundDocument; found = viewer->findText(ttf, options); + findWidget->labelWrapped->hide(); if (!found) { - p.setColor(QPalette::Active, QPalette::Base, QColor(255, 102, 102)); - } else { - findWidget->labelWrapped->show(); + options |= QWebPage::FindWrapsAroundDocument; + found = viewer->findText(ttf, options); + if (found) + findWidget->labelWrapped->show(); } + } else if (tabWidget->currentWidget() == m_searchWidget) { + QTextBrowser *browser = qFindChild(m_searchWidget); + found = findInTextBrowser(browser, ttf, forward, backward); } - } #else - if (viewer) { - doc = viewer->document(); - cursor = viewer->textCursor(); - browser = qobject_cast(viewer); - } + QTextBrowser *browser = qobject_cast(viewer); + if (tabWidget->currentWidget() == m_searchWidget) + browser = qFindChild(m_searchWidget); + found = findInTextBrowser(browser, ttf, forward, backward); +#endif - if (tabWidget->currentWidget() == m_searchWidget) { - QTextBrowser *browser = qFindChild(m_searchWidget); - if (browser) { - doc = browser->document(); - cursor = browser->textCursor(); - } + if (!found) + p.setColor(QPalette::Active, QPalette::Base, QColor(255, 102, 102)); } - if (!browser || !doc || cursor.isNull()) - return; + if (!findWidget->isVisible()) + findWidget->show(); + findWidget->editFind->setPalette(p); +} + +bool CentralWidget::findInTextBrowser(QTextBrowser* browser, const QString &ttf, + bool forward, bool backward) +{ + if (!browser) + return false; + + QTextDocument *doc = browser->document(); + QTextCursor cursor = browser->textCursor(); + + if (!doc || cursor.isNull()) + return false; QTextDocument::FindFlags options; @@ -910,44 +914,33 @@ void CentralWidget::find(QString ttf, bool forward, bool backward) QTextCursor::MoveAnchor); } - QTextCursor newCursor = cursor; + if (backward) + options |= QTextDocument::FindBackward; - if (!ttf.isEmpty()) { - if (backward) - options |= QTextDocument::FindBackward; - - if (findWidget->checkCase->isChecked()) - options |= QTextDocument::FindCaseSensitively; + if (findWidget->checkCase->isChecked()) + options |= QTextDocument::FindCaseSensitively; - if (findWidget->checkWholeWords->isChecked()) - options |= QTextDocument::FindWholeWords; + if (findWidget->checkWholeWords->isChecked()) + options |= QTextDocument::FindWholeWords; - newCursor = doc->find(ttf, cursor, options); - findWidget->labelWrapped->hide(); + findWidget->labelWrapped->hide(); + bool found = true; + QTextCursor newCursor = doc->find(ttf, cursor, options); + if (newCursor.isNull()) { + QTextCursor ac(doc); + ac.movePosition(options & QTextDocument::FindBackward + ? QTextCursor::End : QTextCursor::Start); + newCursor = doc->find(ttf, ac, options); if (newCursor.isNull()) { - QTextCursor ac(doc); - ac.movePosition(options & QTextDocument::FindBackward - ? QTextCursor::End : QTextCursor::Start); - newCursor = doc->find(ttf, ac, options); - if (newCursor.isNull()) { - p.setColor(QPalette::Active, QPalette::Base, QColor(255, 102, 102)); - newCursor = cursor; - } else { - findWidget->labelWrapped->show(); - } + found = false; + newCursor = cursor; + } else { + findWidget->labelWrapped->show(); } } -#endif - - if (!findWidget->isVisible()) - findWidget->show(); - -#if defined(QT_NO_WEBKIT) - if (browser) - browser->setTextCursor(newCursor); -#endif - findWidget->editFind->setPalette(p); + browser->setTextCursor(newCursor); + return found; } void CentralWidget::updateBrowserFont() diff --git a/tools/assistant/tools/assistant/centralwidget.h b/tools/assistant/tools/assistant/centralwidget.h index e3ce200..1342a75 100644 --- a/tools/assistant/tools/assistant/centralwidget.h +++ b/tools/assistant/tools/assistant/centralwidget.h @@ -55,6 +55,7 @@ class QLabel; class QAction; class QCheckBox; class QLineEdit; +class QTextBrowser; class QToolButton; class HelpViewer; @@ -176,7 +177,9 @@ private slots: private: void connectSignals(); bool eventFilter(QObject *object, QEvent *e); - void find(QString ttf, bool forward, bool backward); + void find(const QString &ttf, bool forward, bool backward); + bool findInTextBrowser(QTextBrowser* browser, const QString &ttf, + bool forward, bool backward); void initPrinter(); QString quoteTabTitle(const QString &title) const; void highlightSearchTerms(); -- cgit v0.12 From b03f598df2aa4037815eab9249ba1213236216c5 Mon Sep 17 00:00:00 2001 From: kh Date: Tue, 26 May 2009 15:57:45 +0200 Subject: Workaround the palette issue, set it only when we search is open. --- tools/assistant/tools/assistant/centralwidget.cpp | 35 +++++++++++++++++++++-- tools/assistant/tools/assistant/centralwidget.h | 5 ++++ 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp index 98245c0..52d48d5 100644 --- a/tools/assistant/tools/assistant/centralwidget.cpp +++ b/tools/assistant/tools/assistant/centralwidget.cpp @@ -87,6 +87,7 @@ namespace { FindWidget::FindWidget(QWidget *parent) : QWidget(parent) + , appPalette(qApp->palette()) { QHBoxLayout *hboxLayout = new QHBoxLayout(this); QString resourcePath = QLatin1String(":/trolltech/assistant/images/"); @@ -148,6 +149,34 @@ FindWidget::~FindWidget() { } +void FindWidget::hideEvent(QHideEvent* event) +{ +#if !defined(QT_NO_WEBKIT) + // TODO: remove this once webkit supports setting the palette + if (!event->spontaneous()) + qApp->setPalette(appPalette); +#else + Q_UNUSED(event); +#endif +} + +void FindWidget::showEvent(QShowEvent* event) +{ +#if !defined(QT_NO_WEBKIT) + // TODO: remove this once webkit supports setting the palette + if (!event->spontaneous()) { + QPalette p = appPalette; + p.setColor(QPalette::Inactive, QPalette::Highlight, + p.color(QPalette::Active, QPalette::Highlight)); + p.setColor(QPalette::Inactive, QPalette::HighlightedText, + p.color(QPalette::Active, QPalette::HighlightedText)); + qApp->setPalette(p); + } +#else + Q_UNUSED(event); +#endif +} + void FindWidget::updateButtons() { if (editFind->text().isEmpty()) { @@ -245,12 +274,14 @@ CentralWidget::CentralWidget(QHelpEngine *engine, MainWindow *parent) SLOT(showTabBarContextMenu(QPoint))); } - QPalette p = qApp->palette(); +#if defined(QT_NO_WEBKIT) + QPalette p = palette(); p.setColor(QPalette::Inactive, QPalette::Highlight, p.color(QPalette::Active, QPalette::Highlight)); p.setColor(QPalette::Inactive, QPalette::HighlightedText, p.color(QPalette::Active, QPalette::HighlightedText)); - qApp->setPalette(p); + setPalette(p); +#endif } CentralWidget::~CentralWidget() diff --git a/tools/assistant/tools/assistant/centralwidget.h b/tools/assistant/tools/assistant/centralwidget.h index 1342a75..d59dbe5 100644 --- a/tools/assistant/tools/assistant/centralwidget.h +++ b/tools/assistant/tools/assistant/centralwidget.h @@ -80,6 +80,10 @@ signals: void findNext(); void findPrevious(); +protected: + void hideEvent(QHideEvent* event); + void showEvent(QShowEvent * event); + private slots: void updateButtons(); @@ -95,6 +99,7 @@ private: QToolButton *toolPrevious; QCheckBox *checkWholeWords; + QPalette appPalette; friend class CentralWidget; }; -- cgit v0.12 From 3cded6c4a90233e214447f769efc4a3524df6872 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Tue, 26 May 2009 16:08:12 +0200 Subject: Bugfix for mapping keys when there is only one softkey in the stack --- src/gui/widgets/qsoftkeystack_s60.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widgets/qsoftkeystack_s60.cpp b/src/gui/widgets/qsoftkeystack_s60.cpp index a6b885e..e9ca13a 100644 --- a/src/gui/widgets/qsoftkeystack_s60.cpp +++ b/src/gui/widgets/qsoftkeystack_s60.cpp @@ -53,7 +53,7 @@ void QSoftKeyStackPrivate::mapSoftKeys(const QSoftkeySet &top) { if (top.count() == 1) { top.at(0)->setNativePosition(2); - top.at(0)->setQtContextKey(Qt::Key_Context2); + top.at(0)->setQtContextKey(Qt::Key_Context1); } else { // FIX THIS -- cgit v0.12 From f61056a556259c12a6de23f12756e45737345111 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 26 May 2009 16:08:59 +0200 Subject: Doc: Updated the list of tools to include makeqpf and qvfb. Reviewed-by: Marcel Schuette --- doc/src/emb-fonts.qdoc | 2 +- doc/src/emb-makeqpf.qdoc | 9 ++++++--- doc/src/tools-list.qdoc | 6 ++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/doc/src/emb-fonts.qdoc b/doc/src/emb-fonts.qdoc index 3ed23c3..86e169d 100644 --- a/doc/src/emb-fonts.qdoc +++ b/doc/src/emb-fonts.qdoc @@ -131,7 +131,7 @@ The Qt Prerendered Font (QPF2) is an architecture-independent, light-weight and non-scalable font format specific to \l{Qt for Embedded Linux}. - Nokia provides the cross-platform \c makeqpf tool, included in the + Nokia provides the cross-platform \l makeqpf tool, included in the \c tools directory of both \l {Qt} and \l{Qt for Embedded Linux}, which allows generation of QPF2 files from system fonts. diff --git a/doc/src/emb-makeqpf.qdoc b/doc/src/emb-makeqpf.qdoc index ca33eda..8f5d10b 100644 --- a/doc/src/emb-makeqpf.qdoc +++ b/doc/src/emb-makeqpf.qdoc @@ -44,7 +44,10 @@ \title makeqpf \ingroup qt-embedded-linux - \c makeqpf is not part of Qt 4. However, Qt 4 can still read QPF - files generated by Qt 2 or 3. To generate QPF files, use makeqpf from Qt 2 - or 3. + \c makeqpf is a tool to generate pre-rendered fonts in QPF2 format for use on Embedded Linux. + + Qt 4 can read files in QPF2 format in addition to QPF files generated by older versions of + \c makeqpf from Qt 2 or 3. + + \sa {Qt for Embedded Linux Fonts} */ diff --git a/doc/src/tools-list.qdoc b/doc/src/tools-list.qdoc index 7af9936..caef268 100644 --- a/doc/src/tools-list.qdoc +++ b/doc/src/tools-list.qdoc @@ -58,12 +58,10 @@ \o Translate applications to reach international markets. \row \o \l{qmake Manual}{qmake} \o Create makefiles from simple platform-independent project files (\c .pro files). - \omit - \row \o \l{emb-qvfb.html}{qvfb} + \row \o \l{The Virtual Framebuffer}{qvfb} \o Run and test embedded applications on the desktop. - \row \o \l{emb-makeqpf.html}{makeqpf} + \row \o \l{makeqpf} \o Create pre-rendered fonts for embedded devices. - \endomit \row \o \l{moc}{Meta-Object Compiler (moc)} \o Generate meta-object information for QObject subclasses. \row \o \l{User Interface Compiler (uic)} -- cgit v0.12 From 8bf5a6986db852525582713cc2f2a760df4fdc60 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Tue, 26 May 2009 16:50:48 +0200 Subject: QFileDialog selection bug when calling it multiple times. The problem was that we don't clear the selection model if the previous selection was valid. Task-number:251341 Reviewed-by:jasplin --- src/gui/dialogs/qfiledialog.cpp | 11 +++++----- tests/auto/qfiledialog/tst_qfiledialog.cpp | 33 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index eeb2743..d42775a 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -776,6 +776,7 @@ void QFileDialog::selectFile(const QString &filename) } QModelIndex index = d->model->index(filename); + QString file; if (!index.isValid()) { // save as dialog where we want to input a default value QString text = filename; @@ -790,13 +791,13 @@ void QFileDialog::selectFile(const QString &filename) ) text = text.remove(0,1); } - if (!isVisible() || !d->lineEdit()->hasFocus()) - d->lineEdit()->setText(text); + file = text; } else { - d->qFileDialogUi->listView->selectionModel()->clear(); - if (!isVisible() || !d->lineEdit()->hasFocus()) - d->lineEdit()->setText(index.data().toString()); + file = index.data().toString(); } + d->qFileDialogUi->listView->selectionModel()->clear(); + if (!isVisible() || !d->lineEdit()->hasFocus()) + d->lineEdit()->setText(file); } /** diff --git a/tests/auto/qfiledialog/tst_qfiledialog.cpp b/tests/auto/qfiledialog/tst_qfiledialog.cpp index 689f73d..16c84d8 100644 --- a/tests/auto/qfiledialog/tst_qfiledialog.cpp +++ b/tests/auto/qfiledialog/tst_qfiledialog.cpp @@ -159,6 +159,7 @@ private slots: void task218353_relativePaths(); void task251321_sideBarHiddenEntries(); void task251341_sideBarRemoveEntries(); + void task254490_selectFileMultipleTimes(); private: QByteArray userSettings; @@ -1981,5 +1982,37 @@ void tst_QFiledialog::task251341_sideBarRemoveEntries() current.rmdir("testDir"); } +void tst_QFiledialog::task254490_selectFileMultipleTimes() +{ + QString tempPath = QDir::tempPath(); + QTemporaryFile *t; + t = new QTemporaryFile; + t->open(); + QNonNativeFileDialog fd(0, "TestFileDialog"); + + fd.setDirectory(tempPath); + fd.setViewMode(QFileDialog::List); + fd.setAcceptMode(QFileDialog::AcceptSave); + fd.setFileMode(QFileDialog::AnyFile); + + //This should select the file in the QFileDialog + fd.selectFile(t->fileName()); + + //This should clear the selection and write it into the filename line edit + fd.selectFile("new_file.txt"); + + fd.show(); + QTest::qWait(250); + + QLineEdit *lineEdit = qFindChild(&fd, "fileNameEdit"); + QVERIFY(lineEdit); + QCOMPARE(lineEdit->text(),QLatin1String("new_file.txt")); + QListView *list = qFindChild(&fd, "listView"); + QVERIFY(list); + QCOMPARE(list->selectionModel()->selectedRows(0).count(), 0); + + t->deleteLater(); +} + QTEST_MAIN(tst_QFiledialog) #include "tst_qfiledialog.moc" -- cgit v0.12 From 4998ad5f72314b48ad8c8115b64f4cb4b747c2bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Tue, 26 May 2009 18:03:52 +0300 Subject: S60Style: Tidy up the code - remove 'todo's. --- src/gui/styles/qs60style.cpp | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 5026d5c..071b60a 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -354,12 +354,15 @@ void QS60StylePrivate::clearCaches(QS60StylePrivate::CacheClearReason reason) { switch(reason){ case CC_LayoutChange: - // when layout changes, the colors remain in cache - m_mappedFontsCache.clear(); //todo: can font change, when layout changes? + // when layout changes, the colors remain in cache, but graphics and fonts can change + m_mappedFontsCache.clear(); m_backgroundValid = false; QPixmapCache::clear(); break; - case CC_ThemeChange: //todo: can font change when theme changes? + case CC_ThemeChange: + m_colorCache.clear(); + QPixmapCache::clear(); + m_backgroundValid = false; case CC_UndefinedChange: default: m_colorCache.clear(); @@ -839,7 +842,6 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom const bool direction = cmb->direction == Qt::LeftToRight; // Button frame - //todo: why calc rect here for button? Is there no suitable SE_xxx for that? QStyleOptionFrame buttonOption; buttonOption.QStyleOption::operator=(*cmb); const int maxHeight = cmbxFrame.height(); @@ -849,7 +851,6 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom buttonOption.rect = buttonRect; buttonOption.state = cmb->state & (State_Enabled | State_MouseOver); drawPrimitive(PE_PanelButtonCommand, &buttonOption, painter, widget); - // todo: we could draw qgn_prop_set_button skin item here // draw label background - label itself is drawn separately const QS60StylePrivate::SkinElements skinElement = QS60StylePrivate::SE_FrameLineEdit; @@ -1108,14 +1109,6 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom break; #endif //QT_NO_DIAL - //todo: remove non-used complex widgets in final version - case CC_TitleBar: -#ifdef QT3_SUPPORT - case CC_Q3ListView: -#endif //QT3_SUPPORT -#ifndef QT_NO_WORKSPACE - case CC_MdiControls: -#endif //QT_NO_WORKSPACE default: QCommonStyle::drawComplexControl(control, option, painter, widget); } @@ -1413,7 +1406,6 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, const int tabOverlap = QS60StylePrivate::pixelMetric(QStyle::PM_TabBarTabOverlap) - borderThickness; //todo: draw navi wipe behind tabbar - must be drawn with first draw - //QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_TableHeaderItem, painter, windowRect, flags); if (skinElement==QS60StylePrivate::SE_TabBarTabEastInactive|| skinElement==QS60StylePrivate::SE_TabBarTabEastActive|| @@ -1690,7 +1682,6 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, break; #endif //QT_NO_MENU - //todo: remove non-used widgets in final version case CE_MenuEmptyArea: #ifndef QT_NO_MENUBAR case CE_MenuBarEmptyArea: @@ -1799,6 +1790,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, break; #endif //QT_NO_TOOLBAR + //todo: remove non-used widgets in final version case CE_ShapedFrame: case CE_MenuVMargin: case CE_MenuHMargin: @@ -2450,7 +2442,6 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con case SE_LineEditContents: { // in S60 the input text box doesn't start from line Edit's TL, but // a bit indented. - // todo: Should we NOT do this for combo boxes and spin boxes? QRect lineEditRect = opt->rect; int adjustment = opt->rect.height()>>2; lineEditRect.adjust(adjustment,0,0,0); -- cgit v0.12 From 8d9b58cde5d1ad6c6684bcc3516cd3782b946bfc Mon Sep 17 00:00:00 2001 From: Iain Date: Tue, 26 May 2009 17:13:01 +0200 Subject: Use __DEBUGGER() when qFatal is called to give the debugger a chance to kick in (assuming JustInTime is set in epoc.ini) RevBy: TrustMe --- src/corelib/global/qglobal.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index dd1dbd2..a1b46f7 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -69,6 +69,7 @@ #endif #if defined(Q_OS_SYMBIAN) +#include #include #endif @@ -2150,6 +2151,7 @@ void qt_message_output(QtMsgType msgType, const char *buf) #endif #if defined(Q_OS_SYMBIAN) + __DEBUGGER(); // on the emulator, get the debugger to kick in if there is JustInTime is true User::Invariant(); // Panic the current thread #elif (defined(Q_OS_UNIX) || defined(Q_CC_MINGW)) abort(); // trap; generates core dump -- cgit v0.12 From b5905a47874a7000602be5b1afc33d90b7ebb831 Mon Sep 17 00:00:00 2001 From: Iain Date: Tue, 26 May 2009 17:40:40 +0200 Subject: Update comment - this version might even make sense... --- src/corelib/global/qglobal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index a1b46f7..4538dc4 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -2151,7 +2151,7 @@ void qt_message_output(QtMsgType msgType, const char *buf) #endif #if defined(Q_OS_SYMBIAN) - __DEBUGGER(); // on the emulator, get the debugger to kick in if there is JustInTime is true + __DEBUGGER(); // on the emulator, get the debugger to kick in if there's one around User::Invariant(); // Panic the current thread #elif (defined(Q_OS_UNIX) || defined(Q_CC_MINGW)) abort(); // trap; generates core dump -- cgit v0.12 From fca64a07d80d3a9284bb9f9bd831d01294fd2be0 Mon Sep 17 00:00:00 2001 From: Iain Date: Tue, 26 May 2009 18:18:56 +0200 Subject: Keep exported symbols the same between udeb and urel, although the implementation does nothing in urel Required to have udeb/urel compatibility between binaries. RevBy: Alessandro Portale --- src/corelib/kernel/qcoreapplication.cpp | 5 +++++ src/corelib/kernel/qcoreapplication_p.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 7d8a77a..d99164b 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -311,6 +311,11 @@ void QCoreApplicationPrivate::checkReceiverThread(QObject *receiver) Q_UNUSED(currentThread); Q_UNUSED(thr); } +#elif defined(Q_OS_SYMBIAN) && defined (QT_NO_DEBUG) +// no implementation in release builds, but keep the symbol present +void QCoreApplicationPrivate::checkReceiverThread(QObject *receiver) +{ +} #endif void QCoreApplicationPrivate::appendApplicationPathToLibraryPaths() diff --git a/src/corelib/kernel/qcoreapplication_p.h b/src/corelib/kernel/qcoreapplication_p.h index 9490ad7..c1118d1 100644 --- a/src/corelib/kernel/qcoreapplication_p.h +++ b/src/corelib/kernel/qcoreapplication_p.h @@ -92,7 +92,7 @@ public: static void sendPostedEvents(QObject *receiver, int event_type, QThreadData *data); static void removePostedEvents_unlocked(QObject *receiver, int type, QThreadData *data); -#if !defined (QT_NO_DEBUG) || defined (QT_MAC_FRAMEWORK_BUILD) +#if !defined (QT_NO_DEBUG) || defined (QT_MAC_FRAMEWORK_BUILD) || defined (Q_OS_SYMBIAN) void checkReceiverThread(QObject *receiver); #endif int &argc; -- cgit v0.12 From cfe54548131d78db9d58366e35e9b29e5d3ba238 Mon Sep 17 00:00:00 2001 From: Thomas Sondergaard Date: Fri, 22 May 2009 20:26:46 +0200 Subject: Updated danish translations. Added them to relevant project files. --- tools/assistant/translations/qt_help.pro | 3 +- tools/assistant/translations/translations.pro | 3 +- translations/assistant_da.ts | 606 ++++---- translations/qt_da.ts | 1978 +++++++++++++++++++++---- translations/qt_help_da.ts | 177 ++- translations/translations.pri | 2 +- 6 files changed, 2132 insertions(+), 637 deletions(-) diff --git a/tools/assistant/translations/qt_help.pro b/tools/assistant/translations/qt_help.pro index efad6bf..e6208a6 100644 --- a/tools/assistant/translations/qt_help.pro +++ b/tools/assistant/translations/qt_help.pro @@ -44,5 +44,6 @@ TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/qt_help_de.ts \ $$[QT_INSTALL_TRANSLATIONS]/qt_help_pl.ts \ $$[QT_INSTALL_TRANSLATIONS]/qt_help_untranslated.ts \ $$[QT_INSTALL_TRANSLATIONS]/qt_help_zh_CN.ts \ - $$[QT_INSTALL_TRANSLATIONS]/qt_help_zh_TW.ts + $$[QT_INSTALL_TRANSLATIONS]/qt_help_zh_TW.ts \ + $$[QT_INSTALL_TRANSLATIONS]/qt_help_da.ts error("This is a dummy profile to be used for translations ONLY.") diff --git a/tools/assistant/translations/translations.pro b/tools/assistant/translations/translations.pro index 58de554..8572123 100644 --- a/tools/assistant/translations/translations.pro +++ b/tools/assistant/translations/translations.pro @@ -45,4 +45,5 @@ TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/assistant_de.ts \ $$[QT_INSTALL_TRANSLATIONS]/assistant_pl.ts \ $$[QT_INSTALL_TRANSLATIONS]/assistant_untranslated.ts \ $$[QT_INSTALL_TRANSLATIONS]/assistant_zh_CN.ts \ - $$[QT_INSTALL_TRANSLATIONS]/assistant_zh_TW.ts + $$[QT_INSTALL_TRANSLATIONS]/assistant_zh_TW.ts \ + $$[QT_INSTALL_TRANSLATIONS]/assistant_da.ts diff --git a/translations/assistant_da.ts b/translations/assistant_da.ts index d039248..8d134fc 100644 --- a/translations/assistant_da.ts +++ b/translations/assistant_da.ts @@ -1,58 +1,77 @@ - AboutDialog - + &Close &Luk + AboutLabel + + + Warning + Advarsel + + + + Unable to launch external application. + + Kunne ikke starte ekstern applikation. + + + + + OK + + + + BookmarkDialog - - - - - + + + + + Bookmarks Favoritter - + Add Bookmark Føj til Favoritter - + Bookmark: Favorit: - + Add in Folder: Føj til mappen: - + + - + New Folder Ny mappe - + Delete Folder Slet mappe - + Rename Folder Omdøb mappe @@ -60,75 +79,79 @@ BookmarkManager - + Bookmarks Favoritter - + Remove Fjern + You are going to delete a Folder, this will also<br>remove it's content. Are you sure to continue? - Ved at slette denne mappe fjernes hele mappens<br>indhold. Ønsker du alligevel at slette? + Ved at slette denne mappe fjernes hele mappens<br>indhold. Ønsker du alligevel at slette? - - + + New Folder Ny mappe - You are about to delete a folder which means that its content<br>will also be removed. Do you want to continue? - Ved at slette denne mappe fjernes hele mappens indhold.<br>Ønsker du alligevel at slette? + Ved at slette denne mappe fjernes hele mappens indhold.<br>Ønsker du alligevel at slette? BookmarkWidget - + + Filter: + Filter: + + + Remove Fjern - + Delete Folder Slet mappe - + Rename Folder Omdøb mappe - + Show Bookmark Vis favorit - + Show Bookmark in New Tab Vis favorit pÃ¥ ny fane - + Delete Bookmark Slet favorit - + Rename Bookmark Omdøb favorit - Search for: - Søg efter: + Søg efter: - + Add Tilføj @@ -136,48 +159,48 @@ CentralWidget - + Add new page Tilføj ny side - + Close current page Luk nuværende side - + Print Document Udskriv dokument - - + + unknown ukendt - + Add New Page Tilføj ny side - + Close This Page Luk denne side - + Close Other Pages Luk de andre sider - + Add Bookmark for this Page... Føj denne side til Favoritter... - + Search Søg @@ -185,12 +208,12 @@ ContentWindow - + Open Link Ã…bn link - + Open Link in New Tab Ã…bn link pÃ¥ ny fane @@ -198,69 +221,77 @@ FilterNameDialogClass - FilterNameDialog - FilterNavnDialog + FilterNavnDialog - + Filter Name: Filternavn: + + + Add Filter Name + Tilføj filternavn + FindWidget - + + <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped + <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Søgning gentaget fra start + + + Previous Forrige - + Next Næste - + Case Sensitive Der skelnes mellem store og smÃ¥ bogstaver - + Whole words Hele ord - <img src="%1">&nbsp;Search wrapped <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped - <img src="%1">&nbsp;Søgning startet forfra + <img src="%1">&nbsp;Søgning startet forfra FontPanel - + Font Skrifttype - + &Writing system &Skrivesystem - + &Family &Familie - + &Style &Stil - + &Point size &Punktstørrelse @@ -268,42 +299,41 @@ HelpViewer - + Help Hjælp - + OK - + <title>Error 404...</title><div align="center"><br><br><h1>The page could not be found</h1><br><h3>'%1'</h3></div> <title>Fejl 404...</title><div align="center"><br><br><h1>Siden blev ikke fundet</h1><br><h3>'%1'</h3></div> - + Copy &Link Location Kopiér &linkets placering - + Open Link in New Tab Ctrl+LMB Ã…bn link pÃ¥ ny fane Ctrl+LMB - + Open Link in New Tab Ã…bn link pÃ¥ ny fane - <b>Page not found:<p>%1.</p></b> - <b>Kunne ikke finde siden:<p>%1.</p></b> + <b>Kunne ikke finde siden:<p>%1.</p></b> - + Unable to launch external application. Kunne ikke starte ekstern applikation. @@ -313,17 +343,17 @@ IndexWindow - + &Look for: &Søg efter: - + Open Link Ã…bn link - + Open Link in New Tab Ã…bn link pÃ¥ ny fane @@ -331,99 +361,99 @@ InstallDialog - - + + Install Documentation Installér dokumentation - + Downloading documentation info... Downloader dokumentationsinformation... - + Download canceled. Download blev annulleret. - - - + + + Done. Færdig. - + The file %1 already exists. Do you want to overwrite it? Filen %1 findes allerede. Ønsker du at overskrive? - + Unable to save the file %1: %2. Kunne ikke gemme filen %1: %2. - + Downloading %1... Downloader %1... - - - + + + Download failed: %1. Download mislykkedes: %1. - + Documentation info file is corrupt! Dokumentationsinformationsfilen er ødelagt! - + Download failed: Downloaded file is corrupted. Download mislykkedes: Den downloadede fil er ødelagt. - + Installing documentation %1... Installerer dokumentation %1... - + Error while installing documentation: %1 Der opstod fejl under installation af dokumentation: %1 - + Available Documentation: Tilgængeligt dokumentation: - + Install Installér - + Cancel Annuller - + Close Luk - + Installation Path: Installationssti: - + ... @@ -431,60 +461,62 @@ MainWindow - - + + Index Indeks - - + + Contents Indhold - - + + Bookmarks Favoritter - - + Search Søg - - - + + + Qt Assistant - - + + Unfiltered Ufiltreret + Page Set&up... - Side&opsætning... + Side&opsætning... + Print Preview... - Vis udskrift... + Vis udskrift... + &Print... - &Udskriv... + &Udskriv... CTRL+P Ctrl+U - + New &Tab &Ny Fane @@ -493,7 +525,7 @@ Ctrl+N - + &Close Tab &Luk fane @@ -502,340 +534,326 @@ Ctrl+L - + &Quit &Afslut + CTRL+Q - Ctrl+A + Ctrl+A + &Copy selected Text - &Kopiér markeret tekst + &Kopiér markeret tekst Ctrl+C Ctrl+K - + &Find in Text... &Find i tekst... - - Ctrl+F - - - - + Find &Next Find N&æste - - F3 - - - - + Find &Previous Find fo&rrige - - Shift+F3 - - - - + Preferences... Indstillinger... - + Zoom &in Zoom &ind - - Ctrl++ - - - - + Zoom &out Zoom u&d - - Ctrl+- - - - - + Normal &Size Normal &størrelse - + Ctrl+0 - + + ALT+C + + + + + ALT+I + + + + + ALT+S + + + + &Home &Hjem - + Ctrl+Home - + &Back &Tilbage - + &Forward Fr&em + Sync with Table of Contents - Synkronisér med Indholdsfortegnelse + Synkronisér med Indholdsfortegnelse - + Next Page Næste side - + Ctrl+Alt+Right Ctrl+Alt+Højre - + Previous Page Forrige side - + Ctrl+Alt+Left Ctrl+Alt+Venstre - + Add Bookmark... Føj til Favoritter... - + About... Om... - + Navigation Toolbar Navigationsværktøjslinie - + Toolbars Værktøjslinier - + Filter Toolbar Filtrer værktøjslinie - + Filtered by: Filtreret efter: - + Address Toolbar Adresseværktøjslinie - + Address: Adresse: - + Could not find the associated content item. Det tilhørende indholdselement kunne ikke findes. - - Open Source Edition - - - - This version of Qt Assistant is part of the Qt Open Source Edition, for use in the development of Open Source applications. Qt is a comprehensive C++ framework for cross-platform application development. - Denne version af Qt Assistant er en del af Qt Open Source Edition til brug med henblik pÃ¥ udvikling af Open Source-applikationer. Qt er et omfattende C++ framework for cross-platform applikationsudvikling. + Denne version af Qt Assistant er en del af Qt Open Source Edition til brug med henblik pÃ¥ udvikling af Open Source-applikationer. Qt er et omfattende C++ framework for cross-platform applikationsudvikling. - This program is licensed to you under the terms of the Qt Commercial License Agreement. For details, see the file LICENSE that came with this software distribution. - Dette program er omfattet af Qt Commercial License Agreement. Se filen LICENCE, der var vedlagt denne software-distribution, for yderligere detaljer. + Dette program er omfattet af Qt Commercial License Agreement. Se filen LICENCE, der var vedlagt denne software-distribution, for yderligere detaljer. - + About %1 Om %1 - + Updating search index Opdaterer søgeindeks - + Looking for Qt Documentation... Søger efter Qt-dokumentation... - + &Window &Vindue - + Minimize Minimér - + Ctrl+M Ctrl+M - + Zoom - + &File &Filer - + &Edit &Redigér - + &View &Vis - + &Go &GÃ¥ til - + &Bookmarks F&avoritter - + &Help &Hjælp - - You need a commercial Qt license for development of proprietary (closed source) applications. Please see <a href="http://trolltech.com/company/about/businessmodel">http://trolltech.com/company/about/businessmodel</a> for an overview of Qt licensing. - - - + ALT+O - Alt+F + Alt+F + CTRL+D - Ctrl+Ø + Ctrl+Ø Ctrl+P Ctrl+U - Ctrl+T - Ctrl+N + Ctrl+N - Ctrl+W - Ctrl+L + Ctrl+L - Ctrl+Q - Ctrl+A + Ctrl+A - Alt+C - Alt+L - - - - Alt+I - + Alt+L - Alt+O - Alt+F - - - - Alt+S - + Alt+F - Ctrl+D - Ctrl+Ø + Ctrl+Ø PreferencesDialog - - - + + Add Documentation Tilføj dokumentation - + Qt Compressed Help Files (*.qch) Qt komprimeret hjælpefil (*.qch) - + The specified file is not a valid Qt Help File! Den anførte fil er ikke en gyldig Qt hjælpefil! - + The namespace %1 is already registered! Navnerummet %1 er allerede registreret! - + + Remove Documentation + Fjern dokumentation + + + + Some documents currently opened in Assistant reference the documentation you are attempting to remove. Removing the documentation will close those documents. + Nogle dokumenter der pt er Ã¥bne i Assistant refererer til den dokumentation du prøver at fjerne. Fjernelse af dokumentation vil resultere i lukning af disse dokumenter. + + + + Cancel + Annuller + + + + OK + + + + Use custom settings Benyt brugerdefineret opsætning @@ -843,158 +861,170 @@ PreferencesDialogClass - + Preferences Indstillinger - + Fonts Skrifttyper - + Font settings: Indstillinger for skrifttype: - + Browser - + Application Applikation - + Filters Filtre - + Filter: Filter: - + Attributes: Attributter: - + 1 - + Add Tilføj - - + Remove Fjern - + Documentation Dokumentation - + Registered Documentation: Registreret dokumentation: - + Add... Tilføj... - Network - Netværk + Netværk - Use Http Proxy - Benyt Http Proxy + Benyt Http Proxy - - Http Proxy: - + + Options + Indstillinger - - Port: - + + Homepage + Hjemmeside + + + + Current Page + Nuværende side + + + + Restore to default + Nulstil til default QObject - + The specified collection file does not exist! Den angivne hjælpesamling findes ikke! - + Missing collection file! Hjælpesamling mangler! - + Invalid URL! Ugyldig URL! - + Missing URL! URL mangler! - - - + + + Unknown widget: %1 Ukendt widget: %1 - - - + + + Missing widget! Widget mangler! - - + + The specified Qt help file does not exist! Den angivne Qt-hjælpefil findes ikke! - - + + Missing help file! Hjælpefilen mangler! - + + Missing filter argument! + Manglende filterargument! + + + Unknown option: %1 Ukendt parameter: %1 - - + + Qt Assistant - + Could not register documentation file %1 @@ -1007,12 +1037,12 @@ Reason: %2 - + Documentation successfully registered. Dokumentationen blev registreret. - + Could not unregister documentation file %1 @@ -1025,18 +1055,23 @@ Reason: %2 - + Documentation successfully unregistered. Dokumentationen blev afregistreret. - + + Cannot load sqlite database driver! + Kan ikke indlæse sqlite database-driver! + + + The specified collection file could not be read! Den angivne hjælpesamling kunne ikke læses! - - + + Bookmark Favorit @@ -1044,11 +1079,10 @@ Reason: QtDocInstaller - The file %1 could not be registered successfully! Reason: %2 - Filen %1 kunne ikke registreres! + Filen %1 kunne ikke registreres! Ã…rsag: %2 @@ -1056,12 +1090,12 @@ Reason: %2 RemoteControl - + Debugging Remote Control - + Received Command: %1 %2 Modtaget kommando: %1 %2 @@ -1069,56 +1103,54 @@ Reason: %2 SearchWidget - + &Copy &Kopiér - + Copy &Link Location Kopiér &linkets placering - - + Open Link in New Tab Ã…bn link pÃ¥ ny fane - + Select All Markér alt - Open Link - Ã…bn link + Ã…bn link TopicChooser - + Choose a topic for <b>%1</b>: Vælg et emne for <b>%1</b>: - + Choose Topic Vælg emne - + &Topics &Emner - + &Display &Vis - + &Close &Luk diff --git a/translations/qt_da.ts b/translations/qt_da.ts index 9350687..105b572 100644 --- a/translations/qt_da.ts +++ b/translations/qt_da.ts @@ -4,15 +4,17 @@ AudioOutput - + <html>The audio playback device <b>%1</b> does not work.<br/>Falling back to <b>%2</b>.</html> <html>Audio-playback-enheden<b>%1</b> virker ikke.<br/>Falder tilbage til <b>%2</b>.</html> + <html>Switching to the audio playback device <b>%1</b><br/>which just became available and has higher preference.</html> - <html>Skifter til audio-playback-enheden, <b>%1</b><br/>der lige er blevet tilgængeligt og har en højere præference.</html> + <html>Skifter til audio-playback-enheden, <b>%1</b><br/>der lige er blevet tilgængelig og har en højere præference.</html> + Revert back to device '%1' GÃ¥ tilbage til enheden '%1' @@ -20,7 +22,7 @@ CloseButton - + Close Tab Luk fane @@ -28,27 +30,32 @@ Phonon:: - + Notifications Meddelelser + Music Musik + Video + Communication Kommunikation + Games Spil + Accessibility Tilgængelighed @@ -56,13 +63,14 @@ Phonon::Gstreamer::Backend - + Warning: You do not seem to have the package gstreamer0.10-plugins-good installed. Some video features have been disabled. Advarsel: Det ser ikke ud til, at gstreamer0.10-plugins-good pakken er installeret. Nogle videofunktioner er deaktiveret. + Warning: You do not seem to have the base GStreamer plugins installed. All audio and video support has been disabled Advarsel: Det ser ikke ud til, at base GStreamer plugins er installeret. @@ -72,7 +80,7 @@ Phonon::Gstreamer::MediaObject - + Cannot start playback. Check your Gstreamer installation and make sure you @@ -83,26 +91,39 @@ Tjek Gstreamer-installationen og kontrollér, at libgstreamer-plugins-base er installeret. + A required codec is missing. You need to install the following codec(s) to play this content: %0 Der mangler et codec. Følgende codecs skal installeres for at afspille dette indhold: %0 + + + + + + + + Could not open media source. Kunne ikke Ã¥bne mediekilden. + Invalid source type. Ugyldig kilde. + Could not locate media source. Kunne ikke lokalisere mediekilden. + Could not open audio device. The device is already in use. Kunne ikke Ã¥bne lydenheden. Enheden er allerede i brug. + Could not decode media source. Kunne ikke afkode mediekilden. @@ -110,10 +131,15 @@ libgstreamer-plugins-base er installeret. Phonon::VolumeSlider + + Volume: %1% + + + Use this slider to adjust the volume. The leftmost position is 0%, the rightmost is %1% Anvend denne skyder til at indstille lydstyrken. Længst til venstre er 0% og længst til højre er %1% @@ -121,11 +147,12 @@ libgstreamer-plugins-base er installeret. Q3Accel - + %1, %2 not defined %1, %2 ikke definerede + Ambiguous %1 not handled Tvetydig %1 ikke behandlet @@ -133,23 +160,27 @@ libgstreamer-plugins-base er installeret. Q3DataTable - + True Sandt + False Falsk + Insert Indsæt + Update Opdater + Delete Slet @@ -157,242 +188,313 @@ libgstreamer-plugins-base er installeret. Q3FileDialog - + Copy or Move a File Kopiér eller flyt en fil + Read: %1 Læs: %1 + + Write: %1 Skriv: %1 + + Cancel Annuller - + + + + All Files (*) Alle filer (*) + Name Navn + Size Størrelse + Type + Date Dato + Attributes Attributter + + &OK &OK + Look &in: Kig &i: + + + File &name: Fil&navn: + File &type: Fil&type: + Back Tilbage + One directory up En mappe op + Create New Folder Opret ny folder + List View Listevisning + Detail View Detaljevisning + Preview File Info Vis filinformation + Preview File Contents Vis filindhold + Read-write Læs-skriv + Read-only Skrivebeskyttet + Write-only Write-only + Inaccessible Utilgængelig + Symlink to File Symlink til Fil + Symlink to Directory Symlink til katalog + Symlink to Special Symlink til Speciel + File Fil + Dir Katalog + Special Speciel - + + + Open Ã…bn - + + Save As Gem som + + + &Open &Ã…bn + + &Save &Gem + &Rename &Omdøb + &Delete &Slet + R&eload Gen&indlæs + Sort by &Name Sortér efter n&avn + Sort by &Size Sortér efter s&tørrelse + Sort by &Date Sortér efter &dato + &Unsorted &Usorteret + Sort Sortér + Show &hidden files Vis s&kjulte filer + the file filen + the directory kataloget + the symlink symlinket + Delete %1 Slet %1 + <qt>Are you sure you wish to delete %1 "%2"?</qt> <qt>Er du sikker pÃ¥, at du vil slette %1 "%2"?</qt> + &Yes &Ja + &No &Nej + New Folder 1 Ny folder 1 + New Folder Ny folder + New Folder %1 Ny folder %1 + Find Directory Find katalog + + Directories Kataloger + Directory: Katalog: + + Error Fejl + %1 File not found. Check path and filename. @@ -401,14 +503,17 @@ Filen blev ikke fundet. Kontrollér sti og filnavn. + All Files (*.*) Alle filer (*.*) + Open Ã…bn + Select a Directory Vælg et katalog @@ -416,24 +521,29 @@ Kontrollér sti og filnavn. Q3LocalFs + + Could not read directory %1 Kunne ikke læse katalog %1 + Could not create directory %1 Kunne ikke oprette katalog %1 + Could not remove file or directory %1 Kunne ikke fjerne fil eller katalog %1 + Could not rename %1 to @@ -444,12 +554,14 @@ to %2 + Could not open %1 Kunne ikke Ã¥bne %1 + Could not write %1 Kunne ikke skrive @@ -459,11 +571,12 @@ to Q3MainWindow - + Line up Linie op + Customize... Tilpas... @@ -471,7 +584,7 @@ to Q3NetworkProtocol - + Operation stopped by the user Brugeren stoppede handlingen @@ -479,6 +592,8 @@ to Q3ProgressDialog + + Cancel Annuller @@ -486,22 +601,28 @@ to Q3TabDialog + + OK + Apply Udfør + Help Hjælp + Defaults Standarder + Cancel Annuller @@ -509,31 +630,38 @@ to Q3TextEdit - + &Undo &Fortryd + &Redo &Gendan + Cu&t &Klip + &Copy K&opiér + &Paste &Sæt ind + Clear Ryd + + Select All Markér alt @@ -541,55 +669,67 @@ to Q3TitleBar - + System + Restore up Gendan op + Minimize Minimer + Restore down Gendan ned + Maximize Maksimér + Close Luk + Contains commands to manipulate the window Indeholder kommandoer til indstilling af vinduet + Puts a minimized back to normal Sætter et minimeret vindue til normal størrelse + Moves the window out of the way Flytter vinduet væk + Puts a maximized window back to normal Sætter et maksimeret vindue til normal størrelse + Makes the window full screen Gør vinduet til fuld skærm + Closes the window Lukker vinduet + Displays the name of the window and contains controls to manipulate it Viser vinduets navn og indeholder kontroller til indstilling af vinduet @@ -597,7 +737,7 @@ to Q3ToolBar - + More... Mere... @@ -605,38 +745,51 @@ to Q3UrlOperator + + + The protocol `%1' is not supported Protokollen '%1' understøttes ikke + The protocol `%1' does not support listing directories Protokollen '%1' understøtter ikke opremsning af kataloger + The protocol `%1' does not support creating new directories Protokollen '%1' understøtter ikke oprettelse af nye kataloger + The protocol `%1' does not support removing files or directories Protokollen '%1' understøtter ikke, at filer eller kataloger fjernes + The protocol `%1' does not support renaming files or directories Protokollen '%1' understøtter ikke, at filer eller kataloger omdøbes + The protocol `%1' does not support getting files Protokollen '%1' understøtter ikke hentning af filer + The protocol `%1' does not support putting files Protokollen '%1' understøtter ikke upload af filer + + The protocol `%1' does not support copying or moving files or directories Protokollen '%1' understøtter ikke kopiering eller flytning af filer eller kataloger + + (unknown) (ukendt) @@ -644,23 +797,27 @@ to Q3Wizard - + &Cancel &Annuller + < &Back < &Tilbage + &Next > &Næste > + &Finish &Udfør + &Help &Hjælp @@ -668,31 +825,44 @@ to QAbstractSocket + + + + Host not found Host blev ikke fundet - + + + Connection refused Forbindelse afvist + Connection timed out Forbindelsen timed out + + + Operation on socket is not supported Socket-operation ikke understøttet + Socket operation timed out Socket-operation timed out + Socket is not connected Socket ikke forbundet + Network unreachable Netværket er ikke tilgængeligt @@ -700,15 +870,17 @@ to QAbstractSpinBox - + &Step up &Trin op + Step &down Trin &ned + &Select All &Vælg alle @@ -716,27 +888,28 @@ to QApplication - + Activate Aktivér - + Executable '%1' requires Qt %2, found Qt %3. Eksekverbar '%1' kræver Qt %2, ikke fundet Qt %3. + Incompatible Qt Library Error Inkompatibel Qt Library fejl - + QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. - + Activates the program's main window Aktiverer programmets hovedvindue @@ -744,18 +917,22 @@ to QAxSelect + Select ActiveX Control Vælg ActiveX-kontrol + OK + &Cancel &Annuller + COM &Object: COM &Objekt: @@ -763,15 +940,17 @@ to QCheckBox - + Uncheck Fjern markering + Check Kryds af + Toggle SlÃ¥ til/fra @@ -779,47 +958,57 @@ to QColorDialog - + Hu&e: Ton&e: + &Sat: &Mæt: + &Val: &Vær: + &Red: &Rød: + &Green: &Grøn: + Bl&ue: Bl&Ã¥: + A&lpha channel: Al&fa-kanal: + Select Color Vælg farve + &Basic colors &Basisfarver + &Custom colors &Egne farver + &Add to Custom Colors &Føj til egne farver @@ -827,20 +1016,23 @@ to QComboBox + + Open Ã…bn - + False Falsk + True Sandt - + Close Luk @@ -848,17 +1040,19 @@ to QCoreApplication - + %1: key is empty QSystemSemaphore %1: nøgle er tom + %1: unable to make key QSystemSemaphore %1: kunne ikke lave nøgle + %1: ftok failed QSystemSemaphore %1: ftok mislykkedes @@ -867,19 +1061,22 @@ to QDB2Driver - + Unable to connect Kunne ikke skabe forbindelse + Unable to commit transaction Kunne ikke gennemføre transaktion + Unable to rollback transaction Kunne ikke tilbagetrække transaktion + Unable to set autocommit Kunne ikke aktivere autocommit @@ -887,26 +1084,33 @@ to QDB2Result + + Unable to execute statement Kunne ikke udføre statement + Unable to prepare statement Kunne ikke forberede udsagn + Unable to bind variable Kunne ikke binde variabel + Unable to fetch record %1 Kunne ikke hente post %1 + Unable to fetch next Kunne ikke hente næste + Unable to fetch first Kunne ikke hente første @@ -914,19 +1118,22 @@ to QDateTimeEdit - + AM + am + PM + pm @@ -934,15 +1141,17 @@ to QDial - + QDial + SpeedoMeter Speedometer + SliderHandle @@ -950,11 +1159,12 @@ to QDialog - + What's This? Hvad er dette? + Done Udført @@ -962,100 +1172,124 @@ to QDialogButtonBox - + + + OK - + &OK + &Save &Gem + Save Gem + Open Ã…bn + &Cancel &Annuller + Cancel Annuller + &Close &Luk + Close Luk + Apply Udfør + Reset Nulstil + Help Hjælp + Don't Save Gem ikke + Discard Kassér + &Yes &Ja + Yes to &All Ja til &alle + &No &Nej + N&o to All Ne&j til alle + Save All Gem alle + Abort Afbryd + Retry Prøv igen + Ignore Ignorer + Restore Defaults Gendan standardværdier + Close without Saving Luk uden at gemme @@ -1063,25 +1297,29 @@ to QDirModel - + Name Navn + Size Størrelse + Kind Match OS X Finder Type + Type All other platforms + Date Modified Ændringsdato @@ -1089,15 +1327,17 @@ to QDockWidget - + Close Luk + Dock LÃ¥st + Float Flydende @@ -1105,10 +1345,12 @@ to QDoubleSpinBox + More Mere + Less Mindre @@ -1116,23 +1358,27 @@ to QErrorMessage - + Debug Message: Debug-besked: + Warning: Advarsel: + Fatal Error: Fatal fejl: + &Show this message again &Vis denne besked igen + &OK @@ -1140,22 +1386,33 @@ to QFile + + Destination file exists Destinationsfil findes + + Cannot remove source file + Kan ikke fjerne kildefil + + + Cannot open %1 for input Kan ikke Ã¥bne %1 til input + Cannot open for output Kan ikke Ã¥bne til output + Failure to write block Kunne ikke skrive blok + Cannot create %1 for output Kunne ikke oprette %1 til output @@ -1163,32 +1420,44 @@ to QFileDialog + + All Files (*) Alle filer (*) + Directories Kataloger + + + + &Open &Ã…bn + + &Save &Gem + Open Ã…bn + %1 already exists. Do you want to replace it? %1 findes allerede. Ønsker du at erstatte den? + %1 File not found. Please verify the correct file name was given. @@ -1197,47 +1466,64 @@ Filen kunne ikke findes. Kontrollér, at det rigtige filnavn er indtastet. - + My Computer Min computer + &Rename &Omdøb + &Delete &Slet + Show &hidden files Vis s&kjulte filer + + Back Tilbage + + Parent Directory Ovenliggende katalog + + List View Listevisning + + Detail View Detaljevisning + + Files of type: Filer af typen: + + Directory: Katalog: + + %1 Directory not found. Please verify the correct directory name was given. @@ -1246,84 +1532,105 @@ Katalog kunne ikke findes. Kontrollér, at det rigtige katalognavn er indtastet. + '%1' is write protected. Do you want to delete it anyway? '%1' er skrivebeskyttet. Ønsker du alligevel at slette? + Are sure you want to delete '%1'? Er du sikker pÃ¥, at '%1' skal slettes? + Could not delete directory. Kunne ikke slette kataloget. + Recent Places Aktuelle steder - + All Files (*.*) Alle filer (*.*) + Save As Gem som - + Drive Drev + + File Fil + Unknown Ukendt + Find Directory Find katalog + Show Vis + + Forward Frem - + New Folder Ny folder + &New Folder &Ny folder + + &Choose &Vælg - + Remove Fjern + + File &name: &Filnavn: + + Look in: Søg i: + + Create New Folder Opret ny folder @@ -1331,62 +1638,74 @@ Do you want to delete it anyway? QFileSystemModel - + Invalid filename Ugyldigt filnavn + <b>The name "%1" can not be used.</b><p>Try using another name, with fewer characters or no punctuations marks. <b>Navnet, %1, kan ikke benyttes.</b><p>Brug et andet navn med færre tegn og ingen kommatering. + Name Navn + Size Størrelse + Kind Match OS X Finder Type + Type All other platforms + Date Modified Ændringsdato - + My Computer Min computer + Computer + %1 TB %1 TB + %1 GB %1 GB + %1 MB %1 MB + %1 KB %1 KB' + %1 bytes %1 bytes @@ -1394,166 +1713,216 @@ Do you want to delete it anyway? QFontDatabase + + Normal + + + Bold Fed + + Demi Bold + + + Black Sort + Demi + + Light Lys + + Italic Kursiv + + Oblique SkrÃ¥t + Any Alle + Latin + Greek Græsk + Cyrillic Kyrillisk + Armenian Armensk + Hebrew Hebræisk + Arabic Arabisk + Syriac Syrisk + Thaana + Devanagari + Bengali Bengalsk + Gurmukhi + Gujarati + Oriya + Tamil + Telugu + Kannada + Malayalam + Sinhala + Thai Thailandsk + Lao + Tibetan Tibetansk + Myanmar + Georgian georgisk + Khmer + Simplified Chinese Forenklet kinesisk + Traditional Chinese Traditionelt kinesisk + Japanese Japansk + Korean Koreansk + Vietnamese Vietnamesisk + Symbol + Ogham + Runic @@ -1561,39 +1930,48 @@ Do you want to delete it anyway? QFontDialog - + &Font S&krifttype + Font st&yle S&til + &Size &Størrelse + Effects Effekter + Stri&keout &Overstreget + &Underline &Understreg + Sample Eksempel + Wr&iting System Skr&ivesystem + + Select Font Vælg skrifttype @@ -1601,116 +1979,145 @@ Do you want to delete it anyway? QFtp - + + Not connected Ingen forbindelse - + + Host %1 not found Vært %1 ikke fundet - + + Connection refused to host %1 Forbindelse til vært %1 afvist + Connection timed out to host %1 Forbindelsen timed out til host %1 + + + Connected to host %1 Tilsluttet vært %1 + + Connection refused for data connection Dataforbindelse afvist + + + + Unknown error Ukendt fejl - + + Connecting to host failed: %1 Forbindelse til vært mislykkedes: %1 - + + Login failed: %1 Login mislykkedes: %1 - + + Listing directory failed: %1 Opremsning af katalogindhold mislykkedes: %1 - + + Changing directory failed: %1 Ændring af katalog mislykkedes: %1 - + + Downloading file failed: %1 Downloading af fil mislykkedes: %1 - + + Uploading file failed: %1 Uploading af fil mislykkedes: %1 - + + Removing file failed: %1 Det mislykkedes at fjerne fil: %1 - + + Creating directory failed: %1 Oprettelse af katalog mislykkedes: %1 - + + Removing directory failed: %1 Det mislykkedes at fjerne katalog: %1 + + + Connection closed Forbindelse lukket + Host %1 found Vært %1 fundet + Connection to %1 closed Forbindelse til %1 lukket + Host found Vært fundet + Connected to host Tilsluttet vært @@ -1718,7 +2125,7 @@ Do you want to delete it anyway? QHostInfo - + Unknown error Ukendt fejl @@ -1726,14 +2133,29 @@ Do you want to delete it anyway? QHostInfoAgent + + + + + + + + Host not found Vært ikke fundet + + + + Unknown address type Ukendt adressetype + + + Unknown error Ukendt fejl @@ -1741,116 +2163,155 @@ Do you want to delete it anyway? QHttp + + + + Unknown error Ukendt fejl + + Request aborted Forespørgsel blev annulleret - + + No server set to connect to Ingen server at forbinde til - + + Wrong content length Forkert indholdslængde - + + Server closed connection unexpectedly Serveren afsluttede uventet forbindelsen + + Unknown authentication method + Ukendt autentifikationsmetode + + + Error writing response to device Skrivefejl mens der blev skrevet til enheden - + + Connection refused Forbindelse afvist - + + + Host %1 not found Vært %1 ikke fundet - + + + + HTTP request failed HTTP anmodning mislykkedes - + + Invalid HTTP response header Ugyldig HTTP-svar-header + + + + Invalid HTTP chunked body Ugyldig HTTP chunked body - + Host %1 found Vært %1 fundet + Connected to host %1 Tilsluttet vært %1 + Connection to %1 closed Forbindelse til %1 lukket + Host found Vært fundet + Connected to host Tilsluttet vært - + + Connection closed Forbindelse lukket + Proxy authentication required Kræver proxy-autentificering + Authentication required Autentificering pÃ¥krævet + Connection refused (or timed out) Forbindelse blev afvist (eller tid udløb) - + Proxy requires authentication Proxy kræver autentificering + Host requires authentication Vært kræver autentificering + Data corrupted Data er ødelagt + Unknown protocol specified En ukendt protokol blev angivet + SSL handshake failed SSL handshake mislykkedes + HTTPS connection requested but SSL support not compiled in Der blevet anmodet om en HTTPS-forbindelse, men SSL understøttelse er ikke kompileret ind @@ -1858,38 +2319,47 @@ Do you want to delete it anyway? QHttpSocketEngine + Did not receive HTTP response from proxy Modtog ikke HTTP-svar fra proxy + Error parsing authentication request from proxy Fejl under fortolking af autentificeringsanmodning fra proxy + Authentication required Autentificering pÃ¥krævet + Proxy denied connection Proxy nægtede forbindelse + Error communicating with HTTP proxy Fejl under kommunikation med HTTP-proxy + Proxy server not found Proxy-server kunne ikke findes + Proxy connection refused Proxy-forbindelse nægtede + Proxy server connection timed out Proxy-serverforbindelse timed out + Proxy connection closed prematurely Proxy-forbindelse afsluttede i utide @@ -1897,19 +2367,22 @@ Do you want to delete it anyway? QIBaseDriver - + Error opening database Der opstod fejl ved Ã¥bning af database + Could not start transaction Kunne ikke pÃ¥begynde transaktionen + Unable to commit transaction Kunne ikke gennemføre transaktionen + Unable to rollback transaction Kunne ikke tilbagetrække transaktionen @@ -1917,70 +2390,89 @@ Do you want to delete it anyway? QIBaseResult + Unable to create BLOB Kunne ikke oprette BLOB + Unable to write BLOB Kunne ikke skrive BLOB + Unable to open BLOB Kunne ikke Ã¥bne BLOB + Unable to read BLOB Kunne ikke læse BLOB + + Could not find array Kunne ikke finde array + Could not get array data Kunne ikke hente arraydata + Could not get query info Kunne ikke hente forespørgselsinfo + Could not start transaction Kunne ikke pÃ¥begynde transaktionen + Unable to commit transaction Kunne ikke gennemføre transaktionen + Could not allocate statement Kunne ikke allokere statement + Could not prepare statement Kunne ikke forberede udsagn + + Could not describe input statement Kunne ikke beskrive input-statement + Could not describe statement Kunne ikke beskrive statement + Unable to close statement Kunne ikke lukke udsagn + Unable to execute query Kunne ikke udføre forespørgsel + Could not fetch next item Kunne ikke hente næste element + Could not get statement info Kunne ikke hente udsagnsinformation @@ -1988,24 +2480,27 @@ Do you want to delete it anyway? QIODevice - + Permission denied Tilladelse nægtet + Too many open files Der er for mange Ã¥bne filer + No such file or directory Fil eller katalog findes ikke + No space left on device Ingen plads tilbage pÃ¥ enheden - + Unknown error Ukendt fejl @@ -2013,19 +2508,22 @@ Do you want to delete it anyway? QInputContext - + XIM + XIM input method XIM input-metode + Windows input method Windows input-metode + Mac OS X input method Mac OS X input-metode @@ -2033,7 +2531,7 @@ Do you want to delete it anyway? QInputDialog - + Enter a value: Indtast en værdi: @@ -2041,55 +2539,66 @@ Do you want to delete it anyway? QLibrary - + Could not mmap '%1': %2 + Plugin verification data mismatch in '%1' Plugin-verifikationsdata er sat forkert sammen i '%1' + Could not unmap '%1': %2 Der var ikke muligt at lave unmap pÃ¥ '%1': %2 + The plugin '%1' uses incompatible Qt library. (%2.%3.%4) [%5] Plugin '%1' bruger inkompatibelt Qt-bibliotek. (%2.%3.%4) [%5] + The plugin '%1' uses incompatible Qt library. Expected build key "%2", got "%3" Plugin '%1' bruger inkompatibelt Qt-bibliotek. Forventet build key "%2", hentede "%3"' + Unknown error Ukendt fejl' - + + The shared library was not found. DSO blev ikke fundet. + The file '%1' is not a valid Qt plugin. Filen '%1' er ikke et gyldigt Qt-plugin. + The plugin '%1' uses incompatible Qt library. (Cannot mix debug and release libraries.) Plugin '%1' bruger inkompatibelt Qt-bibliotek. (Ikke muligt at mikse debug og release-biblioteker) - + + Cannot load library %1: %2 Kan ikke indlæse bibliotek %1: %2 - + + Cannot unload library %1: %2 Kan ikke afregistrere bibliotek %1: %2 - + + Cannot resolve symbol "%1" in %2: %3 Kan ikke løse symbol "%1" i %2: %3 @@ -2097,31 +2606,37 @@ Do you want to delete it anyway? QLineEdit - + &Undo &Fortryd + &Redo &Gendan + Cu&t K&lip + &Copy &Kopiér + &Paste &Sæt ind + Delete Slet + Select All Markér alt @@ -2129,20 +2644,24 @@ Do you want to delete it anyway? QLocalServer - + + %1: Name error %1: Navnefejl + %1: Permission denied %1: Tilladelse nægtet + %1: Address in use %1: Adresse i brug - + + %1: Unknown error %2 %1: Ukendt fejl %2 @@ -2150,54 +2669,70 @@ Do you want to delete it anyway? QLocalSocket - + + %1: Connection refused %1: Forbindelse afvist - + + %1: Remote closed %1: Den anden ende lukkede + + + + %1: Invalid name %1: Ugyldigt navn - + + %1: Socket access error %1: Fejl i socket-adgang - + + %1: Socket resource error %1: Fejl i socket-ressource - + + %1: Socket operation timed out %1: Socket-handling timed out - + + %1: Datagram too large %1: Datagram er for stort + + + %1: Connection error %1: Forbindelsesfejl - + + %1: The socket operation is not supported %1: Socket-handlingen understøttes ikke + %1: Unknown error %1: Ukendt fejl - + + %1: Unknown error %2 %1: Ukendt fejl %2 @@ -2205,23 +2740,27 @@ Do you want to delete it anyway? QMYSQLDriver - + Unable to open database ' Kunne ikke Ã¥bne databasen ' + Unable to connect Kunne ikke forbinde + Unable to begin transaction Kunne ikke pÃ¥begynde transaktionen + Unable to commit transaction Kunne ikke gennemføre transaktionen + Unable to rollback transaction Kunne ikke tilbagetrække transaktionen @@ -2229,46 +2768,59 @@ Do you want to delete it anyway? QMYSQLResult + Unable to fetch data Kunne ikke hente data + Unable to execute query Kunne ikke udføre forespørgsel + Unable to store result Kunne ikke gemme resultatet + + Unable to prepare statement Kunne ikke forberede udsagn + Unable to reset statement Kunne ikke nulstille udsagn + Unable to bind value Kunne ikke tildele værdi + Unable to execute statement Kunne ikke udføre udsagn + + Unable to bind outvalues Kunne ikke binde udværdier + Unable to store statement results Kunne ikke gemme udsagnsresultater + Unable to execute next query Kunne ikke udføre næste forespørgsel + Unable to store next result Kunne ikke gemme næste resultat @@ -2276,7 +2828,7 @@ Do you want to delete it anyway? QMdiArea - + (Untitled) (Uden titel) @@ -2284,75 +2836,92 @@ Do you want to delete it anyway? QMdiSubWindow - + %1 - [%2] + Close Luk + Minimize Minimér + Restore Down Gendan Ned + &Restore &Gendan + &Move &Flyt + &Size &Størrelse + Mi&nimize Mi&nimér + Ma&ximize Ma&ksimér + Stay on &Top Bliv &oppe + &Close &Luk + - [%1] + Maximize Maksimér + Unshade Fjern skygge + Shade Skygge + Restore Gendan + Help Hjælp + Menu @@ -2360,14 +2929,21 @@ Do you want to delete it anyway? QMenu + + Close Luk + + Open Ã…bn + + + Execute Udfør @@ -2375,42 +2951,55 @@ Do you want to delete it anyway? QMessageBox + Help Hjælp + + + + OK + + <h3>About Qt</h3><p>This program uses Qt version %1.</p><p>Qt is a C++ toolkit for cross-platform application development.</p><p>Qt provides single-source portability across MS&nbsp;Windows, Mac&nbsp;OS&nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.</p><p>Qt is available under three different licensing options designed to accommodate the needs of our various users.</p>Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.</p><p>Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.</p><p>Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.</p><p>Please see <a href="http://www.qtsoftware.com/products/licensing">www.qtsoftware.com/products/licensing</a> for an overview of Qt licensing.</p><p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p><p>Qt is a Nokia product. See <a href="http://www.qtsoftware.com/qt/">www.qtsoftware.com/qt</a> for more information.</p> + <h3>Om Qt</h3><p>Dette program anvender Qt version %1.</p><p>Qt er et C++ toolkit til cross-platform applikationsudvikling.</p><p>Qt tilbyder single-source portabilitet til MS&nbsp;Windows, Mac&nbsp;OS&nbsp;X, Linux, og alle større kommercielle Unix-varianter. Qt er ogsÃ¥ tilgængeligt til indlejrede systemer som Qt for Embedded Linux and Qt for Windows CE.</p>Qt er tilgængeligt under tre forskellige licenser skabt med henblik pÃ¥ at imødekomme forskellige brugeres behov.</p><p>Qt licenseret under vores kommercielle licensaftale er passende for udvikling af proprietær/kommerciel software, hvor du ikke ønsker at dele sourcekode med tredie part, eller pÃ¥ anden vis ikke kan tiltræde vilkÃ¥rerne i GNU LGPL version 2.1 eller GNU GPL version 3.0</p><p>Qt licenseret under GLU General Public License version 3.0 er passende for udvikling af Qt applikationer, hvor du ønsker at bruge softwaren i kombination med software under vilkÃ¥rerne i GNU GPL version 3.0, eller hvor du ellers er villig til at overholde vilkÃ¥rerne i GNU GPL version 3.0</p><p>See venligst <a href="http://www.qtsoftware.com/products/licensing">www.qtsoftware.com/products/licensing</a> for et overblik over Qt licensforhold.</p><p>Qt er et Nokia produkt. Se <a href="http://qtsoftware.com/qt/">qtsoftware.com/qt/</a> for yderligere information.</p> + + + About Qt Om Qt <p>This program uses Qt version %1.</p> - <p>Dette program bruger Qt-version %1.</p> + <p>Dette program bruger Qt-version %1.</p> + Show Details... Vis detaljer... + Hide Details... Skjul detaljer... <h3>About Qt</h3>%1<p>Qt is a C++ toolkit for cross-platform application development.</p><p>Qt provides single-source portability across MS&nbsp;Windows, Mac&nbsp;OS&nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.</p><p>Qt is a Nokia product. See <a href="http://qtsoftware.com/qt/">qtsoftware.com/qt/</a> for more information.</p> - <h3>Om Qt</h3>%1<p>Qt er et C++ toolkit til cross-platform applikationsudvikling.</p><p>Qt tilbyder single-source portabilitet til MS&nbsp;Windows, Mac&nbsp;OS&nbsp;X, Linux, og alle større kommercielle Unix-varianter. Qt er ogsÃ¥ tilgængeligt til indlejrede systemer som Qt for Embedded Linux and Qt for Windows CE.</p><p>Qt er et Nokia produkt. Se <a href="http://qtsoftware.com/qt/">qtsoftware.com/qt/</a> for yderligere information.</p> + <h3>Om Qt</h3>%1<p>Qt er et C++ toolkit til cross-platform applikationsudvikling.</p><p>Qt tilbyder single-source portabilitet til MS&nbsp;Windows, Mac&nbsp;OS&nbsp;X, Linux, og alle større kommercielle Unix-varianter. Qt er ogsÃ¥ tilgængeligt til indlejrede systemer som Qt for Embedded Linux and Qt for Windows CE.</p><p>Qt er et Nokia produkt. Se <a href="http://qtsoftware.com/qt/">qtsoftware.com/qt/</a> for yderligere information.</p> <p>This program uses Qt Open Source Edition version %1.</p><p>Qt Open Source Edition is intended for the development of Open Source applications. You need a commercial Qt license for development of proprietary (closed source) applications.</p><p>Please see <a href="http://qtsoftware.com/company/model/">qtsoftware.com/company/model/</a> for an overview of Qt licensing.</p> - <p>Dette program bruger Qt Open Source Edition version %1.</p><p>Qt Open Source Edition er beregnet til udvikling af Open Source applikationer. En kommerciel Qt licens er nødvendig til udvikling af proprietære (lukket sourcekode) applikationer.</p><p>Se venligst <a href="http://qtsoftware.com/company/model/">qtsoftware.com/company/model/</a> for et overblik over Qt licensforhold.</p> + <p>Dette program bruger Qt Open Source Edition version %1.</p><p>Qt Open Source Edition er beregnet til udvikling af Open Source applikationer. En kommerciel Qt licens er nødvendig til udvikling af proprietære (lukket sourcekode) applikationer.</p><p>Se venligst <a href="http://qtsoftware.com/company/model/">qtsoftware.com/company/model/</a> for et overblik over Qt licensforhold.</p> QMultiInputContext - + Select IM Markér IM @@ -2418,11 +3007,12 @@ Do you want to delete it anyway? QMultiInputContextPlugin - + Multiple input method switcher Multiple input metode-switcher + Multiple input method switcher that uses the context menu of the text widgets Multiple input metode-switcher, der benytter tekstkontrollernes kontekstmenuer @@ -2430,107 +3020,132 @@ Do you want to delete it anyway? QNativeSocketEngine - + The remote host closed the connection Fjern-hosten lukkede forbindelsen + Network operation timed out Netværksoperationen timed out + Out of resources Ikke flere ressourcer + Unsupported socket operation Socket-operation ikke understøttet + Protocol type not supported Protokoltypen understøttes ikke + Invalid socket descriptor Ugyldig socket-deskriptor + Network unreachable Netværket er ikke tilgængeligt + Permission denied Tilladelse nægtet + Connection timed out Forbindelsen timed out + Connection refused Forbindelse afvist + The bound address is already in use Den bundne adresse er allerede i brug + The address is not available Adressen er ikke tilgængelig + The address is protected Adressen er beskyttet + Unable to send a message Kunne ikke sende en besked + Unable to receive a message Kunne ikke modtage en besked + Unable to write Kunne ikke skrive + Network error Netværksfejl + Another socket is already listening on the same port En anden socket lytter allerede pÃ¥ samme port + Unable to initialize non-blocking socket Kunne ikke initialisere non-blocking socket + Unable to initialize broadcast socket Kunne ikke initialisere broadcast-socket + Attempt to use IPv6 socket on a platform with no IPv6 support Forsøg pÃ¥ at bruge IPv6-socket pÃ¥ en platform uden IPv6-support + Host unreachable Vært er ikke tilgængelig + Datagram was too large to send Datagrammet var for stort til at blive sendt + Operation on non-socket Handling pÃ¥ non-socket + Unknown error Ukendt fejl + The proxy type is invalid for this operation Proxytypen er ugyldig til denne handling @@ -2538,7 +3153,7 @@ Do you want to delete it anyway? QNetworkAccessCacheBackend - + Error opening %1 Der opstod fejl i at Ã¥bne %1 @@ -2546,23 +3161,27 @@ Do you want to delete it anyway? QNetworkAccessFileBackend - + Request for opening non-local file %1 Anmodning om at Ã¥bne ikke-lokal fil %1 + Error opening %1: %2 Der opstod fejl i at Ã¥bne %1: %2 + Write error writing to %1: %2 Skrivefejl mens der blev skrevet til %1: %2 + Cannot open %1: Path is a directory Kan ikke Ã¥bne %1: Stien er et katalog + Read error reading from %1: %2 Læsefejl mens der blev læst fra %1: %2 @@ -2570,23 +3189,27 @@ Do you want to delete it anyway? QNetworkAccessFtpBackend - + No suitable proxy found Ingen passende proxy blev fundet + Cannot open %1: is a directory Kan ikke Ã¥bne %1: Er et katalog + Logging in to %1 failed: authentication required Der opstod fejl i at logge pÃ¥ %1: Autentificering kræves + Error while downloading %1: %2 Der opstod fejl i at downloade %1: %2 + Error while uploading %1: %2 Der opstod fejl i at uploade %1: %2 @@ -2594,7 +3217,7 @@ Do you want to delete it anyway? QNetworkAccessHttpBackend - + No suitable proxy found Ingen passende proxy blev fundet @@ -2602,11 +3225,12 @@ Do you want to delete it anyway? QNetworkReply + Error downloading %1 - server replied: %2 Der opstod fejl i at downloade %1 - serveren svarede: %2 - + Protocol "%1" is unknown Protokollen "%1" er ukendt @@ -2614,6 +3238,8 @@ Do you want to delete it anyway? QNetworkReplyImpl + + Operation canceled Handling blev annulleret @@ -2621,24 +3247,28 @@ Do you want to delete it anyway? QOCIDriver - + Unable to logon Kunne ikke logge pÃ¥ + Unable to initialize QOCIDriver Kunne ikke initialisere + Unable to begin transaction Kunne ikke pÃ¥begynde transaktionen + Unable to commit transaction Kunne ikke gennemføre transaktionen + Unable to rollback transaction Kunne ikke tilbagetrække transaktionen @@ -2646,34 +3276,43 @@ Do you want to delete it anyway? QOCIResult + + + Unable to bind column for batch execute Kunne ikke tildele kolonne til batch-udførsel + Unable to execute batch statement Kunne ikke udføre batch-udsagn + Unable to goto next Kunne ikke gÃ¥ til den næste + Unable to alloc statement Kunne ikke allokere udsagn + Unable to prepare statement Kunne ikke forberede udsagn + Unable to bind value Kunne ikke tildele værdi Unable to execute select statement - Kunne ikke udføre det valgte udsagn + Kunne ikke udføre det valgte udsagn + Unable to execute statement Kunne ikke udføre udsagn @@ -2681,27 +3320,32 @@ Do you want to delete it anyway? QODBCDriver - + Unable to connect Kunne ikke forbinde + Unable to connect - Driver doesn't support all needed functionality Kunne ikke forbinde. Driveren understøtter ikke alle de nødvendige funktionaliteter + Unable to disable autocommit Kunne ikke slÃ¥ auto-udfør fra + Unable to commit transaction Kunne ikke gennemføre transaktionen + Unable to rollback transaction Kunne ikke tilbagetrække transaktionen + Unable to enable autocommit Kunne ikke slÃ¥ auto-udfør til @@ -2709,38 +3353,51 @@ Do you want to delete it anyway? QODBCResult + + QODBCResult::reset: Unable to set 'SQL_CURSOR_STATIC' as statement attribute. Please check your ODBC driver configuration QODBCResult::reset: Kunne ikke indstille 'SQL_CURSOR_STATIC' til udsagnsattribut. Kontrollér ODBC-driver-konfigurationen + + Unable to execute statement Kunne ikke udføre udsagn + Unable to fetch next Kunne ikke hente den næste + Unable to prepare statement Kunne ikke forberede udsagn + Unable to bind variable Kunne ikke tildele variabel + + + Unable to fetch last Kunne ikke hente den sidste + Unable to fetch Kunne ikke hente + Unable to fetch first Kunne ikke hente den første + Unable to fetch previous Kunne ikke hente den forrige @@ -2748,41 +3405,48 @@ Do you want to delete it anyway? QObject - + Home Hjem - + Operation not supported on %1 Handling blev ikke understøttet pÃ¥ %1 + Invalid URI: %1 Ugyldig URI: %1 - + Write error writing to %1: %2 Skrivefejl mens der blev skrevet til %1: %2 + Read error reading from %1: %2 Læsefejl mens der blev læst fra %1: %2 + Socket error on %1: %2 Socket-fejl pÃ¥ %1: %2 + Remote host closed the connection prematurely on %1 Fjern-host lukkede forbindelsen for tidligt pÃ¥ %1 + Protocol error: packet of size 0 received Protokolfejl: Pakke pÃ¥ størrelsen 0 modtaget + + No host name given Hostnavn mangler @@ -2790,11 +3454,12 @@ Do you want to delete it anyway? QPPDOptionsModel - + Name Navn + Value Værdi @@ -2802,27 +3467,32 @@ Do you want to delete it anyway? QPSQLDriver - + Unable to connect Kunne ikke skabe forbindelse + Could not begin transaction Kunne ikke pÃ¥begynde transaktion + Could not commit transaction Kunne ikke gennemføre transaktion + Could not rollback transaction Kunne ikke tilbagetrække transaktion + Unable to subscribe Kunne ikke tilmelde + Unable to unsubscribe Kunne ikke afmelde @@ -2830,10 +3500,12 @@ Do you want to delete it anyway? QPSQLResult + Unable to create query Kunne ikke oprette forespørgsel + Unable to prepare statement Kunne ikke forberede udsagn @@ -2841,83 +3513,102 @@ Do you want to delete it anyway? QPageSetupWidget - + Centimeters (cm) Centimeter (cm) + Millimeters (mm) Millimeter (mm) + Inches (in) + Points (pt) Point (pt) + Form + Paper Papir + Page size: Sidestørrelse: + Width: Vidde: + Height: Højde: + Paper source: Papirkilde: + Orientation + Portrait Portræt + Landscape Landskab + Reverse landscape Omvendt landskab + Reverse portrait Omvendt portræt + Margins Margener + top margin Margen - øverst + left margin Margen - venstre + right margin Margen - højre + bottom margin Margen - bund @@ -2925,11 +3616,12 @@ Do you want to delete it anyway? QPluginLoader - + Unknown error Ukendt fejl + The plugin was not loaded. Plugin blev ikke indlæst. @@ -2937,346 +3629,428 @@ Do you want to delete it anyway? QPrintDialog - + locally connected lokalt forbundet + + Aliases: %1 Aliasser: %1 + + unknown Ukendt - + A0 (841 x 1189 mm) + A1 (594 x 841 mm) + A2 (420 x 594 mm) + A3 (297 x 420 mm) + A4 (210 x 297 mm, 8.26 x 11.7 inches) + A5 (148 x 210 mm) + A6 (105 x 148 mm) + A7 (74 x 105 mm) + A8 (52 x 74 mm) + A9 (37 x 52 mm) + B0 (1000 x 1414 mm) + B1 (707 x 1000 mm) + B2 (500 x 707 mm) + B3 (353 x 500 mm) + B4 (250 x 353 mm) + B5 (176 x 250 mm, 6.93 x 9.84 inches) + B6 (125 x 176 mm) + B7 (88 x 125 mm) + B8 (62 x 88 mm) + B9 (44 x 62 mm) + B10 (31 x 44 mm) + C5E (163 x 229 mm) + DLE (110 x 220 mm) + Executive (7.5 x 10 inches, 191 x 254 mm) + Folio (210 x 330 mm) + Ledger (432 x 279 mm) + Legal (8.5 x 14 inches, 216 x 356 mm) + Letter (8.5 x 11 inches, 216 x 279 mm) + Tabloid (279 x 432 mm) + US Common #10 Envelope (105 x 241 mm) - + OK + + + Print Udskriv + Print To File ... Udskriv til fil... - + Print range UdskriftsomrÃ¥de + Print all Udskriv alle - + File %1 is not writable. Please choose a different file name. Filen %1 kan ikke skrives. Vælg et andet filnavn. + %1 already exists. Do you want to overwrite it? %1 findes allerede. Ønsker du at overskrive? + File exists Fil findes + <qt>Do you want to overwrite it?</qt> <qt>Ønsker du at overskrive?</qt> + Print selection Udskriv markerede + %1 is a directory. Please choose a different file name. %1 er et katalog. Vælg et andet filnavn. + A0 + A1 + A2 + A3 + A4 + A5 + A6 + A7 + A8 + A9 + B0 + B1 + B2 + B3 + B4 + B5 + B6 + B7 + B8 + B9 + B10 + C5E + DLE + Executive + Folio + Ledger + Legal + Letter + Tabloid + US Common #10 Envelope + Custom Brugerdefineret + + &Options >> &Indstillinger>> + &Print &Udskriv + &Options << &Indstillinger<< + Print to File (PDF) Udskriv til fil (PDF) + Print to File (Postscript) Udskriv til fil (Postscript) + Local file Lokal fil + Write %1 file Skriv %1 fil - + The 'From' value cannot be greater than the 'To' value. 'Fra'-værdien kan ikke være større end 'til'-værdien. @@ -3284,87 +4058,108 @@ Vælg et andet filnavn. QPrintPreviewDialog + + Page Setup Sideopsætning - + %1% + Print Preview Vis udskrift + Next page Næste side + Previous page Forrige side + First page Første side + Last page Sidste side + Fit width Tilpas bredde + Fit page Tilpas siden + Zoom in Zoom ind + Zoom out Zoom ud + Portrait Portræt + Landscape Landskab + Show single page Vis enkelt side + Show facing pages Vis sideopslag + Show overview of all pages Vis oversigt af alle sider + Print Udskriv + Page setup Sideopsætning + Close Luk + Export to PDF Eksportér til PDF + Export to PostScript Eksportér til PostScript @@ -3372,14 +4167,17 @@ Vælg et andet filnavn. QPrintPropertiesWidget + Form Form + Page Side + Advanced Avanceret @@ -3387,78 +4185,97 @@ Vælg et andet filnavn. QPrintSettingsOutput + Form + Copies Kopier + Print range Udskriv sider + Print all Udskriv alle + Pages from Sider fra + to til + Selection Valg + Output Settings Udskriftsindstillinger + Copies: Kopier: + Collate Samordne + Reverse Omvendt + Options Valgmuligheder + Color Mode Farvetilstand + Color Farve + Grayscale GrÃ¥skala + Duplex Printing Dobbelsidet + None Ingen + Long side Bog + Short side Tavle @@ -3466,38 +4283,47 @@ Vælg et andet filnavn. QPrintWidget + Form + Printer ' + &Name: &Navn: + P&roperties &Egenskaber + Location: Placering: + Preview Vis udskrift + Type: + Output &file: Udskrifts&fil: + ... @@ -3505,37 +4331,62 @@ Vælg et andet filnavn. QProcess - + + Could not open input redirection for reading Kunne ikke Ã¥bne input redirection for læsning - + + Could not open output redirection for writing Kunne ikke Ã¥bne output redirection for skrivning + Resource error (fork failure): %1 Ressource fejl (fork fejl): %1 + + + + + + + + + Process operation timed out Proces-operation time out + + + + Error reading from process Fejl ved læsning fra proces - + + + Error writing to process Fejl ved skrivning til proces + Process crashed Proces crashede + + No program defined + Intet program defineret + + + Process failed to start Processen kunne ikke starte @@ -3543,7 +4394,7 @@ Vælg et andet filnavn. QProgressDialog - + Cancel Annuller @@ -3551,6 +4402,7 @@ Vælg et andet filnavn. QPushButton + Open Ã…bn @@ -3558,6 +4410,7 @@ Vælg et andet filnavn. QRadioButton + Check Kontrollér @@ -3565,39 +4418,47 @@ Vælg et andet filnavn. QRegExp - + no error occurred der opstod ingen fejl + disabled feature used deaktiveret funktion blev brugt + bad char class syntax dÃ¥rlig char class syntaks + bad lookahead syntax dÃ¥rlig lookahead syntaks + bad repetition syntax dÃ¥rlig gentagelsessyntaks + invalid octal value ugyldigt oktal-tal + missing left delim Manglende venstre delimiter + unexpected end uventet afslutning + met internal limit nÃ¥ede interne grænse @@ -3605,19 +4466,22 @@ Vælg et andet filnavn. QSQLite2Driver - + Error to open database Der opstod fejl ved Ã¥bning af database + Unable to begin transaction Kunne ikke pÃ¥begynde transaktionen + Unable to commit transaction Kunne ikke gennemføre transaktionen + Unable to rollback Transaction Kunne ikke tilbagetrække transaktion @@ -3625,10 +4489,12 @@ Vælg et andet filnavn. QSQLite2Result + Unable to fetch results Kunne ikke hente resultater + Unable to execute statement Kunne ikke udføre statement @@ -3636,23 +4502,27 @@ Vælg et andet filnavn. QSQLiteDriver - + Error opening database Der opstod fejl ved Ã¥bning af database + Error closing database Der opstod fejl ved lukning af database + Unable to begin transaction Kunne ikke pÃ¥begynde transaktionen + Unable to commit transaction Kunne ikke gennemføre transaktion + Unable to rollback transaction Kunne ikke tilbagetrække transaktion @@ -3660,26 +4530,34 @@ Vælg et andet filnavn. QSQLiteResult + + + Unable to fetch row Kunne ikke hente række + Unable to execute statement Kunne ikke udføre udsagn + Unable to reset statement Kunne ikke nulstille udsagn + Unable to bind parameters Unable to bind parameters + Parameter count mismatch Misforhold i parametertælling + No query Ingen forespørgesel @@ -3687,69 +4565,84 @@ Vælg et andet filnavn. QScrollBar - + Scroll here Scroll her + Left edge Venstre kant + Top Øverst + Right edge Højre kant + Bottom Bund + Page left Side venstre - + + Page up Side øverst + Page right Side højre - + + Page down Side ned + Scroll left Scroll til venstre + Scroll up Scroll op + Scroll right Scroll til højre + Scroll down Scroll ned + Line up Linie op + Position Placering + Line down Linie ned @@ -3757,81 +4650,99 @@ Vælg et andet filnavn. QSharedMemory - + %1: unable to set key on lock %1: Kunne ikke oprette nøgle + %1: create size is less then 0 %1: create size is less then 0 - + + %1: unable to lock %1: Kunne ikke lÃ¥se + %1: unable to unlock %1: Kunne ikke oprette nøgle - + + %1: permission denied %1: Tilladelse nægtet + + %1: already exists %1: Findes allerede - + + %1: doesn't exists %1: Findes ikke - + + %1: out of resources %1: Ikke flere ressourcer - + + %1: unknown error %2 %1: ukendt fejl %2 + %1: key is empty %1: nøgle er tom + %1: unix key file doesn't exists %1: Kunne ikke oprette nøgle + %1: ftok failed %1: ftok mislykkedes - + + %1: unable to make key %1: Kunne ikke oprette nøgle + %1: system-imposed size restrictions %1: System-pÃ¥lagte størrelsesrestriktioner + %1: not attached %1: Ikke vedhæftet + %1: invalid size %1: Ugyldig størrelse + %1: key error %1: Nøglefejl + %1: size query failed %1: Størrelsesforespørgsel mislykkedes @@ -3839,371 +4750,466 @@ Vælg et andet filnavn. QShortcut - + Space + Esc + Tab + Backtab Tilbage-tabulator + Backspace Tilbage + Return + Enter + Ins + Del + Pause + Print Udskriv + SysReq + Home + End + Left Venstre + Up Op + Right Højre + Down Ned + PgUp + PgDown + CapsLock ' + NumLock + ScrollLock + Menu + Help Hjælp + Back Tilbage + Forward Frem + Stop + Refresh Opdater + Volume Down Lydstyrke ned + Volume Mute Lydstyrke mute + Volume Up Lydstyrke op + Bass Boost + Bass Up Bass op + Bass Down Bass ned + Treble Up Diskant op + Treble Down Diskant ned + Media Play + Media Stop + Media Previous Media forrige + Media Next Media næste + Media Record + Favorites + Search Søg + Standby + Open URL Ã…bn URL + Launch Mail Start mail + Launch Media Start Media + Launch (0) Start (0) + Launch (1) Start (1) + Launch (2) Start (2) + Launch (3) Start (3) + Launch (4) Start (4) + Launch (5) Start (5) + Launch (6) Start (6) + Launch (7) Start (7) + Launch (8) Start (8) + Launch (9) Start (9) + Launch (A) Start (A) + Launch (B) Start (B) + Launch (C) Start (C) + Launch (D) Start (D) + Launch (E) Start (E) + Launch (F) Start (F) + Print Screen + Page Up + Page Down + Caps Lock + Num Lock + Number Lock + Scroll Lock + Insert + Delete + Escape + System Request + Select Væg + Yes Ja + No Nej + Context1 Kontekst1 + Context2 Kontekst2 + Context3 Kontekst3 + Context4 Kontekst4 + Call Ring til + Hangup Læg pÃ¥ + Flip Vend + + Ctrl + + Shift + + Alt + + Meta + + + F%1 + Home Page Startside @@ -4211,23 +5217,27 @@ Vælg et andet filnavn. QSlider - + Page left Side venstre + Page up Side op + Position Placering + Page right Side højre + Page down Side ned @@ -4235,58 +5245,72 @@ Vælg et andet filnavn. QSocks5SocketEngine + Connection to proxy refused Proxy-forbindelse nægtede + Connection to proxy closed prematurely Proxy-forbindelse afsluttede i utide + Proxy host not found Proxy-host kunne ikke findes + Connection to proxy timed out Proxy-serverforbindelse timed out + Proxy authentication failed Proxy autentificering mislykkedes + Proxy authentication failed: %1 Proxy autentificering mislykkedes: %1 + SOCKS version 5 protocol error SOCKS version 5 protokolfejl + General SOCKSv5 server failure General SOCKSv5 serverfejl + Connection not allowed by SOCKSv5 server Forbindelse ikke tilladt a SOCKSv5-server + TTL expired TTL udløbet + SOCKSv5 command not supported SOCKSv5-kommando ikke understøttet + Address type not supported Adressetype understøttes ikke + Unknown SOCKSv5 proxy error code 0x%1 Ukendt SOCKSv5 proxy fejlkode 0x%1 + Network operation timed out Netværksoperationen timed out @@ -4294,10 +5318,12 @@ Vælg et andet filnavn. QSpinBox + More Mere + Less Mindre @@ -4305,43 +5331,56 @@ Vælg et andet filnavn. QSql - + Delete Slet + Delete this record? Slet denne post? + + + Yes Ja + + + No Nej + Insert Indsæt + Update Opdater + Save edits? Gem ændringer? + Cancel Annuller + Confirm Bekræft + Cancel your edits? Skal dine ændringer annulleres? @@ -4349,47 +5388,57 @@ Vælg et andet filnavn. QSslSocket - + Unable to write data: %1 Kunne ikke skrive data: %1 + Error while reading: %1 Der opstod en fejl under læsning af: %1 + Error during SSL handshake: %1 Der opstod en fejl under SSL handshake: %1 + Error creating SSL context (%1) Der opstod fejl under oprettelse af SSL-kontekst (%1) + Invalid or empty cipher list (%1) Ugyldig eller tom chifferliste (%1) + Error creating SSL session, %1 Der opstod fejl under oprettelse af SSL-session, %1 + Error creating SSL session: %1 Der opstod fejl under oprettelse af SSL-session, %1 + Cannot provide a certificate with no key, %1 Kan ikke give et certifikat uden nøgle, %1 + Error loading local certificate, %1 Der opstod fejl under indlæsning af lokalt certifikat, %1 + Error loading private key, %1 Der opstod fejl under indlæsning af privat nøgle, %1 + Private key does not certificate public key, %1 Privat-nøgle autoriserer ikke offentlig-nøgle, %1 @@ -4397,25 +5446,30 @@ Vælg et andet filnavn. QSystemSemaphore - + + %1: out of resources %1: Ikke flere ressourcer - + + %1: permission denied %1: Tilladelse nægtet + %1: already exists %1: Findes allerede + %1: does not exist %1: Findes ikke - + + %1: unknown error %2 %1: Ukendt fejl %2 @@ -4423,11 +5477,12 @@ Vælg et andet filnavn. QTDSDriver - + Unable to open connection Kunne ikke etablere forbindelsen + Unable to use database Kunne ikke bruge databasen @@ -4435,10 +5490,12 @@ Vælg et andet filnavn. QTabBar + Scroll Left Scroll til venstre + Scroll Right Scroll til højre @@ -4446,7 +5503,7 @@ Vælg et andet filnavn. QTcpServer - + Operation on socket is not supported Socket-operation ikke understøttet @@ -4454,35 +5511,42 @@ Vælg et andet filnavn. QTextControl - + &Undo &Fortryd + &Redo &Gendan + Cu&t K&lip + &Copy &Kopiér + Copy &Link Location Kopiér l&ink + &Paste &Sæt ind + Delete Slet + Select All Markér alt @@ -4490,10 +5554,14 @@ Vælg et andet filnavn. QToolButton + + Press Tryk pÃ¥ + + Open Ã…bn @@ -4501,7 +5569,7 @@ Vælg et andet filnavn. QUdpSocket - + This platform does not support IPv6 Denne platform understøtter ikke IPv6 @@ -4509,11 +5577,12 @@ Vælg et andet filnavn. QUndoGroup - + Undo Fortryd + Redo Gendan @@ -4521,7 +5590,7 @@ Vælg et andet filnavn. QUndoModel - + <empty> <tom> @@ -4529,11 +5598,12 @@ Vælg et andet filnavn. QUndoStack - + Undo Fortryd + Redo Gendan @@ -4541,47 +5611,57 @@ Vælg et andet filnavn. QUnicodeControlCharacterMenu - + LRM Left-to-right mark + RLM Right-to-left mark + ZWJ Zero width joiner + ZWNJ Zero width non-joiner + ZWSP Zero width space + LRE Start of left-to-right embedding + RLE Start of right-to-left embedding + LRO Start of left-to-right override + RLO Start of right-to-left override + PDF Pop directional formatting + Insert Unicode control character @@ -4589,27 +5669,32 @@ Vælg et andet filnavn. QWebFrame - + Request cancelled Anmodning annulleret + Request blocked Anmodning blokeret + Cannot show URL Kan ikke vise URL + Frame load interruped by policy change Billedindlæsning afbrudt af ændringer i retningslinier + Cannot show mimetype Kan ikke vise MIME-type + File does not exist Filen findes ikke @@ -4617,316 +5702,376 @@ Vælg et andet filnavn. QWebPage - + Bad HTTP request DÃ¥rlig HTTP-anmodning - + Submit default label for Submit buttons in forms on web pages Send + Submit Submit (input element) alt text for <input> elements with no alt, title, or value Send + Reset default label for Reset buttons in forms on web pages Nulstil + This is a searchable index. Enter search keywords: text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index' Dette er et søgeindeks. Indtast søgeord: + Choose File title for file button used in HTML forms Vælg fil + No file selected text to display in file button used in HTML forms when no file is selected Der er ikke valgt en fil + Open in New Window Open in New Window context menu item Ã…bn i nyt vindue + Save Link... Download Linked File context menu item Gem link... + Copy Link Copy Link context menu item Kopiér link + Open Image Open Image in New Window context menu item Ã…bn billede + Save Image Download Image context menu item Gem billede + Copy Image Copy Link context menu item Kopiér billede + Open Frame Open Frame in New Window context menu item Ã…bn faneblad + Copy Copy context menu item Kopiér + Go Back Back context menu item GÃ¥ tilbage + Go Forward Forward context menu item GÃ¥ frem + Stop Stop context menu item Stop + Reload Reload context menu item Genindlæs + Cut Cut context menu item Klip + Paste Paste context menu item Sæt ind + No Guesses Found No Guesses Found context menu item Der er ikke fundet nogen gæt + Ignore Ignore Spelling context menu item Ignorér + Add To Dictionary Learn Spelling context menu item Tilføj til ordbog + Search The Web Search The Web context menu item Søg pÃ¥ nettet + Look Up In Dictionary Look Up in Dictionary context menu item SlÃ¥ op i ordbog + Open Link Open Link context menu item Ã…bn link + Ignore Ignore Grammar context menu item Ignorér + Spelling Spelling and Grammar context sub-menu item Stavekontrol + Show Spelling and Grammar menu item title Vis stave- og grammatikkontrol + Hide Spelling and Grammar menu item title Skjul stave- og grammatikkontrol + Check Spelling Check spelling context menu item Kør stavekontrol + Check Spelling While Typing Check spelling while typing context menu item Kør stavekontrol mens der tastes + Check Grammar With Spelling Check grammar with spelling context menu item Kør grammatikkontrol sammen med stavekontrol + Fonts Font context sub-menu item Skrifttyper + Bold Bold context menu item Fed + Italic Italic context menu item Kursiv + Underline Underline context menu item Understreget + Outline Outline context menu item Kontur + Direction Writing direction context sub-menu item Retning + Text Direction Text direction context sub-menu item Tekstretning + Default Default writing direction context menu item Standard + LTR Left to Right context menu item + RTL Right to Left context menu item + Inspect Inspect Element context menu item Inspicér + No recent searches Label for only item in menu that appears when clicking on the search field image, when no searches have been performed Ingen aktuelle søgninger + Recent searches label for first item in the menu that appears when clicking on the search field image, used as embedded menu title Aktuelle søgninger + Clear recent searches menu item in Recent Searches menu that empties menu's contents Ryd aktuelle søgninger + Unknown Unknown filesize FTP directory listing item Ukendt + %1 (%2x%3 pixels) Title string for images %1 (%2x%3 pixels) - + Web Inspector - %2 Web-inspektør - %2 - + Scroll here Scroll her + Left edge Venstre kant + Top + Right edge Højre kant + Bottom Bund + Page left Side venstre + Page up Side øverst + Page right Side højre + Page down Side ned + Scroll left Scroll til venstre + Scroll up Scroll op + Scroll right Scroll til højre + Scroll down Scroll ned - + %n file(s) number of chosen file @@ -4935,127 +6080,170 @@ Vælg et andet filnavn. - + JavaScript Alert - %1 JavaScript alert - %1 + JavaScript Confirm - %1 JavaScript Bekræft - %1 + JavaScript Prompt - %1 JavaScript Prompt - %1 + Move the cursor to the next character Flyt markør til næste tegn + Move the cursor to the previous character Flyt markør til forrige tegn + Move the cursor to the next word Flyt markør til næste ord + Move the cursor to the previous word Flyt markør til forrige ord + Move the cursor to the next line Flyt markør til næste linie + Move the cursor to the previous line Flyt markør til forrige linie + Move the cursor to the start of the line Flyt markør til starten af linien + Move the cursor to the end of the line Flyt markør til slutningen af linien + Move the cursor to the start of the block Flyt markør til starten af sektionen + Move the cursor to the end of the block Flyt markør til slutningen af sektionen + Move the cursor to the start of the document Flyt markør til starten af dokumentet + Move the cursor to the end of the document Flyt markør til slutningen af dokumentet + + Select all + Markér alt + + + Select to the next character Vælg til næste tegn + Select to the previous character Vælg til forrige tegn + Select to the next word Vælg til næste ord + Select to the previous word Vælg til forrige ord + Select to the next line Vælg til næste linie + Select to the previous line Vælg til forrige linie + Select to the start of the line Vælg til starten af linien + Select to the end of the line Vælg til slutningen af linien + Select to the start of the block Vælg til starten af sektionen + Select to the end of the block Vælg til slutningen af sektionen + Select to the start of the document Vælg til starten af dokumentet + Select to the end of the document Vælg til slutningen af dokumentet + Delete to the start of the word Slet til starten af ordet + Delete to the end of the word Slet til slutningen af ordet + + + Insert a new paragraph + Indsæt et nyt afsnit + + + + Insert a new line + Insert ny linie + QWhatsThisAction - + What's This? Hvad er dette? @@ -5063,7 +6251,7 @@ Vælg et andet filnavn. QWidget - + * @@ -5071,47 +6259,57 @@ Vælg et andet filnavn. QWizard - + Go Back GÃ¥ tilbage + Continue Fortsæt + Commit Udfør + Done Færdig + Help Hjælp + < &Back < &Tilbage + &Finish &Afslut + Cancel Annuller + &Help &Hjælp + &Next &Næste + &Next > &Næste > @@ -5119,55 +6317,69 @@ Vælg et andet filnavn. QWorkspace - + &Restore &Gendan + &Move &Flyt + &Size &Størrelse + Mi&nimize Mi&nimér + Ma&ximize Ma&ksimér + &Close &Luk + Stay on &Top Bliv pÃ¥ &toppen + + Sh&ade Sk&ygge + + %1 - [%2] + Minimize Minimer + Restore Down Gendan ned + Close Luk + &Unshade &Fjern skygge @@ -5175,95 +6387,117 @@ Vælg et andet filnavn. QXml - + no error occurred der opstod ingen fejl + error triggered by consumer - + Fejltilstand rejst af datamodtager + unexpected end of file uventet afslutning pÃ¥ fil + more than one document type definition mere end én definition pÃ¥ dokumenttype + error occurred while parsing element der opstod fejl under fortolking af element + tag mismatch + error occurred while parsing content der opstod fejl under fortolking af indhold + unexpected character uventet tegn + invalid name for processing instruction - + Ugyldigt navn for processing instruction + version expected while reading the XML declaration version forventet under læsning af XML-deklaration + wrong value for standalone declaration - + Forkert værdi for fri deklaration + encoding declaration or standalone declaration expected while reading the XML declaration - + Enkodningsdeklaration eller fri deklaration forventet ved læsning af XML-deklaration + standalone declaration expected while reading the XML declaration - + fri deklaration forventet ved læsning af XML-deklaration + error occurred while parsing document type definition der opstod fejl under fortolking af dokumenttypedefinition + letter is expected - + bogstav forventet + error occurred while parsing comment der opstod fejl under fortolking af kommentar + error occurred while parsing reference der opstod fejl under fortolking af reference + internal general entity reference not allowed in DTD - + intern generel entitetsreference ikke tilladt i DTD + external parsed general entity reference not allowed in attribute value - + Eksternt parset generel entitetsreference ikke tilladt i attributværdi + external parsed general entity reference not allowed in DTD - + Eksternt parset generel entitetsreference ikke tilladt i DTD + unparsed entity reference in wrong context ufortolket enhedsreference i forkert kontekst + recursive entities - + rekursive entiteter + error in the text declaration of an external entity fejl i tekstdeklaration pÃ¥ en ekstern enhed @@ -5271,412 +6505,485 @@ Vælg et andet filnavn. QXmlStream - + + Extra content at end of document. Ekstra indhold sidst i dokumentet. + Invalid entity value. Ugyldig enhedsværdi. + Invalid XML character. Ugyldigt XML-tegn. + Sequence ']]>' not allowed in content. Sekvens ']]>' ikke tilladt i indhold. + Namespace prefix '%1' not declared Navnerumspræfiks '%1' ikke deklareret + Attribute redefined. - + Attribut redefineret. + Unexpected character '%1' in public id literal. - + Uventet tegn '%1' i public id værdi. + Invalid XML version string. Ugyldigt XML-versionsstreng. + Unsupported XML version. XML-version understøttes ikke. + %1 is an invalid encoding name. - + %1 er et ugyldigt enkodningsnavn. + Encoding %1 is unsupported - + Enkodning %1 er ikke understøttet + Standalone accepts only yes or no. + Invalid attribute in XML declaration. - + Ugyldig attribut i XML-deklaration. + Premature end of document. - + Dokument sluttede for tidligt. + Invalid document. Ugyldigt dokument. + Expected Forventet + , but got ' , men fik ' + Unexpected ' Uventet ' + Expected character data. Forventet tegndata. + Recursive entity detected. - + Rekursiv entitet opdaget. + Start tag expected. Start-tag forventet. + XML declaration not at start of document. XML-deklaration ikke i starten af dokumentet. + NDATA in parameter entity declaration. - + NDATA i parameterentitetsdeklaration. + %1 is an invalid processing instruction name. - + %1 er et ugyldigt processing-instruction-navn. + Invalid processing instruction name. - + Ugyldigt processing-instruction-navn. + + + + Illegal namespace declaration. Ulovligt navnerumsdeklaration. - + Invalid XML name. Ugyldigt XML-navn. + Opening and ending tag mismatch. Ã…bner og afslutter tag-mismatch. + Reference to unparsed entity '%1'. Reference to ufortolket enhed '%1'. + + + Entity '%1' not declared. Enheden '%1' ikke deklareret. + Reference to external entity '%1' in attribute value. Reference til ekstern enhed '%1' i attributværdi. + Invalid character reference. Ugyldig tegnreference. + + Encountered incorrectly encoded content. - + Indhold med forkert enkodning læst. + The standalone pseudo attribute must appear after the encoding. - + Den frie pseudo-attribut skal optræde efter enkodningen. - + %1 is an invalid PUBLIC identifier. - + %1 er en ugyldig PUBLIC identifier. QtXmlPatterns - + An %1-attribute with value %2 has already been declared. - + En %1-attribut med værdi %2 er allerede erklæret. + An %1-attribute must have a valid %2 as value, which %3 isn't. - + En %1-attribut skal have en gyldig %2 som værdi, hvilket %3 ikke er. - + Network timeout. - + Netværk timeout. - + Element %1 can't be serialized because it appears outside the document element. - + Element %1 kan ikke serialiseres fordi det optræder udenfor dokument-elementet. - + Year %1 is invalid because it begins with %2. - + Ã…r %1 er ugyldigt da det begynder med %2. + Day %1 is outside the range %2..%3. - + Dag %1 er udenfor intervallet %2..%3. + Month %1 is outside the range %2..%3. - + MÃ¥ned %1 er udenfor intervallet %2..%3. + Overflow: Can't represent date %1. - + Overflow: Kan ikke repræsentere dato %1. + Day %1 is invalid for month %2. - + Dag %1 er ugyldig for mÃ¥net %2. + Time 24:%1:%2.%3 is invalid. Hour is 24, but minutes, seconds, and milliseconds are not all 0; - + Tidspunkt 24:%1:%2.%3 er ugyldigt. Timetal er 24, men minutter, sekunder og millisekunder er ikke alle 0; + Time %1:%2:%3.%4 is invalid. - + Tidspunkt %1:%2:%3.%4 er ugyldigt. + Overflow: Date can't be represented. - + Overflow: Dato kan ikke repræsenteres. + + At least one component must be present. - + Mindst en komponent skal være tilstede. + At least one time component must appear after the %1-delimiter. - + Mindst en tidskomponent skal optræde efter %1-skillemærket. - + No operand in an integer division, %1, can be %2. - + Ingen operand i en heltalsdivision, %1, kan være %2. + The first operand in an integer division, %1, cannot be infinity (%2). - + Den første operand i en heltalsdivision, %1, kan ikke være uendeligt (%2). + The second operand in a division, %1, cannot be zero (%2). - + Den anden operand i en division, %1, kan ikke være nul (%2). - + %1 is not a valid value of type %2. - + %1 er ikke en gyldig værdi af typen %2. - + When casting to %1 from %2, the source value cannot be %3. - + Ved cast til %1 fra %2, kan kildeværdien ikke være %3. - + Integer division (%1) by zero (%2) is undefined. - + Heltalsdivision (%1) med nul (%2) er udefineret. + Division (%1) by zero (%2) is undefined. - + Division (%1) med nul (%2) er udefineret. + Modulus division (%1) by zero (%2) is undefined. - + Modulusdivision (%1) med nul (%2) er udefineret. + + Dividing a value of type %1 by %2 (not-a-number) is not allowed. - + Division af værdi af typen %1 med %2 (ikke et tal) er ikke tilladt. + Dividing a value of type %1 by %2 or %3 (plus or minus zero) is not allowed. + Multiplication of a value of type %1 by %2 or %3 (plus or minus infinity) is not allowed. - + A value of type %1 cannot have an Effective Boolean Value. - + Effective Boolean Value cannot be calculated for a sequence containing two or more atomic values. - + Value %1 of type %2 exceeds maximum (%3). + Value %1 of type %2 is below minimum (%3). - + A value of type %1 must contain an even number of digits. The value %2 does not. + %1 is not valid as a value of type %2. - + Operator %1 cannot be used on type %2. + Operator %1 cannot be used on atomic values of type %2 and %3. - + The namespace URI in the name for a computed attribute cannot be %1. + The name for a computed attribute cannot have the namespace URI %1 with the local name %2. - + Type error in cast, expected %1, received %2. + When casting to %1 or types derived from it, the source value must be of the same type, or it must be a string literal. Type %2 is not allowed. - + No casting is possible with %1 as the target type. + It is not possible to cast from %1 to %2. + Casting to %1 is not possible because it is an abstract type, and can therefore never be instantiated. + It's not possible to cast the value %1 of type %2 to %3 + Failure when casting from %1 to %2: %3 - + A comment cannot contain %1 + A comment cannot end with a %1. - + No comparisons can be done involving the type %1. + Operator %1 is not available between atomic values of type %2 and %3. - + An attribute node cannot be a child of a document node. Therefore, the attribute %1 is out of place. - + A library module cannot be evaluated directly. It must be imported from a main module. + No template by name %1 exists. - + A value of type %1 cannot be a predicate. A predicate must have either a numeric type or an Effective Boolean Value type. + A positional predicate must evaluate to a single numeric value. - + The target name in a processing instruction cannot be %1 in any combination of upper and lower case. Therefore, is %2 invalid. + %1 is not a valid target name in a processing instruction. It must be a %2 value, e.g. %3. - + The last step in a path must contain either nodes or atomic values. It cannot be a mixture between the two. - + The data of a processing instruction cannot contain the string %1 - + No namespace binding exists for the prefix %1 - + No namespace binding exists for the prefix %1 in %2 - + + %1 is an invalid %2 - + %1 takes at most %n argument(s). %2 is therefore invalid. @@ -5684,6 +6991,7 @@ Vælg et andet filnavn. + %1 requires at least %n argument(s). %2 is therefore invalid. @@ -5691,613 +6999,731 @@ Vælg et andet filnavn. - + The first argument to %1 cannot be of type %2. It must be a numeric type, xs:yearMonthDuration or xs:dayTimeDuration. + The first argument to %1 cannot be of type %2. It must be of type %3, %4, or %5. + The second argument to %1 cannot be of type %2. It must be of type %3, %4, or %5. - + %1 is not a valid XML 1.0 character. - + The first argument to %1 cannot be of type %2. - + If both values have zone offsets, they must have the same zone offset. %1 and %2 are not the same. - + %1 was called. - + %1 must be followed by %2 or %3, not at the end of the replacement string. + In the replacement string, %1 must be followed by at least one digit when not escaped. + In the replacement string, %1 can only be used to escape itself or %2, not %3 - + %1 matches newline characters + %1 and %2 match the start and end of a line. + Matches are case insensitive + Whitespace characters are removed, except when they appear in character classes + %1 is an invalid regular expression pattern: %2 + %1 is an invalid flag for regular expressions. Valid flags are: - + If the first argument is the empty sequence or a zero-length string (no namespace), a prefix cannot be specified. Prefix %1 was specified. - + It will not be possible to retrieve %1. - + The root node of the second argument to function %1 must be a document node. %2 is not a document node. - + The default collection is undefined + %1 cannot be retrieved - + The normalization form %1 is unsupported. The supported forms are %2, %3, %4, and %5, and none, i.e. the empty string (no normalization). - + A zone offset must be in the range %1..%2 inclusive. %3 is out of range. + %1 is not a whole number of minutes. - + Required cardinality is %1; got cardinality %2. - + The item %1 did not match the required type %2. + + %1 is an unknown schema type. + Only one %1 declaration can occur in the query prolog. + The initialization of variable %1 depends on itself + No variable by name %1 exists - + The variable %1 is unused - + Version %1 is not supported. The supported XQuery version is 1.0. + The encoding %1 is invalid. It must contain Latin characters only, must not contain whitespace, and must match the regular expression %2. + No function with signature %1 is available + + A default namespace declaration must occur before function, variable, and option declarations. + Namespace declarations must occur before function, variable, and option declarations. + Module imports must occur before function, variable, and option declarations. + It is not possible to redeclare prefix %1. + Prefix %1 is already declared in the prolog. + The name of an option must have a prefix. There is no default namespace for options. + The Schema Import feature is not supported, and therefore %1 declarations cannot occur. + The target namespace of a %1 cannot be empty. + The module import feature is not supported + No value is available for the external variable by name %1. + A construct was encountered which only is allowed in XQuery. + A template by name %1 has already been declared. + The keyword %1 cannot occur with any other mode name. + The value of attribute %1 must of type %2, which %3 isn't. + The prefix %1 can not be bound. By default, it is already bound to the namespace %2. + A variable by name %1 has already been declared. + A stylesheet function must have a prefixed name. + The namespace for a user defined function cannot be empty (try the predefined prefix %1 which exists for cases like this) + The namespace %1 is reserved; therefore user defined functions may not use it. Try the predefined prefix %2, which exists for these cases. + The namespace of a user defined function in a library module must be equivalent to the module namespace. In other words, it should be %1 instead of %2 + A function already exists with the signature %1. + No external functions are supported. All supported functions can be used directly, without first declaring them as external + An argument by name %1 has already been declared. Every argument name must be unique. + When function %1 is used for matching inside a pattern, the argument must be a variable reference or a string literal. + In an XSL-T pattern, the first argument to function %1 must be a string literal, when used for matching. + In an XSL-T pattern, the first argument to function %1 must be a literal or a variable reference, when used for matching. + In an XSL-T pattern, function %1 cannot have a third argument. + In an XSL-T pattern, only function %1 and %2, not %3, can be used for matching. + In an XSL-T pattern, axis %1 cannot be used, only axis %2 or %3 can. + %1 is an invalid template mode name. + The name of a variable bound in a for-expression must be different from the positional variable. Hence, the two variables named %1 collide. + The Schema Validation Feature is not supported. Hence, %1-expressions may not be used. + None of the pragma expressions are supported. Therefore, a fallback expression must be present + Each name of a template parameter must be unique; %1 is duplicated. + The %1-axis is unsupported in XQuery + %1 is not a valid name for a processing-instruction. + %1 is not a valid numeric literal. + No function by name %1 is available. + The namespace URI cannot be the empty string when binding to a prefix, %1. + %1 is an invalid namespace URI. + It is not possible to bind to the prefix %1 + Namespace %1 can only be bound to %2 (and it is, in either case, pre-declared). + Prefix %1 can only be bound to %2 (and it is, in either case, pre-declared). + Two namespace declaration attributes have the same name: %1. + The namespace URI must be a constant and cannot use enclosed expressions. + An attribute by name %1 has already appeared on this element. + A direct element constructor is not well-formed. %1 is ended with %2. + The name %1 does not refer to any schema type. + %1 is an complex type. Casting to complex types is not possible. However, casting to atomic types such as %2 works. + %1 is not an atomic type. Casting is only possible to atomic types. + + %1 is not in the in-scope attribute declarations. Note that the schema import feature is not supported. + The name of an extension expression must be in a namespace. - + empty + zero or one + exactly one + one or more + zero or more - + Required type is %1, but %2 was found. + Promoting %1 to %2 may cause loss of precision. + The focus is undefined. - + It's not possible to add attributes after any other kind of node. + An attribute by name %1 has already been created. - + Only the Unicode Codepoint Collation is supported(%1). %2 is unsupported. - + Attribute %1 can't be serialized because it appears at the top level. - + %1 is an unsupported encoding. + %1 contains octets which are disallowed in the requested encoding %2. + The codepoint %1, occurring in %2 using encoding %3, is an invalid XML character. - + Ambiguous rule match. - - In a namespace constructor, the value for a namespace value cannot be an empty string. + + In a namespace constructor, the value for a namespace cannot be an empty string. + The prefix must be a valid %1, which %2 is not. + The prefix %1 cannot be bound. + Only the prefix %1 can be bound to %2 and vice versa. - + Circularity detected - + The parameter %1 is required, but no corresponding %2 is supplied. + The parameter %1 is passed, but no corresponding %2 exists. - + The URI cannot have a fragment - + Element %1 is not allowed at this location. + Text nodes are not allowed at this location. + Parse error: %1 + The value of the XSL-T version attribute must be a value of type %1, which %2 isn't. + Running an XSL-T 1.0 stylesheet with a 2.0 processor. + Unknown XSL-T attribute %1. + Attribute %1 and %2 are mutually exclusive. + In a simplified stylesheet module, attribute %1 must be present. + If element %1 has no attribute %2, it cannot have attribute %3 or %4. + Element %1 must have at least one of the attributes %2 or %3. + At least one mode must be specified in the %1-attribute on element %2. - + Attribute %1 cannot appear on the element %2. Only the standard attributes can appear. + Attribute %1 cannot appear on the element %2. Only %3 is allowed, and the standard attributes. + Attribute %1 cannot appear on the element %2. Allowed is %3, %4, and the standard attributes. + Attribute %1 cannot appear on the element %2. Allowed is %3, and the standard attributes. + XSL-T attributes on XSL-T elements must be in the null namespace, not in the XSL-T namespace which %1 is. + The attribute %1 must appear on element %2. + The element with local name %1 does not exist in XSL-T. - + Element %1 must come last. + At least one %1-element must occur before %2. + Only one %1-element can appear. + At least one %1-element must occur inside %2. + When attribute %1 is present on %2, a sequence constructor cannot be used. + Element %1 must have either a %2-attribute or a sequence constructor. + When a parameter is required, a default value cannot be supplied through a %1-attribute or a sequence constructor. + Element %1 cannot have children. + Element %1 cannot have a sequence constructor. + + The attribute %1 cannot appear on %2, when it is a child of %3. + A parameter in a function cannot be declared to be a tunnel. + This processor is not Schema-aware and therefore %1 cannot be used. + Top level stylesheet elements must be in a non-null namespace, which %1 isn't. + The value for attribute %1 on element %2 must either be %3 or %4, not %5. + Attribute %1 cannot have the value %2. + The attribute %1 can only appear on the first %2 element. + At least one %1 element must appear as child of %2. @@ -6305,11 +7731,13 @@ Vælg et andet filnavn. VolumeSlider - + Muted + + Volume: %1% Lydstyrke: %1% diff --git a/translations/qt_help_da.ts b/translations/qt_help_da.ts index 0e4a362..73609a1 100644 --- a/translations/qt_help_da.ts +++ b/translations/qt_help_da.ts @@ -4,27 +4,27 @@ QCLuceneResultWidget - + Search Results Søgeresultater - + Note: Bemærk: - + The search results may not be complete since the documentation is still being indexed! Søgeresultaterne kan være ufuldstændige, fordi dokumentationen stadig indekseres! - + Your search did not match any documents. Søgningen matchede ikke nogen dokumenter. - + (The reason for this might be that the documentation is still being indexed.) (Ã…rsagen kan være, at dokumentationen stadig indekseres.) @@ -32,72 +32,78 @@ QHelpCollectionHandler - + The collection file is not set up yet! Hjælpesamlingen er ikke konfigureret endnu! - + + Cannot load sqlite database driver! + Kan ikke indlæse sqlite database-driver! + + + + Cannot open collection file: %1 Kan ikke Ã¥bne hjælpesamlingen: %1 - + Cannot create tables in file %1! Kan ikke oprette tabler i filen %1! - + The specified collection file already exists! Den angivne hjælpesamling findes allerede! - + Cannot create directory: %1 Kan ikke oprette kataloget: %1 - + Cannot copy collection file: %1 Kan ikke kopiere hjælpesamling: %1 - + Unknown filter! Ukendt filter! - + Cannot register filter %1! Kan ikke registrere filteret %1! - + Cannot open documentation file %1! Kan ikke Ã¥bne dokumentationsfilen %1! - + Invalid documentation file! Ugyldig dokumentationsfil! - + The namespace %1 was not registered! Navnerummet %1 blev ikke registreret! - + Namespace %1 already exists! Navnerummet %1 findes allerede! - + Cannot register namespace! Kan ikke registrere navnerummet! - + Cannot open database to optimize! Kan ikke Ã¥bne den database, der skal optimeres! @@ -105,15 +111,19 @@ QHelpDBReader - Cannot open DB! - Kan ikke Ã¥bne DB! + Kan ikke Ã¥bne DB! + + + + Cannot open database '%1' '%2': %3 + Kan ikke Ã¥bne database '%1' '%2': %3 QHelpEngineCore - + The specified namespace does not exist! Det angivne navnerum findes ikke! @@ -121,125 +131,135 @@ QHelpEngineCorePrivate - + + Cannot open documentation file %1: %2! + Kan ikke Ã¥bne dokumentationsfil %1: %2! + + Cannot open collection file %1! - Kan ikke Ã¥bne hjælpesamlingen %1! + Kan ikke Ã¥bne hjælpesamlingen %1! - Cannot open documentation file %1! - Kan ikke Ã¥bne dokumentationsfilen %1! + Kan ikke Ã¥bne dokumentationsfilen %1! QHelpGenerator - + Invalid help data! Ugyldigt hjælpedata! - + No output file name specified! Der er ikke anført et output-filnavn! - The file %1 already exists! - Filen %1 findes allerede! + Filen %1 findes allerede! - + Building up file structure... Bygger filstruktur... - Cannot open DB! - Kan ikke Ã¥bne DB! + Kan ikke Ã¥bne DB! + + + + The file %1 cannot be overwritten! + Filen %1 kan ikke overskrives! - + + Cannot open data base file %1! + Kan ikke Ã¥bne databasefil %1! + + + Cannot register namespace %1! Kan ikke registrere navnerummet %1! - + Insert custom filters... Indsæt brugerdefinerede filtre... - + Insert help data for filter section (%1 of %2)... Indsæt hjælpedata til filtersektion (%1 af %2)... - + Documentation successfully generated. Dokumentationen blev genereret. - + Some tables already exist! Nogle af tabellerne findes allerede! - + Cannot create tables! Kan ikke oprette tabeller! - + Cannot register virtual folder! Kan ikke registrere virtuel mappe! - + Insert files... Indsæt filer... - + The file %1 does not exist! Skipping it. Filen %1 findes ikke, og den springes over. - + Cannot open file %1! Skipping it. Kan ikke Ã¥bne filen %1, og den springes over. - Cannot insert file data into database! - Kan ikke indsætte fildata i databasen! + Kan ikke indsætte fildata i databasen! - + The filter %1 is already registered! Filtret %1 er allerede registreret! - + Cannot register filter %1! Kan ikke registrere filtret %1! - + Insert indices... Indsæt indeks... - + Insert contents... Indsæt indhold... - + Cannot insert contents! Kan ikke indsætte indhold! - + Cannot register contents! Kan ikke registrere indhold! @@ -247,42 +267,42 @@ QHelpSearchQueryWidget - + Search for: Søg efter: - + Search Søg - + Advanced search Avanceret søgning - + words <B>similar</B> to: ord <B>tilsvarende</B>: - + <B>without</B> the words: <B>uden</B> ordene: - + with <B>exact phrase</B>: med den <B>eksakte sætning</B>: - + with <B>all</B> of the words: med <B>alle</B> ordene: - + with <B>at least one</B> of the words: med <B>mindst ét</B> af ordene: @@ -290,7 +310,7 @@ QHelpSearchResultWidget - + 0 - 0 of 0 Hits 0 - 0 af 0 Hits @@ -298,7 +318,7 @@ QHelpSearchResultWidgetPrivate - + %1 - %2 of %3 Hits %1 - %2 af %3 Hits @@ -306,47 +326,60 @@ QObject - + Untitled Ingen titel - Unknown token at line %1. - Ukendt symbol pÃ¥ linie %1. + Ukendt symbol pÃ¥ linie %1. - Unknown token at line %1. Expected "QtHelpProject"! - Ukendt symbol pÃ¥ linie %1. Forventet "QtHelpProject"! + Ukendt symbol pÃ¥ linie %1. Forventet "QtHelpProject"! + + + + Unknown token. + Ukendt token. + + + + Unknown token. Expected "QtHelpProject"! + Ukendt token. Forventede "QtHelpProject"! + + + + Error in line %1: %2 + Fejl i linie %1: %2 - + A virtual folder must not contain a '/' character! En virtuel mappe mÃ¥ ikke indholde tegnet '/'! - + A namespace must not contain a '/' character! Et navnerum mÃ¥ ikke indeholde tegnet '/'! - + Missing namespace in QtHelpProject. Navnerum i +++ mangler. - + Missing virtual folder in QtHelpProject Virtuel mappe i QtHelpProject mangler - + Missing attribute in keyword at line %1. Attribut i nøgleord pÃ¥ linie %1 mangler. - + The input file %1 could not be opened! Input-filen %1 kunne ikke Ã¥bnes! diff --git a/translations/translations.pri b/translations/translations.pri index efefa09..0c5c1ee 100644 --- a/translations/translations.pri +++ b/translations/translations.pri @@ -21,7 +21,7 @@ LRELEASE = $$fixPath($$QT_BUILD_TREE/bin/lrelease) ###### Qt Libraries -QT_TS = de fr zh_CN untranslated ar es iw ja_JP pl pt ru sk sv uk zh_TW +QT_TS = de fr zh_CN untranslated ar es iw ja_JP pl pt ru sk sv uk zh_TW da ts-qt.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \ 3rdparty/phonon \ -- cgit v0.12 From 52071c71ddfde1354e6c17737660a3d161d0bc89 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 26 May 2009 20:59:55 +0200 Subject: Introducing QKeyEventSoftKey helper class. It maps softkeys to actual key events. Making it easy and non-intrusive to add softkey usage to existing widgets. --- src/gui/widgets/qsoftkeystack.cpp | 24 ++++++++++++++++++++++++ src/gui/widgets/qsoftkeystack_p.h | 14 ++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index 0054c6b..3591dc1 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -43,6 +43,7 @@ #include "qsoftkeystack_p.h" #include "qapplication.h" #include "qmainwindow.h" +#include "qevent.h" static bool isSame(const QSoftkeySet& a, const QSoftkeySet& b) { @@ -228,3 +229,26 @@ void QSoftKeyStackPrivate::setNativeSoftKeys() { } #endif // !defined(Q_WS_S60) + +QKeyEventSoftKey::QKeyEventSoftKey(QSoftKeyAction *softKeyAction, Qt::Key key, QObject *parent) + : QObject(parent) + , m_softKeyAction(softKeyAction) + , m_key(key) +{ +} + +void QKeyEventSoftKey::addSoftKey(QSoftKeyAction::StandardRole standardRole, Qt::Key key, QWidget *actionWidget) +{ + QSoftKeyStack *stack = QSoftKeyStack::softKeyStackOfWidget(actionWidget); + if (!stack) + return; + QSoftKeyAction *action = new QSoftKeyAction(standardRole, actionWidget); + QKeyEventSoftKey *softKey = new QKeyEventSoftKey(action, key, actionWidget); + connect(action, SIGNAL(triggered()), softKey, SLOT(sendKeyEvent())); + stack->push(action); +} + +void QKeyEventSoftKey::sendKeyEvent() +{ + QApplication::postEvent(parent(), new QKeyEvent(QEvent::KeyPress, m_key, Qt::NoModifier)); +} diff --git a/src/gui/widgets/qsoftkeystack_p.h b/src/gui/widgets/qsoftkeystack_p.h index b698178..e728cbb 100644 --- a/src/gui/widgets/qsoftkeystack_p.h +++ b/src/gui/widgets/qsoftkeystack_p.h @@ -70,6 +70,7 @@ QT_BEGIN_NAMESPACE class QSoftKeyStackPrivate : public QObjectPrivate { + Q_DECLARE_PUBLIC(QSoftKeyStack); public: QSoftKeyStackPrivate(); ~QSoftKeyStackPrivate(); @@ -91,6 +92,19 @@ private: QStack softKeyStack; }; +class QKeyEventSoftKey : QObject +{ + Q_OBJECT +public: + QKeyEventSoftKey(QSoftKeyAction *softKeyAction, Qt::Key key, QObject *parent); + static void addSoftKey(QSoftKeyAction::StandardRole standardRole, Qt::Key key, QWidget *actionWidget); +private: + QSoftKeyAction *m_softKeyAction; + Qt::Key m_key; +private Q_SLOTS: + void sendKeyEvent(); +}; + QT_END_NAMESPACE #endif // QSOFTKEYSTACK_P_H -- cgit v0.12 From f414d09532e6add26c70dc485743f414ee6bc118 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 26 May 2009 21:02:04 +0200 Subject: Platforms that do not yet have a softkey adaptation layer will show the softkeys in a toolbar inside the respective QMainWindow. This is a kind-of-usable stub and definitely useful for debugging. --- src/gui/widgets/qsoftkeystack.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index 3591dc1..ac58d2a 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -45,6 +45,10 @@ #include "qmainwindow.h" #include "qevent.h" +#if !defined(Q_WS_S60) +#include "qtoolbar.h" +#endif + static bool isSame(const QSoftkeySet& a, const QSoftkeySet& b) { bool isSame=true; @@ -225,8 +229,38 @@ void QSoftKeyStackPrivate::handleSoftKeyPress(int command) Q_UNUSED(command) } +QToolBar* softKeyToolBar(QMainWindow *mainWindow) +{ + Q_ASSERT(mainWindow); + const QString toolBarName = QString::fromLatin1("SoftKeyToolBarForDebugging"); + QToolBar *result = 0; + foreach (QObject *child, mainWindow->children()) { + result = qobject_cast(child); + if (result && result->objectName() == toolBarName) + return result; + } + result = mainWindow->addToolBar(toolBarName); + result->setObjectName(toolBarName); + return result; +} + void QSoftKeyStackPrivate::setNativeSoftKeys() { + Q_Q(QSoftKeyStack); + QMainWindow *parent = qobject_cast(q->parent()); + if (!parent) + return; + QToolBar* toolbar = softKeyToolBar(parent); + toolbar->clear(); + foreach (const QSoftkeySet &set, softKeyStack) { + foreach (QSoftKeyAction *skAction, set) + toolbar->addAction(skAction); + toolbar->addSeparator(); + } + if (toolbar->actions().isEmpty()) { + parent->removeToolBar(toolbar); + delete toolbar; + } } #endif // !defined(Q_WS_S60) -- cgit v0.12 From 6b35dbafe0c42f26335d94d5fae43bf13c6b3584 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 26 May 2009 21:03:31 +0200 Subject: KeyPadNavigation: showing a 'Back' softkey while in editfocus. --- src/gui/itemviews/qabstractitemview.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index 159a997..6e24c85 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -61,6 +61,9 @@ #ifndef QT_NO_ACCESSIBILITY #include #endif +#ifdef QT_KEYPAD_NAVIGATION +#include +#endif QT_BEGIN_NAMESPACE @@ -2003,16 +2006,19 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event) if (QApplication::keypadNavigationEnabled()) { if (!hasEditFocus()) { setEditFocus(true); + QKeyEventSoftKey::addSoftKey(QSoftKeyAction::Back, Qt::Key_Back, this); return; } } break; case Qt::Key_Back: - case Qt::Key_Context2: // TODO: aportale, remove KEYPAD_NAVIGATION_HACK when softkey support is there - if (QApplication::keypadNavigationEnabled() && hasEditFocus()) + if (QApplication::keypadNavigationEnabled() && hasEditFocus()) { + if (QSoftKeyStack *stack = QSoftKeyStack::softKeyStackOfWidget(this)) + stack->pop(); setEditFocus(false); - else + } else { event->ignore(); + } return; default: if (QApplication::keypadNavigationEnabled() && !hasEditFocus()) { -- cgit v0.12 From 33368fa3541fb38c3afc1d525da2cd837f2920a1 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 27 May 2009 09:31:28 +0300 Subject: Fixed qtemporaryfile test case compilation for Symbian OS. Symbian mmp file format does not accept strings with quotes in defines. For this reason the SRCDIR need to be defined in sources. --- tests/auto/qtemporaryfile/qtemporaryfile.pro | 2 +- tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/auto/qtemporaryfile/qtemporaryfile.pro b/tests/auto/qtemporaryfile/qtemporaryfile.pro index bde990a..a3a3910 100644 --- a/tests/auto/qtemporaryfile/qtemporaryfile.pro +++ b/tests/auto/qtemporaryfile/qtemporaryfile.pro @@ -2,4 +2,4 @@ load(qttest_p4) SOURCES += tst_qtemporaryfile.cpp QT = core -DEFINES += SRCDIR=\\\"$$PWD/\\\" +!symbian:DEFINES += SRCDIR=\\\"$$PWD/\\\" diff --git a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp index 543a116..b9f1cc5 100644 --- a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp +++ b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp @@ -59,6 +59,10 @@ # include // close(2) #endif +#ifdef Q_OS_SYMBIAN +#define SRCDIR "" +#endif + //TESTED_CLASS= //TESTED_FILES= -- cgit v0.12 From 0f932c13de7791246c1b30a8fed95a78867dde55 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 27 May 2009 09:37:41 +0300 Subject: Fixed qsqldatabase test case compilation. Unterminated `#if_ conditional, probably due to bad merge --- tests/auto/qsqldatabase/tst_qsqldatabase.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp index 66cf81f..4fa3dc4 100644 --- a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp +++ b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp @@ -1058,7 +1058,6 @@ void tst_QSqlDatabase::recordMySQL() specifically: Before MySQL 5.0.15, the pad value is space. Values are right-padded with space on insert, and trailing spaces are removed on select. */ -#ifdef QT3_SUPPORT if ( major >5 || ( major == 5 && minor > 0) || ( major == 5 && minor == 0 && revision >= 15) ) { bin10 = FieldDef("binary(10)", QVariant::ByteArray, QByteArray(Q3CString("123abc "))); varbin10 = FieldDef("varbinary(10)", QVariant::ByteArray, QByteArray(Q3CString("123abcv "))); -- cgit v0.12 From d61736900e8781fa2fa3b98f30abf8925787d0f9 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 27 May 2009 09:44:57 +0300 Subject: Fixed qpen test case panic in Symbian OS. "Expected data of type _bool_, got _int_ for element 2 of data with tag _differentColor_." FALSE and TRUE are defined to int in Symbian OS, buu test case expects boolean. --- tests/auto/qpen/tst_qpen.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/auto/qpen/tst_qpen.cpp b/tests/auto/qpen/tst_qpen.cpp index 0327629..4fc19c4 100644 --- a/tests/auto/qpen/tst_qpen.cpp +++ b/tests/auto/qpen/tst_qpen.cpp @@ -111,22 +111,22 @@ void tst_QPen::operator_eq_eq_data() QTest::newRow("differentColor") << QPen(Qt::red) << QPen(Qt::blue) - << FALSE; + << bool(FALSE); QTest::newRow("differentWidth") << QPen(Qt::red, 2) << QPen(Qt::red, 3) - << FALSE; + << bool(FALSE); QTest::newRow("differentPenStyle") << QPen(Qt::red, 2, Qt::DashLine) << QPen(Qt::red, 2, Qt::DotLine) - << FALSE; + << bool(FALSE); QTest::newRow("differentCapStyle") << QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::BevelJoin) << QPen(Qt::red, 2, Qt::DashLine, Qt::SquareCap, Qt::BevelJoin) - << FALSE; + << bool(FALSE); QTest::newRow("differentJoinStyle") << QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::BevelJoin) << QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::MiterJoin) - << FALSE; + << bool(FALSE); QTest::newRow("same") << QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::BevelJoin) << QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::BevelJoin) - << TRUE; + << bool(TRUE); } -- cgit v0.12 From 9d5308b95bed09e72203eb53ced1a57c21744c71 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Wed, 27 May 2009 09:48:33 +0200 Subject: Added handling for a case when menu is being rebuilt and menu is not inside a QMainWindow. --- src/gui/widgets/qmenu_symbian.cpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index 491c78e..1ed3505 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -184,19 +184,21 @@ static void rebuildMenu() QMenuBarPrivate *mb = 0; QWidget *w = qApp->activeWindow(); QMainWindow *mainWindow = qobject_cast(w); - QSoftKeyStack* softKeyStack = mainWindow->softKeyStack(); - if (!softKeyStack->isEmpty()) { - const QSoftkeySet& softKeyTop = softKeyStack->top(); - int index=0; - bool found=false; - while( indexrole(); - if(softAction->role() == QSoftKeyAction::ContextMenu) { - widgetWithContextMenu = softAction->parentWidget(); - found=true; - } - index++; + if (mainWindow) { + QSoftKeyStack* softKeyStack = mainWindow->softKeyStack(); + if (!softKeyStack->isEmpty()) { + const QSoftkeySet& softKeyTop = softKeyStack->top(); + int index=0; + bool found=false; + while( indexrole(); + if(softAction->role() == QSoftKeyAction::ContextMenu) { + widgetWithContextMenu = softAction->parentWidget(); + found=true; + } + index++; + } } } -- cgit v0.12 From fde5a9bde254dd0381762e2c52c0f4904599d40a Mon Sep 17 00:00:00 2001 From: Aleksandar Sasha Babic Date: Wed, 27 May 2009 10:28:12 +0200 Subject: Enabling QTextEdit to handle Input Methods. --- src/gui/widgets/qtextedit.cpp | 17 +++++++++++++++-- src/gui/widgets/qtextedit_p.h | 1 + 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/gui/widgets/qtextedit.cpp b/src/gui/widgets/qtextedit.cpp index 1c4df93..c1ec5c2 100644 --- a/src/gui/widgets/qtextedit.cpp +++ b/src/gui/widgets/qtextedit.cpp @@ -74,6 +74,10 @@ QT_BEGIN_NAMESPACE #ifndef QT_NO_TEXTEDIT +static inline bool shouldEnableInputMethod(QTextEdit *textedit) +{ + return !textedit->isReadOnly(); +} class QTextEditControl : public QTextControl { @@ -104,7 +108,7 @@ public: QTextEditPrivate::QTextEditPrivate() : control(0), autoFormatting(QTextEdit::AutoNone), tabChangesFocus(false), - lineWrap(QTextEdit::WidgetWidth), lineWrapColumnOrWidth(0), + lineWrap(QTextEdit::WidgetWidth), lineWrapColumnOrWidth(0), clickCausedFocus(0), wordWrap(QTextOption::WrapAtWordBoundaryOrAnywhere), textFormat(Qt::AutoText) { ignoreAutomaticScrollbarAdjustment = false; @@ -1559,6 +1563,12 @@ void QTextEdit::mouseReleaseEvent(QMouseEvent *e) d->autoScrollTimer.stop(); ensureCursorVisible(); } + if (e->button() == Qt::LeftButton && qApp->autoSipEnabled() + && (!d->clickCausedFocus || qApp->autoSipOnMouseFocus())) { + QEvent event(QEvent::RequestSoftwareInputPanel); + QApplication::sendEvent(this, &event); + } + d->clickCausedFocus = 0; } /*! \reimp @@ -1694,6 +1704,9 @@ QVariant QTextEdit::inputMethodQuery(Qt::InputMethodQuery property) const void QTextEdit::focusInEvent(QFocusEvent *e) { Q_D(QTextEdit); + if (e->reason() == Qt::MouseFocusReason) { + d->clickCausedFocus = 1; + } QAbstractScrollArea::focusInEvent(e); d->sendControlEvent(e); } @@ -2058,7 +2071,7 @@ void QTextEdit::setReadOnly(bool ro) } else { flags = Qt::TextEditorInteraction; } - setAttribute(Qt::WA_InputMethodEnabled, !ro); + setAttribute(Qt::WA_InputMethodEnabled, shouldEnableInputMethod(this)); d->control->setTextInteractionFlags(flags); } diff --git a/src/gui/widgets/qtextedit_p.h b/src/gui/widgets/qtextedit_p.h index 3c37868..594174a 100644 --- a/src/gui/widgets/qtextedit_p.h +++ b/src/gui/widgets/qtextedit_p.h @@ -123,6 +123,7 @@ public: uint preferRichText : 1; uint showCursorOnInitialShow : 1; uint inDrag : 1; + uint clickCausedFocus : 1; // Qt3 COMPAT only, for setText Qt::TextFormat textFormat; -- cgit v0.12 From 5e38702684529cf7c3d1ab8ac6cd14900ca20b89 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Wed, 27 May 2009 10:43:32 +0200 Subject: Added method bool hasSoftKeyStack() so that user can check if QMainWindow has a softkeystack or not. Making method QSoftKeyStack *softKeyStack() const return 0 when there is no softkeystack was also evaluated. Returning 0 was discarded as it would make softKeyStack() behave differently than statusBar() and menuBar() methods. It would be bad API design to have methods in same class behave differently. --- src/gui/widgets/qmainwindow.cpp | 15 ++++++++++++++- src/gui/widgets/qmainwindow.h | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index e12b879..618023e 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -543,7 +543,7 @@ QSoftKeyStack *QMainWindow::softKeyStack() const } /*! - Sets the softkey stackfor the main window to \a softKeyStack. + Sets the softkey stack for the main window to \a softKeyStack. Note: QMainWindow takes ownership of the \a softKeyStack pointer and deletes it at the appropriate time. @@ -559,6 +559,19 @@ void QMainWindow::setSoftKeyStack(QSoftKeyStack *softKeyStack) } d->softKeyStack = softKeyStack; } + +/*! + Returns true if QMainWindow has a softkeystack and false otherwise + + \sa softKeyStack() +*/ +bool QMainWindow::hasSoftKeyStack() +{ + Q_D(QMainWindow); + if (d->softKeyStack ) + return true; + return false; +} #endif // QT_NO_SOFTKEYSTACK #ifndef QT_NO_STATUSBAR diff --git a/src/gui/widgets/qmainwindow.h b/src/gui/widgets/qmainwindow.h index e2dcd5e..01b275e 100644 --- a/src/gui/widgets/qmainwindow.h +++ b/src/gui/widgets/qmainwindow.h @@ -135,6 +135,7 @@ public: #ifndef QT_NO_SOFTKEYSTACK QSoftKeyStack *softKeyStack() const; void setSoftKeyStack(QSoftKeyStack *softKeyStack); + bool hasSoftKeyStack(); #endif #ifndef QT_NO_STATUSBAR -- cgit v0.12 From 1fb00d68de22a414f5e3f57b6623f570a002167a Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 27 May 2009 12:02:32 +0300 Subject: Implemented task 247268 - Cleanup qeventdispatcher_unix.cpp. All qeventdispatcher_unix.cpp changes were reverted since, this file is not anymore used in Symbian OS branch. --- src/corelib/kernel/qeventdispatcher_unix.cpp | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp index ce38b73..6aa3b56 100644 --- a/src/corelib/kernel/qeventdispatcher_unix.cpp +++ b/src/corelib/kernel/qeventdispatcher_unix.cpp @@ -54,7 +54,7 @@ #include #include -#if (_POSIX_MONOTONIC_CLOCK-0 <= 0) || defined(QT_BOOTSTRAPPED) && !defined(Q_OS_SYMBIAN) +#if (_POSIX_MONOTONIC_CLOCK-0 <= 0) || defined(QT_BOOTSTRAPPED) # include #endif @@ -65,7 +65,7 @@ Q_CORE_EXPORT bool qt_disable_lowpriority_timers=false; /***************************************************************************** UNIX signal handling *****************************************************************************/ -#if !defined(Q_OS_SYMBIAN) + static sig_atomic_t signal_received; static sig_atomic_t signals_fired[NSIG]; @@ -74,7 +74,7 @@ static void signalHandler(int sig) signals_fired[sig] = 1; signal_received = 1; } -#endif + static void initThreadPipeFD(int fd) { @@ -134,7 +134,6 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags, int nsel; do { -#if !defined(Q_OS_SYMBIAN) if (mainThread) { while (signal_received) { signal_received = 0; @@ -146,7 +145,7 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags, } } } -#endif + // Process timers and socket notifiers - the common UNIX stuff int highest = 0; if (! (flags & QEventLoop::ExcludeSocketNotifiers) && (sn_highest >= 0)) { @@ -258,7 +257,7 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags, QTimerInfoList::QTimerInfoList() { -#if (_POSIX_MONOTONIC_CLOCK-0 <= 0) && !defined(Q_OS_SYMBIAN) +#if (_POSIX_MONOTONIC_CLOCK-0 <= 0) useMonotonicTimers = false; # if (_POSIX_MONOTONIC_CLOCK == 0) @@ -299,7 +298,7 @@ timeval QTimerInfoList::updateCurrentTime() return currentTime; } -#if ((_POSIX_MONOTONIC_CLOCK-0 <= 0) || defined(QT_BOOTSTRAPPED)) && !defined(Q_OS_SYMBIAN) +#if (_POSIX_MONOTONIC_CLOCK-0 <= 0) || defined(QT_BOOTSTRAPPED) /* Returns true if the real time clock has changed by more than 10% @@ -375,11 +374,7 @@ void QTimerInfoList::repairTimersIfNeeded() void QTimerInfoList::getTime(timeval &t) { timespec ts; -#if !defined(Q_OS_SYMBIAN) clock_gettime(CLOCK_MONOTONIC, &ts); -#else - clock_gettime(CLOCK_REALTIME, &ts); -#endif t.tv_sec = ts.tv_sec; t.tv_usec = ts.tv_nsec / 1000; } @@ -944,7 +939,7 @@ void QEventDispatcherUNIX::flush() -#if !defined(Q_OS_SYMBIAN) + void QCoreApplication::watchUnixSignal(int sig, bool watch) { if (sig < NSIG) { @@ -958,10 +953,5 @@ void QCoreApplication::watchUnixSignal(int sig, bool watch) sigaction(sig, &sa, 0); } } -#else -void QCoreApplication::watchUnixSignal(int, bool) -{ -} -#endif QT_END_NAMESPACE -- cgit v0.12 From 2c1b11f2192fd48da01a1093a7cb4a848de43c8a Mon Sep 17 00:00:00 2001 From: Trond Kjernaasen Date: Wed, 27 May 2009 11:11:57 +0200 Subject: Fixed aliasing pointer corruption in QDataStream. Use a union instead of an unsafe cast when swapping the bytes in the QDataStream streaming operators. The old seems to cause problems with Link Time Code Generation optimizations with the MSVC compilers. Task-number: 247708 Reviewed-by: Samuel Reviewed-by: Thiago BT: yes --- src/corelib/io/qdatastream.cpp | 92 +++++++++++++++++++++++++++++++++++------- 1 file changed, 77 insertions(+), 15 deletions(-) diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp index b203899..e324ffe 100644 --- a/src/corelib/io/qdatastream.cpp +++ b/src/corelib/io/qdatastream.cpp @@ -622,11 +622,16 @@ QDataStream &QDataStream::operator>>(qint16 &i) setStatus(ReadPastEnd); } } else { - register uchar *p = (uchar *)(&i); + union { + qint16 val1; + char val2[2]; + } x; + char *p = x.val2; char b[2]; if (dev->read(b, 2) == 2) { *p++ = b[1]; *p = b[0]; + i = x.val1; } else { setStatus(ReadPastEnd); } @@ -660,13 +665,18 @@ QDataStream &QDataStream::operator>>(qint32 &i) setStatus(ReadPastEnd); } } else { // swap bytes - uchar *p = (uchar *)(&i); + union { + qint32 val1; + char val2[4]; + } x; + char *p = x.val2; char b[4]; if (dev->read(b, 4) == 4) { *p++ = b[3]; *p++ = b[2]; *p++ = b[1]; *p = b[0]; + i = x.val1; } else { setStatus(ReadPastEnd); } @@ -703,7 +713,12 @@ QDataStream &QDataStream::operator>>(qint64 &i) setStatus(ReadPastEnd); } } else { // swap bytes - uchar *p = (uchar *)(&i); + union { + qint64 val1; + char val2[8]; + } x; + + char *p = x.val2; char b[8]; if (dev->read(b, 8) == 8) { *p++ = b[7]; @@ -714,6 +729,7 @@ QDataStream &QDataStream::operator>>(qint64 &i) *p++ = b[2]; *p++ = b[1]; *p = b[0]; + i = x.val1; } else { setStatus(ReadPastEnd); } @@ -751,13 +767,19 @@ QDataStream &QDataStream::operator>>(float &f) setStatus(ReadPastEnd); } } else { // swap bytes - uchar *p = (uchar *)(&f); + union { + float val1; + char val2[4]; + } x; + + char *p = x.val2; char b[4]; if (dev->read(b, 4) == 4) { *p++ = b[3]; *p++ = b[2]; *p++ = b[1]; *p = b[0]; + f = x.val1; } else { setStatus(ReadPastEnd); } @@ -788,7 +810,11 @@ QDataStream &QDataStream::operator>>(double &f) setStatus(ReadPastEnd); } } else { // swap bytes - register uchar *p = (uchar *)(&f); + union { + double val1; + char val2[8]; + } x; + char *p = x.val2; char b[8]; if (dev->read(b, 8) == 8) { *p++ = b[7]; @@ -799,13 +825,18 @@ QDataStream &QDataStream::operator>>(double &f) *p++ = b[2]; *p++ = b[1]; *p = b[0]; + f = x.val1; } else { setStatus(ReadPastEnd); } } #else //non-standard floating point format - register uchar *p = (uchar *)(&f); + union { + double val1; + char val2[8]; + } x; + char *p = x.val2; char b[8]; if (dev->read(b, 8) == 8) { if (noswap) { @@ -827,6 +858,7 @@ QDataStream &QDataStream::operator>>(double &f) *p++ = b[Q_DF(1)]; *p = b[Q_DF(0)]; } + f = x.val1; } else { setStatus(ReadPastEnd); } @@ -970,7 +1002,12 @@ QDataStream &QDataStream::operator<<(qint16 i) if (noswap) { dev->write((char *)&i, sizeof(qint16)); } else { // swap bytes - register uchar *p = (uchar *)(&i); + union { + qint16 val1; + char val2[2]; + } x; + x.val1 = i; + char *p = x.val2; char b[2]; b[1] = *p++; b[0] = *p; @@ -992,7 +1029,12 @@ QDataStream &QDataStream::operator<<(qint32 i) if (noswap) { dev->write((char *)&i, sizeof(qint32)); } else { // swap bytes - register uchar *p = (uchar *)(&i); + union { + qint32 val1; + char val2[4]; + } x; + x.val1 = i; + char *p = x.val2; char b[4]; b[3] = *p++; b[2] = *p++; @@ -1022,13 +1064,18 @@ QDataStream &QDataStream::operator<<(qint64 i) { CHECK_STREAM_PRECOND(*this) if (version() < 6) { - quint32 i1 = i & 0xffffffff; - quint32 i2 = i >> 32; - *this << i2 << i1; + quint32 i1 = i & 0xffffffff; + quint32 i2 = i >> 32; + *this << i2 << i1; } else if (noswap) { // no conversion needed dev->write((char *)&i, sizeof(qint64)); } else { // swap bytes - register uchar *p = (uchar *)(&i); + union { + qint64 val1; + char val2[8]; + } x; + x.val1 = i; + char *p = x.val2; char b[8]; b[7] = *p++; b[6] = *p++; @@ -1077,7 +1124,12 @@ QDataStream &QDataStream::operator<<(float f) if (noswap) { // no conversion needed dev->write((char *)&g, sizeof(float)); } else { // swap bytes - register uchar *p = (uchar *)(&g); + union { + float val1; + char val2[4]; + } x; + x.val1 = f; + char *p = x.val2; char b[4]; b[3] = *p++; b[2] = *p++; @@ -1103,7 +1155,12 @@ QDataStream &QDataStream::operator<<(double f) if (noswap) { dev->write((char *)&f, sizeof(double)); } else { - register uchar *p = (uchar *)(&f); + union { + double val1; + char val2[8]; + } x; + x.val1 = f; + char *p = x.val2; char b[8]; b[7] = *p++; b[6] = *p++; @@ -1116,7 +1173,12 @@ QDataStream &QDataStream::operator<<(double f) dev->write(b, 8); } #else - register uchar *p = (uchar *)(&f); + union { + double val1; + char val2[8]; + } x; + x.val1 = f; + char *p = x.val2; char b[8]; if (noswap) { b[Q_DF(0)] = *p++; -- cgit v0.12 From e2c09e6b998aa139fa24e5a1f685159be97de8bd Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 27 May 2009 12:31:09 +0300 Subject: Fixed qscriptv8testsuite test case deployment for Symbian. Also gave more heap for test to run properly on Symbian. --- tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro index 9e35801..9a17e13 100644 --- a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro +++ b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro @@ -2,10 +2,10 @@ load(qttest_p4) QT = core script SOURCES += tst_qscriptv8testsuite.cpp -wince*: { +wince*|symbian: { testFiles.sources = tests testFiles.path = . DEPLOYMENT += testFiles } - +symbian:TARGET.EPOCHEAPSIZE = 0x00020000 0x01000000 -- cgit v0.12 From f7c182fa3d6526b05403b0374f29b30aed9995e0 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Wed, 27 May 2009 11:38:55 +0200 Subject: Changed menu adaptation to handle case where no softkeystack is instantiated better --- src/gui/widgets/qmenu_symbian.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index 1ed3505..1577977 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -184,7 +184,7 @@ static void rebuildMenu() QMenuBarPrivate *mb = 0; QWidget *w = qApp->activeWindow(); QMainWindow *mainWindow = qobject_cast(w); - if (mainWindow) { + if ((mainWindow) && mainWindow->hasSoftKeyStack()) { QSoftKeyStack* softKeyStack = mainWindow->softKeyStack(); if (!softKeyStack->isEmpty()) { const QSoftkeySet& softKeyTop = softKeyStack->top(); -- cgit v0.12 From 448d7d5702e90e21e1effe2ff460a48aa4a0b7d2 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 27 May 2009 12:50:12 +0300 Subject: Converted qstylesheetstyle test case to use qttest_p4. qttest_p4 takes care of definign the UID3 for autotests in Symbian OS, among the other things. The UID3 is needed to run tests ih HW with cetest. --- tests/auto/qstylesheetstyle/qstylesheetstyle.pro | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/tests/auto/qstylesheetstyle/qstylesheetstyle.pro b/tests/auto/qstylesheetstyle/qstylesheetstyle.pro index 6acb0b4..7babe25 100644 --- a/tests/auto/qstylesheetstyle/qstylesheetstyle.pro +++ b/tests/auto/qstylesheetstyle/qstylesheetstyle.pro @@ -1,14 +1,4 @@ -###################################################################### -# Automatically generated by qmake (2.01a) Wed Apr 26 13:53:24 2006 -###################################################################### - -TEMPLATE = app -TARGET = tst_qstylesheetstyle -DEPENDPATH += . -INCLUDEPATH += . .. - -CONFIG += console qtestlib -contains(QT_CONFIG, qt3support): QT += qt3support +load(qttest_p4) # Input SOURCES += tst_qstylesheetstyle.cpp -- cgit v0.12 From 0d819337435487a84e274714a759eb4bda24f942 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 27 May 2009 13:00:01 +0300 Subject: Fixed qscriptv8testsuite test case out-of-memory crashes. Increased qscriptv8testsuite max heap size and skipped two test cases on Symbian which demand too much memory. --- tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro | 2 +- tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro index 9a17e13..9976bb2 100644 --- a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro +++ b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro @@ -8,4 +8,4 @@ testFiles.path = . DEPLOYMENT += testFiles } -symbian:TARGET.EPOCHEAPSIZE = 0x00020000 0x01000000 +symbian:TARGET.EPOCHEAPSIZE = 0x00020000 0x02000000 diff --git a/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp b/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp index 435af41..5811938 100644 --- a/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp +++ b/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp @@ -256,6 +256,11 @@ tst_Suite::tst_Suite() addTestExclusion("mul-exhaustive", "Demands too much memory on WinCE"); #endif +#ifdef Q_OS_SYMBIAN + addTestExclusion("nested-repetition-count-overflow", "Demands too much memory on Symbian"); + addTestExclusion("unicode-test", "Demands too much memory on Symbian"); +#endif + QVector *data = qt_meta_data_tst_Suite(); // content: *data << 1 // revision -- cgit v0.12 From 3bf92180a78cd14e76e11b9effc45e0a27889b8f Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 27 May 2009 13:08:49 +0300 Subject: Updated S60 installation docs. --- doc/src/installation.qdoc | 129 +++++++++++++++++++----- doc/src/s60-introduction.qdoc | 9 +- doc/src/snippets/code/doc_src_installation.qdoc | 25 +++-- 3 files changed, 117 insertions(+), 46 deletions(-) diff --git a/doc/src/installation.qdoc b/doc/src/installation.qdoc index 85ea20c..91b7a25 100644 --- a/doc/src/installation.qdoc +++ b/doc/src/installation.qdoc @@ -505,7 +505,6 @@ in the \l{Qt for Windows CE Requirements} document. \ingroup installation \ingroup qts60 \brief How to install Qt on S60. - \list 1 \o Install needed IDE and SDKs @@ -522,9 +521,84 @@ in the \l{Qt for Windows CE Requirements} document. \note Users of \bold{S60 Platform SDK 3rd Edition FP1} also need special updates. The update can be found \l{http://pepper.troll.no/s60prereleases/patches/}{here}. - \note The wsini.ini provided with the \bold{S60 Platform SDK 5th Edition v0.9} - needs to be updated for correct font rendering in the emulator. The update can be found - \l{http://pepper.troll.no/s60prereleases/patches/}{here}. + \o Depending on how you obtained the Qt for S60 release, follow the instructions in one of these pages: + \list + \o \l{Installing Qt for S60 with installer} + \o \l{Installing Qt for S60 from source package} + \endlist +\endlist +*/ + +/*! \page install-S60-installer.html + +\title Installing Qt for S60 with installer +\ingroup installation +\ingroup qts60 +\brief How to install Qt on S60 using installer. +\list 1 + + \o Install Qt + + Run the \c{qt-s60-%VERSION%.exe} to install Qt. + + \note Qt must be installed on the same drive as the S60 SDK you are + using, and the install path must not contain any spaces. + + \o Environment variables + + In order to build and use Qt, the \c PATH environment variable needs + to be extended: + + \snippet doc/src/snippets/code/doc_src_installation.qdoc 18 + + This is done by adding \c{c:\Qt\%VERSION%\bin} to the \c PATH variable. + + On Windows the PATH can be extended by navigating to + "Control Panel->System->Advanced->Environment variables". + + \note Instead of modifying system path, you can also use the "Qt S60 Command Prompt" + to build your applications. It can be launched from start menu. + + In addition, you must configure the environment for use with the S60 + emulator. This is done by locating the Carbide.c++ submenu on the Start + menu, and choosing "Configure environment for WINSCW command line". + + \o Running Qt demos + + We've included a subset of the Qt demos in this package for you + to try out. An excellent starting point is the "fluidlauncher" + demo. To run the demo on a real device, you first have to install + the Qt libraries and demos on the device. + Install \c{qt_libs_armv5_urel.sisx} and \c{fluidlauncher_armv5_urel.sisx} + found at Qt installation folder to the device. + + To run the demos on the emulator, navigate to + \c{%EPOCROOT%\Epoc32\release\winscw\udeb\} and start any of the + Qt demos located there, for example: + + \snippet doc/src/snippets/code/doc_src_installation.qdoc 26 + + For more information about building and running Qt programs on S60, + see \l{S60 - Introduction to using Qt}. + + We hope you will enjoy using Qt. + +\endlist + +*/ +/*! \page install-S60-sources.html + +\title Installing Qt for S60 from source package +\ingroup installation +\ingroup qts60 +\brief How to install Qt on S60 from source package. + +\list 1 + + \o Install needed tools + + Building Qt libraries requires \l{http://www.arm.com/products/DevTools/RVCT.html}{RVCT} 2.2 [build 616] or later, + which is not available free of charge. \o Install Qt @@ -561,11 +635,9 @@ in the \l{Qt for Windows CE Requirements} document. \o Build Qt - The Qt libraries comes pre-built for real devices. - If you are using a 3.x S60 SDK, install \c{qts60binaries\3.x\qtlibs-%VERSION%.exe} - into the S60 SDK root directory. For example: \c{C:\Symbian\9.2\S60_3rd_FP1_2\} - If you are using a 5.0 S60 SDK, install \c{qts60binaries\5.0\qtlibs-%VERSION%.exe} - into the S60 SDK root directory. For example: \c{C:\S60\devices\S60_5th_Edition_SDK_v0.9\} + To build Qt for the device, type: + + \snippet doc/src/snippets/code/doc_src_installation.qdoc 28 To build Qt for the emulator, type: @@ -576,33 +648,34 @@ in the \l{Qt for Windows CE Requirements} document. \o Running Qt demos We've included a subset of the Qt demos in this package for you - to try out. An excellent starting point is the "fluidlauncher" - demo. To run the demo on a real device, you first have to install - the Qt libraries on the device. - For 3.x devices install \c{qts60binaries\3.x\qt_libs_armv5_udeb.sisx} - For 5.0 devices install \c{qts60binaries\5.0\qt_libs_armv5_udeb.sisx} - included in this package to the device. Then type: + to try out. An excellent starting point is the "fluidlauncher" + demo. To run the demo on a real device, you first have to install + the Qt libraries on the device: + + \snippet doc/src/snippets/code/doc_src_installation.qdoc 29 + + \note You will need to supply certificate that allows installation + of binaries with "All -Tcb" capability to your device. + + Similarly, install fluidlauncher to the device: - \snippet doc/src/snippets/code/doc_src_installation.qdoc 25 + \snippet doc/src/snippets/code/doc_src_installation.qdoc 30 - This will create a self-signed \c fluidlauncher_gcce_udeb.sisx and + This will create a self-signed \c fluidlauncher_armv5_urel.sisx and install it to your device. - \note You can specify your own certificate and key files as additional parameters to - \c createpackage if default ones are not suitable. - - To run the demos on the emulator simply run: + To run the demos on the emulator simply run: - \snippet doc/src/snippets/code/doc_src_installation.qdoc 27 + \snippet doc/src/snippets/code/doc_src_installation.qdoc 27 - Or, if you need to supply arguments to the program, navigate to - \c{%EPOCROOT%\Epoc32\release\winscw\udeb\} and start any of the - Qt demos located there, for example: + Or, if you need to supply arguments to the program, navigate to + \c{%EPOCROOT%\Epoc32\release\winscw\udeb\} and start any of the + Qt demos located there, for example: - \snippet doc/src/snippets/code/doc_src_installation.qdoc 26 + \snippet doc/src/snippets/code/doc_src_installation.qdoc 26 - For more information about building and running Qt programs on S60, - see \l{S60 - Introduction to using Qt}. + For more information about building and running Qt programs on S60, + see \l{S60 - Introduction to using Qt}. We hope you will enjoy using Qt. diff --git a/doc/src/s60-introduction.qdoc b/doc/src/s60-introduction.qdoc index a574355..e6e6b7e 100644 --- a/doc/src/s60-introduction.qdoc +++ b/doc/src/s60-introduction.qdoc @@ -19,19 +19,14 @@ \tableofcontents - \section1 Required tools - - In order to use Qt for S60 you need to have a typical S60 development - setup. See \l{Qt for S60 Requirements} for the details. - \section1 Installing Qt Follow the instructions found in \l{Installing Qt on S60}. \section1 Building your own applications - If you are new to Qt development, have a look at \l{How to Learn Qt} - and \l{Qt Tutorial}. In general, the difference between developing a + If you are new to Qt development, have a look at \l{How to Learn Qt}. + In general, the difference between developing a Qt application on S60 compared to any of the other platforms supported by Qt is not that big. diff --git a/doc/src/snippets/code/doc_src_installation.qdoc b/doc/src/snippets/code/doc_src_installation.qdoc index 2930317..8730125 100644 --- a/doc/src/snippets/code/doc_src_installation.qdoc +++ b/doc/src/snippets/code/doc_src_installation.qdoc @@ -138,17 +138,6 @@ make debug-winscw //! [24] -//! [25] -cd examples -make debug-gcce -cd ..\demos - -make debug-gcce -cd embedded\fluidlauncher -createpackage -i fluidlauncher_gcce_udeb.pkg -//! [25] - - //! [26] wiggly.exe -small-screen //! [26] @@ -156,3 +145,17 @@ wiggly.exe -small-screen //! [27] make run //! [27] + +//! [28] +make release-armv5 +//! [28] + +//! [29] +cd src\s60installs +createpackage -i qt_libs_armv5_urel.pkg +//! [29] + +//! [30] +cd embedded\fluidlauncher +createpackage -i fluidlauncher_armv5_urel.pkg +//! [30] -- cgit v0.12 From a135a11faeafaed264e264975b74ba7665ff5e42 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 27 May 2009 13:21:57 +0300 Subject: Configured qtwidgets autotest to use default IAP without user prompts. --- tests/auto/qtwidgets/tst_qtwidgets.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/auto/qtwidgets/tst_qtwidgets.cpp b/tests/auto/qtwidgets/tst_qtwidgets.cpp index a6a3be1..6a79242 100644 --- a/tests/auto/qtwidgets/tst_qtwidgets.cpp +++ b/tests/auto/qtwidgets/tst_qtwidgets.cpp @@ -47,15 +47,28 @@ #include "mainwindow.h" +#include "../network-settings.h" class tst_QtWidgets: public QObject { Q_OBJECT +public: + tst_QtWidgets(); + virtual ~tst_QtWidgets(); + private slots: void snapshot(); }; +tst_QtWidgets::tst_QtWidgets() +{ + Q_SET_DEFAULT_IAP +} + +tst_QtWidgets::~tst_QtWidgets() +{ +} void tst_QtWidgets::snapshot() { -- cgit v0.12 From 86d5c38d3f21a7d89dd619fa448a9c50527d8ba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Wed, 27 May 2009 13:44:40 +0300 Subject: S60Style: Keep the background texture in static QPixmap pointer. --- src/gui/styles/qs60style.cpp | 27 +++++++++++++++++---------- src/gui/styles/qs60style_p.h | 20 ++++++++++++-------- src/gui/styles/qs60style_simulated.cpp | 19 +++++-------------- src/gui/styles/qs60style_symbian.cpp | 34 ++++++++++++---------------------- 4 files changed, 46 insertions(+), 54 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 071b60a..5f7c083 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -95,7 +95,8 @@ const short QS60StylePrivate::data[][MAX_PIXELMETRICS] = { const short *QS60StylePrivate::m_pmPointer = QS60StylePrivate::data[0]; #endif // defined(QT_S60STYLE_LAYOUTDATA_SIMULATED) -bool QS60StylePrivate::m_backgroundValid = false; +// theme background texture +QPixmap *QS60StylePrivate::m_background = 0; const struct QS60StylePrivate::frameElementCenter QS60StylePrivate::m_frameElementsData[] = { {SE_ButtonNormal, QS60StyleEnums::SP_QsnFrButtonTbCenter}, @@ -352,25 +353,25 @@ QFont QS60StylePrivate::s60Font( void QS60StylePrivate::clearCaches(QS60StylePrivate::CacheClearReason reason) { - switch(reason){ + switch(reason){ case CC_LayoutChange: // when layout changes, the colors remain in cache, but graphics and fonts can change m_mappedFontsCache.clear(); - m_backgroundValid = false; + deleteBackground(); QPixmapCache::clear(); break; case CC_ThemeChange: m_colorCache.clear(); QPixmapCache::clear(); - m_backgroundValid = false; + deleteBackground(); case CC_UndefinedChange: default: m_colorCache.clear(); m_mappedFontsCache.clear(); QPixmapCache::clear(); - m_backgroundValid = false; + deleteBackground(); break; - } + } } // Since S60Style has 'button' and 'tooltip' as a graphic, we don't have any native color which to use @@ -561,6 +562,14 @@ void QS60StylePrivate::setBackgroundTexture(QApplication *app) const app->setPalette(applicationPalette); } +void QS60StylePrivate::deleteBackground() +{ + if (QS60StylePrivate::m_background) { + delete QS60StylePrivate::m_background; + QS60StylePrivate::m_background = 0; + } +} + int QS60StylePrivate::focusRectPenWidth() { return pixelMetric(QS60Style::PM_DefaultFrameWidth); @@ -1314,16 +1323,14 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, (listView->selectionMode() == QAbstractItemView::SingleSelection || listView->selectionMode() == QAbstractItemView::NoSelection); QRect selectionRect = subElementRect(SE_ItemViewItemCheckIndicator, &voptAdj, widget); - if (voptAdj.state & QStyle::State_Selected && - !singleSelection) { + if (voptAdj.state & QStyle::State_Selected && !singleSelection) { QStyleOptionViewItemV4 option(voptAdj); option.rect = selectionRect; // Draw selection mark. drawPrimitive(QStyle::PE_IndicatorViewItemCheck, &option, painter, widget); if ( textRect.right() > selectionRect.left() ) textRect.setRight(selectionRect.left()); - } - else if (singleSelection && + } else if (singleSelection && voptAdj.features & QStyleOptionViewItemV2::HasCheckIndicator) { // draw the check mark if (selectionRect.isValid()) { diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index ba7dca3..bedff58 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -331,13 +331,13 @@ public: SF_StateDisabled = 0x0020, SF_ColorSkinned = 0x0040, }; - + enum CacheClearReason { CC_UndefinedChange = 0, CC_LayoutChange, CC_ThemeChange }; - + Q_DECLARE_FLAGS(SkinElementFlags, SkinElementFlag) // draws skin element @@ -373,8 +373,10 @@ public: int pointSize = -1) const; // clears all style caches (fonts, colors, pixmaps) void clearCaches(CacheClearReason reason = CC_UndefinedChange); - // returns themed background texture - static QPixmap backgroundTexture(); + + // themed main background oprations + void setBackgroundTexture(QApplication *application) const; + static void deleteBackground(); static bool isTouchSupported(); static bool isToolBarBackground(); @@ -383,7 +385,6 @@ public: QColor colorFromFrameGraphics(QS60StylePrivate::SkinFrameElements frame) const; void setThemePalette(QApplication *application) const; void setThemePalette(QWidget *widget) const; - void setBackgroundTexture(QApplication *application) const; static int focusRectPenWidth(); @@ -411,6 +412,8 @@ public: static QPixmap frame(SkinFrameElements frame, const QSize &size, SkinElementFlags flags = KDefaultSkinElementFlags); + static QPixmap backgroundTexture(); + private: static void drawPart(QS60StyleEnums::SkinParts part, QPainter *painter, const QRect &rect, SkinElementFlags flags = KDefaultSkinElementFlags); @@ -424,9 +427,9 @@ private: SkinElementFlags flags = KDefaultSkinElementFlags); static QPixmap cachedFrame(SkinFrameElements frame, const QSize &size, SkinElementFlags flags = KDefaultSkinElementFlags); - + static void refreshUI(); - + static QSize partSize(QS60StyleEnums::SkinParts part, SkinElementFlags flags = KDefaultSkinElementFlags); static QPixmap part(QS60StyleEnums::SkinParts part, const QSize &size, @@ -436,7 +439,8 @@ private: static QSize screenSize(); - static bool m_backgroundValid; + // Contains background texture. + static QPixmap *m_background; const static SkinElementFlags KDefaultSkinElementFlags; }; diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index 65336ae..3edc874 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -193,24 +193,15 @@ QVariant QS60StylePrivate::styleProperty_specific(const char *name) const QPixmap QS60StylePrivate::backgroundTexture() { - static QPixmap result; - // Poor mans caching. + Making sure that there is always only one background image in memory at a time - -/* - TODO: 1) Hold the background QPixmap as pointer in a static class member. - Also add a deleteBackground() function and call that in ~QS60StylePrivate() - 2) Don't cache the background at all as soon as we have native pixmap support -*/ - - if (!m_backgroundValid) { - result = QPixmap(); + if (!m_background) { const QSize size = QApplication::activeWindow()?QApplication::activeWindow()->size():QSize(100, 100); - result = part(QS60StyleEnums::SP_QsnBgScreen, size); - m_backgroundValid = true; + QPixmap background = part(QS60StyleEnums::SP_QsnBgScreen, size); + m_background = new QPixmap(background); } - return result; + return *m_background; } + bool QS60StylePrivate::isTouchSupported() { #ifdef QT_KEYPAD_NAVIGATION diff --git a/src/gui/styles/qs60style_symbian.cpp b/src/gui/styles/qs60style_symbian.cpp index 3fc4c8c..f860842 100644 --- a/src/gui/styles/qs60style_symbian.cpp +++ b/src/gui/styles/qs60style_symbian.cpp @@ -583,26 +583,6 @@ QPixmap QS60StyleModeSpecifics::fromFbsBitmap(CFbsBitmap *icon, CFbsBitmap *mask return QPixmap::fromImage(iconImage); } -QPixmap QS60StylePrivate::backgroundTexture() -{ - static QPixmap result; - // Poor mans caching. + Making sure that there is always only one background image in memory at a time - -/* - TODO: 1) Hold the background QPixmap as pointer in a static class member. - Also add a deleteBackground() function and call that in ~QS60StylePrivate() - 2) Don't cache the background at all as soon as we have native pixmap support -*/ - - if (!m_backgroundValid) { - result = QPixmap(); - result = part(QS60StyleEnums::SP_QsnBgScreen, - QSize(S60->screenWidthInPixels, S60->screenHeightInPixels), SkinElementFlags()); - m_backgroundValid = true; - } - return result; -} - bool QS60StylePrivate::isTouchSupported() { return bool(AknLayoutUtils::PenEnabled()); @@ -975,7 +955,7 @@ void QS60StylePrivate::setActiveLayout() break; } } - + //not found, lets try without mirroring info if (activeLayoutIndex==-1){ for (int i=0; iscreenWidthInPixels, S60->screenHeightInPixels), SkinElementFlags()); + m_background = new QPixmap(background); + } + return *m_background; +} + // If the public SDK returns compressed images, please let us also uncompress those! void QS60StyleModeSpecifics::unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap* aTrgBitmap, CFbsBitmap* aSrcBitmap) { -- cgit v0.12 From 97228a74cbb6bffa2d621f3267da9270381aec37 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 27 May 2009 13:48:48 +0300 Subject: Workaround for non-native makefile target names with symbian-abl. --- tests/auto/qresourceengine/qresourceengine.pro | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/auto/qresourceengine/qresourceengine.pro b/tests/auto/qresourceengine/qresourceengine.pro index f487b97..d98c2db 100644 --- a/tests/auto/qresourceengine/qresourceengine.pro +++ b/tests/auto/qresourceengine/qresourceengine.pro @@ -9,7 +9,11 @@ load(resources) SOURCES += tst_resourceengine.cpp RESOURCES += testqrc/test.qrc -runtime_resource.target = $$PWD/runtime_resource.rcc +symbian-sbsv2 { + runtime_resource.target = $$PWD/runtime_resource.rcc +} else { + runtime_resource.target = runtime_resource.rcc +} runtime_resource.depends = $$PWD/testqrc/test.qrc runtime_resource.commands = $$QMAKE_RCC -root /runtime_resource/ -binary $${runtime_resource.depends} -o $${runtime_resource.target} QMAKE_EXTRA_TARGETS = runtime_resource -- cgit v0.12 From 3a61a448b92b4f7c7ee02196340d3bcb75d067fb Mon Sep 17 00:00:00 2001 From: diaulas Date: Tue, 12 May 2009 14:15:34 +0200 Subject: Dont show children when parent is not visible in QGraphicsItem When setVisible() is called on a QGraphicsItem, if the parent of that item was hidden, the child shouldn't be actually shown. Task-number: 197802 Reviewed-by: leo Reviewed-by: alexis --- src/gui/graphicsview/qgraphicsitem.cpp | 5 ++++ tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 32 ++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 4908296..b6a7386 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -1522,6 +1522,11 @@ void QGraphicsItemPrivate::setVisibleHelper(bool newVisible, bool explicitly, bo if (visible == quint32(newVisible)) return; + QGraphicsItem *parent(q_ptr->parentItem()); + if (parent && newVisible && !parent->d_ptr->visible) { + return; + } + // Modify the property. const QVariant newVisibleVariant(q_ptr->itemChange(QGraphicsItem::ItemVisibleChange, quint32(newVisible))); diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 58a17ea..d477135 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -123,6 +123,7 @@ private slots: void destruction(); void scene(); void parentItem(); + void childrenVisibility(); void setParentItem(); void children(); void flags(); @@ -549,6 +550,37 @@ void tst_QGraphicsItem::parentItem() delete item2; } +void tst_QGraphicsItem::childrenVisibility() +{ + QGraphicsScene scene; + QGraphicsRectItem item(QRectF(0,0,20,20)); + + QGraphicsRectItem *item2 = new QGraphicsRectItem(QRectF(0,0,10,10), &item); + scene.addItem(&item); + + //freshly created: both visible + QVERIFY(item.isVisible()); + QVERIFY(item2->isVisible()); + //hide child: parent visible, child not + item2->hide(); + QVERIFY(item.isVisible()); + QVERIFY(!item2->isVisible()); + //hide parent: parent and child invisible + item.hide(); + QVERIFY(!item.isVisible()); + QVERIFY(!item2->isVisible()); + //ask to show the child: parent and child invisible anyways + item2->show(); + QVERIFY(!item.isVisible()); + QVERIFY(!item2->isVisible()); + //show the parent: both parent and child visible + item.show(); + QVERIFY(item.isVisible()); + QVERIFY(item2->isVisible()); + + delete item2; +} + void tst_QGraphicsItem::setParentItem() { QGraphicsScene scene; -- cgit v0.12 From 5675d15eebd76fde43bc9305347c3b7833a7d893 Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Wed, 27 May 2009 15:03:00 +0200 Subject: Fixes for merge-request #407 Removed unused line and added task number to autotest. --- src/gui/graphicsview/qgraphicsitem.cpp | 5 +- tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 70 ++++++++++++++------------ 2 files changed, 39 insertions(+), 36 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index b6a7386..e8ace65 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -1522,10 +1522,9 @@ void QGraphicsItemPrivate::setVisibleHelper(bool newVisible, bool explicitly, bo if (visible == quint32(newVisible)) return; - QGraphicsItem *parent(q_ptr->parentItem()); - if (parent && newVisible && !parent->d_ptr->visible) { + // Don't show child if parent is not visible + if (parent && newVisible && !parent->d_ptr->visible) return; - } // Modify the property. const QVariant newVisibleVariant(q_ptr->itemChange(QGraphicsItem::ItemVisibleChange, diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index d477135..34a6ab1 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -123,7 +123,6 @@ private slots: void destruction(); void scene(); void parentItem(); - void childrenVisibility(); void setParentItem(); void children(); void flags(); @@ -227,6 +226,7 @@ private slots: void task240400_clickOnTextItem_data(); void task240400_clickOnTextItem(); void task243707_addChildBeforeParent(); + void task197802_childrenVisibility(); }; void tst_QGraphicsItem::init() @@ -550,37 +550,6 @@ void tst_QGraphicsItem::parentItem() delete item2; } -void tst_QGraphicsItem::childrenVisibility() -{ - QGraphicsScene scene; - QGraphicsRectItem item(QRectF(0,0,20,20)); - - QGraphicsRectItem *item2 = new QGraphicsRectItem(QRectF(0,0,10,10), &item); - scene.addItem(&item); - - //freshly created: both visible - QVERIFY(item.isVisible()); - QVERIFY(item2->isVisible()); - //hide child: parent visible, child not - item2->hide(); - QVERIFY(item.isVisible()); - QVERIFY(!item2->isVisible()); - //hide parent: parent and child invisible - item.hide(); - QVERIFY(!item.isVisible()); - QVERIFY(!item2->isVisible()); - //ask to show the child: parent and child invisible anyways - item2->show(); - QVERIFY(!item.isVisible()); - QVERIFY(!item2->isVisible()); - //show the parent: both parent and child visible - item.show(); - QVERIFY(item.isVisible()); - QVERIFY(item2->isVisible()); - - delete item2; -} - void tst_QGraphicsItem::setParentItem() { QGraphicsScene scene; @@ -5378,7 +5347,7 @@ void tst_QGraphicsItem::task243707_addChildBeforeParent() // inconsistent internal state that can cause a crash. This test shows // one such crash. QGraphicsScene scene; - QGraphicsWidget *widget = new QGraphicsWidget; + QGraphicsWidget *widget = new QGraphicsWidget; QGraphicsWidget *widget2 = new QGraphicsWidget(widget); scene.addItem(widget2); QVERIFY(!widget2->parentItem()); @@ -5387,6 +5356,41 @@ void tst_QGraphicsItem::task243707_addChildBeforeParent() QVERIFY(!widget2->commonAncestorItem(widget)); } +void tst_QGraphicsItem::task197802_childrenVisibility() +{ + QGraphicsScene scene; + QGraphicsRectItem item(QRectF(0,0,20,20)); + + QGraphicsRectItem *item2 = new QGraphicsRectItem(QRectF(0,0,10,10), &item); + scene.addItem(&item); + + //freshly created: both visible + QVERIFY(item.isVisible()); + QVERIFY(item2->isVisible()); + + //hide child: parent visible, child not + item2->hide(); + QVERIFY(item.isVisible()); + QVERIFY(!item2->isVisible()); + + //hide parent: parent and child invisible + item.hide(); + QVERIFY(!item.isVisible()); + QVERIFY(!item2->isVisible()); + + //ask to show the child: parent and child invisible anyways + item2->show(); + QVERIFY(!item.isVisible()); + QVERIFY(!item2->isVisible()); + + //show the parent: both parent and child visible + item.show(); + QVERIFY(item.isVisible()); + QVERIFY(item2->isVisible()); + + delete item2; +} + void tst_QGraphicsItem::boundingRegion_data() { QTest::addColumn("line"); -- cgit v0.12 From df4a095019638356520728f88ac4d919e654dcdd Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Wed, 27 May 2009 15:41:01 +0200 Subject: Modify QDesktopWidget to emit proper signals on resize. The resize behavior of QDesktopWidget was somewhat undefined on Symbian because we weren't actually changing the size of the widget. This patch fixes that and also implements the resizeEvent() function so that it properly emits signals. We didn't call resize() to change the size here because our implementation of setGeometry_sys() ignores the desktop widget since it doesn't have a backing store and isn't a real window. Task-number: 253930 --- src/gui/kernel/qapplication_s60.cpp | 10 ++++++ src/gui/kernel/qdesktopwidget_s60.cpp | 63 ++++++++++++++++++++++++++++++----- 2 files changed, 65 insertions(+), 8 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index dd51fcd..5b2c1fb 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -14,6 +14,7 @@ #include "qevent.h" #include "qeventdispatcher_s60_p.h" #include "qwidget.h" +#include "qdesktopwidget.h" #include "private/qbackingstore_p.h" #include "qt_s60_p.h" #include "private/qevent_p.h" @@ -49,6 +50,8 @@ static bool appNoGrab = false; // Grabbing enabled Q_GUI_EXPORT QS60Data *qt_s60Data = 0; extern bool qt_sendSpontaneousEvent(QObject*,QEvent*); +extern QDesktopWidget *qt_desktopWidget; // qapplication.cpp + QWidget *qt_button_down = 0; // widget got last button-down bool qt_nograb() // application no-grab option @@ -988,6 +991,13 @@ int QApplication::s60ProcessEvent(TWsEvent *event) case EEventScreenDeviceChanged: if (S60) S60->updateScreenSize(); + if (qt_desktopWidget) { + QSize oldSize = qt_desktopWidget->size(); + qt_desktopWidget->data->crect.setWidth(S60->screenWidthInPixels); + qt_desktopWidget->data->crect.setHeight(S60->screenHeightInPixels); + QResizeEvent e(qt_desktopWidget->size(), oldSize); + QApplication::sendEvent(qt_desktopWidget, &e); + } return 0; // Propagate to CONE case EEventWindowVisibilityChanged: if (controlInMap) { diff --git a/src/gui/kernel/qdesktopwidget_s60.cpp b/src/gui/kernel/qdesktopwidget_s60.cpp index 029892e..d57d289 100644 --- a/src/gui/kernel/qdesktopwidget_s60.cpp +++ b/src/gui/kernel/qdesktopwidget_s60.cpp @@ -32,34 +32,58 @@ public: static int screenCount; static int primaryScreen; + + static QVector *rects; + static QVector *workrects; + + static int refcount; }; int QDesktopWidgetPrivate::screenCount = 1; int QDesktopWidgetPrivate::primaryScreen = 0; +QVector *QDesktopWidgetPrivate::rects = 0; +QVector *QDesktopWidgetPrivate::workrects = 0; +int QDesktopWidgetPrivate::refcount = 0; QDesktopWidgetPrivate::QDesktopWidgetPrivate() { + ++refcount; } QDesktopWidgetPrivate::~QDesktopWidgetPrivate() { + if (!--refcount) + cleanup(); } void QDesktopWidgetPrivate::init(QDesktopWidget *that) { - TInt screenCount=0; - TInt result=0; + int screenCount=0; + + if (HAL::Get(0, HALData::EDisplayNumberOfScreens, screenCount) == KErrNone) + QDesktopWidgetPrivate::screenCount = screenCount; + else + QDesktopWidgetPrivate::screenCount = 0; - result = HAL::Get(0, HALData::EDisplayNumberOfScreens, screenCount); - QDesktopWidgetPrivate::screenCount = screenCount; - if( result != KErrNone) - { - // ### What to do if no screens found? - } + rects = new QVector(); + workrects = new QVector(); + + rects->resize(QDesktopWidgetPrivate::screenCount); + workrects->resize(QDesktopWidgetPrivate::screenCount); + + // ### TODO: Implement proper multi-display support + rects->resize(1); + rects->replace(0, that->rect()); + workrects->resize(1); + workrects->replace(0, that->rect()); } void QDesktopWidgetPrivate::cleanup() { + delete rects; + rects = 0; + delete workrects; + workrects = 0; } @@ -120,6 +144,29 @@ int QDesktopWidget::screenNumber(const QPoint &point) const void QDesktopWidget::resizeEvent(QResizeEvent *) { + Q_D(QDesktopWidget); + QVector oldrects; + oldrects = *d->rects; + QVector oldworkrects; + oldworkrects = *d->workrects; + int oldscreencount = d->screenCount; + + QDesktopWidgetPrivate::cleanup(); + QDesktopWidgetPrivate::init(this); + + for (int i = 0; i < qMin(oldscreencount, d->screenCount); ++i) { + QRect oldrect = oldrects[i]; + QRect newrect = d->rects->at(i); + if (oldrect != newrect) + emit resized(i); + } + + for (int j = 0; j < qMin(oldscreencount, d->screenCount); ++j) { + QRect oldrect = oldworkrects[j]; + QRect newrect = d->workrects->at(j); + if (oldrect != newrect) + emit workAreaResized(j); + } } QT_END_NAMESPACE -- cgit v0.12 From e24868e99ef0ffd8e5690761a798d731c4b71b26 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Wed, 27 May 2009 16:30:47 +0200 Subject: Fixed a possible assert in QGtkStyle We now set and unset the GTK_HAS_FOCUS flag on the same painting call only if focus is set instead of resetting it on each painting call. This is a tiny optimization but also kills a possible assert on certain versions of Gtk+ (as reported with Red Hat Enterprise Linux 5). Task-number: 254614 Reviewed-by: denis --- src/gui/styles/qgtkstyle.cpp | 63 ++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index 14be518..0e54af8 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -940,10 +940,6 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element, case PE_FrameLineEdit: { GtkWidget *gtkEntry = QGtk::gtkWidget(QLS("GtkEntry")); - if (option->state & State_HasFocus) - GTK_WIDGET_SET_FLAGS(gtkEntry, GTK_HAS_FOCUS); - else - GTK_WIDGET_UNSET_FLAGS(gtkEntry, GTK_HAS_FOCUS); gboolean interior_focus; gint focus_line_width; @@ -957,6 +953,9 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element, if (!interior_focus && option->state & State_HasFocus) rect.adjust(focus_line_width, focus_line_width, -focus_line_width, -focus_line_width); + + if (option->state & State_HasFocus) + GTK_WIDGET_SET_FLAGS(gtkEntry, GTK_HAS_FOCUS); gtkPainter.paintShadow(gtkEntry, "entry", rect, option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE, GTK_SHADOW_IN, gtkEntry->style, @@ -965,6 +964,9 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element, gtkPainter.paintShadow(gtkEntry, "entry", option->rect, option->state & State_Enabled ? GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE, GTK_SHADOW_IN, gtkEntry->style, QLS("GtkEntryShadowIn")); + + if (option->state & State_HasFocus) + GTK_WIDGET_UNSET_FLAGS(gtkEntry, GTK_HAS_FOCUS); } break; @@ -1050,17 +1052,13 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element, GTK_WIDGET_SET_FLAGS(gtkButton, GTK_HAS_DEFAULT); gtkPainter.paintBox(gtkButton, "buttondefault", buttonRect, state, GTK_SHADOW_IN, style, isDefault ? QLS("d") : QString()); - } else - GTK_WIDGET_UNSET_FLAGS(gtkButton, GTK_HAS_DEFAULT); + } bool hasFocus = option->state & State_HasFocus; if (hasFocus) { key += QLS("def"); GTK_WIDGET_SET_FLAGS(gtkButton, GTK_HAS_FOCUS); - - } else { - GTK_WIDGET_UNSET_FLAGS(gtkButton, GTK_HAS_FOCUS); } if (!interiorFocus) @@ -1071,6 +1069,10 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element, gtkPainter.paintBox(gtkButton, "button", buttonRect, state, shadow, style, key); + if (isDefault) + GTK_WIDGET_UNSET_FLAGS(gtkButton, GTK_HAS_DEFAULT); + if (hasFocus) + GTK_WIDGET_UNSET_FLAGS(gtkButton, GTK_HAS_FOCUS); } break; @@ -1334,6 +1336,8 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom GtkWidget *gtkToggleButton = QGtk::gtkWidget(buttonPath); QGtk::gtk_widget_set_direction(gtkToggleButton, reverse ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR); if (gtkToggleButton && (appears_as_list || comboBox->editable)) { + if (focus) + GTK_WIDGET_SET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS); // Draw the combo box as a line edit with a button next to it if (comboBox->editable || appears_as_list) { GtkStateType frameState = (state == GTK_STATE_PRELIGHT) ? GTK_STATE_NORMAL : state; @@ -1347,22 +1351,16 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom else frameRect.setRight(arrowButtonRect.left()); - // Required for inner blue highlight with clearlooks - if (focus) { - GTK_WIDGET_SET_FLAGS(gtkEntry, GTK_HAS_FOCUS); - GTK_WIDGET_SET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS); - - } else { - GTK_WIDGET_UNSET_FLAGS(gtkEntry, GTK_HAS_FOCUS); - GTK_WIDGET_UNSET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS); - } - // Fill the line edit background // We could have used flat_box with "entry_bg" but that is probably not worth the overhead uint resolve_mask = option->palette.resolve(); int xt = gtkEntry->style->xthickness; int yt = gtkEntry->style->ythickness; QRect contentRect = frameRect.adjusted(xt, yt, -xt, -yt); + // Required for inner blue highlight with clearlooks + if (focus) + GTK_WIDGET_SET_FLAGS(gtkEntry, GTK_HAS_FOCUS); + if (widget && widget->testAttribute(Qt::WA_SetPalette) && resolve_mask & (1 << QPalette::Base)) // Palette overridden by user p->fillRect(contentRect, option->palette.base().color()); @@ -1376,6 +1374,8 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom GTK_SHADOW_IN, gtkEntry->style, entryPath + QString::number(focus) + QString::number(comboBox->editable) + QString::number(option->direction)); + if (focus) + GTK_WIDGET_UNSET_FLAGS(gtkEntry, GTK_HAS_FOCUS); } GtkStateType buttonState = GTK_STATE_NORMAL; @@ -1394,22 +1394,21 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom gtkCachedPainter.paintBox( gtkToggleButton, "button", arrowButtonRect, buttonState, shadow, gtkToggleButton->style, buttonPath + QString::number(focus) + QString::number(option->direction)); - + if (focus) + GTK_WIDGET_UNSET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS); } else { // Draw combo box as a button QRect buttonRect = option->rect; - if (focus) { // Clearlooks actually check the widget for the default state + if (focus) // Clearlooks actually check the widget for the default state GTK_WIDGET_SET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS); - - } else { - GTK_WIDGET_UNSET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS); - } - gtkCachedPainter.paintBox(gtkToggleButton, "button", buttonRect, state, shadow, gtkToggleButton->style, buttonPath + QString::number(focus)); + if (focus) + GTK_WIDGET_UNSET_FLAGS(gtkToggleButton, GTK_HAS_FOCUS); + // Draw the separator between label and arrows QString vSeparatorPath = buttonPath + QLS(".GtkHBox.GtkVSeparator"); @@ -1775,15 +1774,12 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom shadow = GTK_SHADOW_IN; style = gtkPainter.getStyle(gtkSpinButton); - if (option->state & State_HasFocus) - GTK_WIDGET_SET_FLAGS(gtkSpinButton, GTK_HAS_FOCUS); - else - GTK_WIDGET_UNSET_FLAGS(gtkSpinButton, GTK_HAS_FOCUS); QString key; - - if (option->state & State_HasFocus) + if (option->state & State_HasFocus) { key = QLS("f"); + GTK_WIDGET_SET_FLAGS(gtkSpinButton, GTK_HAS_FOCUS); + } uint resolve_mask = option->palette.resolve(); @@ -1816,6 +1812,9 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom gtkPainter.paintBox( gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_PRELIGHT, GTK_SHADOW_OUT, style, key); else gtkPainter.paintBox( gtkSpinButton, "spinbutton_down", downRect, GTK_STATE_NORMAL, GTK_SHADOW_OUT, style, key); + + if (option->state & State_HasFocus) + GTK_WIDGET_UNSET_FLAGS(gtkSpinButton, GTK_HAS_FOCUS); } if (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus) { -- cgit v0.12 From 2be3c937fdca26287f74dd58cc217cb51924cf8a Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Wed, 27 May 2009 17:21:53 +0200 Subject: QNetworkReply internals: do not assert when aborted and reading data ...but just silently return. This is ok because at another location in QNetworkReplyImplPrivate we do the same. Reviewed-by: Thiago Task-number: 254638 --- src/network/access/qnetworkreplyimpl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp index 79c3d1a..6f715e5 100644 --- a/src/network/access/qnetworkreplyimpl.cpp +++ b/src/network/access/qnetworkreplyimpl.cpp @@ -382,7 +382,8 @@ void QNetworkReplyImplPrivate::feed(const QByteArray &data) void QNetworkReplyImplPrivate::feed(QIODevice *data) { Q_Q(QNetworkReplyImpl); - Q_ASSERT(q->isOpen()); + if (!q->isOpen()) + return; // read until EOF from data if (copyDevice) { -- cgit v0.12 From d0bc0a26f8ac4c2f02819c262b8aa7c3dd1cad3b Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 27 May 2009 17:25:01 +0200 Subject: Fixed: Setting a border using stylesheet for QComboBox adds an unwated frame. This was already fix. But there was still a frame if there was a stylesheet on the applicaiton. The reason is that the frame's constructor call the style for some hints. And later the combobox will query the style again for the frame hint, before the view get polished. The problem is that the StyleSheetStyle will fill the css cache with wrong information on the first call. This is not visible if there is no stylesheet as in the constructor, the widget style is still the default application stylesheet if there is no global applicaiton stylesheet. Task-number: 254589 Reviewed-by: jbache BT: --- src/gui/styles/qstylesheetstyle.cpp | 9 ++++++--- tests/auto/qcombobox/tst_qcombobox.cpp | 8 +++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index 714b8c5..bd80bb6 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -5252,9 +5252,12 @@ int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWi #ifndef QT_NO_COMBOBOX if (qobject_cast(w)) { QAbstractItemView *view = qFindChild(w); - QRenderRule subRule = renderRule(view, PseudoElement_None); - if (subRule.hasBox() || !subRule.hasNativeBorder()) - return QFrame::NoFrame; + if (view) { + view->ensurePolished(); + QRenderRule subRule = renderRule(view, PseudoElement_None); + if (subRule.hasBox() || !subRule.hasNativeBorder()) + return QFrame::NoFrame; + } } #endif // QT_NO_COMBOBOX break; diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp index 2fff6d0..816b2e8 100644 --- a/tests/auto/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/qcombobox/tst_qcombobox.cpp @@ -2171,7 +2171,7 @@ void tst_QComboBox::noScrollbar_data() QTest::newRow("everything and more") << QString::fromLatin1("QAbstractItemView { border: 1px 3px 5px 1px solid blue; " " padding: 2px 5px 3px 1px; margin: 2px 5px 3px 1px; } " " QAbstractItemView::item { border: 2px solid green; " - " padding: 1px 1px 2px 2px margin: 1px; } " ); + " padding: 1px 1px 2px 2px; margin: 1px; } " ); } void tst_QComboBox::noScrollbar() @@ -2179,10 +2179,11 @@ void tst_QComboBox::noScrollbar() QStringList initialContent; initialContent << "foo" << "bar" << "foobar" << "moo"; QFETCH(QString, stylesheet); + QString oldCss = qApp->styleSheet(); + qApp->setStyleSheet(stylesheet); { QComboBox comboBox; - comboBox.setStyleSheet(stylesheet); comboBox.addItems(initialContent); comboBox.show(); comboBox.resize(200, comboBox.height()); @@ -2196,7 +2197,6 @@ void tst_QComboBox::noScrollbar() { QTableWidget *table = new QTableWidget(2,2); QComboBox comboBox; - comboBox.setStyleSheet(stylesheet); comboBox.setView(table); comboBox.setModel(table->model()); comboBox.show(); @@ -2207,6 +2207,8 @@ void tst_QComboBox::noScrollbar() QVERIFY(!comboBox.view()->horizontalScrollBar()->isVisible()); QVERIFY(!comboBox.view()->verticalScrollBar()->isVisible()); } + + qApp->setStyleSheet(oldCss); } void tst_QComboBox::setItemDelegate() -- cgit v0.12 From f96614f608d080b89fde95118f0eb35443b671ea Mon Sep 17 00:00:00 2001 From: Aleksandar Sasha Babic Date: Wed, 27 May 2009 18:55:18 +0200 Subject: InputMethods supported enabled for QPlainTextEdit. --- src/gui/widgets/qplaintextedit.cpp | 20 ++++++++++++++++++-- src/gui/widgets/qplaintextedit_p.h | 6 +++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp index e563fa1..3d2c4f5 100644 --- a/src/gui/widgets/qplaintextedit.cpp +++ b/src/gui/widgets/qplaintextedit.cpp @@ -72,6 +72,11 @@ QT_BEGIN_NAMESPACE +static inline bool shouldEnableInputMethod(QPlainTextEdit *plaintextedit) +{ + return !plaintextedit->isReadOnly(); +} + class QPlainTextDocumentLayoutPrivate : public QAbstractTextDocumentLayoutPrivate { Q_DECLARE_PUBLIC(QPlainTextDocumentLayout) @@ -705,7 +710,8 @@ QPlainTextEditPrivate::QPlainTextEditPrivate() tabChangesFocus(false), lineWrap(QPlainTextEdit::WidgetWidth), wordWrap(QTextOption::WrapAtWordBoundaryOrAnywhere), - topLine(0), pageUpDownLastCursorYIsValid(false) + clickCausedFocus(0),topLine(0), + pageUpDownLastCursorYIsValid(false) { showCursorOnInitialShow = true; backgroundVisible = false; @@ -1905,6 +1911,13 @@ void QPlainTextEdit::mouseReleaseEvent(QMouseEvent *e) d->autoScrollTimer.stop(); d->ensureCursorVisible(); } + + if (e->button() == Qt::LeftButton && qApp->autoSipEnabled() + && (!d->clickCausedFocus || qApp->autoSipOnMouseFocus())) { + QEvent event(QEvent::RequestSoftwareInputPanel); + QApplication::sendEvent(this, &event); + } + d->clickCausedFocus = 0; } /*! \reimp @@ -2038,6 +2051,9 @@ QVariant QPlainTextEdit::inputMethodQuery(Qt::InputMethodQuery property) const void QPlainTextEdit::focusInEvent(QFocusEvent *e) { Q_D(QPlainTextEdit); + if (e->reason() == Qt::MouseFocusReason) { + d->clickCausedFocus = 1; + } QAbstractScrollArea::focusInEvent(e); d->sendControlEvent(e); } @@ -2304,7 +2320,7 @@ void QPlainTextEdit::setReadOnly(bool ro) } else { flags = Qt::TextEditorInteraction; } - setAttribute(Qt::WA_InputMethodEnabled, !ro); + setAttribute(Qt::WA_InputMethodEnabled, shouldEnableInputMethod(this)); d->control->setTextInteractionFlags(flags); } diff --git a/src/gui/widgets/qplaintextedit_p.h b/src/gui/widgets/qplaintextedit_p.h index 0739d53..56a3aa9 100644 --- a/src/gui/widgets/qplaintextedit_p.h +++ b/src/gui/widgets/qplaintextedit_p.h @@ -91,7 +91,10 @@ public: return r; } inline QRectF cursorRect() { return cursorRect(textCursor()); } - void ensureCursorVisible() { textEdit->ensureCursorVisible(); } + void ensureCursorVisible() { + textEdit->ensureCursorVisible(); + emit microFocusChanged(); + } QPlainTextEdit *textEdit; @@ -148,6 +151,7 @@ public: uint backgroundVisible : 1; uint centerOnScroll : 1; uint inDrag : 1; + uint clickCausedFocus : 1; int topLine; -- cgit v0.12 From 51d580aef7fce99a7c531fa35e50637ec8704a5d Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 27 May 2009 21:43:02 +0200 Subject: QSoftKeyStack::softKeyStackOfWidget only returns a stack if has one. No implicit creation happens. --- src/gui/widgets/qsoftkeystack.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index ac58d2a..50d7939 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -220,7 +220,7 @@ QMainWindow *QSoftKeyStack::mainWindowOfWidget(QWidget *widget) QSoftKeyStack *QSoftKeyStack::softKeyStackOfWidget(QWidget *widget) { QMainWindow *mainWindow = mainWindowOfWidget(widget); - return mainWindow ? mainWindow->softKeyStack() : 0; + return (mainWindow && mainWindow->hasSoftKeyStack()) ? mainWindow->softKeyStack() : 0; } #if !defined(Q_WS_S60) -- cgit v0.12 From 8c7098210e6dfa7886d6e33918899a211019b699 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 27 May 2009 22:47:19 +0200 Subject: Moved the soft key command relay acrobatics from QApplication to QSoftKeyStackPrivate. Removed QSoftKeyStack::handleSoftKeyPress and made QSoftKeyStackPrivate::handleSoftKeyPress static, so that it can be called from QApplication. --- src/gui/kernel/qapplication_s60.cpp | 12 +++--------- src/gui/widgets/qsoftkeystack.cpp | 6 ------ src/gui/widgets/qsoftkeystack.h | 2 -- src/gui/widgets/qsoftkeystack_p.h | 2 +- src/gui/widgets/qsoftkeystack_s60.cpp | 12 ++++++++++-- 5 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index ad1c842..138ba8c 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -29,8 +29,6 @@ #include "private/qwindowsurface_s60_p.h" #include "qpaintengine.h" #include "qmenubar.h" -#include "qmainwindow.h" -#include "qsoftkeystack.h" #include "private/qsoftkeystack_p.h" #include "apgwgnam.h" // For CApaWindowGroupName @@ -1041,14 +1039,10 @@ void QApplication::s60HandleCommandL(int command) exit(); break; default: - if (command >= SOFTKEYSTART && command <= SOFTKEYEND) { - const QMainWindow *activeMainWindow = - qobject_cast(QApplication::activeWindow()); - if (activeMainWindow) - activeMainWindow->softKeyStack()->handleSoftKeyPress(command); - } else { + if (command >= SOFTKEYSTART && command <= SOFTKEYEND) + QSoftKeyStackPrivate::handleSoftKeyPress(command); + else QMenuBar::symbianCommands(command); - } break; } } diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index 50d7939..c68fe19 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -201,12 +201,6 @@ void QSoftKeyStack::handleFocusChanged(QWidget *old, QWidget *now) } } -void QSoftKeyStack::handleSoftKeyPress(int command) -{ - Q_D(QSoftKeyStack); - d->handleSoftKeyPress(command); -} - QMainWindow *QSoftKeyStack::mainWindowOfWidget(QWidget *widget) { QWidget *widgetParent = widget; diff --git a/src/gui/widgets/qsoftkeystack.h b/src/gui/widgets/qsoftkeystack.h index 2606bd1..423da66 100644 --- a/src/gui/widgets/qsoftkeystack.h +++ b/src/gui/widgets/qsoftkeystack.h @@ -71,8 +71,6 @@ public: const QSoftkeySet& top(); bool isEmpty(); - void handleSoftKeyPress(int command); - static QMainWindow *mainWindowOfWidget(QWidget *widget); static QSoftKeyStack *softKeyStackOfWidget(QWidget *widget); diff --git a/src/gui/widgets/qsoftkeystack_p.h b/src/gui/widgets/qsoftkeystack_p.h index e728cbb..75d7ad4 100644 --- a/src/gui/widgets/qsoftkeystack_p.h +++ b/src/gui/widgets/qsoftkeystack_p.h @@ -82,7 +82,7 @@ public: void popandPush(const QList &softkeys); const QSoftkeySet& top(); bool isEmpty(); - void handleSoftKeyPress(int command); + static void handleSoftKeyPress(int command); private: void mapSoftKeys(const QSoftkeySet &top); diff --git a/src/gui/widgets/qsoftkeystack_s60.cpp b/src/gui/widgets/qsoftkeystack_s60.cpp index e9ca13a..8dfd5dd 100644 --- a/src/gui/widgets/qsoftkeystack_s60.cpp +++ b/src/gui/widgets/qsoftkeystack_s60.cpp @@ -48,6 +48,8 @@ #include "private/qcore_symbian_p.h" #include "qsoftkeystack_p.h" +#include "qapplication.h" +#include "qmainwindow.h" void QSoftKeyStackPrivate::mapSoftKeys(const QSoftkeySet &top) { @@ -99,9 +101,15 @@ void QSoftKeyStackPrivate::setNativeSoftKeys() void QSoftKeyStackPrivate::handleSoftKeyPress(int command) { - const QSoftkeySet top = softKeyStack.top(); + const QMainWindow *activeMainWindow = + qobject_cast(QApplication::activeWindow()); + if (!activeMainWindow) + return; + QSoftKeyStackPrivate *d_ptr = activeMainWindow->softKeyStack()->d_func(); + + const QSoftkeySet top = d_ptr->softKeyStack.top(); int index = command-SOFTKEYSTART; - if( index<0 || index>=top.count()){ + if (index < 0 || index >= top.count()) { // ### FIX THIS, add proper error handling, now fail quietly return; } -- cgit v0.12 From 2f42ad94f671d50568afa2a1d0ef82e921cc73a0 Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Thu, 28 May 2009 09:09:07 +0200 Subject: Optimize font DPI calculation by using cached value. The default DPI is stored in the S60 structure, so that can simply be used here instead of re-calculating it each time. Task-number: 247279 --- src/gui/text/qfont.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index 4d316f6..930e8af 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -173,8 +173,7 @@ Q_GUI_EXPORT int qt_defaultDpiX() screen = subScreens.at(0); dpi = qRound(screen->width() / (screen->physicalWidth() / qreal(25.4))); #elif defined(Q_WS_S60) - const TReal inchWidth = (TReal)S60->screenWidthInTwips / KTwipsPerInch; - dpi = S60->screenWidthInPixels / inchWidth; + dpi = S60->defaultDpiX; #endif // Q_WS_X11 return dpi; @@ -202,8 +201,7 @@ Q_GUI_EXPORT int qt_defaultDpiY() screen = subScreens.at(0); dpi = qRound(screen->height() / (screen->physicalHeight() / qreal(25.4))); #elif defined(Q_WS_S60) - const TReal inchHeight = (TReal)S60->screenHeightInTwips / KTwipsPerInch; - dpi = S60->screenHeightInPixels / inchHeight; + dpi = S60->defaultDpiY; #endif // Q_WS_X11 return dpi; -- cgit v0.12 From ec081e992b1c8588bd08fef677fe090f6fe5c693 Mon Sep 17 00:00:00 2001 From: Aleksandar Sasha Babic Date: Thu, 28 May 2009 09:24:58 +0200 Subject: No need for this IP address. --- tests/auto/qhostinfo/tst_qhostinfo.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/auto/qhostinfo/tst_qhostinfo.cpp b/tests/auto/qhostinfo/tst_qhostinfo.cpp index c3aca7a..0395ca0 100644 --- a/tests/auto/qhostinfo/tst_qhostinfo.cpp +++ b/tests/auto/qhostinfo/tst_qhostinfo.cpp @@ -92,7 +92,6 @@ //TESTED_CLASS= //TESTED_FILES= -const char * const lupinellaIp = "10.3.4.6"; class tst_QHostInfo : public QObject { -- cgit v0.12 From 695e49acfb34ffb5b61fddbd6afff9f1281e8299 Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Thu, 28 May 2009 10:00:22 +0200 Subject: Doc - final screenshot and changes --- doc/src/designer-manual.qdoc | 19 ++++++++----------- .../images/rgbController-configure-connection1.png | Bin 29210 -> 23241 bytes 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/doc/src/designer-manual.qdoc b/doc/src/designer-manual.qdoc index 58d0f71..4b8de32 100644 --- a/doc/src/designer-manual.qdoc +++ b/doc/src/designer-manual.qdoc @@ -58,7 +58,8 @@ and custom plugins allow you to use your own components with \QD. If you are new to \QD, you can take a look at the - \l{Getting To Know Qt Designer} document. + \l{Getting To Know Qt Designer} document. For a quick tutorial on how to + use \QD, refer to \l{A Quick Start to Qt Designer}. Qt Designer 4.5 boasts a long list of improvements. For a detailed list of what is new, refer \l{What's New in Qt Designer 4.5}. @@ -499,7 +500,7 @@ correct signal and slot and click \gui OK. \endtable - \image rgbController-configureConnection1.png + \image rgbController-configure-connection1.png Repeat the step (in reverse order), clicking on the spin box and dragging the cursor towards the slider, to connect the spin box's @@ -531,15 +532,11 @@ process for the remaining spin boxes and sliders. \endtable - Now, we preview your form to see how it would look in your application. To - preview your form, press \key{Ctrl + R} or select \gui Preview from the - \gui Form menu. - - \image rgbController-preview.png - - Try dragging the slider - the spin box will mirror its value too (and vice - versa). Also, you can resize it to see how the layouts used to manage the - child widgets respond to different window sizes. + Now, we preview your form to see how it would look in your application - + press \key{Ctrl + R} or select \gui Preview from the \gui Form menu. Try + dragging the slider - the spin box will mirror its value too (and vice + versa). Also, you can resize it to see how the layouts that are used to + manage the child widgets, respond to different window sizes. */ diff --git a/doc/src/images/rgbController-configure-connection1.png b/doc/src/images/rgbController-configure-connection1.png index 0798184..4e5dcf2 100644 Binary files a/doc/src/images/rgbController-configure-connection1.png and b/doc/src/images/rgbController-configure-connection1.png differ -- cgit v0.12 From abed949f0de16c94a146a965a13b38493cde6671 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Thu, 28 May 2009 11:29:34 +0200 Subject: BT: aboutQt dialog is too big. Make use of setInformativeText in qmessagebox for aboutQt dialog for now. Proper fix might be to add scrollable widget to the dialog, or split the about info into several pieces, though it cannot be done in a patch release. Task-number: 254464 Reviewed-by: Trenton Schulz --- src/gui/dialogs/qmessagebox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/dialogs/qmessagebox.cpp b/src/gui/dialogs/qmessagebox.cpp index fb3bcb8..b121a8f 100644 --- a/src/gui/dialogs/qmessagebox.cpp +++ b/src/gui/dialogs/qmessagebox.cpp @@ -1723,7 +1723,7 @@ void QMessageBox::aboutQt(QWidget *parent, const QString &title) QMessageBox *msgBox = new QMessageBox(parent); msgBox->setAttribute(Qt::WA_DeleteOnClose); msgBox->setWindowTitle(title.isEmpty() ? tr("About Qt") : title); - msgBox->setText(translatedTextAboutQt); + msgBox->setInformativeText(translatedTextAboutQt); QPixmap pm(QLatin1String(":/trolltech/qmessagebox/images/qtlogo-64.png")); if (!pm.isNull()) -- cgit v0.12 From b2a1e5938e1abf45d70cbfa7ec1ab0c21c01911d Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 27 May 2009 10:19:44 +0200 Subject: support for -ltcg configure switch for Windows CE builds Additionally we turn -ltcg on by default on Windows CE. See commit 56191830 for details. Reviewed-by: mauricek BT: yes --- mkspecs/common/wince.conf | 7 +++++-- tools/configure/configureapp.cpp | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mkspecs/common/wince.conf b/mkspecs/common/wince.conf index d017cae..d6e4ba7 100644 --- a/mkspecs/common/wince.conf +++ b/mkspecs/common/wince.conf @@ -19,7 +19,8 @@ QMAKE_YACCFLAGS = -d QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t- QMAKE_CFLAGS_WARN_ON = -W3 QMAKE_CFLAGS_WARN_OFF = -W0 -QMAKE_CFLAGS_RELEASE = -O2 -GL -MD +QMAKE_CFLAGS_RELEASE = -O2 -MD +QMAKE_CFLAGS_LTCG = -GL QMAKE_CFLAGS_DEBUG = -DDEBUG -D_DEBUG -Zi -MDd QMAKE_CFLAGS_YACC = @@ -34,6 +35,7 @@ QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON -w34100 -w34189 QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG +QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC QMAKE_CXXFLAGS_STL_ON = -EHsc QMAKE_CXXFLAGS_STL_OFF = @@ -55,8 +57,9 @@ QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ @<< QMAKE_LINK = link QMAKE_LFLAGS = /NOLOGO /NODEFAULTLIB:OLDNAMES.LIB -QMAKE_LFLAGS_RELEASE = /LTCG /INCREMENTAL:NO +QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO QMAKE_LFLAGS_DEBUG = /DEBUG +QMAKE_LFLAGS_LTCG = /LTCG QMAKE_LIBS_NETWORK = ws2.lib QMAKE_LIBS_OPENGL = QMAKE_LIBS_COMPAT = diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 91344c8..a6b06a6 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1326,6 +1326,7 @@ void Configure::applySpecSpecifics() dictionary[ "WEBKIT" ] = "no"; dictionary[ "PHONON" ] = "yes"; dictionary[ "DIRECTSHOW" ] = "no"; + dictionary[ "LTCG" ] = "yes"; // We only apply MMX/IWMMXT for mkspecs we know they work if (dictionary[ "XQMAKESPEC" ].startsWith("wincewm")) { dictionary[ "MMX" ] = "yes"; -- cgit v0.12 From 349dd6ef5cbba0c45d8089a3cf65f587c2662c4d Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Thu, 28 May 2009 13:59:31 +0300 Subject: Fixed Qt/Symbian compilation with -stl configure option. The STL enabled config does not have implicit include for e32base.h. --- src/plugins/s60/src/qdesktopservices_3_2.cpp | 4 +++- src/plugins/s60/src/qlocale_3_2.cpp | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/s60/src/qdesktopservices_3_2.cpp b/src/plugins/s60/src/qdesktopservices_3_2.cpp index e563c14..679b370 100644 --- a/src/plugins/s60/src/qdesktopservices_3_2.cpp +++ b/src/plugins/s60/src/qdesktopservices_3_2.cpp @@ -10,10 +10,12 @@ ****************************************************************************/ #include -#include // CDirectoryLocalizer #include #include +#include // CBase -> Required by cdirectorylocalizer.h +#include // CDirectoryLocalizer + EXPORT_C QString localizedDirectoryName(QString& rawPath) { QString ret; diff --git a/src/plugins/s60/src/qlocale_3_2.cpp b/src/plugins/s60/src/qlocale_3_2.cpp index 027eefc..fe1d642 100644 --- a/src/plugins/s60/src/qlocale_3_2.cpp +++ b/src/plugins/s60/src/qlocale_3_2.cpp @@ -10,6 +10,7 @@ ****************************************************************************/ #include +#include EXPORT_C TPtrC defaultGetLongDateFormatSpec(TExtendedLocale& locale) { -- cgit v0.12 From f4d9a9458451ad4b3bd63bfafa34a57e3ba91c4a Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Thu, 28 May 2009 14:03:24 +0300 Subject: Enabled STL support by default in configure.exe for Symbian. This change should be quite safe, since all Qt <-> STL type conversions are implemented in inline methods. The only major difference is that new operator is now used from STL instead of one from e32base.h Of course, this change also requires that you have STLport installed to your SDK. This should be the case if you have installed the latest Open C/C++ plug-in from forum nokia. --- configure.exe | Bin 535040 -> 1183744 bytes tools/configure/configureapp.cpp | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.exe b/configure.exe index 30383d8..b3e68c2 100755 Binary files a/configure.exe and b/configure.exe differ diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index a879e5d..40caff0 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1405,7 +1405,7 @@ void Configure::applySpecSpecifics() dictionary[ "QT3SUPPORT" ] = "no"; dictionary[ "OPENGL" ] = "no"; dictionary[ "OPENSSL" ] = "no"; - dictionary[ "STL" ] = "no"; + dictionary[ "STL" ] = "yes"; dictionary[ "EXCEPTIONS" ] = "no"; dictionary[ "RTTI" ] = "no"; dictionary[ "ARCHITECTURE" ] = "symbian"; -- cgit v0.12 From 131d8f90aa2991866884a896fdebcc05a020a905 Mon Sep 17 00:00:00 2001 From: axis Date: Thu, 28 May 2009 13:24:10 +0200 Subject: Recompiled configure.exe with MSVC6. --- configure.exe | Bin 1183744 -> 868352 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/configure.exe b/configure.exe index b3e68c2..65db048 100755 Binary files a/configure.exe and b/configure.exe differ -- cgit v0.12 From 1ee484031d2a240bd7019753e83bb473ea9891de Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Thu, 28 May 2009 13:49:08 +0200 Subject: Enabled QtS60Style background filling also for _simulated, by moving some code to qs60style.cpp. De-duplicated some code in qt_s60_fill_background. The unused QT_S60STYLE_LAYOUTDATA_SIMULATED had to go, too. --- src/gui/kernel/qwidget.cpp | 23 +++++++------- src/gui/styles/qs60style.cpp | 55 ++++++++++++++++++++++++---------- src/gui/styles/qs60style_p.h | 2 -- src/gui/styles/qs60style_simulated.cpp | 23 +++++--------- src/gui/styles/qs60style_symbian.cpp | 52 +++----------------------------- src/gui/styles/styles.pri | 1 - 6 files changed, 65 insertions(+), 91 deletions(-) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index dae4179..4fcedb4 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -2046,17 +2046,20 @@ static inline void fillRegion(QPainter *painter, const QRegion &rgn, const QPoin // Defined in qmacstyle_mac.cpp extern void qt_mac_fill_background(QPainter *painter, const QRegion &rgn, const QPoint &offset, const QBrush &brush); qt_mac_fill_background(painter, rgn, offset, brush); -#elif defined(Q_WS_S60) - // Defined in qs60style_symbian.cpp - extern void qt_s60_fill_background(QPainter *painter, const QRegion &rgn, - const QPoint &offset, const QBrush &brush); - qt_s60_fill_background(painter, rgn, offset, brush); #else - const QRegion translated = rgn.translated(offset); - const QRect rect(translated.boundingRect()); - painter->setClipRegion(translated); - painter->drawTiledPixmap(rect, brush.texture(), rect.topLeft()); -#endif +#if !defined(QT_NO_STYLE_S60) + // Defined in qs60style.cpp + extern bool qt_s60_fill_background(QPainter *painter, const QRegion &rgn, + const QPoint &offset, const QBrush &brush); + if (!qt_s60_fill_background(painter, rgn, offset, brush)) +#endif // !defined(QT_NO_STYLE_S60) + { + const QRegion translated = rgn.translated(offset); + const QRect rect(translated.boundingRect()); + painter->setClipRegion(translated); + painter->drawTiledPixmap(rect, brush.texture(), rect.topLeft()); + } +#endif // Q_WS_MAC } else { const QVector &rects = rgn.rects(); for (int i = 0; i < rects.size(); ++i) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 5f7c083..b066967 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -57,7 +57,6 @@ const QS60StylePrivate::SkinElementFlags QS60StylePrivate::KDefaultSkinElementFl static const QByteArray propertyKeyLayouts = "layouts"; static const QByteArray propertyKeyCurrentlayout = "currentlayout"; -#if defined(QT_S60STYLE_LAYOUTDATA_SIMULATED) const layoutHeader QS60StylePrivate::m_layoutHeaders[] = { // *** generated layout data *** {240,320,1,14,true,QLatin1String("QVGA Landscape Mirrored")}, @@ -93,7 +92,6 @@ const short QS60StylePrivate::data[][MAX_PIXELMETRICS] = { }; const short *QS60StylePrivate::m_pmPointer = QS60StylePrivate::data[0]; -#endif // defined(QT_S60STYLE_LAYOUTDATA_SIMULATED) // theme background texture QPixmap *QS60StylePrivate::m_background = 0; @@ -119,6 +117,11 @@ static const int frameElementsCount = const int KNotFound = -1; +QS60StylePrivate::~QS60StylePrivate() +{ + deleteBackground(); +} + void QS60StylePrivate::drawSkinElement(SkinElements element, QPainter *painter, const QRect &rect, SkinElementFlags flags) { @@ -252,10 +255,18 @@ void QS60StylePrivate::drawSkinPart(QS60StyleEnums::SkinParts part, drawPart(part, painter, rect, flags); } +short QS60StylePrivate::pixelMetric(int metric) +{ + Q_ASSERT(metric < MAX_PIXELMETRICS); + const short returnValue = m_pmPointer[metric]; + if (returnValue==-909) + return -1; + return returnValue; +} + void QS60StylePrivate::setStyleProperty(const char *name, const QVariant &value) { if (name == propertyKeyCurrentlayout) { -#if !defined(QT_WS_S60) || defined(QT_S60STYLE_LAYOUTDATA_SIMULATED) static const QStringList layouts = styleProperty(propertyKeyLayouts).toStringList(); const QString layout = value.toString(); Q_ASSERT(layouts.contains(layout)); @@ -265,24 +276,17 @@ void QS60StylePrivate::setStyleProperty(const char *name, const QVariant &value) clearCaches(); refreshUI(); return; -#else - qFatal("Cannot set static layout. Dynamic layouts are used!"); -#endif } } QVariant QS60StylePrivate::styleProperty(const char *name) const { if (name == propertyKeyLayouts) { -#if !defined(QT_WS_S60) || defined(QT_S60STYLE_LAYOUTDATA_SIMULATED) static QStringList layouts; if (layouts.isEmpty()) for (int i = 0; i < QS60StylePrivate::m_numberOfLayouts; i++) layouts.append(QS60StylePrivate::m_layoutHeaders[i].layoutName); return layouts; -#else - qFatal("Cannot return list of 'canned' static layouts. Dynamic layouts are used!"); -#endif } return QVariant(); } @@ -575,13 +579,10 @@ int QS60StylePrivate::focusRectPenWidth() return pixelMetric(QS60Style::PM_DefaultFrameWidth); } -#if !defined(QT_WS_S60) || defined(QT_S60STYLE_LAYOUTDATA_SIMULATED) void QS60StylePrivate::setCurrentLayout(int index) { m_pmPointer = data[index]; } -#endif - void QS60StylePrivate::drawPart(QS60StyleEnums::SkinParts skinPart, QPainter *painter, const QRect &rect, SkinElementFlags flags) @@ -2185,7 +2186,6 @@ int QS60Style::pixelMetric(PixelMetric metric, const QStyleOption *option, const metricValue = QCommonStyle::pixelMetric(metric, option, widget); if (metric == PM_SubMenuOverlap && widget){ - const int widgetWidth = widget->width(); const QMenu *menu = qobject_cast(widget); if (menu && menu->activeAction() && menu->activeAction()->menu()) { const int menuWidth = menu->activeAction()->menu()->sizeHint().width(); @@ -2415,11 +2415,12 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple ret = QCommonStyle::subControlRect(control, option, scontrol, widget); switch (scontrol) { case SC_GroupBoxCheckBox: //fallthrough - case SC_GroupBoxLabel: + case SC_GroupBoxLabel: { //slightly indent text and boxes, so that dialog border does not mess with them. const int horizontalSpacing = QS60StylePrivate::pixelMetric(QStyle::PM_LayoutHorizontalSpacing); ret.adjust(2,horizontalSpacing-3,0,0); + } break; case SC_GroupBoxFrame: { const QRect textBox = subControlRect(control, option, SC_GroupBoxLabel, widget); @@ -2685,6 +2686,7 @@ void QS60Style::polish(QApplication *application) void QS60Style::unpolish(QApplication *application) { + Q_UNUSED(application) QPalette newPalette = qApp->style()->standardPalette(); application->setPalette(newPalette); QApplicationPrivate::setSystemPalette(originalPalette); @@ -2787,6 +2789,29 @@ QIcon QS60Style::standardIconImplementation(StandardPixmap standardIcon, QCommonStyle::standardIconImplementation(standardIcon, option, widget) : QIcon(cachedPixMap); } +extern QPoint qt_s60_fill_background_offset(const QWidget *targetWidget); + +bool qt_s60_fill_background(QPainter *painter, const QRegion &rgn, const QPoint &offset, + const QBrush &brush) +{ + const QPixmap backgroundTexture(QS60StylePrivate::backgroundTexture()); + if (backgroundTexture.cacheKey() != brush.texture().cacheKey()) + return false; + + const QPaintDevice *target = painter->device(); + if (target->devType() == QInternal::Widget) { + const QWidget *widget = static_cast(target); + const QRegion translated = rgn.translated(offset); + const QVector &rects = translated.rects(); + for (int i = 0; i < rects.size(); ++i) { + const QRect rect(rects.at(i)); + painter->drawPixmap(rect.topLeft(), backgroundTexture, + rect.translated(qt_s60_fill_background_offset(widget))); + } + } + return true; +} + QT_END_NAMESPACE #endif // QT_NO_STYLE_S60 || QT_PLUGIN diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index bedff58..22b01f6 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -388,7 +388,6 @@ public: static int focusRectPenWidth(); -#if defined(QT_S60STYLE_LAYOUTDATA_SIMULATED) static const layoutHeader m_layoutHeaders[]; static const short data[][MAX_PIXELMETRICS]; @@ -398,7 +397,6 @@ public: static short const *m_pmPointer; // number of layouts supported by the style static const int m_numberOfLayouts; -#endif // defined(QT_S60STYLE_LAYOUTDATA_SIMULATED) mutable QHash, QFont> m_mappedFontsCache; mutable QHash m_colorCache; diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index 3edc874..b6ad0ac 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -42,19 +42,6 @@ QS60StylePrivate::QS60StylePrivate() setCurrentLayout(0); } -QS60StylePrivate::~QS60StylePrivate() -{ -} - -short QS60StylePrivate::pixelMetric(int metric) -{ - Q_ASSERT(metric < MAX_PIXELMETRICS); - const short returnValue = m_pmPointer[metric]; - if (returnValue==-909) - return -1; - return returnValue; -} - QColor QS60StylePrivate::s60Color(QS60StyleEnums::ColorLists list, int index, const QStyleOption *option) { @@ -194,7 +181,7 @@ QVariant QS60StylePrivate::styleProperty_specific(const char *name) const QPixmap QS60StylePrivate::backgroundTexture() { if (!m_background) { - const QSize size = QApplication::activeWindow()?QApplication::activeWindow()->size():QSize(100, 100); + const QSize size = QApplication::desktop()->screen()->size(); QPixmap background = part(QS60StyleEnums::SP_QsnBgScreen, size); m_background = new QPixmap(background); } @@ -216,7 +203,6 @@ bool QS60StylePrivate::isToolBarBackground() return true; } - QFont QS60StylePrivate::s60Font_specific(QS60StyleEnums::FontCategories fontCategory, int pointSize) { QFont result; @@ -281,6 +267,13 @@ void QS60Style::setS60Theme(const QHash &parts, QS60StyleModeSpecifics::m_partPictures = parts; QS60StyleModeSpecifics::m_colors = colors; d->clearCaches(QS60StylePrivate::CC_ThemeChange); + d->setBackgroundTexture(qApp); +} + +QPoint qt_s60_fill_background_offset(const QWidget *targetWidget) +{ + Q_UNUSED(targetWidget) + return QPoint(); } QT_END_NAMESPACE diff --git a/src/gui/styles/qs60style_symbian.cpp b/src/gui/styles/qs60style_symbian.cpp index f860842..ddee4ba 100644 --- a/src/gui/styles/qs60style_symbian.cpp +++ b/src/gui/styles/qs60style_symbian.cpp @@ -593,30 +593,11 @@ bool QS60StylePrivate::isToolBarBackground() return (QSysInfo::s60Version() == QSysInfo::SV_S60_3_1 || QSysInfo::s60Version() == QSysInfo::SV_S60_3_2); } -void qt_s60_fill_background(QPainter *painter, const QRegion &rgn, const QPoint &offset, - const QBrush &brush) +QPoint qt_s60_fill_background_offset(const QWidget *targetWidget) { - const QPixmap backgroundTexture(QS60StylePrivate::backgroundTexture()); - if (backgroundTexture.cacheKey() == brush.texture().cacheKey()) { - const QPaintDevice *target = painter->device(); - if (target->devType() == QInternal::Widget) { - const QWidget *widget = static_cast(target); - CCoeControl *control = widget->effectiveWinId(); - TPoint globalPos = control ? control->PositionRelativeToScreen() : TPoint(0,0); - const QRegion translated = rgn.translated(offset); - const QVector &rects = translated.rects(); - for (int i = 0; i < rects.size(); ++i) { - const QRect rect(rects.at(i)); - painter->drawPixmap(rect.topLeft(), backgroundTexture, - rect.translated(globalPos.iX, globalPos.iY)); - } - } - } else { - const QRegion translated = rgn.translated(offset); - const QRect rect(translated.boundingRect()); - painter->setClipRegion(translated); - painter->drawTiledPixmap(rect, brush.texture(), rect.topLeft()); - } + CCoeControl *control = targetWidget->effectiveWinId(); + TPoint globalPos = control ? control->PositionRelativeToScreen() : TPoint(0,0); + return QPoint(globalPos.iX, globalPos.iY); } QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL( @@ -939,7 +920,6 @@ QFont QS60StylePrivate::s60Font_specific( return result; } -#ifdef QT_S60STYLE_LAYOUTDATA_SIMULATED void QS60StylePrivate::setActiveLayout() { const QSize activeScreenSize(screenSize()); @@ -979,19 +959,11 @@ void QS60StylePrivate::setActiveLayout() m_pmPointer = data[activeLayoutIndex]; } -#endif // QT_S60STYLE_LAYOUTDATA_SIMULATED QS60StylePrivate::QS60StylePrivate() { -#ifdef QT_S60STYLE_LAYOUTDATA_SIMULATED // No need to set active layout, if dynamic metrics API is available setActiveLayout(); -#endif // QT_S60STYLE_LAYOUTDATA_SIMULATED -} - -QS60StylePrivate::~QS60StylePrivate() -{ - deleteBackground(); } void QS60StylePrivate::setStyleProperty_specific(const char *name, const QVariant &value) @@ -1011,20 +983,6 @@ QVariant QS60StylePrivate::styleProperty_specific(const char *name) const return styleProperty(name); } -short QS60StylePrivate::pixelMetric(int metric) -{ -#ifdef QT_S60STYLE_LAYOUTDATA_SIMULATED - Q_ASSERT(metric < MAX_PIXELMETRICS); - const short returnValue = m_pmPointer[metric]; - if (returnValue==-909) - return -1; - return returnValue; -#else - //todo - call the pixelmetrics API directly - return 0; -#endif // QT_S60STYLE_LAYOUTDATA_SIMULATED -} - QColor QS60StylePrivate::s60Color(QS60StyleEnums::ColorLists list, int index, const QStyleOption *option) { @@ -1343,9 +1301,7 @@ void QS60Style::handleDynamicLayoutVariantSwitch() { Q_D(QS60Style); d->clearCaches(QS60StylePrivate::CC_LayoutChange); -#ifdef QT_S60STYLE_LAYOUTDATA_SIMULATED d->setActiveLayout(); -#endif // QT_S60STYLE_LAYOUTDATA_SIMULATED d->refreshUI(); d->setBackgroundTexture(qApp); foreach (QWidget *widget, QApplication::allWidgets()) diff --git a/src/gui/styles/styles.pri b/src/gui/styles/styles.pri index 9aa170e..b0e9f21 100644 --- a/src/gui/styles/styles.pri +++ b/src/gui/styles/styles.pri @@ -160,7 +160,6 @@ contains( styles, s60 ) { styles/qs60style.h \ styles/qs60style_p.h SOURCES += styles/qs60style.cpp - DEFINES += QT_S60STYLE_LAYOUTDATA_SIMULATED symbian { SOURCES += styles/qs60style_symbian.cpp # TODO: fix the following LIBS hack. Line 1 is for armv5, 2 for winscw -- cgit v0.12 From 8ed5931925b4e8ed8f098b5c36e1378f95d7d25a Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 28 May 2009 13:40:59 +0200 Subject: BT: Support saving forms with resources more than once in Qt Jambi When a form is loaded, Designer will set the path to the resource as an absolute path rather than the path actually stored in the file. There is code to work around this to make file paths relative when saving the file later on, but no work around for Qt Jambi. So when saving Qt Jambi forms, you would get an absolute path to the resource which contains the location of the resource file (.jar or on disk) This of course breaks the concept of resources, as the .jui file was no longer portable. The fix is to special case Qt Jambi resources and set the relative path when loading them. The patch has no effect on regular Designer. Task-number: 254621 Reviewed-by: Kai Koehne --- .../components/formeditor/qdesigner_resource.cpp | 34 ++++++++++++++-------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/tools/designer/src/components/formeditor/qdesigner_resource.cpp b/tools/designer/src/components/formeditor/qdesigner_resource.cpp index 75a53b7..064da9b 100644 --- a/tools/designer/src/components/formeditor/qdesigner_resource.cpp +++ b/tools/designer/src/components/formeditor/qdesigner_resource.cpp @@ -159,6 +159,7 @@ private: QDesignerFormEditorInterface *m_core; DesignerPixmapCache *m_pixmapCache; DesignerIconCache *m_iconCache; + const QDesignerLanguageExtension *m_lang; bool m_saveRelative; mutable QMap m_usedQrcFiles; mutable QMap m_loadedQrcFiles; @@ -168,13 +169,18 @@ QDesignerResourceBuilder::QDesignerResourceBuilder(QDesignerFormEditorInterface m_core(core), m_pixmapCache(pixmapCache), m_iconCache(iconCache), + m_lang(qt_extension(core->extensionManager(), core)), m_saveRelative(true) { } -static inline void setIconPixmap(QIcon::Mode m, QIcon::State s, const QDir &workingDirectory, const QString &v, PropertySheetIconValue &icon) +static inline void setIconPixmap(QIcon::Mode m, QIcon::State s, const QDir &workingDirectory, + QString path, PropertySheetIconValue &icon, + const QDesignerLanguageExtension *lang = 0) { - icon.setPixmap(m, s, PropertySheetPixmapValue(QFileInfo(workingDirectory, v).absoluteFilePath())); + if (lang == 0 || !lang->isLanguageResource(path)) + path = QFileInfo(workingDirectory, path).absoluteFilePath(); + icon.setPixmap(m, s, PropertySheetPixmapValue(path)); } QVariant QDesignerResourceBuilder::loadResource(const QDir &workingDirectory, const DomProperty *property) const @@ -184,7 +190,11 @@ QVariant QDesignerResourceBuilder::loadResource(const QDir &workingDirectory, co PropertySheetPixmapValue pixmap; DomResourcePixmap *dp = property->elementPixmap(); if (!dp->text().isEmpty()) { - pixmap.setPath(QFileInfo(workingDirectory, dp->text()).absoluteFilePath()); + if (m_lang != 0 && m_lang->isLanguageResource(dp->text())) { + pixmap.setPath(dp->text()); + } else { + pixmap.setPath(QFileInfo(workingDirectory, dp->text()).absoluteFilePath()); + } #ifdef OLD_RESOURCE_FORMAT if (dp->hasAttributeResource()) m_loadedQrcFiles.insert(QFileInfo(workingDirectory, dp->attributeResource()).absoluteFilePath(), false); @@ -198,24 +208,24 @@ QVariant QDesignerResourceBuilder::loadResource(const QDir &workingDirectory, co DomResourceIcon *di = property->elementIconSet(); if (const int flags = iconStateFlags(di)) { // new, post 4.4 format if (flags & NormalOff) - setIconPixmap(QIcon::Normal, QIcon::Off, workingDirectory, di->elementNormalOff()->text(), icon); + setIconPixmap(QIcon::Normal, QIcon::Off, workingDirectory, di->elementNormalOff()->text(), icon, m_lang); if (flags & NormalOn) - setIconPixmap(QIcon::Normal, QIcon::On, workingDirectory, di->elementNormalOn()->text(), icon); + setIconPixmap(QIcon::Normal, QIcon::On, workingDirectory, di->elementNormalOn()->text(), icon, m_lang); if (flags & DisabledOff) - setIconPixmap(QIcon::Disabled, QIcon::Off, workingDirectory, di->elementDisabledOff()->text(), icon); + setIconPixmap(QIcon::Disabled, QIcon::Off, workingDirectory, di->elementDisabledOff()->text(), icon, m_lang); if (flags & DisabledOn) - setIconPixmap(QIcon::Disabled, QIcon::On, workingDirectory, di->elementDisabledOn()->text(), icon); + setIconPixmap(QIcon::Disabled, QIcon::On, workingDirectory, di->elementDisabledOn()->text(), icon, m_lang); if (flags & ActiveOff) - setIconPixmap(QIcon::Active, QIcon::Off, workingDirectory, di->elementActiveOff()->text(), icon); + setIconPixmap(QIcon::Active, QIcon::Off, workingDirectory, di->elementActiveOff()->text(), icon, m_lang); if (flags & ActiveOn) - setIconPixmap(QIcon::Active, QIcon::On, workingDirectory, di->elementActiveOn()->text(), icon); + setIconPixmap(QIcon::Active, QIcon::On, workingDirectory, di->elementActiveOn()->text(), icon, m_lang); if (flags & SelectedOff) - setIconPixmap(QIcon::Selected, QIcon::Off, workingDirectory, di->elementSelectedOff()->text(), icon); + setIconPixmap(QIcon::Selected, QIcon::Off, workingDirectory, di->elementSelectedOff()->text(), icon, m_lang); if (flags & SelectedOn) - setIconPixmap(QIcon::Selected, QIcon::On, workingDirectory, di->elementSelectedOn()->text(), icon); + setIconPixmap(QIcon::Selected, QIcon::On, workingDirectory, di->elementSelectedOn()->text(), icon, m_lang); } else { #ifdef OLD_RESOURCE_FORMAT - setIconPixmap(QIcon::Normal, QIcon::Off, workingDirectory, di->text(), icon); + setIconPixmap(QIcon::Normal, QIcon::Off, workingDirectory, di->text(), icon, m_lang); if (di->hasAttributeResource()) m_loadedQrcFiles.insert(QFileInfo(workingDirectory, di->attributeResource()).absoluteFilePath(), false); #endif -- cgit v0.12 From c1246f5b283754ed4f59770ba4690ea391e60483 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 28 May 2009 14:50:17 +0300 Subject: Fixed sis package names in S60 install docs. --- doc/src/installation.qdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/installation.qdoc b/doc/src/installation.qdoc index 91b7a25..3270dae 100644 --- a/doc/src/installation.qdoc +++ b/doc/src/installation.qdoc @@ -568,8 +568,8 @@ in the \l{Qt for Windows CE Requirements} document. We've included a subset of the Qt demos in this package for you to try out. An excellent starting point is the "fluidlauncher" demo. To run the demo on a real device, you first have to install - the Qt libraries and demos on the device. - Install \c{qt_libs_armv5_urel.sisx} and \c{fluidlauncher_armv5_urel.sisx} + the Qt libraries and the demo on the device. + Install \c{qt_libs.sis} and \c{fluidlauncher.sis} found at Qt installation folder to the device. To run the demos on the emulator, navigate to -- cgit v0.12 From 353afc392b843519023f27753b45b2e6fd9467ff Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Thu, 28 May 2009 13:11:29 +0200 Subject: Don't assume the tty was in K_XLATE when application started Instead, query the mode at startup, store it and restore it on exit. Reviewed-By: TrustMe Task-number: 254194 --- src/gui/embedded/qkbdtty_qws.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/embedded/qkbdtty_qws.cpp b/src/gui/embedded/qkbdtty_qws.cpp index b588e55..7c162bc 100644 --- a/src/gui/embedded/qkbdtty_qws.cpp +++ b/src/gui/embedded/qkbdtty_qws.cpp @@ -97,6 +97,7 @@ private slots: private: QWSPC101KeyboardHandler *handler; struct termios origTermData; + int originalKbdMode; }; QWSTtyKeyboardHandler::QWSTtyKeyboardHandler(const QString &device) @@ -156,6 +157,7 @@ QWSTtyKbPrivate::QWSTtyKbPrivate(QWSPC101KeyboardHandler *h, const QString &devi tcgetattr(kbdFD, &termdata); #if defined(Q_OS_LINUX) + ioctl(kbdFD, KDGKBMODE, &originalKbdMode); # ifdef QT_QWS_USE_KEYCODES ioctl(kbdFD, KDSKBMODE, K_MEDIUMRAW); # else @@ -202,7 +204,7 @@ QWSTtyKbPrivate::~QWSTtyKbPrivate() { if (kbdFD >= 0) { #if defined(Q_OS_LINUX) - ioctl(kbdFD, KDSKBMODE, K_XLATE); + ioctl(kbdFD, KDSKBMODE, originalKbdMode); #endif tcsetattr(kbdFD, TCSANOW, &origTermData); ::close(kbdFD); -- cgit v0.12 From 8e2d3cc2e84b6d8109c30a853ea40ff9cfa29bcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Thu, 28 May 2009 15:05:21 +0200 Subject: Minor cleanup. Reviewed-by: Kim --- tests/auto/qdatastream/tst_qdatastream.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/auto/qdatastream/tst_qdatastream.cpp b/tests/auto/qdatastream/tst_qdatastream.cpp index d7ca7bc..6a69fcc 100644 --- a/tests/auto/qdatastream/tst_qdatastream.cpp +++ b/tests/auto/qdatastream/tst_qdatastream.cpp @@ -462,7 +462,7 @@ void tst_QDataStream::writeQString(QDataStream* s) { QString test(QStringData(dataIndex(QTest::currentDataTag()))); *s << test; - *s << QString("Faen her spyr man"); + *s << QString("Her er det noe tekst"); *s << test; *s << QString(); *s << test; @@ -480,7 +480,7 @@ void tst_QDataStream::readQString(QDataStream *s) *s >> S; QCOMPARE(S, test); *s >> S; - QCOMPARE(S, QString("Faen her spyr man")); + QCOMPARE(S, QString("Her er det noe tekst")); *s >> S; QCOMPARE(S, test); *s >> S; @@ -533,7 +533,7 @@ void tst_QDataStream::writeQRegExp(QDataStream* s) { QRegExp test(QRegExpData(dataIndex(QTest::currentDataTag()))); *s << test; - *s << QString("Faen her spyr man"); + *s << QString("Her er det noe tekst"); *s << test; *s << QString("nonempty"); *s << test; @@ -550,7 +550,7 @@ void tst_QDataStream::readQRegExp(QDataStream *s) *s >> R; QCOMPARE(R, test); *s >> S; - QCOMPARE(S, QString("Faen her spyr man")); + QCOMPARE(S, QString("Her er det noe tekst")); *s >> R; QCOMPARE(R, test); *s >> S; -- cgit v0.12 From 408ca46193f70ff66d060f7b7c506a97fee945e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Thu, 28 May 2009 15:07:01 +0200 Subject: Fixed a problem with streaming QIcons containing multiple pixmaps. If pixmaps were added through QIcon::addFile() with different sizes than the sizes of the pixmaps themselves, streaming the icon in didn't work properly. Task-number: 254374 Reviewed-by: Kim --- src/gui/image/qicon.cpp | 9 ++++++--- tests/auto/qicon/tst_qicon.cpp | 43 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index a880a13..0799ea7 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -428,10 +428,13 @@ bool QPixmapIconEngine::read(QDataStream &in) in >> sz; in >> mode; in >> state; - if (pm.isNull()) + if (pm.isNull()) { addFile(fileName, sz, QIcon::Mode(mode), QIcon::State(state)); - else - addPixmap(pm, QIcon::Mode(mode), QIcon::State(state)); + } else { + QPixmapIconEngineEntry pe(fileName, sz, QIcon::Mode(mode), QIcon::State(state)); + pe.pixmap = pm; + pixmaps += pe; + } } return true; } diff --git a/tests/auto/qicon/tst_qicon.cpp b/tests/auto/qicon/tst_qicon.cpp index 4e9a880..1dd223f 100644 --- a/tests/auto/qicon/tst_qicon.cpp +++ b/tests/auto/qicon/tst_qicon.cpp @@ -72,6 +72,8 @@ private slots: void svg(); void addFile(); void availableSizes(); + void streamAvailableSizes_data(); + void streamAvailableSizes(); void task184901_badCache(); void task223279_inconsistentAddFile(); @@ -540,6 +542,47 @@ void tst_QIcon::availableSizes() } } +void tst_QIcon::streamAvailableSizes_data() +{ + QTest::addColumn("icon"); + + QIcon icon; + icon.addFile(":/image.png", QSize(32,32)); + QTest::newRow( "32x32" ) << icon; + icon.addFile(":/image.png", QSize(64,64)); + QTest::newRow( "64x64" ) << icon; + icon.addFile(":/image.png", QSize(128,128)); + QTest::newRow( "128x128" ) << icon; + icon.addFile(":/image.png", QSize(256,256)); + QTest::newRow( "256x256" ) << icon; +} + +void tst_QIcon::streamAvailableSizes() +{ + QFETCH(QIcon, icon); + + QByteArray ba; + // write to QByteArray + { + QBuffer buffer(&ba); + buffer.open(QIODevice::WriteOnly); + QDataStream stream(&buffer); + stream << icon; + } + + // read from QByteArray + { + QBuffer buffer(&ba); + buffer.open(QIODevice::ReadOnly); + QDataStream stream(&buffer); + QIcon i; + stream >> i; + QCOMPARE(i.isNull(), icon.isNull()); + QCOMPARE(i.availableSizes(), icon.availableSizes()); + } +} + + static inline bool operator<(const QSize &lhs, const QSize &rhs) { if (lhs.width() < rhs.width()) -- cgit v0.12 From 713833c831fb667fcb6fa4b1aad0dc452d70122f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Thu, 28 May 2009 16:53:48 +0300 Subject: S60Style: Adding missing break for clearCaches. --- src/gui/styles/qs60style.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index b066967..b0ba30b 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -368,6 +368,7 @@ void QS60StylePrivate::clearCaches(QS60StylePrivate::CacheClearReason reason) m_colorCache.clear(); QPixmapCache::clear(); deleteBackground(); + break; case CC_UndefinedChange: default: m_colorCache.clear(); -- cgit v0.12 From 1e96103c5bbd875d9e8607a322409b3abbfb136b Mon Sep 17 00:00:00 2001 From: axis Date: Thu, 28 May 2009 15:55:45 +0200 Subject: Fixed input methods support on all spinbox types. --- src/gui/widgets/qabstractspinbox.cpp | 13 ++++++++++++- src/gui/widgets/qabstractspinbox.h | 2 ++ src/gui/widgets/qdatetimeedit.cpp | 1 + src/gui/widgets/qspinbox.cpp | 9 +++++++++ 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/gui/widgets/qabstractspinbox.cpp b/src/gui/widgets/qabstractspinbox.cpp index 347f89a..2bf1cda 100644 --- a/src/gui/widgets/qabstractspinbox.cpp +++ b/src/gui/widgets/qabstractspinbox.cpp @@ -659,7 +659,6 @@ void QAbstractSpinBox::setLineEdit(QLineEdit *lineEdit) d->edit->setParent(this); d->edit->setFrame(false); - d->edit->setAttribute(Qt::WA_InputMethodEnabled, false); d->edit->setFocusProxy(this); d->edit->setAcceptDrops(false); @@ -690,6 +689,18 @@ void QAbstractSpinBox::interpretText() d->interpret(EmitIfChanged); } +/* + Reimplemented in 4.6, so be careful. + */ +/*! + \reimp +*/ +QVariant QAbstractSpinBox::inputMethodQuery(Qt::InputMethodQuery query) const +{ + Q_D(const QAbstractSpinBox); + return d->edit->inputMethodQuery(query); +} + /*! \reimp */ diff --git a/src/gui/widgets/qabstractspinbox.h b/src/gui/widgets/qabstractspinbox.h index 4e7fc3f..aa8905f 100644 --- a/src/gui/widgets/qabstractspinbox.h +++ b/src/gui/widgets/qabstractspinbox.h @@ -122,6 +122,8 @@ public: void interpretText(); bool event(QEvent *event); + QVariant inputMethodQuery(Qt::InputMethodQuery) const; + virtual QValidator::State validate(QString &input, int &pos) const; virtual void fixup(QString &input) const; diff --git a/src/gui/widgets/qdatetimeedit.cpp b/src/gui/widgets/qdatetimeedit.cpp index 83bec68..4d34691 100644 --- a/src/gui/widgets/qdatetimeedit.cpp +++ b/src/gui/widgets/qdatetimeedit.cpp @@ -2390,6 +2390,7 @@ void QDateTimeEditPrivate::init(const QVariant &var) q->setCalendarPopup(true); #endif updateTimeSpec(); + q->setInputMethodHints(Qt::ImhPreferNumbers); setLayoutItemMargins(QStyle::SE_DateTimeEditLayoutItem); } diff --git a/src/gui/widgets/qspinbox.cpp b/src/gui/widgets/qspinbox.cpp index c691eaf..295bf48 100644 --- a/src/gui/widgets/qspinbox.cpp +++ b/src/gui/widgets/qspinbox.cpp @@ -77,6 +77,8 @@ public: QChar thousand; inline void init() { + Q_Q(QSpinBox); + q->setInputMethodHints(Qt::ImhDigitsOnly); setLayoutItemMargins(QStyle::SE_SpinBoxLayoutItem); } }; @@ -97,6 +99,11 @@ public: // variables int decimals; QChar delimiter, thousand; + + inline void init() { + Q_Q(QDoubleSpinBox); + q->setInputMethodHints(Qt::ImhFormattedNumbersOnly); + } }; @@ -592,6 +599,8 @@ void QSpinBox::fixup(QString &input) const QDoubleSpinBox::QDoubleSpinBox(QWidget *parent) : QAbstractSpinBox(*new QDoubleSpinBoxPrivate(parent), parent) { + Q_D(QDoubleSpinBox); + d->init(); } /*! -- cgit v0.12 From cf6e5bd61cf0fc9fe4f70f87ad6d1dd59d456d97 Mon Sep 17 00:00:00 2001 From: axis Date: Thu, 28 May 2009 16:31:28 +0200 Subject: Cleaned up the inputMethodHints enum a bit. Made a clear distinction between Exclusive flags and other flags. --- doc/src/qnamespace.qdoc | 2 ++ src/corelib/global/qnamespace.h | 23 +++++++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/doc/src/qnamespace.qdoc b/doc/src/qnamespace.qdoc index 84b3a01..fc0598f 100644 --- a/doc/src/qnamespace.qdoc +++ b/doc/src/qnamespace.qdoc @@ -2412,6 +2412,8 @@ \value ImhNoPredictiveText Do not use predictive text (i.e. dictionary lookup) while typing. \value ImhDialableCharactersOnly Only characters suitable for phone dialling are allowed. + \value ImhExclusiveInputMask A mask to test for the presence of any flags ending with \c Only. + \note If several flags ending with \c Only are ORed together, the resulting character set will consist of the union of the specified sets. For instance specifying \c ImhNumbersOnly and \c ImhUppercaseOnly would yield a set consisting of numbers and uppercase letters. diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index e0ca27c..75524a0 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1401,16 +1401,19 @@ public: enum InputMethodHint { ImhNone = 0x0, ImhHiddenText = 0x1, - ImhDigitsOnly = 0x2, - ImhFormattedNumbersOnly = 0x4, - ImhUppercaseOnly = 0x8, - ImhLowercaseOnly = 0x10, - ImhNoAutoUppercase = 0x20, - ImhPreferNumbers = 0x40, - ImhPreferUppercase = 0x80, - ImhPreferLowercase = 0x100, - ImhNoPredictiveText = 0x200, - ImhDialableCharactersOnly = 0x400 + ImhNoAutoUppercase = 0x2, + ImhPreferNumbers = 0x4, + ImhPreferUppercase = 0x8, + ImhPreferLowercase = 0x10, + ImhNoPredictiveText = 0x20, + + ImhDigitsOnly = 0x10000, + ImhFormattedNumbersOnly = 0x20000, + ImhUppercaseOnly = 0x40000, + ImhLowercaseOnly = 0x80000, + ImhDialableCharactersOnly = 0x100000, + + ImhExclusiveInputMask = 0xffff0000 }; Q_DECLARE_FLAGS(InputMethodHints, InputMethodHint) -- cgit v0.12 From 09ae2f274b417bab4abee8900c5ad0a8f01d65b1 Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Thu, 28 May 2009 16:39:48 +0200 Subject: Scroll the dirty region with WA_PaintOnScreen When QWidget::scroll() is called on a widget with WA_PaintOnScreen, scroll the dirty region. Task-number: 254742 Reviewed-by: bnilsen --- src/gui/kernel/qwidget_x11.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp index 6202b35..e00c37c 100644 --- a/src/gui/kernel/qwidget_x11.cpp +++ b/src/gui/kernel/qwidget_x11.cpp @@ -2487,6 +2487,8 @@ void QWidgetPrivate::scroll_sys(int dx, int dy, const QRect &r) QRect sr = valid_rect ? r : clipRect(); if (just_update) q->update(); + else if (!valid_rect) + dirty.translate(dx, dy); int x1, y1, x2, y2, w = sr.width(), h = sr.height(); if (dx > 0) { -- cgit v0.12 From 89029a54cb3adfb54736a6aafaea9ec535407592 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 28 May 2009 14:57:20 +0200 Subject: cosmetic changes to examples/dialogs/sipdialog main function has a return value now. On the HTC this example didn't work, because this stupid thing sends two resize events, if the SIP is opened (and only one if it is closed). Reviewed-by: mauricek --- examples/dialogs/sipdialog/dialog.cpp | 13 ++++++------- examples/dialogs/sipdialog/main.cpp | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/examples/dialogs/sipdialog/dialog.cpp b/examples/dialogs/sipdialog/dialog.cpp index 9f1b9ad..653b518 100644 --- a/examples/dialogs/sipdialog/dialog.cpp +++ b/examples/dialogs/sipdialog/dialog.cpp @@ -90,7 +90,7 @@ Dialog::Dialog() //! [Dialog constructor part4] //! [Dialog constructor part5] - connect(button, SIGNAL(pressed()), + connect(button, SIGNAL(clicked()), qApp, SLOT(closeAllWindows())); connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), this, SLOT(desktopResized(int))); @@ -111,14 +111,13 @@ void Dialog::reactToSIP() { QRect availableGeometry = QApplication::desktop()->availableGeometry(0); - if (desktopGeometry.width() == availableGeometry.width()) { - if (desktopGeometry.height() > availableGeometry.height()) { + if (desktopGeometry != availableGeometry) { + if (windowState() | Qt::WindowMaximized) setWindowState(windowState() & ~Qt::WindowMaximized); - setGeometry(availableGeometry); - } else { - setWindowState(windowState() | Qt::WindowMaximized); - } + + setGeometry(availableGeometry); } + desktopGeometry = availableGeometry; } //! [reactToSIP() function] diff --git a/examples/dialogs/sipdialog/main.cpp b/examples/dialogs/sipdialog/main.cpp index 5fcbfd8..fec6de2 100644 --- a/examples/dialogs/sipdialog/main.cpp +++ b/examples/dialogs/sipdialog/main.cpp @@ -48,6 +48,6 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Dialog dialog; - dialog.exec(); + return dialog.exec(); } //! [main() function] -- cgit v0.12 From 8e4300e2866fd28881853509df6ff054e13f841b Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Thu, 28 May 2009 14:46:39 +0200 Subject: Fix wrong sorting when using the QFileSystemModel with QTreeView An optimization was made to the sorting of QFileDialog to sort only the current root (meaning what the user see). This avoided slowness when the model was big with lots of leafs. The problem here is for the treeview, the root is always the same, we expands only nodes. In that case, a recursive sorting is needed to ensure that all expanded nodes are correctly sorted (and filtered). This will be slower that's why i use an hidden flag in the d pointer to deactivate the recursive sort for the QFileDialog. Task-number:254701 Reviewed-by:olivier BT:yes --- src/gui/dialogs/qfiledialog.cpp | 1 + src/gui/dialogs/qfilesystemmodel.cpp | 11 ++++ src/gui/dialogs/qfilesystemmodel_p.h | 7 ++- .../auto/qfilesystemmodel/tst_qfilesystemmodel.cpp | 65 +++++++++++++++++++++- 4 files changed, 80 insertions(+), 4 deletions(-) diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index d42775a..d4d0136 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -2108,6 +2108,7 @@ void QFileDialogPrivate::createWidgets() #else model->setNameFilterDisables(false); #endif + model->d_func()->disableRecursiveSort = true; QFileDialog::connect(model, SIGNAL(fileRenamed(const QString &, const QString &, const QString &)), q, SLOT(_q_fileRenamed(const QString &, const QString &, const QString &))); QFileDialog::connect(model, SIGNAL(rootPathChanged(const QString &)), q, SLOT(_q_pathChanged(const QString &))); diff --git a/src/gui/dialogs/qfilesystemmodel.cpp b/src/gui/dialogs/qfilesystemmodel.cpp index 012d3a1..03017c3 100644 --- a/src/gui/dialogs/qfilesystemmodel.cpp +++ b/src/gui/dialogs/qfilesystemmodel.cpp @@ -1083,6 +1083,7 @@ private: */ void QFileSystemModelPrivate::sortChildren(int column, const QModelIndex &parent) { + Q_Q(QFileSystemModel); QFileSystemModelPrivate::QFileSystemNode *indexNode = node(parent); if (indexNode->children.count() == 0) return; @@ -1106,6 +1107,16 @@ void QFileSystemModelPrivate::sortChildren(int column, const QModelIndex &parent indexNode->visibleChildren.append(values.at(i).first->fileName); values.at(i).first->isVisible = true; } + + if (!disableRecursiveSort) { + for (int i = 0; i < q->rowCount(parent); ++i) { + const QModelIndex childIndex = q->index(i, 0, parent); + QFileSystemModelPrivate::QFileSystemNode *indexNode = node(childIndex); + //Only do a recursive sort on visible nodes + if (indexNode->isVisible) + sortChildren(column, childIndex); + } + } } /*! diff --git a/src/gui/dialogs/qfilesystemmodel_p.h b/src/gui/dialogs/qfilesystemmodel_p.h index 61e8b4c..af4fada 100644 --- a/src/gui/dialogs/qfilesystemmodel_p.h +++ b/src/gui/dialogs/qfilesystemmodel_p.h @@ -208,7 +208,8 @@ public: readOnly(true), setRootPath(false), filters(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::AllDirs), - nameFilterDisables(true) // false on windows, true on mac and unix + nameFilterDisables(true), // false on windows, true on mac and unix + disableRecursiveSort(false) { delayedSortTimer.setSingleShot(true); } @@ -294,6 +295,10 @@ public: QDir::Filters filters; QHash bypassFilters; bool nameFilterDisables; + //This flag is an optimization for the QFileDialog + //It enable a sort which is not recursive, it means + //we sort only what we see. + bool disableRecursiveSort; #ifndef QT_NO_REGEXP QList nameFilters; #endif diff --git a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp index 59d57ce..b109d4b 100644 --- a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp +++ b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp @@ -43,6 +43,7 @@ #include #include "../../../src/gui/dialogs/qfilesystemmodel_p.h" #include +#include #include "../../shared/util.h" #include #include @@ -102,6 +103,7 @@ private slots: void setData_data(); void setData(); + void sort_data(); void sort(); void mkdir(); @@ -452,8 +454,12 @@ void tst_QFileSystemModel::rowsInserted() } else { QCOMPARE(model->index(model->rowCount(root) - 1, 0, root).data().toString(), QString("b")); } - if (spy0.count() > 0) - if (count == 0) QCOMPARE(spy0.count(), 0); else QVERIFY(spy0.count() >= 1); + if (spy0.count() > 0) { + if (count == 0) + QCOMPARE(spy0.count(), 0); + else + QVERIFY(spy0.count() >= 1); + } if (count == 0) QCOMPARE(spy1.count(), 0); else QVERIFY(spy1.count() >= 1); QVERIFY(createFiles(tmp, QStringList(".hidden_file"), 5 + count)); @@ -722,6 +728,19 @@ void tst_QFileSystemModel::setData() QTRY_COMPARE(model->rowCount(root), files.count()); } +class MyFriendFileSystemModel : public QFileSystemModel +{ + friend class tst_QFileSystemModel; + Q_DECLARE_PRIVATE(QFileSystemModel) +}; + +void tst_QFileSystemModel::sort_data() +{ + QTest::addColumn("fileDialogMode"); + QTest::newRow("standard usage") << false; + QTest::newRow("QFileDialog usage") << true; +} + void tst_QFileSystemModel::sort() { QTemporaryFile file; @@ -733,8 +752,48 @@ void tst_QFileSystemModel::sort() model->sort(0, Qt::AscendingOrder); model->sort(0, Qt::DescendingOrder); QVERIFY(idx.column() != 0); -} + QFETCH(bool, fileDialogMode); + + MyFriendFileSystemModel *myModel = new MyFriendFileSystemModel(); + QTreeView *tree = new QTreeView(); + + if (fileDialogMode) + myModel->d_func()->disableRecursiveSort = true; + + const QString dirPath = QString("%1/sortTemp").arg(QDir::tempPath()); + QDir dir(dirPath); + dir.mkpath(dirPath); + QVERIFY(dir.exists()); + dir.mkdir("a"); + dir.mkdir("b"); + dir.mkdir("c"); + dir.mkdir("d"); + dir.mkdir("e"); + dir.mkdir("f"); + dir.mkdir("g"); + QTemporaryFile tempFile(dirPath + "/rXXXXXX"); + tempFile.open(); + myModel->setRootPath(QDir::rootPath()); + tree->setModel(myModel); + tree->show(); + QTest::qWait(500); + tree->expand(myModel->index(dir.absolutePath(), 0)); + while (dir.cdUp()) + { + tree->expand(myModel->index(dir.absolutePath(), 0)); + } + QTest::qWait(250); + //File dialog Mode means sub trees are not sorted, only the current root + if (fileDialogMode) + QVERIFY(myModel->index(0, 1, myModel->index(dirPath, 0)).data(QFileSystemModel::FilePathRole).toString() != dirPath + QLatin1String("/a")); + else + QCOMPARE(myModel->index(0, 1, myModel->index(dirPath, 0)).data(QFileSystemModel::FilePathRole).toString(), dirPath + QLatin1String("/a")); + + delete tree; + delete myModel; + +} void tst_QFileSystemModel::mkdir() { -- cgit v0.12 From 4a82680736ace8abb46e6fb5e085e8622f154b2d Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Thu, 28 May 2009 17:24:53 +0200 Subject: Fix a ASSERT/Crash when adding two times the same QAction to a QGW. We were adding two times in the QActionPrivate list the entry for the current QGraphicsWidget if the action was existing before. Task-number:KDE Reviewed-by:bnilsen BT:yes --- src/gui/graphicsview/qgraphicswidget.cpp | 6 ++++-- tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp index 7f02fb9..7781258 100644 --- a/src/gui/graphicsview/qgraphicswidget.cpp +++ b/src/gui/graphicsview/qgraphicswidget.cpp @@ -1887,8 +1887,10 @@ void QGraphicsWidget::insertAction(QAction *before, QAction *action) } d->actions.insert(pos, action); - QActionPrivate *apriv = action->d_func(); - apriv->graphicsWidgets.append(this); + if (index == -1) { + QActionPrivate *apriv = action->d_func(); + apriv->graphicsWidgets.append(this); + } QActionEvent e(QEvent::ActionAdded, action, before); QApplication::sendEvent(this, &e); diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp index b85abd3..1917357 100644 --- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp +++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp @@ -51,6 +51,7 @@ #include #include #include +#include #include "../../shared/util.h" @@ -147,6 +148,7 @@ private slots: void setSizes(); void closePopupOnOutsideClick(); void defaultSize(); + void shortcutsDeletion(); // Task fixes void task236127_bspTreeIndexFails(); @@ -1782,6 +1784,20 @@ void tst_QGraphicsWidget::defaultSize() } +void tst_QGraphicsWidget::shortcutsDeletion() +{ + QGraphicsWidget *widget = new QGraphicsWidget; + QGraphicsWidget *widget2 = new QGraphicsWidget; + widget->setMinimumSize(40, 40); + QWidgetAction *del = new QWidgetAction(widget); + del->setIcon(QIcon("edit-delete")); + del->setShortcut(Qt::Key_Delete); + del->setShortcutContext(Qt::WidgetShortcut); + widget2->addAction(del); + widget2->addAction(del); + delete widget; +} + class ProxyStyle : public QCommonStyle { public: -- cgit v0.12 From 36ae58e7a6a888d3ae7bd162d59daada550bbfb1 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Thu, 28 May 2009 10:51:32 -0700 Subject: Warn when trying to use an unsupported format Due to incompatibilities between RGB32 in DirectFB and Qt we can't use RGB32. Reviewed-by: Donald --- src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp index 98e32ed..9e35a66 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp @@ -958,9 +958,6 @@ bool QDirectFBScreen::connect(const QString &displaySpec) return false; } - if (displayArgs.contains(QLatin1String("debug"), Qt::CaseInsensitive)) - printDirectFBInfo(d_ptr->dfb, d_ptr->dfbSurface); - // Work out what format we're going to use for surfaces with an alpha channel d_ptr->alphaPixmapFormat = QDirectFBScreen::getImageFormat(d_ptr->dfbSurface); setPixelFormat(d_ptr->alphaPixmapFormat); @@ -971,12 +968,17 @@ bool QDirectFBScreen::connect(const QString &displaySpec) case QImage::Format_RGB444: d_ptr->alphaPixmapFormat = QImage::Format_ARGB4444_Premultiplied; break; + case QImage::Format_RGB32: + qWarning("QDirectFBScreen::connect(). Qt/DirectFB does not work with the RGB32 pixelformat. " + "We recommmend using ARGB instead"); + return false; + case QImage::Format_Indexed8: + qWarning("QDirectFBScreen::connect(). Qt/DirectFB does not work with the LUT8 pixelformat."); + return false; case QImage::NImageFormats: case QImage::Format_Invalid: case QImage::Format_Mono: case QImage::Format_MonoLSB: - case QImage::Format_Indexed8: - case QImage::Format_RGB32: case QImage::Format_RGB888: case QImage::Format_RGB16: case QImage::Format_RGB555: @@ -1037,6 +1039,9 @@ bool QDirectFBScreen::connect(const QString &displaySpec) setGraphicsSystem(d_ptr); + if (displayArgs.contains(QLatin1String("debug"), Qt::CaseInsensitive)) + printDirectFBInfo(d_ptr->dfb, d_ptr->dfbSurface); + return true; } -- cgit v0.12 From 36bc35c451b6123b0e237430343a80db8a600b24 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Thu, 28 May 2009 10:57:45 -0700 Subject: Remove all force raster on RGB32 stuff Previously we allowed RGB32 but forced fallbacks for all drawing operations. It turns out blitting operations doesn't work right either so we'll rather just disallow this format altogether. See also 36ae58e7a6a888d3ae7bd162d59daada550bbfb1 Reviewed-by: Donald --- .../gfxdrivers/directfb/qdirectfbpaintdevice.h | 4 -- .../gfxdrivers/directfb/qdirectfbpaintengine.cpp | 77 +++++++++------------- .../gfxdrivers/directfb/qdirectfbpixmap.cpp | 23 +------ .../gfxdrivers/directfb/qdirectfbwindowsurface.cpp | 3 - 4 files changed, 32 insertions(+), 75 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h index 13f0a8f..180acaf 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h @@ -61,8 +61,6 @@ public: void lockDirectFB(uint flags); void unlockDirectFB(); - inline bool forceRasterPrimitives() const { return forceRaster; } - // Reimplemented from QCustomRasterPaintDevice: void* memory() const; QImage::Format format() const; @@ -77,7 +75,6 @@ protected: dfbSurface(0), lockedImage(0), screen(scr), - forceRaster(false), lock(0), mem(0) {} @@ -95,7 +92,6 @@ protected: QImage *lockedImage; QDirectFBScreen *screen; int bpl; - bool forceRaster; uint lock; uchar *mem; private: diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index a68bc8f..7535090 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -81,7 +81,7 @@ template <> inline const bool* ptr(const bool &) { return 0; } template static void rasterFallbackWarn(const char *msg, const char *func, const device *dev, int scale, bool matrixRotShear, bool simplePen, - bool dfbHandledClip, bool forceRasterPrimitives, + bool dfbHandledClip, const char *nameOne, const T1 &one, const char *nameTwo, const T2 &two, const char *nameThree, const T3 &three) @@ -98,8 +98,7 @@ static void rasterFallbackWarn(const char *msg, const char *func, const device * dbg << "scale" << scale << "matrixRotShear" << matrixRotShear << "simplePen" << simplePen - << "dfbHandledClip" << dfbHandledClip - << "forceRasterPrimitives" << forceRasterPrimitives; + << "dfbHandledClip" << dfbHandledClip; const T1 *t1 = ptr(one); const T2 *t2 = ptr(two); @@ -125,7 +124,6 @@ static void rasterFallbackWarn(const char *msg, const char *func, const device * __FUNCTION__, state()->painter->device(), \ d_func()->scale, d_func()->matrixRotShear, \ d_func()->simplePen, d_func()->dfbCanHandleClip(), \ - d_func()->forceRasterPrimitives, \ #one, one, #two, two, #three, three); \ if (op & (QT_DIRECTFB_DISABLE_RASTERFALLBACKS)) \ return; @@ -140,7 +138,6 @@ static void rasterFallbackWarn(const char *msg, const char *func, const device * __FUNCTION__, state()->painter->device(), \ d_func()->scale, d_func()->matrixRotShear, \ d_func()->simplePen, d_func()->dfbCanHandleClip(), \ - d_func()->forceRasterPrimitives, \ #one, one, #two, two, #three, three); #else #define RASTERFALLBACK(op, one, two, three) @@ -263,7 +260,6 @@ private: QPen pen; bool antialiased; - bool forceRasterPrimitives; bool simplePen; @@ -408,8 +404,7 @@ void QDirectFBPaintEngine::drawRects(const QRect *rects, int rectCount) d->updateClip(); const QBrush &brush = state()->brush; if (!d->dfbCanHandleClip() || d->matrixRotShear - || !d->simplePen || d->forceRasterPrimitives - || !d->isSimpleBrush(brush)) { + || !d->simplePen || !d->isSimpleBrush(brush)) { RASTERFALLBACK(DRAW_RECTS, rectCount, VOID_ARG(), VOID_ARG()); d->lock(); QRasterPaintEngine::drawRects(rects, rectCount); @@ -434,8 +429,7 @@ void QDirectFBPaintEngine::drawRects(const QRectF *rects, int rectCount) d->updateClip(); const QBrush &brush = state()->brush; if (!d->dfbCanHandleClip() || d->matrixRotShear - || !d->simplePen || d->forceRasterPrimitives - || !d->isSimpleBrush(brush)) { + || !d->simplePen || !d->isSimpleBrush(brush)) { RASTERFALLBACK(DRAW_RECTS, rectCount, VOID_ARG(), VOID_ARG()); d->lock(); QRasterPaintEngine::drawRects(rects, rectCount); @@ -458,7 +452,7 @@ void QDirectFBPaintEngine::drawLines(const QLine *lines, int lineCount) { Q_D(QDirectFBPaintEngine); d->updateClip(); - if (!d->simplePen || !d->dfbCanHandleClip() || d->forceRasterPrimitives) { + if (!d->simplePen || !d->dfbCanHandleClip()) { RASTERFALLBACK(DRAW_LINES, lineCount, VOID_ARG(), VOID_ARG()); d->lock(); QRasterPaintEngine::drawLines(lines, lineCount); @@ -476,7 +470,7 @@ void QDirectFBPaintEngine::drawLines(const QLineF *lines, int lineCount) { Q_D(QDirectFBPaintEngine); d->updateClip(); - if (!d->simplePen || !d->dfbCanHandleClip() || d->forceRasterPrimitives) { + if (!d->simplePen || !d->dfbCanHandleClip()) { RASTERFALLBACK(DRAW_LINES, lineCount, VOID_ARG(), VOID_ARG()); d->lock(); QRasterPaintEngine::drawLines(lines, lineCount); @@ -691,8 +685,6 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QBrush &brush) if (d->dfbCanHandleClip(rect) && !d->matrixRotShear) { switch (brush.style()) { case Qt::SolidPattern: { - if (d->forceRasterPrimitives) - break; d->unlock(); d->setDFBColor(brush.color()); const QRect r = d->transform.mapRect(rect).toRect(); @@ -720,7 +712,7 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QColor &color) { Q_D(QDirectFBPaintEngine); d->updateClip(); - if (!d->dfbCanHandleClip() || d->matrixRotShear || d->forceRasterPrimitives) { + if (!d->dfbCanHandleClip() || d->matrixRotShear) { RASTERFALLBACK(FILL_RECT, rect, color, VOID_ARG()); d->lock(); QRasterPaintEngine::fillRect(rect, color); @@ -737,38 +729,32 @@ void QDirectFBPaintEngine::drawColorSpans(const QSpan *spans, int count, uint color) { Q_D(QDirectFBPaintEngine); - if (d->forceRasterPrimitives) { - RASTERFALLBACK(DRAW_COLORSPANS, count, color, VOID_ARG()); - d->lock(); - QRasterPaintEngine::drawColorSpans(spans, count, color); - } else { - color = INV_PREMUL(color); - - QVarLengthArray lines(count); - int j = 0; - for (int i = 0; i < count; ++i) { - if (spans[i].coverage == 255) { - lines[j].x1 = spans[i].x; - lines[j].y1 = spans[i].y; - lines[j].x2 = spans[i].x + spans[i].len - 1; - lines[j].y2 = spans[i].y; - ++j; - } else { - DFBSpan span = { spans[i].x, spans[i].len }; - uint c = BYTE_MUL(color, spans[i].coverage); - // ### how does this play with setDFBColor - d->surface->SetColor(d->surface, - qRed(c), qGreen(c), qBlue(c), qAlpha(c)); - d->surface->FillSpans(d->surface, spans[i].y, &span, 1); - } - } - if (j > 0) { + color = INV_PREMUL(color); + + QVarLengthArray lines(count); + int j = 0; + for (int i = 0; i < count; ++i) { + if (spans[i].coverage == 255) { + lines[j].x1 = spans[i].x; + lines[j].y1 = spans[i].y; + lines[j].x2 = spans[i].x + spans[i].len - 1; + lines[j].y2 = spans[i].y; + ++j; + } else { + DFBSpan span = { spans[i].x, spans[i].len }; + uint c = BYTE_MUL(color, spans[i].coverage); + // ### how does this play with setDFBColor d->surface->SetColor(d->surface, - qRed(color), qGreen(color), qBlue(color), - qAlpha(color)); - d->surface->DrawLines(d->surface, lines.data(), j); + qRed(c), qGreen(c), qBlue(c), qAlpha(c)); + d->surface->FillSpans(d->surface, spans[i].y, &span, 1); } } + if (j > 0) { + d->surface->SetColor(d->surface, + qRed(color), qGreen(color), qBlue(color), + qAlpha(color)); + d->surface->DrawLines(d->surface, lines.data(), j); + } } void QDirectFBPaintEngine::drawBufferSpan(const uint *buffer, int bufsize, @@ -803,7 +789,7 @@ void QDirectFBPaintEngine::initImageCache(int size) QDirectFBPaintEnginePrivate::QDirectFBPaintEnginePrivate(QDirectFBPaintEngine *p) - : surface(0), antialiased(false), forceRasterPrimitives(false), simplePen(false), + : surface(0), antialiased(false), simplePen(false), matrixRotShear(false), scale(NoScale), lastLockedHeight(-1), fbWidth(-1), fbHeight(-1), opacity(255), drawFlagsFromCompositionMode(0), blitFlagsFromCompositionMode(0), porterDuffRule(DSPD_SRC_OVER), dirtyClip(true), @@ -896,7 +882,6 @@ void QDirectFBPaintEnginePrivate::begin(QPaintDevice *device) device->devType()); } lockedMemory = 0; - forceRasterPrimitives = dfbDevice->forceRasterPrimitives(); surface->GetSize(surface, &fbWidth, &fbHeight); diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index c9b676a..dba1b51 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -76,7 +76,6 @@ void QDirectFBPixmapData::resize(int width, int height) format, QDirectFBScreen::TrackSurface); alpha = false; - forceRaster = (format == QImage::Format_RGB32); if (!dfbSurface) { invalidate(); qWarning("QDirectFBPixmapData::resize(): Unable to allocate surface"); @@ -187,7 +186,6 @@ void QDirectFBPixmapData::fromImage(const QImage &i, } dfbSurface = screen->copyToDFBSurface(img, format, QDirectFBScreen::TrackSurface); - forceRaster = (format == QImage::Format_RGB32); if (!dfbSurface) { qWarning("QDirectFBPixmapData::fromImage()"); invalidate(); @@ -216,7 +214,6 @@ void QDirectFBPixmapData::copy(const QPixmapData *data, const QRect &rect) invalidate(); return; } - forceRaster = (format == QImage::Format_RGB32); if (hasAlpha) { dfbSurface->Clear(dfbSurface, 0, 0, 0, 0); @@ -268,7 +265,6 @@ void QDirectFBPixmapData::fill(const QColor &color) screen->releaseDFBSurface(dfbSurface); format = screen->alphaPixmapFormat(); dfbSurface = screen->createDFBSurface(size, screen->alphaPixmapFormat(), QDirectFBScreen::TrackSurface); - forceRaster = false; setSerialNumber(++global_ser_no); if (!dfbSurface) { qWarning("QDirectFBPixmapData::fill()"); @@ -277,24 +273,7 @@ void QDirectFBPixmapData::fill(const QColor &color) } } - if (forceRaster) { - // in DSPF_RGB32 all dfb drawing causes the Alpha byte to be - // set to 0. This causes issues for the raster engine. - uchar *mem = QDirectFBScreen::lockSurface(dfbSurface, DSLF_WRITE, &bpl); - if (mem) { - const int h = QPixmapData::height(); - const int w = QPixmapData::width() * 4; // 4 bytes per 32 bit pixel - const int c = color.rgba(); - for (int i = 0; i < h; ++i) { - memset(mem, c, w); - mem += bpl; - } - dfbSurface->Unlock(dfbSurface); - } - } else { - dfbSurface->Clear(dfbSurface, color.red(), color.green(), color.blue(), - color.alpha()); - } + dfbSurface->Clear(dfbSurface, color.red(), color.green(), color.blue(), color.alpha()); } QPixmap QDirectFBPixmapData::transformed(const QTransform &transform, diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp index cd8796b..c7cae80 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp @@ -127,7 +127,6 @@ void QDirectFBWindowSurface::createWindow() dfbSurface->Release(dfbSurface); dfbWindow->GetSurface(dfbWindow, &dfbSurface); - forceRaster = (format == QImage::Format_RGB32); #endif } #endif // QT_NO_DIRECTFB_WM @@ -164,7 +163,6 @@ void QDirectFBWindowSurface::setGeometry(const QRect &rect, const QRegion &mask) rect.width(), rect.height() }; result = primarySurface->GetSubSurface(primarySurface, &r, &dfbSurface); } - forceRaster = (dfbSurface && QDirectFBScreen::getImageFormat(dfbSurface) == QImage::Format_RGB32); } else { const bool isResize = rect.size() != geometry().size(); #ifdef QT_NO_DIRECTFB_WM @@ -179,7 +177,6 @@ void QDirectFBWindowSurface::setGeometry(const QRect &rect, const QRegion &mask) } dfbSurface = screen->createDFBSurface(rect.size(), screen->pixelFormat(), QDirectFBScreen::DontTrackSurface); - forceRaster = (dfbSurface && QDirectFBScreen::getImageFormat(dfbSurface) == QImage::Format_RGB32); } else { Q_ASSERT(dfbSurface); } -- cgit v0.12 From 2a986b86f841b798cc754fe5c5390c6fee95ce71 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Thu, 28 May 2009 13:20:48 -0700 Subject: Changes for DirectFB Reviewed-by: TrustMe --- dist/changes-4.5.2 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 1e00208..dcb77d6 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -139,6 +139,26 @@ Qt for Windows CE * Plugins * **************************************************************************** +- directfb + * Make sure we pick an approriate format for pixmaps. E.g. use the same as + the primary surface for opaque pixmaps and pick an appropriate one for + transparent pixmaps if the primary surface format is not transparent. + * Properly fall back to the raster engine for pens that aren't solidcolor + * Properly fall back to raster engine with "mirrored" scales + * Make sure window surfaces are the approriate pixel format and created in + video memory if supported + * Fix clipping bug that would cause painting errors + * Fix various crash bugs + * Fix bugs when transforming/copying pixmaps with alpha channel + * Fix various bugs with regards to painting with alpha channel/porter duff + * Optimize a coupld of internal functions to slightly speed up drawing + * Optimize raster fall backs + * Allow more customization for Flipping options + * Fix drawing with opacity != 1.0 + * Support for better logging when trying to debug performance problems. + * Fix bug in keyboard handling that caused modifiers not to work + * Get rid of some compiler warnings + **************************************************************************** * Important Behavior Changes * -- cgit v0.12 From a1ffc561aa6bbbdc1355119d5a43d17d0ff5c560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 29 May 2009 10:05:07 +0300 Subject: S60Style: Rename the private class to highlight that it is available only to 's60'. --- src/gui/styles/qs60style_s60.cpp | 1326 ++++++++++++++++++++++++++++++++++ src/gui/styles/qs60style_symbian.cpp | 1326 ---------------------------------- src/gui/styles/styles.pri | 2 +- 3 files changed, 1327 insertions(+), 1327 deletions(-) create mode 100644 src/gui/styles/qs60style_s60.cpp delete mode 100644 src/gui/styles/qs60style_symbian.cpp diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp new file mode 100644 index 0000000..ddee4ba --- /dev/null +++ b/src/gui/styles/qs60style_s60.cpp @@ -0,0 +1,1326 @@ +/**************************************************************************** +** +** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the $MODULE$ of the Qt Toolkit. +** +** $TROLLTECH_DUAL_LICENSE$ +** +****************************************************************************/ + +#include "qs60style.h" +#include "qs60style_p.h" +#include "qpainter.h" +#include "qstyleoption.h" +#include "qstyle.h" +#include "private/qwindowsurface_s60_p.h" +#include "private/qt_s60_p.h" +#include "private/qcore_symbian_p.h" +#include "qapplication.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if !defined(QT_NO_STYLE_S60) || defined(QT_PLUGIN) + +QT_BEGIN_NAMESPACE + +enum TDrawType { + EDrawIcon, + EDrawBackground, + ENoDraw +}; + +enum TSupportRelease { + ES60_None = 0x0000, //indicates that the commonstyle should draw the graphics + ES60_3_1 = 0x0001, + ES60_3_2 = 0x0002, + ES60_5_0 = 0x0004, + // Add all new releases here + ES60_AllReleases = ES60_3_1 | ES60_3_2 | ES60_5_0 +}; + +typedef struct { + const TAknsItemID &skinID; + TDrawType drawType; + int supportInfo; + int newMajorSkinId; + int newMinorSkinId; +} partMapEntry; + +enum TFallbackMbmFile { + EAvkonMbm = 0, + ELastMbm +}; + +typedef struct { + const QS60StyleEnums::SkinParts partID; + TFallbackMbmFile fallbackFileID; //to avoid putting large char strings to table, lets only have a mapping value + int fallbackGraphicID; +} fallbackMapEntry; + +class QS60StyleModeSpecifics +{ +public: + static QPixmap skinnedGraphics(QS60StyleEnums::SkinParts stylepart, + const QSize &size, QS60StylePrivate::SkinElementFlags flags); + static QPixmap skinnedGraphics(QS60StylePrivate::SkinFrameElements frameElement, const QSize &size, QS60StylePrivate::SkinElementFlags flags); + static QPixmap colorSkinnedGraphics(const QS60StyleEnums::SkinParts &stylepart, + const QSize &size, QS60StylePrivate::SkinElementFlags flags); + static QColor colorValue(const TAknsItemID &colorGroup, int colorIndex); + static QPixmap fromFbsBitmap(CFbsBitmap *icon, CFbsBitmap *mask, QS60StylePrivate::SkinElementFlags flags, QImage::Format format); + static bool disabledPartGraphic(QS60StyleEnums::SkinParts &part); + static bool disabledFrameGraphic(QS60StylePrivate::SkinFrameElements &frame); + static QPixmap generateMissingThemeGraphic(QS60StyleEnums::SkinParts &part, const QSize &size, QS60StylePrivate::SkinElementFlags flags); + +private: + static QPixmap createSkinnedGraphicsL(QS60StyleEnums::SkinParts part, + const QSize &size, QS60StylePrivate::SkinElementFlags flags); + static QPixmap createSkinnedGraphicsL(QS60StylePrivate::SkinFrameElements frameElement, const QSize &size, QS60StylePrivate::SkinElementFlags flags); + static QPixmap colorSkinnedGraphicsL(const QS60StyleEnums::SkinParts &stylepart, + const QSize &size, QS60StylePrivate::SkinElementFlags flags); + static void frameIdAndCenterId(QS60StylePrivate::SkinFrameElements frameElement, TAknsItemID &frameId, TAknsItemID ¢erId); + static TRect innerRectFromElement(QS60StylePrivate::SkinFrameElements frameElement, const TRect &outerRect); + static void checkAndUnCompressBitmapL(CFbsBitmap*& aOriginalBitmap); + static void checkAndUnCompressBitmap(CFbsBitmap*& aOriginalBitmap); + static void unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap* aTrgBitmap, CFbsBitmap* aSrcBitmap); + static void colorGroupAndIndex(QS60StyleEnums::SkinParts skinID, + TAknsItemID &colorGroup, int colorIndex); + static void fallbackInfo(const QS60StyleEnums::SkinParts &stylepart, TDes& fallbackFileName, TInt& fallbackIndex); + static bool checkSupport(const int supportedRelease); + static TAknsItemID checkAndUpdateReleaseSpecificGraphics(int part); + // Array to match the skin ID, fallback graphics and Qt widget graphics. + static const partMapEntry m_partMap[]; +}; + +const partMapEntry QS60StyleModeSpecifics::m_partMap[] = { + /* SP_QgnGrafBarWait */ {KAknsIIDQgnGrafBarWaitAnim, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafBarFrameCenter */ {KAknsIIDQgnGrafBarFrameCenter, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafBarFrameSideL */ {KAknsIIDQgnGrafBarFrameSideL, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafBarFrameSideR */ {KAknsIIDQgnGrafBarFrameSideR, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafBarProgress */ {KAknsIIDQgnGrafBarProgress, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafScrollArrowDown */ {KAknsIIDQgnGrafScrollArrowDown, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafScrollArrowLeft */ {KAknsIIDQgnGrafScrollArrowLeft, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafScrollArrowRight */ {KAknsIIDQgnGrafScrollArrowRight, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafScrollArrowUp */ {KAknsIIDQgnGrafScrollArrowUp, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafTabActiveL */ {KAknsIIDQgnGrafTabActiveL, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafTabActiveM */ {KAknsIIDQgnGrafTabActiveM, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafTabActiveR */ {KAknsIIDQgnGrafTabActiveR, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafTabPassiveL */ {KAknsIIDQgnGrafTabPassiveL, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafTabPassiveM */ {KAknsIIDQgnGrafTabPassiveM, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafTabPassiveR */ {KAknsIIDQgnGrafTabPassiveR, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnIndiCheckboxOff */ {KAknsIIDQgnIndiCheckboxOff, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnIndiCheckboxOn */ {KAknsIIDQgnIndiCheckboxOn, EDrawIcon, ES60_AllReleases, -1,-1}, + // Following 5 items (SP_QgnIndiHlColSuper - SP_QgnIndiHlLineStraight) are available starting from S60 release 3.2. + // In 3.1 CommonStyle drawing is used for these QTreeView elements, since no similar icons in AVKON UI. + /* SP_QgnIndiHlColSuper */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d5 /* KAknsIIDQgnIndiHlColSuper */}, + /* SP_QgnIndiHlExpSuper */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d6 /* KAknsIIDQgnIndiHlExpSuper */}, + /* SP_QgnIndiHlLineBranch */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d7 /* KAknsIIDQgnIndiHlLineBranch */}, + /* SP_QgnIndiHlLineEnd */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d8 /* KAknsIIDQgnIndiHlLineEnd */}, + /* SP_QgnIndiHlLineStraight */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d9 /* KAknsIIDQgnIndiHlLineStraight */}, + /* SP_QgnIndiMarkedAdd */ {KAknsIIDQgnIndiMarkedAdd, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnIndiNaviArrowLeft */ {KAknsIIDQgnGrafScrollArrowLeft, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnIndiNaviArrowRight */ {KAknsIIDQgnGrafScrollArrowRight, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnIndiRadiobuttOff */ {KAknsIIDQgnIndiRadiobuttOff, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnIndiRadiobuttOn */ {KAknsIIDQgnIndiRadiobuttOn, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnIndiSliderEdit */ {KAknsIIDQgnIndiSliderEdit, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnIndiSubMenu */ {KAknsIIDQgnIndiSubmenu, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnNoteErased */ {KAknsIIDQgnNoteErased, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnNoteError */ {KAknsIIDQgnNoteError, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnNoteInfo */ {KAknsIIDQgnNoteInfo, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnNoteOk */ {KAknsIIDQgnNoteOk, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnNoteQuery */ {KAknsIIDQgnNoteQuery, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnNoteWarning */ {KAknsIIDQgnNoteWarning, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnPropFileSmall */ {KAknsIIDQgnPropFileSmall, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnPropFolderCurrent */ {KAknsIIDQgnPropFolderCurrent, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnPropFolderSmall */ {KAknsIIDQgnPropFolderSmall, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnPropFolderSmallNew */ {KAknsIIDQgnPropFolderSmallNew, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnPropPhoneMemcLarge */ {KAknsIIDQgnPropPhoneMemcLarge, EDrawIcon, ES60_AllReleases, -1,-1}, + + // 3.1 & 3.2 do not have pressed state for scrollbar, so use normal scrollbar graphics instead. + /* SP_QsnCpScrollHandleBottomPressed*/ {KAknsIIDQsnCpScrollHandleBottom, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorGeneric, 0x20f8}, /*KAknsIIDQsnCpScrollHandleBottomPressed*/ + /* SP_QsnCpScrollHandleMiddlePressed*/ {KAknsIIDQsnCpScrollHandleMiddle, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorGeneric, 0x20f9}, /*KAknsIIDQsnCpScrollHandleMiddlePressed*/ + /* SP_QsnCpScrollHandleTopPressed*/ {KAknsIIDQsnCpScrollHandleTop, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorGeneric, 0x20fa}, /*KAknsIIDQsnCpScrollHandleTopPressed*/ + + /* SP_QsnBgScreen */ {KAknsIIDQsnBgScreen, EDrawBackground, ES60_AllReleases, -1,-1}, + + /* SP_QsnCpScrollBgBottom */ {KAknsIIDQsnCpScrollBgBottom, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QsnCpScrollBgMiddle */ {KAknsIIDQsnCpScrollBgMiddle, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QsnCpScrollBgTop */ {KAknsIIDQsnCpScrollBgTop, EDrawIcon, ES60_AllReleases, -1,-1}, + + /* SP_QsnCpScrollHandleBottom */ {KAknsIIDQsnCpScrollHandleBottom, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QsnCpScrollHandleMiddle */ {KAknsIIDQsnCpScrollHandleMiddle, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QsnCpScrollHandleTop */ {KAknsIIDQsnCpScrollHandleTop, EDrawIcon, ES60_AllReleases, -1,-1}, + + /* SP_QsnFrButtonTbCornerTl */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, //todo: use "normal button" from 5.0 onwards + /* SP_QsnFrButtonTbCornerTr */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbCornerBl */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbCornerBr */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbSideT */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbSideB */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbSideL */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbSideR */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbCenter */ {KAknsIIDQsnFrButtonTbCenter, EDrawIcon, ES60_AllReleases, -1,-1}, + + /* SP_QsnFrButtonTbCornerTlPressed */{KAknsIIDQsnFrButtonTbCornerTlPressed, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbCornerTrPressed */{KAknsIIDQsnFrButtonTbCornerTrPressed, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbCornerBlPressed */{KAknsIIDQsnFrButtonTbCornerBlPressed, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbCornerBrPressed */{KAknsIIDQsnFrButtonTbCornerBrPressed, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbSideTPressed */ {KAknsIIDQsnFrButtonTbSideTPressed, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbSideBPressed */ {KAknsIIDQsnFrButtonTbSideBPressed, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbSideLPressed */ {KAknsIIDQsnFrButtonTbSideLPressed, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbSideRPressed */ {KAknsIIDQsnFrButtonTbSideRPressed, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbCenterPressed */ {KAknsIIDQsnFrButtonTbCenterPressed, EDrawIcon, ES60_AllReleases, -1,-1}, + + /* SP_QsnFrCaleCornerTl */ {KAknsIIDQsnFrCaleCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleCornerTr */ {KAknsIIDQsnFrCaleCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleCornerBl */ {KAknsIIDQsnFrCaleCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleCornerBr */ {KAknsIIDQsnFrCaleCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleGSideT */ {KAknsIIDQsnFrCaleSideT, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleGSideB */ {KAknsIIDQsnFrCaleSideB, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleGSideL */ {KAknsIIDQsnFrCaleSideL, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleGSideR */ {KAknsIIDQsnFrCaleSideR, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleCenter */ {KAknsIIDQsnFrCaleCenter, ENoDraw, ES60_AllReleases, -1,-1}, + + /* SP_QsnFrCaleHeadingCornerTl */ {KAknsIIDQsnFrCaleHeadingCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleHeadingCornerTr */ {KAknsIIDQsnFrCaleHeadingCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleHeadingCornerBl */ {KAknsIIDQsnFrCaleHeadingCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleHeadingCornerBr */ {KAknsIIDQsnFrCaleHeadingCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleHeadingSideT */ {KAknsIIDQsnFrCaleHeadingSideT, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleHeadingSideB */ {KAknsIIDQsnFrCaleHeadingSideB, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleHeadingSideL */ {KAknsIIDQsnFrCaleHeadingSideL, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleHeadingSideR */ {KAknsIIDQsnFrCaleHeadingSideR, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleHeadingCenter */ {KAknsIIDQsnFrCaleHeadingCenter, ENoDraw, ES60_AllReleases, -1,-1}, + + /* SP_QsnFrInputCornerTl */ {KAknsIIDQsnFrInputCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrInputCornerTr */ {KAknsIIDQsnFrInputCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrInputCornerBl */ {KAknsIIDQsnFrInputCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrInputCornerBr */ {KAknsIIDQsnFrInputCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrInputSideT */ {KAknsIIDQsnFrInputSideT, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrInputSideB */ {KAknsIIDQsnFrInputSideB, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrInputSideL */ {KAknsIIDQsnFrInputSideL, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrInputSideR */ {KAknsIIDQsnFrInputSideR, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrInputCenter */ {KAknsIIDQsnFrInputCenter, ENoDraw, ES60_AllReleases, -1,-1}, + + /* SP_QsnFrListCornerTl */ {KAknsIIDQsnFrListCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrListCornerTr */ {KAknsIIDQsnFrListCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrListCornerBl */ {KAknsIIDQsnFrListCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrListCornerBr */ {KAknsIIDQsnFrListCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrListSideT */ {KAknsIIDQsnFrListSideT, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrListSideB */ {KAknsIIDQsnFrListSideB, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrListSideL */ {KAknsIIDQsnFrListSideL, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrListSideR */ {KAknsIIDQsnFrListSideR, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrListCenter */ {KAknsIIDQsnFrListCenter, ENoDraw, ES60_AllReleases, -1,-1}, + + /* SP_QsnFrPopupCornerTl */ {KAknsIIDQsnFrPopupCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrPopupCornerTr */ {KAknsIIDQsnFrPopupCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrPopupCornerBl */ {KAknsIIDQsnFrPopupCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrPopupCornerBr */ {KAknsIIDQsnFrPopupCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrPopupSideT */ {KAknsIIDQsnFrPopupSideT, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrPopupSideB */ {KAknsIIDQsnFrPopupSideB, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrPopupSideL */ {KAknsIIDQsnFrPopupSideL, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrPopupSideR */ {KAknsIIDQsnFrPopupSideR, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrPopupCenter */ {KAknsIIDQsnFrPopupCenter, ENoDraw, ES60_AllReleases, -1,-1}, + + // ToolTip graphics different in 3.1 vs. 3.2+. + /* SP_QsnFrPopupPreviewCornerTl */ {KAknsIIDQsnFrPopupCornerTl, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c5}, /* KAknsIIDQsnFrPopupPreviewCornerTl */ + /* SP_QsnFrPopupPreviewCornerTr */ {KAknsIIDQsnFrPopupCornerTr, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c6}, + /* SP_QsnFrPopupPreviewCornerBl */ {KAknsIIDQsnFrPopupCornerBl, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c3}, + /* SP_QsnFrPopupPreviewCornerBr */ {KAknsIIDQsnFrPopupCornerBr, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c4}, + /* SP_QsnFrPopupPreviewSideT */ {KAknsIIDQsnFrPopupSideT, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19ca}, + /* SP_QsnFrPopupPreviewSideB */ {KAknsIIDQsnFrPopupSideB, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c7}, + /* SP_QsnFrPopupPreviewSideL */ {KAknsIIDQsnFrPopupSideL, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c8}, + /* SP_QsnFrPopupPreviewSideR */ {KAknsIIDQsnFrPopupSideR, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c9}, + /* SP_QsnFrPopupPreviewCenter */ {KAknsIIDQsnFrPopupCenter, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c2}, + + /* SP_QsnFrSetOptCornerTl */ {KAknsIIDQsnFrSetOptCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrSetOptCornerTr */ {KAknsIIDQsnFrSetOptCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrSetOptCornerBl */ {KAknsIIDQsnFrSetOptCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrSetOptCornerBr */ {KAknsIIDQsnFrSetOptCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrSetOptSideT */ {KAknsIIDQsnFrSetOptSideT, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrSetOptSideB */ {KAknsIIDQsnFrSetOptSideB, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrSetOptSideL */ {KAknsIIDQsnFrSetOptSideL, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrSetOptSideR */ {KAknsIIDQsnFrSetOptSideR, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrSetOptCenter */ {KAknsIIDQsnFrSetOptCenter, ENoDraw, ES60_AllReleases, -1,-1}, + + // No toolbar frame for 5.0+ releases. + /* SP_QsnFrPopupSubCornerTl */ {KAknsIIDQsnFrPopupSubCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, + /* SP_QsnFrPopupSubCornerTr */ {KAknsIIDQsnFrPopupSubCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, + /* SP_QsnFrPopupSubCornerBl */ {KAknsIIDQsnFrPopupSubCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, + /* SP_QsnFrPopupSubCornerBr */ {KAknsIIDQsnFrPopupSubCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, + /* SP_QsnFrPopupSubSideT */ {KAknsIIDQsnFrPopupSubSideT, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, + /* SP_QsnFrPopupSubSideB */ {KAknsIIDQsnFrPopupSubSideB, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, + /* SP_QsnFrPopupSubSideL */ {KAknsIIDQsnFrPopupSubSideL, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, + /* SP_QsnFrPopupSubSideR */ {KAknsIIDQsnFrPopupSubSideR, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, + /* SP_QsnFrPopupSubCenter */ {KAknsIIDQsnFrPopupCenterSubmenu, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, + + // Toolbar graphics is different in 3.1/3.2 vs. 5.0 + /* SP_QsnFrSctrlButtonCornerTl */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2301}, /* KAknsIIDQgnFrSctrlButtonCornerTl*/ + /* SP_QsnFrSctrlButtonCornerTr */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2302}, + /* SP_QsnFrSctrlButtonCornerBl */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2303}, + /* SP_QsnFrSctrlButtonCornerBr */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2304}, + /* SP_QsnFrSctrlButtonSideT */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2305}, + /* SP_QsnFrSctrlButtonSideB */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2306}, + /* SP_QsnFrSctrlButtonSideL */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2307}, + /* SP_QsnFrSctrlButtonSideR */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2308}, + /* SP_QsnFrSctrlButtonCenter */ {KAknsIIDQsnFrButtonTbCenter, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2309}, /*KAknsIIDQgnFrSctrlButtonCenter*/ + + // No pressed state for toolbar button in 3.1/3.2. + /* SP_QsnFrSctrlButtonCornerTlPressed */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2621}, /*KAknsIIDQsnFrSctrlButtonCornerTlPressed*/ + /* SP_QsnFrSctrlButtonCornerTrPressed */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2622}, + /* SP_QsnFrSctrlButtonCornerBlPressed */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2623}, + /* SP_QsnFrSctrlButtonCornerBrPressed */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2624}, + /* SP_QsnFrSctrlButtonSideTPressed */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2625}, + /* SP_QsnFrSctrlButtonSideBPressed */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2626}, + /* SP_QsnFrSctrlButtonSideLPressed */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2627}, + /* SP_QsnFrSctrlButtonSideRPressed */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2628}, + /* SP_QsnFrSctrlButtonCenterPressed */ {KAknsIIDQsnFrButtonTbCenter, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2629}, + + // No inactive button graphics in 3.1/3.2 + /* SP_QsnFrButtonCornerTlInactive */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b1}, /*KAknsIIDQsnFrButtonCornerTlInactive*/ + /* SP_QsnFrButtonCornerTrInactive */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b2}, + /* SP_QsnFrButtonCornerBlInactive */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b3}, + /* SP_QsnFrButtonCornerTrInactive */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b4}, + /* SP_QsnFrButtonSideTInactive */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b5}, + /* SP_QsnFrButtonSideBInactive */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b6}, + /* SP_QsnFrButtonSideLInactive */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b7}, + /* SP_QsnFrButtonSideRInactive */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b8}, + /* SP_QsnFrButtonCenterInactive */ {KAknsIIDQsnFrButtonTbCenter, EDrawIcon,ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b9} + +}; + +QPixmap QS60StyleModeSpecifics::skinnedGraphics( + QS60StyleEnums::SkinParts stylepart, const QSize &size, + QS60StylePrivate::SkinElementFlags flags) +{ + QPixmap themedImage; + TRAPD( error, { + const QPixmap skinnedImage = createSkinnedGraphicsL(stylepart, size, flags); + themedImage = skinnedImage; + }); + if (error) + return themedImage = QPixmap(); + return themedImage; +} + +QPixmap QS60StyleModeSpecifics::skinnedGraphics( + QS60StylePrivate::SkinFrameElements frame, const QSize &size, QS60StylePrivate::SkinElementFlags flags) +{ + QPixmap themedImage; + TRAPD( error, { + const QPixmap skinnedImage = createSkinnedGraphicsL(frame, size, flags); + themedImage = skinnedImage; + }); + if (error) + return themedImage = QPixmap(); + return themedImage; +} + +QPixmap QS60StyleModeSpecifics::colorSkinnedGraphics( + const QS60StyleEnums::SkinParts &stylepart, + const QSize &size, QS60StylePrivate::SkinElementFlags flags) +{ + QPixmap colorGraphics; + TRAPD(error, colorGraphics = colorSkinnedGraphicsL(stylepart, size, flags)); + return error ? QPixmap() : colorGraphics; +} + +void QS60StyleModeSpecifics::fallbackInfo(const QS60StyleEnums::SkinParts &stylepart, TDes& fallbackFileName, TInt& fallbackIndex) +{ + switch(stylepart) { + case QS60StyleEnums::SP_QgnGrafBarWait: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_graf_bar_wait_1; + break; + case QS60StyleEnums::SP_QgnGrafBarFrameCenter: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_graf_bar_frame_center; + break; + case QS60StyleEnums::SP_QgnGrafBarFrameSideL: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_graf_bar_frame_side_l; + break; + case QS60StyleEnums::SP_QgnGrafBarFrameSideR: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_graf_bar_frame_side_r; + break; + case QS60StyleEnums::SP_QgnGrafBarProgress: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_graf_bar_progress; + break; + case QS60StyleEnums::SP_QgnGrafTabActiveL: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_graf_tab_active_l; + break; + case QS60StyleEnums::SP_QgnGrafTabActiveM: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_graf_tab_active_m; + break; + case QS60StyleEnums::SP_QgnGrafTabActiveR: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_graf_tab_active_r; + break; + case QS60StyleEnums::SP_QgnGrafTabPassiveL: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_graf_tab_passive_l; + break; + case QS60StyleEnums::SP_QgnGrafTabPassiveM: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_graf_tab_passive_m; + break; + case QS60StyleEnums::SP_QgnGrafTabPassiveR: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_graf_tab_passive_r; + break; + case QS60StyleEnums::SP_QgnIndiCheckboxOff: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_indi_checkbox_off; + break; + case QS60StyleEnums::SP_QgnIndiCheckboxOn: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_indi_checkbox_on; + break; + case QS60StyleEnums::SP_QgnIndiHlColSuper: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = 0x4456; /* EMbmAvkonQgn_indi_hl_col_super */ + break; + case QS60StyleEnums::SP_QgnIndiHlExpSuper: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = 0x4458; /* EMbmAvkonQgn_indi_hl_exp_super */ + break; + case QS60StyleEnums::SP_QgnIndiHlLineBranch: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = 0x445A; /* EMbmAvkonQgn_indi_hl_line_branch */ + break; + case QS60StyleEnums::SP_QgnIndiHlLineEnd: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = 0x445C; /* EMbmAvkonQgn_indi_hl_line_end */ + break; + case QS60StyleEnums::SP_QgnIndiHlLineStraight: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = 0x445E; /* EMbmAvkonQgn_indi_hl_line_straight */ + break; + case QS60StyleEnums::SP_QgnIndiMarkedAdd: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_indi_marked_add; + break; + case QS60StyleEnums::SP_QgnIndiNaviArrowLeft: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_indi_navi_arrow_left; + break; + case QS60StyleEnums::SP_QgnIndiNaviArrowRight: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_indi_navi_arrow_right; + break; + case QS60StyleEnums::SP_QgnIndiRadiobuttOff: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_indi_radiobutt_off; + break; + case QS60StyleEnums::SP_QgnIndiRadiobuttOn: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_indi_radiobutt_on; + break; + case QS60StyleEnums::SP_QgnIndiSliderEdit: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_indi_slider_edit; + break; + case QS60StyleEnums::SP_QgnIndiSubMenu: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_indi_submenu; + break; + case QS60StyleEnums::SP_QgnNoteErased: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_note_erased; + break; + case QS60StyleEnums::SP_QgnNoteError: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_note_error; + break; + case QS60StyleEnums::SP_QgnNoteInfo: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_note_info; + break; + case QS60StyleEnums::SP_QgnNoteOk: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_note_ok; + break; + case QS60StyleEnums::SP_QgnNoteQuery: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_note_query; + break; + case QS60StyleEnums::SP_QgnNoteWarning: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_note_warning; + break; + case QS60StyleEnums::SP_QgnPropFileSmall: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_prop_file_small; + break; + case QS60StyleEnums::SP_QgnPropFolderCurrent: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_prop_folder_current; + break; + case QS60StyleEnums::SP_QgnPropFolderSmall: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_prop_folder_small; + break; + case QS60StyleEnums::SP_QgnPropFolderSmallNew: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_prop_folder_small_new; + break; + case QS60StyleEnums::SP_QgnPropPhoneMemcLarge: + fallbackFileName = KAvkonBitmapFile(); + fallbackIndex = EMbmAvkonQgn_prop_phone_memc_large; + break; + default: + fallbackFileName = KNullDesC(); + fallbackIndex = -1; + break; + } +} + +QPixmap QS60StyleModeSpecifics::colorSkinnedGraphicsL( + const QS60StyleEnums::SkinParts &stylepart, + const QSize &size, QS60StylePrivate::SkinElementFlags flags) +{ + const int stylepartIndex = (int)stylepart; + const TAknsItemID skinId = m_partMap[stylepartIndex].skinID; + + TInt fallbackGraphicID = -1; + HBufC* iconFile = HBufC::NewLC( KMaxFileName ); + TPtr fileNamePtr = iconFile->Des(); + fallbackInfo(stylepart, fileNamePtr, fallbackGraphicID); + + TAknsItemID colorGroup = KAknsIIDQsnIconColors; + int colorIndex = 0; + colorGroupAndIndex(stylepart, colorGroup, colorIndex); + + const bool rotatedBy90or270 = + (flags & (QS60StylePrivate::SF_PointEast | QS60StylePrivate::SF_PointWest)); + const TSize targetSize = + rotatedBy90or270?TSize(size.height(), size.width()):TSize(size.width(), size.height()); + CFbsBitmap *icon = 0; + CFbsBitmap *iconMask = 0; + const TInt fallbackGraphicsMaskID = + fallbackGraphicID == KErrNotFound?KErrNotFound:fallbackGraphicID+1; //masks are auto-generated as next in mif files + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + AknsUtils::CreateColorIconLC( + skinInstance, skinId, colorGroup, colorIndex, icon, iconMask, fileNamePtr, fallbackGraphicID , fallbackGraphicsMaskID, KRgbBlack); + User::LeaveIfError(AknIconUtils::SetSize(icon, targetSize, EAspectRatioNotPreserved)); + User::LeaveIfError(AknIconUtils::SetSize(iconMask, targetSize, EAspectRatioNotPreserved)); + QPixmap result = fromFbsBitmap(icon, iconMask, flags, qt_TDisplayMode2Format(icon->DisplayMode())); + CleanupStack::PopAndDestroy(3); //icon, iconMask, iconFile + return result; +} + +QColor QS60StyleModeSpecifics::colorValue(const TAknsItemID &colorGroup, int colorIndex) +{ + TRgb skinnedColor; + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + AknsUtils::GetCachedColor(skin, skinnedColor, colorGroup, colorIndex); + return QColor(skinnedColor.Red(),skinnedColor.Green(),skinnedColor.Blue()); +} + +QPixmap QS60StyleModeSpecifics::fromFbsBitmap(CFbsBitmap *icon, CFbsBitmap *mask, QS60StylePrivate::SkinElementFlags flags, QImage::Format format) +{ + Q_ASSERT(icon); + const TSize iconSize = icon->SizeInPixels(); + const int iconBytesPerLine = CFbsBitmap::ScanLineLength(iconSize.iWidth, icon->DisplayMode()); + const int iconBytesCount = iconBytesPerLine * iconSize.iHeight; + + QImage iconImage(qt_TSize2QSize(iconSize), format); + if (iconImage.isNull()) + return QPixmap(); + + checkAndUnCompressBitmap(icon); + if (!icon) //checkAndUnCompressBitmap might set icon to NULL + return QPixmap(); + + icon->LockHeap(); + const uchar *const iconBytes = (uchar*)icon->DataAddress(); + // The icon data needs to be copied, since the color format will be + // automatically converted to Format_ARGB32 when setAlphaChannel is called. + memcpy(iconImage.bits(), iconBytes, iconBytesCount); + icon->UnlockHeap(); + if (mask) { + checkAndUnCompressBitmap(mask); + if (mask) { //checkAndUnCompressBitmap might set mask to NULL + const TSize maskSize = icon->SizeInPixels(); + const int maskBytesPerLine = CFbsBitmap::ScanLineLength(maskSize.iWidth, mask->DisplayMode()); + mask->LockHeap(); + const uchar *const maskBytes = (uchar *)mask->DataAddress(); + // Since no other bitmap should be locked, we can just "borrow" the mask data for setAlphaChannel + const QImage maskImage(maskBytes, maskSize.iWidth, maskSize.iHeight, maskBytesPerLine, QImage::Format_Indexed8); + if (!maskImage.isNull()) + iconImage.setAlphaChannel(maskImage); + mask->UnlockHeap(); + } + } + + QTransform imageTransform; + if (flags & QS60StylePrivate::SF_PointEast) { + imageTransform.rotate(90); + } else if (flags & QS60StylePrivate::SF_PointSouth) { + imageTransform.rotate(180); + iconImage = iconImage.transformed(imageTransform); + } else if (flags & QS60StylePrivate::SF_PointWest) { + imageTransform.rotate(270); + } + if (imageTransform.isRotating()) + iconImage = iconImage.transformed(imageTransform); + + return QPixmap::fromImage(iconImage); +} + +bool QS60StylePrivate::isTouchSupported() +{ + return bool(AknLayoutUtils::PenEnabled()); +} + +bool QS60StylePrivate::isToolBarBackground() +{ + return (QSysInfo::s60Version() == QSysInfo::SV_S60_3_1 || QSysInfo::s60Version() == QSysInfo::SV_S60_3_2); +} + +QPoint qt_s60_fill_background_offset(const QWidget *targetWidget) +{ + CCoeControl *control = targetWidget->effectiveWinId(); + TPoint globalPos = control ? control->PositionRelativeToScreen() : TPoint(0,0); + return QPoint(globalPos.iX, globalPos.iY); +} + +QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL( + QS60StyleEnums::SkinParts part, + const QSize &size, QS60StylePrivate::SkinElementFlags flags) +{ + if (!size.isValid()) + return QPixmap(); + + // Check release support and change part, if necessary. + const TAknsItemID skinId = checkAndUpdateReleaseSpecificGraphics((int)part); + const int stylepartIndex = (int)part; + const TDrawType drawType = m_partMap[stylepartIndex].drawType; + Q_ASSERT(drawType != ENoDraw); + const bool rotatedBy90or270 = + (flags & (QS60StylePrivate::SF_PointEast | QS60StylePrivate::SF_PointWest)); + TSize targetSize = + rotatedBy90or270 ? TSize(size.height(), size.width()) : qt_QSize2TSize(size); + + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + + QPixmap result; + + switch (drawType) { + case EDrawIcon: + { + TInt fallbackGraphicID = -1; + HBufC* iconFile = HBufC::NewLC( KMaxFileName ); + TPtr fileNamePtr = iconFile->Des(); + fallbackInfo(part, fileNamePtr, fallbackGraphicID); + // todo: could we instead use AknIconUtils::AvkonIconFileName(); to avoid allocating each time? + + CFbsBitmap *icon = 0; + CFbsBitmap *iconMask = 0; + const TInt fallbackGraphicsMaskID = + fallbackGraphicID == KErrNotFound?KErrNotFound:fallbackGraphicID+1; //masks are auto-generated as next in mif files +// QS60WindowSurface::unlockBitmapHeap(); + AknsUtils::CreateIconLC(skinInstance, skinId, icon, iconMask, fileNamePtr, fallbackGraphicID , fallbackGraphicsMaskID); + User::LeaveIfError(AknIconUtils::SetSize(icon, targetSize, EAspectRatioNotPreserved)); + User::LeaveIfError(AknIconUtils::SetSize(iconMask, targetSize, EAspectRatioNotPreserved)); + result = fromFbsBitmap(icon, iconMask, flags, qt_TDisplayMode2Format(icon->DisplayMode())); + CleanupStack::PopAndDestroy(3); // iconMask, icon, iconFile +// QS60WindowSurface::lockBitmapHeap(); + break; + } + case EDrawBackground: + { +// QS60WindowSurface::unlockBitmapHeap(); + CFbsBitmap *background = new (ELeave) CFbsBitmap(); //offscreen + CleanupStack::PushL(background); + User::LeaveIfError(background->Create(targetSize, EColor16MA)); + + CFbsBitmapDevice* dev = CFbsBitmapDevice::NewL(background); + CleanupStack::PushL(dev); + CFbsBitGc* gc = NULL; + User::LeaveIfError(dev->CreateContext(gc)); + CleanupStack::PushL(gc); + + CAknsBasicBackgroundControlContext* bgContext = CAknsBasicBackgroundControlContext::NewL( + skinId, + targetSize, + EFalse); + CleanupStack::PushL(bgContext); + + const TBool drawn = AknsDrawUtils::DrawBackground( + skinInstance, + bgContext, + NULL, + *gc, + TPoint(), + targetSize, + KAknsDrawParamDefault | KAknsDrawParamRGBOnly); + + if (drawn) + result = fromFbsBitmap(background, NULL, flags, QImage::Format_RGB32); + + CleanupStack::PopAndDestroy(4, background); //background, dev, gc, bgContext +// QS60WindowSurface::lockBitmapHeap(); + break; + } + } + + return result; // TODO: Let fromFbsBitmap return a QPixmap +} + +QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL(QS60StylePrivate::SkinFrameElements frameElement, + const QSize &size, QS60StylePrivate::SkinElementFlags flags) +{ + if (!size.isValid()) + return QPixmap(); + + const bool rotatedBy90or270 = + (flags & (QS60StylePrivate::SF_PointEast | QS60StylePrivate::SF_PointWest)); + TSize targetSize = + rotatedBy90or270 ? TSize(size.height(), size.width()) : qt_QSize2TSize(size); + + MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); + + QPixmap result; + +// QS60WindowSurface::unlockBitmapHeap(); + static const bool canDoEColor16MAP = !(QSysInfo::s60Version() == QSysInfo::SV_S60_3_1 || QSysInfo::s60Version() == QSysInfo::SV_S60_3_2); + static const TDisplayMode displayMode = canDoEColor16MAP ? TDisplayMode(13) : EColor16MA; // 13 = EColor16MAP + static const TInt drawParam = canDoEColor16MAP ? KAknsDrawParamDefault : KAknsDrawParamNoClearUnderImage|KAknsDrawParamRGBOnly; + + CFbsBitmap *frame = new (ELeave) CFbsBitmap(); //offscreen + CleanupStack::PushL(frame); + User::LeaveIfError(frame->Create(targetSize, displayMode)); + + CFbsBitmapDevice* bitmapDev = CFbsBitmapDevice::NewL(frame); + CleanupStack::PushL(bitmapDev); + CFbsBitGc* bitmapGc = NULL; + User::LeaveIfError(bitmapDev->CreateContext(bitmapGc)); + CleanupStack::PushL(bitmapGc); + + frame->LockHeap(); + memset(frame->DataAddress(), 0, frame->SizeInPixels().iWidth * frame->SizeInPixels().iHeight * 4); // 4: argb bytes + frame->UnlockHeap(); + + const TRect outerRect(TPoint(0, 0), targetSize); + const TRect innerRect = innerRectFromElement(frameElement, outerRect); + + TAknsItemID frameSkinID, centerSkinID; + frameSkinID = centerSkinID = checkAndUpdateReleaseSpecificGraphics(QS60StylePrivate::m_frameElementsData[frameElement].center); + frameIdAndCenterId(frameElement, frameSkinID, centerSkinID); + const TBool drawn = AknsDrawUtils::DrawFrame( skinInstance, + *bitmapGc, outerRect, innerRect, + frameSkinID, centerSkinID, + drawParam ); + + if (canDoEColor16MAP) { + if (drawn) + result = fromFbsBitmap(frame, NULL, flags, QImage::Format_ARGB32_Premultiplied); + } else { + TDisplayMode maskDepth = EGray2; + // Query the skin item for possible frame graphics mask details. + if (skinInstance) { + CAknsMaskedBitmapItemData* skinMaskedBmp = static_cast( + skinInstance->GetCachedItemData(frameSkinID,EAknsITMaskedBitmap)); + if (skinMaskedBmp && skinMaskedBmp->Mask()) + maskDepth = skinMaskedBmp->Mask()->DisplayMode(); + } + if (maskDepth != ENone) { + CFbsBitmap *frameMask = new (ELeave) CFbsBitmap(); //offscreen + CleanupStack::PushL(frameMask); + User::LeaveIfError(frameMask->Create(targetSize, maskDepth)); + + CFbsBitmapDevice* maskBitmapDevice = CFbsBitmapDevice::NewL(frameMask); + CleanupStack::PushL(maskBitmapDevice); + CFbsBitGc* maskBitGc = NULL; + User::LeaveIfError(maskBitmapDevice->CreateContext(maskBitGc)); + CleanupStack::PushL(maskBitGc); + + if (drawn) { + //ensure that the mask is really transparent + maskBitGc->Activate( maskBitmapDevice ); + maskBitGc->SetPenStyle(CGraphicsContext::ENullPen); + maskBitGc->SetBrushStyle(CGraphicsContext::ESolidBrush); + maskBitGc->SetBrushColor(KRgbWhite); + maskBitGc->Clear(); + maskBitGc->SetBrushStyle(CGraphicsContext::ENullBrush); + + AknsDrawUtils::DrawFrame(skinInstance, + *maskBitGc, outerRect, innerRect, + frameSkinID, centerSkinID, + KAknsSDMAlphaOnly |KAknsDrawParamNoClearUnderImage); + result = fromFbsBitmap(frame, frameMask, flags, QImage::Format_ARGB32); + } + CleanupStack::PopAndDestroy(3, frameMask); + } + } + CleanupStack::PopAndDestroy(3, frame); //frame, bitmapDev, bitmapGc + + return result; // TODO: Let fromFbsBitmap return a QPixmap +} + +void QS60StyleModeSpecifics::frameIdAndCenterId(QS60StylePrivate::SkinFrameElements frameElement, TAknsItemID &frameId, TAknsItemID ¢erId) +{ +// There are some major mix-ups in skin declarations for some frames. +// First, the frames are not declared in sequence. +// Second, the parts use different major than the frame-master. + + switch(frameElement) { + case QS60StylePrivate::SF_ToolTip: + if (QSysInfo::s60Version()!=QSysInfo::SV_S60_3_1) { + centerId.Set(EAknsMajorGeneric, 0x19c2); + frameId.Set(EAknsMajorSkin, 0x5300); + } else { + centerId.Set(KAknsIIDQsnFrPopupCenter); + frameId.iMinor = centerId.iMinor - 9; + } + break; + case QS60StylePrivate::SF_ToolBar: + if (QSysInfo::s60Version()==QSysInfo::SV_S60_3_1 || QSysInfo::s60Version()==QSysInfo::SV_S60_3_2) { + centerId.Set(KAknsIIDQsnFrPopupCenterSubmenu); + frameId.Set(KAknsIIDQsnFrPopupSub); + } + break; + case QS60StylePrivate::SF_PanelBackground: + // remove center piece for panel graphics, so that only border is drawn + centerId.Set(KAknsIIDNone); + frameId.Set(KAknsIIDQsnFrSetOpt); + break; + default: + // center should be correct here + frameId.iMinor = centerId.iMinor - 9; + break; + } +} + +TRect QS60StyleModeSpecifics::innerRectFromElement(QS60StylePrivate::SkinFrameElements frameElement, const TRect &outerRect) +{ + TInt widthShrink = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth); + TInt heightShrink = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerHeight); + switch(frameElement) { + case QS60StylePrivate::SF_PanelBackground: + // panel should have slightly slimmer border to enable thin line of background graphics between closest component + widthShrink = widthShrink-2; + heightShrink = heightShrink-2; + break; + case QS60StylePrivate::SF_ToolTip: + widthShrink = widthShrink>>1; + heightShrink = heightShrink>>1; + break; + default: + break; + } + TRect innerRect(outerRect); + innerRect.Shrink(widthShrink, heightShrink); + return innerRect; +} + +bool QS60StyleModeSpecifics::checkSupport(const int supportedRelease) +{ + const QSysInfo::S60Version currentRelease = QSysInfo::s60Version(); + return ( (currentRelease == QSysInfo::SV_S60_3_1 && supportedRelease & ES60_3_1) || + (currentRelease == QSysInfo::SV_S60_3_2 && supportedRelease & ES60_3_2) || + (currentRelease == QSysInfo::SV_S60_5_0 && supportedRelease & ES60_5_0)); +} + +TAknsItemID QS60StyleModeSpecifics::checkAndUpdateReleaseSpecificGraphics(int part) +{ + TAknsItemID newSkinId; + if (!checkSupport(m_partMap[(int)part].supportInfo)) + newSkinId.Set(m_partMap[(int)part].newMajorSkinId, m_partMap[(int)part].newMinorSkinId); + else + newSkinId.Set(m_partMap[(int)part].skinID); + return newSkinId; +} + +void QS60StyleModeSpecifics::checkAndUnCompressBitmap(CFbsBitmap*& aOriginalBitmap) +{ + TRAPD(error, checkAndUnCompressBitmapL(aOriginalBitmap)); + if (error) + aOriginalBitmap = NULL; +} + +void QS60StyleModeSpecifics::checkAndUnCompressBitmapL(CFbsBitmap*& aOriginalBitmap) +{ + if (aOriginalBitmap->IsCompressedInRAM()) { + const TSize iconSize(aOriginalBitmap->SizeInPixels().iWidth, + aOriginalBitmap->SizeInPixels().iHeight); + CFbsBitmap* uncompressedBitmap = new (ELeave) CFbsBitmap(); + CleanupStack::PushL(uncompressedBitmap); + User::LeaveIfError(uncompressedBitmap->Create(iconSize, + aOriginalBitmap->DisplayMode())); + unCompressBitmapL(iconSize, uncompressedBitmap, aOriginalBitmap); + CleanupStack::Pop(uncompressedBitmap); + User::LeaveIfError(aOriginalBitmap->Duplicate( + uncompressedBitmap->Handle())); + delete uncompressedBitmap; + } +} + +QFont QS60StylePrivate::s60Font_specific( + QS60StyleEnums::FontCategories fontCategory, int pointSize) +{ + enum TAknFontCategory aknFontCategory = EAknFontCategoryUndefined; + switch (fontCategory) { + case QS60StyleEnums::FC_Primary: + aknFontCategory = EAknFontCategoryPrimary; + break; + case QS60StyleEnums::FC_Secondary: + aknFontCategory = EAknFontCategorySecondary; + break; + case QS60StyleEnums::FC_Title: + aknFontCategory = EAknFontCategoryTitle; + break; + case QS60StyleEnums::FC_PrimarySmall: + aknFontCategory = EAknFontCategoryPrimarySmall; + break; + case QS60StyleEnums::FC_Digital: + aknFontCategory = EAknFontCategoryDigital; + break; + case QS60StyleEnums::FC_Undefined: + default: + break; + } + + // Create AVKON font according the given parameters + CWsScreenDevice* dev = CCoeEnv::Static()->ScreenDevice(); + TAknFontSpecification spec(aknFontCategory, TFontSpec(), NULL); + if (pointSize > 0) { + const TInt pixelSize = dev->VerticalTwipsToPixels(pointSize * KTwipsPerPoint); + spec.SetTextPaneHeight(pixelSize + 4); // TODO: Is 4 a reasonable top+bottom margin? + } + + QFont result; + TRAPD( error, { + const CAknLayoutFont* aknFont = + AknFontAccess::CreateLayoutFontFromSpecificationL(*dev, spec); + + result = qt_TFontSpec2QFontL(aknFont->DoFontSpecInTwips()); + if (result.pointSize() != pointSize) + result.setPointSize(pointSize); // Correct the font size returned by CreateLayoutFontFromSpecificationL() + + delete aknFont; + }); + if (error) result = QFont(); + return result; +} + +void QS60StylePrivate::setActiveLayout() +{ + const QSize activeScreenSize(screenSize()); + int activeLayoutIndex = -1; + const bool mirrored = !QApplication::isLeftToRight(); + const short screenHeight = (short)activeScreenSize.height(); + const short screenWidth = (short)activeScreenSize.width(); + for (int i=0; istandardPalette(); + + // For now, always generate new icon based on "selected". In the future possibly, expand + // this to consist other possibilities as well. + result = QApplication::style()->generatedIconPixmap(QIcon::Selected, result, &opt); + return result; + } +} + +QPixmap QS60StylePrivate::part(QS60StyleEnums::SkinParts part, + const QSize &size, SkinElementFlags flags) +{ + QS60WindowSurface::unlockBitmapHeap(); + QPixmap result = (flags & SF_ColorSkinned)? + QS60StyleModeSpecifics::colorSkinnedGraphics(part, size, flags) + : QS60StyleModeSpecifics::skinnedGraphics(part, size, flags); + QS60WindowSurface::lockBitmapHeap(); + + if (flags & SF_StateDisabled && !QS60StyleModeSpecifics::disabledPartGraphic(part)) { + // TODO: fix this + QStyleOption opt; +// opt.palette = q->standardPalette(); + result = QApplication::style()->generatedIconPixmap(QIcon::Disabled, result, &opt); + } + + if (!result) + result = QS60StyleModeSpecifics::generateMissingThemeGraphic(part, size, flags); + + return result; +} + +QPixmap QS60StylePrivate::frame(SkinFrameElements frame, const QSize &size, SkinElementFlags flags) +{ + QS60WindowSurface::unlockBitmapHeap(); + QPixmap result = QS60StyleModeSpecifics::skinnedGraphics(frame, size, flags); + QS60WindowSurface::lockBitmapHeap(); + + if (flags & SF_StateDisabled && !QS60StyleModeSpecifics::disabledFrameGraphic(frame)) { + // TODO: fix this + QStyleOption opt; +// opt.palette = q->standardPalette(); + result = QApplication::style()->generatedIconPixmap(QIcon::Disabled, result, &opt); + } + return result; +} + +QPixmap QS60StylePrivate::backgroundTexture() +{ + if (!m_background) { + QPixmap background = part(QS60StyleEnums::SP_QsnBgScreen, + QSize(S60->screenWidthInPixels, S60->screenHeightInPixels), SkinElementFlags()); + m_background = new QPixmap(background); + } + return *m_background; +} + +// If the public SDK returns compressed images, please let us also uncompress those! +void QS60StyleModeSpecifics::unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap* aTrgBitmap, CFbsBitmap* aSrcBitmap) +{ + if (!aSrcBitmap) + User::Leave(KErrArgument); + if (!aTrgBitmap) + User::Leave(KErrArgument); + + // Note! aSrcBitmap->IsCompressedInRAM() is always ETrue, since this method is called only if that applies! + ASSERT(aSrcBitmap->IsCompressedInRAM()); + + TDisplayMode displayMode = aSrcBitmap->DisplayMode(); + + if (displayMode != aTrgBitmap->DisplayMode()) + User::Leave(KErrArgument); + + TSize trgSize = aTrgBitmap->SizeInPixels(); + TSize srcSize = aSrcBitmap->SizeInPixels(); + + // calculate the valid drawing area + TRect drawRect = aTrgRect; + drawRect.Intersection(TRect(TPoint(0, 0), trgSize)); + + if (drawRect.IsEmpty()) + return; + + CFbsBitmap* realSource = new (ELeave) CFbsBitmap(); + CleanupStack::PushL(realSource); + User::LeaveIfError(realSource->Create(srcSize, displayMode)); + CFbsBitmapDevice* dev = CFbsBitmapDevice::NewL(realSource); + CleanupStack::PushL(dev); + CFbsBitGc* gc = NULL; + User::LeaveIfError(dev->CreateContext(gc)); + CleanupStack::PushL(gc); + gc->BitBlt(TPoint(0, 0), aSrcBitmap); + CleanupStack::PopAndDestroy(2); // dev, gc + + // Heap lock for FBServ large chunk is only needed with large bitmaps. + if (realSource->IsLargeBitmap() || aTrgBitmap->IsLargeBitmap()) { + aTrgBitmap->LockHeapLC(ETrue); // fbsheaplock + } else { + CleanupStack::PushL((TAny*) NULL); + } + + TUint32* srcAddress = realSource->DataAddress(); + TUint32* trgAddress = aTrgBitmap->DataAddress(); + + const TInt xSkip = (srcSize.iWidth << 8) / aTrgRect.Width(); + const TInt ySkip = (srcSize.iHeight << 8) / aTrgRect.Height(); + + const TInt drawWidth = drawRect.Width(); + const TInt drawHeight = drawRect.Height(); + + TRect offsetRect(aTrgRect.iTl, drawRect.iTl); + const TInt yPosOffset = ySkip * offsetRect.Height(); + const TInt xPosOffset = xSkip * offsetRect.Width(); + + if ((displayMode == EGray256) || (displayMode == EColor256)) { + TInt srcScanLen8 = CFbsBitmap::ScanLineLength(srcSize.iWidth, + displayMode); + TInt trgScanLen8 = CFbsBitmap::ScanLineLength(trgSize.iWidth, + displayMode); + + TUint8* trgAddress8 = reinterpret_cast (trgAddress); + + TInt yPos = yPosOffset; + // skip left and top margins in the beginning + trgAddress8 += trgScanLen8 * drawRect.iTl.iY + drawRect.iTl.iX; + + for (TInt y = 0; y < drawHeight; y++) { + TUint8* srcAddress8 = reinterpret_cast (srcAddress) + + (srcScanLen8 * (yPos >> 8)); + + TInt xPos = xPosOffset; + for (TInt x = 0; x < drawWidth; x++) { + *(trgAddress8++) = srcAddress8[xPos >> 8]; + xPos += xSkip; + } + + yPos += ySkip; + + trgAddress8 += trgScanLen8 - drawWidth; + } + } else if (displayMode == EColor4K || displayMode == EColor64K) { + TInt srcScanLen16 = CFbsBitmap::ScanLineLength(srcSize.iWidth, + displayMode) >>1; + TInt trgScanLen16 = CFbsBitmap::ScanLineLength(trgSize.iWidth, + displayMode) >>1; + + TUint16* trgAddress16 = reinterpret_cast (trgAddress); + + TInt yPos = yPosOffset; + // skip left and top margins in the beginning + trgAddress16 += trgScanLen16 * drawRect.iTl.iY + drawRect.iTl.iX; + + for (TInt y = 0; y < drawHeight; y++) { + TUint16* srcAddress16 = reinterpret_cast (srcAddress) + + (srcScanLen16 * (yPos >> 8)); + + TInt xPos = xPosOffset; + for (TInt x = 0; x < drawWidth; x++) { + *(trgAddress16++) = srcAddress16[xPos >> 8]; + xPos += xSkip; + } + + yPos += ySkip; + + trgAddress16 += trgScanLen16 - drawWidth; + } + } else if (displayMode == EColor16MU || displayMode == EColor16MA) { + TInt srcScanLen32 = CFbsBitmap::ScanLineLength(srcSize.iWidth, + displayMode) >>2; + TInt trgScanLen32 = CFbsBitmap::ScanLineLength(trgSize.iWidth, + displayMode) >>2; + + TUint32* trgAddress32 = reinterpret_cast (trgAddress); + + TInt yPos = yPosOffset; + // skip left and top margins in the beginning + trgAddress32 += trgScanLen32 * drawRect.iTl.iY + drawRect.iTl.iX; + + for (TInt y = 0; y < drawHeight; y++) { + TUint32* srcAddress32 = reinterpret_cast (srcAddress) + + (srcScanLen32 * (yPos >> 8)); + + TInt xPos = xPosOffset; + for (TInt x = 0; x < drawWidth; x++) { + *(trgAddress32++) = srcAddress32[xPos >> 8]; + xPos += xSkip; + } + + yPos += ySkip; + + trgAddress32 += trgScanLen32 - drawWidth; + } + } else { User::Leave(KErrUnknown);} + + CleanupStack::PopAndDestroy(2); // fbsheaplock, realSource +} + +QSize QS60StylePrivate::screenSize() +{ + TSize mySize = QS60Data::screenDevice()->SizeInPixels(); + return QSize(mySize.iWidth, mySize.iHeight); +} + +void QS60StyleModeSpecifics::colorGroupAndIndex( + QS60StyleEnums::SkinParts skinID, TAknsItemID &colorGroup, int colorIndex) +{ + switch(skinID) { + case QS60StyleEnums::SP_QgnIndiSubMenu: + colorGroup = KAknsIIDQsnIconColors; + colorIndex = EAknsCIQsnIconColorsCG1; + break; + case QS60StyleEnums::SP_QgnIndiRadiobuttOff: + case QS60StyleEnums::SP_QgnIndiRadiobuttOn: + case QS60StyleEnums::SP_QgnIndiCheckboxOff: + case QS60StyleEnums::SP_QgnIndiCheckboxOn: + colorGroup = KAknsIIDQsnIconColors; + colorIndex = EAknsCIQsnIconColorsCG14; + break; + default: + break; + } +} + +void QS60Style::handleDynamicLayoutVariantSwitch() +{ + Q_D(QS60Style); + d->clearCaches(QS60StylePrivate::CC_LayoutChange); + d->setActiveLayout(); + d->refreshUI(); + d->setBackgroundTexture(qApp); + foreach (QWidget *widget, QApplication::allWidgets()) + widget->ensurePolished(); +} + +void QS60Style::handleSkinChange() +{ + Q_D(QS60Style); + d->clearCaches(QS60StylePrivate::CC_ThemeChange); + d->setThemePalette(qApp); + foreach (QWidget *topLevelWidget, QApplication::allWidgets()){ + QEvent e(QEvent::StyleChange); + QApplication::sendEvent(topLevelWidget, &e); + d->setThemePalette(topLevelWidget); + topLevelWidget->ensurePolished(); + } +} + +QT_END_NAMESPACE + +#endif // QT_NO_STYLE_S60 || QT_PLUGIN diff --git a/src/gui/styles/qs60style_symbian.cpp b/src/gui/styles/qs60style_symbian.cpp deleted file mode 100644 index ddee4ba..0000000 --- a/src/gui/styles/qs60style_symbian.cpp +++ /dev/null @@ -1,1326 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the $MODULE$ of the Qt Toolkit. -** -** $TROLLTECH_DUAL_LICENSE$ -** -****************************************************************************/ - -#include "qs60style.h" -#include "qs60style_p.h" -#include "qpainter.h" -#include "qstyleoption.h" -#include "qstyle.h" -#include "private/qwindowsurface_s60_p.h" -#include "private/qt_s60_p.h" -#include "private/qcore_symbian_p.h" -#include "qapplication.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if !defined(QT_NO_STYLE_S60) || defined(QT_PLUGIN) - -QT_BEGIN_NAMESPACE - -enum TDrawType { - EDrawIcon, - EDrawBackground, - ENoDraw -}; - -enum TSupportRelease { - ES60_None = 0x0000, //indicates that the commonstyle should draw the graphics - ES60_3_1 = 0x0001, - ES60_3_2 = 0x0002, - ES60_5_0 = 0x0004, - // Add all new releases here - ES60_AllReleases = ES60_3_1 | ES60_3_2 | ES60_5_0 -}; - -typedef struct { - const TAknsItemID &skinID; - TDrawType drawType; - int supportInfo; - int newMajorSkinId; - int newMinorSkinId; -} partMapEntry; - -enum TFallbackMbmFile { - EAvkonMbm = 0, - ELastMbm -}; - -typedef struct { - const QS60StyleEnums::SkinParts partID; - TFallbackMbmFile fallbackFileID; //to avoid putting large char strings to table, lets only have a mapping value - int fallbackGraphicID; -} fallbackMapEntry; - -class QS60StyleModeSpecifics -{ -public: - static QPixmap skinnedGraphics(QS60StyleEnums::SkinParts stylepart, - const QSize &size, QS60StylePrivate::SkinElementFlags flags); - static QPixmap skinnedGraphics(QS60StylePrivate::SkinFrameElements frameElement, const QSize &size, QS60StylePrivate::SkinElementFlags flags); - static QPixmap colorSkinnedGraphics(const QS60StyleEnums::SkinParts &stylepart, - const QSize &size, QS60StylePrivate::SkinElementFlags flags); - static QColor colorValue(const TAknsItemID &colorGroup, int colorIndex); - static QPixmap fromFbsBitmap(CFbsBitmap *icon, CFbsBitmap *mask, QS60StylePrivate::SkinElementFlags flags, QImage::Format format); - static bool disabledPartGraphic(QS60StyleEnums::SkinParts &part); - static bool disabledFrameGraphic(QS60StylePrivate::SkinFrameElements &frame); - static QPixmap generateMissingThemeGraphic(QS60StyleEnums::SkinParts &part, const QSize &size, QS60StylePrivate::SkinElementFlags flags); - -private: - static QPixmap createSkinnedGraphicsL(QS60StyleEnums::SkinParts part, - const QSize &size, QS60StylePrivate::SkinElementFlags flags); - static QPixmap createSkinnedGraphicsL(QS60StylePrivate::SkinFrameElements frameElement, const QSize &size, QS60StylePrivate::SkinElementFlags flags); - static QPixmap colorSkinnedGraphicsL(const QS60StyleEnums::SkinParts &stylepart, - const QSize &size, QS60StylePrivate::SkinElementFlags flags); - static void frameIdAndCenterId(QS60StylePrivate::SkinFrameElements frameElement, TAknsItemID &frameId, TAknsItemID ¢erId); - static TRect innerRectFromElement(QS60StylePrivate::SkinFrameElements frameElement, const TRect &outerRect); - static void checkAndUnCompressBitmapL(CFbsBitmap*& aOriginalBitmap); - static void checkAndUnCompressBitmap(CFbsBitmap*& aOriginalBitmap); - static void unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap* aTrgBitmap, CFbsBitmap* aSrcBitmap); - static void colorGroupAndIndex(QS60StyleEnums::SkinParts skinID, - TAknsItemID &colorGroup, int colorIndex); - static void fallbackInfo(const QS60StyleEnums::SkinParts &stylepart, TDes& fallbackFileName, TInt& fallbackIndex); - static bool checkSupport(const int supportedRelease); - static TAknsItemID checkAndUpdateReleaseSpecificGraphics(int part); - // Array to match the skin ID, fallback graphics and Qt widget graphics. - static const partMapEntry m_partMap[]; -}; - -const partMapEntry QS60StyleModeSpecifics::m_partMap[] = { - /* SP_QgnGrafBarWait */ {KAknsIIDQgnGrafBarWaitAnim, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafBarFrameCenter */ {KAknsIIDQgnGrafBarFrameCenter, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafBarFrameSideL */ {KAknsIIDQgnGrafBarFrameSideL, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafBarFrameSideR */ {KAknsIIDQgnGrafBarFrameSideR, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafBarProgress */ {KAknsIIDQgnGrafBarProgress, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafScrollArrowDown */ {KAknsIIDQgnGrafScrollArrowDown, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafScrollArrowLeft */ {KAknsIIDQgnGrafScrollArrowLeft, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafScrollArrowRight */ {KAknsIIDQgnGrafScrollArrowRight, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafScrollArrowUp */ {KAknsIIDQgnGrafScrollArrowUp, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafTabActiveL */ {KAknsIIDQgnGrafTabActiveL, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafTabActiveM */ {KAknsIIDQgnGrafTabActiveM, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafTabActiveR */ {KAknsIIDQgnGrafTabActiveR, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafTabPassiveL */ {KAknsIIDQgnGrafTabPassiveL, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafTabPassiveM */ {KAknsIIDQgnGrafTabPassiveM, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafTabPassiveR */ {KAknsIIDQgnGrafTabPassiveR, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnIndiCheckboxOff */ {KAknsIIDQgnIndiCheckboxOff, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnIndiCheckboxOn */ {KAknsIIDQgnIndiCheckboxOn, EDrawIcon, ES60_AllReleases, -1,-1}, - // Following 5 items (SP_QgnIndiHlColSuper - SP_QgnIndiHlLineStraight) are available starting from S60 release 3.2. - // In 3.1 CommonStyle drawing is used for these QTreeView elements, since no similar icons in AVKON UI. - /* SP_QgnIndiHlColSuper */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d5 /* KAknsIIDQgnIndiHlColSuper */}, - /* SP_QgnIndiHlExpSuper */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d6 /* KAknsIIDQgnIndiHlExpSuper */}, - /* SP_QgnIndiHlLineBranch */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d7 /* KAknsIIDQgnIndiHlLineBranch */}, - /* SP_QgnIndiHlLineEnd */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d8 /* KAknsIIDQgnIndiHlLineEnd */}, - /* SP_QgnIndiHlLineStraight */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d9 /* KAknsIIDQgnIndiHlLineStraight */}, - /* SP_QgnIndiMarkedAdd */ {KAknsIIDQgnIndiMarkedAdd, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnIndiNaviArrowLeft */ {KAknsIIDQgnGrafScrollArrowLeft, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnIndiNaviArrowRight */ {KAknsIIDQgnGrafScrollArrowRight, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnIndiRadiobuttOff */ {KAknsIIDQgnIndiRadiobuttOff, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnIndiRadiobuttOn */ {KAknsIIDQgnIndiRadiobuttOn, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnIndiSliderEdit */ {KAknsIIDQgnIndiSliderEdit, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnIndiSubMenu */ {KAknsIIDQgnIndiSubmenu, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnNoteErased */ {KAknsIIDQgnNoteErased, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnNoteError */ {KAknsIIDQgnNoteError, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnNoteInfo */ {KAknsIIDQgnNoteInfo, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnNoteOk */ {KAknsIIDQgnNoteOk, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnNoteQuery */ {KAknsIIDQgnNoteQuery, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnNoteWarning */ {KAknsIIDQgnNoteWarning, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnPropFileSmall */ {KAknsIIDQgnPropFileSmall, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnPropFolderCurrent */ {KAknsIIDQgnPropFolderCurrent, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnPropFolderSmall */ {KAknsIIDQgnPropFolderSmall, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnPropFolderSmallNew */ {KAknsIIDQgnPropFolderSmallNew, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnPropPhoneMemcLarge */ {KAknsIIDQgnPropPhoneMemcLarge, EDrawIcon, ES60_AllReleases, -1,-1}, - - // 3.1 & 3.2 do not have pressed state for scrollbar, so use normal scrollbar graphics instead. - /* SP_QsnCpScrollHandleBottomPressed*/ {KAknsIIDQsnCpScrollHandleBottom, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorGeneric, 0x20f8}, /*KAknsIIDQsnCpScrollHandleBottomPressed*/ - /* SP_QsnCpScrollHandleMiddlePressed*/ {KAknsIIDQsnCpScrollHandleMiddle, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorGeneric, 0x20f9}, /*KAknsIIDQsnCpScrollHandleMiddlePressed*/ - /* SP_QsnCpScrollHandleTopPressed*/ {KAknsIIDQsnCpScrollHandleTop, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorGeneric, 0x20fa}, /*KAknsIIDQsnCpScrollHandleTopPressed*/ - - /* SP_QsnBgScreen */ {KAknsIIDQsnBgScreen, EDrawBackground, ES60_AllReleases, -1,-1}, - - /* SP_QsnCpScrollBgBottom */ {KAknsIIDQsnCpScrollBgBottom, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QsnCpScrollBgMiddle */ {KAknsIIDQsnCpScrollBgMiddle, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QsnCpScrollBgTop */ {KAknsIIDQsnCpScrollBgTop, EDrawIcon, ES60_AllReleases, -1,-1}, - - /* SP_QsnCpScrollHandleBottom */ {KAknsIIDQsnCpScrollHandleBottom, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QsnCpScrollHandleMiddle */ {KAknsIIDQsnCpScrollHandleMiddle, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QsnCpScrollHandleTop */ {KAknsIIDQsnCpScrollHandleTop, EDrawIcon, ES60_AllReleases, -1,-1}, - - /* SP_QsnFrButtonTbCornerTl */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, //todo: use "normal button" from 5.0 onwards - /* SP_QsnFrButtonTbCornerTr */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbCornerBl */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbCornerBr */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbSideT */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbSideB */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbSideL */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbSideR */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbCenter */ {KAknsIIDQsnFrButtonTbCenter, EDrawIcon, ES60_AllReleases, -1,-1}, - - /* SP_QsnFrButtonTbCornerTlPressed */{KAknsIIDQsnFrButtonTbCornerTlPressed, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbCornerTrPressed */{KAknsIIDQsnFrButtonTbCornerTrPressed, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbCornerBlPressed */{KAknsIIDQsnFrButtonTbCornerBlPressed, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbCornerBrPressed */{KAknsIIDQsnFrButtonTbCornerBrPressed, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbSideTPressed */ {KAknsIIDQsnFrButtonTbSideTPressed, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbSideBPressed */ {KAknsIIDQsnFrButtonTbSideBPressed, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbSideLPressed */ {KAknsIIDQsnFrButtonTbSideLPressed, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbSideRPressed */ {KAknsIIDQsnFrButtonTbSideRPressed, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbCenterPressed */ {KAknsIIDQsnFrButtonTbCenterPressed, EDrawIcon, ES60_AllReleases, -1,-1}, - - /* SP_QsnFrCaleCornerTl */ {KAknsIIDQsnFrCaleCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleCornerTr */ {KAknsIIDQsnFrCaleCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleCornerBl */ {KAknsIIDQsnFrCaleCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleCornerBr */ {KAknsIIDQsnFrCaleCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleGSideT */ {KAknsIIDQsnFrCaleSideT, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleGSideB */ {KAknsIIDQsnFrCaleSideB, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleGSideL */ {KAknsIIDQsnFrCaleSideL, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleGSideR */ {KAknsIIDQsnFrCaleSideR, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleCenter */ {KAknsIIDQsnFrCaleCenter, ENoDraw, ES60_AllReleases, -1,-1}, - - /* SP_QsnFrCaleHeadingCornerTl */ {KAknsIIDQsnFrCaleHeadingCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleHeadingCornerTr */ {KAknsIIDQsnFrCaleHeadingCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleHeadingCornerBl */ {KAknsIIDQsnFrCaleHeadingCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleHeadingCornerBr */ {KAknsIIDQsnFrCaleHeadingCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleHeadingSideT */ {KAknsIIDQsnFrCaleHeadingSideT, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleHeadingSideB */ {KAknsIIDQsnFrCaleHeadingSideB, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleHeadingSideL */ {KAknsIIDQsnFrCaleHeadingSideL, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleHeadingSideR */ {KAknsIIDQsnFrCaleHeadingSideR, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleHeadingCenter */ {KAknsIIDQsnFrCaleHeadingCenter, ENoDraw, ES60_AllReleases, -1,-1}, - - /* SP_QsnFrInputCornerTl */ {KAknsIIDQsnFrInputCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrInputCornerTr */ {KAknsIIDQsnFrInputCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrInputCornerBl */ {KAknsIIDQsnFrInputCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrInputCornerBr */ {KAknsIIDQsnFrInputCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrInputSideT */ {KAknsIIDQsnFrInputSideT, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrInputSideB */ {KAknsIIDQsnFrInputSideB, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrInputSideL */ {KAknsIIDQsnFrInputSideL, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrInputSideR */ {KAknsIIDQsnFrInputSideR, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrInputCenter */ {KAknsIIDQsnFrInputCenter, ENoDraw, ES60_AllReleases, -1,-1}, - - /* SP_QsnFrListCornerTl */ {KAknsIIDQsnFrListCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrListCornerTr */ {KAknsIIDQsnFrListCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrListCornerBl */ {KAknsIIDQsnFrListCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrListCornerBr */ {KAknsIIDQsnFrListCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrListSideT */ {KAknsIIDQsnFrListSideT, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrListSideB */ {KAknsIIDQsnFrListSideB, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrListSideL */ {KAknsIIDQsnFrListSideL, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrListSideR */ {KAknsIIDQsnFrListSideR, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrListCenter */ {KAknsIIDQsnFrListCenter, ENoDraw, ES60_AllReleases, -1,-1}, - - /* SP_QsnFrPopupCornerTl */ {KAknsIIDQsnFrPopupCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrPopupCornerTr */ {KAknsIIDQsnFrPopupCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrPopupCornerBl */ {KAknsIIDQsnFrPopupCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrPopupCornerBr */ {KAknsIIDQsnFrPopupCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrPopupSideT */ {KAknsIIDQsnFrPopupSideT, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrPopupSideB */ {KAknsIIDQsnFrPopupSideB, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrPopupSideL */ {KAknsIIDQsnFrPopupSideL, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrPopupSideR */ {KAknsIIDQsnFrPopupSideR, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrPopupCenter */ {KAknsIIDQsnFrPopupCenter, ENoDraw, ES60_AllReleases, -1,-1}, - - // ToolTip graphics different in 3.1 vs. 3.2+. - /* SP_QsnFrPopupPreviewCornerTl */ {KAknsIIDQsnFrPopupCornerTl, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c5}, /* KAknsIIDQsnFrPopupPreviewCornerTl */ - /* SP_QsnFrPopupPreviewCornerTr */ {KAknsIIDQsnFrPopupCornerTr, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c6}, - /* SP_QsnFrPopupPreviewCornerBl */ {KAknsIIDQsnFrPopupCornerBl, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c3}, - /* SP_QsnFrPopupPreviewCornerBr */ {KAknsIIDQsnFrPopupCornerBr, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c4}, - /* SP_QsnFrPopupPreviewSideT */ {KAknsIIDQsnFrPopupSideT, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19ca}, - /* SP_QsnFrPopupPreviewSideB */ {KAknsIIDQsnFrPopupSideB, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c7}, - /* SP_QsnFrPopupPreviewSideL */ {KAknsIIDQsnFrPopupSideL, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c8}, - /* SP_QsnFrPopupPreviewSideR */ {KAknsIIDQsnFrPopupSideR, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c9}, - /* SP_QsnFrPopupPreviewCenter */ {KAknsIIDQsnFrPopupCenter, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c2}, - - /* SP_QsnFrSetOptCornerTl */ {KAknsIIDQsnFrSetOptCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrSetOptCornerTr */ {KAknsIIDQsnFrSetOptCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrSetOptCornerBl */ {KAknsIIDQsnFrSetOptCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrSetOptCornerBr */ {KAknsIIDQsnFrSetOptCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrSetOptSideT */ {KAknsIIDQsnFrSetOptSideT, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrSetOptSideB */ {KAknsIIDQsnFrSetOptSideB, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrSetOptSideL */ {KAknsIIDQsnFrSetOptSideL, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrSetOptSideR */ {KAknsIIDQsnFrSetOptSideR, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrSetOptCenter */ {KAknsIIDQsnFrSetOptCenter, ENoDraw, ES60_AllReleases, -1,-1}, - - // No toolbar frame for 5.0+ releases. - /* SP_QsnFrPopupSubCornerTl */ {KAknsIIDQsnFrPopupSubCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, - /* SP_QsnFrPopupSubCornerTr */ {KAknsIIDQsnFrPopupSubCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, - /* SP_QsnFrPopupSubCornerBl */ {KAknsIIDQsnFrPopupSubCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, - /* SP_QsnFrPopupSubCornerBr */ {KAknsIIDQsnFrPopupSubCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, - /* SP_QsnFrPopupSubSideT */ {KAknsIIDQsnFrPopupSubSideT, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, - /* SP_QsnFrPopupSubSideB */ {KAknsIIDQsnFrPopupSubSideB, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, - /* SP_QsnFrPopupSubSideL */ {KAknsIIDQsnFrPopupSubSideL, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, - /* SP_QsnFrPopupSubSideR */ {KAknsIIDQsnFrPopupSubSideR, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, - /* SP_QsnFrPopupSubCenter */ {KAknsIIDQsnFrPopupCenterSubmenu, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, - - // Toolbar graphics is different in 3.1/3.2 vs. 5.0 - /* SP_QsnFrSctrlButtonCornerTl */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2301}, /* KAknsIIDQgnFrSctrlButtonCornerTl*/ - /* SP_QsnFrSctrlButtonCornerTr */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2302}, - /* SP_QsnFrSctrlButtonCornerBl */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2303}, - /* SP_QsnFrSctrlButtonCornerBr */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2304}, - /* SP_QsnFrSctrlButtonSideT */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2305}, - /* SP_QsnFrSctrlButtonSideB */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2306}, - /* SP_QsnFrSctrlButtonSideL */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2307}, - /* SP_QsnFrSctrlButtonSideR */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2308}, - /* SP_QsnFrSctrlButtonCenter */ {KAknsIIDQsnFrButtonTbCenter, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2309}, /*KAknsIIDQgnFrSctrlButtonCenter*/ - - // No pressed state for toolbar button in 3.1/3.2. - /* SP_QsnFrSctrlButtonCornerTlPressed */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2621}, /*KAknsIIDQsnFrSctrlButtonCornerTlPressed*/ - /* SP_QsnFrSctrlButtonCornerTrPressed */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2622}, - /* SP_QsnFrSctrlButtonCornerBlPressed */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2623}, - /* SP_QsnFrSctrlButtonCornerBrPressed */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2624}, - /* SP_QsnFrSctrlButtonSideTPressed */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2625}, - /* SP_QsnFrSctrlButtonSideBPressed */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2626}, - /* SP_QsnFrSctrlButtonSideLPressed */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2627}, - /* SP_QsnFrSctrlButtonSideRPressed */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2628}, - /* SP_QsnFrSctrlButtonCenterPressed */ {KAknsIIDQsnFrButtonTbCenter, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2629}, - - // No inactive button graphics in 3.1/3.2 - /* SP_QsnFrButtonCornerTlInactive */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b1}, /*KAknsIIDQsnFrButtonCornerTlInactive*/ - /* SP_QsnFrButtonCornerTrInactive */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b2}, - /* SP_QsnFrButtonCornerBlInactive */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b3}, - /* SP_QsnFrButtonCornerTrInactive */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b4}, - /* SP_QsnFrButtonSideTInactive */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b5}, - /* SP_QsnFrButtonSideBInactive */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b6}, - /* SP_QsnFrButtonSideLInactive */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b7}, - /* SP_QsnFrButtonSideRInactive */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b8}, - /* SP_QsnFrButtonCenterInactive */ {KAknsIIDQsnFrButtonTbCenter, EDrawIcon,ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b9} - -}; - -QPixmap QS60StyleModeSpecifics::skinnedGraphics( - QS60StyleEnums::SkinParts stylepart, const QSize &size, - QS60StylePrivate::SkinElementFlags flags) -{ - QPixmap themedImage; - TRAPD( error, { - const QPixmap skinnedImage = createSkinnedGraphicsL(stylepart, size, flags); - themedImage = skinnedImage; - }); - if (error) - return themedImage = QPixmap(); - return themedImage; -} - -QPixmap QS60StyleModeSpecifics::skinnedGraphics( - QS60StylePrivate::SkinFrameElements frame, const QSize &size, QS60StylePrivate::SkinElementFlags flags) -{ - QPixmap themedImage; - TRAPD( error, { - const QPixmap skinnedImage = createSkinnedGraphicsL(frame, size, flags); - themedImage = skinnedImage; - }); - if (error) - return themedImage = QPixmap(); - return themedImage; -} - -QPixmap QS60StyleModeSpecifics::colorSkinnedGraphics( - const QS60StyleEnums::SkinParts &stylepart, - const QSize &size, QS60StylePrivate::SkinElementFlags flags) -{ - QPixmap colorGraphics; - TRAPD(error, colorGraphics = colorSkinnedGraphicsL(stylepart, size, flags)); - return error ? QPixmap() : colorGraphics; -} - -void QS60StyleModeSpecifics::fallbackInfo(const QS60StyleEnums::SkinParts &stylepart, TDes& fallbackFileName, TInt& fallbackIndex) -{ - switch(stylepart) { - case QS60StyleEnums::SP_QgnGrafBarWait: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_graf_bar_wait_1; - break; - case QS60StyleEnums::SP_QgnGrafBarFrameCenter: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_graf_bar_frame_center; - break; - case QS60StyleEnums::SP_QgnGrafBarFrameSideL: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_graf_bar_frame_side_l; - break; - case QS60StyleEnums::SP_QgnGrafBarFrameSideR: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_graf_bar_frame_side_r; - break; - case QS60StyleEnums::SP_QgnGrafBarProgress: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_graf_bar_progress; - break; - case QS60StyleEnums::SP_QgnGrafTabActiveL: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_graf_tab_active_l; - break; - case QS60StyleEnums::SP_QgnGrafTabActiveM: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_graf_tab_active_m; - break; - case QS60StyleEnums::SP_QgnGrafTabActiveR: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_graf_tab_active_r; - break; - case QS60StyleEnums::SP_QgnGrafTabPassiveL: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_graf_tab_passive_l; - break; - case QS60StyleEnums::SP_QgnGrafTabPassiveM: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_graf_tab_passive_m; - break; - case QS60StyleEnums::SP_QgnGrafTabPassiveR: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_graf_tab_passive_r; - break; - case QS60StyleEnums::SP_QgnIndiCheckboxOff: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_indi_checkbox_off; - break; - case QS60StyleEnums::SP_QgnIndiCheckboxOn: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_indi_checkbox_on; - break; - case QS60StyleEnums::SP_QgnIndiHlColSuper: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = 0x4456; /* EMbmAvkonQgn_indi_hl_col_super */ - break; - case QS60StyleEnums::SP_QgnIndiHlExpSuper: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = 0x4458; /* EMbmAvkonQgn_indi_hl_exp_super */ - break; - case QS60StyleEnums::SP_QgnIndiHlLineBranch: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = 0x445A; /* EMbmAvkonQgn_indi_hl_line_branch */ - break; - case QS60StyleEnums::SP_QgnIndiHlLineEnd: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = 0x445C; /* EMbmAvkonQgn_indi_hl_line_end */ - break; - case QS60StyleEnums::SP_QgnIndiHlLineStraight: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = 0x445E; /* EMbmAvkonQgn_indi_hl_line_straight */ - break; - case QS60StyleEnums::SP_QgnIndiMarkedAdd: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_indi_marked_add; - break; - case QS60StyleEnums::SP_QgnIndiNaviArrowLeft: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_indi_navi_arrow_left; - break; - case QS60StyleEnums::SP_QgnIndiNaviArrowRight: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_indi_navi_arrow_right; - break; - case QS60StyleEnums::SP_QgnIndiRadiobuttOff: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_indi_radiobutt_off; - break; - case QS60StyleEnums::SP_QgnIndiRadiobuttOn: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_indi_radiobutt_on; - break; - case QS60StyleEnums::SP_QgnIndiSliderEdit: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_indi_slider_edit; - break; - case QS60StyleEnums::SP_QgnIndiSubMenu: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_indi_submenu; - break; - case QS60StyleEnums::SP_QgnNoteErased: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_note_erased; - break; - case QS60StyleEnums::SP_QgnNoteError: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_note_error; - break; - case QS60StyleEnums::SP_QgnNoteInfo: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_note_info; - break; - case QS60StyleEnums::SP_QgnNoteOk: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_note_ok; - break; - case QS60StyleEnums::SP_QgnNoteQuery: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_note_query; - break; - case QS60StyleEnums::SP_QgnNoteWarning: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_note_warning; - break; - case QS60StyleEnums::SP_QgnPropFileSmall: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_prop_file_small; - break; - case QS60StyleEnums::SP_QgnPropFolderCurrent: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_prop_folder_current; - break; - case QS60StyleEnums::SP_QgnPropFolderSmall: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_prop_folder_small; - break; - case QS60StyleEnums::SP_QgnPropFolderSmallNew: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_prop_folder_small_new; - break; - case QS60StyleEnums::SP_QgnPropPhoneMemcLarge: - fallbackFileName = KAvkonBitmapFile(); - fallbackIndex = EMbmAvkonQgn_prop_phone_memc_large; - break; - default: - fallbackFileName = KNullDesC(); - fallbackIndex = -1; - break; - } -} - -QPixmap QS60StyleModeSpecifics::colorSkinnedGraphicsL( - const QS60StyleEnums::SkinParts &stylepart, - const QSize &size, QS60StylePrivate::SkinElementFlags flags) -{ - const int stylepartIndex = (int)stylepart; - const TAknsItemID skinId = m_partMap[stylepartIndex].skinID; - - TInt fallbackGraphicID = -1; - HBufC* iconFile = HBufC::NewLC( KMaxFileName ); - TPtr fileNamePtr = iconFile->Des(); - fallbackInfo(stylepart, fileNamePtr, fallbackGraphicID); - - TAknsItemID colorGroup = KAknsIIDQsnIconColors; - int colorIndex = 0; - colorGroupAndIndex(stylepart, colorGroup, colorIndex); - - const bool rotatedBy90or270 = - (flags & (QS60StylePrivate::SF_PointEast | QS60StylePrivate::SF_PointWest)); - const TSize targetSize = - rotatedBy90or270?TSize(size.height(), size.width()):TSize(size.width(), size.height()); - CFbsBitmap *icon = 0; - CFbsBitmap *iconMask = 0; - const TInt fallbackGraphicsMaskID = - fallbackGraphicID == KErrNotFound?KErrNotFound:fallbackGraphicID+1; //masks are auto-generated as next in mif files - MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); - AknsUtils::CreateColorIconLC( - skinInstance, skinId, colorGroup, colorIndex, icon, iconMask, fileNamePtr, fallbackGraphicID , fallbackGraphicsMaskID, KRgbBlack); - User::LeaveIfError(AknIconUtils::SetSize(icon, targetSize, EAspectRatioNotPreserved)); - User::LeaveIfError(AknIconUtils::SetSize(iconMask, targetSize, EAspectRatioNotPreserved)); - QPixmap result = fromFbsBitmap(icon, iconMask, flags, qt_TDisplayMode2Format(icon->DisplayMode())); - CleanupStack::PopAndDestroy(3); //icon, iconMask, iconFile - return result; -} - -QColor QS60StyleModeSpecifics::colorValue(const TAknsItemID &colorGroup, int colorIndex) -{ - TRgb skinnedColor; - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - AknsUtils::GetCachedColor(skin, skinnedColor, colorGroup, colorIndex); - return QColor(skinnedColor.Red(),skinnedColor.Green(),skinnedColor.Blue()); -} - -QPixmap QS60StyleModeSpecifics::fromFbsBitmap(CFbsBitmap *icon, CFbsBitmap *mask, QS60StylePrivate::SkinElementFlags flags, QImage::Format format) -{ - Q_ASSERT(icon); - const TSize iconSize = icon->SizeInPixels(); - const int iconBytesPerLine = CFbsBitmap::ScanLineLength(iconSize.iWidth, icon->DisplayMode()); - const int iconBytesCount = iconBytesPerLine * iconSize.iHeight; - - QImage iconImage(qt_TSize2QSize(iconSize), format); - if (iconImage.isNull()) - return QPixmap(); - - checkAndUnCompressBitmap(icon); - if (!icon) //checkAndUnCompressBitmap might set icon to NULL - return QPixmap(); - - icon->LockHeap(); - const uchar *const iconBytes = (uchar*)icon->DataAddress(); - // The icon data needs to be copied, since the color format will be - // automatically converted to Format_ARGB32 when setAlphaChannel is called. - memcpy(iconImage.bits(), iconBytes, iconBytesCount); - icon->UnlockHeap(); - if (mask) { - checkAndUnCompressBitmap(mask); - if (mask) { //checkAndUnCompressBitmap might set mask to NULL - const TSize maskSize = icon->SizeInPixels(); - const int maskBytesPerLine = CFbsBitmap::ScanLineLength(maskSize.iWidth, mask->DisplayMode()); - mask->LockHeap(); - const uchar *const maskBytes = (uchar *)mask->DataAddress(); - // Since no other bitmap should be locked, we can just "borrow" the mask data for setAlphaChannel - const QImage maskImage(maskBytes, maskSize.iWidth, maskSize.iHeight, maskBytesPerLine, QImage::Format_Indexed8); - if (!maskImage.isNull()) - iconImage.setAlphaChannel(maskImage); - mask->UnlockHeap(); - } - } - - QTransform imageTransform; - if (flags & QS60StylePrivate::SF_PointEast) { - imageTransform.rotate(90); - } else if (flags & QS60StylePrivate::SF_PointSouth) { - imageTransform.rotate(180); - iconImage = iconImage.transformed(imageTransform); - } else if (flags & QS60StylePrivate::SF_PointWest) { - imageTransform.rotate(270); - } - if (imageTransform.isRotating()) - iconImage = iconImage.transformed(imageTransform); - - return QPixmap::fromImage(iconImage); -} - -bool QS60StylePrivate::isTouchSupported() -{ - return bool(AknLayoutUtils::PenEnabled()); -} - -bool QS60StylePrivate::isToolBarBackground() -{ - return (QSysInfo::s60Version() == QSysInfo::SV_S60_3_1 || QSysInfo::s60Version() == QSysInfo::SV_S60_3_2); -} - -QPoint qt_s60_fill_background_offset(const QWidget *targetWidget) -{ - CCoeControl *control = targetWidget->effectiveWinId(); - TPoint globalPos = control ? control->PositionRelativeToScreen() : TPoint(0,0); - return QPoint(globalPos.iX, globalPos.iY); -} - -QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL( - QS60StyleEnums::SkinParts part, - const QSize &size, QS60StylePrivate::SkinElementFlags flags) -{ - if (!size.isValid()) - return QPixmap(); - - // Check release support and change part, if necessary. - const TAknsItemID skinId = checkAndUpdateReleaseSpecificGraphics((int)part); - const int stylepartIndex = (int)part; - const TDrawType drawType = m_partMap[stylepartIndex].drawType; - Q_ASSERT(drawType != ENoDraw); - const bool rotatedBy90or270 = - (flags & (QS60StylePrivate::SF_PointEast | QS60StylePrivate::SF_PointWest)); - TSize targetSize = - rotatedBy90or270 ? TSize(size.height(), size.width()) : qt_QSize2TSize(size); - - MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); - - QPixmap result; - - switch (drawType) { - case EDrawIcon: - { - TInt fallbackGraphicID = -1; - HBufC* iconFile = HBufC::NewLC( KMaxFileName ); - TPtr fileNamePtr = iconFile->Des(); - fallbackInfo(part, fileNamePtr, fallbackGraphicID); - // todo: could we instead use AknIconUtils::AvkonIconFileName(); to avoid allocating each time? - - CFbsBitmap *icon = 0; - CFbsBitmap *iconMask = 0; - const TInt fallbackGraphicsMaskID = - fallbackGraphicID == KErrNotFound?KErrNotFound:fallbackGraphicID+1; //masks are auto-generated as next in mif files -// QS60WindowSurface::unlockBitmapHeap(); - AknsUtils::CreateIconLC(skinInstance, skinId, icon, iconMask, fileNamePtr, fallbackGraphicID , fallbackGraphicsMaskID); - User::LeaveIfError(AknIconUtils::SetSize(icon, targetSize, EAspectRatioNotPreserved)); - User::LeaveIfError(AknIconUtils::SetSize(iconMask, targetSize, EAspectRatioNotPreserved)); - result = fromFbsBitmap(icon, iconMask, flags, qt_TDisplayMode2Format(icon->DisplayMode())); - CleanupStack::PopAndDestroy(3); // iconMask, icon, iconFile -// QS60WindowSurface::lockBitmapHeap(); - break; - } - case EDrawBackground: - { -// QS60WindowSurface::unlockBitmapHeap(); - CFbsBitmap *background = new (ELeave) CFbsBitmap(); //offscreen - CleanupStack::PushL(background); - User::LeaveIfError(background->Create(targetSize, EColor16MA)); - - CFbsBitmapDevice* dev = CFbsBitmapDevice::NewL(background); - CleanupStack::PushL(dev); - CFbsBitGc* gc = NULL; - User::LeaveIfError(dev->CreateContext(gc)); - CleanupStack::PushL(gc); - - CAknsBasicBackgroundControlContext* bgContext = CAknsBasicBackgroundControlContext::NewL( - skinId, - targetSize, - EFalse); - CleanupStack::PushL(bgContext); - - const TBool drawn = AknsDrawUtils::DrawBackground( - skinInstance, - bgContext, - NULL, - *gc, - TPoint(), - targetSize, - KAknsDrawParamDefault | KAknsDrawParamRGBOnly); - - if (drawn) - result = fromFbsBitmap(background, NULL, flags, QImage::Format_RGB32); - - CleanupStack::PopAndDestroy(4, background); //background, dev, gc, bgContext -// QS60WindowSurface::lockBitmapHeap(); - break; - } - } - - return result; // TODO: Let fromFbsBitmap return a QPixmap -} - -QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL(QS60StylePrivate::SkinFrameElements frameElement, - const QSize &size, QS60StylePrivate::SkinElementFlags flags) -{ - if (!size.isValid()) - return QPixmap(); - - const bool rotatedBy90or270 = - (flags & (QS60StylePrivate::SF_PointEast | QS60StylePrivate::SF_PointWest)); - TSize targetSize = - rotatedBy90or270 ? TSize(size.height(), size.width()) : qt_QSize2TSize(size); - - MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); - - QPixmap result; - -// QS60WindowSurface::unlockBitmapHeap(); - static const bool canDoEColor16MAP = !(QSysInfo::s60Version() == QSysInfo::SV_S60_3_1 || QSysInfo::s60Version() == QSysInfo::SV_S60_3_2); - static const TDisplayMode displayMode = canDoEColor16MAP ? TDisplayMode(13) : EColor16MA; // 13 = EColor16MAP - static const TInt drawParam = canDoEColor16MAP ? KAknsDrawParamDefault : KAknsDrawParamNoClearUnderImage|KAknsDrawParamRGBOnly; - - CFbsBitmap *frame = new (ELeave) CFbsBitmap(); //offscreen - CleanupStack::PushL(frame); - User::LeaveIfError(frame->Create(targetSize, displayMode)); - - CFbsBitmapDevice* bitmapDev = CFbsBitmapDevice::NewL(frame); - CleanupStack::PushL(bitmapDev); - CFbsBitGc* bitmapGc = NULL; - User::LeaveIfError(bitmapDev->CreateContext(bitmapGc)); - CleanupStack::PushL(bitmapGc); - - frame->LockHeap(); - memset(frame->DataAddress(), 0, frame->SizeInPixels().iWidth * frame->SizeInPixels().iHeight * 4); // 4: argb bytes - frame->UnlockHeap(); - - const TRect outerRect(TPoint(0, 0), targetSize); - const TRect innerRect = innerRectFromElement(frameElement, outerRect); - - TAknsItemID frameSkinID, centerSkinID; - frameSkinID = centerSkinID = checkAndUpdateReleaseSpecificGraphics(QS60StylePrivate::m_frameElementsData[frameElement].center); - frameIdAndCenterId(frameElement, frameSkinID, centerSkinID); - const TBool drawn = AknsDrawUtils::DrawFrame( skinInstance, - *bitmapGc, outerRect, innerRect, - frameSkinID, centerSkinID, - drawParam ); - - if (canDoEColor16MAP) { - if (drawn) - result = fromFbsBitmap(frame, NULL, flags, QImage::Format_ARGB32_Premultiplied); - } else { - TDisplayMode maskDepth = EGray2; - // Query the skin item for possible frame graphics mask details. - if (skinInstance) { - CAknsMaskedBitmapItemData* skinMaskedBmp = static_cast( - skinInstance->GetCachedItemData(frameSkinID,EAknsITMaskedBitmap)); - if (skinMaskedBmp && skinMaskedBmp->Mask()) - maskDepth = skinMaskedBmp->Mask()->DisplayMode(); - } - if (maskDepth != ENone) { - CFbsBitmap *frameMask = new (ELeave) CFbsBitmap(); //offscreen - CleanupStack::PushL(frameMask); - User::LeaveIfError(frameMask->Create(targetSize, maskDepth)); - - CFbsBitmapDevice* maskBitmapDevice = CFbsBitmapDevice::NewL(frameMask); - CleanupStack::PushL(maskBitmapDevice); - CFbsBitGc* maskBitGc = NULL; - User::LeaveIfError(maskBitmapDevice->CreateContext(maskBitGc)); - CleanupStack::PushL(maskBitGc); - - if (drawn) { - //ensure that the mask is really transparent - maskBitGc->Activate( maskBitmapDevice ); - maskBitGc->SetPenStyle(CGraphicsContext::ENullPen); - maskBitGc->SetBrushStyle(CGraphicsContext::ESolidBrush); - maskBitGc->SetBrushColor(KRgbWhite); - maskBitGc->Clear(); - maskBitGc->SetBrushStyle(CGraphicsContext::ENullBrush); - - AknsDrawUtils::DrawFrame(skinInstance, - *maskBitGc, outerRect, innerRect, - frameSkinID, centerSkinID, - KAknsSDMAlphaOnly |KAknsDrawParamNoClearUnderImage); - result = fromFbsBitmap(frame, frameMask, flags, QImage::Format_ARGB32); - } - CleanupStack::PopAndDestroy(3, frameMask); - } - } - CleanupStack::PopAndDestroy(3, frame); //frame, bitmapDev, bitmapGc - - return result; // TODO: Let fromFbsBitmap return a QPixmap -} - -void QS60StyleModeSpecifics::frameIdAndCenterId(QS60StylePrivate::SkinFrameElements frameElement, TAknsItemID &frameId, TAknsItemID ¢erId) -{ -// There are some major mix-ups in skin declarations for some frames. -// First, the frames are not declared in sequence. -// Second, the parts use different major than the frame-master. - - switch(frameElement) { - case QS60StylePrivate::SF_ToolTip: - if (QSysInfo::s60Version()!=QSysInfo::SV_S60_3_1) { - centerId.Set(EAknsMajorGeneric, 0x19c2); - frameId.Set(EAknsMajorSkin, 0x5300); - } else { - centerId.Set(KAknsIIDQsnFrPopupCenter); - frameId.iMinor = centerId.iMinor - 9; - } - break; - case QS60StylePrivate::SF_ToolBar: - if (QSysInfo::s60Version()==QSysInfo::SV_S60_3_1 || QSysInfo::s60Version()==QSysInfo::SV_S60_3_2) { - centerId.Set(KAknsIIDQsnFrPopupCenterSubmenu); - frameId.Set(KAknsIIDQsnFrPopupSub); - } - break; - case QS60StylePrivate::SF_PanelBackground: - // remove center piece for panel graphics, so that only border is drawn - centerId.Set(KAknsIIDNone); - frameId.Set(KAknsIIDQsnFrSetOpt); - break; - default: - // center should be correct here - frameId.iMinor = centerId.iMinor - 9; - break; - } -} - -TRect QS60StyleModeSpecifics::innerRectFromElement(QS60StylePrivate::SkinFrameElements frameElement, const TRect &outerRect) -{ - TInt widthShrink = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth); - TInt heightShrink = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerHeight); - switch(frameElement) { - case QS60StylePrivate::SF_PanelBackground: - // panel should have slightly slimmer border to enable thin line of background graphics between closest component - widthShrink = widthShrink-2; - heightShrink = heightShrink-2; - break; - case QS60StylePrivate::SF_ToolTip: - widthShrink = widthShrink>>1; - heightShrink = heightShrink>>1; - break; - default: - break; - } - TRect innerRect(outerRect); - innerRect.Shrink(widthShrink, heightShrink); - return innerRect; -} - -bool QS60StyleModeSpecifics::checkSupport(const int supportedRelease) -{ - const QSysInfo::S60Version currentRelease = QSysInfo::s60Version(); - return ( (currentRelease == QSysInfo::SV_S60_3_1 && supportedRelease & ES60_3_1) || - (currentRelease == QSysInfo::SV_S60_3_2 && supportedRelease & ES60_3_2) || - (currentRelease == QSysInfo::SV_S60_5_0 && supportedRelease & ES60_5_0)); -} - -TAknsItemID QS60StyleModeSpecifics::checkAndUpdateReleaseSpecificGraphics(int part) -{ - TAknsItemID newSkinId; - if (!checkSupport(m_partMap[(int)part].supportInfo)) - newSkinId.Set(m_partMap[(int)part].newMajorSkinId, m_partMap[(int)part].newMinorSkinId); - else - newSkinId.Set(m_partMap[(int)part].skinID); - return newSkinId; -} - -void QS60StyleModeSpecifics::checkAndUnCompressBitmap(CFbsBitmap*& aOriginalBitmap) -{ - TRAPD(error, checkAndUnCompressBitmapL(aOriginalBitmap)); - if (error) - aOriginalBitmap = NULL; -} - -void QS60StyleModeSpecifics::checkAndUnCompressBitmapL(CFbsBitmap*& aOriginalBitmap) -{ - if (aOriginalBitmap->IsCompressedInRAM()) { - const TSize iconSize(aOriginalBitmap->SizeInPixels().iWidth, - aOriginalBitmap->SizeInPixels().iHeight); - CFbsBitmap* uncompressedBitmap = new (ELeave) CFbsBitmap(); - CleanupStack::PushL(uncompressedBitmap); - User::LeaveIfError(uncompressedBitmap->Create(iconSize, - aOriginalBitmap->DisplayMode())); - unCompressBitmapL(iconSize, uncompressedBitmap, aOriginalBitmap); - CleanupStack::Pop(uncompressedBitmap); - User::LeaveIfError(aOriginalBitmap->Duplicate( - uncompressedBitmap->Handle())); - delete uncompressedBitmap; - } -} - -QFont QS60StylePrivate::s60Font_specific( - QS60StyleEnums::FontCategories fontCategory, int pointSize) -{ - enum TAknFontCategory aknFontCategory = EAknFontCategoryUndefined; - switch (fontCategory) { - case QS60StyleEnums::FC_Primary: - aknFontCategory = EAknFontCategoryPrimary; - break; - case QS60StyleEnums::FC_Secondary: - aknFontCategory = EAknFontCategorySecondary; - break; - case QS60StyleEnums::FC_Title: - aknFontCategory = EAknFontCategoryTitle; - break; - case QS60StyleEnums::FC_PrimarySmall: - aknFontCategory = EAknFontCategoryPrimarySmall; - break; - case QS60StyleEnums::FC_Digital: - aknFontCategory = EAknFontCategoryDigital; - break; - case QS60StyleEnums::FC_Undefined: - default: - break; - } - - // Create AVKON font according the given parameters - CWsScreenDevice* dev = CCoeEnv::Static()->ScreenDevice(); - TAknFontSpecification spec(aknFontCategory, TFontSpec(), NULL); - if (pointSize > 0) { - const TInt pixelSize = dev->VerticalTwipsToPixels(pointSize * KTwipsPerPoint); - spec.SetTextPaneHeight(pixelSize + 4); // TODO: Is 4 a reasonable top+bottom margin? - } - - QFont result; - TRAPD( error, { - const CAknLayoutFont* aknFont = - AknFontAccess::CreateLayoutFontFromSpecificationL(*dev, spec); - - result = qt_TFontSpec2QFontL(aknFont->DoFontSpecInTwips()); - if (result.pointSize() != pointSize) - result.setPointSize(pointSize); // Correct the font size returned by CreateLayoutFontFromSpecificationL() - - delete aknFont; - }); - if (error) result = QFont(); - return result; -} - -void QS60StylePrivate::setActiveLayout() -{ - const QSize activeScreenSize(screenSize()); - int activeLayoutIndex = -1; - const bool mirrored = !QApplication::isLeftToRight(); - const short screenHeight = (short)activeScreenSize.height(); - const short screenWidth = (short)activeScreenSize.width(); - for (int i=0; istandardPalette(); - - // For now, always generate new icon based on "selected". In the future possibly, expand - // this to consist other possibilities as well. - result = QApplication::style()->generatedIconPixmap(QIcon::Selected, result, &opt); - return result; - } -} - -QPixmap QS60StylePrivate::part(QS60StyleEnums::SkinParts part, - const QSize &size, SkinElementFlags flags) -{ - QS60WindowSurface::unlockBitmapHeap(); - QPixmap result = (flags & SF_ColorSkinned)? - QS60StyleModeSpecifics::colorSkinnedGraphics(part, size, flags) - : QS60StyleModeSpecifics::skinnedGraphics(part, size, flags); - QS60WindowSurface::lockBitmapHeap(); - - if (flags & SF_StateDisabled && !QS60StyleModeSpecifics::disabledPartGraphic(part)) { - // TODO: fix this - QStyleOption opt; -// opt.palette = q->standardPalette(); - result = QApplication::style()->generatedIconPixmap(QIcon::Disabled, result, &opt); - } - - if (!result) - result = QS60StyleModeSpecifics::generateMissingThemeGraphic(part, size, flags); - - return result; -} - -QPixmap QS60StylePrivate::frame(SkinFrameElements frame, const QSize &size, SkinElementFlags flags) -{ - QS60WindowSurface::unlockBitmapHeap(); - QPixmap result = QS60StyleModeSpecifics::skinnedGraphics(frame, size, flags); - QS60WindowSurface::lockBitmapHeap(); - - if (flags & SF_StateDisabled && !QS60StyleModeSpecifics::disabledFrameGraphic(frame)) { - // TODO: fix this - QStyleOption opt; -// opt.palette = q->standardPalette(); - result = QApplication::style()->generatedIconPixmap(QIcon::Disabled, result, &opt); - } - return result; -} - -QPixmap QS60StylePrivate::backgroundTexture() -{ - if (!m_background) { - QPixmap background = part(QS60StyleEnums::SP_QsnBgScreen, - QSize(S60->screenWidthInPixels, S60->screenHeightInPixels), SkinElementFlags()); - m_background = new QPixmap(background); - } - return *m_background; -} - -// If the public SDK returns compressed images, please let us also uncompress those! -void QS60StyleModeSpecifics::unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap* aTrgBitmap, CFbsBitmap* aSrcBitmap) -{ - if (!aSrcBitmap) - User::Leave(KErrArgument); - if (!aTrgBitmap) - User::Leave(KErrArgument); - - // Note! aSrcBitmap->IsCompressedInRAM() is always ETrue, since this method is called only if that applies! - ASSERT(aSrcBitmap->IsCompressedInRAM()); - - TDisplayMode displayMode = aSrcBitmap->DisplayMode(); - - if (displayMode != aTrgBitmap->DisplayMode()) - User::Leave(KErrArgument); - - TSize trgSize = aTrgBitmap->SizeInPixels(); - TSize srcSize = aSrcBitmap->SizeInPixels(); - - // calculate the valid drawing area - TRect drawRect = aTrgRect; - drawRect.Intersection(TRect(TPoint(0, 0), trgSize)); - - if (drawRect.IsEmpty()) - return; - - CFbsBitmap* realSource = new (ELeave) CFbsBitmap(); - CleanupStack::PushL(realSource); - User::LeaveIfError(realSource->Create(srcSize, displayMode)); - CFbsBitmapDevice* dev = CFbsBitmapDevice::NewL(realSource); - CleanupStack::PushL(dev); - CFbsBitGc* gc = NULL; - User::LeaveIfError(dev->CreateContext(gc)); - CleanupStack::PushL(gc); - gc->BitBlt(TPoint(0, 0), aSrcBitmap); - CleanupStack::PopAndDestroy(2); // dev, gc - - // Heap lock for FBServ large chunk is only needed with large bitmaps. - if (realSource->IsLargeBitmap() || aTrgBitmap->IsLargeBitmap()) { - aTrgBitmap->LockHeapLC(ETrue); // fbsheaplock - } else { - CleanupStack::PushL((TAny*) NULL); - } - - TUint32* srcAddress = realSource->DataAddress(); - TUint32* trgAddress = aTrgBitmap->DataAddress(); - - const TInt xSkip = (srcSize.iWidth << 8) / aTrgRect.Width(); - const TInt ySkip = (srcSize.iHeight << 8) / aTrgRect.Height(); - - const TInt drawWidth = drawRect.Width(); - const TInt drawHeight = drawRect.Height(); - - TRect offsetRect(aTrgRect.iTl, drawRect.iTl); - const TInt yPosOffset = ySkip * offsetRect.Height(); - const TInt xPosOffset = xSkip * offsetRect.Width(); - - if ((displayMode == EGray256) || (displayMode == EColor256)) { - TInt srcScanLen8 = CFbsBitmap::ScanLineLength(srcSize.iWidth, - displayMode); - TInt trgScanLen8 = CFbsBitmap::ScanLineLength(trgSize.iWidth, - displayMode); - - TUint8* trgAddress8 = reinterpret_cast (trgAddress); - - TInt yPos = yPosOffset; - // skip left and top margins in the beginning - trgAddress8 += trgScanLen8 * drawRect.iTl.iY + drawRect.iTl.iX; - - for (TInt y = 0; y < drawHeight; y++) { - TUint8* srcAddress8 = reinterpret_cast (srcAddress) - + (srcScanLen8 * (yPos >> 8)); - - TInt xPos = xPosOffset; - for (TInt x = 0; x < drawWidth; x++) { - *(trgAddress8++) = srcAddress8[xPos >> 8]; - xPos += xSkip; - } - - yPos += ySkip; - - trgAddress8 += trgScanLen8 - drawWidth; - } - } else if (displayMode == EColor4K || displayMode == EColor64K) { - TInt srcScanLen16 = CFbsBitmap::ScanLineLength(srcSize.iWidth, - displayMode) >>1; - TInt trgScanLen16 = CFbsBitmap::ScanLineLength(trgSize.iWidth, - displayMode) >>1; - - TUint16* trgAddress16 = reinterpret_cast (trgAddress); - - TInt yPos = yPosOffset; - // skip left and top margins in the beginning - trgAddress16 += trgScanLen16 * drawRect.iTl.iY + drawRect.iTl.iX; - - for (TInt y = 0; y < drawHeight; y++) { - TUint16* srcAddress16 = reinterpret_cast (srcAddress) - + (srcScanLen16 * (yPos >> 8)); - - TInt xPos = xPosOffset; - for (TInt x = 0; x < drawWidth; x++) { - *(trgAddress16++) = srcAddress16[xPos >> 8]; - xPos += xSkip; - } - - yPos += ySkip; - - trgAddress16 += trgScanLen16 - drawWidth; - } - } else if (displayMode == EColor16MU || displayMode == EColor16MA) { - TInt srcScanLen32 = CFbsBitmap::ScanLineLength(srcSize.iWidth, - displayMode) >>2; - TInt trgScanLen32 = CFbsBitmap::ScanLineLength(trgSize.iWidth, - displayMode) >>2; - - TUint32* trgAddress32 = reinterpret_cast (trgAddress); - - TInt yPos = yPosOffset; - // skip left and top margins in the beginning - trgAddress32 += trgScanLen32 * drawRect.iTl.iY + drawRect.iTl.iX; - - for (TInt y = 0; y < drawHeight; y++) { - TUint32* srcAddress32 = reinterpret_cast (srcAddress) - + (srcScanLen32 * (yPos >> 8)); - - TInt xPos = xPosOffset; - for (TInt x = 0; x < drawWidth; x++) { - *(trgAddress32++) = srcAddress32[xPos >> 8]; - xPos += xSkip; - } - - yPos += ySkip; - - trgAddress32 += trgScanLen32 - drawWidth; - } - } else { User::Leave(KErrUnknown);} - - CleanupStack::PopAndDestroy(2); // fbsheaplock, realSource -} - -QSize QS60StylePrivate::screenSize() -{ - TSize mySize = QS60Data::screenDevice()->SizeInPixels(); - return QSize(mySize.iWidth, mySize.iHeight); -} - -void QS60StyleModeSpecifics::colorGroupAndIndex( - QS60StyleEnums::SkinParts skinID, TAknsItemID &colorGroup, int colorIndex) -{ - switch(skinID) { - case QS60StyleEnums::SP_QgnIndiSubMenu: - colorGroup = KAknsIIDQsnIconColors; - colorIndex = EAknsCIQsnIconColorsCG1; - break; - case QS60StyleEnums::SP_QgnIndiRadiobuttOff: - case QS60StyleEnums::SP_QgnIndiRadiobuttOn: - case QS60StyleEnums::SP_QgnIndiCheckboxOff: - case QS60StyleEnums::SP_QgnIndiCheckboxOn: - colorGroup = KAknsIIDQsnIconColors; - colorIndex = EAknsCIQsnIconColorsCG14; - break; - default: - break; - } -} - -void QS60Style::handleDynamicLayoutVariantSwitch() -{ - Q_D(QS60Style); - d->clearCaches(QS60StylePrivate::CC_LayoutChange); - d->setActiveLayout(); - d->refreshUI(); - d->setBackgroundTexture(qApp); - foreach (QWidget *widget, QApplication::allWidgets()) - widget->ensurePolished(); -} - -void QS60Style::handleSkinChange() -{ - Q_D(QS60Style); - d->clearCaches(QS60StylePrivate::CC_ThemeChange); - d->setThemePalette(qApp); - foreach (QWidget *topLevelWidget, QApplication::allWidgets()){ - QEvent e(QEvent::StyleChange); - QApplication::sendEvent(topLevelWidget, &e); - d->setThemePalette(topLevelWidget); - topLevelWidget->ensurePolished(); - } -} - -QT_END_NAMESPACE - -#endif // QT_NO_STYLE_S60 || QT_PLUGIN diff --git a/src/gui/styles/styles.pri b/src/gui/styles/styles.pri index b0e9f21..050d81d 100644 --- a/src/gui/styles/styles.pri +++ b/src/gui/styles/styles.pri @@ -161,7 +161,7 @@ contains( styles, s60 ) { styles/qs60style_p.h SOURCES += styles/qs60style.cpp symbian { - SOURCES += styles/qs60style_symbian.cpp + SOURCES += styles/qs60style_s60.cpp # TODO: fix the following LIBS hack. Line 1 is for armv5, 2 for winscw LIBS += aknicon aknskins aknskinsrv fontutils LIBS += -laknicon -laknskins -laknskinsrv -lfontutils -- cgit v0.12 From 777c504bb7858bf5e7073f7efbe58db33b93673a Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 29 May 2009 10:46:23 +0300 Subject: Removed PAGED keyword from S60 3.1 builds --- mkspecs/common/symbian/symbian.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf index 968a6bc..5a61a23 100644 --- a/mkspecs/common/symbian/symbian.conf +++ b/mkspecs/common/symbian/symbian.conf @@ -137,5 +137,6 @@ exists($${EPOCROOT}epoc32/release/winscw/udeb/z/system/install/Series60v5.0.sis S60_VERSION = 3.2 } else { S60_VERSION = 3.1 + MMP_RULES -= PAGED } } -- cgit v0.12 From dcf5d568aba893d690eedbe1e18148b504de2abb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 29 May 2009 10:46:40 +0300 Subject: S60Style: Remove unneeded case-statements and own implementation for drawItemText. --- src/gui/styles/qs60style.cpp | 91 -------------------------------------------- src/gui/styles/qs60style.h | 1 - src/gui/styles/qs60style_p.h | 2 - 3 files changed, 94 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index b0ba30b..930602b 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -1111,15 +1111,6 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom } break; #endif //QT_NO_GROUPBOX -#ifndef QT_NO_DIAL - case CC_Dial: - if (const QStyleOptionSlider *slider = qstyleoption_cast(option)) { - QStyleOptionSlider optionSlider = *slider; - QCommonStyle::drawComplexControl(control, &optionSlider, painter, widget); - } - break; -#endif //QT_NO_DIAL - default: QCommonStyle::drawComplexControl(control, option, painter, widget); } @@ -1177,24 +1168,6 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, QS60StylePrivate::drawSkinElement(skinElement, painter, option->rect, flags); } break; - case CE_PushButtonLabel: - if (const QStyleOptionButton *button = qstyleoption_cast(option)) { - QStyleOptionButton optionButton = *button; - QCommonStyle::drawControl(element, &optionButton, painter, widget); - } - break; - case CE_CheckBoxLabel: - if (const QStyleOptionButton *checkBox = qstyleoption_cast(option)) { - QStyleOptionButton optionCheckBox = *checkBox; - QCommonStyle::drawControl(element, &optionCheckBox, painter, widget); - } - break; - case CE_RadioButtonLabel: - if (const QStyleOptionButton *radioButton = qstyleoption_cast(option)) { - QStyleOptionButton optionRadioButton = *radioButton; - QCommonStyle::drawControl(element, &optionRadioButton, painter, widget); - } - break; #ifndef QT_NO_TOOLBUTTON case CE_ToolButtonLabel: if (const QStyleOptionToolButton *toolBtn = qstyleoption_cast(option)) { @@ -1213,12 +1186,6 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, } break; #endif //QT_NO_TOOLBUTTON - case CE_HeaderLabel: - if (const QStyleOptionHeader *headerLabel = qstyleoption_cast(option)) { - QStyleOptionHeader optionHeaderLabel = *headerLabel; - QCommonStyle::drawControl(element, &optionHeaderLabel, painter, widget); - } - break; #ifndef QT_NO_COMBOBOX case CE_ComboBoxLabel: if (const QStyleOptionComboBox *comboBox = qstyleoption_cast(option)) { @@ -1580,12 +1547,6 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, break; #endif // QT_NO_PROGRESSBAR #ifndef QT_NO_MENUBAR - case CE_MenuBarItem: - if (const QStyleOptionMenuItem *menuBarItem = qstyleoption_cast(option)) { - QStyleOptionMenuItem optionMenuBarItem = *menuBarItem; - QCommonStyle::drawControl(element, &optionMenuBarItem, painter, widget); - } - break; #endif //QT_NO_MENUBAR #ifndef QT_NO_MENU case CE_MenuItem: @@ -1798,49 +1759,6 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, } break; #endif //QT_NO_TOOLBAR - - //todo: remove non-used widgets in final version - case CE_ShapedFrame: - case CE_MenuVMargin: - case CE_MenuHMargin: -#ifndef QT_NO_MENU - case CE_MenuScroller: - case CE_MenuTearoff: -#endif //QT_NO_MENU - - case CE_CheckBox: - case CE_RadioButton: -#ifndef QT_NO_TABBAR - case CE_TabBarTab: -#endif //QT_NO_TABBAR -#ifndef QT_NO_PROGRESSBAR - case CE_ProgressBar: -#endif // QT_NO_PROGRESSBAR - case CE_Q3DockWindowEmptyArea: -#ifndef QT_NO_SIZEGRIP - case CE_SizeGrip: -#endif //QT_NO_SIZEGRIP - case CE_Splitter: -#ifndef QT_NO_RUBBERBAND - case CE_RubberBand: -#endif //QT_NO_RUBBERBAND -#ifndef QT_NO_DOCKWIDGET - case CE_DockWidgetTitle: -#endif //QT_NO_DOCKWIDGET - case CE_ScrollBarAddLine: - case CE_ScrollBarSubLine: - case CE_ScrollBarAddPage: - case CE_ScrollBarSubPage: - case CE_ScrollBarSlider: - case CE_ScrollBarFirst: - case CE_ScrollBarLast: - case CE_FocusFrame: -#ifndef QT_NO_TOOLBOX - case CE_ToolBoxTab: - case CE_ToolBoxTabShape: - case CE_ToolBoxTabLabel: -#endif //QT_NO_TOOLBOX - case CE_ColumnViewGrip: default: QCommonStyle::drawControl(element, option, painter, widget); } @@ -2169,15 +2087,6 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti } /*! - \reimp - sets the default colors -*/ -void QS60Style::drawItemText(QPainter *painter, const QRect &rectangle, int alignment, const QPalette & palette, bool enabled, const QString &text, QPalette::ColorRole textRole) const -{ - QPalette override = palette; - QCommonStyle::drawItemText(painter, rectangle, alignment, override, enabled, text, textRole); -} - -/*! \reimp */ int QS60Style::pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const diff --git a/src/gui/styles/qs60style.h b/src/gui/styles/qs60style.h index 945e182..09c6b00 100644 --- a/src/gui/styles/qs60style.h +++ b/src/gui/styles/qs60style.h @@ -36,7 +36,6 @@ public: void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget = 0) const; void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const; void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const; - void drawItemText(QPainter *painter, const QRect &rectangle, int alignment, const QPalette &palette, bool enabled, const QString &text, QPalette::ColorRole textRole = QPalette::NoRole) const; int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const; QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w = 0) const; int styleHint(StyleHint sh, const QStyleOption *opt = 0, const QWidget *w = 0, diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index 22b01f6..c93d271 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -366,8 +366,6 @@ public: static QColor lighterColor(const QColor &baseColor); //deduces if the given widget should have separately themeable background static bool drawsOwnThemeBackground(const QWidget *widget); - // gets layout - static const QHash &s60StyleLayout(); QFont s60Font(QS60StyleEnums::FontCategories fontCategory, int pointSize = -1) const; -- cgit v0.12 From d4a8cb47cb106ad642e908763787407774619aac Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Fri, 29 May 2009 09:40:32 +0200 Subject: Disable keypad navigation for the autotests and document it. On Symbian keypad navigation is enabled by default since there is no reliable way to detect the presence of touch or not. Enabling this feature though causes problems for many of Qt's autotests since they were not written with this in mind. Many tests send QTest::key*() events to a widget and subsequently test the state of the widget, but with keypad navigation enabled, the behavior changes because the widget does not have edit focus by default. Reviewed-by: axis --- src/gui/kernel/qapplication.cpp | 6 +++--- src/testlib/qtest.h | 7 +++++++ src/testlib/qtestcase.cpp | 7 ++++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index fb002a3..eaaeb4b 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -4764,7 +4764,7 @@ void QApplicationPrivate::emitLastWindowClosed() If \a enable is true, Qt::Key_Up and Qt::Key_Down are used to change focus. - This feature is available in Qt for Embedded Linux only. + This feature is available in Qt for Embedded Linux and Symbian only. \sa keypadNavigationEnabled() */ @@ -4775,9 +4775,9 @@ void QApplication::setKeypadNavigationEnabled(bool enable) /*! Returns true if Qt is set to use keypad navigation; otherwise returns - false. The default is false. + false. The default value is true on Symbian, but false on other platforms. - This feature is available in Qt for Embedded Linux only. + This feature is available in Qt for Embedded Linux and Symbian only. \sa setKeypadNavigationEnabled() */ diff --git a/src/testlib/qtest.h b/src/testlib/qtest.h index 6ea38f7..15319ce 100644 --- a/src/testlib/qtest.h +++ b/src/testlib/qtest.h @@ -226,10 +226,17 @@ int main(int argc, char *argv[]) \ #include +#ifdef QT_KEYPAD_NAVIGATION +# define QTEST_DISABLE_KEYPAD_NAVIGATION QApplication::setKeypadNavigationEnabled(false); +#else +# define QTEST_DISABLE_KEYPAD_NAVIGATION +#endif + #define QTEST_MAIN(TestObject) \ int main(int argc, char *argv[]) \ { \ QApplication app(argc, argv); \ + QTEST_DISABLE_KEYPAD_NAVIGATION \ TestObject tc; \ return QTest::qExec(&tc, argc, argv); \ } diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 27ba6da..b676012 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -300,10 +300,15 @@ QT_BEGIN_NAMESPACE the \a TestClass, and executes all tests in the order they were defined. Use this macro to build stand-alone executables. + \bold {Note:} On platforms that have keypad navigation enabled by default (eg: Symbian), + this macro will forcfully disable it to simplify the usage of key events when writing + autotests. If you wish to write a test case that uses keypad navigation, you should + enable it either in the \c {initTestCase()} or \c {init()} functions of your test case. + Example: \snippet doc/src/snippets/code/src_qtestlib_qtestcase.cpp 11 - \sa QTEST_APPLESS_MAIN(), QTest::qExec() + \sa QTEST_APPLESS_MAIN(), QTest::qExec(), QApplication::setKeypadNavigationEnabled() */ /*! \macro QTEST_APPLESS_MAIN(TestClass) -- cgit v0.12 From e501070def74e241c39abc44e30b443aa006bed3 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 29 May 2009 10:48:20 +0300 Subject: Further refinement of release package creation script --- bin/build_release_package.pl | 179 ++++++++++++++++++++++++++++++------------- 1 file changed, 125 insertions(+), 54 deletions(-) diff --git a/bin/build_release_package.pl b/bin/build_release_package.pl index 0df5995..44b0fb1 100644 --- a/bin/build_release_package.pl +++ b/bin/build_release_package.pl @@ -7,10 +7,11 @@ # ####################################################################### -use Cwd; +my $buildContentDemoValue = "libs+demo"; if (@ARGV) { + my $buildContent = shift(@ARGV); my $platform = shift(@ARGV); my $build = shift(@ARGV); my $cert = shift(@ARGV); @@ -19,10 +20,22 @@ if (@ARGV) my $qtRootDir = shift(@ARGV); my $epocroot = shift(@ARGV); + if ($buildContent eq "") + { + print("Build content parameter required!\n"); + exit 2; + } + + if ($platform eq "") + { + print("HW platform parameter required!\n"); + exit 2; + } + if ($build eq "") { print("HW build parameter required!\n"); - exit 1; + exit 2; } if ($cert eq "") @@ -34,22 +47,28 @@ if (@ARGV) if ($certKey eq "") { print("Signing certificate key parameter required!\n"); - exit 3; + exit 2; } if ($releaseDir eq "") { print("Release directory parameter required!\n"); - exit 4; + exit 2; } if ($qtRootDir eq "") { - $qtRootDir = cwd(); - $qtRootDir =~ s/\//\\/g; + print("Qt root directory parameter required!\n"); + exit 2; + } + + if ($epocroot eq "") + { + print("Epocroot directory parameter required!\n"); + exit 2; } - # Lose the ending separator is any + # Lose the ending separator if any $qtRootDir =~ s/\\$//; $epocroot =~ s/\\$//; @@ -66,12 +85,13 @@ if (@ARGV) $qtRootDirForMatch =~ s/\\/\\\\/g; my $pkgFileName = "src\\s60installs\\qt_libs_${platform}_${build}.pkg"; + my $demoAppPkgFileName = "demos\\embedded\\fluidlauncher\\fluidlauncher_${platform}_${build}.pkg"; + my $sisFileNameBase = "qt_libs"; + my $demoAppSisFileNameBase = "fluidlauncher"; my $hwBuildDir = "${epocroot}\\epoc32\\release\\$platform\\$build"; my $armDbgDir = "epoc32\\release\\armv5\\udeb"; my $armRelDir = "epoc32\\release\\armv5\\urel"; - my $gcceDbgDir = "epoc32\\release\\gcce\\udeb"; - my $gcceRelDir = "epoc32\\release\\gcce\\urel"; my $armLibDir = "epoc32\\release\\armv5\\lib"; my $winscwDbgDir = "epoc32\\release\\winscw\\udeb"; @@ -96,13 +116,8 @@ if (@ARGV) runSystemCmd("attrib -A ${epocroot}\\${winscwDbgDir}\\*"); # Build Qt - runSystemCmd("configure -platform win32-mwc -xplatform symbian-abld -openssl-linked -qt-sql-sqlite -system-sqlite -nokia-developer"); - chdir("src"); - runSystemCmd("qmake"); - runSystemCmd("bldmake bldfiles"); - runSystemCmd("abld build ${platform} ${build}"); - runSystemCmd("abld build winscw udeb"); - chdir($qtRootDir); + runSystemCmd("configure -platform win32-mwc -xplatform symbian-abld -openssl-linked -qt-sql-sqlite -system-sqlite -confirm-license -opensource"); + buildDir("src", $qtRootDir, $platform, $build); # Copy misc stuff runSystemCmd("xcopy ${qtRootDir}\\bin\\* ${releaseDirQt}\\bin /F /R /Y /I /D"); @@ -114,7 +129,60 @@ if (@ARGV) runSystemCmd("copy .qmake.cache ${releaseDirQt}\\.qmake.cache"); # Copy stuff indicated by pkg file for emulator - open (PKG, "<".$pkgFileName); + parsePkgFile($pkgFileName, $epocroot, $build, $platform, $releaseDirEpocroot, $qtRootDirForMatch, $releaseDirQt); + + # Copy any other binaries and related files built not included in pkg + runSystemCmd("xcopy ${hwBuildDir}\\* ${releaseDirEpocroot}\\${armDbgDir} /A /F /R /Y /I /D "); + runSystemCmd("xcopy ${releaseDirEpocroot}\\${armDbgDir}\\* ${releaseDirEpocroot}\\${armRelDir} /F /R /Y /I /D"); + system("del /F /Q ${releaseDirEpocroot}\\${armRelDir}\\*.sym 2> NUL"); + runSystemCmd("xcopy ${epocroot}\\${armLibDir}\\* ${releaseDirEpocroot}\\${armLibDir} /A /F /R /Y /I /D"); + runSystemCmd("xcopy ${epocroot}\\${winscwDbgDir}\\* ${releaseDirEpocroot}\\${winscwDbgDir} /A /F /R /Y /I /D"); + + if ($buildContent eq $buildContentDemoValue) + { + # Also build demos & examples and add fluidlauncher sis + buildDir("examples", $qtRootDir, $platform, $build); + buildDir("demos", $qtRootDir, $platform, $build); + parsePkgFile($demoAppPkgFileName, $epocroot, $build, $platform, $releaseDirEpocroot, $qtRootDirForMatch, $releaseDirQt); + createSis($demoAppPkgFileName, $releaseDirSis, "selfsigned.cer", "selfsigned.key", $demoAppSisFileNameBase); + } + + # Create unsigned sis and Rnd signed sisx + createSis($pkgFileName, $releaseDirSis, $cert, $certKey, $sisFileNameBase); + +} +else +{ + print("Usage:\n"); + print("build_release_package.pl \n"); + print("1) Clean up the env. (abld reallyclean & delete \\my\\epoc\\root\\build folder)\n"); + print("2) Run \"build_release_package.pl armv5 udeb \\rd.cer \\rd-key.pem \\my_release_dir [\\my\\qt\\root\\] [\\my\\epoc\\root\\]>\"\n"); + print(" to build Qt and create the release package structure and sis file.\n"); + print(" Note: Run in the Qt root directory.\n"); + print("3) Optional: Get the sis signed with commercial certificate (can be found in qt directory under release directory)\n"); + print("4) Zip up the release directory contents\n"); +} + +sub runSystemCmd +{ + my $error_code = system($_[0]); + if ($error_code != 0) + { + print("'$_[0]' call failed: error code == $error_code\n"); + exit 9; + } +} + +sub parsePkgFile +{ + my $epocroot = $_[1]; + my $build = $_[2]; + my $platform = $_[3]; + my $releaseDirEpocroot = $_[4]; + my $qtRootDirForMatch = $_[5]; + my $releaseDirQt = $_[6]; + + open (PKG, "<".$_[0]); while () { my $line = $_; @@ -150,7 +218,15 @@ if (@ARGV) if ($sourcePath !~ m/\\epoc32\\release\\([^\\]+)\\(udeb|urel)\\(\w+(\.dll|\.exe))/i) { # Copy non-binaries also over for emulator to use - $pkgDestinationPath =~ s/!:/${releaseDirEpocroot}\\epoc32\\winscw\\c/g; + if ($pkgDestinationPath =~ m/(private\\10003a3f\\import\\apps|resource\\apps)/i) + { + $pkgDestinationPath =~ s/!:/${releaseDirEpocroot}\\epoc32\\release\\winscw\\udeb\\z/g; + } + else + { + $pkgDestinationPath =~ s/!:/${releaseDirEpocroot}\\epoc32\\winscw\\c/g; + } + runSystemCmd("echo f|xcopy ${sourcePath} ${pkgDestinationPath} /F /R /Y /I /D"); } else @@ -164,46 +240,41 @@ if (@ARGV) } } close (PKG); +} - # Copy any other binaries and related files built not included in pkg - runSystemCmd("xcopy ${hwBuildDir}\\* ${releaseDirEpocroot}\\${armDbgDir} /A /F /R /Y /I /D "); - runSystemCmd("xcopy ${releaseDirEpocroot}\\${armDbgDir}\\* ${releaseDirEpocroot}\\${armRelDir} /F /R /Y /I /D"); - system("del /F /Q ${releaseDirEpocroot}\\${armRelDir}\\*.sym 2> NUL"); - runSystemCmd("xcopy ${releaseDirEpocroot}\\${armDbgDir}\\* ${releaseDirEpocroot}\\${gcceDbgDir} /F /R /Y /I /D"); - runSystemCmd("xcopy ${releaseDirEpocroot}\\${armRelDir}\\* ${releaseDirEpocroot}\\${gcceRelDir} /F /R /Y /I /D"); - runSystemCmd("xcopy ${epocroot}\\${armLibDir}\\* ${releaseDirEpocroot}\\${armLibDir} /A /F /R /Y /I /D"); - runSystemCmd("xcopy ${epocroot}\\${winscwDbgDir}\\* ${releaseDirEpocroot}\\${winscwDbgDir} /A /F /R /Y /I /D"); +sub createSis +{ + my $pkgFileName = $_[0]; + my $releaseDirSis = $_[1]; + my $cert = $_[2]; + my $certKey = $_[3]; + my $sisFileNameBase = $_[4]; + my $signedSuffix = ".sis"; + my $unsignedSuffix = "_unsigned.sis"; - # Create unsigned sis and Rnd signed sisx - my @pkgPathElements = split(/\\/, $pkgFileName); - my $pathlessPkgFile = pop(@pkgPathElements); - my @pkgSuffixElements = split(/\./, $pathlessPkgFile); - pop(@pkgSuffixElements); - my $sisFileName = join("", @pkgSuffixElements).".sis"; - my $rndSisFileName = join("", @pkgSuffixElements)."_rnd.sisx"; - system("mkdir ${releaseDirSis}"); + if ($cert =~ m/rd\.cer/i) + { + $signedSuffix = "_rnd.sis"; + } + + my $sisFileName = $sisFileNameBase.$unsignedSuffix; + my $signedSisFileName = $sisFileNameBase.$signedSuffix; + system("mkdir ${releaseDirSis} 2> NUL"); runSystemCmd("makesis ${pkgFileName} ${releaseDirSis}\\${sisFileName}"); - runSystemCmd("signsis ${releaseDirSis}\\${sisFileName} ${releaseDirSis}\\${rndSisFileName} ${cert} ${certKey}"); -} -else -{ - print("Usage:\n"); - print("build_release_package.pl [QTROOT] [EPOCROOT]\n"); - print("QTROOT and EPOCROOT are optional; QTROOT defaults to current dir and EPOCROOT defaults to '\\'\n"); - print("1) Clean up the env. (abld reallyclean & delete \\my\\epoc\\root\\build folder)\n"); - print("2) Run \"build_release_package.pl armv5 udeb \\rd.cer \\rd-key.pem \\my_release_dir [\\my\\qt\\root\\] [\\my\\epoc\\root\\]>\"\n"); - print(" to build Qt and create the release package structure and sis file.\n"); - print(" Note: Run in the Qt root directory.\n"); - print("3) Optional: Get the sis signed with commercial certificate (can be found in qt directory under release directory)\n"); - print("4) Zip up the release directory contents\n"); + runSystemCmd("signsis ${releaseDirSis}\\${sisFileName} ${releaseDirSis}\\${signedSisFileName} ${cert} ${certKey}"); } -sub runSystemCmd +sub buildDir { - my $error_code = system($_[0]); - if ($error_code != 0) - { - print("'$_[0]' call failed: error code == $error_code\n"); - exit 5; - } + my $buildDir = $_[0]; + my $qtRootDir = $_[1]; + my $platform = $_[2]; + my $build = $_[3]; + + chdir($buildDir); + runSystemCmd("qmake"); + runSystemCmd("bldmake bldfiles"); + runSystemCmd("abld build ${platform} ${build}"); + runSystemCmd("abld build winscw udeb"); + chdir($qtRootDir); } -- cgit v0.12 From 0bd369dd52561d4654697b09a89141e96305e837 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Fri, 29 May 2009 09:58:33 +0200 Subject: Implemented better way to detect when to add automagically a menu button to softkeys --- src/gui/widgets/qsoftkeystack.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index c68fe19..984922e 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -185,15 +185,20 @@ void QSoftKeyStack::handleFocusChanged(QWidget *old, QWidget *now) QMainWindow *mainWindow = qobject_cast(w); if( !mainWindow) return; + if (!mainWindow->hasSoftKeyStack()) + return; QSoftKeyStack* softKeyStack = mainWindow->softKeyStack(); - - Qt::ContextMenuPolicy policy = now->contextMenuPolicy(); - if (policy != Qt::NoContextMenu && policy != Qt::PreventContextMenu ) { + if( mainWindow->menuWidget() ) + { QList actionList; QSoftKeyAction* menu = new QSoftKeyAction(QSoftKeyAction::Menu, QString::fromLatin1("Menu"), now); - QSoftKeyAction* contextMenu = new QSoftKeyAction(QSoftKeyAction::ContextMenu, QString::fromLatin1("ContextMenu"), now); actionList.append(menu); - actionList.append(contextMenu); + + Qt::ContextMenuPolicy policy = now->contextMenuPolicy(); + if (policy != Qt::NoContextMenu && policy != Qt::PreventContextMenu ) { + QSoftKeyAction* contextMenu = new QSoftKeyAction(QSoftKeyAction::ContextMenu, QString::fromLatin1("ContextMenu"), now); + actionList.append(contextMenu); + } if (old) softKeyStack->popandPush(actionList); else -- cgit v0.12 From 436a2fdde1268ce548097d36df234e027b83b856 Mon Sep 17 00:00:00 2001 From: ikause Date: Tue, 26 May 2009 14:08:17 +0300 Subject: A fix for a bug 252798 AVKON will show blanker - this will allow applications to change their layout and ensures that 'intermediate' states are not shown to the end user. This blanker is a full screen window and this causes Qt application to receive visibility change event (not visible) and then Qt application deletes backing store. Finally, when blanker is removed, Qt application receives another visibility change event (fully or partially visible) and backing store is recreated, but the original version does not ensure that window contents are valid. In fact, because of orientation change event, window server generates redraw request and it is handled before receiving that second visibility change event. In QSymbianControl::Draw doesn't draw anything. By adding this update() call, we ensure that window will be drawn correctly eventually. Reviewed-by: Jason Barron --- src/gui/kernel/qapplication_s60.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 5b2c1fb..b4658da 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1011,6 +1011,7 @@ int QApplication::s60ProcessEvent(TWsEvent *event) } else if ((visChangedEvent->iFlags & TWsVisibilityChangedEvent::EPartiallyVisible) && !w->d_func()->maybeBackingStore()) { w->d_func()->topData()->backingStore = new QWidgetBackingStore(w); + w->update(); } return 1; } -- cgit v0.12 From f67bc13bc8e2d2c76d7d9f12abb1dbda85abe337 Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Fri, 29 May 2009 10:22:24 +0200 Subject: Doc - marked QFileDialog::setOption() with the since 4.5 tag. Task-number: 254549 Reviewed-by: TrustMe --- src/gui/dialogs/qfiledialog.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index d4d0136..405e71e 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -565,8 +565,9 @@ bool QFileDialogPrivate::canBeNativeDialog() } /*! - Sets the given \a option to be enabled if \a on is true; - otherwise, clears the given \a option. + \since 4.5 + Sets the given \a option to be enabled if \a on is true; otherwise, + clears the given \a option. \sa options, testOption() */ -- cgit v0.12 From 7bc17b5b9ff9f2e3e04f36fec8ccbb546d9b7a31 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Fri, 29 May 2009 10:48:53 +0200 Subject: Fixed build issues with MSVC in atomic operations, we declare Interlock... functions in the namespace That can confuse the compiler because they are also declared in another header outside the namespace. Same problem in clucene where we include windows.h from within the NS. Task-number: 254214 Reviewed-by: ogoffart --- src/corelib/arch/qatomic_windows.h | 14 ++++++++++++++ tools/assistant/lib/fulltextsearch/qclucene_global_p.h | 16 ++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/corelib/arch/qatomic_windows.h b/src/corelib/arch/qatomic_windows.h index ac26b4f..5135575 100644 --- a/src/corelib/arch/qatomic_windows.h +++ b/src/corelib/arch/qatomic_windows.h @@ -220,6 +220,9 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueTo #if !defined(Q_OS_WINCE) // use compiler intrinsics for all atomic functions +//those functions need to be define in the global namespace +QT_END_NAMESPACE + extern "C" { long __cdecl _InterlockedIncrement(volatile long *); long __cdecl _InterlockedDecrement(volatile long *); @@ -252,6 +255,9 @@ extern "C" { # define _InterlockedExchangeAddPointer(a,b) \ _InterlockedExchangeAdd(reinterpret_cast(a), long(b)) # endif + +QT_BEGIN_NAMESPACE + inline bool QBasicAtomicInt::ref() { return _InterlockedIncrement(reinterpret_cast(&_q_value)) != 0; @@ -335,6 +341,8 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueTo #define Q_ARGUMENT_TYPE #endif +QT_END_NAMESPACE + extern "C" { long __cdecl InterlockedIncrement(long Q_ARGUMENT_TYPE * lpAddend); long __cdecl InterlockedDecrement(long Q_ARGUMENT_TYPE * lpAddend); @@ -351,6 +359,8 @@ long __cdecl InterlockedExchangeAdd(long Q_ARGUMENT_TYPE * Addend, long Value); # pragma intrinsic (_InterlockedExchangeAdd) #endif +QT_BEGIN_NAMESPACE + #endif @@ -409,6 +419,8 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddOrdered(qptrdiff valueTo // MinGW's definition, such that we pick up variations in the headers. #ifndef __INTERLOCKED_DECLARED #define __INTERLOCKED_DECLARED +QT_END_NAMESPACE + extern "C" { __declspec(dllimport) long __stdcall InterlockedCompareExchange(long *, long, long); __declspec(dllimport) long __stdcall InterlockedIncrement(long *); @@ -416,6 +428,8 @@ extern "C" { __declspec(dllimport) long __stdcall InterlockedExchange(long *, long); __declspec(dllimport) long __stdcall InterlockedExchangeAdd(long *, long); } + +QT_BEGIN_NAMESPACE #endif inline bool QBasicAtomicInt::ref() diff --git a/tools/assistant/lib/fulltextsearch/qclucene_global_p.h b/tools/assistant/lib/fulltextsearch/qclucene_global_p.h index 2a9d146..3dba45a 100644 --- a/tools/assistant/lib/fulltextsearch/qclucene_global_p.h +++ b/tools/assistant/lib/fulltextsearch/qclucene_global_p.h @@ -29,6 +29,14 @@ #include #include +#if !defined(_MSC_VER) && defined(_CL_HAVE_WCHAR_H) && defined(_CL_HAVE_WCHAR_T) +# if !defined(TCHAR) +# define TCHAR wchar_t +# endif +#else +# include +#endif + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -87,14 +95,6 @@ QT_BEGIN_NAMESPACE # define CL_NS2(sub,sub2) #endif -#if !defined(_MSC_VER) && defined(_CL_HAVE_WCHAR_H) && defined(_CL_HAVE_WCHAR_T) -# if !defined(TCHAR) -# define TCHAR wchar_t -# endif -#else -# include -#endif - namespace { TCHAR* QStringToTChar(const QString &str) { -- cgit v0.12 From e08f3e7bf3dbae6036ab89248793b98330971269 Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Fri, 29 May 2009 09:21:16 +0200 Subject: Only display the choice of license if we can find the files Task-number: 254451 Reviewed-by: eskil BT: yes --- tools/configure/configureapp.cpp | 43 +++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index a6b06a6..b9d172f 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -3483,12 +3483,15 @@ void Configure::readLicense() dictionary[ "PLATFORM NAME" ] = (QFile::exists(dictionary["QT_SOURCE_TREE"] + "/src/corelib/kernel/qfunctions_wince.h") && (dictionary.value("QMAKESPEC").startsWith("wince") || dictionary.value("XQMAKESPEC").startsWith("wince"))) ? "Qt for Windows CE" : "Qt for Windows"; + dictionary["LICENSE FILE"] = sourcePath; + bool openSource = false; + bool hasOpenSource = QFile::exists(dictionary["LICENSE FILE"] + "/LICENSE.GPL3") || QFile::exists(dictionary["LICENSE FILE"] + "/LICENSE.LGPL"); if (dictionary["BUILDNOKIA"] == "yes" || dictionary["BUILDTYPE"] == "commercial") { openSource = false; } else if (dictionary["BUILDTYPE"] == "opensource") { openSource = true; - } else { + } else if (hasOpenSource) { // No Open Source? Just display the commercial license right away forever { char accept = '?'; cout << "Which edition of Qt do you want to use ?" << endl; @@ -3506,28 +3509,23 @@ void Configure::readLicense() } } } - if (openSource) { - dictionary["LICENSE FILE"] = sourcePath; - if (QFile::exists(dictionary["LICENSE FILE"] + "/LICENSE.GPL3") || QFile::exists(dictionary["LICENSE FILE"] + "/LICENSE.LGPL")) { - cout << endl << "This is the " << dictionary["PLATFORM NAME"] << " Open Source Edition." << endl; - licenseInfo["LICENSEE"] = "Open Source"; - dictionary["EDITION"] = "OpenSource"; - dictionary["QT_EDITION"] = "QT_EDITION_OPENSOURCE"; - cout << endl; - if (!showLicense(dictionary["LICENSE FILE"])) { - cout << "Configuration aborted since license was not accepted"; - dictionary["DONE"] = "error"; - return; - } + if (hasOpenSource && openSource) { + cout << endl << "This is the " << dictionary["PLATFORM NAME"] << " Open Source Edition." << endl; + licenseInfo["LICENSEE"] = "Open Source"; + dictionary["EDITION"] = "OpenSource"; + dictionary["QT_EDITION"] = "QT_EDITION_OPENSOURCE"; + cout << endl; + if (!showLicense(dictionary["LICENSE FILE"])) { + cout << "Configuration aborted since license was not accepted"; + dictionary["DONE"] = "error"; return; } -#ifndef COMMERCIAL_VERSION - else { - cout << endl << "Cannot find the GPL license files!" << endl; + } else if (openSource) { + cout << endl << "Cannot find the GPL license files! Please download the Open Source version of the library." << endl; dictionary["DONE"] = "error"; } -#else - } else { +#ifdef COMMERCIAL_VERSION + else { Tools::checkLicense(dictionary, licenseInfo, firstLicensePath()); if (dictionary["DONE"] != "error" && dictionary["BUILDNOKIA"] != "yes") { // give the user some feedback, and prompt for license acceptance @@ -3539,7 +3537,12 @@ void Configure::readLicense() } } } -#endif // COMMERCIAL_VERSION +#else // !COMMERCIAL_VERSION + else { + cout << endl << "Cannot build commercial edition from the open source version of the library." << endl; + dictionary["DONE"] = "error"; + } +#endif } void Configure::reloadCmdLine() -- cgit v0.12 From 87acb1722d9db66aa01d238b6e4ac90dfe095ff0 Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Fri, 29 May 2009 09:25:59 +0200 Subject: New configure.exe binary Task-number: 254451 Reviewed-by: trustme BT: yes --- configure.exe | Bin 856064 -> 856064 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/configure.exe b/configure.exe index 40843b4..9da5c60 100644 Binary files a/configure.exe and b/configure.exe differ -- cgit v0.12 From 909f96a4f92ad3c9fed1dc4c3873b638421568b0 Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Fri, 29 May 2009 10:07:06 +0200 Subject: Remove the fixFilename() usage from the solution generator Only the Solution Generator was using the fixFilename() function, so under some circumstances the solution filename wouldn't find the correct vcproj file to include. This created a problem with network-chat.vcproj. Task-number: 254772 Reviewed-by: joao --- qmake/generators/win32/msvc_vcproj.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 8901289..13bc05b 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -574,7 +574,7 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) } // We assume project filename is [QMAKE_ORIG_TARGET].vcproj - QString vcproj = unescapeFilePath(fixFilename(tmp_vcproj.project->first("QMAKE_ORIG_TARGET")) + project->first("VCPROJ_EXTENSION")); + QString vcproj = unescapeFilePath(tmp_vcproj.project->first("QMAKE_ORIG_TARGET") + project->first("VCPROJ_EXTENSION")); QString vcprojDir = qmake_getpwd(); // If file doesn't exsist, then maybe the users configuration -- cgit v0.12 From 8147373cc6234dbbefb0edaa9a3d987294b8a889 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Fri, 29 May 2009 12:20:40 +0300 Subject: Support for SSL symbol runtime resolving in Symbian. The commit enables -openssl config in addition to -openssl-linked in Symbian OS platforms. In Symbian OS the symbol names are stripped away from DLLand symbols are are referenced via ordinal numbers. This change resolves the correct ordinals for SSL symbols in Symbian OS. The change is a bit hackish, but is currently only way to resolve symbols at runtime in Symbian OS - if STDDLL targettype is not counted. The problem of STDDLL target type is that it is not supported by S60 3.1 and in addition the SSL libraries in S60 are not currently build with STDDLL target but DLL target. This mechanism should work as long as BC for SSL symbols is kept. And S60 has given binary promise, so we should not have problems... --- src/network/ssl/qsslsocket_openssl_symbols.cpp | 145 +++++++++++++++++++++++++ 1 file changed, 145 insertions(+) diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp index 42c09f5..d083765 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols.cpp +++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp @@ -231,10 +231,16 @@ DEFINEFUNC3(DSA *, d2i_DSAPrivateKey, DSA **a, a, unsigned char **b, b, long c, DEFINEFUNC(void, OPENSSL_add_all_algorithms_noconf, void, DUMMYARG, return, DUMMYARG) DEFINEFUNC(void, OPENSSL_add_all_algorithms_conf, void, DUMMYARG, return, DUMMYARG) +#ifdef Q_OS_SYMBIAN +#define RESOLVEFUNC(func, ordinal, lib) \ + if (!(_q_##func = _q_PTR_##func(lib->resolve(#ordinal)))) \ + qWarning("QSslSocket: cannot resolve "#func); +#else #define RESOLVEFUNC(func) \ if (!(_q_##func = _q_PTR_##func(libs.first->resolve(#func))) \ && !(_q_##func = _q_PTR_##func(libs.second->resolve(#func)))) \ qWarning("QSslSocket: cannot resolve "#func); +#endif #if !defined QT_LINKED_OPENSSL @@ -335,7 +341,24 @@ static QPair loadOpenSsl() pair.first = ssleay32; pair.second = libeay32; return pair; +# elif defined(Q_OS_SYMBIAN) + QLibrary *libssl = new QLibrary(QLatin1String("libssl")); + if (!libssl->load()) { + // Cannot find ssleay32.dll + delete libssl; + return pair; + } + QLibrary *libcrypto = new QLibrary(QLatin1String("libcrypto")); + if (!libcrypto->load()) { + delete libcrypto; + delete libssl; + return pair; + } + + pair.first = libssl; + pair.second = libcrypto; + return pair; # elif defined(Q_OS_UNIX) QLibrary *&libssl = pair.first; QLibrary *&libcrypto = pair.second; @@ -437,6 +460,127 @@ bool q_resolveOpenSslSymbols() // failed to load them return false; +#ifdef Q_OS_SYMBIAN +#ifdef SSLEAY_MACROS + RESOLVEFUNC(ASN1_dup, 125, libs.second ) +#endif + RESOLVEFUNC(ASN1_STRING_data, 71, libs.second ) + RESOLVEFUNC(ASN1_STRING_length, 76, libs.second ) + RESOLVEFUNC(BIO_ctrl, 184, libs.second ) + RESOLVEFUNC(BIO_free, 210, libs.second ) + RESOLVEFUNC(BIO_new, 222, libs.second ) + RESOLVEFUNC(BIO_new_mem_buf, 230, libs.second ) + RESOLVEFUNC(BIO_read, 244, libs.second ) + RESOLVEFUNC(BIO_s_mem, 251, libs.second ) + RESOLVEFUNC(BIO_write, 269, libs.second ) + RESOLVEFUNC(BN_num_bits, 387, libs.second ) + RESOLVEFUNC(CRYPTO_free, 469, libs.second ) + RESOLVEFUNC(CRYPTO_num_locks, 500, libs.second ) + RESOLVEFUNC(CRYPTO_set_id_callback, 513, libs.second ) + RESOLVEFUNC(CRYPTO_set_locking_callback, 516, libs.second ) + RESOLVEFUNC(DSA_free, 594, libs.second ) + RESOLVEFUNC(ERR_error_string, 744, libs.second ) + RESOLVEFUNC(ERR_get_error, 749, libs.second ) + RESOLVEFUNC(EVP_des_ede3_cbc, 919, libs.second ) + RESOLVEFUNC(EVP_PKEY_assign, 859, libs.second ) + RESOLVEFUNC(EVP_PKEY_free, 867, libs.second ) + RESOLVEFUNC(EVP_PKEY_get1_DSA, 869, libs.second ) + RESOLVEFUNC(EVP_PKEY_get1_RSA, 870, libs.second ) + RESOLVEFUNC(EVP_PKEY_new, 876, libs.second ) + RESOLVEFUNC(EVP_PKEY_type, 882, libs.second ) + RESOLVEFUNC(OBJ_nid2sn, 1036, libs.second ) + RESOLVEFUNC(OBJ_obj2nid, 1037, libs.second ) +#ifdef SSLEAY_MACROS // ### verify + RESOLVEFUNC(PEM_ASN1_read_bio, 1180, libs.second ) +#else + RESOLVEFUNC(PEM_read_bio_DSAPrivateKey, 1219, libs.second ) + RESOLVEFUNC(PEM_read_bio_RSAPrivateKey, 1228, libs.second ) + RESOLVEFUNC(PEM_write_bio_DSAPrivateKey, 1260, libs.second ) + RESOLVEFUNC(PEM_write_bio_RSAPrivateKey, 1271, libs.second ) +#endif + RESOLVEFUNC(PEM_read_bio_DSA_PUBKEY, 1220, libs.second ) + RESOLVEFUNC(PEM_read_bio_RSA_PUBKEY, 1230, libs.second ) + RESOLVEFUNC(PEM_write_bio_DSA_PUBKEY, 1261, libs.second ) + RESOLVEFUNC(PEM_write_bio_RSA_PUBKEY, 1273, libs.second ) + RESOLVEFUNC(RAND_seed, 1426, libs.second ) + RESOLVEFUNC(RAND_status, 1429, libs.second ) + RESOLVEFUNC(RSA_free, 1450, libs.second ) + RESOLVEFUNC(sk_free, 2571, libs.second ) + RESOLVEFUNC(sk_num, 2576, libs.second ) + RESOLVEFUNC(sk_value, 2585, libs.second ) + RESOLVEFUNC(SSL_CIPHER_description, 11, libs.first ) + RESOLVEFUNC(SSL_CTX_check_private_key, 21, libs.first ) + RESOLVEFUNC(SSL_CTX_ctrl, 22, libs.first ) + RESOLVEFUNC(SSL_CTX_free, 24, libs.first ) + RESOLVEFUNC(SSL_CTX_new, 35, libs.first ) + RESOLVEFUNC(SSL_CTX_set_cipher_list, 40, libs.first ) + RESOLVEFUNC(SSL_CTX_set_default_verify_paths, 44, libs.first ) + RESOLVEFUNC(SSL_CTX_set_verify, 56, libs.first ) + RESOLVEFUNC(SSL_CTX_set_verify_depth, 57, libs.first ) + RESOLVEFUNC(SSL_CTX_use_certificate, 64, libs.first ) + RESOLVEFUNC(SSL_CTX_use_certificate_file, 67, libs.first ) + RESOLVEFUNC(SSL_CTX_use_PrivateKey, 58, libs.first ) + RESOLVEFUNC(SSL_CTX_use_RSAPrivateKey, 61, libs.first ) + RESOLVEFUNC(SSL_CTX_use_PrivateKey_file, 60, libs.first ) + RESOLVEFUNC(SSL_accept, 82, libs.first ) + RESOLVEFUNC(SSL_clear, 92, libs.first ) + RESOLVEFUNC(SSL_connect, 93, libs.first ) + RESOLVEFUNC(SSL_free, 99, libs.first ) + RESOLVEFUNC(SSL_get_ciphers, 104, libs.first ) + RESOLVEFUNC(SSL_get_current_cipher, 106, libs.first ) + RESOLVEFUNC(SSL_get_error, 110, libs.first ) + RESOLVEFUNC(SSL_get_peer_cert_chain, 117, libs.first ) + RESOLVEFUNC(SSL_get_peer_certificate, 118, libs.first ) + RESOLVEFUNC(SSL_get_verify_result, 132, libs.first ) + RESOLVEFUNC(SSL_library_init, 137, libs.first ) + RESOLVEFUNC(SSL_load_error_strings, 139, libs.first ) + RESOLVEFUNC(SSL_new, 140, libs.first ) + RESOLVEFUNC(SSL_read, 143, libs.first ) + RESOLVEFUNC(SSL_set_accept_state, 148, libs.first ) + RESOLVEFUNC(SSL_set_bio, 149, libs.first ) + RESOLVEFUNC(SSL_set_connect_state, 152, libs.first ) + RESOLVEFUNC(SSL_shutdown, 173, libs.first ) + RESOLVEFUNC(SSL_write, 188, libs.first ) + RESOLVEFUNC(SSLv2_client_method, 192, libs.first ) + RESOLVEFUNC(SSLv3_client_method, 195, libs.first ) + RESOLVEFUNC(SSLv23_client_method, 189, libs.first ) + RESOLVEFUNC(TLSv1_client_method, 198, libs.first ) + RESOLVEFUNC(SSLv2_server_method, 194, libs.first ) + RESOLVEFUNC(SSLv3_server_method, 197, libs.first ) + RESOLVEFUNC(SSLv23_server_method, 191, libs.first ) + RESOLVEFUNC(TLSv1_server_method, 200, libs.first ) + RESOLVEFUNC(X509_NAME_oneline, 1830, libs.second ) + RESOLVEFUNC(X509_PUBKEY_get, 1844, libs.second ) + RESOLVEFUNC(X509_STORE_free, 1939, libs.second ) + RESOLVEFUNC(X509_STORE_new, 1942, libs.second ) + RESOLVEFUNC(X509_STORE_add_cert, 1936, libs.second ) + RESOLVEFUNC(X509_STORE_CTX_free, 1907, libs.second ) + RESOLVEFUNC(X509_STORE_CTX_init, 1919, libs.second ) + RESOLVEFUNC(X509_STORE_CTX_new, 1920, libs.second ) + RESOLVEFUNC(X509_STORE_CTX_set_purpose, 1931, libs.second ) + RESOLVEFUNC(X509_cmp, 1992, libs.second ) +#ifndef SSLEAY_MACROS + RESOLVEFUNC(X509_dup, 1997, libs.second ) +#endif + RESOLVEFUNC(X509_EXTENSION_get_object, 1785, libs.second ) + RESOLVEFUNC(X509_free, 2001, libs.second ) + RESOLVEFUNC(X509_get_ext, 2012, libs.second ) + RESOLVEFUNC(X509_get_ext_count, 2016, libs.second ) + RESOLVEFUNC(X509_get_ext_d2i, 2017, libs.second ) + RESOLVEFUNC(X509_get_issuer_name, 2018, libs.second ) + RESOLVEFUNC(X509_get_subject_name, 2022, libs.second ) + RESOLVEFUNC(X509_verify_cert, 2069, libs.second ) + RESOLVEFUNC(d2i_X509, 2309, libs.second ) + RESOLVEFUNC(i2d_X509, 2489, libs.second ) +#ifdef SSLEAY_MACROS + RESOLVEFUNC(i2d_DSAPrivateKey, 2395, libs.second ) + RESOLVEFUNC(i2d_RSAPrivateKey, 2476, libs.second ) + RESOLVEFUNC(d2i_DSAPrivateKey, 2220, libs.second ) + RESOLVEFUNC(d2i_RSAPrivateKey, 2296, libs.second ) +#endif + RESOLVEFUNC(OPENSSL_add_all_algorithms_noconf, 1153, libs.second ) + RESOLVEFUNC(OPENSSL_add_all_algorithms_conf, 1152, libs.second ) +#else // Q_OS_SYMBIAN #ifdef SSLEAY_MACROS RESOLVEFUNC(ASN1_dup) #endif @@ -556,6 +700,7 @@ bool q_resolveOpenSslSymbols() #endif RESOLVEFUNC(OPENSSL_add_all_algorithms_noconf) RESOLVEFUNC(OPENSSL_add_all_algorithms_conf) +#endif // Q_OS_SYMBIAN symbolsResolved = true; delete libs.first; delete libs.second; -- cgit v0.12 From 0e9566f108c1fa25914cbb7717d1701e8f163e01 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Fri, 29 May 2009 13:34:03 +0300 Subject: Oops typo in my previous commit: 8137373. Correct ordinal for BIO_free symbol is 209. --- src/network/ssl/qsslsocket_openssl_symbols.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp index d083765..0723822 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols.cpp +++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp @@ -467,7 +467,7 @@ bool q_resolveOpenSslSymbols() RESOLVEFUNC(ASN1_STRING_data, 71, libs.second ) RESOLVEFUNC(ASN1_STRING_length, 76, libs.second ) RESOLVEFUNC(BIO_ctrl, 184, libs.second ) - RESOLVEFUNC(BIO_free, 210, libs.second ) + RESOLVEFUNC(BIO_free, 209, libs.second ) RESOLVEFUNC(BIO_new, 222, libs.second ) RESOLVEFUNC(BIO_new_mem_buf, 230, libs.second ) RESOLVEFUNC(BIO_read, 244, libs.second ) -- cgit v0.12 From 13815a0768236982a025833497d3e2a2f3b6acf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Fri, 29 May 2009 12:35:40 +0200 Subject: Fixed a crash in the GL 2 paintengine when drawing text. The new glyph cache may return null images for e.g. space characters. Task-number: 253468 Reviewed-by: Samuel BT: yes --- src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index a74f044..beb4da6 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -926,6 +926,9 @@ void QGL2PaintEngineEx::drawCachedGlyphs(const QPointF &p, const QTextItemInt &t const QImage &image = cache->image(); int margin = cache->glyphMargin(); + if (image.isNull()) + return; + glActiveTexture(QT_BRUSH_TEXTURE_UNIT); d->ctx->d_func()->bindTexture(image, GL_TEXTURE_2D, GL_RGBA, true); -- cgit v0.12 From ec532841421ec261ea30b22e26d12c5c77ef52a2 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Fri, 29 May 2009 13:39:41 +0300 Subject: Enabled runtime resolving of OpenSSL symbols by default in Symbian OS. We cannot use -openssl-linked to create official SIS packages, due to US export regulations or some legal issues. That's why Open SSL symbols are resolved at runtime. The runtime resolving of OpenSSL symbols is default behaviour on other platforms as well. --- configure.exe | Bin 868352 -> 1183744 bytes confqt.bat | 2 +- confsbsv2.bat | 2 +- tools/configure/configureapp.cpp | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.exe b/configure.exe index 65db048..f2a2cb5 100755 Binary files a/configure.exe and b/configure.exe differ diff --git a/confqt.bat b/confqt.bat index 5da9592..b1474a7 100644 --- a/confqt.bat +++ b/confqt.bat @@ -1 +1 @@ -configure -platform win32-mwc -xplatform symbian-abld -openssl-linked -qt-sql-sqlite -system-sqlite -nokia-developer %* +configure -platform win32-mwc -xplatform symbian-abld -qt-sql-sqlite -system-sqlite -nokia-developer %* diff --git a/confsbsv2.bat b/confsbsv2.bat index 6c9bc1a..f3a8424 100644 --- a/confsbsv2.bat +++ b/confsbsv2.bat @@ -1 +1 @@ -configure -platform win32-mwc -xplatform symbian-sbsv2 -openssl-linked -qt-sql-sqlite -system-sqlite -nokia-developer %* +configure -platform win32-mwc -xplatform symbian-sbsv2 -qt-sql-sqlite -system-sqlite -nokia-developer %* diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 40caff0..9b44fb5 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1404,7 +1404,7 @@ void Configure::applySpecSpecifics() dictionary[ "FREETYPE" ] = "no"; dictionary[ "QT3SUPPORT" ] = "no"; dictionary[ "OPENGL" ] = "no"; - dictionary[ "OPENSSL" ] = "no"; + dictionary[ "OPENSSL" ] = "yes"; dictionary[ "STL" ] = "yes"; dictionary[ "EXCEPTIONS" ] = "no"; dictionary[ "RTTI" ] = "no"; -- cgit v0.12 From 5cb3d14a9b1a573dbbdaf48d19492192f5978c9d Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 29 May 2009 12:44:02 +0200 Subject: Recompiled configure.exe with MSVC6. --- configure.exe | Bin 1183744 -> 868352 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/configure.exe b/configure.exe index f2a2cb5..15a4d66 100755 Binary files a/configure.exe and b/configure.exe differ -- cgit v0.12 From 28305c37a1874be6919c316be03fff2aaf3d94cb Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Fri, 29 May 2009 15:54:00 +0200 Subject: Remove unused variable. --- src/gui/kernel/qwidget_x11.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp index e00c37c..6250fb77 100644 --- a/src/gui/kernel/qwidget_x11.cpp +++ b/src/gui/kernel/qwidget_x11.cpp @@ -1509,7 +1509,6 @@ QWidget *QWidget::keyboardGrabber() void QWidget::activateWindow() { - Q_D(QWidget); QWidget *tlw = window(); if (tlw->isVisible() && !tlw->d_func()->topData()->embedded && !X11->deferred_map.contains(tlw)) { if (X11->userTime == 0) -- cgit v0.12 From 235818fdac5faf0d38f9b37c7bd5ee522935aed1 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Fri, 29 May 2009 10:11:29 +0200 Subject: Removed nested comment signature in the doc to fix a warning. Reviewed-by: David Boddie --- src/corelib/kernel/qobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index f1a1eb5..7e5f779 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -2066,7 +2066,7 @@ void QObject::deleteLater() or - \tt{/*: ... \starslash} + \tt{\begincomment: ... \endcomment} Examples: -- cgit v0.12 From 8506cc8ce89c23fbfe27f9fb4d4e0cd7c90e9b24 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 29 May 2009 16:23:06 +0200 Subject: Making hasSoftKeyStack() const. +coding conventions. --- src/gui/widgets/qmainwindow.cpp | 14 ++++++-------- src/gui/widgets/qmainwindow.h | 5 ++--- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index 618023e..6843d4e 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -67,7 +67,7 @@ QT_END_NAMESPACE #endif #ifndef QT_NO_SOFTKEYSTACK -#include +#include #endif QT_BEGIN_NAMESPACE @@ -85,7 +85,7 @@ public: , hasOldCursor(false) , cursorAdjusted(false) #endif #ifndef QT_NO_SOFTKEYSTACK - , softKeyStack(0) + , softKeyStack(0) #endif { } QMainWindowLayout *layout; @@ -108,7 +108,7 @@ public: #endif #ifndef QT_NO_SOFTKEYSTACK - QSoftKeyStack* softKeyStack; + QSoftKeyStack *softKeyStack; #endif }; @@ -565,12 +565,10 @@ void QMainWindow::setSoftKeyStack(QSoftKeyStack *softKeyStack) \sa softKeyStack() */ -bool QMainWindow::hasSoftKeyStack() +bool QMainWindow::hasSoftKeyStack() const { - Q_D(QMainWindow); - if (d->softKeyStack ) - return true; - return false; + Q_D(const QMainWindow); + return d->softKeyStack != 0; } #endif // QT_NO_SOFTKEYSTACK diff --git a/src/gui/widgets/qmainwindow.h b/src/gui/widgets/qmainwindow.h index 01b275e..81457d6 100644 --- a/src/gui/widgets/qmainwindow.h +++ b/src/gui/widgets/qmainwindow.h @@ -59,9 +59,8 @@ class QMenuBar; class QStatusBar; class QToolBar; class QMenu; -#ifndef QT_NO_SOFTKEYSTACK class QSoftKeyStack; -#endif + class Q_GUI_EXPORT QMainWindow : public QWidget { Q_OBJECT @@ -135,7 +134,7 @@ public: #ifndef QT_NO_SOFTKEYSTACK QSoftKeyStack *softKeyStack() const; void setSoftKeyStack(QSoftKeyStack *softKeyStack); - bool hasSoftKeyStack(); + bool hasSoftKeyStack() const; #endif #ifndef QT_NO_STATUSBAR -- cgit v0.12 From 42fbf668b6da3251aea2ce27a25882437b9a4a06 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 29 May 2009 16:40:27 +0200 Subject: Pulled helper menuActionList() out of QSoftKeyStack::handleFocusChanged. It is also needed in other places. --- src/gui/widgets/qsoftkeystack.cpp | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index 984922e..c07dd9e 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -177,6 +177,21 @@ bool QSoftKeyStack::isEmpty() return d->isEmpty(); } +QList menuActionList(QWidget *widget) +{ + QList result; + + QSoftKeyAction* menu = new QSoftKeyAction(QSoftKeyAction::Menu, QString::fromLatin1("Menu"), widget); + result.append(menu); + const Qt::ContextMenuPolicy policy = widget->contextMenuPolicy(); + if (policy != Qt::NoContextMenu && policy != Qt::PreventContextMenu ) { + QSoftKeyAction* contextMenu = new QSoftKeyAction(QSoftKeyAction::ContextMenu, QString::fromLatin1("ContextMenu"), widget); + result.append(contextMenu); + } + + return result; +} + void QSoftKeyStack::handleFocusChanged(QWidget *old, QWidget *now) { if (!now) @@ -188,17 +203,8 @@ void QSoftKeyStack::handleFocusChanged(QWidget *old, QWidget *now) if (!mainWindow->hasSoftKeyStack()) return; QSoftKeyStack* softKeyStack = mainWindow->softKeyStack(); - if( mainWindow->menuWidget() ) - { - QList actionList; - QSoftKeyAction* menu = new QSoftKeyAction(QSoftKeyAction::Menu, QString::fromLatin1("Menu"), now); - actionList.append(menu); - - Qt::ContextMenuPolicy policy = now->contextMenuPolicy(); - if (policy != Qt::NoContextMenu && policy != Qt::PreventContextMenu ) { - QSoftKeyAction* contextMenu = new QSoftKeyAction(QSoftKeyAction::ContextMenu, QString::fromLatin1("ContextMenu"), now); - actionList.append(contextMenu); - } + if (mainWindow->menuWidget()) { + QList actionList = menuActionList(now); if (old) softKeyStack->popandPush(actionList); else -- cgit v0.12 From dc599015e702320cbb868855ba76f37d264dc074 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 29 May 2009 17:08:32 +0200 Subject: Append and push the softKey instead of the empty list --- src/gui/widgets/qsoftkeystack.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index c07dd9e..0c5648e 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -100,7 +100,7 @@ void QSoftKeyStackPrivate::popandPush(QSoftKeyAction *softKey) { QSoftkeySet oldSoftKeySet = softKeyStack.pop(); QSoftkeySet newSoftKeySet; - newSoftKeySet.append(newSoftKeySet); + newSoftKeySet.append(softKey); softKeyStack.push(newSoftKeySet); if( !isSame(oldSoftKeySet, newSoftKeySet)) setNativeSoftKeys(); -- cgit v0.12 From afef05497be340509ffb604ab23d7d036bc363ea Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 29 May 2009 18:33:30 +0200 Subject: Implemented QKeyEventSoftKey::removeSoftkey and using it in QAbstractItemView::keyPressEvent to remove the "Back" key. --- src/gui/itemviews/qabstractitemview.cpp | 3 +-- src/gui/widgets/qsoftkeystack.cpp | 11 ++++++++++- src/gui/widgets/qsoftkeystack_p.h | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index 6e24c85..565bc28 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -2013,8 +2013,7 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event) break; case Qt::Key_Back: if (QApplication::keypadNavigationEnabled() && hasEditFocus()) { - if (QSoftKeyStack *stack = QSoftKeyStack::softKeyStackOfWidget(this)) - stack->pop(); + QKeyEventSoftKey::removeSoftkey(this); setEditFocus(false); } else { event->ignore(); diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index 0c5648e..db9b7a2 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -284,7 +284,16 @@ void QKeyEventSoftKey::addSoftKey(QSoftKeyAction::StandardRole standardRole, Qt: QSoftKeyAction *action = new QSoftKeyAction(standardRole, actionWidget); QKeyEventSoftKey *softKey = new QKeyEventSoftKey(action, key, actionWidget); connect(action, SIGNAL(triggered()), softKey, SLOT(sendKeyEvent())); - stack->push(action); + stack->popandPush(action); +} + +void QKeyEventSoftKey::removeSoftkey(QWidget *focussedWidget) +{ + QSoftKeyStack *stack = QSoftKeyStack::softKeyStackOfWidget(focussedWidget); + if (!stack) + return; + QList actionList = menuActionList(focussedWidget); + stack->popandPush(actionList); } void QKeyEventSoftKey::sendKeyEvent() diff --git a/src/gui/widgets/qsoftkeystack_p.h b/src/gui/widgets/qsoftkeystack_p.h index 75d7ad4..c9d7f8d 100644 --- a/src/gui/widgets/qsoftkeystack_p.h +++ b/src/gui/widgets/qsoftkeystack_p.h @@ -98,6 +98,7 @@ class QKeyEventSoftKey : QObject public: QKeyEventSoftKey(QSoftKeyAction *softKeyAction, Qt::Key key, QObject *parent); static void addSoftKey(QSoftKeyAction::StandardRole standardRole, Qt::Key key, QWidget *actionWidget); + static void removeSoftkey(QWidget *focussedWidget); private: QSoftKeyAction *m_softKeyAction; Qt::Key m_key; -- cgit v0.12 From 5f1ec2a20d13b9ca9bae1b7b40692925dcd99051 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Fri, 29 May 2009 11:17:11 -0700 Subject: Don't support porter duff |= source over DirectFB and Qt treats these things rather differently so the mapping just doesn't work very well. Only use DirectFB for SourceOver stuff (which is the default mode anyway) Reviewed-by: Donald --- .../gfxdrivers/directfb/qdirectfbpaintengine.cpp | 120 +++++---------------- 1 file changed, 24 insertions(+), 96 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index 7535090..2fb533a 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -215,8 +215,8 @@ public: void setTransform(const QTransform &m); void setPen(const QPen &pen); - void setCompositionMode(QPainter::CompositionMode mode); - void setOpacity(quint8 value); + inline void setCompositionMode(QPainter::CompositionMode mode); + inline void setOpacity(quint8 value); void setRenderHints(QPainter::RenderHints hints); inline void setDFBColor(const QColor &color); @@ -276,14 +276,12 @@ private: quint8 opacity; - quint32 drawFlagsFromCompositionMode, blitFlagsFromCompositionMode; - DFBSurfacePorterDuffRule porterDuffRule; - bool dirtyClip; bool dfbHandledClip; bool ignoreSystemClip; QDirectFBPaintDevice *dfbDevice; void *lockedMemory; + bool unsupportedCompositionMode; QDirectFBPaintEngine *q; friend class QDirectFBPaintEngine; @@ -403,7 +401,7 @@ void QDirectFBPaintEngine::drawRects(const QRect *rects, int rectCount) Q_D(QDirectFBPaintEngine); d->updateClip(); const QBrush &brush = state()->brush; - if (!d->dfbCanHandleClip() || d->matrixRotShear + if (d->unsupportedCompositionMode || !d->dfbCanHandleClip() || d->matrixRotShear || !d->simplePen || !d->isSimpleBrush(brush)) { RASTERFALLBACK(DRAW_RECTS, rectCount, VOID_ARG(), VOID_ARG()); d->lock(); @@ -428,7 +426,7 @@ void QDirectFBPaintEngine::drawRects(const QRectF *rects, int rectCount) Q_D(QDirectFBPaintEngine); d->updateClip(); const QBrush &brush = state()->brush; - if (!d->dfbCanHandleClip() || d->matrixRotShear + if (d->unsupportedCompositionMode || !d->dfbCanHandleClip() || d->matrixRotShear || !d->simplePen || !d->isSimpleBrush(brush)) { RASTERFALLBACK(DRAW_RECTS, rectCount, VOID_ARG(), VOID_ARG()); d->lock(); @@ -452,7 +450,7 @@ void QDirectFBPaintEngine::drawLines(const QLine *lines, int lineCount) { Q_D(QDirectFBPaintEngine); d->updateClip(); - if (!d->simplePen || !d->dfbCanHandleClip()) { + if (d->unsupportedCompositionMode || !d->simplePen || !d->dfbCanHandleClip()) { RASTERFALLBACK(DRAW_LINES, lineCount, VOID_ARG(), VOID_ARG()); d->lock(); QRasterPaintEngine::drawLines(lines, lineCount); @@ -470,7 +468,7 @@ void QDirectFBPaintEngine::drawLines(const QLineF *lines, int lineCount) { Q_D(QDirectFBPaintEngine); d->updateClip(); - if (!d->simplePen || !d->dfbCanHandleClip()) { + if (d->unsupportedCompositionMode || !d->simplePen || !d->dfbCanHandleClip()) { RASTERFALLBACK(DRAW_LINES, lineCount, VOID_ARG(), VOID_ARG()); d->lock(); QRasterPaintEngine::drawLines(lines, lineCount); @@ -510,7 +508,8 @@ void QDirectFBPaintEngine::drawImage(const QRectF &r, const QImage &image, d->updateClip(); #if !defined QT_NO_DIRECTFB_PREALLOCATED || defined QT_DIRECTFB_IMAGECACHE - if (d->matrixRotShear + if (d->unsupportedCompositionMode + || d->matrixRotShear || d->scale == QDirectFBPaintEnginePrivate::NegativeScale || !d->dfbCanHandleClip(r) #ifndef QT_DIRECTFB_IMAGECACHE @@ -554,7 +553,7 @@ void QDirectFBPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pixmap, RASTERFALLBACK(DRAW_PIXMAP, r, pixmap.size(), sr); d->lock(); QRasterPaintEngine::drawPixmap(r, pixmap, sr); - } else if (!d->dfbCanHandleClip(r) || d->matrixRotShear + } else if (d->unsupportedCompositionMode || !d->dfbCanHandleClip(r) || d->matrixRotShear || d->scale == QDirectFBPaintEnginePrivate::NegativeScale) { RASTERFALLBACK(DRAW_PIXMAP, r, pixmap.size(), sr); const QImage *img = static_cast(pixmap.pixmapData())->buffer(DSLF_READ); @@ -586,7 +585,7 @@ void QDirectFBPaintEngine::drawTiledPixmap(const QRectF &r, RASTERFALLBACK(DRAW_TILED_PIXMAP, r, pixmap.size(), sp); d->lock(); QRasterPaintEngine::drawTiledPixmap(r, pixmap, sp); - } else if (!d->dfbCanHandleClip(r) || d->matrixRotShear || !sp.isNull() + } else if (d->unsupportedCompositionMode || !d->dfbCanHandleClip(r) || d->matrixRotShear || !sp.isNull() || d->scale == QDirectFBPaintEnginePrivate::NegativeScale) { RASTERFALLBACK(DRAW_TILED_PIXMAP, r, pixmap.size(), sp); const QImage *img = static_cast(pixmap.pixmapData())->buffer(DSLF_READ); @@ -682,7 +681,7 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QBrush &brush) { Q_D(QDirectFBPaintEngine); d->updateClip(); - if (d->dfbCanHandleClip(rect) && !d->matrixRotShear) { + if (!d->unsupportedCompositionMode && d->dfbCanHandleClip(rect) && !d->matrixRotShear) { switch (brush.style()) { case Qt::SolidPattern: { d->unlock(); @@ -712,7 +711,7 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QColor &color) { Q_D(QDirectFBPaintEngine); d->updateClip(); - if (!d->dfbCanHandleClip() || d->matrixRotShear) { + if (d->unsupportedCompositionMode || !d->dfbCanHandleClip() || d->matrixRotShear) { RASTERFALLBACK(FILL_RECT, rect, color, VOID_ARG()); d->lock(); QRasterPaintEngine::fillRect(rect, color); @@ -791,9 +790,9 @@ void QDirectFBPaintEngine::initImageCache(int size) QDirectFBPaintEnginePrivate::QDirectFBPaintEnginePrivate(QDirectFBPaintEngine *p) : surface(0), antialiased(false), simplePen(false), matrixRotShear(false), scale(NoScale), lastLockedHeight(-1), - fbWidth(-1), fbHeight(-1), opacity(255), drawFlagsFromCompositionMode(0), - blitFlagsFromCompositionMode(0), porterDuffRule(DSPD_SRC_OVER), dirtyClip(true), - dfbHandledClip(false), dfbDevice(0), lockedMemory(0), q(p) + fbWidth(-1), fbHeight(-1), opacity(255), dirtyClip(true), + dfbHandledClip(false), dfbDevice(0), lockedMemory(0), + unsupportedCompositionMode(false), q(p) { fb = QDirectFBScreen::instance()->dfb(); ignoreSystemClip = QDirectFBScreen::instance()->directFBFlags() & QDirectFBScreen::IgnoreSystemClip; @@ -887,7 +886,7 @@ void QDirectFBPaintEnginePrivate::begin(QPaintDevice *device) setTransform(QTransform()); antialiased = false; - opacity = 255; + setOpacity(255); setCompositionMode(q->state()->compositionMode()); dirtyClip = true; setPen(q->state()->pen); @@ -915,72 +914,13 @@ void QDirectFBPaintEnginePrivate::setPen(const QPen &p) void QDirectFBPaintEnginePrivate::setCompositionMode(QPainter::CompositionMode mode) { - blitFlagsFromCompositionMode = DSBLIT_NOFX; - drawFlagsFromCompositionMode = DSDRAW_NOFX; - - bool blend = true; - switch (mode) { - case QPainter::CompositionMode_SourceOver: - porterDuffRule = DSPD_SRC_OVER; - break; - case QPainter::CompositionMode_DestinationOver: - porterDuffRule = DSPD_DST_OVER; - break; - case QPainter::CompositionMode_Clear: - porterDuffRule = DSPD_CLEAR; - blend = false; - break; - case QPainter::CompositionMode_Source: - porterDuffRule = DSPD_SRC; - blend = false; - break; - case QPainter::CompositionMode_Destination: - porterDuffRule = DSPD_NONE; // ### need to double check this - blend = false; - return; - case QPainter::CompositionMode_SourceIn: - porterDuffRule = DSPD_SRC_IN; - break; - case QPainter::CompositionMode_DestinationIn: - porterDuffRule = DSPD_DST_IN; - break; - case QPainter::CompositionMode_SourceOut: - porterDuffRule = DSPD_SRC_OUT; - break; - case QPainter::CompositionMode_DestinationOut: - porterDuffRule = DSPD_DST_OUT; - break; - case QPainter::CompositionMode_Xor: - porterDuffRule = DSPD_XOR; - blitFlagsFromCompositionMode |= DSBLIT_XOR; - drawFlagsFromCompositionMode |= DSDRAW_XOR; - break; -// case QPainter::CompositionMode_Plus: // ??? -// porterDuffRule = DSPD_ADD; -// break; - default: - qWarning("QDirectFBPaintEnginePrivate::setCompositionMode(): " - "mode %d not implemented", mode); - return; - } - // intentially not comparing with current porterDuffRule. surface might have changed. - if (blend) { - blitFlagsFromCompositionMode |= DSBLIT_BLEND_ALPHACHANNEL; - drawFlagsFromCompositionMode |= DSDRAW_BLEND; - } - if (opacity != 255) { - setOpacity(opacity); - } + unsupportedCompositionMode = (mode != QPainter::CompositionMode_SourceOver); } + void QDirectFBPaintEnginePrivate::setOpacity(quint8 op) { opacity = op; - if (opacity == 255) { - blitFlagsFromCompositionMode &= ~DSBLIT_BLEND_COLORALPHA; - } else { - blitFlagsFromCompositionMode |= DSBLIT_BLEND_COLORALPHA; - } } void QDirectFBPaintEnginePrivate::setRenderHints(QPainter::RenderHints hints) @@ -994,15 +934,9 @@ void QDirectFBPaintEnginePrivate::setRenderHints(QPainter::RenderHints hints) void QDirectFBPaintEnginePrivate::prepareForBlit(bool alpha) { - quint32 blittingFlags = blitFlagsFromCompositionMode; - if (alpha) { - surface->SetPorterDuff(surface, - (blittingFlags & DSBLIT_BLEND_COLORALPHA) - ? DSPD_NONE - : porterDuffRule); - } else { - blittingFlags &= ~DSBLIT_BLEND_ALPHACHANNEL; - surface->SetPorterDuff(surface, DSPD_NONE); + quint32 blittingFlags = alpha ? DSBLIT_BLEND_ALPHACHANNEL : DSBLIT_NOFX; + if (opacity != 255) { + blittingFlags |= DSBLIT_BLEND_COLORALPHA; } surface->SetColor(surface, 0xff, 0xff, 0xff, opacity); surface->SetBlittingFlags(surface, DFBSurfaceBlittingFlags(blittingFlags)); @@ -1013,15 +947,9 @@ void QDirectFBPaintEnginePrivate::setDFBColor(const QColor &color) Q_ASSERT(surface); const quint8 alpha = (opacity == 255 ? color.alpha() : ALPHA_MUL(color.alpha(), opacity)); - surface->SetColor(surface, - color.red(), color.green(), color.blue(), alpha); - quint32 drawingFlags = drawFlagsFromCompositionMode; - if (alpha == 255) { - drawingFlags &= ~DSDRAW_BLEND; - } + surface->SetColor(surface, color.red(), color.green(), color.blue(), alpha); surface->SetPorterDuff(surface, DSPD_NONE); - // PorterDuff messes up alpha values for primitives - surface->SetDrawingFlags(surface, DFBSurfaceDrawingFlags(drawingFlags)); + surface->SetDrawingFlags(surface, alpha == 255 ? DSDRAW_NOFX : DSDRAW_BLEND); } void QDirectFBPaintEnginePrivate::drawLines(const QLine *lines, int n) -- cgit v0.12 From 824e8c4decf952b93279dc2c8c58e5d8dc0aa509 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Sat, 30 May 2009 18:48:27 +0200 Subject: Delete the actions in the popped SoftKeySets. --- src/gui/widgets/qsoftkeystack.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index db9b7a2..494471e 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -79,10 +79,9 @@ void QSoftKeyStackPrivate::push(QSoftKeyAction *softKey) { QSoftkeySet softKeySet; softKeySet.append(softKey); - softKeyStack.push(softKeySet); - setNativeSoftKeys(); - + push(softKeySet); } + void QSoftKeyStackPrivate::push(const QList &softkeys) { QSoftkeySet softKeySet(softkeys); @@ -92,18 +91,15 @@ void QSoftKeyStackPrivate::push(const QList &softkeys) void QSoftKeyStackPrivate::pop() { - softKeyStack.pop(); + qDeleteAll(softKeyStack.pop()); setNativeSoftKeys(); } void QSoftKeyStackPrivate::popandPush(QSoftKeyAction *softKey) { - QSoftkeySet oldSoftKeySet = softKeyStack.pop(); QSoftkeySet newSoftKeySet; newSoftKeySet.append(softKey); - softKeyStack.push(newSoftKeySet); - if( !isSame(oldSoftKeySet, newSoftKeySet)) - setNativeSoftKeys(); + popandPush(newSoftKeySet); } void QSoftKeyStackPrivate::popandPush(const QList &softkeys) @@ -111,8 +107,14 @@ void QSoftKeyStackPrivate::popandPush(const QList &softkeys) QSoftkeySet oldSoftKeySet = softKeyStack.pop(); QSoftkeySet newSoftKeySet(softkeys); softKeyStack.push(newSoftKeySet); - if( !isSame(oldSoftKeySet, newSoftKeySet)) +#ifdef Q_WS_S60 + // Don't flicker on Symbian. + // Platforms that use QActions as native SoftKeys must always call setNativeSoftKeys + // Otherwise the following deletion of oldSoftKeySet would remove the softkeys + if (!isSame(oldSoftKeySet, newSoftKeySet)) +#endif setNativeSoftKeys(); + qDeleteAll(oldSoftKeySet); } const QSoftkeySet& QSoftKeyStackPrivate::top() -- cgit v0.12 From cde524b88f9db46588773d20bf5c36b4e31d234a Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Sat, 30 May 2009 18:49:53 +0200 Subject: Make sure that the QKeyEventSoftKey gets deleted when the action gets deleted. --- src/gui/widgets/qsoftkeystack.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index 494471e..7946f4a 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -286,6 +286,7 @@ void QKeyEventSoftKey::addSoftKey(QSoftKeyAction::StandardRole standardRole, Qt: QSoftKeyAction *action = new QSoftKeyAction(standardRole, actionWidget); QKeyEventSoftKey *softKey = new QKeyEventSoftKey(action, key, actionWidget); connect(action, SIGNAL(triggered()), softKey, SLOT(sendKeyEvent())); + connect(action, SIGNAL(destroyed()), softKey, SLOT(deleteLater())); stack->popandPush(action); } -- cgit v0.12 From 049619000c031964cf33ef351d3df619a6815f5e Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Mon, 1 Jun 2009 13:08:32 +1000 Subject: Fixed failure of tst_Selftests::checkXML. Cherry-pick of 548da9a5434d615456a7a6efda3380b7138c6000 and some earlier changes predating public repo. Note that this test is not failing if using Qt 4.5 only. However, it fails if using Qt 4.5 selftests against Qt master testlib. We want to be able to use master testlib to run 4.5 testcases, and this change does no harm when using Qt 4.5 testlib, so backport it to 4.5 for convenience. Original change description follows: A few tests use printf, which means they interfere with the XML test logging. Blacklist them for the XML test. Note that these tests happened to pass under the old test logger implementation. That was because the test logger always printed XML tags on a single line, and the printf calls contained no special XML characters. The test logs generated were technically valid XML but contained extraneous text. --- tests/auto/selftests/expected_skip.txt | 2 +- tests/auto/selftests/skip/tst_skip.cpp | 6 +++--- tests/auto/selftests/tst_selftests.cpp | 5 +++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/auto/selftests/expected_skip.txt b/tests/auto/selftests/expected_skip.txt index ba41e67..f3be5b5 100644 --- a/tests/auto/selftests/expected_skip.txt +++ b/tests/auto/selftests/expected_skip.txt @@ -7,7 +7,7 @@ SKIP : tst_Skip::emptytest() skipping all Loc: [/home/fenglich/dev/qt-4.3/tests/auto/selftests/skip/tst_skip.cpp(45)] SKIP : tst_Skip::singleSkip(local 1) skipping one Loc: [/home/fenglich/dev/qt-4.3/tests/auto/selftests/skip/tst_skip.cpp(64)] -this line should only be reached once (true) +QDEBUG : tst_Skip::singleSkip(local 2) this line should only be reached once (true) PASS : tst_Skip::singleSkip() PASS : tst_Skip::cleanupTestCase() Totals: 3 passed, 0 failed, 3 skipped diff --git a/tests/auto/selftests/skip/tst_skip.cpp b/tests/auto/selftests/skip/tst_skip.cpp index b1a3936..437cf62 100644 --- a/tests/auto/selftests/skip/tst_skip.cpp +++ b/tests/auto/selftests/skip/tst_skip.cpp @@ -70,7 +70,7 @@ void tst_Skip::test_data() void tst_Skip::test() { - printf("this line should never be reached, since we skip in the _data function\n"); + qDebug("this line should never be reached, since we skip in the _data function"); } void tst_Skip::emptytest_data() @@ -80,7 +80,7 @@ void tst_Skip::emptytest_data() void tst_Skip::emptytest() { - printf("this line should never be reached, since we skip in the _data function\n"); + qDebug("this line should never be reached, since we skip in the _data function"); } void tst_Skip::singleSkip_data() @@ -95,7 +95,7 @@ void tst_Skip::singleSkip() QFETCH(bool, booll); if (!booll) QSKIP("skipping one", SkipSingle); - printf("this line should only be reached once (%s)\n", booll ? "true" : "false"); + qDebug("this line should only be reached once (%s)", booll ? "true" : "false"); } QTEST_MAIN(tst_Skip) diff --git a/tests/auto/selftests/tst_selftests.cpp b/tests/auto/selftests/tst_selftests.cpp index 103fd79..6776b12 100644 --- a/tests/auto/selftests/tst_selftests.cpp +++ b/tests/auto/selftests/tst_selftests.cpp @@ -295,6 +295,11 @@ void tst_Selftests::initTestCase() m_checkXMLBlacklist.append("differentexec"); m_checkXMLBlacklist.append("qexecstringlist"); m_checkXMLBlacklist.append("benchliboptions"); + + /* These tests use printf and therefore corrupt the testlog */ + m_checkXMLBlacklist.append("subtest"); + m_checkXMLBlacklist.append("globaldata"); + m_checkXMLBlacklist.append("warnings"); } void tst_Selftests::checkXML() const -- cgit v0.12 From 31b240c31cbe12fc12db65fe8c7e4f5c9bd23259 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 1 Jun 2009 09:30:31 +0300 Subject: Made securesocketclient example build in Symbian --- examples/network/securesocketclient/sslclient.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/network/securesocketclient/sslclient.cpp b/examples/network/securesocketclient/sslclient.cpp index bf8443d..b2f3dd4 100644 --- a/examples/network/securesocketclient/sslclient.cpp +++ b/examples/network/securesocketclient/sslclient.cpp @@ -145,7 +145,9 @@ void SslClient::socketEncrypted() if (!padLock) { padLock = new QToolButton; padLock->setIcon(QIcon(":/encrypted.png")); +#ifndef QT_NO_CURSOR padLock->setCursor(Qt::ArrowCursor); +#endif padLock->setToolTip(tr("Display encryption details.")); int extent = form->hostNameEdit->height() - 2; -- cgit v0.12 From 0356b3cc5ec37c4d9c1865e0a832a4c6edca7fed Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Mon, 1 Jun 2009 09:57:39 +0300 Subject: Fix to GCCE compiler error in qtablewidget test case. The fixed error was: {standard input}: Assembler messages: {standard input}:47278: Error: branch out of range --- tests/auto/qtablewidget/qtablewidget.pro | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/qtablewidget/qtablewidget.pro b/tests/auto/qtablewidget/qtablewidget.pro index 2b2a016..bcc82bd 100644 --- a/tests/auto/qtablewidget/qtablewidget.pro +++ b/tests/auto/qtablewidget/qtablewidget.pro @@ -1,4 +1,5 @@ load(qttest_p4) SOURCES += tst_qtablewidget.cpp +symbian:MMP_RULES += "OPTION GCCE -mlong-calls" -- cgit v0.12 From 01e0c8b400547dcd772dae7c30405fb7bad15493 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 1 Jun 2009 10:41:03 +0300 Subject: Removed PAGED keyword from qlocale test case GCCE builds in S60 3.2 environments, as it was causing compilation of the test case to crash. --- tests/auto/qlocale/test/test.pro | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/auto/qlocale/test/test.pro b/tests/auto/qlocale/test/test.pro index 32e2423..7bc9f59 100644 --- a/tests/auto/qlocale/test/test.pro +++ b/tests/auto/qlocale/test/test.pro @@ -29,4 +29,11 @@ wince*: { DEPLOYMENT += addFiles } - +symbian:contains(S60_VERSION,3.2) { + # This test case compilation crashes on 3.2 for gcce if paging is on + MMP_RULES -= PAGED + custom_paged_rule = "$${LITERAL_HASH}ifndef GCCE"\ + "PAGED" \ + "$${LITERAL_HASH}endif" + MMP_RULES += custom_paged_rule +} \ No newline at end of file -- cgit v0.12 From 488088b95351716f800acfc48e0ca2885950c261 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Mon, 1 Jun 2009 10:26:37 +0200 Subject: Moved originalPalette member from public to private class. --- src/gui/styles/qs60style.cpp | 9 +++++---- src/gui/styles/qs60style.h | 1 - src/gui/styles/qs60style_p.h | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 930602b..58ee29f 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2589,17 +2589,18 @@ void QS60Style::unpolish(QWidget *widget) void QS60Style::polish(QApplication *application) { - Q_D(const QS60Style); - originalPalette = application->palette(); + Q_D(QS60Style); + d->m_originalPalette = application->palette(); d->setThemePalette(application); } void QS60Style::unpolish(QApplication *application) { Q_UNUSED(application) - QPalette newPalette = qApp->style()->standardPalette(); + Q_D(QS60Style); + const QPalette newPalette = QApplication::style()->standardPalette(); application->setPalette(newPalette); - QApplicationPrivate::setSystemPalette(originalPalette); + QApplicationPrivate::setSystemPalette(d->m_originalPalette); } void QS60Style::setStyleProperty(const char *name, const QVariant &value) diff --git a/src/gui/styles/qs60style.h b/src/gui/styles/qs60style.h index 09c6b00..f6e5473 100644 --- a/src/gui/styles/qs60style.h +++ b/src/gui/styles/qs60style.h @@ -70,7 +70,6 @@ protected slots: private: Q_DISABLE_COPY(QS60Style) friend class QStyleFactory; - QPalette originalPalette; }; #endif // QT_NO_STYLE_S60 diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index c93d271..8a872fc 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -438,6 +438,7 @@ private: // Contains background texture. static QPixmap *m_background; const static SkinElementFlags KDefaultSkinElementFlags; + QPalette m_originalPalette; }; QT_END_NAMESPACE -- cgit v0.12 From 0ff7b68f2e3f184d809cf6fd13ff930efa493e9f Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Mon, 1 Jun 2009 09:39:37 -0700 Subject: Improve readability of QDFBWindowSurface::scroll The batch-blits buys us nothing and this is much more readable. Reviewed-by: TrustMe --- .../gfxdrivers/directfb/qdirectfbwindowsurface.cpp | 39 ++++++++++------------ 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp index c7cae80..330eb88 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp @@ -239,31 +239,28 @@ void QDirectFBWindowSurface::setPermanentState(const QByteArray &state) #endif } -bool QDirectFBWindowSurface::scroll(const QRegion ®ion, int dx, int dy) +static inline void scrollSurface(IDirectFBSurface *surface, const QRect &r, int dx, int dy) { - if (!dfbSurface || !(flipFlags & DSFLIP_BLIT)) - return false; - - const QVector rects = region.rects(); - const int n = rects.size(); - - QVarLengthArray dfbRects(n); - QVarLengthArray dfbPoints(n); + surface->SetBlittingFlags(surface, DSBLIT_NOFX); + const DFBRectangle rect = { r.x(), r.y(), r.width(), r.height() }; + surface->Blit(surface, surface, &rect, r.x() + dx, r.y() + dy); +} - for (int i = 0; i < n; ++i) { - const QRect r = rects.at(i); - dfbRects[i].x = r.x(); - dfbRects[i].y = r.y(); - dfbRects[i].w = r.width(); - dfbRects[i].h = r.height(); - dfbPoints[i].x = r.x() + dx; - dfbPoints[i].y = r.y() + dy; - } +bool QDirectFBWindowSurface::scroll(const QRegion ®ion, int dx, int dy) +{ + if (!dfbSurface || !(flipFlags & DSFLIP_BLIT) || region.isEmpty()) + return false; dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_NOFX); - dfbSurface->BatchBlit(dfbSurface, dfbSurface, - dfbRects.data(), dfbPoints.data(), n); - dfbSurface->ReleaseSource(dfbSurface); + if (region.numRects() == 1) { + ::scrollSurface(dfbSurface, region.boundingRect(), dx, dy); + } else { + const QVector rects = region.rects(); + const int n = rects.size(); + for (int i=0; i Date: Mon, 1 Jun 2009 18:43:29 +0200 Subject: Set each widgets palette after changing the theme. --- src/gui/styles/qs60style_simulated.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index b6ad0ac..7131640 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -268,11 +268,14 @@ void QS60Style::setS60Theme(const QHash &parts, QS60StyleModeSpecifics::m_colors = colors; d->clearCaches(QS60StylePrivate::CC_ThemeChange); d->setBackgroundTexture(qApp); + + foreach (QWidget *widget, QApplication::allWidgets()) + d->setThemePalette(widget); } QPoint qt_s60_fill_background_offset(const QWidget *targetWidget) { - Q_UNUSED(targetWidget) + Q_UNUSED(targetWidget) return QPoint(); } -- cgit v0.12 From 19f36cfed2c64160c17d0b8a6ed8a3b90dbf0d4b Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Mon, 1 Jun 2009 19:04:24 +0200 Subject: warnings-- --- src/gui/widgets/qsoftkeystack.cpp | 3 +-- src/gui/widgets/qsoftkeystack_p.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index 7946f4a..9a5a66c 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -216,8 +216,7 @@ void QSoftKeyStack::handleFocusChanged(QWidget *old, QWidget *now) QMainWindow *QSoftKeyStack::mainWindowOfWidget(QWidget *widget) { - QWidget *widgetParent = widget; - while (widgetParent = widgetParent->parentWidget()) + for (QWidget *widgetParent = widget; widgetParent; widgetParent = widgetParent->parentWidget()) if (QMainWindow *mainWindow = qobject_cast(widgetParent)) return mainWindow; diff --git a/src/gui/widgets/qsoftkeystack_p.h b/src/gui/widgets/qsoftkeystack_p.h index c9d7f8d..4532515 100644 --- a/src/gui/widgets/qsoftkeystack_p.h +++ b/src/gui/widgets/qsoftkeystack_p.h @@ -70,7 +70,7 @@ QT_BEGIN_NAMESPACE class QSoftKeyStackPrivate : public QObjectPrivate { - Q_DECLARE_PUBLIC(QSoftKeyStack); + Q_DECLARE_PUBLIC(QSoftKeyStack) public: QSoftKeyStackPrivate(); ~QSoftKeyStackPrivate(); -- cgit v0.12 From 988f6ae93c771fe94f12a0307d34c14edd5f2c3b Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Mon, 1 Jun 2009 19:06:04 +0200 Subject: Using softkeys for the Cancel/Back buttons during keypad navigation --- src/gui/widgets/qcombobox.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp index 16e2f39..59b740f 100644 --- a/src/gui/widgets/qcombobox.cpp +++ b/src/gui/widgets/qcombobox.cpp @@ -75,6 +75,9 @@ #ifndef QT_NO_EFFECTS # include #endif +#ifdef QT_KEYPAD_NAVIGATION +# include +#endif QT_BEGIN_NAMESPACE extern QHash *qt_app_fonts_hash(); @@ -628,6 +631,9 @@ bool QComboBoxPrivateContainer::eventFilter(QObject *o, QEvent *e) case Qt::Key_Select: #endif if (view->currentIndex().isValid() && (view->currentIndex().flags() & Qt::ItemIsEnabled) ) { +#ifdef QT_KEYPAD_NAVIGATION + QKeyEventSoftKey::removeSoftkey(this); +#endif combo->hidePopup(); emit itemSelected(view->currentIndex()); } @@ -640,7 +646,7 @@ bool QComboBoxPrivateContainer::eventFilter(QObject *o, QEvent *e) case Qt::Key_Escape: #ifdef QT_KEYPAD_NAVIGATION case Qt::Key_Back: - case Qt::Key_Context2: // TODO: aportale, KEYPAD_NAVIGATION_HACK when softkey support is there + QKeyEventSoftKey::removeSoftkey(this); #endif combo->hidePopup(); return true; @@ -2435,6 +2441,7 @@ void QComboBox::showPopup() #ifdef QT_KEYPAD_NAVIGATION if (QApplication::keypadNavigationEnabled()) view()->setEditFocus(true); + QKeyEventSoftKey::addSoftKey(QSoftKeyAction::Cancel, Qt::Key_Back, this); #endif } -- cgit v0.12 From 6e7c48df05189e4066c9e455a4b47cfd5d47a7e7 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Tue, 2 Jun 2009 10:12:07 +0300 Subject: Fixed qiodevice compilation error when QIODEVICE_DEBUG is defined. --- src/corelib/io/qiodevice.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp index 3816803..765bf40 100644 --- a/src/corelib/io/qiodevice.cpp +++ b/src/corelib/io/qiodevice.cpp @@ -362,7 +362,7 @@ QIODevice::QIODevice() { #if defined QIODEVICE_DEBUG QFile *file = qobject_cast(this); - printf("%p QIODevice::QIODevice(\"%s\") %s\n", this, className(), + printf("%p QIODevice::QIODevice(\"%s\") %s\n", this, metaObject()->className(), qPrintable(file ? file->fileName() : QString())); #endif } @@ -375,7 +375,7 @@ QIODevice::QIODevice(QObject *parent) : QObject(*new QIODevicePrivate, parent) { #if defined QIODEVICE_DEBUG - printf("%p QIODevice::QIODevice(%p \"%s\")\n", this, parent, className()); + printf("%p QIODevice::QIODevice(%p \"%s\")\n", this, parent, metaObject()->className()); #endif } -- cgit v0.12 From a6600b2152dbe38f4bdbff08c1158651324ce288 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 2 Jun 2009 11:08:46 +0300 Subject: Removed fluidlauncher winscw binaries from S60 installation package creation --- bin/build_release_package.pl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bin/build_release_package.pl b/bin/build_release_package.pl index 44b0fb1..62390eb 100644 --- a/bin/build_release_package.pl +++ b/bin/build_release_package.pl @@ -116,8 +116,8 @@ if (@ARGV) runSystemCmd("attrib -A ${epocroot}\\${winscwDbgDir}\\*"); # Build Qt - runSystemCmd("configure -platform win32-mwc -xplatform symbian-abld -openssl-linked -qt-sql-sqlite -system-sqlite -confirm-license -opensource"); - buildDir("src", $qtRootDir, $platform, $build); + runSystemCmd("configure -platform win32-mwc -xplatform symbian-abld -qt-sql-sqlite -system-sqlite -confirm-license -opensource"); + buildDir("src", $qtRootDir, $platform, $build, "winscw"); # Copy misc stuff runSystemCmd("xcopy ${qtRootDir}\\bin\\* ${releaseDirQt}\\bin /F /R /Y /I /D"); @@ -143,7 +143,8 @@ if (@ARGV) # Also build demos & examples and add fluidlauncher sis buildDir("examples", $qtRootDir, $platform, $build); buildDir("demos", $qtRootDir, $platform, $build); - parsePkgFile($demoAppPkgFileName, $epocroot, $build, $platform, $releaseDirEpocroot, $qtRootDirForMatch, $releaseDirQt); + # Do not include binaries for demo apps as winscw versions are not BC accross all S60 platform versions + #parsePkgFile($demoAppPkgFileName, $epocroot, $build, $platform, $releaseDirEpocroot, $qtRootDirForMatch, $releaseDirQt); createSis($demoAppPkgFileName, $releaseDirSis, "selfsigned.cer", "selfsigned.key", $demoAppSisFileNameBase); } @@ -270,11 +271,15 @@ sub buildDir my $qtRootDir = $_[1]; my $platform = $_[2]; my $build = $_[3]; + my $extra = $_[4]; chdir($buildDir); runSystemCmd("qmake"); runSystemCmd("bldmake bldfiles"); runSystemCmd("abld build ${platform} ${build}"); - runSystemCmd("abld build winscw udeb"); + if ($extra =~ m/winscw/i) + { + runSystemCmd("abld build winscw udeb"); + } chdir($qtRootDir); } -- cgit v0.12 From 43df9b0eaf58fc9fb252919d61189da8b77cfe38 Mon Sep 17 00:00:00 2001 From: axis Date: Tue, 2 Jun 2009 10:17:26 +0200 Subject: Recompiled configure.exe with MSVC6. --- configure.exe | Bin 868352 -> 868352 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/configure.exe b/configure.exe index 15a4d66..706b3b4 100755 Binary files a/configure.exe and b/configure.exe differ -- cgit v0.12 From 5dca661dc78d8eb0489e7debf342a0869ae75a43 Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Tue, 2 Jun 2009 10:35:10 +0200 Subject: My changes for Qt 4.5.2. Better late than never. --- dist/changes-4.5.2 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index dcb77d6..98ea59e 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -46,6 +46,18 @@ Third party components Plugins (r41346, r43550, r43915, r43917, r43923) Clipboard (r41360) +- QMacStyle + * [253339] Don't draw arrows on toolbuttons that have a menu and text only. + * [252301] Ensure that small and mini spin boxes are drawn correctly. + +- QFontDialog + * [252000] Ensure that QFontDialog::getFont() works on Mac OS X. + +- QWidget + * [250668] Don't send extra wheel events when using the scroll wheel in Cocoa. + * [253448] Prevent a crash when using the Qt::WA_MacBrushedMetal attribute + in conjunction with style sheets. + **************************************************************************** * Database Drivers * **************************************************************************** @@ -65,6 +77,10 @@ Qt for Windows Qt for Mac OS X --------------- +[252795] Ensure that we send Apple Events in the Cocoa port even when Cocoa isn't ready. +[252176] Fix regression in drawing parts of pixmaps on Panther. +[253402] Fix a crash when a Cocoa window that used to be a QWidget would get events + after the QWidget was destroyed. Qt for Embedded Linux @@ -101,6 +117,8 @@ Qt for Windows CE of 'Fixed' on the main cointainer. * [253278] Made it possible to set QString-type properties using QDesignerFormWindowCursor::setProperty(). + * [253539] Prevent crash in Designer with the Cocoa port when when using a scroll + wheel to change a property. - Linguist - Linguist GUI -- cgit v0.12 From 73e514015e416cb290adc1bb513669bc6f4b4ec9 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 2 Jun 2009 11:41:27 +0300 Subject: Removed unused function from symmake --- qmake/generators/symbian/symmake.cpp | 3 --- qmake/generators/symbian/symmake.h | 1 - 2 files changed, 4 deletions(-) diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index 5c9ec13..c5f13f6 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -116,9 +116,6 @@ QString SymbianMakefileGenerator::canonizePath(const QString& origPath) SymbianMakefileGenerator::SymbianMakefileGenerator() : MakefileGenerator() { } SymbianMakefileGenerator::~SymbianMakefileGenerator() { } -// check this out -bool SymbianMakefileGenerator::writeStubMakefile(QTextStream &t) { t; return false; } - void SymbianMakefileGenerator::writeHeader(QTextStream &t) { t << "// ============================================================================" << endl; t << "// * Makefile for building: " << escapeFilePath(var("TARGET")) << endl; diff --git a/qmake/generators/symbian/symmake.h b/qmake/generators/symbian/symmake.h index 06732b5..09c7267 100644 --- a/qmake/generators/symbian/symmake.h +++ b/qmake/generators/symbian/symmake.h @@ -52,7 +52,6 @@ protected: QString fixPathForMmp(const QString& origPath, const QDir& parentDir); QString canonizePath(const QString& origPath); - virtual bool writeStubMakefile(QTextStream &t); virtual bool writeMakefile(QTextStream &t); bool generatePkgFile(const QString &compiler, const QString &config, const QString &iconFile); -- cgit v0.12 From d018549a25761b5e50d90939d94384f23d7a01e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Fri, 29 May 2009 19:05:29 +0200 Subject: Fixes possible infinite loop in QApplication::topLevelAt KDE Bug: https://bugs.kde.org/show_bug.cgi?id=191759 Reviewed-by: Bradley T. Hughes --- src/gui/kernel/qapplication_x11.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index a3c9406..12155f0 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -2955,10 +2955,10 @@ QWidget *QApplication::topLevelAt(const QPoint &p) Window wid = widget->internalWinId(); while (ctarget && !w) { X11->ignoreBadwindow(); - XTranslateCoordinates(X11->display, - QX11Info::appRootWindow(screen), - ctarget, x, y, &unused, &unused, &ctarget); - if (X11->badwindow()) + if (!XTranslateCoordinates(X11->display, + QX11Info::appRootWindow(screen), + ctarget, x, y, &unused, &unused, &ctarget) + || X11->badwindow()) break; if (ctarget == wid) { // Found! -- cgit v0.12 From 8f16a4f1638fd661e74c6aa60822cd9ef17e5003 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 2 Jun 2009 11:02:21 +0200 Subject: My 4.5.2 changes for the changelog. --- dist/changes-4.5.2 | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 98ea59e..0cb3112 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -58,6 +58,26 @@ Third party components * [253448] Prevent a crash when using the Qt::WA_MacBrushedMetal attribute in conjunction with style sheets. +- QPainter + * [253783] Fixed text shaping bugs when using ligatures and different + scripts in a single text item. + * Fixed various inconsistencies for image drawing on non-integer + coordinates. + * Fixed bug with 0-opacity causing images to be drawn fully opaque. + * Fixed crash when drawing on a null pixmap. + * [251534] Fixed issue where text with non-opaque color from widget + palette would be blitted instead of blended. + +- QTransform + * Fixed issue in QTransform::type() causing a projective transform to be + treated as a scaling transform. + +- QtOpenGL + * [247083] Re-enabled antialiasing for large font sizes in OpenGL paint + engine. + * [251485] Fixed crash that could occur with projective transforms and + high quality antialiasing. + **************************************************************************** * Database Drivers * **************************************************************************** @@ -69,7 +89,11 @@ Third party components Qt for Linux/X11 ---------------- - +[253186] Fixed compile error in qfontengine_ft.cpp on 64-bit platforms with +legacy freetype headers. +[241361] Prevented asynchronous access to non-thread safe libfontconfig API. +[244362] Worked around X server crash when calling XFillPolygon with more than +200000 points by falling back to raster paint engine. Qt for Windows -------------- -- cgit v0.12 From 17a4589e4d8e5dede5dc786a284115cb822872e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Tue, 2 Jun 2009 12:42:27 +0300 Subject: S60Style: Add support for setting themePalette to QStyleOption. Also, set up themePaletteHash. --- src/gui/styles/qs60style.cpp | 281 ++++++++++++------- src/gui/styles/qs60style_p.h | 17 +- src/gui/styles/qs60style_s60.cpp | 491 ++++++++++++++++----------------- src/gui/styles/qs60style_simulated.cpp | 9 +- 4 files changed, 438 insertions(+), 360 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 58ee29f..fde1cc6 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -96,6 +96,8 @@ const short *QS60StylePrivate::m_pmPointer = QS60StylePrivate::data[0]; // theme background texture QPixmap *QS60StylePrivate::m_background = 0; +QPalette *QS60StylePrivate::m_themePalette = 0; + const struct QS60StylePrivate::frameElementCenter QS60StylePrivate::m_frameElementsData[] = { {SE_ButtonNormal, QS60StyleEnums::SP_QsnFrButtonTbCenter}, {SE_ButtonPressed, QS60StyleEnums::SP_QsnFrButtonTbCenterPressed}, @@ -119,7 +121,8 @@ const int KNotFound = -1; QS60StylePrivate::~QS60StylePrivate() { - deleteBackground(); + clearCaches(); //deletes also background image + delete m_themePalette; } void QS60StylePrivate::drawSkinElement(SkinElements element, QPainter *painter, @@ -291,7 +294,7 @@ QVariant QS60StylePrivate::styleProperty(const char *name) const return QVariant(); } -QColor QS60StylePrivate::stateColor(const QColor& color, const QStyleOption *option) +QColor QS60StylePrivate::stateColor(const QColor &color, const QStyleOption *option) { QColor retColor (color); if (option && !(option->state & QStyle::State_Enabled)) { @@ -446,116 +449,18 @@ void QS60StylePrivate::setThemePalette(QApplication *app) const return; QPalette widgetPalette = QPalette(Qt::white); - - // basic colors - widgetPalette.setColor(QPalette::WindowText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); - widgetPalette.setColor(QPalette::ButtonText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); - widgetPalette.setColor(QPalette::Text, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); - widgetPalette.setColor(QPalette::ToolTipText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 55, 0)); - widgetPalette.setColor(QPalette::BrightText, widgetPalette.color(QPalette::WindowText).lighter()); - widgetPalette.setColor(QPalette::HighlightedText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 10, 0)); - widgetPalette.setColor(QPalette::Link, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnHighlightColors, 3, 0)); - widgetPalette.setColor(QPalette::LinkVisited, widgetPalette.color(QPalette::Link).darker()); - widgetPalette.setColor(QPalette::Highlight, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnHighlightColors, 2, 0)); - // set these as transparent so that styled full screen theme background is visible - widgetPalette.setColor(QPalette::AlternateBase, Qt::transparent); - widgetPalette.setBrush(QPalette::Window, QS60StylePrivate::backgroundTexture()); - widgetPalette.setColor(QPalette::Base, Qt::transparent); - // set button and tooltipbase based on pixel colors - const QColor buttonColor = colorFromFrameGraphics(QS60StylePrivate::SF_ButtonNormal); - widgetPalette.setColor(QPalette::Button, buttonColor ); - widgetPalette.setColor(QPalette::Light, widgetPalette.color(QPalette::Button).lighter()); - widgetPalette.setColor(QPalette::Dark, widgetPalette.color(QPalette::Button).darker()); - widgetPalette.setColor(QPalette::Midlight, widgetPalette.color(QPalette::Button).lighter(125)); - widgetPalette.setColor(QPalette::Mid, widgetPalette.color(QPalette::Button).darker(150)); - widgetPalette.setColor(QPalette::Shadow, Qt::black); - QColor toolTipColor = colorFromFrameGraphics(QS60StylePrivate::SF_ToolTip); - widgetPalette.setColor(QPalette::ToolTipBase, toolTipColor ); - + setThemePalette(&widgetPalette); app->setPalette(widgetPalette); } -void QS60StylePrivate::setThemePalette(QWidget *widget) const +void QS60StylePrivate::setThemePalette(QStyleOption *option) const { - if(!widget) - return; - QPalette widgetPalette = widget->palette(); + setThemePalette(&option->palette); +} - // widget specific colors and fonts - if (qobject_cast(widget)){ - widgetPalette.setColor(QPalette::All, QPalette::WindowText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnLineColors, 8, 0)); - QApplication::setPalette(widgetPalette, "QSlider"); - } else if (qobject_cast(widget)){ - const QFont suggestedFont = s60Font( - QS60StyleEnums::FC_Primary, widget->font().pointSizeF()); - widget->setFont(suggestedFont); - widgetPalette.setColor(QPalette::Active, QPalette::ButtonText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); - widgetPalette.setColor(QPalette::Inactive, QPalette::ButtonText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); - const QStyleOption opt; - widgetPalette.setColor(QPalette::Disabled, QPalette::ButtonText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, &opt)); - QApplication::setPalette(widgetPalette, "QPushButton"); - } else if (qobject_cast(widget)){ - const QFont suggestedFont = s60Font( - QS60StyleEnums::FC_Primary, widget->font().pointSizeF()); - widget->setFont(suggestedFont); - widgetPalette.setColor(QPalette::Active, QPalette::ButtonText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); - widgetPalette.setColor(QPalette::Inactive, QPalette::ButtonText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); - QApplication::setPalette(widgetPalette, "QToolButton"); - } else if (qobject_cast(widget)){ - const QFont suggestedFont = s60Font( - QS60StyleEnums::FC_Secondary, widget->font().pointSizeF()); - widget->setFont(suggestedFont); - widgetPalette.setColor(QPalette::Active, QPalette::ButtonText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 23, 0)); - QHeaderView* header = qobject_cast(widget); - widgetPalette.setColor(QPalette::Button, Qt::transparent ); - if ( header->viewport() ) - header->viewport()->setPalette(widgetPalette); - QApplication::setPalette(widgetPalette, "QHeaderView"); - } else if (qobject_cast(widget)){ - widgetPalette.setColor(QPalette::All, QPalette::ButtonText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 8, 0)); - QApplication::setPalette(widgetPalette, "QMenuBar"); - } else if (qobject_cast(widget)){ - widgetPalette.setColor(QPalette::Active, QPalette::WindowText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 4, 0)); - QApplication::setPalette(widgetPalette, "QTabBar"); - } else if (qobject_cast(widget)){ - widgetPalette.setColor(QPalette::All, QPalette::Text, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 22, 0)); - QApplication::setPalette(widgetPalette, "QTableView"); - } else if (qobject_cast(widget)){ - const QFont suggestedFont = s60Font( - QS60StyleEnums::FC_Title, widget->font().pointSizeF()); - widget->setFont(suggestedFont); - } else if (qobject_cast(widget)) { - widgetPalette.setColor(QPalette::All, QPalette::HighlightedText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0)); - QApplication::setPalette(widgetPalette, "QLineEdit"); - } else if (qobject_cast (widget)) { - const QColor color(QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); - widgetPalette.setColor(QPalette::WindowText, color); - widgetPalette.setColor(QPalette::Button, QApplication::palette().color(QPalette::Button)); - widgetPalette.setColor(QPalette::Dark, color.darker()); - widgetPalette.setColor(QPalette::Light, color.lighter()); - QApplication::setPalette(widgetPalette, "QDial"); - } else if (qobject_cast(widget)) { - widgetPalette.setBrush(QPalette::Window, QBrush()); - QApplication::setPalette(widgetPalette, "QScrollArea"); - } +QPalette* QS60StylePrivate::themePalette() +{ + return m_themePalette; } void QS60StylePrivate::setBackgroundTexture(QApplication *app) const @@ -689,6 +594,167 @@ void QS60StylePrivate::refreshUI() } } +void QS60StylePrivate::setFont(QWidget *widget) const +{ + QS60StyleEnums::FontCategories fontCategory = QS60StyleEnums::FC_Undefined; + if (!widget) + return; + if (qobject_cast(widget)){ + fontCategory = QS60StyleEnums::FC_Primary; + } else if (qobject_cast(widget)){ + fontCategory = QS60StyleEnums::FC_Primary; + } else if (qobject_cast(widget)){ + fontCategory = QS60StyleEnums::FC_Secondary; + } else if (qobject_cast(widget)){ + fontCategory = QS60StyleEnums::FC_Title; + } + if (fontCategory != QS60StyleEnums::FC_Undefined) { + const QFont suggestedFont = + s60Font(fontCategory, widget->font().pointSizeF()); + widget->setFont(suggestedFont); + } +} + +void QS60StylePrivate::setThemePalette(QWidget *widget) const +{ + if(!widget) + return; + QPalette widgetPalette = widget->palette(); + + //header view and its viewport need to be set 100% transparent button color, since drawing code will + //draw transparent theme graphics there. + if (qobject_cast(widget)){ + widgetPalette.setColor(QPalette::Active, QPalette::ButtonText, + QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 23, 0)); + QHeaderView* header = qobject_cast(widget); + widgetPalette.setColor(QPalette::Button, Qt::transparent ); + if ( header->viewport() ) + header->viewport()->setPalette(widgetPalette); + QApplication::setPalette(widgetPalette, "QHeaderView"); + } +} + +void QS60StylePrivate::setThemePalette(QPalette *palette) const +{ + if (!palette) + return; + + // basic colors + palette->setColor(QPalette::WindowText, + QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); + palette->setColor(QPalette::ButtonText, + QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); + palette->setColor(QPalette::Text, + QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); + palette->setColor(QPalette::ToolTipText, + QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 55, 0)); + palette->setColor(QPalette::BrightText, palette->color(QPalette::WindowText).lighter()); + palette->setColor(QPalette::HighlightedText, + QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 10, 0)); + palette->setColor(QPalette::Link, + QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnHighlightColors, 3, 0)); + palette->setColor(QPalette::LinkVisited, palette->color(QPalette::Link).darker()); + palette->setColor(QPalette::Highlight, + QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnHighlightColors, 2, 0)); + // set these as transparent so that styled full screen theme background is visible + palette->setColor(QPalette::AlternateBase, Qt::transparent); + palette->setBrush(QPalette::Window, QS60StylePrivate::backgroundTexture()); + palette->setColor(QPalette::Base, Qt::transparent); + // set button and tooltipbase based on pixel colors + const QColor buttonColor = this->colorFromFrameGraphics(QS60StylePrivate::SF_ButtonNormal); + palette->setColor(QPalette::Button, buttonColor ); + palette->setColor(QPalette::Light, palette->color(QPalette::Button).lighter()); + palette->setColor(QPalette::Dark, palette->color(QPalette::Button).darker()); + palette->setColor(QPalette::Midlight, palette->color(QPalette::Button).lighter(125)); + palette->setColor(QPalette::Mid, palette->color(QPalette::Button).darker(150)); + palette->setColor(QPalette::Shadow, Qt::black); + QColor toolTipColor = this->colorFromFrameGraphics(QS60StylePrivate::SF_ToolTip); + palette->setColor(QPalette::ToolTipBase, toolTipColor ); + + setThemePaletteHash(palette); + QS60StylePrivate::storeThemePalette(palette); +} + +void QS60StylePrivate::storeThemePalette(QPalette *palette) +{ + //store specified palette for latter use. + if (m_themePalette) { + delete m_themePalette; + m_themePalette = 0; + } + m_themePalette = new QPalette(*palette); +} + +// set widget specific palettes +void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const +{ + if (!palette) + return; + + //store the original palette + QPalette widgetPalette = *palette; + + widgetPalette.setColor(QPalette::All, QPalette::WindowText, + QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnLineColors, 8, 0)); + QApplication::setPalette(widgetPalette, "QSlider"); + // return to original palette after each widget + widgetPalette = *palette; + + widgetPalette.setColor(QPalette::Active, QPalette::ButtonText, + QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); + widgetPalette.setColor(QPalette::Inactive, QPalette::ButtonText, + QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); + const QStyleOption opt; + widgetPalette.setColor(QPalette::Disabled, QPalette::ButtonText, + QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, &opt)); + QApplication::setPalette(widgetPalette, "QPushButton"); + widgetPalette = *palette; + + widgetPalette.setColor(QPalette::Active, QPalette::ButtonText, + QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); + widgetPalette.setColor(QPalette::Inactive, QPalette::ButtonText, + QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); + QApplication::setPalette(widgetPalette, "QToolButton"); + widgetPalette = *palette; + + widgetPalette.setColor(QPalette::Active, QPalette::ButtonText, + QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 23, 0)); + QApplication::setPalette(widgetPalette, "QHeaderView"); + widgetPalette = *palette; + + widgetPalette.setColor(QPalette::All, QPalette::ButtonText, + QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 8, 0)); + QApplication::setPalette(widgetPalette, "QMenuBar"); + widgetPalette = *palette; + + widgetPalette.setColor(QPalette::Active, QPalette::WindowText, + QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 4, 0)); + QApplication::setPalette(widgetPalette, "QTabBar"); + widgetPalette = *palette; + + widgetPalette.setColor(QPalette::All, QPalette::Text, + QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 22, 0)); + QApplication::setPalette(widgetPalette, "QTableView"); + widgetPalette = *palette; + + widgetPalette.setColor(QPalette::All, QPalette::HighlightedText, + QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0)); + QApplication::setPalette(widgetPalette, "QLineEdit"); + widgetPalette = *palette; + + const QColor color(QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); + widgetPalette.setColor(QPalette::WindowText, color); + widgetPalette.setColor(QPalette::Button, QApplication::palette().color(QPalette::Button)); + widgetPalette.setColor(QPalette::Dark, color.darker()); + widgetPalette.setColor(QPalette::Light, color.lighter()); + QApplication::setPalette(widgetPalette, "QDial"); + widgetPalette = *palette; + + widgetPalette.setBrush(QPalette::Window, QBrush()); + QApplication::setPalette(widgetPalette, "QScrollArea"); + widgetPalette = *palette; +} + QSize QS60StylePrivate::partSize(QS60StyleEnums::SkinParts part, SkinElementFlags flags) { QSize result(20, 20); @@ -2552,6 +2618,7 @@ void QS60Style::polish(QWidget *widget) widget->setAttribute(Qt::WA_StyledBackground); } d->setThemePalette(widget); + d->setFont(widget); } void QS60Style::unpolish(QWidget *widget) diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index 8a872fc..88b07b3 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -381,8 +381,13 @@ public: // calculates average color based on button skin graphics (minus borders). QColor colorFromFrameGraphics(QS60StylePrivate::SkinFrameElements frame) const; + + //set theme palette for application void setThemePalette(QApplication *application) const; - void setThemePalette(QWidget *widget) const; + //set theme palette for style option + void setThemePalette(QStyleOption *option) const; + //access to theme palette + static QPalette* themePalette(); static int focusRectPenWidth(); @@ -407,7 +412,6 @@ public: static QPixmap frame(SkinFrameElements frame, const QSize &size, SkinElementFlags flags = KDefaultSkinElementFlags); - static QPixmap backgroundTexture(); private: @@ -426,6 +430,13 @@ private: static void refreshUI(); + // set S60 font for widget + void setFont(QWidget *widget) const; + void setThemePalette(QWidget *widget) const; + void setThemePalette(QPalette *palette) const; + void setThemePaletteHash(QPalette *palette) const; + static void QS60StylePrivate::storeThemePalette(QPalette *palette); + static QSize partSize(QS60StyleEnums::SkinParts part, SkinElementFlags flags = KDefaultSkinElementFlags); static QPixmap part(QS60StyleEnums::SkinParts part, const QSize &size, @@ -438,6 +449,8 @@ private: // Contains background texture. static QPixmap *m_background; const static SkinElementFlags KDefaultSkinElementFlags; + // defined theme palette + static QPalette *m_themePalette; QPalette m_originalPalette; }; diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index ddee4ba..105f6be 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -105,198 +105,198 @@ private: }; const partMapEntry QS60StyleModeSpecifics::m_partMap[] = { - /* SP_QgnGrafBarWait */ {KAknsIIDQgnGrafBarWaitAnim, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafBarFrameCenter */ {KAknsIIDQgnGrafBarFrameCenter, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafBarFrameSideL */ {KAknsIIDQgnGrafBarFrameSideL, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafBarFrameSideR */ {KAknsIIDQgnGrafBarFrameSideR, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafBarProgress */ {KAknsIIDQgnGrafBarProgress, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafScrollArrowDown */ {KAknsIIDQgnGrafScrollArrowDown, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafScrollArrowLeft */ {KAknsIIDQgnGrafScrollArrowLeft, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafScrollArrowRight */ {KAknsIIDQgnGrafScrollArrowRight, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafScrollArrowUp */ {KAknsIIDQgnGrafScrollArrowUp, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafTabActiveL */ {KAknsIIDQgnGrafTabActiveL, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafTabActiveM */ {KAknsIIDQgnGrafTabActiveM, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafTabActiveR */ {KAknsIIDQgnGrafTabActiveR, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafTabPassiveL */ {KAknsIIDQgnGrafTabPassiveL, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafTabPassiveM */ {KAknsIIDQgnGrafTabPassiveM, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnGrafTabPassiveR */ {KAknsIIDQgnGrafTabPassiveR, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnIndiCheckboxOff */ {KAknsIIDQgnIndiCheckboxOff, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnIndiCheckboxOn */ {KAknsIIDQgnIndiCheckboxOn, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafBarWait */ {KAknsIIDQgnGrafBarWaitAnim, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafBarFrameCenter */ {KAknsIIDQgnGrafBarFrameCenter, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafBarFrameSideL */ {KAknsIIDQgnGrafBarFrameSideL, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafBarFrameSideR */ {KAknsIIDQgnGrafBarFrameSideR, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafBarProgress */ {KAknsIIDQgnGrafBarProgress, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafScrollArrowDown */ {KAknsIIDQgnGrafScrollArrowDown, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafScrollArrowLeft */ {KAknsIIDQgnGrafScrollArrowLeft, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafScrollArrowRight */ {KAknsIIDQgnGrafScrollArrowRight, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafScrollArrowUp */ {KAknsIIDQgnGrafScrollArrowUp, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafTabActiveL */ {KAknsIIDQgnGrafTabActiveL, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafTabActiveM */ {KAknsIIDQgnGrafTabActiveM, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafTabActiveR */ {KAknsIIDQgnGrafTabActiveR, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafTabPassiveL */ {KAknsIIDQgnGrafTabPassiveL, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafTabPassiveM */ {KAknsIIDQgnGrafTabPassiveM, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafTabPassiveR */ {KAknsIIDQgnGrafTabPassiveR, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnIndiCheckboxOff */ {KAknsIIDQgnIndiCheckboxOff, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnIndiCheckboxOn */ {KAknsIIDQgnIndiCheckboxOn, EDrawIcon, ES60_AllReleases, -1,-1}, // Following 5 items (SP_QgnIndiHlColSuper - SP_QgnIndiHlLineStraight) are available starting from S60 release 3.2. // In 3.1 CommonStyle drawing is used for these QTreeView elements, since no similar icons in AVKON UI. - /* SP_QgnIndiHlColSuper */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d5 /* KAknsIIDQgnIndiHlColSuper */}, - /* SP_QgnIndiHlExpSuper */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d6 /* KAknsIIDQgnIndiHlExpSuper */}, - /* SP_QgnIndiHlLineBranch */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d7 /* KAknsIIDQgnIndiHlLineBranch */}, - /* SP_QgnIndiHlLineEnd */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d8 /* KAknsIIDQgnIndiHlLineEnd */}, - /* SP_QgnIndiHlLineStraight */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d9 /* KAknsIIDQgnIndiHlLineStraight */}, - /* SP_QgnIndiMarkedAdd */ {KAknsIIDQgnIndiMarkedAdd, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnIndiNaviArrowLeft */ {KAknsIIDQgnGrafScrollArrowLeft, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnIndiNaviArrowRight */ {KAknsIIDQgnGrafScrollArrowRight, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnIndiRadiobuttOff */ {KAknsIIDQgnIndiRadiobuttOff, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnIndiRadiobuttOn */ {KAknsIIDQgnIndiRadiobuttOn, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnIndiSliderEdit */ {KAknsIIDQgnIndiSliderEdit, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnIndiSubMenu */ {KAknsIIDQgnIndiSubmenu, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnNoteErased */ {KAknsIIDQgnNoteErased, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnNoteError */ {KAknsIIDQgnNoteError, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnNoteInfo */ {KAknsIIDQgnNoteInfo, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnNoteOk */ {KAknsIIDQgnNoteOk, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnNoteQuery */ {KAknsIIDQgnNoteQuery, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnNoteWarning */ {KAknsIIDQgnNoteWarning, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnPropFileSmall */ {KAknsIIDQgnPropFileSmall, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnPropFolderCurrent */ {KAknsIIDQgnPropFolderCurrent, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnPropFolderSmall */ {KAknsIIDQgnPropFolderSmall, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnPropFolderSmallNew */ {KAknsIIDQgnPropFolderSmallNew, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QgnPropPhoneMemcLarge */ {KAknsIIDQgnPropPhoneMemcLarge, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnIndiHlColSuper */ {KAknsIIDNone, EDrawIcon, ES60_3_1, EAknsMajorGeneric, 0x17d5 /* KAknsIIDQgnIndiHlColSuper */}, + /* SP_QgnIndiHlExpSuper */ {KAknsIIDNone, EDrawIcon, ES60_3_1, EAknsMajorGeneric, 0x17d6 /* KAknsIIDQgnIndiHlExpSuper */}, + /* SP_QgnIndiHlLineBranch */ {KAknsIIDNone, EDrawIcon, ES60_3_1, EAknsMajorGeneric, 0x17d7 /* KAknsIIDQgnIndiHlLineBranch */}, + /* SP_QgnIndiHlLineEnd */ {KAknsIIDNone, EDrawIcon, ES60_3_1, EAknsMajorGeneric, 0x17d8 /* KAknsIIDQgnIndiHlLineEnd */}, + /* SP_QgnIndiHlLineStraight */ {KAknsIIDNone, EDrawIcon, ES60_3_1, EAknsMajorGeneric, 0x17d9 /* KAknsIIDQgnIndiHlLineStraight */}, + /* SP_QgnIndiMarkedAdd */ {KAknsIIDQgnIndiMarkedAdd, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnIndiNaviArrowLeft */ {KAknsIIDQgnGrafScrollArrowLeft, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnIndiNaviArrowRight */ {KAknsIIDQgnGrafScrollArrowRight, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnIndiRadiobuttOff */ {KAknsIIDQgnIndiRadiobuttOff, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnIndiRadiobuttOn */ {KAknsIIDQgnIndiRadiobuttOn, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnIndiSliderEdit */ {KAknsIIDQgnIndiSliderEdit, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnIndiSubMenu */ {KAknsIIDQgnIndiSubmenu, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnNoteErased */ {KAknsIIDQgnNoteErased, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnNoteError */ {KAknsIIDQgnNoteError, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnNoteInfo */ {KAknsIIDQgnNoteInfo, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnNoteOk */ {KAknsIIDQgnNoteOk, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnNoteQuery */ {KAknsIIDQgnNoteQuery, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnNoteWarning */ {KAknsIIDQgnNoteWarning, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnPropFileSmall */ {KAknsIIDQgnPropFileSmall, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnPropFolderCurrent */ {KAknsIIDQgnPropFolderCurrent, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnPropFolderSmall */ {KAknsIIDQgnPropFolderSmall, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnPropFolderSmallNew */ {KAknsIIDQgnPropFolderSmallNew, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnPropPhoneMemcLarge */ {KAknsIIDQgnPropPhoneMemcLarge, EDrawIcon, ES60_AllReleases, -1,-1}, // 3.1 & 3.2 do not have pressed state for scrollbar, so use normal scrollbar graphics instead. - /* SP_QsnCpScrollHandleBottomPressed*/ {KAknsIIDQsnCpScrollHandleBottom, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorGeneric, 0x20f8}, /*KAknsIIDQsnCpScrollHandleBottomPressed*/ - /* SP_QsnCpScrollHandleMiddlePressed*/ {KAknsIIDQsnCpScrollHandleMiddle, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorGeneric, 0x20f9}, /*KAknsIIDQsnCpScrollHandleMiddlePressed*/ - /* SP_QsnCpScrollHandleTopPressed*/ {KAknsIIDQsnCpScrollHandleTop, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorGeneric, 0x20fa}, /*KAknsIIDQsnCpScrollHandleTopPressed*/ - - /* SP_QsnBgScreen */ {KAknsIIDQsnBgScreen, EDrawBackground, ES60_AllReleases, -1,-1}, - - /* SP_QsnCpScrollBgBottom */ {KAknsIIDQsnCpScrollBgBottom, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QsnCpScrollBgMiddle */ {KAknsIIDQsnCpScrollBgMiddle, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QsnCpScrollBgTop */ {KAknsIIDQsnCpScrollBgTop, EDrawIcon, ES60_AllReleases, -1,-1}, - - /* SP_QsnCpScrollHandleBottom */ {KAknsIIDQsnCpScrollHandleBottom, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QsnCpScrollHandleMiddle */ {KAknsIIDQsnCpScrollHandleMiddle, EDrawIcon, ES60_AllReleases, -1,-1}, - /* SP_QsnCpScrollHandleTop */ {KAknsIIDQsnCpScrollHandleTop, EDrawIcon, ES60_AllReleases, -1,-1}, - - /* SP_QsnFrButtonTbCornerTl */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, //todo: use "normal button" from 5.0 onwards - /* SP_QsnFrButtonTbCornerTr */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbCornerBl */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbCornerBr */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbSideT */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbSideB */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbSideL */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbSideR */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbCenter */ {KAknsIIDQsnFrButtonTbCenter, EDrawIcon, ES60_AllReleases, -1,-1}, - - /* SP_QsnFrButtonTbCornerTlPressed */{KAknsIIDQsnFrButtonTbCornerTlPressed, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbCornerTrPressed */{KAknsIIDQsnFrButtonTbCornerTrPressed, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbCornerBlPressed */{KAknsIIDQsnFrButtonTbCornerBlPressed, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbCornerBrPressed */{KAknsIIDQsnFrButtonTbCornerBrPressed, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbSideTPressed */ {KAknsIIDQsnFrButtonTbSideTPressed, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbSideBPressed */ {KAknsIIDQsnFrButtonTbSideBPressed, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbSideLPressed */ {KAknsIIDQsnFrButtonTbSideLPressed, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbSideRPressed */ {KAknsIIDQsnFrButtonTbSideRPressed, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrButtonTbCenterPressed */ {KAknsIIDQsnFrButtonTbCenterPressed, EDrawIcon, ES60_AllReleases, -1,-1}, - - /* SP_QsnFrCaleCornerTl */ {KAknsIIDQsnFrCaleCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleCornerTr */ {KAknsIIDQsnFrCaleCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleCornerBl */ {KAknsIIDQsnFrCaleCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleCornerBr */ {KAknsIIDQsnFrCaleCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleGSideT */ {KAknsIIDQsnFrCaleSideT, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleGSideB */ {KAknsIIDQsnFrCaleSideB, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleGSideL */ {KAknsIIDQsnFrCaleSideL, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleGSideR */ {KAknsIIDQsnFrCaleSideR, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleCenter */ {KAknsIIDQsnFrCaleCenter, ENoDraw, ES60_AllReleases, -1,-1}, - - /* SP_QsnFrCaleHeadingCornerTl */ {KAknsIIDQsnFrCaleHeadingCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleHeadingCornerTr */ {KAknsIIDQsnFrCaleHeadingCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleHeadingCornerBl */ {KAknsIIDQsnFrCaleHeadingCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleHeadingCornerBr */ {KAknsIIDQsnFrCaleHeadingCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleHeadingSideT */ {KAknsIIDQsnFrCaleHeadingSideT, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleHeadingSideB */ {KAknsIIDQsnFrCaleHeadingSideB, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleHeadingSideL */ {KAknsIIDQsnFrCaleHeadingSideL, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleHeadingSideR */ {KAknsIIDQsnFrCaleHeadingSideR, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrCaleHeadingCenter */ {KAknsIIDQsnFrCaleHeadingCenter, ENoDraw, ES60_AllReleases, -1,-1}, - - /* SP_QsnFrInputCornerTl */ {KAknsIIDQsnFrInputCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrInputCornerTr */ {KAknsIIDQsnFrInputCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrInputCornerBl */ {KAknsIIDQsnFrInputCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrInputCornerBr */ {KAknsIIDQsnFrInputCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrInputSideT */ {KAknsIIDQsnFrInputSideT, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrInputSideB */ {KAknsIIDQsnFrInputSideB, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrInputSideL */ {KAknsIIDQsnFrInputSideL, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrInputSideR */ {KAknsIIDQsnFrInputSideR, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrInputCenter */ {KAknsIIDQsnFrInputCenter, ENoDraw, ES60_AllReleases, -1,-1}, - - /* SP_QsnFrListCornerTl */ {KAknsIIDQsnFrListCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrListCornerTr */ {KAknsIIDQsnFrListCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrListCornerBl */ {KAknsIIDQsnFrListCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrListCornerBr */ {KAknsIIDQsnFrListCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrListSideT */ {KAknsIIDQsnFrListSideT, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrListSideB */ {KAknsIIDQsnFrListSideB, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrListSideL */ {KAknsIIDQsnFrListSideL, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrListSideR */ {KAknsIIDQsnFrListSideR, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrListCenter */ {KAknsIIDQsnFrListCenter, ENoDraw, ES60_AllReleases, -1,-1}, - - /* SP_QsnFrPopupCornerTl */ {KAknsIIDQsnFrPopupCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrPopupCornerTr */ {KAknsIIDQsnFrPopupCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrPopupCornerBl */ {KAknsIIDQsnFrPopupCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrPopupCornerBr */ {KAknsIIDQsnFrPopupCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrPopupSideT */ {KAknsIIDQsnFrPopupSideT, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrPopupSideB */ {KAknsIIDQsnFrPopupSideB, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrPopupSideL */ {KAknsIIDQsnFrPopupSideL, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrPopupSideR */ {KAknsIIDQsnFrPopupSideR, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrPopupCenter */ {KAknsIIDQsnFrPopupCenter, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnCpScrollHandleBottomPressed*/ {KAknsIIDQsnCpScrollHandleBottom, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorGeneric, 0x20f8}, /*KAknsIIDQsnCpScrollHandleBottomPressed*/ + /* SP_QsnCpScrollHandleMiddlePressed*/ {KAknsIIDQsnCpScrollHandleMiddle, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorGeneric, 0x20f9}, /*KAknsIIDQsnCpScrollHandleMiddlePressed*/ + /* SP_QsnCpScrollHandleTopPressed*/ {KAknsIIDQsnCpScrollHandleTop, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorGeneric, 0x20fa}, /*KAknsIIDQsnCpScrollHandleTopPressed*/ + + /* SP_QsnBgScreen */ {KAknsIIDQsnBgScreen, EDrawBackground, ES60_AllReleases, -1,-1}, + + /* SP_QsnCpScrollBgBottom */ {KAknsIIDQsnCpScrollBgBottom, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QsnCpScrollBgMiddle */ {KAknsIIDQsnCpScrollBgMiddle, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QsnCpScrollBgTop */ {KAknsIIDQsnCpScrollBgTop, EDrawIcon, ES60_AllReleases, -1,-1}, + + /* SP_QsnCpScrollHandleBottom */ {KAknsIIDQsnCpScrollHandleBottom, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QsnCpScrollHandleMiddle */ {KAknsIIDQsnCpScrollHandleMiddle, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QsnCpScrollHandleTop */ {KAknsIIDQsnCpScrollHandleTop, EDrawIcon, ES60_AllReleases, -1,-1}, + + /* SP_QsnFrButtonTbCornerTl */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, //todo: use "normal button" from 5.0 onwards + /* SP_QsnFrButtonTbCornerTr */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbCornerBl */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbCornerBr */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbSideT */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbSideB */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbSideL */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbSideR */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbCenter */ {KAknsIIDQsnFrButtonTbCenter, EDrawIcon, ES60_AllReleases, -1,-1}, + + /* SP_QsnFrButtonTbCornerTlPressed */{KAknsIIDQsnFrButtonTbCornerTlPressed, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbCornerTrPressed */{KAknsIIDQsnFrButtonTbCornerTrPressed, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbCornerBlPressed */{KAknsIIDQsnFrButtonTbCornerBlPressed, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbCornerBrPressed */{KAknsIIDQsnFrButtonTbCornerBrPressed, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbSideTPressed */ {KAknsIIDQsnFrButtonTbSideTPressed, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbSideBPressed */ {KAknsIIDQsnFrButtonTbSideBPressed, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbSideLPressed */ {KAknsIIDQsnFrButtonTbSideLPressed, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbSideRPressed */ {KAknsIIDQsnFrButtonTbSideRPressed, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbCenterPressed */ {KAknsIIDQsnFrButtonTbCenterPressed, EDrawIcon, ES60_AllReleases, -1,-1}, + + /* SP_QsnFrCaleCornerTl */ {KAknsIIDQsnFrCaleCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleCornerTr */ {KAknsIIDQsnFrCaleCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleCornerBl */ {KAknsIIDQsnFrCaleCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleCornerBr */ {KAknsIIDQsnFrCaleCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleGSideT */ {KAknsIIDQsnFrCaleSideT, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleGSideB */ {KAknsIIDQsnFrCaleSideB, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleGSideL */ {KAknsIIDQsnFrCaleSideL, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleGSideR */ {KAknsIIDQsnFrCaleSideR, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleCenter */ {KAknsIIDQsnFrCaleCenter, ENoDraw, ES60_AllReleases, -1,-1}, + + /* SP_QsnFrCaleHeadingCornerTl */ {KAknsIIDQsnFrCaleHeadingCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleHeadingCornerTr */ {KAknsIIDQsnFrCaleHeadingCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleHeadingCornerBl */ {KAknsIIDQsnFrCaleHeadingCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleHeadingCornerBr */ {KAknsIIDQsnFrCaleHeadingCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleHeadingSideT */ {KAknsIIDQsnFrCaleHeadingSideT, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleHeadingSideB */ {KAknsIIDQsnFrCaleHeadingSideB, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleHeadingSideL */ {KAknsIIDQsnFrCaleHeadingSideL, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleHeadingSideR */ {KAknsIIDQsnFrCaleHeadingSideR, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleHeadingCenter */ {KAknsIIDQsnFrCaleHeadingCenter, ENoDraw, ES60_AllReleases, -1,-1}, + + /* SP_QsnFrInputCornerTl */ {KAknsIIDQsnFrInputCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrInputCornerTr */ {KAknsIIDQsnFrInputCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrInputCornerBl */ {KAknsIIDQsnFrInputCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrInputCornerBr */ {KAknsIIDQsnFrInputCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrInputSideT */ {KAknsIIDQsnFrInputSideT, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrInputSideB */ {KAknsIIDQsnFrInputSideB, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrInputSideL */ {KAknsIIDQsnFrInputSideL, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrInputSideR */ {KAknsIIDQsnFrInputSideR, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrInputCenter */ {KAknsIIDQsnFrInputCenter, ENoDraw, ES60_AllReleases, -1,-1}, + + /* SP_QsnFrListCornerTl */ {KAknsIIDQsnFrListCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrListCornerTr */ {KAknsIIDQsnFrListCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrListCornerBl */ {KAknsIIDQsnFrListCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrListCornerBr */ {KAknsIIDQsnFrListCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrListSideT */ {KAknsIIDQsnFrListSideT, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrListSideB */ {KAknsIIDQsnFrListSideB, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrListSideL */ {KAknsIIDQsnFrListSideL, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrListSideR */ {KAknsIIDQsnFrListSideR, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrListCenter */ {KAknsIIDQsnFrListCenter, ENoDraw, ES60_AllReleases, -1,-1}, + + /* SP_QsnFrPopupCornerTl */ {KAknsIIDQsnFrPopupCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrPopupCornerTr */ {KAknsIIDQsnFrPopupCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrPopupCornerBl */ {KAknsIIDQsnFrPopupCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrPopupCornerBr */ {KAknsIIDQsnFrPopupCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrPopupSideT */ {KAknsIIDQsnFrPopupSideT, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrPopupSideB */ {KAknsIIDQsnFrPopupSideB, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrPopupSideL */ {KAknsIIDQsnFrPopupSideL, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrPopupSideR */ {KAknsIIDQsnFrPopupSideR, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrPopupCenter */ {KAknsIIDQsnFrPopupCenter, ENoDraw, ES60_AllReleases, -1,-1}, // ToolTip graphics different in 3.1 vs. 3.2+. - /* SP_QsnFrPopupPreviewCornerTl */ {KAknsIIDQsnFrPopupCornerTl, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c5}, /* KAknsIIDQsnFrPopupPreviewCornerTl */ - /* SP_QsnFrPopupPreviewCornerTr */ {KAknsIIDQsnFrPopupCornerTr, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c6}, - /* SP_QsnFrPopupPreviewCornerBl */ {KAknsIIDQsnFrPopupCornerBl, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c3}, - /* SP_QsnFrPopupPreviewCornerBr */ {KAknsIIDQsnFrPopupCornerBr, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c4}, - /* SP_QsnFrPopupPreviewSideT */ {KAknsIIDQsnFrPopupSideT, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19ca}, - /* SP_QsnFrPopupPreviewSideB */ {KAknsIIDQsnFrPopupSideB, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c7}, - /* SP_QsnFrPopupPreviewSideL */ {KAknsIIDQsnFrPopupSideL, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c8}, - /* SP_QsnFrPopupPreviewSideR */ {KAknsIIDQsnFrPopupSideR, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c9}, - /* SP_QsnFrPopupPreviewCenter */ {KAknsIIDQsnFrPopupCenter, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c2}, - - /* SP_QsnFrSetOptCornerTl */ {KAknsIIDQsnFrSetOptCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrSetOptCornerTr */ {KAknsIIDQsnFrSetOptCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrSetOptCornerBl */ {KAknsIIDQsnFrSetOptCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrSetOptCornerBr */ {KAknsIIDQsnFrSetOptCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrSetOptSideT */ {KAknsIIDQsnFrSetOptSideT, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrSetOptSideB */ {KAknsIIDQsnFrSetOptSideB, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrSetOptSideL */ {KAknsIIDQsnFrSetOptSideL, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrSetOptSideR */ {KAknsIIDQsnFrSetOptSideR, ENoDraw, ES60_AllReleases, -1,-1}, - /* SP_QsnFrSetOptCenter */ {KAknsIIDQsnFrSetOptCenter, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrPopupPreviewCornerTl */ {KAknsIIDQsnFrPopupCornerTl, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c5}, /* KAknsIIDQsnFrPopupPreviewCornerTl */ + /* SP_QsnFrPopupPreviewCornerTr */ {KAknsIIDQsnFrPopupCornerTr, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c6}, + /* SP_QsnFrPopupPreviewCornerBl */ {KAknsIIDQsnFrPopupCornerBl, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c3}, + /* SP_QsnFrPopupPreviewCornerBr */ {KAknsIIDQsnFrPopupCornerBr, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c4}, + /* SP_QsnFrPopupPreviewSideT */ {KAknsIIDQsnFrPopupSideT, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19ca}, + /* SP_QsnFrPopupPreviewSideB */ {KAknsIIDQsnFrPopupSideB, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c7}, + /* SP_QsnFrPopupPreviewSideL */ {KAknsIIDQsnFrPopupSideL, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c8}, + /* SP_QsnFrPopupPreviewSideR */ {KAknsIIDQsnFrPopupSideR, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c9}, + /* SP_QsnFrPopupPreviewCenter */ {KAknsIIDQsnFrPopupCenter, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c2}, + + /* SP_QsnFrSetOptCornerTl */ {KAknsIIDQsnFrSetOptCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrSetOptCornerTr */ {KAknsIIDQsnFrSetOptCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrSetOptCornerBl */ {KAknsIIDQsnFrSetOptCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrSetOptCornerBr */ {KAknsIIDQsnFrSetOptCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrSetOptSideT */ {KAknsIIDQsnFrSetOptSideT, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrSetOptSideB */ {KAknsIIDQsnFrSetOptSideB, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrSetOptSideL */ {KAknsIIDQsnFrSetOptSideL, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrSetOptSideR */ {KAknsIIDQsnFrSetOptSideR, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrSetOptCenter */ {KAknsIIDQsnFrSetOptCenter, ENoDraw, ES60_AllReleases, -1,-1}, // No toolbar frame for 5.0+ releases. - /* SP_QsnFrPopupSubCornerTl */ {KAknsIIDQsnFrPopupSubCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, - /* SP_QsnFrPopupSubCornerTr */ {KAknsIIDQsnFrPopupSubCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, - /* SP_QsnFrPopupSubCornerBl */ {KAknsIIDQsnFrPopupSubCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, - /* SP_QsnFrPopupSubCornerBr */ {KAknsIIDQsnFrPopupSubCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, - /* SP_QsnFrPopupSubSideT */ {KAknsIIDQsnFrPopupSubSideT, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, - /* SP_QsnFrPopupSubSideB */ {KAknsIIDQsnFrPopupSubSideB, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, - /* SP_QsnFrPopupSubSideL */ {KAknsIIDQsnFrPopupSubSideL, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, - /* SP_QsnFrPopupSubSideR */ {KAknsIIDQsnFrPopupSubSideR, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, - /* SP_QsnFrPopupSubCenter */ {KAknsIIDQsnFrPopupCenterSubmenu, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, + /* SP_QsnFrPopupSubCornerTl */ {KAknsIIDQsnFrPopupSubCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, + /* SP_QsnFrPopupSubCornerTr */ {KAknsIIDQsnFrPopupSubCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, + /* SP_QsnFrPopupSubCornerBl */ {KAknsIIDQsnFrPopupSubCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, + /* SP_QsnFrPopupSubCornerBr */ {KAknsIIDQsnFrPopupSubCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, + /* SP_QsnFrPopupSubSideT */ {KAknsIIDQsnFrPopupSubSideT, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, + /* SP_QsnFrPopupSubSideB */ {KAknsIIDQsnFrPopupSubSideB, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, + /* SP_QsnFrPopupSubSideL */ {KAknsIIDQsnFrPopupSubSideL, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, + /* SP_QsnFrPopupSubSideR */ {KAknsIIDQsnFrPopupSubSideR, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, + /* SP_QsnFrPopupSubCenter */ {KAknsIIDQsnFrPopupCenterSubmenu, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, // Toolbar graphics is different in 3.1/3.2 vs. 5.0 - /* SP_QsnFrSctrlButtonCornerTl */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2301}, /* KAknsIIDQgnFrSctrlButtonCornerTl*/ - /* SP_QsnFrSctrlButtonCornerTr */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2302}, - /* SP_QsnFrSctrlButtonCornerBl */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2303}, - /* SP_QsnFrSctrlButtonCornerBr */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2304}, - /* SP_QsnFrSctrlButtonSideT */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2305}, - /* SP_QsnFrSctrlButtonSideB */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2306}, - /* SP_QsnFrSctrlButtonSideL */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2307}, - /* SP_QsnFrSctrlButtonSideR */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2308}, - /* SP_QsnFrSctrlButtonCenter */ {KAknsIIDQsnFrButtonTbCenter, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2309}, /*KAknsIIDQgnFrSctrlButtonCenter*/ + /* SP_QsnFrSctrlButtonCornerTl */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2301}, /* KAknsIIDQgnFrSctrlButtonCornerTl*/ + /* SP_QsnFrSctrlButtonCornerTr */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2302}, + /* SP_QsnFrSctrlButtonCornerBl */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2303}, + /* SP_QsnFrSctrlButtonCornerBr */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2304}, + /* SP_QsnFrSctrlButtonSideT */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2305}, + /* SP_QsnFrSctrlButtonSideB */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2306}, + /* SP_QsnFrSctrlButtonSideL */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2307}, + /* SP_QsnFrSctrlButtonSideR */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2308}, + /* SP_QsnFrSctrlButtonCenter */ {KAknsIIDQsnFrButtonTbCenter, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2309}, /*KAknsIIDQgnFrSctrlButtonCenter*/ // No pressed state for toolbar button in 3.1/3.2. - /* SP_QsnFrSctrlButtonCornerTlPressed */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2621}, /*KAknsIIDQsnFrSctrlButtonCornerTlPressed*/ - /* SP_QsnFrSctrlButtonCornerTrPressed */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2622}, - /* SP_QsnFrSctrlButtonCornerBlPressed */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2623}, - /* SP_QsnFrSctrlButtonCornerBrPressed */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2624}, - /* SP_QsnFrSctrlButtonSideTPressed */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2625}, - /* SP_QsnFrSctrlButtonSideBPressed */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2626}, - /* SP_QsnFrSctrlButtonSideLPressed */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2627}, - /* SP_QsnFrSctrlButtonSideRPressed */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2628}, - /* SP_QsnFrSctrlButtonCenterPressed */ {KAknsIIDQsnFrButtonTbCenter, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2629}, + /* SP_QsnFrSctrlButtonCornerTlPressed */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2621}, /*KAknsIIDQsnFrSctrlButtonCornerTlPressed*/ + /* SP_QsnFrSctrlButtonCornerTrPressed */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2622}, + /* SP_QsnFrSctrlButtonCornerBlPressed */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2623}, + /* SP_QsnFrSctrlButtonCornerBrPressed */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2624}, + /* SP_QsnFrSctrlButtonSideTPressed */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2625}, + /* SP_QsnFrSctrlButtonSideBPressed */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2626}, + /* SP_QsnFrSctrlButtonSideLPressed */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2627}, + /* SP_QsnFrSctrlButtonSideRPressed */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2628}, + /* SP_QsnFrSctrlButtonCenterPressed */ {KAknsIIDQsnFrButtonTbCenter, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2629}, // No inactive button graphics in 3.1/3.2 - /* SP_QsnFrButtonCornerTlInactive */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b1}, /*KAknsIIDQsnFrButtonCornerTlInactive*/ - /* SP_QsnFrButtonCornerTrInactive */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b2}, - /* SP_QsnFrButtonCornerBlInactive */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b3}, - /* SP_QsnFrButtonCornerTrInactive */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b4}, - /* SP_QsnFrButtonSideTInactive */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b5}, - /* SP_QsnFrButtonSideBInactive */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b6}, - /* SP_QsnFrButtonSideLInactive */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b7}, - /* SP_QsnFrButtonSideRInactive */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b8}, - /* SP_QsnFrButtonCenterInactive */ {KAknsIIDQsnFrButtonTbCenter, EDrawIcon,ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b9} + /* SP_QsnFrButtonCornerTlInactive */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b1}, /*KAknsIIDQsnFrButtonCornerTlInactive*/ + /* SP_QsnFrButtonCornerTrInactive */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b2}, + /* SP_QsnFrButtonCornerBlInactive */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b3}, + /* SP_QsnFrButtonCornerTrInactive */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b4}, + /* SP_QsnFrButtonSideTInactive */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b5}, + /* SP_QsnFrButtonSideBInactive */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b6}, + /* SP_QsnFrButtonSideLInactive */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b7}, + /* SP_QsnFrButtonSideRInactive */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b8}, + /* SP_QsnFrButtonCenterInactive */ {KAknsIIDQsnFrButtonTbCenter, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b9} }; @@ -622,65 +622,63 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL( QPixmap result; switch (drawType) { - case EDrawIcon: - { - TInt fallbackGraphicID = -1; - HBufC* iconFile = HBufC::NewLC( KMaxFileName ); - TPtr fileNamePtr = iconFile->Des(); - fallbackInfo(part, fileNamePtr, fallbackGraphicID); - // todo: could we instead use AknIconUtils::AvkonIconFileName(); to avoid allocating each time? - - CFbsBitmap *icon = 0; - CFbsBitmap *iconMask = 0; - const TInt fallbackGraphicsMaskID = - fallbackGraphicID == KErrNotFound?KErrNotFound:fallbackGraphicID+1; //masks are auto-generated as next in mif files -// QS60WindowSurface::unlockBitmapHeap(); - AknsUtils::CreateIconLC(skinInstance, skinId, icon, iconMask, fileNamePtr, fallbackGraphicID , fallbackGraphicsMaskID); - User::LeaveIfError(AknIconUtils::SetSize(icon, targetSize, EAspectRatioNotPreserved)); - User::LeaveIfError(AknIconUtils::SetSize(iconMask, targetSize, EAspectRatioNotPreserved)); - result = fromFbsBitmap(icon, iconMask, flags, qt_TDisplayMode2Format(icon->DisplayMode())); - CleanupStack::PopAndDestroy(3); // iconMask, icon, iconFile -// QS60WindowSurface::lockBitmapHeap(); - break; - } - case EDrawBackground: - { -// QS60WindowSurface::unlockBitmapHeap(); - CFbsBitmap *background = new (ELeave) CFbsBitmap(); //offscreen - CleanupStack::PushL(background); - User::LeaveIfError(background->Create(targetSize, EColor16MA)); - - CFbsBitmapDevice* dev = CFbsBitmapDevice::NewL(background); - CleanupStack::PushL(dev); - CFbsBitGc* gc = NULL; - User::LeaveIfError(dev->CreateContext(gc)); - CleanupStack::PushL(gc); - - CAknsBasicBackgroundControlContext* bgContext = CAknsBasicBackgroundControlContext::NewL( - skinId, - targetSize, - EFalse); - CleanupStack::PushL(bgContext); - - const TBool drawn = AknsDrawUtils::DrawBackground( - skinInstance, - bgContext, - NULL, - *gc, - TPoint(), - targetSize, - KAknsDrawParamDefault | KAknsDrawParamRGBOnly); - - if (drawn) - result = fromFbsBitmap(background, NULL, flags, QImage::Format_RGB32); - - CleanupStack::PopAndDestroy(4, background); //background, dev, gc, bgContext -// QS60WindowSurface::lockBitmapHeap(); - break; - } + case EDrawIcon: { + TInt fallbackGraphicID = -1; + HBufC* iconFile = HBufC::NewLC( KMaxFileName ); + TPtr fileNamePtr = iconFile->Des(); + fallbackInfo(part, fileNamePtr, fallbackGraphicID); + // todo: could we instead use AknIconUtils::AvkonIconFileName(); to avoid allocating each time? + + CFbsBitmap *icon = 0; + CFbsBitmap *iconMask = 0; + const TInt fallbackGraphicsMaskID = + fallbackGraphicID == KErrNotFound?KErrNotFound:fallbackGraphicID+1; //masks are auto-generated as next in mif files + // QS60WindowSurface::unlockBitmapHeap(); + AknsUtils::CreateIconLC(skinInstance, skinId, icon, iconMask, fileNamePtr, fallbackGraphicID , fallbackGraphicsMaskID); + User::LeaveIfError(AknIconUtils::SetSize(icon, targetSize, EAspectRatioNotPreserved)); + User::LeaveIfError(AknIconUtils::SetSize(iconMask, targetSize, EAspectRatioNotPreserved)); + result = fromFbsBitmap(icon, iconMask, flags, qt_TDisplayMode2Format(icon->DisplayMode())); + CleanupStack::PopAndDestroy(3); // iconMask, icon, iconFile + // QS60WindowSurface::lockBitmapHeap(); + break; + } + case EDrawBackground: { + // QS60WindowSurface::unlockBitmapHeap(); + CFbsBitmap *background = new (ELeave) CFbsBitmap(); //offscreen + CleanupStack::PushL(background); + User::LeaveIfError(background->Create(targetSize, EColor16MA)); + + CFbsBitmapDevice* dev = CFbsBitmapDevice::NewL(background); + CleanupStack::PushL(dev); + CFbsBitGc* gc = NULL; + User::LeaveIfError(dev->CreateContext(gc)); + CleanupStack::PushL(gc); + + CAknsBasicBackgroundControlContext* bgContext = CAknsBasicBackgroundControlContext::NewL( + skinId, + targetSize, + EFalse); + CleanupStack::PushL(bgContext); + + const TBool drawn = AknsDrawUtils::DrawBackground( + skinInstance, + bgContext, + NULL, + *gc, + TPoint(), + targetSize, + KAknsDrawParamDefault | KAknsDrawParamRGBOnly); + + if (drawn) + result = fromFbsBitmap(background, NULL, flags, QImage::Format_RGB32); + + CleanupStack::PopAndDestroy(4, background); //background, dev, gc, bgContext + // QS60WindowSurface::lockBitmapHeap(); + break; + } } - return result; // TODO: Let fromFbsBitmap return a QPixmap + return result; } QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL(QS60StylePrivate::SkinFrameElements frameElement, @@ -695,7 +693,6 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL(QS60StylePrivate::SkinFra rotatedBy90or270 ? TSize(size.height(), size.width()) : qt_QSize2TSize(size); MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); - QPixmap result; // QS60WindowSurface::unlockBitmapHeap(); @@ -739,7 +736,7 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL(QS60StylePrivate::SkinFra skinInstance->GetCachedItemData(frameSkinID,EAknsITMaskedBitmap)); if (skinMaskedBmp && skinMaskedBmp->Mask()) maskDepth = skinMaskedBmp->Mask()->DisplayMode(); - } + } if (maskDepth != ENone) { CFbsBitmap *frameMask = new (ELeave) CFbsBitmap(); //offscreen CleanupStack::PushL(frameMask); @@ -767,11 +764,10 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL(QS60StylePrivate::SkinFra result = fromFbsBitmap(frame, frameMask, flags, QImage::Format_ARGB32); } CleanupStack::PopAndDestroy(3, frameMask); - } } + } CleanupStack::PopAndDestroy(3, frame); //frame, bitmapDev, bitmapGc - - return result; // TODO: Let fromFbsBitmap return a QPixmap + return result; } void QS60StyleModeSpecifics::frameIdAndCenterId(QS60StylePrivate::SkinFrameElements frameElement, TAknsItemID &frameId, TAknsItemID ¢erId) @@ -1073,9 +1069,10 @@ QPixmap QS60StyleModeSpecifics::generateMissingThemeGraphic(QS60StyleEnums::Skin return QPixmap(); } else { QPixmap result = skinnedGraphics(updatedPart, size, flags); - // TODO: fix this QStyleOption opt; - //opt.palette = q->standardPalette(); + QPalette *themePalette = QS60StylePrivate::themePalette(); + if (themePalette) + opt.palette = *themePalette; // For now, always generate new icon based on "selected". In the future possibly, expand // this to consist other possibilities as well. @@ -1094,9 +1091,10 @@ QPixmap QS60StylePrivate::part(QS60StyleEnums::SkinParts part, QS60WindowSurface::lockBitmapHeap(); if (flags & SF_StateDisabled && !QS60StyleModeSpecifics::disabledPartGraphic(part)) { - // TODO: fix this QStyleOption opt; -// opt.palette = q->standardPalette(); + QPalette *themePalette = QS60StylePrivate::themePalette(); + if (themePalette) + opt.palette = *themePalette; result = QApplication::style()->generatedIconPixmap(QIcon::Disabled, result, &opt); } @@ -1113,9 +1111,10 @@ QPixmap QS60StylePrivate::frame(SkinFrameElements frame, const QSize &size, Skin QS60WindowSurface::lockBitmapHeap(); if (flags & SF_StateDisabled && !QS60StyleModeSpecifics::disabledFrameGraphic(frame)) { - // TODO: fix this QStyleOption opt; -// opt.palette = q->standardPalette(); + QPalette *themePalette = QS60StylePrivate::themePalette(); + if (themePalette) + opt.palette = *themePalette; result = QApplication::style()->generatedIconPixmap(QIcon::Disabled, result, &opt); } return result; diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index 7131640..929f987 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -93,9 +93,10 @@ QPixmap QS60StylePrivate::part(QS60StyleEnums::SkinParts part, const QSize &size QPixmap result = QPixmap::fromImage(partImage); if (flags & SF_StateDisabled) { - // TODO: fix this QStyleOption opt; -// opt.palette = q->standardPalette(); + QPalette *themePalette = QS60StylePrivate::themePalette(); + if (themePalette) + opt.palette = *themePalette; result = QApplication::style()->generatedIconPixmap(QIcon::Disabled, result, &opt); } @@ -268,9 +269,7 @@ void QS60Style::setS60Theme(const QHash &parts, QS60StyleModeSpecifics::m_colors = colors; d->clearCaches(QS60StylePrivate::CC_ThemeChange); d->setBackgroundTexture(qApp); - - foreach (QWidget *widget, QApplication::allWidgets()) - d->setThemePalette(widget); + d->setThemePalette(qApp); } QPoint qt_s60_fill_background_offset(const QWidget *targetWidget) -- cgit v0.12 From 7314c07a3e443b1d5349b419a03db8d41ca43f7e Mon Sep 17 00:00:00 2001 From: jasplin Date: Tue, 2 Jun 2009 10:57:42 +0200 Subject: BT: Fixed crash on Mac caused by erroneous handling of native focus events. On Mac, a widget with a NoFocus policy could still get focus (if only temporarily) as the result of a native focus event. In particular, a line edit with a completer should not lose focus (if only for a brief moment) as a result of the completer popup being shown. This will for example cause an item delegate to think that the user has navigated away from the cell and delete the line edit as a result. This will in turn cause the completer to access a null pointer. Reviewed-by: Richard Moe Gustavsen Task-number: 254456 and 254460 --- src/gui/kernel/qwidget_mac.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index f863428..c82b87d 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -1296,8 +1296,11 @@ OSStatus QWidgetPrivate::qt_widget_event(EventHandlerCallRef er, EventRef event, if(part == kControlFocusNoPart){ if (widget->hasFocus()) QApplicationPrivate::setFocusWidget(0, Qt::OtherFocusReason); - } else + } else if (widget->focusPolicy() != Qt::NoFocus) { widget->setFocus(); + } else { + handled_event = false; + } } if(!HIObjectIsOfClass((HIObjectRef)hiview, kObjectQWidget)) CallNextEventHandler(er, event); -- cgit v0.12 From f352f8e1bb1c34da9447f645eb923e322407d973 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Tue, 2 Jun 2009 13:26:21 +0300 Subject: Made -qt-sql-sqlite and -system-sqlite options default for confifure.exe In addition removed those options from confqt.bat and confsbsv2.bat --- configure.exe | Bin 868352 -> 1187840 bytes confqt.bat | 2 +- confsbsv2.bat | 2 +- tools/configure/configureapp.cpp | 4 +++- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/configure.exe b/configure.exe index 15a4d66..9b6621f 100755 Binary files a/configure.exe and b/configure.exe differ diff --git a/confqt.bat b/confqt.bat index b1474a7..30a5b5d 100644 --- a/confqt.bat +++ b/confqt.bat @@ -1 +1 @@ -configure -platform win32-mwc -xplatform symbian-abld -qt-sql-sqlite -system-sqlite -nokia-developer %* +configure -platform win32-mwc -xplatform symbian-abld -nokia-developer %* diff --git a/confsbsv2.bat b/confsbsv2.bat index f3a8424..a9194d4 100644 --- a/confsbsv2.bat +++ b/confsbsv2.bat @@ -1 +1 @@ -configure -platform win32-mwc -xplatform symbian-sbsv2 -qt-sql-sqlite -system-sqlite -nokia-developer %* +configure -platform win32-mwc -xplatform symbian-sbsv2 -nokia-developer %* diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 9b44fb5..4ac93f6 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1428,7 +1428,9 @@ void Configure::applySpecSpecifics() dictionary[ "QT_HOST_PREFIX" ] = dictionary[ "QT_INSTALL_PREFIX" ]; dictionary[ "QT_INSTALL_PREFIX" ] = ""; dictionary[ "QT_INSTALL_PLUGINS" ] = "\\resource\\qt\\plugins"; - dictionary[ "ARM_FPU_TYPE" ] = "softvfp"; + dictionary[ "ARM_FPU_TYPE" ] = "softvfp"; + dictionary[ "SQL_SQLITE" ] = "yes"; + dictionary[ "SQL_SQLITE_LIB" ] = "system"; } else if(dictionary[ "XQMAKESPEC" ].startsWith("linux")) { //TODO actually wrong. //TODO -- cgit v0.12 From 4dea80184af6eb3316b5765d9b2ebee2befdc64f Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Tue, 2 Jun 2009 13:52:54 +0300 Subject: Removed confqt.bat and confsbsv2.bat. These files were added for convenience purposes, but they were meant to be only temporary solution. Now all SSL and SQL related parameters confqt.bat used to pass for configure.exe have been made default values of configure.exe. To configure Qt for S60 you can use the following command line: configure -platform win32-mwc -xplatform symbian-abld To configure Qt for S60 by using SBSv2 toolchain (Raptor) you can use the following command line: configure -platform win32-mwc -xplatform symbian-sbsv2 --- confqt.bat | 1 - confsbsv2.bat | 1 - 2 files changed, 2 deletions(-) delete mode 100644 confqt.bat delete mode 100644 confsbsv2.bat diff --git a/confqt.bat b/confqt.bat deleted file mode 100644 index 30a5b5d..0000000 --- a/confqt.bat +++ /dev/null @@ -1 +0,0 @@ -configure -platform win32-mwc -xplatform symbian-abld -nokia-developer %* diff --git a/confsbsv2.bat b/confsbsv2.bat deleted file mode 100644 index a9194d4..0000000 --- a/confsbsv2.bat +++ /dev/null @@ -1 +0,0 @@ -configure -platform win32-mwc -xplatform symbian-sbsv2 -nokia-developer %* -- cgit v0.12 From 9b53bb583ca7e74c737683d85593e4a97107a777 Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Tue, 2 Jun 2009 13:02:27 +0200 Subject: Doc - changing the "main layout" term to "top level widget's layout" to preserve some consistency. Also added a screenshot of the Object Insepector displaying a form where its widget has no top level layout. Reviewed-By: TrustMe --- doc/src/designer-manual.qdoc | 19 ++++++++++++------- doc/src/images/rgbController-no-toplevel-layout.png | Bin 0 -> 1343 bytes 2 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 doc/src/images/rgbController-no-toplevel-layout.png diff --git a/doc/src/designer-manual.qdoc b/doc/src/designer-manual.qdoc index 4b8de32..fc3adcf 100644 --- a/doc/src/designer-manual.qdoc +++ b/doc/src/designer-manual.qdoc @@ -465,18 +465,23 @@ spin boxes and sliders as well. The next step is to combine all three layouts into one \bold{main layout}. - It is important that your form has a main layout; otherwise, the widgets - on your form will not resize when your form is resized. To set the main - layout, \gui{Right click} anywhere on your form, outside of the three - separate layouts, and select \gui{Lay Out Horizontally}. Alternatively, you - could also select \gui{Lay Out in a Grid} -- you will still see the same - arrangement (shown below). + The main layout is the top level widget's (in this case, the QWidget) + layout. It is important that your top level widget has a layout; otherwise, + the widgets on your window will not resize when your window is resized. To + set the layout, \gui{Right click} anywhere on your form, outside of the + three separate layouts, and select \gui{Lay Out Horizontally}. + Alternatively, you could also select \gui{Lay Out in a Grid} -- you will + still see the same arrangement (shown below). \image rgbController-final-layout.png \note Main layouts cannot be seen on the form. To check if you have a main layout installed, try resizing your form; your widgets should resize - accordingly. + accordingly. Alternatively, you can take a look at \QD's + \gui{Object Inspector}. If your top level widget does not have a layout, + you will see the broken layout icon next to it, + \inlineimage rgbController-no-toplevel-layout.png + . When you click on the slider and drag it to a certain value, you want the spin box to display the slider's position. To accomplish this behavior, you diff --git a/doc/src/images/rgbController-no-toplevel-layout.png b/doc/src/images/rgbController-no-toplevel-layout.png new file mode 100644 index 0000000..0a9bc29 Binary files /dev/null and b/doc/src/images/rgbController-no-toplevel-layout.png differ -- cgit v0.12 From 1cc91f422888d68f24dec136f521620300e35558 Mon Sep 17 00:00:00 2001 From: axis Date: Tue, 2 Jun 2009 13:05:02 +0200 Subject: Recompiled configure.exe with MSVC6. --- configure.exe | Bin 1187840 -> 868352 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/configure.exe b/configure.exe index c4b5d7f..7d8861e 100755 Binary files a/configure.exe and b/configure.exe differ -- cgit v0.12 From 9dc7a011e798c24b4dd8b19a74b42c61f52a1328 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Tue, 2 Jun 2009 13:08:10 +0200 Subject: Changelog for 4.5.2 --- dist/changes-4.5.2 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 0cb3112..423bbdd 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -94,10 +94,15 @@ legacy freetype headers. [241361] Prevented asynchronous access to non-thread safe libfontconfig API. [244362] Worked around X server crash when calling XFillPolygon with more than 200000 points by falling back to raster paint engine. +[250326] Titlebar wasn't shown on X11 with Qt::CustomizeWindowHint for + fixed-size windows. +[251925] Improved showing QMessageBox on small screens. Qt for Windows -------------- +[251259] Switching to another app left text cursor in line edits with + QtMfc framework. Qt for Mac OS X --------------- -- cgit v0.12 From addc4d77f781f05a203638a26035afb1076c6d64 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 2 Jun 2009 13:28:51 +0200 Subject: Initialize the QImage --- src/gui/styles/qs60style_simulated.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index 929f987..0e00463 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -139,6 +139,7 @@ QPixmap QS60StylePrivate::frame(SkinFrameElements frame, const QSize &size, const QRect centerRect = drawOnlyCenter ? rect : rect.adjusted(cornerWidth, cornerWidth, -cornerWidth, -cornerWidth); QImage result(size, QImage::Format_ARGB32); + result.fill(Qt::transparent); QPainter painter(&result); #if 0 -- cgit v0.12 From 4ae7a683217eb2a7e9fc2fe2ed173e7da277038b Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Tue, 2 Jun 2009 13:44:24 +0200 Subject: My Changelog for 4.5.2 --- 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 423bbdd..c87ad92 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -46,6 +46,9 @@ Third party components Plugins (r41346, r43550, r43915, r43917, r43923) Clipboard (r41360) +- QAbstractNetworkCache + * Only cache responses to HTTP GET by default, not HTTP PUT or POST + - QMacStyle * [253339] Don't draw arrows on toolbuttons that have a menu and text only. * [252301] Ensure that small and mini spin boxes are drawn correctly. @@ -53,6 +56,13 @@ Third party components - QFontDialog * [252000] Ensure that QFontDialog::getFont() works on Mac OS X. +- QNetworkCookie + * [251959] fix parsing of multiple cookies separated by a newline + +- QNetworkCookieJar + * [251467] do not allow cookies for domains like ".com" + * [228974] allow cookies whose domain attribute is missing a leading dot + - QWidget * [250668] Don't send extra wheel events when using the scroll wheel in Cocoa. * [253448] Prevent a crash when using the Qt::WA_MacBrushedMetal attribute -- cgit v0.12 From 791905c40df60e09ca1f693c1e48cfb70d4d64b0 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 2 Jun 2009 15:16:22 +0300 Subject: S60 release package building script moved to mkdist repo. --- bin/build_release_package.pl | 285 ------------------------------------------- 1 file changed, 285 deletions(-) delete mode 100644 bin/build_release_package.pl diff --git a/bin/build_release_package.pl b/bin/build_release_package.pl deleted file mode 100644 index 62390eb..0000000 --- a/bin/build_release_package.pl +++ /dev/null @@ -1,285 +0,0 @@ -####################################################################### -# -# A script for creating binary release package -# -# Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). -# Contact: Qt Software Information (qt-info@nokia.com) -# -####################################################################### - -my $buildContentDemoValue = "libs+demo"; - -if (@ARGV) -{ - my $buildContent = shift(@ARGV); - my $platform = shift(@ARGV); - my $build = shift(@ARGV); - my $cert = shift(@ARGV); - my $certKey = shift(@ARGV); - my $releaseDir = shift(@ARGV); - my $qtRootDir = shift(@ARGV); - my $epocroot = shift(@ARGV); - - if ($buildContent eq "") - { - print("Build content parameter required!\n"); - exit 2; - } - - if ($platform eq "") - { - print("HW platform parameter required!\n"); - exit 2; - } - - if ($build eq "") - { - print("HW build parameter required!\n"); - exit 2; - } - - if ($cert eq "") - { - print("Signing certificate parameter required!\n"); - exit 2; - } - - if ($certKey eq "") - { - print("Signing certificate key parameter required!\n"); - exit 2; - } - - if ($releaseDir eq "") - { - print("Release directory parameter required!\n"); - exit 2; - } - - if ($qtRootDir eq "") - { - print("Qt root directory parameter required!\n"); - exit 2; - } - - if ($epocroot eq "") - { - print("Epocroot directory parameter required!\n"); - exit 2; - } - - # Lose the ending separator if any - $qtRootDir =~ s/\\$//; - $epocroot =~ s/\\$//; - - chdir($qtRootDir); - - # Lose the drive designator from epocroot - $epocroot =~ s/.://; - - my $releaseDirQt = "${releaseDir}\\qt"; - my $releaseDirEpocroot = "${releaseDir}\\epocroot"; - my $releaseDirSis = $releaseDirQt; # Put sis files to Qt source dir root - - my $qtRootDirForMatch = $qtRootDir; # Double backslashes so that variable can be used in matching - $qtRootDirForMatch =~ s/\\/\\\\/g; - - my $pkgFileName = "src\\s60installs\\qt_libs_${platform}_${build}.pkg"; - my $demoAppPkgFileName = "demos\\embedded\\fluidlauncher\\fluidlauncher_${platform}_${build}.pkg"; - my $sisFileNameBase = "qt_libs"; - my $demoAppSisFileNameBase = "fluidlauncher"; - - my $hwBuildDir = "${epocroot}\\epoc32\\release\\$platform\\$build"; - my $armDbgDir = "epoc32\\release\\armv5\\udeb"; - my $armRelDir = "epoc32\\release\\armv5\\urel"; - my $armLibDir = "epoc32\\release\\armv5\\lib"; - my $winscwDbgDir = "epoc32\\release\\winscw\\udeb"; - - # clean up old stuff - system("rd /S /Q ${releaseDir} 2> NUL"); - system("rd /S /Q ${epocroot}\\epoc32\\build 2> NUL"); # Just in case env is not clean - - # Copy the whole thing over to the release dir before it gets polluted - print("Copying clean tree...\n"); - my $tempExcludeFile = "${releaseDir}\\__temp_exclude.txt"; - system("mkdir ${releaseDir} 2>NUL"); - runSystemCmd("echo ${qtRootDir}\\.git\\ > ${tempExcludeFile}"); - runSystemCmd("echo ${qtRootDir}\\tests\\ >> ${tempExcludeFile}"); - runSystemCmd("echo ${qtRootDir}\\util\\ >> ${tempExcludeFile}"); - runSystemCmd("xcopy ${qtRootDir} ${releaseDirQt} /E /I /H /Q /EXCLUDE:${tempExcludeFile}"); - system("del /F /Q ${tempExcludeFile} 2> NUL"); - - # Clear archive flag from all items in \epoc32\release\armv5\urel and \epoc32\release\armv5\lib - # as those will have the binaries used for all platforms and builds. - runSystemCmd("attrib -A ${hwBuildDir}\\*"); - runSystemCmd("attrib -A ${epocroot}\\${armLibDir}\\*"); - runSystemCmd("attrib -A ${epocroot}\\${winscwDbgDir}\\*"); - - # Build Qt - runSystemCmd("configure -platform win32-mwc -xplatform symbian-abld -qt-sql-sqlite -system-sqlite -confirm-license -opensource"); - buildDir("src", $qtRootDir, $platform, $build, "winscw"); - - # Copy misc stuff - runSystemCmd("xcopy ${qtRootDir}\\bin\\* ${releaseDirQt}\\bin /F /R /Y /I /D"); - runSystemCmd("xcopy ${qtRootDir}\\lib\\*.prl ${releaseDirQt}\\lib /F /R /Y /I /D /E"); - runSystemCmd("xcopy ${qtRootDir}\\mkspecs\\* ${releaseDirQt}\\mkspecs /F /R /Y /I /D /E"); - print("Copying includes...\n"); - runSystemCmd("xcopy ${qtRootDir}\\include\\* ${releaseDirQt}\\include /F /R /Y /I /D /E /Q"); - runSystemCmd("copy src\\corelib\\global\\qconfig.h ${releaseDirQt}\\src\\corelib\\global\\qconfig.h"); - runSystemCmd("copy .qmake.cache ${releaseDirQt}\\.qmake.cache"); - - # Copy stuff indicated by pkg file for emulator - parsePkgFile($pkgFileName, $epocroot, $build, $platform, $releaseDirEpocroot, $qtRootDirForMatch, $releaseDirQt); - - # Copy any other binaries and related files built not included in pkg - runSystemCmd("xcopy ${hwBuildDir}\\* ${releaseDirEpocroot}\\${armDbgDir} /A /F /R /Y /I /D "); - runSystemCmd("xcopy ${releaseDirEpocroot}\\${armDbgDir}\\* ${releaseDirEpocroot}\\${armRelDir} /F /R /Y /I /D"); - system("del /F /Q ${releaseDirEpocroot}\\${armRelDir}\\*.sym 2> NUL"); - runSystemCmd("xcopy ${epocroot}\\${armLibDir}\\* ${releaseDirEpocroot}\\${armLibDir} /A /F /R /Y /I /D"); - runSystemCmd("xcopy ${epocroot}\\${winscwDbgDir}\\* ${releaseDirEpocroot}\\${winscwDbgDir} /A /F /R /Y /I /D"); - - if ($buildContent eq $buildContentDemoValue) - { - # Also build demos & examples and add fluidlauncher sis - buildDir("examples", $qtRootDir, $platform, $build); - buildDir("demos", $qtRootDir, $platform, $build); - # Do not include binaries for demo apps as winscw versions are not BC accross all S60 platform versions - #parsePkgFile($demoAppPkgFileName, $epocroot, $build, $platform, $releaseDirEpocroot, $qtRootDirForMatch, $releaseDirQt); - createSis($demoAppPkgFileName, $releaseDirSis, "selfsigned.cer", "selfsigned.key", $demoAppSisFileNameBase); - } - - # Create unsigned sis and Rnd signed sisx - createSis($pkgFileName, $releaseDirSis, $cert, $certKey, $sisFileNameBase); - -} -else -{ - print("Usage:\n"); - print("build_release_package.pl \n"); - print("1) Clean up the env. (abld reallyclean & delete \\my\\epoc\\root\\build folder)\n"); - print("2) Run \"build_release_package.pl armv5 udeb \\rd.cer \\rd-key.pem \\my_release_dir [\\my\\qt\\root\\] [\\my\\epoc\\root\\]>\"\n"); - print(" to build Qt and create the release package structure and sis file.\n"); - print(" Note: Run in the Qt root directory.\n"); - print("3) Optional: Get the sis signed with commercial certificate (can be found in qt directory under release directory)\n"); - print("4) Zip up the release directory contents\n"); -} - -sub runSystemCmd -{ - my $error_code = system($_[0]); - if ($error_code != 0) - { - print("'$_[0]' call failed: error code == $error_code\n"); - exit 9; - } -} - -sub parsePkgFile -{ - my $epocroot = $_[1]; - my $build = $_[2]; - my $platform = $_[3]; - my $releaseDirEpocroot = $_[4]; - my $qtRootDirForMatch = $_[5]; - my $releaseDirQt = $_[6]; - - open (PKG, "<".$_[0]); - while () - { - my $line = $_; - chomp ($line); - - # If the line specifies a file, parse the source and destination locations. - if ($line =~ m/\"([^\"]+)\"\s*\-\s*\"([^\"]+)\"/) - { - my $sourcePath = $1; - my $pkgDestinationPath = $2; - $sourcePath =~ s/\//\\/g; - - # Copy stuff required for creating deployment package - my $destinationPath = $sourcePath; - - if($destinationPath =~ m/($qtRootDirForMatch)/i) - { - $destinationPath =~ s/($qtRootDirForMatch)//i; - $destinationPath = $releaseDirQt.$destinationPath; - } - else - { - $destinationPath =~ s/.://; - if ($epocroot !~ m/\\/) - { - $destinationPath =~ s/($epocroot)//i; - } - $destinationPath = $releaseDirEpocroot.$destinationPath; - } - - runSystemCmd("echo f|xcopy ${sourcePath} ${destinationPath} /F /R /Y /I /D"); - - if ($sourcePath !~ m/\\epoc32\\release\\([^\\]+)\\(udeb|urel)\\(\w+(\.dll|\.exe))/i) - { - # Copy non-binaries also over for emulator to use - if ($pkgDestinationPath =~ m/(private\\10003a3f\\import\\apps|resource\\apps)/i) - { - $pkgDestinationPath =~ s/!:/${releaseDirEpocroot}\\epoc32\\release\\winscw\\udeb\\z/g; - } - else - { - $pkgDestinationPath =~ s/!:/${releaseDirEpocroot}\\epoc32\\winscw\\c/g; - } - - runSystemCmd("echo f|xcopy ${sourcePath} ${pkgDestinationPath} /F /R /Y /I /D"); - } - else - { - # For binaries, copy also winscw versions (needed for deployed binaries that are not actually built) - $sourcePath =~ s/epoc32\\release\\${platform}\\${build}/epoc32\\release\\winscw\\udeb/; - $destinationPath =~ s/epoc32\\release\\${platform}\\${build}/epoc32\\release\\winscw\\udeb/; - runSystemCmd("echo f|xcopy ${sourcePath} ${destinationPath} /F /R /Y /I /D"); - } - - } - } - close (PKG); -} - -sub createSis -{ - my $pkgFileName = $_[0]; - my $releaseDirSis = $_[1]; - my $cert = $_[2]; - my $certKey = $_[3]; - my $sisFileNameBase = $_[4]; - my $signedSuffix = ".sis"; - my $unsignedSuffix = "_unsigned.sis"; - - if ($cert =~ m/rd\.cer/i) - { - $signedSuffix = "_rnd.sis"; - } - - my $sisFileName = $sisFileNameBase.$unsignedSuffix; - my $signedSisFileName = $sisFileNameBase.$signedSuffix; - system("mkdir ${releaseDirSis} 2> NUL"); - runSystemCmd("makesis ${pkgFileName} ${releaseDirSis}\\${sisFileName}"); - runSystemCmd("signsis ${releaseDirSis}\\${sisFileName} ${releaseDirSis}\\${signedSisFileName} ${cert} ${certKey}"); -} - -sub buildDir -{ - my $buildDir = $_[0]; - my $qtRootDir = $_[1]; - my $platform = $_[2]; - my $build = $_[3]; - my $extra = $_[4]; - - chdir($buildDir); - runSystemCmd("qmake"); - runSystemCmd("bldmake bldfiles"); - runSystemCmd("abld build ${platform} ${build}"); - if ($extra =~ m/winscw/i) - { - runSystemCmd("abld build winscw udeb"); - } - chdir($qtRootDir); -} -- cgit v0.12 From 5be3335436501c5e0d3f5cb047edba1371aeb187 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Tue, 2 Jun 2009 15:02:00 +0200 Subject: Use a QVarLengthArray instead of some hacky self-made container This won't leak on error case, and will work with arbitrary sizes. Also changed from int to short as instructed by Samuel. Reviewed-by: Samuel --- src/gui/painting/qpaintengine_raster.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 847904b..58ffb02 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -3876,11 +3876,7 @@ static void qt_merge_clip(const QClipData *c1, const QClipData *c2, QClipData *r { Q_ASSERT(c1->clipSpanHeight == c2->clipSpanHeight && c1->clipSpanHeight == result->clipSpanHeight); - // ### buffer overflow possible - const int BUFFER_SIZE = 4096; - int buffer[BUFFER_SIZE]; - int *b = buffer; - int bsize = BUFFER_SIZE; + QVarLengthArray buffer; QClipData::ClipLine *c1ClipLines = const_cast(c1)->clipLines(); QClipData::ClipLine *c2ClipLines = const_cast(c2)->clipLines(); @@ -3907,11 +3903,8 @@ static void qt_merge_clip(const QClipData *c1, const QClipData *c2, QClipData *r // find required length int max = qMax(c1_spans[c1_count - 1].x + c1_spans[c1_count - 1].len, c2_spans[c2_count - 1].x + c2_spans[c2_count - 1].len); - if (max > bsize) { - b = (int *)realloc(bsize == BUFFER_SIZE ? 0 : b, max*sizeof(int)); - bsize = max; - } - memset(buffer, 0, BUFFER_SIZE * sizeof(int)); + buffer.resize(max); + memset(buffer.data(), 0, buffer.size() * sizeof(short)); // Fill with old spans. for (int i = 0; i < c1_count; ++i) { @@ -3947,8 +3940,6 @@ static void qt_merge_clip(const QClipData *c1, const QClipData *c2, QClipData *r result->appendSpan(sx, x - sx, y, coverage); } } - if (b != buffer) - free(b); } void QRasterPaintEnginePrivate::initializeRasterizer(QSpanData *data) -- cgit v0.12 From 7a095c52057633e9050e74622f8a990738c2741b Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Tue, 2 Jun 2009 15:20:04 +0200 Subject: Fixed aspect ratio on Windows - When changing the aspect ratio, the video wouldn't update. - The VMR9 can in some cases try to manage the aspect ratio itself and then fights our system. This is now disabled. --- src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp | 1 + src/3rdparty/phonon/ds9/videowidget.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp b/src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp index 298e9fa..81ebb8b 100644 --- a/src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp +++ b/src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp @@ -169,6 +169,7 @@ namespace Phonon Q_ASSERT(SUCCEEDED(hr)); ComPointer windowlessControl(m_filter, IID_IVMRWindowlessControl9); windowlessControl->SetVideoClippingWindow(reinterpret_cast(target->winId())); + windowlessControl->SetAspectRatioMode(VMR9ARMode_None); //we're in control of the size } QImage VideoRendererVMR9::snapshot() const diff --git a/src/3rdparty/phonon/ds9/videowidget.cpp b/src/3rdparty/phonon/ds9/videowidget.cpp index de7ce5f..0ef653f 100644 --- a/src/3rdparty/phonon/ds9/videowidget.cpp +++ b/src/3rdparty/phonon/ds9/videowidget.cpp @@ -261,6 +261,7 @@ namespace Phonon { m_aspectRatio = aspectRatio; updateVideoSize(); + m_widget->update(); } Phonon::VideoWidget::ScaleMode VideoWidget::scaleMode() const @@ -279,6 +280,7 @@ namespace Phonon { m_scaleMode = scaleMode; updateVideoSize(); + m_widget->update(); } void VideoWidget::setBrightness(qreal b) -- cgit v0.12 From 8fd9ad6c82ae4a7017a83fec529b80a0fb21480f Mon Sep 17 00:00:00 2001 From: makuukka Date: Fri, 29 May 2009 10:40:28 +0300 Subject: Missing double click handling added to mouse handling, so that latter release event is not missed. Reviewed-by: Janne Koskinen --- src/gui/kernel/qapplication_s60.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index b4658da..308bdbb 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -204,7 +204,7 @@ static void mapS60MouseEventTypeToQt(QEvent::Type *type, Qt::MouseButton *button *type = QEvent::MouseButtonDblClick; } - if (*type == QEvent::MouseButtonPress) + if (*type == QEvent::MouseButtonPress || *type == QEvent::MouseButtonDblClick) QApplicationPrivate::mouse_buttons = QApplicationPrivate::mouse_buttons | (*button); else if (*type == QEvent::MouseButtonRelease) QApplicationPrivate::mouse_buttons = QApplicationPrivate::mouse_buttons &(~(*button)); @@ -313,7 +313,7 @@ void QSymbianControl::HandleLongTapEventL( const TPoint& aPenEventLocation, cons QMouseEvent mEvent(QEvent::MouseButtonPress, alienWidget->mapFrom(qwidget, widgetPos), globalPos, Qt::RightButton, QApplicationPrivate::mouse_buttons, Qt::NoModifier); sendMouseEvent(alienWidget, &mEvent); - m_previousEventLongTap = true; + m_previousEventLongTap = false; } void QSymbianControl::HandlePointerEventL(const TPointerEvent& pEvent) @@ -342,7 +342,7 @@ void QSymbianControl::HandlePointerEventL(const TPointerEvent& pEvent) TPoint controlScreenPos = PositionRelativeToScreen(); QPoint globalPos = QPoint(controlScreenPos.iX, controlScreenPos.iY) + widgetPos; - if (type == QEvent::MouseButtonPress) + if (type == QEvent::MouseButtonPress || type == QEvent::MouseButtonDblClick) { // get the button press target alienWidget = qwidget->childAt(widgetPos); @@ -362,7 +362,7 @@ void QSymbianControl::HandlePointerEventL(const TPointerEvent& pEvent) alienWidget = S60->mousePressTarget; if (alienWidget != S60->lastPointerEventTarget) - if (type == QEvent::MouseButtonPress || type == QEvent::MouseMove) + if (type == QEvent::MouseButtonPress || QEvent::MouseButtonDblClick || type == QEvent::MouseMove) { //moved to another widget, create enter and leave events if (S60->lastPointerEventTarget) -- cgit v0.12 From d7700105933b3c4071f8df524915dbaa2092d82b Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Tue, 2 Jun 2009 15:48:27 +0200 Subject: Correct invalid font. QFont() returns the app font, not an invalid font. --- tests/auto/qcssparser/tst_cssparser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qcssparser/tst_cssparser.cpp b/tests/auto/qcssparser/tst_cssparser.cpp index 7c4fac1..b41a745 100644 --- a/tests/auto/qcssparser/tst_cssparser.cpp +++ b/tests/auto/qcssparser/tst_cssparser.cpp @@ -1475,7 +1475,7 @@ void tst_CssParser::extractFontFamily_data() QTest::newRow("unquoted-family-name2") << "font-family: Times New Roman" << QString("Times New Roman"); QTest::newRow("multiple") << "font-family: Times New Roman , foobar, 'baz'" << QString("Times New Roman"); QTest::newRow("multiple2") << "font-family: invalid, Times New Roman " << QString("Times New Roman"); - QTest::newRow("invalid") << "font-family: invalid" << QFont().family(); + QTest::newRow("invalid") << "font-family: invalid" << QFontInfo(QFont("invalid font")).family(); QTest::newRow("shorthand") << "font: 12pt Times New Roman" << QString("Times New Roman"); QTest::newRow("shorthand multiple quote") << "font: 12pt invalid, \"Times New Roman\" " << QString("Times New Roman"); QTest::newRow("shorthand multiple") << "font: 12pt invalid, Times New Roman " << QString("Times New Roman"); -- cgit v0.12 From ad46e77420449ede2cb6c1ea2a810a2614520db9 Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Tue, 2 Jun 2009 16:09:58 +0200 Subject: BT: Remove duplicate code and fix font parsing. QFont has a feature that you can pass a comma-separated list and it will walk through the list and match the font that it hits first. There's a nice static function that X11 and Windows uses, but the Mac was using an older copied version of it. This old version didn't handle quoting which is what happens in the style sheet. So, using the same code makes everything work well. As a bonus, Creator looks correct again. Reviewed-by: Simon Hausmann --- src/gui/text/qfontdatabase.cpp | 2 +- src/gui/text/qfontdatabase_mac.cpp | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index c3fc9f5..5fb294f 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -827,6 +827,7 @@ static void getEngineData(const QFontPrivate *d, const QFontCache::Key &key) d->engineData->ref.ref(); } } +#endif static QStringList familyList(const QFontDef &req) { @@ -855,7 +856,6 @@ static QStringList familyList(const QFontDef &req) return family_list; } -#endif Q_GLOBAL_STATIC(QFontDatabasePrivate, privateDb) Q_GLOBAL_STATIC_WITH_ARGS(QMutex, fontDatabaseMutex, (QMutex::Recursive)) diff --git a/src/gui/text/qfontdatabase_mac.cpp b/src/gui/text/qfontdatabase_mac.cpp index 80ddbd5..26d8687 100644 --- a/src/gui/text/qfontdatabase_mac.cpp +++ b/src/gui/text/qfontdatabase_mac.cpp @@ -281,14 +281,7 @@ void QFontDatabase::load(const QFontPrivate *d, int script) } //find the font - QStringList family_list = req.family.split(QLatin1Char(',')); - // append the substitute list for each family in family_list - { - QStringList subs_list; - for(QStringList::ConstIterator it = family_list.constBegin(); it != family_list.constEnd(); ++it) - subs_list += QFont::substitutes(*it); - family_list += subs_list; - } + QStringList family_list = familyList(req); const char *stylehint = styleHint(req); if (stylehint) -- cgit v0.12 From a5b11b9031f9a2a97b65e9a6134244249845491a Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Tue, 2 Jun 2009 16:29:57 +0200 Subject: Avoid a crash when setting a focus in a widget hierarchy containing both visible and invisible widgets. This is a quick hack to avoid a crash in Qt when setting a focus on a visible widget that has invisible parent. Proper fix was committed into master 1a7da7096bbda17197738061902f4489af234bc0, see it's description for more details. Task-number: 254563 Reviewed-by: Thierry Bastian --- src/gui/kernel/qwidget.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index bbf6758..baf3278 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -5804,8 +5804,9 @@ void QWidget::setFocus(Qt::FocusReason reason) void QWidget::clearFocus() { QWidget *w = this; - while (w && w->d_func()->focus_child == this) { - w->d_func()->focus_child = 0; + while (w) { + if (w->d_func()->focus_child == this) + w->d_func()->focus_child = 0; w = w->parentWidget(); } #ifndef QT_NO_GRAPHICSVIEW -- cgit v0.12 From 629c7c2785bc7b371ed8ce1abf016c6c35a4a78f Mon Sep 17 00:00:00 2001 From: Aleksandar Sasha Babic Date: Tue, 2 Jun 2009 16:33:56 +0200 Subject: Fixed incorrect focus detection. Previously we assumed that focused widget will give us both the parent and the child. Rev By:Axis --- src/gui/kernel/qapplication_s60.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 308bdbb..3d865d3 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -524,7 +524,14 @@ TKeyResponse QSymbianControl::sendKeyEvent(QWidget *widget, QKeyEvent *keyEvent) #ifndef QT_NO_IM TCoeInputCapabilities QSymbianControl::InputCapabilities() const { - QWidget *w = qwidget->focusWidget(); + QWidget *w = 0; + + if(qwidget->hasFocus()) { + w = qwidget; + } else { + w = qwidget->focusWidget(); + } + QCoeFepInputContext *ic; if (w && w->isEnabled() && w->testAttribute(Qt::WA_InputMethodEnabled) && (ic = qobject_cast(w->inputContext()))) { -- cgit v0.12 From 0068bd9279b5f7a12f00ffea66cb264930f88138 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 2 Jun 2009 16:29:32 +0200 Subject: missing deployment rule added to examples/richtext/textobject The example SVG must be deployed on Windows CE devices to be used. Reviewed-by: mauricek BT: yes --- examples/richtext/textobject/textobject.pro | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/richtext/textobject/textobject.pro b/examples/richtext/textobject/textobject.pro index fbb809c..4fa9cb0 100644 --- a/examples/richtext/textobject/textobject.pro +++ b/examples/richtext/textobject/textobject.pro @@ -12,3 +12,7 @@ sources.files = $$SOURCES $$HEADERS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/richtext/textobject INSTALLS += target sources +filesToDeploy.sources = files/*.svg +filesToDeploy.path = files +DEPLOYMENT += filesToDeploy + -- cgit v0.12 From d69f28f00fe7efda12f9bb236ecd6a0de39232e4 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 2 Jun 2009 16:50:57 +0200 Subject: my changes for 4.5.2 --- dist/changes-4.5.2 | 1 + 1 file changed, 1 insertion(+) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index c87ad92..f5e93f8 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -128,6 +128,7 @@ Qt for Embedded Linux Qt for Windows CE ----------------- +[248846] handle the back soft key on Windows mobile. **************************************************************************** -- cgit v0.12 From e8c6c0cf4d341572e4740940590b0301d208d239 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 2 Jun 2009 17:17:16 +0200 Subject: Update my changelog for 4.5.2 --- dist/changes-4.5.2 | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index f5e93f8..5149eba 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -46,9 +46,23 @@ Third party components Plugins (r41346, r43550, r43915, r43917, r43923) Clipboard (r41360) +- QAbstractItemView + * [250754] Changing the font of the view would not update the size of the + items if there is an application stylesheet. + * [252532] Pressing enter in a QPlainTextEdit embedded on a itemview now + insert a newline + - QAbstractNetworkCache * Only cache responses to HTTP GET by default, not HTTP PUT or POST +- QComboBox + * [253944] Changing the style doesn't reset custom item delegate anymore. + * [254589] Fixed the frame appearing if setting a stylesheet with a border + on the embedded itemview while there is a stylesheet on the application + +- QDir + * Fix reentrency (listing directories in different threads) + - QMacStyle * [253339] Don't draw arrows on toolbuttons that have a menu and text only. * [252301] Ensure that small and mini spin boxes are drawn correctly. @@ -68,6 +82,10 @@ Third party components * [253448] Prevent a crash when using the Qt::WA_MacBrushedMetal attribute in conjunction with style sheets. +- QObject + * Fixed possible race condition if two QObject connected together with + signals and slot are destroyed in different threads + - QPainter * [253783] Fixed text shaping bugs when using ligatures and different scripts in a single text item. @@ -78,16 +96,37 @@ Third party components * [251534] Fixed issue where text with non-opaque color from widget palette would be blitted instead of blended. +- QSelectionModel + * [252069] fix QSelectionModel::rowIntersectsSelection or QSelectionModel::columnsIntersectsSelection not reporting right result if some items are disabled. + +- QSortFilterProxyModel + * [250023] Fixes QSortFilterProxyModel not reporting child if the model + need to fetchMore + * [251296] In dynamic filter model, childs of temporarly filtered items + where not correctly updated. + * [252507] Show a warning instead of crashing if invalid indexes are passed. + * [254234] Fixed setDynamicSortFilter not working when setting the model initially + +- QString + * Fixed reentrency of QString::squeeze() + - QTransform * Fixed issue in QTransform::type() causing a projective transform to be treated as a scaling transform. +- QVector + * Fixed reentrency of QVector::reserve() + - QtOpenGL * [247083] Re-enabled antialiasing for large font sizes in OpenGL paint engine. * [251485] Fixed crash that could occur with projective transforms and high quality antialiasing. +- QCssParser + * [252311] "font-family:" now handle fallback font specified with a comas + separated list. + **************************************************************************** * Database Drivers * **************************************************************************** -- cgit v0.12 From b3ebeff77de9f3e53bea08bfd09eac9cb3a32be3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Tue, 2 Jun 2009 17:55:58 +0200 Subject: Fixed a byte ordering issue when using the raster graphicssystem. The R and B channels were swapped on little endian machines with BGR layout. Task-number: 254934 Reviewed-by: Samuel --- src/gui/painting/qpaintengine_x11.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp index 9cc9683..2e6d593 100644 --- a/src/gui/painting/qpaintengine_x11.cpp +++ b/src/gui/painting/qpaintengine_x11.cpp @@ -1826,9 +1826,10 @@ Q_GUI_EXPORT void qt_x11_drawImage(const QRect &rect, const QPoint &pos, const Q const int h = rect.height(); QImage im; - if ((QSysInfo::ByteOrder == QSysInfo::BigEndian - && ((ImageByteOrder(X11->display) == LSBFirst) || bgr_layout)) - || (ImageByteOrder(X11->display) == MSBFirst && QSysInfo::ByteOrder == QSysInfo::LittleEndian)) + int image_byte_order = ImageByteOrder(X11->display); + if ((QSysInfo::ByteOrder == QSysInfo::BigEndian && ((image_byte_order == LSBFirst) || bgr_layout)) + || (image_byte_order == MSBFirst && QSysInfo::ByteOrder == QSysInfo::LittleEndian) + || (image_byte_order == LSBFirst && bgr_layout)) { im = image.copy(rect); const int iw = im.bytesPerLine() / 4; @@ -1836,19 +1837,21 @@ Q_GUI_EXPORT void qt_x11_drawImage(const QRect &rect, const QPoint &pos, const Q for (int i=0; i < h; i++) { uint *p = data; uint *end = p + w; - if (bgr_layout && ImageByteOrder(X11->display) == MSBFirst && QSysInfo::ByteOrder == QSysInfo::LittleEndian) { + if (bgr_layout && image_byte_order == MSBFirst && QSysInfo::ByteOrder == QSysInfo::LittleEndian) { while (p < end) { *p = ((*p << 8) & 0xffffff00) | ((*p >> 24) & 0x000000ff); p++; } - } else if ((ImageByteOrder(X11->display) == LSBFirst && QSysInfo::ByteOrder == QSysInfo::BigEndian) - || (ImageByteOrder(X11->display) == MSBFirst && QSysInfo::ByteOrder == QSysInfo::LittleEndian)) { + } else if ((image_byte_order == LSBFirst && QSysInfo::ByteOrder == QSysInfo::BigEndian) + || (image_byte_order == MSBFirst && QSysInfo::ByteOrder == QSysInfo::LittleEndian)) { while (p < end) { *p = ((*p << 24) & 0xff000000) | ((*p << 8) & 0x00ff0000) | ((*p >> 8) & 0x0000ff00) | ((*p >> 24) & 0x000000ff); p++; } - } else if (ImageByteOrder(X11->display) == MSBFirst && QSysInfo::ByteOrder == QSysInfo::BigEndian) { + } else if ((image_byte_order == MSBFirst && QSysInfo::ByteOrder == QSysInfo::BigEndian) + || (image_byte_order == LSBFirst && bgr_layout)) + { while (p < end) { *p = ((*p << 16) & 0x00ff0000) | ((*p >> 16) & 0x000000ff) | ((*p ) & 0xff00ff00); -- cgit v0.12 From 9877c2b3b4b9bb8afaac9b207917ccdd866ad1d3 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 2 Jun 2009 20:28:48 +0200 Subject: Since now, S60 commands are handled by QApplication::s60HandleCommandL inside QtGui, we do not need to export those QMenu[Bar]::symbianCommands through our public API, anymore. This commit moved the code of QMenuBar::symbianCommands to QMenuBarPrivate::symbianCommands and made that one static. QMenu[Private]::symbianCommands was apparently unused -> deleted. RevBy: Jason Barron RevvBy: Markku Luukkainen --- src/gui/kernel/qapplication.h | 2 +- src/gui/kernel/qapplication_s60.cpp | 13 ++++++++++--- src/gui/widgets/qmenu.h | 3 --- src/gui/widgets/qmenu_p.h | 1 - src/gui/widgets/qmenu_symbian.cpp | 34 +++++----------------------------- src/gui/widgets/qmenubar.h | 4 ---- src/gui/widgets/qmenubar_p.h | 2 +- src/s60main/qts60mainappui.cpp | 2 +- 8 files changed, 18 insertions(+), 43 deletions(-) diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h index ca0eb98..f9559fa 100644 --- a/src/gui/kernel/qapplication.h +++ b/src/gui/kernel/qapplication.h @@ -233,7 +233,7 @@ public: #if defined(Q_WS_S60) int s60ProcessEvent(TWsEvent *event); virtual bool s60EventFilter(TWsEvent *aEvent); - void s60HandleCommandL(int command); + void symbianHandleCommand(int command); #endif #if defined(Q_WS_QWS) virtual bool qwsEventFilter(QWSEvent *); diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 3d865d3..7b1817f 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -28,7 +28,7 @@ #endif #include "private/qwindowsurface_s60_p.h" #include "qpaintengine.h" -#include "qmenubar.h" +#include "private/qmenubar_p.h" #include "apgwgnam.h" // For CApaWindowGroupName #include // For CMdaAudioToneUtility @@ -1038,7 +1038,14 @@ bool QApplication::s60EventFilter(TWsEvent *aEvent) return false; } -void QApplication::s60HandleCommandL(int command) +/*! + Handles commands which are typically handled by CAknAppUi::HandleCommandL() + Qts Ui integration into Symbian is partially achieved by deriving from CAknAppUi. + Currently, exit, menu and softkey commands are handled + + \sa s60EventFilter(), s60ProcessEvent() +*/ +void QApplication::symbianHandleCommand(int command) { switch (command) { case EEikCmdExit: @@ -1048,7 +1055,7 @@ void QApplication::s60HandleCommandL(int command) break; default: // For now assume all unknown menu items are Qt menu items - QMenuBar::symbianCommands(command); + QMenuBarPrivate::symbianCommands(command); break; } } diff --git a/src/gui/widgets/qmenu.h b/src/gui/widgets/qmenu.h index 1676eb8..bf1c39f 100644 --- a/src/gui/widgets/qmenu.h +++ b/src/gui/widgets/qmenu.h @@ -184,9 +184,6 @@ protected: #ifdef Q_OS_WINCE QAction* wceCommands(uint command); #endif -#ifdef Q_OS_SYMBIAN - void symbianCommands(int command); -#endif private Q_SLOTS: void internalSetSloppyAction(); diff --git a/src/gui/widgets/qmenu_p.h b/src/gui/widgets/qmenu_p.h index a45f12f..aafc945 100644 --- a/src/gui/widgets/qmenu_p.h +++ b/src/gui/widgets/qmenu_p.h @@ -358,7 +358,6 @@ public: return 0; } } *symbian_menu; - bool symbianCommands(int command); #endif QPointer noReplayFor; }; diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index 86affe3..f181924 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -219,42 +219,18 @@ Q_GUI_EXPORT void qt_symbian_show_submenu( CEikMenuPane* menuPane, int id) } } -void QMenu::symbianCommands(int command) -{ - Q_D(QMenu); - d->symbianCommands(command); -} - -void QMenuBar::symbianCommands(int command) +void QMenuBarPrivate::symbianCommands(int command) { int size = nativeMenuBars.size(); for (int i = 0; i < nativeMenuBars.size(); ++i) { - bool result = nativeMenuBars.at(i)->d_func()->symbianCommands(command); - if (result) - return; - } -} - -bool QMenuBarPrivate::symbianCommands(int command) -{ SymbianMenuItem* menu = qt_symbian_find_menu_item(command, symbianMenus); if (!menu) - return false; - - emit q_func()->triggered(menu->action); - menu->action->activate(QAction::Trigger); - return true; -} - -bool QMenuPrivate::symbianCommands(int command) -{ - SymbianMenuItem* menu = qt_symbian_find_menu_item(command, symbianMenus); - if (!menu) - return false; + continue; - emit q_func()->triggered(menu->action); + emit nativeMenuBars.at(i)->triggered(menu->action); menu->action->activate(QAction::Trigger); - return true; + break; + } } void QMenuBarPrivate::symbianCreateMenuBar(QWidget *parent) diff --git a/src/gui/widgets/qmenubar.h b/src/gui/widgets/qmenubar.h index 36c983b..42f0c0c 100644 --- a/src/gui/widgets/qmenubar.h +++ b/src/gui/widgets/qmenubar.h @@ -118,10 +118,6 @@ public: static void wceRefresh(); #endif -#ifdef Q_OS_SYMBIAN - static void symbianCommands(int command); -#endif - public Q_SLOTS: virtual void setVisible(bool visible); diff --git a/src/gui/widgets/qmenubar_p.h b/src/gui/widgets/qmenubar_p.h index d562cd9..7993acd 100644 --- a/src/gui/widgets/qmenubar_p.h +++ b/src/gui/widgets/qmenubar_p.h @@ -259,7 +259,7 @@ public: } } *symbian_menubar; - bool symbianCommands(int command); + static void symbianCommands(int command); #endif }; diff --git a/src/s60main/qts60mainappui.cpp b/src/s60main/qts60mainappui.cpp index dafbe96..8467aef 100644 --- a/src/s60main/qts60mainappui.cpp +++ b/src/s60main/qts60mainappui.cpp @@ -73,7 +73,7 @@ CQtS60MainAppUi::~CQtS60MainAppUi() void CQtS60MainAppUi::HandleCommandL( TInt aCommand ) { if (qApp) - qApp->s60HandleCommandL(aCommand); + qApp->symbianHandleCommand(aCommand); } void CQtS60MainAppUi::HandleWsEventL(const TWsEvent& aEvent, CCoeControl *control) -- cgit v0.12 From ba105741867dd96a9d58dcfcb78afef60e611bd6 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 3 Jun 2009 09:06:54 +0300 Subject: Fix to qapplication::setActiveWindow autotest case in Symbian. In case the application is closing, we should not call process events since event dispatcher is already deleted. Calling processEvents caused application to oanic with KERN-EXEC 3 i.e. access violation. --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 8612e55..e3427ec 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -13,6 +13,7 @@ #include "qcoefepinputcontext_p.h" #include +#include #include #include @@ -59,9 +60,12 @@ QCoeFepInputContext::~QCoeFepInputContext() // This is to make sure that the FEP manager "forgets" about us, // otherwise we may get callbacks even after we're destroyed. // The call is asynchronous though, so we must spin the event loop - // to make sure it gets detected. + // to make sure it gets detected. However we will not spin eventloop + // in case that app is closing, since eventDispatcher is already deleted. CCoeEnv::Static()->InputCapabilitiesChanged(); - QApplication::processEvents(); + if(!QApplicationPrivate::is_app_closing) { + QApplication::processEvents(); + } if (m_fepState) delete m_fepState; -- cgit v0.12 From efcfcdb908a8aef894eff0a9ba13bb92c41b10f5 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 3 Jun 2009 09:08:56 +0300 Subject: Updated QtCore autotest category file used in Symbian. Added utf8 test case to test set. The test passed at least in S60 5.0 emulator. --- tests/auto/_Categories/QtCore.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/_Categories/QtCore.txt b/tests/auto/_Categories/QtCore.txt index fc19f45..0b0b6ce 100644 --- a/tests/auto/_Categories/QtCore.txt +++ b/tests/auto/_Categories/QtCore.txt @@ -103,3 +103,4 @@ qwaitcondition qwineventnotifier qwritelocker q_func_info +utf8 -- cgit v0.12 From 1ba722e9925b2f6c788c73476a9b1ee50faf6049 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 3 Jun 2009 09:10:28 +0300 Subject: Updated QtGui autotest category file used in Symbian. Added modeltest test case to test set. The test passed at least in S60 5.0 emulator. --- tests/auto/_Categories/QtGui.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/_Categories/QtGui.txt b/tests/auto/_Categories/QtGui.txt index f0975e4..b03a870 100644 --- a/tests/auto/_Categories/QtGui.txt +++ b/tests/auto/_Categories/QtGui.txt @@ -1,4 +1,5 @@ languagechange +modeltest qabstractbutton qabstractitemview #qabstractprintdialog NO PRINTING SUPPORT -- cgit v0.12 From 24ab5472408bb906bd5ca904f69eb116d7d385f8 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 3 Jun 2009 09:11:21 +0300 Subject: Updated QtSql autotest category file used in Symbian. Added qsqldriver test case to test set. The test passed at least in S60 5.0 emulator. --- tests/auto/_Categories/QtSql.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/_Categories/QtSql.txt b/tests/auto/_Categories/QtSql.txt index 55c1464..1232500 100644 --- a/tests/auto/_Categories/QtSql.txt +++ b/tests/auto/_Categories/QtSql.txt @@ -1,6 +1,7 @@ qsql qsqlbatch qsqldatabase +qsqldriver qsqlerror qsqlfield qsqlquery -- cgit v0.12 From 0686e72f9fc73a83c4fa92da76063479e2fc0eaf Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 3 Jun 2009 09:18:41 +0300 Subject: Enabled STL related test cases in QtCore autotest category file. STL config is now enabled by default in configure.exe, this means we can also execute the related test cases now. --- tests/auto/_Categories/QtCore.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/auto/_Categories/QtCore.txt b/tests/auto/_Categories/QtCore.txt index 0b0b6ce..131978a 100644 --- a/tests/auto/_Categories/QtCore.txt +++ b/tests/auto/_Categories/QtCore.txt @@ -3,8 +3,8 @@ collections exceptionsafety qabstractitemmodel -# Requires std -#qalgorithms +#Requires STL +qalgorithms qatomicint qatomicpointer qbitarray @@ -68,7 +68,8 @@ qsignalspy qsize qsizef qsocketnotifier -#qstl requires STL +#Requires STL +qstl qstring qstringlist qstringmatcher -- cgit v0.12 From 526a31361417fec3da9910f6e5c0a864556dfefe Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 3 Jun 2009 09:30:44 +0300 Subject: Updated QtCore autotest category file for Symbian - qbytearraymatcher. Added qbytearraymatcher test case to test set. The test passed at least in S60 5.0 emulator. --- tests/auto/_Categories/QtCore.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/_Categories/QtCore.txt b/tests/auto/_Categories/QtCore.txt index 131978a..7238bf8 100644 --- a/tests/auto/_Categories/QtCore.txt +++ b/tests/auto/_Categories/QtCore.txt @@ -10,6 +10,7 @@ qatomicpointer qbitarray qbuffer qbytearray +qbytearraymatcher qcache qchar qcoreapplication -- cgit v0.12 From 3d19bb6e7572cad3644863f3f89cf67a3b7160d7 Mon Sep 17 00:00:00 2001 From: peknurmi Date: Wed, 3 Jun 2009 08:44:41 +0200 Subject: Now qs60style does not send extra resize event in orientation change. QSymbianControl::HandleResourceChange contained global event handling. So Qt handled same issues unnecessarily (for each shown top level widget). Now this global event handling is encapsulated to s60ResourceChange (new method) called by s60main. In addition, qs60style generated unnecessary resize events. If widget was fullscreen or maximized, then this caused incorrect resize events (old size delivered). With these changes, qs60style just informs widgets of style change (similarly as in qstylesheetstyle). Task-number: 251085 Reviewed-by: Jason Barron Conflicts: src/gui/kernel/qapplication.h src/gui/styles/qs60style.cpp --- src/gui/kernel/qapplication.h | 1 + src/gui/kernel/qapplication_s60.cpp | 56 ++++--- src/gui/styles/qs60style.cpp | 26 +++- src/s60main/qts60mainappui.cpp | 13 ++ src/s60main/qts60mainappui.h | 7 + .../orientationchange/orientationchange.pro | 7 + .../orientationchange/tst_orientationchange.cpp | 165 +++++++++++++++++++++ tests/auto/symbian/qsymbiantests.pro | 2 +- 8 files changed, 247 insertions(+), 30 deletions(-) create mode 100644 tests/auto/symbian/orientationchange/orientationchange.pro create mode 100644 tests/auto/symbian/orientationchange/tst_orientationchange.cpp diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h index f9559fa..6088780 100644 --- a/src/gui/kernel/qapplication.h +++ b/src/gui/kernel/qapplication.h @@ -234,6 +234,7 @@ public: int s60ProcessEvent(TWsEvent *event); virtual bool s60EventFilter(TWsEvent *aEvent); void symbianHandleCommand(int command); + void s60ResourceChangeL(int type); #endif #if defined(Q_WS_QWS) virtual bool qwsEventFilter(QWSEvent *); diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 7b1817f..dc2b9d3 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -649,21 +649,7 @@ void QSymbianControl::HandleResourceChange(int resourceType) // font change event break; case KEikDynamicLayoutVariantSwitch: - { -#ifndef QT_NO_STYLE_S60 - QS60Style *s60Style = 0; - -#ifndef QT_NO_STYLE_STYLESHEET - QStyleSheetStyle *proxy = qobject_cast(QApplication::style()); - if (proxy) - s60Style = qobject_cast(proxy->baseStyle()); - else -#endif - s60Style = qobject_cast(QApplication::style()); - - if (s60Style) - s60Style->handleDynamicLayoutVariantSwitch(); -#endif + { if (qwidget->isFullScreen()) { SetExtentToWholeScreen(); } else if (qwidget->isMaximized()) { @@ -672,12 +658,6 @@ void QSymbianControl::HandleResourceChange(int resourceType) } break; } -#ifndef QT_NO_STYLE_S60 - case KAknsMessageSkinChange: - if (QS60Style *s60Style = qobject_cast(QApplication::style())) - s60Style->handleSkinChange(); - break; -#endif default: break; } @@ -1060,6 +1040,40 @@ void QApplication::symbianHandleCommand(int command) } } +void QApplication::s60ResourceChangeL(int type) +{ + switch (type) { + case KEikDynamicLayoutVariantSwitch: + { +#ifndef QT_NO_STYLE_S60 + QS60Style *s60Style = 0; + +#ifndef QT_NO_STYLE_STYLESHEET + QStyleSheetStyle *proxy = qobject_cast(QApplication::style()); + if (proxy) + s60Style = qobject_cast(proxy->baseStyle()); + else +#endif + s60Style = qobject_cast(QApplication::style()); + + if (s60Style) + s60Style->handleDynamicLayoutVariantSwitch(); +#endif + } + break; + +#ifndef QT_NO_STYLE_S60 + case KAknsMessageSkinChange: + if (QS60Style *s60Style = qobject_cast(QApplication::style())) + s60Style->handleSkinChange(); + break; +#endif + + default: + break; + } +} + #ifndef QT_NO_WHEELEVENT int QApplication::wheelScrollLines() { diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index fde1cc6..3aaa839 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -119,6 +119,22 @@ static const int frameElementsCount = const int KNotFound = -1; +static void updateWidgets(const QList& widgets) +{ + // This is based on updateWidgets in qstylesheetstyle.cpp. + + for (int i = 0; i < widgets.size(); ++i) { + QWidget *widget = const_cast(widgets.at(i)); + if (widget == 0) + continue; + widget->style()->polish(widget); + QEvent event(QEvent::StyleChange); + qApp->sendEvent(widget, &event); + widget->update(); + widget->updateGeometry(); + } +} + QS60StylePrivate::~QS60StylePrivate() { clearCaches(); //deletes also background image @@ -584,14 +600,8 @@ QPixmap QS60StylePrivate::cachedFrame(SkinFrameElements frame, const QSize &size } void QS60StylePrivate::refreshUI() -{ - foreach (QWidget *topLevelWidget, QApplication::allWidgets()) { - topLevelWidget->updateGeometry(); - //todo: study how we can get rid of this. Apparently scrollbars cache pixelmetrics values, and we need them to update themselves - // maybe styleChanged event is enough? - //QCoreApplication::postEvent(topLevelWidget, new QEvent(QEvent::StyleChange)); - QCoreApplication::postEvent(topLevelWidget, new QResizeEvent(topLevelWidget->size(), topLevelWidget->size())); - } +{ + updateWidgets(QApplication::allWidgets()); } void QS60StylePrivate::setFont(QWidget *widget) const diff --git a/src/s60main/qts60mainappui.cpp b/src/s60main/qts60mainappui.cpp index 8467aef..f7e570b 100644 --- a/src/s60main/qts60mainappui.cpp +++ b/src/s60main/qts60mainappui.cpp @@ -76,6 +76,19 @@ void CQtS60MainAppUi::HandleCommandL( TInt aCommand ) qApp->symbianHandleCommand(aCommand); } +// ----------------------------------------------------------------------------- +// CQtS60MainAppUi::HandleResourceChangeL() +// Takes care of event handling. +// ----------------------------------------------------------------------------- +// +void CQtS60MainAppUi::HandleResourceChangeL(TInt aType) +{ + CAknAppUi::HandleResourceChangeL(aType); + + if (qApp) + qApp->s60ResourceChangeL(aType); +} + void CQtS60MainAppUi::HandleWsEventL(const TWsEvent& aEvent, CCoeControl *control) { int result = 0; diff --git a/src/s60main/qts60mainappui.h b/src/s60main/qts60mainappui.h index 3addb0c..8124fa3 100644 --- a/src/s60main/qts60mainappui.h +++ b/src/s60main/qts60mainappui.h @@ -61,6 +61,13 @@ class CQtS60MainAppUi : public CAknAppUi void HandleCommandL( TInt aCommand ); /** + * From CAknAppUi, HandleResourceChangeL + * Handles resource change events such as layout switches in global level. + * @param aType event type. + */ + void HandleResourceChangeL(TInt aType); + + /** * HandleStatusPaneSizeChange. * Called by the framework when the application status pane * size is changed. diff --git a/tests/auto/symbian/orientationchange/orientationchange.pro b/tests/auto/symbian/orientationchange/orientationchange.pro new file mode 100644 index 0000000..d240fa1 --- /dev/null +++ b/tests/auto/symbian/orientationchange/orientationchange.pro @@ -0,0 +1,7 @@ +load(qttest_p4) +HEADERS += +SOURCES += tst_orientationchange.cpp + +symbian { + INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE +} diff --git a/tests/auto/symbian/orientationchange/tst_orientationchange.cpp b/tests/auto/symbian/orientationchange/tst_orientationchange.cpp new file mode 100644 index 0000000..9d57ae1 --- /dev/null +++ b/tests/auto/symbian/orientationchange/tst_orientationchange.cpp @@ -0,0 +1,165 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#ifdef Q_OS_SYMBIAN + +#include +#include + +class tst_orientationchange : public QObject +{ + Q_OBJECT +public: + tst_orientationchange(){}; + ~tst_orientationchange(){}; + +private slots: + void resizeEventOnOrientationChange(); +}; + +class TestWidget : public QWidget +{ +public: + TestWidget(QWidget *parent = 0); + + void reset(); +public: + void resizeEvent(QResizeEvent *event); + +public: + QSize resizeEventSize; + int resizeEventCount; +}; + +TestWidget::TestWidget(QWidget *parent) +: QWidget(parent) +{ + reset(); +} + +void TestWidget::reset() +{ + resizeEventSize = QSize(); + resizeEventCount = 0; +} + +void TestWidget::resizeEvent(QResizeEvent *event) +{ + QWidget::resizeEvent(event); + + // Size delivered in first resize event is stored. + if (!resizeEventCount) + resizeEventSize = event->size(); + + resizeEventCount++; +} + +void tst_orientationchange::resizeEventOnOrientationChange() +{ + // This will test that when orientation 'changes', then + // at most one resize event is generated. + + TestWidget *normalWidget = new TestWidget(); + TestWidget *fullScreenWidget = new TestWidget(); + TestWidget *maximizedWidget = new TestWidget(); + + fullScreenWidget->showFullScreen(); + maximizedWidget->showMaximized(); + normalWidget->show(); + + QCoreApplication::sendPostedEvents(); + QCoreApplication::sendPostedEvents(); + + QCOMPARE(fullScreenWidget->resizeEventCount, 1); + QCOMPARE(fullScreenWidget->size(), fullScreenWidget->resizeEventSize); + QCOMPARE(maximizedWidget->resizeEventCount, 1); + QCOMPARE(maximizedWidget->size(), maximizedWidget->resizeEventSize); + QCOMPARE(normalWidget->resizeEventCount, 1); + QCOMPARE(normalWidget->size(), normalWidget->resizeEventSize); + + fullScreenWidget->reset(); + maximizedWidget->reset(); + normalWidget->reset(); + + // Assumes that Qt application is AVKON application. + CAknAppUi *appUi = static_cast(CEikonEnv::Static()->EikAppUi()); + + // Determine 'opposite' orientation to the current orientation. + + CAknAppUi::TAppUiOrientation orientation = CAknAppUi::EAppUiOrientationLandscape; + if (fullScreenWidget->size().width() > fullScreenWidget->size().height()) { + orientation = CAknAppUi::EAppUiOrientationPortrait; + } + + TRAPD(err, appUi->SetOrientationL(orientation)); + + QCoreApplication::sendPostedEvents(); + QCoreApplication::sendPostedEvents(); + + // setOrientationL is not guaranteed to change orientation + // (if emulator configured to support just portrait or landscape, then + // setOrientationL call shouldn't do anything). + // So let's ensure that we do not get resize event twice. + + QVERIFY(fullScreenWidget->resizeEventCount <= 1); + if (fullScreenWidget->resizeEventCount) { + QCOMPARE(fullScreenWidget->size(), fullScreenWidget->resizeEventSize); + } + QVERIFY(maximizedWidget->resizeEventCount <= 1); + if (fullScreenWidget->resizeEventCount) { + QCOMPARE(maximizedWidget->size(), maximizedWidget->resizeEventSize); + } + QCOMPARE(normalWidget->resizeEventCount, 0); + + TRAP(err, appUi->SetOrientationL(CAknAppUi::EAppUiOrientationUnspecified)); + + delete normalWidget; + delete fullScreenWidget; + delete maximizedWidget; +} + +QTEST_MAIN(tst_orientationchange) +#include "tst_orientationchange.moc" +#else +QTEST_NOOP_MAIN +#endif diff --git a/tests/auto/symbian/qsymbiantests.pro b/tests/auto/symbian/qsymbiantests.pro index 151d7ec..648335e 100644 --- a/tests/auto/symbian/qsymbiantests.pro +++ b/tests/auto/symbian/qsymbiantests.pro @@ -1,2 +1,2 @@ TEMPLATE = subdirs -SUBDIRS = qmainexceptions \ No newline at end of file +SUBDIRS = qmainexceptions orientationchange \ No newline at end of file -- cgit v0.12 From 7a7a73184b5de3be3bb84df3991ca95461a711cc Mon Sep 17 00:00:00 2001 From: peknurmi Date: Wed, 3 Jun 2009 08:51:56 +0200 Subject: Some minor correction to qs60style. Added null check to qs60style::refreshUI method. Reviewed-by: Jason Barron Conflicts: src/gui/styles/qs60style.cpp --- src/gui/styles/qs60style.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 3aaa839..93a3144 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -119,22 +119,6 @@ static const int frameElementsCount = const int KNotFound = -1; -static void updateWidgets(const QList& widgets) -{ - // This is based on updateWidgets in qstylesheetstyle.cpp. - - for (int i = 0; i < widgets.size(); ++i) { - QWidget *widget = const_cast(widgets.at(i)); - if (widget == 0) - continue; - widget->style()->polish(widget); - QEvent event(QEvent::StyleChange); - qApp->sendEvent(widget, &event); - widget->update(); - widget->updateGeometry(); - } -} - QS60StylePrivate::~QS60StylePrivate() { clearCaches(); //deletes also background image @@ -600,8 +584,24 @@ QPixmap QS60StylePrivate::cachedFrame(SkinFrameElements frame, const QSize &size } void QS60StylePrivate::refreshUI() -{ - updateWidgets(QApplication::allWidgets()); +{ + QList widgets = QApplication::allWidgets(); + + // The following is similar to updateWidgets in qstylesheetstyle.cpp. + + for (int i = 0; i < widgets.size(); ++i) { + QWidget *widget = widgets.at(i); + if (widget == 0) + continue; + + if (widget->style()) { + widget->style()->polish(widget); + QEvent event(QEvent::StyleChange); + qApp->sendEvent(widget, &event); + } + widget->update(); + widget->updateGeometry(); + } } void QS60StylePrivate::setFont(QWidget *widget) const -- cgit v0.12 From 6ea9dca71b58c51e8fdb44fdd7d9b2a0381538cb Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Wed, 3 Jun 2009 08:55:35 +0200 Subject: Change function name to match symbianHandleCommand(). These functions are really Symbian functions and not S60 specific so they should be named as such. Also, our public API should use the Qt convention and not the Symbian convention so remove the 'L' even if it is a leaving function at the moment. --- src/gui/kernel/qapplication.h | 2 +- src/gui/kernel/qapplication_s60.cpp | 2 +- src/s60main/qts60mainappui.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h index 6088780..e1b8b26 100644 --- a/src/gui/kernel/qapplication.h +++ b/src/gui/kernel/qapplication.h @@ -234,7 +234,7 @@ public: int s60ProcessEvent(TWsEvent *event); virtual bool s60EventFilter(TWsEvent *aEvent); void symbianHandleCommand(int command); - void s60ResourceChangeL(int type); + void symbianResourceChange(int type); #endif #if defined(Q_WS_QWS) virtual bool qwsEventFilter(QWSEvent *); diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index dc2b9d3..a05e9bd 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1040,7 +1040,7 @@ void QApplication::symbianHandleCommand(int command) } } -void QApplication::s60ResourceChangeL(int type) +void QApplication::symbianResourceChange(int type) { switch (type) { case KEikDynamicLayoutVariantSwitch: diff --git a/src/s60main/qts60mainappui.cpp b/src/s60main/qts60mainappui.cpp index f7e570b..49a3342 100644 --- a/src/s60main/qts60mainappui.cpp +++ b/src/s60main/qts60mainappui.cpp @@ -86,7 +86,7 @@ void CQtS60MainAppUi::HandleResourceChangeL(TInt aType) CAknAppUi::HandleResourceChangeL(aType); if (qApp) - qApp->s60ResourceChangeL(aType); + qApp->symbianResourceChange(aType); } void CQtS60MainAppUi::HandleWsEventL(const TWsEvent& aEvent, CCoeControl *control) -- cgit v0.12 From 917372922f90b1b108575ad391aa74c9d0d9c94d Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 3 Jun 2009 10:10:19 +0300 Subject: Adapted _networkselftest autotest for Symbian environment. - Fixed SRCDIR thing - Added default IAP handling - Skipped NTML related test cases for now --- tests/auto/_networkselftest/_networkselftest.pro | 2 +- .../auto/_networkselftest/tst_networkselftest.cpp | 30 ++++++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/tests/auto/_networkselftest/_networkselftest.pro b/tests/auto/_networkselftest/_networkselftest.pro index 9e2ad0e..a2e1adf 100644 --- a/tests/auto/_networkselftest/_networkselftest.pro +++ b/tests/auto/_networkselftest/_networkselftest.pro @@ -2,5 +2,5 @@ load(qttest_p4) SOURCES += tst_networkselftest.cpp QT = core network -DEFINES += SRCDIR=\\\"$$PWD\\\" +!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/_networkselftest/tst_networkselftest.cpp b/tests/auto/_networkselftest/tst_networkselftest.cpp index dab4433..0e64988 100644 --- a/tests/auto/_networkselftest/tst_networkselftest.cpp +++ b/tests/auto/_networkselftest/tst_networkselftest.cpp @@ -43,9 +43,17 @@ #include #include "../network-settings.h" +#if defined(Q_OS_SYMBIAN) +#define SRCDIR "" +#endif + class tst_NetworkSelfTest: public QObject { Q_OBJECT +public: + tst_NetworkSelfTest(); + virtual ~tst_NetworkSelfTest(); + private slots: void hostTest(); void dnsResolution_data(); @@ -60,7 +68,7 @@ private slots: void httpServer(); void httpsServer(); void httpProxy(); - void httpProxyBasicAuth(); + void httpProxyBasicAuth(); void httpProxyNtlmAuth(); void socks5Proxy(); void socks5ProxyAuth(); @@ -309,6 +317,15 @@ static void netChat(int port, const QList &chat) } } +tst_NetworkSelfTest::tst_NetworkSelfTest() +{ + Q_SET_DEFAULT_IAP +} + +tst_NetworkSelfTest::~tst_NetworkSelfTest() +{ +} + void tst_NetworkSelfTest::hostTest() { // this is a localhost self-test @@ -360,13 +377,18 @@ void tst_NetworkSelfTest::remotePortsOpen_data() QTest::newRow("https") << 443; QTest::newRow("http-proxy") << 3128; QTest::newRow("http-proxy-auth-basic") << 3129; - QTest::newRow("http-proxy-auth-ntlm") << 3130; + QTest::newRow("http-proxy-auth-ntlm") << 3130; QTest::newRow("socks5-proxy") << 1080; QTest::newRow("socks5-proxy-auth") << 1081; } void tst_NetworkSelfTest::remotePortsOpen() { +#ifdef Q_OS_SYMBIAN + if (qstrcmp(QTest::currentDataTag(), "http-proxy-auth-ntlm") == 0) + QSKIP("NTML authentication not yet supported in Symbian", SkipSingle); +#endif + QFETCH(int, portNumber); QTcpSocket socket; socket.connectToHost(QtNetworkSettings::serverName(), portNumber); @@ -520,6 +542,9 @@ void tst_NetworkSelfTest::httpProxyBasicAuth() void tst_NetworkSelfTest::httpProxyNtlmAuth() { +#ifdef Q_OS_SYMBIAN + QSKIP("NTML authentication not yet supported in Symbian", SkipAll); +#else netChat(3130, QList() // test auth required response << Chat::send("GET http://" + QtNetworkSettings::serverName().toLatin1() + "/ HTTP/1.0\r\n" @@ -532,6 +557,7 @@ void tst_NetworkSelfTest::httpProxyNtlmAuth() << Chat::discardUntil("\r\nProxy-Authenticate: NTLM\r\n") << Chat::DiscardUntilDisconnect ); +#endif } // SOCKSv5 is a binary protocol -- cgit v0.12 From 33c88e4ed64a31a1cdfe1cedd9e6a2c0ddbdc05f Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 3 Jun 2009 10:12:07 +0300 Subject: Added _networkselftest to QtNetwork autotest category file. --- tests/auto/_Categories/QtNetwork.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/_Categories/QtNetwork.txt b/tests/auto/_Categories/QtNetwork.txt index 60df74a..f5d191d 100644 --- a/tests/auto/_Categories/QtNetwork.txt +++ b/tests/auto/_Categories/QtNetwork.txt @@ -1,3 +1,5 @@ +_networkselftest +#qsocketnotifier qabstractnetworkcache qabstractsocket qftp -- cgit v0.12 From b469fd9aac5c0e4a87ea1a9be254b566c0353702 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 3 Jun 2009 09:15:57 +0200 Subject: _networktest compile fix Reviewed-by: mauricek --- tests/auto/_networkselftest/tst_networkselftest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/_networkselftest/tst_networkselftest.cpp b/tests/auto/_networkselftest/tst_networkselftest.cpp index dab4433..0fa001a 100644 --- a/tests/auto/_networkselftest/tst_networkselftest.cpp +++ b/tests/auto/_networkselftest/tst_networkselftest.cpp @@ -463,7 +463,7 @@ void tst_NetworkSelfTest::httpsServer() << Chat::expect("200 ") << Chat::DiscardUntilDisconnect); #else - QSKIP("SSL not enabled, cannot test"); + QSKIP("SSL not enabled, cannot test", SkipAll); #endif } -- cgit v0.12 From 5ef34ed91918402aabc10cee5b790df619cf2783 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 3 Jun 2009 10:54:11 +0300 Subject: S60 installation docs update. --- doc/src/installation.qdoc | 28 ++++++++++++++++++------- doc/src/snippets/code/doc_src_installation.qdoc | 9 ++++++++ 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/doc/src/installation.qdoc b/doc/src/installation.qdoc index 319420b..7cd7b0c 100644 --- a/doc/src/installation.qdoc +++ b/doc/src/installation.qdoc @@ -508,13 +508,22 @@ in the \l{Qt for Windows CE Requirements} document. \list 1 \o Install needed IDE and SDKs - Make sure you have the following installed: + Make sure you have the following installed on your development PC: \list \o \l{http://www.forum.nokia.com/main/resources/tools_and_sdks/carbide_cpp/}{Carbide.c++ v2.0.0 or higher} \o \l{http://www.forum.nokia.com/main/resources/tools_and_sdks/S60SDK/}{S60 Platform SDK 3rd Edition FP1 or higher} - \o \l{http://www.forum.nokia.com/main/resources/technologies/openc_cpp/}{Open C/C++ for S60 3rd Edition} (automatically included in 3.2 and higher) + \o \l{http://www.forum.nokia.com/main/resources/technologies/openc_cpp/}{Open C/C++ v1.6.0 or higher}. + Install this to all S60 SDKs you plan to use Qt with. \endlist + Make sure you have the following packages installed on any device you want to use to run Qt applications. + These packages can be found under \c nokia_plugin directory in any S60 SDK where you have installed Open C/C++: + \list + \o pips_s60_.sis + \o openc_ssl_s60_.sis + \o stdcpp_s60_.sis + \endlist + These instructions assume the above tools are installed and that the enviroment variables for your compiler are set correctly. @@ -568,13 +577,16 @@ in the \l{Qt for Windows CE Requirements} document. We've included a subset of the Qt demos in this package for you to try out. An excellent starting point is the "fluidlauncher" demo. To run the demo on a real device, you first have to install - the Qt libraries and the demo on the device. - Install \c{qt_libs.sis} and \c{fluidlauncher.sis} - found at Qt installation folder to the device. + \c{qt_libs.sis} and \c{fluidlauncher.sis} + found at Qt installation directory to the device. - To run the demos on the emulator, navigate to - \c{%EPOCROOT%\Epoc32\release\winscw\udeb\} and start any of the - Qt demos located there, for example: + To run the demos and examples on the emulator, you need to build them first: + + \snippet doc/src/snippets/code/doc_src_installation.qdoc 25 + + After building, you can run demos and examples by navigating to + \c{%EPOCROOT%\Epoc32\release\winscw\udeb\} and starting any of the + Qt demos and examples located there. For example: \snippet doc/src/snippets/code/doc_src_installation.qdoc 26 diff --git a/doc/src/snippets/code/doc_src_installation.qdoc b/doc/src/snippets/code/doc_src_installation.qdoc index 8730125..d698f4a 100644 --- a/doc/src/snippets/code/doc_src_installation.qdoc +++ b/doc/src/snippets/code/doc_src_installation.qdoc @@ -137,6 +137,15 @@ configure -platform win32-mwc -xplatform symbian-abld make debug-winscw //! [24] +//! [25] +cd examples +qmake +make +cd ..\demos +qmake +make +//! [25] + //! [26] wiggly.exe -small-screen -- cgit v0.12 From 0f0f50aee7f3e5c647edda2ed3e7cd00deeb58ad Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 3 Jun 2009 11:07:16 +0300 Subject: Fixed tst_qcombobox compiler errors for Symbian WINSCW target. --- tests/auto/qcombobox/tst_qcombobox.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp index 13ffd67..4973d4f 100644 --- a/tests/auto/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/qcombobox/tst_qcombobox.cpp @@ -2219,7 +2219,7 @@ void tst_QComboBox::setItemDelegate() QComboBox comboBox; QStyledItemDelegate *itemDelegate = new QStyledItemDelegate; comboBox.setItemDelegate(itemDelegate); - QCOMPARE(comboBox.itemDelegate(), itemDelegate); + QCOMPARE(static_cast(comboBox.itemDelegate()), itemDelegate); } void tst_QComboBox::task253944_itemDelegateIsReset() @@ -2229,10 +2229,10 @@ void tst_QComboBox::task253944_itemDelegateIsReset() comboBox.setItemDelegate(itemDelegate); comboBox.setEditable(true); - QCOMPARE(comboBox.itemDelegate(), itemDelegate); + QCOMPARE(static_cast(comboBox.itemDelegate()), itemDelegate); comboBox.setStyleSheet("QComboBox { border: 1px solid gray; }"); - QCOMPARE(comboBox.itemDelegate(), itemDelegate); + QCOMPARE(static_cast(comboBox.itemDelegate()), itemDelegate); } QTEST_MAIN(tst_QComboBox) -- cgit v0.12 From 10b1e68d07746fde5ec6d6d2fc3f46fb803a2462 Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Wed, 3 Jun 2009 10:14:49 +0200 Subject: Doc - fixed a typo Reviewed-By: TrustMe --- doc/src/tutorials/addressbook.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/tutorials/addressbook.qdoc b/doc/src/tutorials/addressbook.qdoc index 3b0d2bc..3ec883f 100644 --- a/doc/src/tutorials/addressbook.qdoc +++ b/doc/src/tutorials/addressbook.qdoc @@ -303,7 +303,7 @@ Within the constructor of \c AddressBook, we set the \c nameLine and \c addressText to read-only, so that we can only display but not edit - existing cotact details. + existing contact details. \dots \snippet tutorials/addressbook/part2/addressbook.cpp setting readonly 1 -- cgit v0.12 From 716e2105dce4487baa32a4e11b69f1d394515a86 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 3 Jun 2009 11:11:41 +0200 Subject: Add a note about what happens when passing 0 to qobject_cast in the doc Reviewed-by: Kavindra Palaraja --- src/corelib/kernel/qobject.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 7e5f779..6583b85 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -912,7 +912,8 @@ QObject::~QObject() \relates QObject Returns the given \a object cast to type T if the object is of type - T (or of a subclass); otherwise returns 0. + T (or of a subclass); otherwise returns 0. If \a object is 0 then + it will also return 0. The class T must inherit (directly or indirectly) QObject and be declared with the \l Q_OBJECT macro. -- cgit v0.12 From a014c0746cf9d4dfb8ba8c0e67060d577c09dd3c Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 3 Jun 2009 11:19:44 +0200 Subject: Fixed incorrect headers. --- demos/embedded/desktopservices/contenttab.cpp | 32 +++++++++++++++++++++- demos/embedded/desktopservices/contenttab.h | 32 +++++++++++++++++++++- demos/embedded/desktopservices/desktopwidget.cpp | 32 +++++++++++++++++++++- demos/embedded/desktopservices/desktopwidget.h | 32 +++++++++++++++++++++- demos/embedded/desktopservices/linktab.cpp | 32 +++++++++++++++++++++- demos/embedded/desktopservices/linktab.h | 32 +++++++++++++++++++++- demos/embedded/desktopservices/main.cpp | 32 +++++++++++++++++++++- doc/src/examples/htmlinfo.qdoc | 32 +++++++++++++++++++++- doc/src/s60-introduction.qdoc | 32 +++++++++++++++++++++- examples/xml/htmlinfo/main.cpp | 32 +++++++++++++++++++++- mkspecs/common/symbian/fixed_stdlib.h | 32 +++++++++++++++++++++- mkspecs/common/symbian/qplatformdefs.h | 32 +++++++++++++++++++++- mkspecs/win32-mwc/qplatformdefs.h | 32 +++++++++++++++++++++- .../symbian/initprojectdeploy_symbian.cpp | 32 +++++++++++++++++++++- .../generators/symbian/initprojectdeploy_symbian.h | 32 +++++++++++++++++++++- qmake/generators/symbian/symmake.cpp | 32 +++++++++++++++++++++- qmake/generators/symbian/symmake.h | 32 +++++++++++++++++++++- qmake/generators/symbian/symmake_abld.cpp | 32 +++++++++++++++++++++- qmake/generators/symbian/symmake_abld.h | 32 +++++++++++++++++++++- qmake/generators/symbian/symmake_sbsv2.cpp | 32 +++++++++++++++++++++- qmake/generators/symbian/symmake_sbsv2.h | 32 +++++++++++++++++++++- qmake/qpopen.cpp | 32 +++++++++++++++++++++- qmake/qpopen.h | 32 +++++++++++++++++++++- src/corelib/arch/qatomic_symbian.h | 32 +++++++++++++++++++++- src/corelib/arch/symbian/qatomic_symbian.cpp | 32 +++++++++++++++++++++- src/corelib/io/qfilesystemwatcher_symbian.cpp | 32 +++++++++++++++++++++- src/corelib/io/qfilesystemwatcher_symbian_p.h | 32 +++++++++++++++++++++- src/corelib/io/qprocess_symbian.cpp | 32 +++++++++++++++++++++- src/corelib/kernel/qcore_symbian_p.cpp | 32 +++++++++++++++++++++- src/corelib/kernel/qcore_symbian_p.h | 32 +++++++++++++++++++++- src/corelib/kernel/qeventdispatcher_symbian.cpp | 32 +++++++++++++++++++++- src/corelib/kernel/qeventdispatcher_symbian_p.h | 32 +++++++++++++++++++++- src/corelib/kernel/qsharedmemory_symbian.cpp | 32 +++++++++++++++++++++- src/corelib/kernel/qsystemsemaphore_symbian.cpp | 32 +++++++++++++++++++++- src/gui/image/qpixmap_s60.cpp | 32 +++++++++++++++++++++- src/gui/inputmethod/qcoefepinputcontext_p.h | 32 +++++++++++++++++++++- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 32 +++++++++++++++++++++- src/gui/kernel/qapplication_s60.cpp | 32 +++++++++++++++++++++- src/gui/kernel/qclipboard_s60.cpp | 32 +++++++++++++++++++++- src/gui/kernel/qcursor_s60.cpp | 32 +++++++++++++++++++++- src/gui/kernel/qdesktopwidget_s60.cpp | 32 +++++++++++++++++++++- src/gui/kernel/qdnd_s60.cpp | 32 +++++++++++++++++++++- src/gui/kernel/qeventdispatcher_s60.cpp | 32 +++++++++++++++++++++- src/gui/kernel/qeventdispatcher_s60_p.h | 32 +++++++++++++++++++++- src/gui/kernel/qkeymapper_s60.cpp | 32 +++++++++++++++++++++- src/gui/kernel/qsound_s60.cpp | 32 +++++++++++++++++++++- src/gui/kernel/qt_s60_p.h | 32 +++++++++++++++++++++- src/gui/kernel/qwidget_s60.cpp | 32 +++++++++++++++++++++- src/gui/painting/qpaintdevice_s60.cpp | 32 +++++++++++++++++++++- src/gui/painting/qregion_s60.cpp | 32 +++++++++++++++++++++- src/gui/painting/qwindowsurface_s60.cpp | 32 +++++++++++++++++++++- src/gui/painting/qwindowsurface_s60_p.h | 32 +++++++++++++++++++++- src/gui/styles/qs60style.cpp | 32 +++++++++++++++++++++- src/gui/styles/qs60style.h | 32 +++++++++++++++++++++- src/gui/styles/qs60style_p.h | 32 +++++++++++++++++++++- src/gui/styles/qs60style_simulated.cpp | 32 +++++++++++++++++++++- src/gui/styles/qs60style_symbian.cpp | 32 +++++++++++++++++++++- src/gui/text/qfont_s60.cpp | 32 +++++++++++++++++++++- src/gui/text/qfontdatabase_s60.cpp | 32 +++++++++++++++++++++- src/gui/text/qfontengine_s60.cpp | 32 +++++++++++++++++++++- src/gui/text/qfontengine_s60_p.h | 32 +++++++++++++++++++++- src/gui/util/qdesktopservices_s60.cpp | 32 +++++++++++++++++++++- src/gui/widgets/qmenu_symbian.cpp | 32 +++++++++++++++++++++- src/network/kernel/qnetworkinterface_symbian.cpp | 32 +++++++++++++++++++++- src/plugins/s60/src/qdesktopservices_3_1.cpp | 32 +++++++++++++++++++++- src/plugins/s60/src/qdesktopservices_3_2.cpp | 32 +++++++++++++++++++++- src/plugins/s60/src/qlocale_3_1.cpp | 32 +++++++++++++++++++++- src/plugins/s60/src/qlocale_3_2.cpp | 32 +++++++++++++++++++++- src/s60main/qts60main.cpp | 32 +++++++++++++++++++++- src/s60main/qts60main_mcrt0.cpp | 32 +++++++++++++++++++++- src/s60main/qts60mainapplication.cpp | 32 +++++++++++++++++++++- src/s60main/qts60mainapplication.h | 32 +++++++++++++++++++++- src/s60main/qts60mainappui.cpp | 32 +++++++++++++++++++++- src/s60main/qts60mainappui.h | 32 +++++++++++++++++++++- src/s60main/qts60maindocument.cpp | 32 +++++++++++++++++++++- src/s60main/qts60maindocument.h | 32 +++++++++++++++++++++- src/s60main/s60main.rss | 32 +++++++++++++++++++++- 77 files changed, 2387 insertions(+), 77 deletions(-) diff --git a/demos/embedded/desktopservices/contenttab.cpp b/demos/embedded/desktopservices/contenttab.cpp index 1abb051..12e80f6 100644 --- a/demos/embedded/desktopservices/contenttab.cpp +++ b/demos/embedded/desktopservices/contenttab.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/embedded/desktopservices/contenttab.h b/demos/embedded/desktopservices/contenttab.h index 60fabc8..af1b7bb 100644 --- a/demos/embedded/desktopservices/contenttab.h +++ b/demos/embedded/desktopservices/contenttab.h @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/embedded/desktopservices/desktopwidget.cpp b/demos/embedded/desktopservices/desktopwidget.cpp index 17243cf..e8a654e 100644 --- a/demos/embedded/desktopservices/desktopwidget.cpp +++ b/demos/embedded/desktopservices/desktopwidget.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/embedded/desktopservices/desktopwidget.h b/demos/embedded/desktopservices/desktopwidget.h index a947e80..246ab18 100644 --- a/demos/embedded/desktopservices/desktopwidget.h +++ b/demos/embedded/desktopservices/desktopwidget.h @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/embedded/desktopservices/linktab.cpp b/demos/embedded/desktopservices/linktab.cpp index 0d5bea7..b4ab308 100644 --- a/demos/embedded/desktopservices/linktab.cpp +++ b/demos/embedded/desktopservices/linktab.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/embedded/desktopservices/linktab.h b/demos/embedded/desktopservices/linktab.h index f88c334..2ce1094 100644 --- a/demos/embedded/desktopservices/linktab.h +++ b/demos/embedded/desktopservices/linktab.h @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/demos/embedded/desktopservices/main.cpp b/demos/embedded/desktopservices/main.cpp index 32e22ae..ebbcf63 100644 --- a/demos/embedded/desktopservices/main.cpp +++ b/demos/embedded/desktopservices/main.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/doc/src/examples/htmlinfo.qdoc b/doc/src/examples/htmlinfo.qdoc index bf95486..af236e1 100644 --- a/doc/src/examples/htmlinfo.qdoc +++ b/doc/src/examples/htmlinfo.qdoc @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/doc/src/s60-introduction.qdoc b/doc/src/s60-introduction.qdoc index e6e6b7e..af67a8a 100644 --- a/doc/src/s60-introduction.qdoc +++ b/doc/src/s60-introduction.qdoc @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/xml/htmlinfo/main.cpp b/examples/xml/htmlinfo/main.cpp index fcf480b..72aef81 100644 --- a/examples/xml/htmlinfo/main.cpp +++ b/examples/xml/htmlinfo/main.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/mkspecs/common/symbian/fixed_stdlib.h b/mkspecs/common/symbian/fixed_stdlib.h index 2346afe..7fd73d6 100644 --- a/mkspecs/common/symbian/fixed_stdlib.h +++ b/mkspecs/common/symbian/fixed_stdlib.h @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/mkspecs/common/symbian/qplatformdefs.h b/mkspecs/common/symbian/qplatformdefs.h index 90d3f41..ebcd295 100644 --- a/mkspecs/common/symbian/qplatformdefs.h +++ b/mkspecs/common/symbian/qplatformdefs.h @@ -5,7 +5,37 @@ ** ** This file is part of the qmake spec of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/mkspecs/win32-mwc/qplatformdefs.h b/mkspecs/win32-mwc/qplatformdefs.h index 5eee746..0ce3ac6 100644 --- a/mkspecs/win32-mwc/qplatformdefs.h +++ b/mkspecs/win32-mwc/qplatformdefs.h @@ -5,7 +5,37 @@ ** ** This file is part of the qmake spec of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp index 23b2c50..0325264 100644 --- a/qmake/generators/symbian/initprojectdeploy_symbian.cpp +++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.h b/qmake/generators/symbian/initprojectdeploy_symbian.h index c4adde4..0aad431 100644 --- a/qmake/generators/symbian/initprojectdeploy_symbian.h +++ b/qmake/generators/symbian/initprojectdeploy_symbian.h @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index 5c9ec13..039eacb 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/qmake/generators/symbian/symmake.h b/qmake/generators/symbian/symmake.h index 06732b5..cc1aa9b 100644 --- a/qmake/generators/symbian/symmake.h +++ b/qmake/generators/symbian/symmake.h @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp index aee9745..32d08f6 100644 --- a/qmake/generators/symbian/symmake_abld.cpp +++ b/qmake/generators/symbian/symmake_abld.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/qmake/generators/symbian/symmake_abld.h b/qmake/generators/symbian/symmake_abld.h index 18cbb9e..d323813 100644 --- a/qmake/generators/symbian/symmake_abld.h +++ b/qmake/generators/symbian/symmake_abld.h @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp index 5afa83d..33431d2 100644 --- a/qmake/generators/symbian/symmake_sbsv2.cpp +++ b/qmake/generators/symbian/symmake_sbsv2.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/qmake/generators/symbian/symmake_sbsv2.h b/qmake/generators/symbian/symmake_sbsv2.h index 8f6183a..e55d177 100644 --- a/qmake/generators/symbian/symmake_sbsv2.h +++ b/qmake/generators/symbian/symmake_sbsv2.h @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/qmake/qpopen.cpp b/qmake/qpopen.cpp index 3b0e2da..ebde035 100644 --- a/qmake/qpopen.cpp +++ b/qmake/qpopen.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/qmake/qpopen.h b/qmake/qpopen.h index c739e92..e15830d 100644 --- a/qmake/qpopen.h +++ b/qmake/qpopen.h @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/corelib/arch/qatomic_symbian.h b/src/corelib/arch/qatomic_symbian.h index 902b320..9b8b341 100644 --- a/src/corelib/arch/qatomic_symbian.h +++ b/src/corelib/arch/qatomic_symbian.h @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/corelib/arch/symbian/qatomic_symbian.cpp b/src/corelib/arch/symbian/qatomic_symbian.cpp index bcb0bd4..170b737 100644 --- a/src/corelib/arch/symbian/qatomic_symbian.cpp +++ b/src/corelib/arch/symbian/qatomic_symbian.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/corelib/io/qfilesystemwatcher_symbian.cpp b/src/corelib/io/qfilesystemwatcher_symbian.cpp index 883b70f..b1a6188 100644 --- a/src/corelib/io/qfilesystemwatcher_symbian.cpp +++ b/src/corelib/io/qfilesystemwatcher_symbian.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/corelib/io/qfilesystemwatcher_symbian_p.h b/src/corelib/io/qfilesystemwatcher_symbian_p.h index b34418a..9919114 100644 --- a/src/corelib/io/qfilesystemwatcher_symbian_p.h +++ b/src/corelib/io/qfilesystemwatcher_symbian_p.h @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/corelib/io/qprocess_symbian.cpp b/src/corelib/io/qprocess_symbian.cpp index ae7f51a..a59976c 100644 --- a/src/corelib/io/qprocess_symbian.cpp +++ b/src/corelib/io/qprocess_symbian.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/corelib/kernel/qcore_symbian_p.cpp b/src/corelib/kernel/qcore_symbian_p.cpp index 19c1510..4f18490 100644 --- a/src/corelib/kernel/qcore_symbian_p.cpp +++ b/src/corelib/kernel/qcore_symbian_p.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/corelib/kernel/qcore_symbian_p.h b/src/corelib/kernel/qcore_symbian_p.h index a7d2ce4..3b974c3 100644 --- a/src/corelib/kernel/qcore_symbian_p.h +++ b/src/corelib/kernel/qcore_symbian_p.h @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp index d745406..30b865e 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian.cpp +++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/corelib/kernel/qeventdispatcher_symbian_p.h b/src/corelib/kernel/qeventdispatcher_symbian_p.h index 393749f..64ea282 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian_p.h +++ b/src/corelib/kernel/qeventdispatcher_symbian_p.h @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/corelib/kernel/qsharedmemory_symbian.cpp b/src/corelib/kernel/qsharedmemory_symbian.cpp index afb161c..b3b50e3 100644 --- a/src/corelib/kernel/qsharedmemory_symbian.cpp +++ b/src/corelib/kernel/qsharedmemory_symbian.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/corelib/kernel/qsystemsemaphore_symbian.cpp b/src/corelib/kernel/qsystemsemaphore_symbian.cpp index 0c138c4..cd5c3ff 100644 --- a/src/corelib/kernel/qsystemsemaphore_symbian.cpp +++ b/src/corelib/kernel/qsystemsemaphore_symbian.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp index 625988a..52e2fe7 100644 --- a/src/gui/image/qpixmap_s60.cpp +++ b/src/gui/image/qpixmap_s60.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ #include diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h index 50f8a12..c2677b1 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_p.h +++ b/src/gui/inputmethod/qcoefepinputcontext_p.h @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 8612e55..92018e7 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 5b2c1fb..dbf592f 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/kernel/qclipboard_s60.cpp b/src/gui/kernel/qclipboard_s60.cpp index ec595b5..f89f3e5 100644 --- a/src/gui/kernel/qclipboard_s60.cpp +++ b/src/gui/kernel/qclipboard_s60.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/kernel/qcursor_s60.cpp b/src/gui/kernel/qcursor_s60.cpp index 4d3f067..a281130 100644 --- a/src/gui/kernel/qcursor_s60.cpp +++ b/src/gui/kernel/qcursor_s60.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/kernel/qdesktopwidget_s60.cpp b/src/gui/kernel/qdesktopwidget_s60.cpp index d57d289..eefd0ef 100644 --- a/src/gui/kernel/qdesktopwidget_s60.cpp +++ b/src/gui/kernel/qdesktopwidget_s60.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/kernel/qdnd_s60.cpp b/src/gui/kernel/qdnd_s60.cpp index 09605be..c459f8f 100644 --- a/src/gui/kernel/qdnd_s60.cpp +++ b/src/gui/kernel/qdnd_s60.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/kernel/qeventdispatcher_s60.cpp b/src/gui/kernel/qeventdispatcher_s60.cpp index 862f4ef..6ac2863 100644 --- a/src/gui/kernel/qeventdispatcher_s60.cpp +++ b/src/gui/kernel/qeventdispatcher_s60.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/kernel/qeventdispatcher_s60_p.h b/src/gui/kernel/qeventdispatcher_s60_p.h index fec8773..e42af95 100644 --- a/src/gui/kernel/qeventdispatcher_s60_p.h +++ b/src/gui/kernel/qeventdispatcher_s60_p.h @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/kernel/qkeymapper_s60.cpp b/src/gui/kernel/qkeymapper_s60.cpp index 2919551..bb074c1 100644 --- a/src/gui/kernel/qkeymapper_s60.cpp +++ b/src/gui/kernel/qkeymapper_s60.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/kernel/qsound_s60.cpp b/src/gui/kernel/qsound_s60.cpp index 2ac7e26..7eb6463 100644 --- a/src/gui/kernel/qsound_s60.cpp +++ b/src/gui/kernel/qsound_s60.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index 4eac35e..aed8241 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 5c3055d..11cb974 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/painting/qpaintdevice_s60.cpp b/src/gui/painting/qpaintdevice_s60.cpp index ec1b765..a2c4499 100644 --- a/src/gui/painting/qpaintdevice_s60.cpp +++ b/src/gui/painting/qpaintdevice_s60.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/painting/qregion_s60.cpp b/src/gui/painting/qregion_s60.cpp index 4504118..4d96910 100644 --- a/src/gui/painting/qregion_s60.cpp +++ b/src/gui/painting/qregion_s60.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp index 2618ce2..2a20b44 100644 --- a/src/gui/painting/qwindowsurface_s60.cpp +++ b/src/gui/painting/qwindowsurface_s60.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/painting/qwindowsurface_s60_p.h b/src/gui/painting/qwindowsurface_s60_p.h index 7b70fd5..40a866d 100644 --- a/src/gui/painting/qwindowsurface_s60_p.h +++ b/src/gui/painting/qwindowsurface_s60_p.h @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index b0ba30b..1d4fb3f 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/styles/qs60style.h b/src/gui/styles/qs60style.h index 945e182..f5335fe 100644 --- a/src/gui/styles/qs60style.h +++ b/src/gui/styles/qs60style.h @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index 22b01f6..6eb5da2 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index b6ad0ac..ddc3d61 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/styles/qs60style_symbian.cpp b/src/gui/styles/qs60style_symbian.cpp index ddee4ba..cffda85 100644 --- a/src/gui/styles/qs60style_symbian.cpp +++ b/src/gui/styles/qs60style_symbian.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/text/qfont_s60.cpp b/src/gui/text/qfont_s60.cpp index 2606091..533e51f 100644 --- a/src/gui/text/qfont_s60.cpp +++ b/src/gui/text/qfont_s60.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp index 0b4567c..ab9291f 100644 --- a/src/gui/text/qfontdatabase_s60.cpp +++ b/src/gui/text/qfontdatabase_s60.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp index eec09f4..1408f37 100644 --- a/src/gui/text/qfontengine_s60.cpp +++ b/src/gui/text/qfontengine_s60.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/text/qfontengine_s60_p.h b/src/gui/text/qfontengine_s60_p.h index ef4a508..2998de8 100644 --- a/src/gui/text/qfontengine_s60_p.h +++ b/src/gui/text/qfontengine_s60_p.h @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/util/qdesktopservices_s60.cpp b/src/gui/util/qdesktopservices_s60.cpp index a32a91c..a30e2ed 100644 --- a/src/gui/util/qdesktopservices_s60.cpp +++ b/src/gui/util/qdesktopservices_s60.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index 86affe3..b8ad654 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -4,7 +4,37 @@ ** Contact: Qt Software Information (qt-info@nokia.com) ** ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/network/kernel/qnetworkinterface_symbian.cpp b/src/network/kernel/qnetworkinterface_symbian.cpp index 82c673f..59f1c02 100644 --- a/src/network/kernel/qnetworkinterface_symbian.cpp +++ b/src/network/kernel/qnetworkinterface_symbian.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/plugins/s60/src/qdesktopservices_3_1.cpp b/src/plugins/s60/src/qdesktopservices_3_1.cpp index 1b7edbd..0551a74 100644 --- a/src/plugins/s60/src/qdesktopservices_3_1.cpp +++ b/src/plugins/s60/src/qdesktopservices_3_1.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/plugins/s60/src/qdesktopservices_3_2.cpp b/src/plugins/s60/src/qdesktopservices_3_2.cpp index 679b370..7695f00 100644 --- a/src/plugins/s60/src/qdesktopservices_3_2.cpp +++ b/src/plugins/s60/src/qdesktopservices_3_2.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/plugins/s60/src/qlocale_3_1.cpp b/src/plugins/s60/src/qlocale_3_1.cpp index 95cf244..b2e6a5d 100644 --- a/src/plugins/s60/src/qlocale_3_1.cpp +++ b/src/plugins/s60/src/qlocale_3_1.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/plugins/s60/src/qlocale_3_2.cpp b/src/plugins/s60/src/qlocale_3_2.cpp index fe1d642..ab3040b 100644 --- a/src/plugins/s60/src/qlocale_3_2.cpp +++ b/src/plugins/s60/src/qlocale_3_2.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/s60main/qts60main.cpp b/src/s60main/qts60main.cpp index 1d19cc6..965c02b 100644 --- a/src/s60main/qts60main.cpp +++ b/src/s60main/qts60main.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/s60main/qts60main_mcrt0.cpp b/src/s60main/qts60main_mcrt0.cpp index 10a784a..b7bf1a3 100644 --- a/src/s60main/qts60main_mcrt0.cpp +++ b/src/s60main/qts60main_mcrt0.cpp @@ -2,7 +2,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_3RDPARTY_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/s60main/qts60mainapplication.cpp b/src/s60main/qts60mainapplication.cpp index 807b5af..680243f 100644 --- a/src/s60main/qts60mainapplication.cpp +++ b/src/s60main/qts60mainapplication.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/s60main/qts60mainapplication.h b/src/s60main/qts60mainapplication.h index 318f83b..70b6909 100644 --- a/src/s60main/qts60mainapplication.h +++ b/src/s60main/qts60mainapplication.h @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/s60main/qts60mainappui.cpp b/src/s60main/qts60mainappui.cpp index dafbe96..1e064ac 100644 --- a/src/s60main/qts60mainappui.cpp +++ b/src/s60main/qts60mainappui.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/s60main/qts60mainappui.h b/src/s60main/qts60mainappui.h index 3addb0c..d988b91 100644 --- a/src/s60main/qts60mainappui.h +++ b/src/s60main/qts60mainappui.h @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/s60main/qts60maindocument.cpp b/src/s60main/qts60maindocument.cpp index 9ab426d..b4a2e66 100644 --- a/src/s60main/qts60maindocument.cpp +++ b/src/s60main/qts60maindocument.cpp @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/s60main/qts60maindocument.h b/src/s60main/qts60maindocument.h index 4979e7f..a95e620 100644 --- a/src/s60main/qts60maindocument.h +++ b/src/s60main/qts60maindocument.h @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/s60main/s60main.rss b/src/s60main/s60main.rss index 569f59e..6e8004c 100644 --- a/src/s60main/s60main.rss +++ b/src/s60main/s60main.rss @@ -5,7 +5,37 @@ ** ** This file is part of the $MODULE$ of the Qt Toolkit. ** -** $TROLLTECH_DUAL_EMBEDDED_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ -- cgit v0.12 From 6545932efa45ea2b8fbc1459d760ec5f15c63120 Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 29 May 2009 14:42:35 +0200 Subject: Revert "Changed the behavior of ImCursorPosition slightly." This reverts commit ce02d0e9e0ad8d8ac47e4f3ee95bac5cb74ed184. This turned out not to be enough for proper selection support together with S60 FEP. Instead we will revert the behavior and add new API. --- doc/src/qnamespace.qdoc | 2 -- src/gui/text/qtextcontrol.cpp | 2 +- src/gui/widgets/qlineedit.cpp | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/src/qnamespace.qdoc b/doc/src/qnamespace.qdoc index fc0598f..a7663f8 100644 --- a/doc/src/qnamespace.qdoc +++ b/doc/src/qnamespace.qdoc @@ -2429,8 +2429,6 @@ \value ImMicroFocus The rectangle covering the area of the input cursor in widget coordinates. \value ImFont The currently used font for text input. \value ImCursorPosition The logical position of the cursor within the text surrounding the input area (see ImSurroundingText). - If any text is selected, the position returned will be at the logical end of the - selection, even if the real cursor is located at the logical start. \value ImSurroundingText The plain text around the input area, for example the current paragraph. \value ImCurrentSelection The currently selected text. \value ImMaximumTextLength The maximum number of characters that the widget can hold. If there is no limit, QVariant() is returned. diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp index c74af23..f6092bb 100644 --- a/src/gui/text/qtextcontrol.cpp +++ b/src/gui/text/qtextcontrol.cpp @@ -1865,7 +1865,7 @@ QVariant QTextControl::inputMethodQuery(Qt::InputMethodQuery property) const case Qt::ImFont: return QVariant(d->cursor.charFormat().font()); case Qt::ImCursorPosition: - return QVariant(d->cursor.selectionEnd() - block.position()); + return QVariant(d->cursor.position() - block.position()); case Qt::ImSurroundingText: return QVariant(block.text()); case Qt::ImCurrentSelection: diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp index 0d8e16f..61b8786 100644 --- a/src/gui/widgets/qlineedit.cpp +++ b/src/gui/widgets/qlineedit.cpp @@ -2337,7 +2337,7 @@ QVariant QLineEdit::inputMethodQuery(Qt::InputMethodQuery property) const case Qt::ImFont: return font(); case Qt::ImCursorPosition: - return QVariant((d->selend - d->selstart == 0) ? d->cursor : d->selend); + return QVariant(d->cursor); case Qt::ImSurroundingText: return QVariant(d->text); case Qt::ImCurrentSelection: -- cgit v0.12 From a12eaad983da3caa30babd36a0e5c527588b2602 Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 29 May 2009 14:45:16 +0200 Subject: Small doc fix. --- doc/src/qnamespace.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/qnamespace.qdoc b/doc/src/qnamespace.qdoc index a7663f8..cd06700 100644 --- a/doc/src/qnamespace.qdoc +++ b/doc/src/qnamespace.qdoc @@ -2428,7 +2428,7 @@ \value ImMicroFocus The rectangle covering the area of the input cursor in widget coordinates. \value ImFont The currently used font for text input. - \value ImCursorPosition The logical position of the cursor within the text surrounding the input area (see ImSurroundingText). + \value ImCursorPosition The logical position of the cursor within the text surrounding the input area (see \c ImSurroundingText). \value ImSurroundingText The plain text around the input area, for example the current paragraph. \value ImCurrentSelection The currently selected text. \value ImMaximumTextLength The maximum number of characters that the widget can hold. If there is no limit, QVariant() is returned. -- cgit v0.12 From 4948f4b188c6aa40e628d74d6d6fce747ee535bd Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 2 Jun 2009 15:26:43 +0200 Subject: open pipes in overlapped mode also on the client side otherwise PeekNamedPipe() may block in threaded environments. Reviewed-by: thiago --- src/network/socket/qlocalsocket_win.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp index 39c9284..ace3bc5 100644 --- a/src/network/socket/qlocalsocket_win.cpp +++ b/src/network/socket/qlocalsocket_win.cpp @@ -144,7 +144,7 @@ void QLocalSocket::connectToServer(const QString &name, OpenMode openMode) 0, // no sharing NULL, // default security attributes OPEN_EXISTING, // opens existing pipe - 0, // default attributes + FILE_FLAG_OVERLAPPED, NULL); // no template file }, { localSocket = CreateFileA( @@ -153,7 +153,7 @@ void QLocalSocket::connectToServer(const QString &name, OpenMode openMode) 0, // no sharing NULL, // default security attributes OPEN_EXISTING, // opens existing pipe - 0, // default attributes + FILE_FLAG_OVERLAPPED, NULL); // no template file }); if (localSocket != INVALID_HANDLE_VALUE) -- cgit v0.12 From 61926772f3c628baefbfe61c28004ffb9ae2b175 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 2 Jun 2009 18:17:13 +0200 Subject: centralize removeServer() invocation for some more determinism --- tests/auto/qlocalsocket/tst_qlocalsocket.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp index deabda6..12be540 100644 --- a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp @@ -113,8 +113,6 @@ tst_QLocalSocket::tst_QLocalSocket() #endif )) qWarning() << "lackey executable doesn't exists!"; - - QLocalServer::removeServer("tst_localsocket"); } tst_QLocalSocket::~tst_QLocalSocket() @@ -139,7 +137,13 @@ public: LocalServer() : QLocalServer() { connect(this, SIGNAL(newConnection()), this, SLOT(slotNewConnection())); - }; + } + + bool listen(const QString &name) + { + removeServer(name); + return QLocalServer::listen(name); + } QList hits; @@ -528,7 +532,7 @@ void tst_QLocalSocket::sendData() // QLocalSocket/Server can take a name or path, check that it works as expected void tst_QLocalSocket::fullPath() { - QLocalServer server; + LocalServer server; QString name = "qlocalsocket_pathtest"; #if defined(QT_LOCALSOCKET_TCP) QString path = "QLocalServer"; @@ -822,7 +826,7 @@ void tst_QLocalSocket::removeServer() void tst_QLocalSocket::recycleServer() { - QLocalServer server; + LocalServer server; QLocalSocket client; QVERIFY(server.listen("recycletest1")); -- cgit v0.12 From 517ebf6f06db90a46d62c397d8e4c940cd7ac62b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 2 Jun 2009 13:05:13 +0200 Subject: fix lithuanian plural rules --- tools/linguist/shared/numerus.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/linguist/shared/numerus.cpp b/tools/linguist/shared/numerus.cpp index f3a29cc..dd9c5ee 100644 --- a/tools/linguist/shared/numerus.cpp +++ b/tools/linguist/shared/numerus.cpp @@ -74,7 +74,7 @@ static const uchar macedonianRules[] = Q_MOD_10 | Q_EQ, 2 }; static const uchar lithuanianRules[] = { Q_MOD_10 | Q_EQ, 1, Q_AND, Q_MOD_100 | Q_NEQ, 11, Q_NEWRULE, - Q_MOD_10 | Q_EQ, 2, Q_AND, Q_MOD_100 | Q_NOT_BETWEEN, 10, 19 }; + Q_MOD_10 | Q_NEQ, 0, Q_AND, Q_MOD_100 | Q_NOT_BETWEEN, 10, 19 }; static const uchar russianStyleRules[] = { Q_MOD_10 | Q_EQ, 1, Q_AND, Q_MOD_100 | Q_NEQ, 11, Q_NEWRULE, Q_MOD_10 | Q_BETWEEN, 2, 4, Q_AND, Q_MOD_100 | Q_NOT_BETWEEN, 10, 19 }; @@ -112,7 +112,7 @@ static const char * const irishStyleForms[] = { "Singular", "Dual", "Plural", 0 static const char * const czechForms[] = { "Singular", "Dual", "Plural", 0 }; static const char * const slovakForms[] = { "Singular", "Dual", "Plural", 0 }; static const char * const macedonianForms[] = { "Singular", "Dual", "Plural", 0 }; -static const char * const lithuanianForms[] = { "Singular", "Dual", "Plural", 0 }; +static const char * const lithuanianForms[] = { "Singular", "Paucal", "Plural", 0 }; static const char * const russianStyleForms[] = { "Singular", "Dual", "Plural", 0 }; static const char * const polishForms[] = { "Singular", "Paucal", "Plural", 0 }; static const char * const romanianForms[] = -- cgit v0.12 From 70be10968c8f547b464b3150ba582766e679ec7d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 2 Jun 2009 14:11:31 +0200 Subject: fix icelandic plural forms --- tools/linguist/shared/numerus.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/linguist/shared/numerus.cpp b/tools/linguist/shared/numerus.cpp index dd9c5ee..8ca6ef6 100644 --- a/tools/linguist/shared/numerus.cpp +++ b/tools/linguist/shared/numerus.cpp @@ -60,6 +60,8 @@ static const uchar frenchStyleRules[] = static const uchar latvianRules[] = { Q_MOD_10 | Q_EQ, 1, Q_AND, Q_MOD_100 | Q_NEQ, 11, Q_NEWRULE, Q_NEQ, 0 }; +static const uchar icelandicRules[] = + { Q_MOD_10 | Q_EQ, 1, Q_AND, Q_MOD_100 | Q_NEQ, 11 }; static const uchar irishStyleRules[] = { Q_EQ, 1, Q_NEWRULE, Q_EQ, 2 }; @@ -107,6 +109,7 @@ static const uchar arabicRules[] = static const char * const japaneseStyleForms[] = { "Universal Form", 0 }; static const char * const englishStyleForms[] = { "Singular", "Plural", 0 }; static const char * const frenchStyleForms[] = { "Singular", "Plural", 0 }; +static const char * const icelandicForms[] = { "Singular", "Plural", 0 }; static const char * const latvianForms[] = { "Singular", "Plural", "Nullar", 0 }; static const char * const irishStyleForms[] = { "Singular", "Dual", "Plural", 0 }; static const char * const czechForms[] = { "Singular", "Dual", "Plural", 0 }; @@ -190,7 +193,6 @@ static const QLocale::Language englishStyleLanguages[] = { QLocale::Hausa, QLocale::Hebrew, QLocale::Hindi, - QLocale::Icelandic, QLocale::Interlingua, QLocale::Interlingue, QLocale::Italian, @@ -261,6 +263,7 @@ static const QLocale::Language frenchStyleLanguages[] = { EOL }; static const QLocale::Language latvianLanguage[] = { QLocale::Latvian, EOL }; +static const QLocale::Language icelandicLanguage[] = { QLocale::Icelandic, EOL }; static const QLocale::Language irishStyleLanguages[] = { QLocale::Divehi, QLocale::Gaelic, @@ -320,6 +323,7 @@ static const NumerusTableEntry numerusTable[] = { { frenchStyleRules, sizeof(frenchStyleRules), frenchStyleForms, frenchStyleLanguages, frenchStyleCountries }, { latvianRules, sizeof(latvianRules), latvianForms, latvianLanguage, 0 }, + { icelandicRules, sizeof(icelandicRules), icelandicForms, icelandicLanguage, 0 }, { irishStyleRules, sizeof(irishStyleRules), irishStyleForms, irishStyleLanguages, 0 }, { czechRules, sizeof(czechRules), czechForms, czechLanguage, 0 }, { slovakRules, sizeof(slovakRules), slovakForms, slovakLanguage, 0 }, -- cgit v0.12 From a9472cb582fe155dd21f7bd3189afb64d5b08ab8 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 2 Jun 2009 14:40:51 +0200 Subject: fix tagalog plural forms --- tools/linguist/shared/numerus.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/linguist/shared/numerus.cpp b/tools/linguist/shared/numerus.cpp index 8ca6ef6..239b4c7 100644 --- a/tools/linguist/shared/numerus.cpp +++ b/tools/linguist/shared/numerus.cpp @@ -105,6 +105,9 @@ static const uchar arabicRules[] = Q_EQ, 2, Q_NEWRULE, Q_MOD_100 | Q_BETWEEN, 3, 10, Q_NEWRULE, Q_MOD_100 | Q_NEQ, 0 }; +static const uchar tagalogRules[] = + { Q_LEQ, 1, Q_NEWRULE, + Q_MOD_10 | Q_EQ, 4, Q_OR, Q_MOD_10 | Q_EQ, 6, Q_OR, Q_MOD_10 | Q_EQ, 9 }; static const char * const japaneseStyleForms[] = { "Universal Form", 0 }; static const char * const englishStyleForms[] = { "Singular", "Plural", 0 }; @@ -127,6 +130,8 @@ static const char * const welshForms[] = { "Nullar", "Singular", "Dual", "Sexal", "Plural", 0 }; static const char * const arabicForms[] = { "Nullar", "Singular", "Dual", "Minority Plural", "Plural", "Plural Form for 100, 200, ...", 0 }; +static const char * const tagalogForms[] = + { "Singular", "Plural (consonant-ended)", "Plural (vowel-ended)", 0 }; #define EOL QLocale::C @@ -233,7 +238,6 @@ static const QLocale::Language englishStyleLanguages[] = { QLocale::Spanish, QLocale::Swahili, QLocale::Swedish, - QLocale::Tagalog, QLocale::Tajik, QLocale::Tamil, QLocale::Tatar, @@ -301,6 +305,7 @@ static const QLocale::Language slovenianLanguage[] = { QLocale::Slovenian, EOL } static const QLocale::Language malteseLanguage[] = { QLocale::Maltese, EOL }; static const QLocale::Language welshLanguage[] = { QLocale::Welsh, EOL }; static const QLocale::Language arabicLanguage[] = { QLocale::Arabic, EOL }; +static const QLocale::Language tagalogLanguage[] = { QLocale::Tagalog, EOL }; static const QLocale::Country frenchStyleCountries[] = { // keep synchronized with frenchStyleLanguages @@ -335,7 +340,8 @@ static const NumerusTableEntry numerusTable[] = { { slovenianRules, sizeof(slovenianRules), slovenianForms, slovenianLanguage, 0 }, { malteseRules, sizeof(malteseRules), malteseForms, malteseLanguage, 0 }, { welshRules, sizeof(welshRules), welshForms, welshLanguage, 0 }, - { arabicRules, sizeof(arabicRules), arabicForms, arabicLanguage, 0 } + { arabicRules, sizeof(arabicRules), arabicForms, arabicLanguage, 0 }, + { tagalogRules, sizeof(tagalogRules), tagalogForms, tagalogLanguage, 0 } }; static const int NumerusTableSize = sizeof(numerusTable) / sizeof(numerusTable[0]); -- cgit v0.12 From 4cc2d62669b1638d34b6588bd3b164fb17138596 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 2 Jun 2009 14:42:24 +0200 Subject: fix turkish plural forms --- tools/linguist/shared/numerus.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/linguist/shared/numerus.cpp b/tools/linguist/shared/numerus.cpp index 239b4c7..3a06065 100644 --- a/tools/linguist/shared/numerus.cpp +++ b/tools/linguist/shared/numerus.cpp @@ -155,6 +155,7 @@ static const QLocale::Language japaneseStyleLanguages[] = { QLocale::Sundanese, QLocale::Thai, QLocale::Tibetan, + QLocale::Turkish, QLocale::Vietnamese, QLocale::Yoruba, QLocale::Zhuang, @@ -244,7 +245,6 @@ static const QLocale::Language englishStyleLanguages[] = { QLocale::Telugu, QLocale::TongaLanguage, QLocale::Tsonga, - QLocale::Turkish, QLocale::Turkmen, QLocale::Twi, QLocale::Uigur, -- cgit v0.12 From 78b44fdb2b505833a9b60fcd63e1fe8c8a59d9ed Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 3 Jun 2009 11:14:46 +0200 Subject: drop traditional czech plural rules in favor of today's slovak-like rules --- tools/linguist/shared/numerus.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tools/linguist/shared/numerus.cpp b/tools/linguist/shared/numerus.cpp index 3a06065..408877f 100644 --- a/tools/linguist/shared/numerus.cpp +++ b/tools/linguist/shared/numerus.cpp @@ -65,9 +65,6 @@ static const uchar icelandicRules[] = static const uchar irishStyleRules[] = { Q_EQ, 1, Q_NEWRULE, Q_EQ, 2 }; -static const uchar czechRules[] = - { Q_MOD_100 | Q_EQ, 1, Q_NEWRULE, - Q_MOD_100 | Q_BETWEEN, 2, 4 }; static const uchar slovakRules[] = { Q_EQ, 1, Q_NEWRULE, Q_BETWEEN, 2, 4 }; @@ -115,7 +112,6 @@ static const char * const frenchStyleForms[] = { "Singular", "Plural", 0 }; static const char * const icelandicForms[] = { "Singular", "Plural", 0 }; static const char * const latvianForms[] = { "Singular", "Plural", "Nullar", 0 }; static const char * const irishStyleForms[] = { "Singular", "Dual", "Plural", 0 }; -static const char * const czechForms[] = { "Singular", "Dual", "Plural", 0 }; static const char * const slovakForms[] = { "Singular", "Dual", "Plural", 0 }; static const char * const macedonianForms[] = { "Singular", "Dual", "Plural", 0 }; static const char * const lithuanianForms[] = { "Singular", "Paucal", "Plural", 0 }; @@ -281,8 +277,7 @@ static const QLocale::Language irishStyleLanguages[] = { QLocale::Sanskrit, EOL }; -static const QLocale::Language czechLanguage[] = { QLocale::Czech, EOL }; -static const QLocale::Language slovakLanguage[] = { QLocale::Slovak, EOL }; +static const QLocale::Language slovakLanguages[] = { QLocale::Slovak, QLocale::Czech, EOL }; static const QLocale::Language macedonianLanguage[] = { QLocale::Macedonian, EOL }; static const QLocale::Language lithuanianLanguage[] = { QLocale::Lithuanian, EOL }; static const QLocale::Language russianStyleLanguages[] = { @@ -330,8 +325,7 @@ static const NumerusTableEntry numerusTable[] = { { latvianRules, sizeof(latvianRules), latvianForms, latvianLanguage, 0 }, { icelandicRules, sizeof(icelandicRules), icelandicForms, icelandicLanguage, 0 }, { irishStyleRules, sizeof(irishStyleRules), irishStyleForms, irishStyleLanguages, 0 }, - { czechRules, sizeof(czechRules), czechForms, czechLanguage, 0 }, - { slovakRules, sizeof(slovakRules), slovakForms, slovakLanguage, 0 }, + { slovakRules, sizeof(slovakRules), slovakForms, slovakLanguages, 0 }, { macedonianRules, sizeof(macedonianRules), macedonianForms, macedonianLanguage, 0 }, { lithuanianRules, sizeof(lithuanianRules), lithuanianForms, lithuanianLanguage, 0 }, { russianStyleRules, sizeof(russianStyleRules), russianStyleForms, russianStyleLanguages, 0 }, -- cgit v0.12 From 3e663dcad5e9fbfd2a5466d464747a1a87f036b3 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 3 Jun 2009 11:06:14 +0200 Subject: rename some plural forms --- tools/linguist/shared/numerus.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/linguist/shared/numerus.cpp b/tools/linguist/shared/numerus.cpp index 408877f..2fe1c78 100644 --- a/tools/linguist/shared/numerus.cpp +++ b/tools/linguist/shared/numerus.cpp @@ -112,16 +112,15 @@ static const char * const frenchStyleForms[] = { "Singular", "Plural", 0 }; static const char * const icelandicForms[] = { "Singular", "Plural", 0 }; static const char * const latvianForms[] = { "Singular", "Plural", "Nullar", 0 }; static const char * const irishStyleForms[] = { "Singular", "Dual", "Plural", 0 }; -static const char * const slovakForms[] = { "Singular", "Dual", "Plural", 0 }; +static const char * const slovakForms[] = { "Singular", "Paucal", "Plural", 0 }; static const char * const macedonianForms[] = { "Singular", "Dual", "Plural", 0 }; static const char * const lithuanianForms[] = { "Singular", "Paucal", "Plural", 0 }; static const char * const russianStyleForms[] = { "Singular", "Dual", "Plural", 0 }; static const char * const polishForms[] = { "Singular", "Paucal", "Plural", 0 }; -static const char * const romanianForms[] = - { "Singular", "Plural Form for 2 to 19", "Plural", 0 }; +static const char * const romanianForms[] = { "Singular", "Paucal", "Plural", 0 }; static const char * const slovenianForms[] = { "Singular", "Dual", "Trial", "Plural", 0 }; static const char * const malteseForms[] = - { "Singular", "Plural Form for 2 to 10", "Plural Form for 11 to 19", "Plural", 0 }; + { "Singular", "Paucal", "Greater Paucal", "Plural", 0 }; static const char * const welshForms[] = { "Nullar", "Singular", "Dual", "Sexal", "Plural", 0 }; static const char * const arabicForms[] = -- cgit v0.12 From b2d43b06d1c1debcd42afbc7dfd85c4991c670d5 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Wed, 3 Jun 2009 12:49:29 +0200 Subject: Added automatic creation for symbian os if softkeystack is enabled. This circumvents the need to go and change every example to explicitly start using softkeystack --- src/gui/widgets/qmainwindow.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index 6843d4e..37b1398 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -121,6 +121,9 @@ void QMainWindowPrivate::init() explicitIconSize = false; q->setAttribute(Qt::WA_Hover); +#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_SOFTKEYSTACK) + softKeyStack = new QSoftKeyStack(q); +#endif } /* -- cgit v0.12 From ae5b1555676cef4058157431c3af2e7ff9ead8ce Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Wed, 3 Jun 2009 12:58:08 +0200 Subject: Doc - minor fixes to beautify the sentence Reviewed-By: TrustMe --- doc/src/tutorials/addressbook.qdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/tutorials/addressbook.qdoc b/doc/src/tutorials/addressbook.qdoc index 3ec883f..15fdd83 100644 --- a/doc/src/tutorials/addressbook.qdoc +++ b/doc/src/tutorials/addressbook.qdoc @@ -374,8 +374,8 @@ \snippet tutorials/addressbook/part2/addressbook.cpp submitContact part2 If the contact already exists, again, we display a QMessageBox to inform - the user about this, to prevent the user from adding duplicate contacts. - Our \c contacts object is based on key-value pairs of name and addresses, + the user about this, preventing the user from adding duplicate contacts. + Our \c contacts object is based on key-value pairs of name and address, hence, we want to ensure that \e key is unique. \o Once we have handled both cases mentioned above, we restore the push -- cgit v0.12 From 259b65c2f5d736dd7f6d81b6390f54464dd5f183 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 2 Jun 2009 18:16:37 +0200 Subject: BT: qt demo takes 100% of the cpu on X11 The tick timer is always active, even if the moving gree Qt logo is not visible. But the code that is supposed to pause it when the app loose the focus doesn't works if the moving Qt logo is not visible. Also the call to syncX makes Xorg takes lot of cpu. It doesn't fix the fact that the timer is still running while the green logo is not visible, but at least doesn't take the cpu anymore if qtdemo loose the focus. Task-number: 255020 Reviewed-by: Richard Moe Gustavsen --- demos/qtdemo/colors.cpp | 2 +- demos/qtdemo/mainwindow.cpp | 13 ++----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/demos/qtdemo/colors.cpp b/demos/qtdemo/colors.cpp index 41bbfb3..883b0fb 100644 --- a/demos/qtdemo/colors.cpp +++ b/demos/qtdemo/colors.cpp @@ -97,7 +97,7 @@ bool Colors::noTickerMorph = false; bool Colors::adapted = false; bool Colors::verbose = false; bool Colors::pause = true; -int Colors::fps = 100; +int Colors::fps = 60; int Colors::menuCount = 18; float Colors::animSpeed = 1.0; float Colors::animSpeedButtons = 1.0; diff --git a/demos/qtdemo/mainwindow.cpp b/demos/qtdemo/mainwindow.cpp index 8723823..16ca95f 100644 --- a/demos/qtdemo/mainwindow.cpp +++ b/demos/qtdemo/mainwindow.cpp @@ -190,7 +190,6 @@ void MainWindow::switchTimerOnOff(bool on) if (on && !Colors::noTimerUpdate){ this->useTimer = true; - this->setViewportUpdateMode(QGraphicsView::NoViewportUpdate); this->fpsTime = QTime::currentTime(); this->updateTimer.start(int(1000 / Colors::fps)); } @@ -262,10 +261,6 @@ void MainWindow::tick() if (MenuManager::instance()->ticker) MenuManager::instance()->ticker->tick(); - this->viewport()->update(); - if (Colors::softwareRendering) - QApplication::syncX(); - if (this->useTimer) this->updateTimer.start(int(1000 / Colors::fps)); } @@ -435,9 +430,7 @@ void MainWindow::focusInEvent(QFocusEvent *) if (MenuManager::instance()->ticker) MenuManager::instance()->ticker->pause(false); - int code = MenuManager::instance()->currentMenuCode; - if (code == MenuManager::ROOT || code == MenuManager::MENU1) - this->switchTimerOnOff(true); + this->switchTimerOnOff(true); this->pausedLabel->setRecursiveVisible(false); } @@ -450,9 +443,7 @@ void MainWindow::focusOutEvent(QFocusEvent *) if (MenuManager::instance()->ticker) MenuManager::instance()->ticker->pause(true); - int code = MenuManager::instance()->currentMenuCode; - if (code == MenuManager::ROOT || code == MenuManager::MENU1) - this->switchTimerOnOff(false); + this->switchTimerOnOff(false); this->pausedLabel->setRecursiveVisible(true); } -- cgit v0.12 From 2e4cadc9a1bb70350259360d1cc8fc00be424414 Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 29 May 2009 14:46:22 +0200 Subject: Added new API Qt::ImAnchorPosition. This is required for S60 FEP. RevBy: Simon Hausmann --- doc/src/qnamespace.qdoc | 1 + src/corelib/global/qnamespace.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/src/qnamespace.qdoc b/doc/src/qnamespace.qdoc index cd06700..c063670 100644 --- a/doc/src/qnamespace.qdoc +++ b/doc/src/qnamespace.qdoc @@ -2432,6 +2432,7 @@ \value ImSurroundingText The plain text around the input area, for example the current paragraph. \value ImCurrentSelection The currently selected text. \value ImMaximumTextLength The maximum number of characters that the widget can hold. If there is no limit, QVariant() is returned. + \value ImAnchorPosition The position of the selection anchor. This may be less or greater than \c ImCursorPosition, depending on which side of selection the cursor is. If there is no selection, it returns the same as \c ImCursorPosition. */ /*! diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 75524a0..43740ed 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1395,7 +1395,8 @@ public: ImCursorPosition, ImSurroundingText, ImCurrentSelection, - ImMaximumTextLength + ImMaximumTextLength, + ImAnchorPosition }; enum InputMethodHint { -- cgit v0.12 From 6989d6438e4fbc78dfbda7ac3326826a2301adaa Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 29 May 2009 14:47:54 +0200 Subject: Added new API QInputMethodEvent::Selection. This is required for S60 FEP. RevBy: Simon Hausmann --- src/gui/kernel/qevent.cpp | 11 +++++++++++ src/gui/kernel/qevent.h | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 2aed287..ba85eea 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -1665,6 +1665,17 @@ Qt::ButtonState QContextMenuEvent::state() const several are specified for any character in the string the behaviour is undefined. + \value Selection + If set, the edit cursor should be moved to the specified position + in the editor text contents. In contrast with \c Cursor, this + attribute does not work on the preedit text, but on the surrounding + text. The cursor will be moved after the commit string has been + committed, and the preedit string will be located at the new edit + position. + The start position specifies the new position and the length + variable can be used to set a selection starting from that point. + The value is unused. + \sa Attribute */ diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index 2724315..7696d05 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -424,7 +424,8 @@ public: TextFormat, Cursor, Language, - Ruby + Ruby, + Selection }; class Attribute { public: -- cgit v0.12 From 7b95b70bc307288bd8ba2b84108f91fdea315826 Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 29 May 2009 15:09:18 +0200 Subject: Made QLineEdit respect the new QInputMethodEvent::Selection. RevBy: Simon Hausmann AutoTest: Will add in later commit --- src/gui/widgets/qlineedit.cpp | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp index 61b8786..c031098 100644 --- a/src/gui/widgets/qlineedit.cpp +++ b/src/gui/widgets/qlineedit.cpp @@ -2274,8 +2274,15 @@ void QLineEdit::inputMethodEvent(QInputMethodEvent *e) } #endif - int priorState = d->undoState; - d->removeSelectedText(); + int priorState = 0; + bool isGettingInput = !e->commitString().isEmpty() || !e->preeditString().isEmpty(); + bool cursorPositionChanged = false; + + if (isGettingInput) { + // If any text is being input, remove selected text. + priorState = d->undoState; + d->removeSelectedText(); + } int c = d->cursor; // cursor position after insertion of commit string if (e->replacementStart() <= 0) @@ -2289,11 +2296,30 @@ void QLineEdit::inputMethodEvent(QInputMethodEvent *e) d->selend = d->selstart + e->replacementLength(); d->removeSelectedText(); } - if (!e->commitString().isEmpty()) + if (!e->commitString().isEmpty()) { d->insert(e->commitString()); + cursorPositionChanged = true; + } d->cursor = qMin(c, d->text.length()); + for (int i = 0; i < e->attributes().size(); ++i) { + const QInputMethodEvent::Attribute &a = e->attributes().at(i); + if (a.type == QInputMethodEvent::Selection) { + d->cursor = qBound(0, a.start + a.length, d->text.length()); + if (a.length) { + d->selstart = qMax(0, qMin(a.start, d->text.length())); + d->selend = d->cursor; + if (d->selend < d->selstart) { + qSwap(d->selstart, d->selend); + } + } else { + d->selstart = d->selend = 0; + } + cursorPositionChanged = true; + } + } + d->textLayout.setPreeditArea(d->cursor, e->preeditString()); d->preeditCursor = e->preeditString().length(); d->hideCursor = false; @@ -2317,9 +2343,12 @@ void QLineEdit::inputMethodEvent(QInputMethodEvent *e) d->textLayout.setAdditionalFormats(formats); d->updateTextLayout(); update(); - if (!e->commitString().isEmpty()) + if (cursorPositionChanged) d->emitCursorPositionChanged(); - d->finishChange(priorState); + + if (isGettingInput) + d->finishChange(priorState); + #ifndef QT_NO_COMPLETER if (!e->commitString().isEmpty()) d->complete(Qt::Key_unknown); -- cgit v0.12 From 0cd99b1b5363a0e06dd660ba0322ef216481f8f7 Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 29 May 2009 15:10:38 +0200 Subject: Made QLineEdit respect the new Qt::ImAnchorPosition. RevBy: Trust me AutoTest: Will add in later commit --- src/gui/widgets/qlineedit.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp index c031098..d9e39d3 100644 --- a/src/gui/widgets/qlineedit.cpp +++ b/src/gui/widgets/qlineedit.cpp @@ -2373,6 +2373,13 @@ QVariant QLineEdit::inputMethodQuery(Qt::InputMethodQuery property) const return QVariant(selectedText()); case Qt::ImMaximumTextLength: return QVariant(maxLength()); + case Qt::ImAnchorPosition: + if (d->selstart == d->selend) + return QVariant(d->cursor); + else if (d->selstart == d->cursor) + return QVariant(d->selend); + else + return QVariant(d->selstart); default: return QVariant(); } -- cgit v0.12 From 48e3dc574f24f31d9506e7fcf2ec53e1c9638684 Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 29 May 2009 15:12:13 +0200 Subject: Made S60 FEP use the new QInputMethodEvent::Selection API. --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 92018e7..bdc79a8 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -636,13 +636,13 @@ void QCoeFepInputContext::SetCursorSelectionForFepL(const TCursorSelection& aCur if (!w) return; - int pos = w->inputMethodQuery(Qt::ImCursorPosition).toInt() + aCursorSelection.iCursorPos + 1; + int pos = aCursorSelection.iAnchorPos; + int length = aCursorSelection.iCursorPos - pos; QList attributes; - attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, pos, 1, QVariant()); + attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, pos, length, QVariant()); QInputMethodEvent event(m_preeditString, attributes); - // ### FIXME Sets preeditcursor and not cursor. Probably needs new API. - //sendEvent(event); + sendEvent(event); } void QCoeFepInputContext::GetCursorSelectionForFep(TCursorSelection& aCursorSelection) const -- cgit v0.12 From 6c153af95d45ad58fe4bca60b5494addd3ede821 Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 29 May 2009 15:12:49 +0200 Subject: Made S60 FEP use the new Qt::ImAnchorPosition API. --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index bdc79a8..6faf792 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -651,9 +651,8 @@ void QCoeFepInputContext::GetCursorSelectionForFep(TCursorSelection& aCursorSele if (!w) return; - QVariant cursorVar = w->inputMethodQuery(Qt::ImCursorPosition); - int cursor = cursorVar.toInt() + m_preeditString.size(); - int anchor = cursor - w->inputMethodQuery(Qt::ImCurrentSelection).toString().size(); + int cursor = w->inputMethodQuery(Qt::ImCursorPosition).toInt() + m_preeditString.size(); + int anchor = w->inputMethodQuery(Qt::ImAnchorPosition).toInt() + m_preeditString.size(); aCursorSelection.iAnchorPos = anchor; aCursorSelection.iCursorPos = cursor; } -- cgit v0.12 From d9bdb8bf50de5ee3fcd8d9de62f41ad52aacebb3 Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 29 May 2009 15:49:00 +0200 Subject: Fixed an autotest that was left behind when API was updated. --- tests/auto/qinputcontext/tst_qinputcontext.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/qinputcontext/tst_qinputcontext.cpp b/tests/auto/qinputcontext/tst_qinputcontext.cpp index 444b400..90ab071 100644 --- a/tests/auto/qinputcontext/tst_qinputcontext.cpp +++ b/tests/auto/qinputcontext/tst_qinputcontext.cpp @@ -142,12 +142,12 @@ void tst_QInputContext::requestSoftwareInputPanel() QApplication::setActiveWindow(&w); // Testing single click panel activation. - QApplication::setTwoClicksToRequestSIP(false); + qApp->setAutoSipOnMouseFocus(true); QTest::mouseClick(le2, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5)); QCOMPARE(ic2->lastType, QEvent::RequestSoftwareInputPanel); // Testing double click panel activation. - QApplication::setTwoClicksToRequestSIP(true); + qApp->setAutoSipOnMouseFocus(false); QTest::mouseClick(le1, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5)); QVERIFY(ic1->lastType != QEvent::RequestSoftwareInputPanel); QTest::mouseClick(le1, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5)); -- cgit v0.12 From c651bff5e560dc495896002ce773b418a05b69a1 Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 29 May 2009 15:49:38 +0200 Subject: Added an autotest for the new selection API in input methods. --- tests/auto/qinputcontext/tst_qinputcontext.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/auto/qinputcontext/tst_qinputcontext.cpp b/tests/auto/qinputcontext/tst_qinputcontext.cpp index 90ab071..444672e 100644 --- a/tests/auto/qinputcontext/tst_qinputcontext.cpp +++ b/tests/auto/qinputcontext/tst_qinputcontext.cpp @@ -66,6 +66,7 @@ private slots: void filterMouseEvents(); void requestSoftwareInputPanel(); void closeSoftwareInputPanel(); + void selections(); }; void tst_QInputContext::maximumTextLength() @@ -191,5 +192,23 @@ void tst_QInputContext::closeSoftwareInputPanel() QCOMPARE(ic2->lastType, QEvent::CloseSoftwareInputPanel); } +void tst_QInputContext::selections() +{ + QLineEdit le; + le.setText("Test text"); + le.setSelection(2, 2); + QCOMPARE(le.inputMethodQuery(Qt::ImCursorPosition).toInt(), 4); + QCOMPARE(le.inputMethodQuery(Qt::ImAnchorPosition).toInt(), 2); + + QList attributes; + attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 5, 3, QVariant())); + QInputMethodEvent event("", attributes); + QApplication::sendEvent(&le, &event); + QCOMPARE(le.cursorPosition(), 8); + QCOMPARE(le.selectionStart(), 5); + QCOMPARE(le.inputMethodQuery(Qt::ImCursorPosition).toInt(), 8); + QCOMPARE(le.inputMethodQuery(Qt::ImAnchorPosition).toInt(), 5); +} + QTEST_MAIN(tst_QInputContext) #include "tst_qinputcontext.moc" -- cgit v0.12 From 3592724b1f7e635904c31ba09a61d6b7259c93e5 Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 3 Jun 2009 13:11:29 +0200 Subject: Fixed failing test case. We are not guaranteed that the checked-for event is the last event, so we look for it in a list instead. --- tests/auto/qinputcontext/tst_qinputcontext.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/auto/qinputcontext/tst_qinputcontext.cpp b/tests/auto/qinputcontext/tst_qinputcontext.cpp index 444672e..67a6819 100644 --- a/tests/auto/qinputcontext/tst_qinputcontext.cpp +++ b/tests/auto/qinputcontext/tst_qinputcontext.cpp @@ -87,7 +87,7 @@ void tst_QInputContext::maximumTextLength() class QFilterInputContext : public QInputContext { public: - QFilterInputContext() : lastType(QEvent::None) {} + QFilterInputContext() {} ~QFilterInputContext() {} QString identifierName() { return QString(); } @@ -99,12 +99,12 @@ public: bool filterEvent( const QEvent *event ) { - lastType = event->type(); + lastTypes.append(event->type()); return false; } public: - QEvent::Type lastType; + QList lastTypes; }; void tst_QInputContext::filterMouseEvents() @@ -117,7 +117,7 @@ void tst_QInputContext::filterMouseEvents() le.setInputContext(ic); QTest::mouseClick(&le, Qt::LeftButton); - QCOMPARE(ic->lastType, QEvent::MouseButtonRelease); + QVERIFY(ic->lastTypes.indexOf(QEvent::MouseButtonRelease) >= 0); le.setInputContext(0); } @@ -145,18 +145,20 @@ void tst_QInputContext::requestSoftwareInputPanel() // Testing single click panel activation. qApp->setAutoSipOnMouseFocus(true); QTest::mouseClick(le2, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5)); - QCOMPARE(ic2->lastType, QEvent::RequestSoftwareInputPanel); + QVERIFY(ic2->lastTypes.indexOf(QEvent::RequestSoftwareInputPanel) >= 0); + ic2->lastTypes.clear(); // Testing double click panel activation. qApp->setAutoSipOnMouseFocus(false); QTest::mouseClick(le1, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5)); - QVERIFY(ic1->lastType != QEvent::RequestSoftwareInputPanel); + QVERIFY(ic1->lastTypes.indexOf(QEvent::RequestSoftwareInputPanel) < 0); QTest::mouseClick(le1, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5)); - QCOMPARE(ic1->lastType, QEvent::RequestSoftwareInputPanel); + QVERIFY(ic1->lastTypes.indexOf(QEvent::RequestSoftwareInputPanel) >= 0); + ic1->lastTypes.clear(); // Testing right mouse button QTest::mouseClick(le1, Qt::RightButton, Qt::NoModifier, QPoint(5, 5)); - QVERIFY(ic1->lastType != QEvent::RequestSoftwareInputPanel); + QVERIFY(ic1->lastTypes.indexOf(QEvent::RequestSoftwareInputPanel) < 0); } void tst_QInputContext::closeSoftwareInputPanel() @@ -185,11 +187,11 @@ void tst_QInputContext::closeSoftwareInputPanel() // Testing that panel doesn't close between two input methods aware widgets. QTest::mouseClick(le1, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5)); QTest::mouseClick(le2, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5)); - QVERIFY(ic2->lastType != QEvent::CloseSoftwareInputPanel); + QVERIFY(ic2->lastTypes.indexOf(QEvent::CloseSoftwareInputPanel) < 0); // Testing that panel closes when focusing non-aware widget. QTest::mouseClick(rb, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5)); - QCOMPARE(ic2->lastType, QEvent::CloseSoftwareInputPanel); + QVERIFY(ic2->lastTypes.indexOf(QEvent::CloseSoftwareInputPanel) >= 0); } void tst_QInputContext::selections() -- cgit v0.12 From 34d003341c5286354e8277a4cc33182c94549ac0 Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Wed, 3 Jun 2009 13:21:21 +0200 Subject: Fix BOM for UTF-32 codec The BOM was created correctly, but half of the BOM was then overwritten by the converted data afterwards. Also made the autotest also do reverse encoding tests where possible. Task-number: 255095 Reviewed-by: lars --- src/corelib/codecs/qutfcodec.cpp | 2 +- tests/auto/qtextcodec/tst_qtextcodec.cpp | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp index 1ac592e..d9defe1 100644 --- a/src/corelib/codecs/qutfcodec.cpp +++ b/src/corelib/codecs/qutfcodec.cpp @@ -478,7 +478,7 @@ QByteArray QUtf32Codec::convertFromUnicode(const QChar *uc, int len, ConverterSt data[2] = 0; data[3] = 0; } - data += 2; + data += 4; } if (endian == BE) { for (int i = 0; i < len; ++i) { diff --git a/tests/auto/qtextcodec/tst_qtextcodec.cpp b/tests/auto/qtextcodec/tst_qtextcodec.cpp index cf4135b..566b20e 100644 --- a/tests/auto/qtextcodec/tst_qtextcodec.cpp +++ b/tests/auto/qtextcodec/tst_qtextcodec.cpp @@ -1537,7 +1537,7 @@ void tst_QTextCodec::utfHeaders_data() << QByteArray("\xef\xbb\xbfhello") << (QString(QChar(0xfeff)) + QString::fromLatin1("hello")) << true; - QTest::newRow("utf8 nobom") + QTest::newRow("utf8 nobom ignore header") << QByteArray("UTF-8") << (int)QTextCodec::IgnoreHeader << QByteArray("hello") @@ -1718,14 +1718,23 @@ void tst_QTextCodec::utfHeaders() QFETCH(bool, toUnicode); + QLatin1String ignoreReverseTestOn = (QSysInfo::ByteOrder == QSysInfo::BigEndian) ? QLatin1String(" le") : QLatin1String(" be"); + QString rowName(QTest::currentDataTag()); + for (int i = 0; i < encoded.length(); ++i) qDebug() << hex << " " << (uint)(uchar)encoded.at(i); if (toUnicode) { QString result = codec->toUnicode(encoded.constData(), encoded.length(), &state); - for (int i = 0; i < result.length(); ++i) - qDebug() << hex << " " << (uint)result.at(i).unicode(); + for (int i = 0; i < result.length(); ++i) + qDebug() << hex << " " << (uint)result.at(i).unicode(); QCOMPARE(result.length(), unicode.length()); QCOMPARE(result, unicode); + + if (!rowName.endsWith("nobom") && !rowName.contains(ignoreReverseTestOn)) { + QTextCodec::ConverterState state2(cFlags); + QByteArray reencoded = codec->fromUnicode(unicode.unicode(), unicode.length(), &state2); + QCOMPARE(reencoded, encoded); + } } else { QByteArray result = codec->fromUnicode(unicode.unicode(), unicode.length(), &state); QCOMPARE(result, encoded); -- cgit v0.12 From 5b4036c9f6c7cb94d476257b96e4753765841f46 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 3 Jun 2009 15:00:04 +0300 Subject: Removed old workaround for S60 emulator deployment bug with saxbookmarks xbel files. --- demos/embedded/fluidlauncher/fluidlauncher.pro | 4 +- examples/xml/saxbookmarks/frankf.xbel | 230 ------------------------- examples/xml/saxbookmarks/jenniferf.xbel | 93 ---------- 3 files changed, 2 insertions(+), 325 deletions(-) delete mode 100644 examples/xml/saxbookmarks/frankf.xbel delete mode 100644 examples/xml/saxbookmarks/jenniferf.xbel diff --git a/demos/embedded/fluidlauncher/fluidlauncher.pro b/demos/embedded/fluidlauncher/fluidlauncher.pro index ed2530c..9c08801 100644 --- a/demos/embedded/fluidlauncher/fluidlauncher.pro +++ b/demos/embedded/fluidlauncher/fluidlauncher.pro @@ -127,8 +127,8 @@ symbian { desktopservices_images.sources = $$PWD/../desktopservices/data/*.png desktopservices_images.path = /data/images - saxbookmarks.sources = $$PWD/../../../examples/xml/saxbookmarks/frankf.xbel - saxbookmarks.sources += $$PWD/../../../examples/xml/saxbookmarks/jenniferf.xbel + saxbookmarks.sources = $$PWD/../../../examples/xml/saxbookmarks/frank.xbel + saxbookmarks.sources += $$PWD/../../../examples/xml/saxbookmarks/jennifer.xbel saxbookmarks.path = /data/qt/saxbookmarks DEPLOYMENT += config files executables viewerimages saxbookmarks reg_resource resource \ diff --git a/examples/xml/saxbookmarks/frankf.xbel b/examples/xml/saxbookmarks/frankf.xbel deleted file mode 100644 index 07a9463..0000000 --- a/examples/xml/saxbookmarks/frankf.xbel +++ /dev/null @@ -1,230 +0,0 @@ - - - - - Literate Programming - - Synopsis of Literate Programming - - - Literate Programming: Propaganda and Tools - - - Literate Programming by Henrik Turbell - - - Literate Programming Library - - - Literate Programming Basics - - - Literate Programming Overview - - - POD is not Literate Programming - - - Computers That We Can Count On - - - Literate Programming - Issues and Problems - - - Literate Programming - Wiki Pages - - - What is well-commented code? - - - Bibliography on literate programming - A searchable bibliography - - - Program comprehension and code reading bibliography - - - Elucidative Programming - - - AVL Trees (TexiWeb) - - - Literate Programming on Wikiverse - - - Physically Based Rendering: From Theory to Implementation - - - - Useful C++ Links - - STL - - STL Reference Documentation - - - STL Tutorial - - - STL Reference - - - - Qt - - Qt 2.3 Reference - - - Qt 3.3 Reference - - - Qt 4.0 Reference - - - Trolltech Home Page - - - - IOStreams - - IO Stream Library - - - Binary I/O - - - I/O Stream FAQ - - - - gdb - - GDB Tutorial - - - Debugging with GDB - - - GDB Quick Reference Page (PDF) (Handy) - - - - Classes and Constructors - - Constructor FAQ - - - Organizing Classes - - - - - Software Documentation or System Documentation - - The Almighty Thud - - - Microsoft Coding Techniques and Programming Practices - - - Software and Documentation - - - The Source Code is the Design - - - What is Software Design? - - - How To Write Unmaintainable Code - - - Self Documenting Program Code Remains a Distant Goal - - - Place Tab A in Slot B - - - UML Reference Card - - - - TeX Resources - - The TeX User's Group - - - MikTeX website - - - MetaPost website - - - HEVEA is a quite complete and fast LATEX to HTML translator - - - - Portable Document Format (PDF) - - Adobe - The postscript and PDF standards - - - Reference Manual Portable Document Format - - - Adobe Acrobat Software Development Kit - - - - Literature Sites - - Guide to Special Collections (Columbia University) - - - Literary Criticism on the Web from the Internet Public Library - - - Victorian Web. - - - Voice of the Shuttle. - - - Modernist Journals Project - - - Museum of American Poetics - - - Modern American Poetry - - - FindArticles.com - - - Literary History - - - Literary Encyclopedia - - - - The University of California Press - - - Wright American Fiction, 1851-1875 - - - Documenting the American South: Beginnings to 1920 - - - Electronic Text Center at the University of Virginia - - - The Schomburg Center for Research in Black Culture - - - Alex Catalogue of Electronic Texts. - - - diff --git a/examples/xml/saxbookmarks/jenniferf.xbel b/examples/xml/saxbookmarks/jenniferf.xbel deleted file mode 100644 index 1f7810b..0000000 --- a/examples/xml/saxbookmarks/jenniferf.xbel +++ /dev/null @@ -1,93 +0,0 @@ - - - - - Qt Resources - - Trolltech Partners - - Training Partners - - - Consultants and System Integrators - - - Technology Partners - - - Value Added Resellers (VARs) - - - - Community Resources - - QtForum.org - - - The Independent Qt Tutorial - - - French PROG.Qt - - - German Qt Forum - - - Korean Qt Community Site - - - Russian Qt Forum - - - Digitalfanatics: The QT 4 Resource Center - - - QtQuestions - - - - Qt Quarterly - - - Trolltech's home page - - - Qt 4.0 documentation - - - Frequently Asked Questions - - - - Online Dictionaries - - Dictionary.com - - - Merriam-Webster Online - - - Cambridge Dictionaries Online - - - OneLook Dictionary Search - - - - The New English-German Dictionary - - - TU Chemnitz German-English Dictionary - - - - Trésor de la Langue Française informatisé - - - Dictionnaire de l'Académie Française - - - Dictionnaire des synonymes - - - -- cgit v0.12 From d16b52d5346a3b652ad7507b24373c51fc0d530c Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Wed, 3 Jun 2009 13:49:22 +0200 Subject: Doc - some sentence clean ups Reviewed-by: TrustMe --- doc/src/tutorials/addressbook.qdoc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/src/tutorials/addressbook.qdoc b/doc/src/tutorials/addressbook.qdoc index 15fdd83..bf202b2 100644 --- a/doc/src/tutorials/addressbook.qdoc +++ b/doc/src/tutorials/addressbook.qdoc @@ -296,8 +296,8 @@ We also declare two private QString objects, \c oldName and \c oldAddress. These objects are needed to hold the name and address of the contact that - was last displayed, before the user clicked "Add". So, when the user clicks - "Cancel", we can revert to displaying the details of the last contact. + was last displayed, before the user clicked \gui Add. So, when the user clicks + \gui Cancel, we can revert to displaying the details of the last contact. \section1 Implementing the AddressBook Class @@ -318,7 +318,7 @@ The \c addButton is displayed by invoking the \l{QPushButton::show()} {show()} function, while the \c submitButton and \c cancelButton are hidden by invoking \l{QPushButton::hide()}{hide()}. These two push - buttons will only be displayed when the user clicks "Add" and this is + buttons will only be displayed when the user clicks \gui Add and this is handled by the \c addContact() function discussed below. \snippet tutorials/addressbook/part2/addressbook.cpp connecting signals and slots @@ -362,7 +362,7 @@ \list 1 \o We extract the contact's details from \c nameLine and \c addressText and store them in QString objects. We also validate to make sure that the - user did not click "Submit" with empty input fields; otherwise, a + user did not click \gui Submit with empty input fields; otherwise, a QMessageBox is displayed to remind the user for a name and address. \snippet tutorials/addressbook/part2/addressbook.cpp submitContact part1 @@ -396,9 +396,9 @@ \snippet tutorials/addressbook/part2/addressbook.cpp cancel - The general idea to add a contact is to give the user the flexibility to - click "Submit" or "Cancel" at any time. The flowchart below further - explains this concept: + The general idea behind adding a contact is to give the user the + flexibility to click \gui Submit or \gui Cancel at any time. The flowchart below + further explains this concept: \image addressbook-tutorial-part2-add-flowchart.png */ -- cgit v0.12 From 91f5c7314afdfd43c867266fc1bc418e0f70bac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 3 Jun 2009 14:16:39 +0200 Subject: Fixed raster bug causing fully clipped images to be partially blended. The blend functions assume the width / height of the images being blended to be greater than 0. A width of 0 caused the first iteration of a duff's device memcpy (QT_MEMCPY_USHORT) to be executed, thus blending 8 pixels instead of none. BT: yes Task-number: 255014 Reviewed-by: Trond --- src/gui/painting/qpaintengine_raster.cpp | 4 ++-- tests/auto/qpainter/tst_qpainter.cpp | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 58ffb02..1a1c204 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -1053,7 +1053,7 @@ void QRasterPaintEnginePrivate::drawImage(const QPointF &pt, int d = x + iw - cx2; iw -= d; } - if (iw < 0) + if (iw <= 0) return; // adapt the y paremeters... @@ -1070,7 +1070,7 @@ void QRasterPaintEnginePrivate::drawImage(const QPointF &pt, int d = y + ih - cy2; ih -= d; } - if (ih < 0) + if (ih <= 0) return; // call the blend function... diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp index 87f9c13..8d6c9d2 100644 --- a/tests/auto/qpainter/tst_qpainter.cpp +++ b/tests/auto/qpainter/tst_qpainter.cpp @@ -215,6 +215,7 @@ private slots: void imageCoordinateLimit(); void imageBlending_data(); void imageBlending(); + void imageBlending_clipped(); void paintOnNullPixmap(); void checkCompositionMode(); @@ -3792,6 +3793,31 @@ void tst_QPainter::imageBlending() } } +void tst_QPainter::imageBlending_clipped() +{ + QImage src(20, 20, QImage::Format_RGB16); + QPainter p(&src); + p.fillRect(src.rect(), Qt::red); + p.end(); + + QImage dst(40, 20, QImage::Format_RGB16); + p.begin(&dst); + p.fillRect(dst.rect(), Qt::white); + p.end(); + + QImage expected = dst; + + p.begin(&dst); + p.setClipRect(QRect(23, 0, 20, 20)); + + // should be completely clipped + p.drawImage(QRectF(3, 0, 20, 20), src); + p.end(); + + // dst should be left unchanged + QCOMPARE(dst, expected); +} + void tst_QPainter::paintOnNullPixmap() { QPixmap pix(16, 16); -- cgit v0.12 From 9db0d28080b4b08ef484e2fb767e20a2754f537d Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 3 Jun 2009 14:31:57 +0200 Subject: Fixed QFontEngineS60::boundingBox. It was actually returning the tight bounding rect, before. --- src/gui/text/qfontengine_s60.cpp | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp index eec09f4..3862b36 100644 --- a/src/gui/text/qfontengine_s60.cpp +++ b/src/gui/text/qfontengine_s60.cpp @@ -197,27 +197,14 @@ QImage QFontEngineS60::alphaMapForGlyph(glyph_t glyph) glyph_metrics_t QFontEngineS60::boundingBox(const QGlyphLayout &glyphs) { - glyph_metrics_t overall; - // initialize with line height, we get the same behaviour on all platforms - overall.y = -ascent(); - overall.height = ascent() + descent() + 1; - - QFixed ymax = 0; - QFixed xmax = 0; - for (int i = 0; i < glyphs.numGlyphs; i++) { - const glyph_metrics_t glyphBounds = boundingBox_const(glyphs.glyphs[i]); - QFixed x = overall.xoff + glyphs.offsets[i].x + glyphBounds.x; - QFixed y = overall.yoff + glyphs.offsets[i].y - glyphBounds.y; - overall.x = qMin(overall.x, x); - overall.y = qMin(overall.y, y); - xmax = qMax(xmax, x + glyphBounds.width); - ymax = qMax(ymax, y + glyphBounds.height); - overall.xoff += glyphBounds.xoff; - } - overall.height = qMax(overall.height, ymax - overall.y); - overall.width = xmax - overall.x; + if (glyphs.numGlyphs == 0) + return glyph_metrics_t(); + + QFixed w = 0; + for (int i = 0; i < glyphs.numGlyphs; ++i) + w += glyphs.effectiveAdvance(i); - return overall; + return glyph_metrics_t(0, -ascent(), w, ascent()+descent()+1, w, 0); } glyph_metrics_t QFontEngineS60::boundingBox_const(glyph_t glyph) const -- cgit v0.12 From 00685bd4a38333e1d13861ecccaab43744009ae3 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 3 Jun 2009 15:34:44 +0300 Subject: Removed DEPENDS keyword from resource blocks of generated mmp files from symbian-abld builds. --- qmake/generators/symbian/symmake.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index c5f13f6..68d544b 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -805,8 +805,9 @@ bool SymbianMakefileGenerator::writeMmpFileResourcePart(QTextStream& t, QStringL t << "SOURCEPATH\t\t\t. " << endl; t << "START RESOURCE\t\t" << regTarget << endl; - t << "DEPENDS " << target << ".rsg" << endl; - t << "\tTARGETPATH\t\t" REGISTRATION_RESOURCE_DIRECTORY_HW << endl; + if (isForSymbianSbsv2()) + t << "DEPENDS " << target << ".rsg" << endl; + t << "TARGETPATH\t\t" REGISTRATION_RESOURCE_DIRECTORY_HW << endl; t << "END" << endl << endl; } return true; -- cgit v0.12 From c9c8742b20c025ad893bdde48cf382267e0b646e Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Wed, 3 Jun 2009 15:03:03 +0200 Subject: Allow qmake to compile using it's .pro file. This fixes a problem where qmake would not compile when it was built from it's .pro file because this method uses the pre-compiled header. This header was causing a compile error in qlocale.cpp because qtextstream.h was included and this includes qlocale.h. The problem in qlocale.cpp was that it uses a define called QLOCALE_CPP to enable extra functions in the class declaration, but the pre-compiled header was preventing the qlocale.h from being re-processed and therefore the function was never compiled in. Reviewed-by: Marius Storm-Olsen --- qmake/qmake_pch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/qmake_pch.h b/qmake/qmake_pch.h index 1fec856..676c806 100644 --- a/qmake/qmake_pch.h +++ b/qmake/qmake_pch.h @@ -53,7 +53,7 @@ //#include "meta.h" #include //#include "winmakefile.h" -#include +//#include //#include "project.h" #include #include -- cgit v0.12 From 826b2ec2067e725561db2892dd432c01f1d36bc7 Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Wed, 3 Jun 2009 15:25:46 +0200 Subject: BT: Fix a crash in the SDI example in Cocoa This was quite a bug and it showed to some issues that I hadn't taken into account when doing the initial port to Cocoa. The issue was that we weren't "merging" items into the application menu if an item had already been associated with it. Which seems OK for applications that create one window with one menubar, but breaks down horrible when you have multiple windows with each having their own menubar. The result is that items in the application menu potentially go to the wrong window (and the potential crash). Since there can only ever be one "Quit", "About", or "Preferences" menu item in Cocoa, we need to make sure that we keep these items in sync whenever we switch the menubar or remove actions that are being deleted. That's what we do here. FWIW, QActions with "ApplicationSpecificRole" for their menu role have potential to cause memory leaks or other bugs if abused. If you are a happy open source hacker who wants a thankless job, solving them would get you lots of goodwill in my book. Task-number: 255038 Reviewed-by: Richard Moe Gustavsen --- src/gui/widgets/qmenu_mac.mm | 52 +++++++++++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm index ad848c9..2560cfa 100644 --- a/src/gui/widgets/qmenu_mac.mm +++ b/src/gui/widgets/qmenu_mac.mm @@ -871,8 +871,6 @@ static NSMenuItem *qt_mac_menu_merge_action(OSMenuRef merge, QMacMenuAction *act } } - if ([ret tag] != 0) - ret = 0; // already taken #endif return ret; } @@ -1131,15 +1129,15 @@ QMenuPrivate::QMacMenuPrivate::addAction(QMacMenuAction *action, QMacMenuAction GetMenuItemAttributes(action->menu, itemCount , &testattr); if (mergedItems.contains(action->command) && (testattr & kMenuItemAttrSeparator)) { - InsertMenuItemTextWithCFString(action->menu, 0, qMax(itemCount - 1, 0), attr, action->command); - index = itemCount; - } else { - MenuItemIndex tmpIndex; - AppendMenuItemTextWithCFString(action->menu, 0, attr, action->command, &tmpIndex); - index = tmpIndex; - if (mergedItems.contains(action->command)) - AppendMenuItemTextWithCFString(action->menu, 0, kMenuItemAttrSeparator, 0, &tmpIndex); - } + InsertMenuItemTextWithCFString(action->menu, 0, qMax(itemCount - 1, 0), attr, action->command); + index = itemCount; + } else { + MenuItemIndex tmpIndex; + AppendMenuItemTextWithCFString(action->menu, 0, attr, action->command, &tmpIndex); + index = tmpIndex; + if (mergedItems.contains(action->command)) + AppendMenuItemTextWithCFString(action->menu, 0, kMenuItemAttrSeparator, 0, &tmpIndex); + } #else [menu addItem:newItem]; #endif @@ -1477,11 +1475,18 @@ QMenuPrivate::QMacMenuPrivate::removeAction(QMacMenuAction *action) DeleteMenuItem(action->menu, qt_mac_menu_find_action(action->menu, action)); #else QMacCocoaAutoReleasePool pool; - QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = getMenuLoader(); - if (action->menuItem == [loader quitMenuItem] || action->menuItem == [loader preferencesMenuItem]) - [action->menuItem setEnabled:false]; - else + if (action->merged) { + if (reinterpret_cast([action->menuItem tag]) == action->action) { + QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = getMenuLoader(); + [action->menuItem setEnabled:false]; + if (action->menuItem != [loader quitMenuItem] + && action->menuItem != [loader preferencesMenuItem]) { + [[action->menuItem menu] removeItem:action->menuItem]; + } + } + } else { [[action->menuItem menu] removeItem:action->menuItem]; + } #endif actionItems.removeAll(action); } @@ -1934,6 +1939,23 @@ bool QMenuBar::macUpdateMenuBar() [loader ensureAppMenuInMenu:menu]; [NSApp setMainMenu:menu]; syncMenuBarItemsVisiblity(mb->d_func()->mac_menubar); + + if (OSMenuRef tmpMerge = QMenuPrivate::mergeMenuHash.value(menu)) { + if (QMenuMergeList *mergeList + = QMenuPrivate::mergeMenuItemsHash.value(tmpMerge)) { + const int mergeListSize = mergeList->size(); + + for (int i = 0; i < mergeListSize; ++i) { + const QMenuMergeItem &mergeItem = mergeList->at(i); + // Ideally we would call QMenuPrivate::syncAction, but that requires finding + // the original QMen and likely doing more work than we need. + // For example, enabled is handled below. + [mergeItem.menuItem setTag:reinterpret_cast( + static_cast(mergeItem.action->action))]; + [mergeItem.menuItem setHidden:!(mergeItem.action->action->isVisible())]; + } + } + } #endif QWidget *modalWidget = qApp->activeModalWidget(); if (mb != menubars()->value(modalWidget)) { -- cgit v0.12 From 11e77b1e47d527a2c4bca6c72d4597bfd8b8a1c3 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 3 Jun 2009 14:28:55 +0200 Subject: use a yes/no message box for a yes/no question in http example Using a OK/Cancel message box is weird for a yes/no question, esp. on a Windows CE device where such a message box doesn't have real push buttons but must be OK'ed / cancelled via system buttons in the title bar. Task-number: 255112 Reviewed-by: thartman --- examples/network/http/httpwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/network/http/httpwindow.cpp b/examples/network/http/httpwindow.cpp index ebde770..7aded07 100644 --- a/examples/network/http/httpwindow.cpp +++ b/examples/network/http/httpwindow.cpp @@ -116,8 +116,8 @@ void HttpWindow::downloadFile() if (QMessageBox::question(this, tr("HTTP"), tr("There already exists a file called %1 in " "the current directory. Overwrite?").arg(fileName), - QMessageBox::Ok|QMessageBox::Cancel, QMessageBox::Cancel) - == QMessageBox::Cancel) + QMessageBox::Yes|QMessageBox::No, QMessageBox::No) + == QMessageBox::No) return; QFile::remove(fileName); } -- cgit v0.12 From c3cad947658ba2ea70e6b9335dd365192a6ed4c4 Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Wed, 3 Jun 2009 15:48:52 +0200 Subject: Make qmake compile from .pro on other platforms. The qpopen.cpp file is a workaround for the fact that the Metrowerks compiler that we are (ab)using to build Windows binaries is lacking a popen() function in the standard library. So only enable the workaround on the platform that needs it. --- qmake/qmake.pri | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qmake/qmake.pri b/qmake/qmake.pri index b51db32..4e58732 100644 --- a/qmake/qmake.pri +++ b/qmake/qmake.pri @@ -9,7 +9,6 @@ DEFINES += QT_NO_TEXTCODEC QT_NO_LIBRARY QT_NO_STL QT_NO_COMPRESS QT_NO_UNICODET SOURCES += project.cpp property.cpp main.cpp generators/makefile.cpp \ generators/unix/unixmake2.cpp generators/unix/unixmake.cpp meta.cpp \ option.cpp generators/win32/winmakefile.cpp generators/win32/mingw_make.cpp \ - qpopen.cpp \ generators/makefiledeps.cpp generators/metamakefile.cpp generators/mac/pbuilder_pbx.cpp \ generators/xmloutput.cpp generators/win32/borland_bmake.cpp \ generators/win32/msvc_nmake.cpp generators/projectgenerator.cpp \ @@ -19,6 +18,12 @@ SOURCES += project.cpp property.cpp main.cpp generators/makefile.cpp \ generators/symbian/symmake_abld.cpp \ generators/symbian/symmake_sbsv2.cpp \ generators/symbian/initprojectdeploy_symbian.cpp + +# MWC does not provide an implementation of popen() so fake it. +win32-mwc { + SOURCES += qpopen.cpp \ +} + HEADERS += project.h property.h generators/makefile.h \ generators/unix/unixmake.h meta.h option.h cachekeys.h \ -- cgit v0.12 From f1e471b561012f90938766c00aefff417593e71f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 3 Jun 2009 13:49:09 +0200 Subject: fix catalan plural rules --- src/corelib/kernel/qtranslator.cpp | 3 +++ src/corelib/kernel/qtranslator_p.h | 1 + tools/linguist/shared/numerus.cpp | 9 +++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp index 3e4b467..df904a6 100644 --- a/src/corelib/kernel/qtranslator.cpp +++ b/src/corelib/kernel/qtranslator.cpp @@ -149,6 +149,9 @@ static int numerusHelper(int n, const uchar *rules, int rulesSize) leftOperand %= 10; } else if (opcode & Q_MOD_100) { leftOperand %= 100; + } else if (opcode & Q_LEAD_1000) { + while (leftOperand >= 1000) + leftOperand /= 1000; } int op = opcode & Q_OP_MASK; diff --git a/src/corelib/kernel/qtranslator_p.h b/src/corelib/kernel/qtranslator_p.h index 77ec8f5..a7d58c5 100644 --- a/src/corelib/kernel/qtranslator_p.h +++ b/src/corelib/kernel/qtranslator_p.h @@ -62,6 +62,7 @@ enum { Q_NOT = 0x08, Q_MOD_10 = 0x10, Q_MOD_100 = 0x20, + Q_LEAD_1000 = 0x40, Q_AND = 0xFD, Q_OR = 0xFE, diff --git a/tools/linguist/shared/numerus.cpp b/tools/linguist/shared/numerus.cpp index 2fe1c78..50e85cb 100644 --- a/tools/linguist/shared/numerus.cpp +++ b/tools/linguist/shared/numerus.cpp @@ -105,6 +105,9 @@ static const uchar arabicRules[] = static const uchar tagalogRules[] = { Q_LEQ, 1, Q_NEWRULE, Q_MOD_10 | Q_EQ, 4, Q_OR, Q_MOD_10 | Q_EQ, 6, Q_OR, Q_MOD_10 | Q_EQ, 9 }; +static const uchar catalanRules[] = + { Q_EQ, 1, Q_NEWRULE, + Q_LEAD_1000 | Q_EQ, 11 }; static const char * const japaneseStyleForms[] = { "Universal Form", 0 }; static const char * const englishStyleForms[] = { "Singular", "Plural", 0 }; @@ -127,6 +130,7 @@ static const char * const arabicForms[] = { "Nullar", "Singular", "Dual", "Minority Plural", "Plural", "Plural Form for 100, 200, ...", 0 }; static const char * const tagalogForms[] = { "Singular", "Plural (consonant-ended)", "Plural (vowel-ended)", 0 }; +static const char * const catalanForms[] = { "Singular", "Undecal (11)", "Plural", 0 }; #define EOL QLocale::C @@ -173,7 +177,6 @@ static const QLocale::Language englishStyleLanguages[] = { // Missing: Bokmal, QLocale::Bulgarian, QLocale::Cambodian, - QLocale::Catalan, QLocale::Cornish, QLocale::Corsican, QLocale::Danish, @@ -300,6 +303,7 @@ static const QLocale::Language malteseLanguage[] = { QLocale::Maltese, EOL }; static const QLocale::Language welshLanguage[] = { QLocale::Welsh, EOL }; static const QLocale::Language arabicLanguage[] = { QLocale::Arabic, EOL }; static const QLocale::Language tagalogLanguage[] = { QLocale::Tagalog, EOL }; +static const QLocale::Language catalanLanguage[] = { QLocale::Catalan, EOL }; static const QLocale::Country frenchStyleCountries[] = { // keep synchronized with frenchStyleLanguages @@ -334,7 +338,8 @@ static const NumerusTableEntry numerusTable[] = { { malteseRules, sizeof(malteseRules), malteseForms, malteseLanguage, 0 }, { welshRules, sizeof(welshRules), welshForms, welshLanguage, 0 }, { arabicRules, sizeof(arabicRules), arabicForms, arabicLanguage, 0 }, - { tagalogRules, sizeof(tagalogRules), tagalogForms, tagalogLanguage, 0 } + { tagalogRules, sizeof(tagalogRules), tagalogForms, tagalogLanguage, 0 }, + { catalanRules, sizeof(catalanRules), catalanForms, catalanLanguage, 0 } }; static const int NumerusTableSize = sizeof(numerusTable) / sizeof(numerusTable[0]); -- cgit v0.12 From c1af1b23442f6d879d3f7eb8c193935f9887244a Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 3 Jun 2009 17:16:59 +0200 Subject: Fix merge --- src/gui/kernel/qapplication_s60.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 542ad43..3921331 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -** +1** ** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -1102,7 +1102,6 @@ void QApplication::symbianResourceChange(int type) #endif default: ->>>>>>> master:src/gui/kernel/qapplication_s60.cpp break; } } -- cgit v0.12 From 49b6219dd12815d5155aa28bd8d1dbf26cf0b1d7 Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 3 Jun 2009 17:13:29 +0200 Subject: Fixed a small input method bug in QLineEdit. We need to check for replacementLength as well. Otherwise there will be no undo information if text is deleted using input methods. --- src/gui/widgets/qlineedit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp index d9e39d3..a95d2f2 100644 --- a/src/gui/widgets/qlineedit.cpp +++ b/src/gui/widgets/qlineedit.cpp @@ -2275,7 +2275,8 @@ void QLineEdit::inputMethodEvent(QInputMethodEvent *e) #endif int priorState = 0; - bool isGettingInput = !e->commitString().isEmpty() || !e->preeditString().isEmpty(); + bool isGettingInput = !e->commitString().isEmpty() || !e->preeditString().isEmpty() + || e->replacementLength() > 0; bool cursorPositionChanged = false; if (isGettingInput) { -- cgit v0.12 From 34c1e57a003cea4f359c05f07b6f255132e97b5f Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 3 Jun 2009 17:15:55 +0200 Subject: Added inputMethodQuery fallback to QWidget. --- src/gui/kernel/qwidget.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 4fcedb4..955ac8b 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -8500,6 +8500,9 @@ QVariant QWidget::inputMethodQuery(Qt::InputMethodQuery query) const return QRect(width()/2, 0, 1, height()); case Qt::ImFont: return font(); + case Qt::ImAnchorPosition: + // Fallback. + return inputMethodQuery(Qt::ImCursorPosition); default: return QVariant(); } -- cgit v0.12 From ad0f42aa8f07b453e9ccfb960f24f40f4f00280d Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 3 Jun 2009 17:16:50 +0200 Subject: Gave QTextControl support for ImAnchorPosition and Selection. RevBy: Trust me The fix is almost identical to the one made for QLineEdit. --- src/gui/text/qtextcontrol.cpp | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp index f6092bb..482d50b 100644 --- a/src/gui/text/qtextcontrol.cpp +++ b/src/gui/text/qtextcontrol.cpp @@ -1813,13 +1813,18 @@ bool QTextControlPrivate::dropEvent(const QMimeData *mimeData, const QPointF &po void QTextControlPrivate::inputMethodEvent(QInputMethodEvent *e) { + Q_Q(QTextControl); if (!(interactionFlags & Qt::TextEditable) || cursor.isNull()) { e->ignore(); return; } - cursor.beginEditBlock(); + bool isGettingInput = !e->commitString().isEmpty() || !e->preeditString().isEmpty() + || e->replacementLength() > 0; - cursor.removeSelectedText(); + if (isGettingInput) { + cursor.beginEditBlock(); + cursor.removeSelectedText(); + } // insert commit string if (!e->commitString().isEmpty() || e->replacementLength()) { @@ -1829,6 +1834,17 @@ void QTextControlPrivate::inputMethodEvent(QInputMethodEvent *e) c.insertText(e->commitString()); } + for (int i = 0; i < e->attributes().size(); ++i) { + const QInputMethodEvent::Attribute &a = e->attributes().at(i); + if (a.type == QInputMethodEvent::Selection) { + QTextCursor oldCursor = cursor; + cursor.setPosition(a.start, QTextCursor::MoveAnchor); + cursor.setPosition(a.start + a.length, QTextCursor::KeepAnchor); + q->ensureCursorVisible(); + repaintOldAndNewSelection(oldCursor); + } + } + QTextBlock block = cursor.block(); QTextLayout *layout = block.layout(); layout->setPreeditArea(cursor.position() - block.position(), e->preeditString()); @@ -1852,7 +1868,9 @@ void QTextControlPrivate::inputMethodEvent(QInputMethodEvent *e) } } layout->setAdditionalFormats(overrides); - cursor.endEditBlock(); + + if (isGettingInput) + cursor.endEditBlock(); } QVariant QTextControl::inputMethodQuery(Qt::InputMethodQuery property) const @@ -1872,6 +1890,8 @@ QVariant QTextControl::inputMethodQuery(Qt::InputMethodQuery property) const return QVariant(d->cursor.selectedText()); case Qt::ImMaximumTextLength: return QVariant(); // No limit. + case Qt::ImAnchorPosition: + return QVariant(qBound(0, d->cursor.anchor() - block.position(), block.length())); default: return QVariant(); } -- cgit v0.12 From 3893a10158e3ef5bec79c55ad89666cdc4ad14f5 Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 3 Jun 2009 17:19:02 +0200 Subject: Fixed an update bug in QTextControl. Previously, the input context would not get updated on every selection update. --- src/gui/text/qtextcontrol.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp index 482d50b..6647558 100644 --- a/src/gui/text/qtextcontrol.cpp +++ b/src/gui/text/qtextcontrol.cpp @@ -1611,6 +1611,9 @@ void QTextControlPrivate::mouseMoveEvent(Qt::MouseButtons buttons, const QPointF if (cursor.position() != oldCursorPos) emit q->cursorPositionChanged(); _q_updateCurrentCharFormatAndSelection(); + if (QInputContext *ic = inputContext()) { + ic->update(); + } } else { //emit q->visibilityRequest(QRectF(mousePos, QSizeF(1, 1))); if (cursor.position() != oldCursorPos) -- cgit v0.12 From 4e7ab98ebd48cc1d5fa7643290e34ee166b9ab03 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 3 Jun 2009 19:30:39 +0200 Subject: Adding and removing a 'Cancel' SoftKey --- src/gui/widgets/qmenu.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index 6be0f19..c4db539 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -60,6 +60,9 @@ #ifndef QT_NO_WHATSTHIS # include #endif +#ifdef QT_KEYPAD_NAVIGATION +# include +#endif #include "qmenu_p.h" #include "qmenubar_p.h" @@ -578,8 +581,14 @@ void QMenuPrivate::setCurrentAction(QAction *action, int popup, SelectionReason //when the action has no QWidget, the QMenu itself should // get the focus // Since the menu is a pop-up, it uses the popup reason. - if (!q->hasFocus()) + if (!q->hasFocus()) { q->setFocus(Qt::PopupFocusReason); +#ifdef QT_KEYPAD_NAVIGATION + // TODO: aportale, remove KEYPAD_NAVIGATION_HACK when softkey stack + // handles focus related and user related actions separately... + QKeyEventSoftKey::addSoftKey(QSoftKeyAction::Cancel, Qt::Key_Back, q); +#endif + } } } } else { //action is a separator @@ -1937,6 +1946,9 @@ void QMenu::popup(const QPoint &p, QAction *atAction) #ifndef QT_NO_ACCESSIBILITY QAccessible::updateAccessibility(this, 0, QAccessible::PopupMenuStart); #endif +#ifdef QT_KEYPAD_NAVIGATION + QKeyEventSoftKey::addSoftKey(QSoftKeyAction::Cancel, Qt::Key_Back, this); +#endif } /*! @@ -2587,7 +2599,7 @@ void QMenu::keyPressEvent(QKeyEvent *e) case Qt::Key_Escape: #ifdef QT_KEYPAD_NAVIGATION case Qt::Key_Back: - case Qt::Key_Context2: // TODO: aportale, remove KEYPAD_NAVIGATION_HACK when softkey support is there + QKeyEventSoftKey::removeSoftkey(this); #endif key_consumed = true; if (d->tornoff) { -- cgit v0.12 From 4b37d772cd5c1098d38944a125b48751f4bb1280 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 3 Jun 2009 21:25:38 +0300 Subject: Fix to tst_QDateTimeEdit::mousePress test case. Checked datetimedit spinbox up location from style, instead of trying to guess the difference offsets. --- tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp index b975405..624d193 100644 --- a/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp +++ b/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp @@ -2213,21 +2213,16 @@ void tst_QDateTimeEdit::mousePress() testWidget->setDate(QDate(2004, 6, 23)); testWidget->setCurrentSection(QDateTimeEdit::YearSection); QCOMPARE(testWidget->currentSection(), QDateTimeEdit::YearSection); - int offset = 10; -#if defined(Q_OS_WINCE) - offset = 20; - if (qt_wince_is_pocket_pc()) { - // depending on wether the display is double-pixeld, we need - // to click at a different position - bool doubledSize = false; - int dpi = GetDeviceCaps(GetDC(0), LOGPIXELSX); - if ((dpi < 1000) && (dpi > 0)) - doubledSize = true; - offset = doubledSize ? 50 : 25; // On CE buttons are aligned horizontal - } -#endif - QTest::mouseClick(testWidget, Qt::LeftButton, 0, QPoint(testWidget->width() - offset, 5)); - QCOMPARE(testWidget->date().year(), 2005); + + // Ask the SC_SpinBoxUp button location from style + QStyleOptionSpinBox so; + so.rect = testWidget->rect(); + QRect rectUp = testWidget->style()->subControlRect(QStyle::CC_SpinBox, &so, QStyle::SC_SpinBoxUp, testWidget); + + // Send mouseClick to center of SC_SpinBoxUp + QTest::mouseClick(testWidget, Qt::LeftButton, 0, rectUp.center()); + QCOMPARE(testWidget->date().year(), 2005); + } void tst_QDateTimeEdit::stepHourAMPM_data() -- cgit v0.12 From ff8dd08c1ec66905a271c528b18c1e6738d2da77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 3 Jun 2009 20:42:42 +0200 Subject: My changes for 4.5.2 --- dist/changes-4.5.2 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 5149eba..378d565 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -127,6 +127,22 @@ Third party components * [252311] "font-family:" now handle fallback font specified with a comas separated list. +- QFile and QTemporaryFile + * [165920] QFile::copy leaves the source file open after the file has been copied + * [191467] & [252293] QFile::copy of resource files to the filesystem fails on Windows + * [197857] QFile::copy of resource files leaves temporary files on filesystem + * [248223] QTemporaryFile: Access denied error when (re-)opening through QFile interface + * [252659] QTemporaryFile::rename may leave source file behind + +- QByteArrayMatcher + * [251958] Assignment operator and copy constructor miss data + +- QCompleter + * [253125] QCompleter doesn't expand entries with UnfilteredPopupCompletion + +- QPrintDialog + * [253135] Crash in QPrintDialog when editing output filename + **************************************************************************** * Database Drivers * **************************************************************************** @@ -180,6 +196,7 @@ Qt for Windows CE **************************************************************************** - Build System + * [253053] Linker in macx-g++42 spec is gcc instead of gcc-4.2 - Assistant -- cgit v0.12 From cfbe3355b36d629f0ba40ddcf421d807e624a1d3 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 3 Jun 2009 20:42:47 +0200 Subject: Added loadS60ThemeFromBlob and saveS60ThemeToBlob. The simulated style will by default try to load the 'Default.blob' --- src/gui/styles/qs60style.cpp | 8 --- src/gui/styles/qs60style.h | 2 + src/gui/styles/qs60style_s60.cpp | 8 +++ src/gui/styles/qs60style_simulated.cpp | 125 +++++++++++++++++++++++++++++++++ 4 files changed, 135 insertions(+), 8 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index f7a1700..b30cc0d 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -870,14 +870,6 @@ QSize QS60StylePrivate::partSize(QS60StyleEnums::SkinParts part, SkinElementFlag \sa QMacStyle, QWindowsStyle, QWindowsXPStyle, QWindowsVistaStyle, QPlastiqueStyle, QCleanlooksStyle, QMotifStyle */ -/*! - Constructs a QS60Style object. -*/ -QS60Style::QS60Style() - : QCommonStyle(*new QS60StylePrivate) -{ -} - QS60Style::~QS60Style() { } diff --git a/src/gui/styles/qs60style.h b/src/gui/styles/qs60style.h index bf8f22e..21cdd1c 100644 --- a/src/gui/styles/qs60style.h +++ b/src/gui/styles/qs60style.h @@ -85,6 +85,8 @@ public: static QStringList colorListKeys(); void setS60Theme(const QHash &parts, const QHash, QColor> &colors); + bool loadS60ThemeFromBlob(const QString &blobFile); + bool saveS60ThemeToBlob(const QString &blobFile) const; #endif // !Q_WS_S60 #ifdef Q_WS_S60 diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index d6f7109..55e80b9 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -1326,6 +1326,14 @@ void QS60StyleModeSpecifics::colorGroupAndIndex( } } +/*! + Constructs a QS60Style object. +*/ +QS60Style::QS60Style() + : QCommonStyle(*new QS60StylePrivate) +{ +} + void QS60Style::handleDynamicLayoutVariantSwitch() { Q_D(QS60Style); diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index 089a252..a94d73e 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -51,11 +51,109 @@ #include "qlayout.h" #include "qpixmapcache.h" #include "qmetaobject.h" +#include "qdebug.h" +#include "qbuffer.h" #if !defined(QT_NO_STYLE_S60) || defined(QT_PLUGIN) QT_BEGIN_NAMESPACE +static const quint32 blobVersion = 1; +static const int pictureSize = 256; + +bool saveThemeToBlob(const QString &themeBlob, + const QHash &partPictures, + const QHash, QColor> &colors) +{ + QFile blob(themeBlob); + if (!blob.open(QIODevice::WriteOnly)) { + qWarning() << __FUNCTION__": Could not create blob: " << themeBlob; + return false; + } + + QByteArray data; + QBuffer dataBuffer(&data); + dataBuffer.open(QIODevice::WriteOnly); + QDataStream dataOut(&dataBuffer); + + const int colorsCount = colors.count(); + dataOut << colorsCount; + const QList > colorKeys = colors.keys(); + for (int i = 0; i < colorsCount; ++i) { + const QPair &key = colorKeys.at(i); + dataOut << key; + const QColor color = colors.value(key); + dataOut << color; + } + + const int picturesCount = partPictures.count(); + dataOut << picturesCount; + foreach (const QString &key, partPictures.keys()) { + const QPicture picture = partPictures.value(key); + dataOut << key; + dataOut << picture; + } + + QDataStream blobOut(&blob); + blobOut << blobVersion; + blobOut << qCompress(data); + return blobOut.status() == QDataStream::Ok; +} + +bool loadThemeFromBlob(const QString &themeBlob, + QHash &partPictures, + QHash, QColor> &colors) +{ + QFile blob(themeBlob); + if (!blob.open(QIODevice::ReadOnly)) { + qWarning() << __FUNCTION__": Could not read blob: " << themeBlob; + return false; + } + QDataStream blobIn(&blob); + + quint32 version; + blobIn >> version; + + if (version != blobVersion) { + qWarning() << __FUNCTION__": Invalid blob version: " << version << " ...expected: " << blobVersion; + return false; + } + + QByteArray data; + blobIn >> data; + data = qUncompress(data); + QBuffer dataBuffer(&data); + dataBuffer.open(QIODevice::ReadOnly); + QDataStream dataIn(&dataBuffer); + + int colorsCount; + dataIn >> colorsCount; + for (int i = 0; i < colorsCount; ++i) { + QPair key; + dataIn >> key; + QColor value; + dataIn >> value; + colors.insert(key, value); + } + + int picturesCount; + dataIn >> picturesCount; + for (int i = 0; i < picturesCount; ++i) { + QString key; + dataIn >> key; + QPicture value; + dataIn >> value; + value.setBoundingRect(QRect(0, 0, pictureSize, pictureSize)); // Bug? The forced bounding rect was not deserialized. + partPictures.insert(key, value); + } + + if (dataIn.status() != QDataStream::Ok) { + qWarning() << __FUNCTION__": Invalid data blob: " << themeBlob; + return false; + } + return true; +} + class QS60StyleModeSpecifics { public: @@ -254,6 +352,16 @@ QFont QS60StylePrivate::s60Font_specific(QS60StyleEnums::FontCategories fontCate return result; } +/*! + Constructs a QS60Style object. +*/ +QS60Style::QS60Style() + : QCommonStyle(*new QS60StylePrivate) +{ + // Assume, that the resource system has a ':/s60Stylethemes/Default.blob' + loadS60ThemeFromBlob(QString::fromLatin1(":/s60Stylethemes/Default.blob")); +} + Q_GLOBAL_STATIC_WITH_INITIALIZER(QStringList, enumPartKeys, { const int enumIndex = QS60StyleEnums::staticMetaObject.indexOfEnumerator("SkinParts"); Q_ASSERT(enumIndex >= 0); @@ -303,6 +411,23 @@ void QS60Style::setS60Theme(const QHash &parts, d->setThemePalette(qApp); } +bool QS60Style::loadS60ThemeFromBlob(const QString &blobFile) +{ + QHash partPictures; + QHash, QColor> colors; + + if (!loadThemeFromBlob(blobFile, partPictures, colors)) + return false; + setS60Theme(partPictures, colors); + return true; +} + +bool QS60Style::saveS60ThemeToBlob(const QString &blobFile) const +{ + return saveThemeToBlob(blobFile, + QS60StyleModeSpecifics::m_partPictures, QS60StyleModeSpecifics::m_colors); +} + QPoint qt_s60_fill_background_offset(const QWidget *targetWidget) { Q_UNUSED(targetWidget) -- cgit v0.12 From 8021218dd5ab2d7ad9314b1c2a54168de4694065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 3 Jun 2009 21:32:55 +0200 Subject: More changes for 4.5.2 --- dist/changes-4.5.2 | 1 + 1 file changed, 1 insertion(+) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 378d565..6772405 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -128,6 +128,7 @@ Third party components separated list. - QFile and QTemporaryFile + * Fixed a leak of file descriptors in QTemporaryFile::rename, introduced in 4.5.1 * [165920] QFile::copy leaves the source file open after the file has been copied * [191467] & [252293] QFile::copy of resource files to the filesystem fails on Windows * [197857] QFile::copy of resource files leaves temporary files on filesystem -- cgit v0.12 From 58d05bc0ddbbae72128849676d12493058272cd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Thu, 4 Jun 2009 09:29:46 +0300 Subject: S60Style: Draw all dialog with popup menu theme background. --- src/gui/styles/qs60style.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index f7a1700..9fbad41 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -50,7 +50,6 @@ #include "qcalendarwidget.h" #include "qdial.h" #include "qdialog.h" -#include "qerrormessage.h" #include "qgroupbox.h" #include "qheaderview.h" #include "qlist.h" @@ -58,7 +57,6 @@ #include "qlistview.h" #include "qmenu.h" #include "qmenubar.h" -#include "qmessagebox.h" #include "qpushbutton.h" #include "qscrollarea.h" #include "qscrollbar.h" @@ -116,8 +114,6 @@ const short QS60StylePrivate::data[][MAX_PIXELMETRICS] = { {7,0,-909,0,0,2,0,0,-1,20,52,28,19,19,9,258,-909,-909,-909,29,19,6,0,0,32,-909,60,-909,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,98,35,98,5,5,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,2,-909,-909,-909,-909,7,7,3,1}, {7,0,-909,0,0,2,0,0,-1,10,20,27,18,18,9,301,-909,-909,-909,29,18,5,0,0,35,-909,32,-909,5,5,2,-909,-909,0,2,8,0,16,28,21,21,26,26,2,170,26,0,-909,-909,-909,-909,0,0,21,5,-909,0,0,-909,-909,-909,-909,-909,-909,54,26,265,34,265,5,5,6,3,18,-909,7,72,19,7,0,8,6,5,11,6,5,-909,2,-909,-909,-909,-909,5,5,3,1}, {7,0,-909,0,0,2,0,0,-1,10,20,27,18,18,9,301,-909,-909,-909,29,18,5,0,0,35,-909,32,-909,5,5,2,-909,-909,0,2,8,0,16,28,21,21,26,26,2,170,26,0,-909,-909,-909,-909,0,0,21,6,-909,0,0,-909,-909,-909,-909,-909,-909,54,26,265,34,265,5,5,6,3,18,-909,7,72,19,7,0,5,6,8,11,6,5,-909,2,-909,-909,-909,-909,5,5,3,1} - - // *** End of generated data *** }; @@ -126,6 +122,7 @@ const short *QS60StylePrivate::m_pmPointer = QS60StylePrivate::data[0]; // theme background texture QPixmap *QS60StylePrivate::m_background = 0; +// theme palette QPalette *QS60StylePrivate::m_themePalette = 0; const struct QS60StylePrivate::frameElementCenter QS60StylePrivate::m_frameElementsData[] = { @@ -144,6 +141,7 @@ const struct QS60StylePrivate::frameElementCenter QS60StylePrivate::m_frameEleme {SE_PanelBackground, QS60StyleEnums::SP_QsnFrSetOptCenter}, {SE_ButtonInactive, QS60StyleEnums::SP_QsnFrButtonCenterInactive}, }; + static const int frameElementsCount = int(sizeof(QS60StylePrivate::m_frameElementsData)/sizeof(QS60StylePrivate::m_frameElementsData[0])); @@ -360,8 +358,7 @@ QColor QS60StylePrivate::lighterColor(const QColor &baseColor) bool QS60StylePrivate::drawsOwnThemeBackground(const QWidget *widget) { - return (qobject_cast (widget) || - qobject_cast (widget)); + return qobject_cast (widget); } QFont QS60StylePrivate::s60Font( @@ -413,8 +410,8 @@ void QS60StylePrivate::clearCaches(QS60StylePrivate::CacheClearReason reason) } // Since S60Style has 'button' and 'tooltip' as a graphic, we don't have any native color which to use -// for QPalette::Button and QPalette::ToolTipBase. Therefore we need to guesstimate -// this by calculating average rgb values for button pixels. +// for QPalette::Button and QPalette::ToolTipBase. Therefore S60Style needs to guesstimate +// palette colors by calculating average rgb values for button pixels. // Returns Qt::black if there is an issue with the graphics (image is NULL, or no bits() found). QColor QS60StylePrivate::colorFromFrameGraphics(QS60StylePrivate::SkinFrameElements frame) const { @@ -615,9 +612,7 @@ QPixmap QS60StylePrivate::cachedFrame(SkinFrameElements frame, const QSize &size void QS60StylePrivate::refreshUI() { - QList widgets = QApplication::allWidgets(); - - // The following is similar to updateWidgets in qstylesheetstyle.cpp. + QList widgets = QApplication::allWidgets(); for (int i = 0; i < widgets.size(); ++i) { QWidget *widget = widgets.at(i); @@ -662,7 +657,7 @@ void QS60StylePrivate::setThemePalette(QWidget *widget) const QPalette widgetPalette = widget->palette(); //header view and its viewport need to be set 100% transparent button color, since drawing code will - //draw transparent theme graphics there. + //draw transparent theme graphics to table column and row headers. if (qobject_cast(widget)){ widgetPalette.setColor(QPalette::Active, QPalette::ButtonText, QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 23, 0)); -- cgit v0.12 From 289c098c15a359c4e5d142a997230db5df554f8d Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 4 Jun 2009 08:44:35 +0200 Subject: Silence compile warning in the test Reviewed-by: TrustMe --- tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp b/tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp index 2383767..2f6180f 100644 --- a/tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp +++ b/tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp @@ -76,7 +76,7 @@ private slots: void oldCacheVersionFile_data(); void oldCacheVersionFile(); - + void sync(); }; @@ -486,7 +486,7 @@ public: void run() { QByteArray longString = "Hello World, this is some long string, well not really that long"; - for (int i = 0; i < 10; ++i) + for (int j = 0; j < 10; ++j) longString += longString; QByteArray longString2 = "Help, I am stuck in an autotest!"; QUrl url(EXAMPLE_URL); -- cgit v0.12 From efcc087e7da35f6db0e544f48493626f4fa2d56a Mon Sep 17 00:00:00 2001 From: Aleksandar Sasha Babic Date: Wed, 3 Jun 2009 10:29:24 +0200 Subject: In QGraphicsView the viewport itself has to be enabled for InputMethods. When events are comming, exactly that widget will be aske for InputContext. --- src/gui/graphicsview/qgraphicsview.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index a795fb4..8137f8e 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -1195,6 +1195,11 @@ QGraphicsView::QGraphicsView(QWidget *parent) // using a simple reference count. The same goes for acceptDrops and mouse // tracking. setAttribute(Qt::WA_InputMethodEnabled); + + // viewport part of the graphics view has to be enabled + // as well, because when events come this widget is asked + // for input context and so on + viewport()->setAttribute(Qt::WA_InputMethodEnabled); } /*! @@ -1209,6 +1214,11 @@ QGraphicsView::QGraphicsView(QGraphicsScene *scene, QWidget *parent) setAcceptDrops(true); setBackgroundRole(QPalette::Base); setAttribute(Qt::WA_InputMethodEnabled); + + // viewport part of the graphics view has to be enabled + // as well, because when events come this widget is asked + // for input context and so on + viewport()->setAttribute(Qt::WA_InputMethodEnabled); } /*! @@ -1221,6 +1231,11 @@ QGraphicsView::QGraphicsView(QGraphicsViewPrivate &dd, QWidget *parent) setAcceptDrops(true); setBackgroundRole(QPalette::Base); setAttribute(Qt::WA_InputMethodEnabled); + + // viewport part of the graphics view has to be enabled + // as well, because when events come this widget is asked + // for input context and so on + viewport()->setAttribute(Qt::WA_InputMethodEnabled); } /*! -- cgit v0.12 From cbe3119db5380c41d44d4e936c7da4889c02f147 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 4 Jun 2009 09:30:17 +0200 Subject: BT: Fixes Crash when deleting a QProgressBar which has been styled with QMotifStyle Same fix as in e9a7e43031d7c1ee712e43be682c4e2c183759c4 but with motif Reported by https://bugs.kde.org/show_bug.cgi?id=193911 Task-number: 255138 Reviewed-by: jbache --- dist/changes-4.5.2 | 3 +++ src/gui/styles/qmotifstyle.cpp | 5 ++++- tests/auto/qprogressbar/tst_qprogressbar.cpp | 20 ++++++++++++++++++-- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 6772405..a54d8ba 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -67,6 +67,9 @@ Third party components * [253339] Don't draw arrows on toolbuttons that have a menu and text only. * [252301] Ensure that small and mini spin boxes are drawn correctly. +- QMotifStyle + * Fix crash when changing style and destroying progressbar. + - QFontDialog * [252000] Ensure that QFontDialog::getFont() works on Mac OS X. diff --git a/src/gui/styles/qmotifstyle.cpp b/src/gui/styles/qmotifstyle.cpp index 7d4fab8..d19750f 100644 --- a/src/gui/styles/qmotifstyle.cpp +++ b/src/gui/styles/qmotifstyle.cpp @@ -298,8 +298,11 @@ void QMotifStyle::unpolish(QWidget* widget) { QCommonStyle::unpolish(widget); #ifndef QT_NO_PROGRESSBAR - if (qobject_cast(widget)) + if (qobject_cast(widget)) { + Q_D(QMotifStyle); widget->removeEventFilter(this); + d->bars.removeAll(static_cast(widget)); + } #endif } diff --git a/tests/auto/qprogressbar/tst_qprogressbar.cpp b/tests/auto/qprogressbar/tst_qprogressbar.cpp index d6379d3..cb037e0 100644 --- a/tests/auto/qprogressbar/tst_qprogressbar.cpp +++ b/tests/auto/qprogressbar/tst_qprogressbar.cpp @@ -63,6 +63,7 @@ private slots: void setValueRepaint(); void sizeHint(); + void task245201_testChangeStyleAndDelete_data(); void task245201_testChangeStyleAndDelete(); }; @@ -224,15 +225,30 @@ void tst_QProgressBar::sizeHint() QCOMPARE(barSize.height(), size.height()); } +void tst_QProgressBar::task245201_testChangeStyleAndDelete_data() +{ + QTest::addColumn("style1_str"); + QTest::addColumn("style2_str"); + + QTest::newRow("plastique-windows") << QString::fromLatin1("plastique") << QString::fromLatin1("windows"); + QTest::newRow("mlotif-windows") << QString::fromLatin1("motif") << QString::fromLatin1("windows"); + QTest::newRow("cleanlooks-cde") << QString::fromLatin1("cleanlooks") << QString::fromLatin1("cde"); + QTest::newRow("gtk-plastique") << QString::fromLatin1("gtk") << QString::fromLatin1("plastique"); +} + void tst_QProgressBar::task245201_testChangeStyleAndDelete() { + QFETCH(QString, style1_str); + QFETCH(QString, style2_str); + QProgressBar *bar = new QProgressBar; - QStyle *style = QStyleFactory::create("plastique"); + QStyle *style = QStyleFactory::create(style1_str); bar->setStyle(style); bar->show(); - QStyle *style2 = QStyleFactory::create("windows"); + QStyle *style2 = QStyleFactory::create(style2_str); bar->setStyle(style2); + QTest::qWait(10); delete bar; QTest::qWait(100); //should not crash -- cgit v0.12 From c755c1d3c6fe60a9018308e1ce13bae6821bc214 Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Thu, 4 Jun 2009 10:10:19 +0200 Subject: Document that textVisible is optional when it comes to styles. No progress bars on the mac show text and it would be bad if we allowed it. There's nothing stopping people from connecting the valueChanged() signal to a slot and have a real label layed out correctly that actually updates with the amount of time it takes to complete, etc. This is more what they do on Mac OS X if they decide to show a label. --- src/gui/widgets/qprogressbar.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/widgets/qprogressbar.cpp b/src/gui/widgets/qprogressbar.cpp index cdb3836..1a7f878 100644 --- a/src/gui/widgets/qprogressbar.cpp +++ b/src/gui/widgets/qprogressbar.cpp @@ -349,6 +349,8 @@ void QProgressBar::setRange(int minimum, int maximum) \property QProgressBar::textVisible \brief whether the current completed percentage should be displayed + This property may be ignored by the style (e.g., QMacStyle never draws the text). + \sa textDirection */ void QProgressBar::setTextVisible(bool visible) -- cgit v0.12 From df5c557e7777c8844ac866d730346178ad33a0a6 Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Thu, 4 Jun 2009 10:39:20 +0200 Subject: Document the proper signals that the ::open() convenience connects to. We were saying that it connected to accepted it all these cases, but it actually is doing some nice magic that makes sense assuming you document it. --- src/gui/dialogs/qcolordialog.cpp | 2 +- src/gui/dialogs/qfiledialog.cpp | 5 +++-- src/gui/dialogs/qfontdialog.cpp | 2 +- src/gui/dialogs/qinputdialog.cpp | 12 ++++++++++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/gui/dialogs/qcolordialog.cpp b/src/gui/dialogs/qcolordialog.cpp index 3aa04f6..4702d14 100644 --- a/src/gui/dialogs/qcolordialog.cpp +++ b/src/gui/dialogs/qcolordialog.cpp @@ -1749,7 +1749,7 @@ void QColorDialog::setVisible(bool visible) \overload \since 4.5 - Opens the dialog and connects its accepted() signal to the slot specified + Opens the dialog and connects its colorSelected() signal to the slot specified by \a receiver and \a member. The signal will be disconnected from the slot when the dialog is closed. diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index 405e71e..77382a7 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -638,8 +638,9 @@ QFileDialog::Options QFileDialog::options() const \since 4.5 - Opens the dialog and connects its accepted() signal to the slot specified - by \a receiver and \a member. + This function connects one of its signals to the slot specified by \a receiver + and \a member. The specific signal depends is filesSelected() if fileMode is + ExistingFiles and fileSelected() if fileMode is anything else. The signal will be disconnected from the slot when the dialog is closed. */ diff --git a/src/gui/dialogs/qfontdialog.cpp b/src/gui/dialogs/qfontdialog.cpp index aa1c553..9ea06ac 100644 --- a/src/gui/dialogs/qfontdialog.cpp +++ b/src/gui/dialogs/qfontdialog.cpp @@ -940,7 +940,7 @@ bool QFontDialogPrivate::sharedFontPanelAvailable = true; \since 4.5 \overload - Opens the dialog and connects its accepted() signal to the slot specified + Opens the dialog and connects its fontSelected() signal to the slot specified by \a receiver and \a member. The signal will be disconnected from the slot when the dialog is closed. diff --git a/src/gui/dialogs/qinputdialog.cpp b/src/gui/dialogs/qinputdialog.cpp index 78d99e3..8754324 100644 --- a/src/gui/dialogs/qinputdialog.cpp +++ b/src/gui/dialogs/qinputdialog.cpp @@ -1020,8 +1020,16 @@ QString QInputDialog::cancelButtonText() const \since 4.5 \overload - Opens the dialog and connects its accepted() signal to the slot specified - by \a receiver and \a member. + This function connects one of its signals to the slot specified by \a receiver + and \a member. The specific signal depends on the arguments that are specified + in \a member. These are: + + \list + \o textValueSelected() if \a member has a QString for its first argument. + \o intValueSelected() if \a member has an int for its first argument. + \o doubleValueSelected() if \a member has a double for its first argument. + \o accepted() if \a member has NO arguments. + \endlist The signal will be disconnected from the slot when the dialog is closed. */ -- cgit v0.12 From 08d020409ecf08c81f31faf33f1da329177cc207 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 4 Jun 2009 11:59:07 +0300 Subject: Added proper picture for Drilldown example in fluidlauncher --- demos/embedded/fluidlauncher/screenshots/drilldown.png | Bin 0 -> 102922 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 demos/embedded/fluidlauncher/screenshots/drilldown.png diff --git a/demos/embedded/fluidlauncher/screenshots/drilldown.png b/demos/embedded/fluidlauncher/screenshots/drilldown.png new file mode 100644 index 0000000..413d713 Binary files /dev/null and b/demos/embedded/fluidlauncher/screenshots/drilldown.png differ -- cgit v0.12 From fc96ef8bf45482483d795fe3d979fb842869a315 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 4 Jun 2009 12:15:05 +0300 Subject: Added proper UID for phonon.pro, and did some symbian scope cleanup, too. --- src/phonon/phonon.pro | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/phonon/phonon.pro b/src/phonon/phonon.pro index 679a1b0..b38adb8 100644 --- a/src/phonon/phonon.pro +++ b/src/phonon/phonon.pro @@ -13,13 +13,6 @@ PHONON_DIR = $$QT_SOURCE_TREE/src/3rdparty/phonon/phonon unix:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui QtNetwork -# Phonon depends on numeric_limits. Enabling STL support in Qt -# would bring in link dependencies, and we don't need that for -# numeric_limits, hence we here merely ensure we bring in the necessary -# header. -symbian:INCLUDEPATH += $${EPOCROOT}epoc32/include/stdapis/stlport \ - $$OS_LAYER_STDCPP_SYSTEMINCLUDE - # Input HEADERS += $$PHONON_DIR/abstractaudiooutput.h \ $$PHONON_DIR/abstractaudiooutput_p.h \ @@ -122,7 +115,16 @@ contains(QT_CONFIG, dbus) { contains(QT_CONFIG, reduce_exports): CONFIG += hide_symbols symbian: { + # Phonon depends on numeric_limits. Enabling STL support in Qt + # would bring in link dependencies, and we don't need that for + # numeric_limits, hence we here merely ensure we bring in the necessary + # header. + INCLUDEPATH *= $${EPOCROOT}epoc32/include/stdapis/stlport \ + $$OS_LAYER_STDCPP_SYSTEMINCLUDE + # Without this setting, code using numeric_limits will fail # for winscw, although armv5 works fine no matter what. - MMP_RULES += "option cw -wchar_t on" + QMAKE_CXXFLAGS.CW *= $$STLLIB_USAGE_CW_FLAGS + + TARGET.UID3 = 0x2001E624 } -- cgit v0.12 From c244010c866cf1a80f1de7382a3b78e2eb0cb56b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Thu, 4 Jun 2009 12:17:39 +0300 Subject: S60Style: Cleanup code before Tower release. --- src/gui/styles/qs60style.cpp | 413 ++++++++++++++++++++------------------- src/gui/styles/qs60style_s60.cpp | 49 ++--- 2 files changed, 229 insertions(+), 233 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index c8582eb..7db0992 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -145,7 +145,7 @@ const struct QS60StylePrivate::frameElementCenter QS60StylePrivate::m_frameEleme static const int frameElementsCount = int(sizeof(QS60StylePrivate::m_frameElementsData)/sizeof(QS60StylePrivate::m_frameElementsData[0])); -const int KNotFound = -1; +const int KNotFound = -909; QS60StylePrivate::~QS60StylePrivate() { @@ -290,8 +290,6 @@ short QS60StylePrivate::pixelMetric(int metric) { Q_ASSERT(metric < MAX_PIXELMETRICS); const short returnValue = m_pmPointer[metric]; - if (returnValue==-909) - return -1; return returnValue; } @@ -306,7 +304,6 @@ void QS60StylePrivate::setStyleProperty(const char *name, const QVariant &value) QApplication::setLayoutDirection(m_layoutHeaders[layoutIndex].mirroring ? Qt::RightToLeft : Qt::LeftToRight); clearCaches(); refreshUI(); - return; } } @@ -559,11 +556,11 @@ void QS60StylePrivate::drawRow(QS60StyleEnums::SkinParts start, QRect endRect; if (orientation == Qt::Horizontal) { - startRect.setWidth(qMin(rect.width() / 2 - 1, startRect.width())); + startRect.setWidth(qMin(rect.width() >>1 - 1, startRect.width())); endRect = startRect.translated(rect.width() - startRect.width(), 0); middleRect.adjust(startRect.width(), 0, -startRect.width(), 0); } else { - startRect.setHeight(qMin(rect.height() / 2 - 1, startRect.height())); + startRect.setHeight(qMin(rect.height() >>1 - 1, startRect.height())); endRect = startRect.translated(0, rect.height() - startRect.height()); middleRect.adjust(0, startRect.height(), 0, -startRect.height()); } @@ -691,20 +688,21 @@ void QS60StylePrivate::setThemePalette(QPalette *palette) const palette->setColor(QPalette::LinkVisited, palette->color(QPalette::Link).darker()); palette->setColor(QPalette::Highlight, QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnHighlightColors, 2, 0)); + // set background image as a texture brush + palette->setBrush(QPalette::Window, QS60StylePrivate::backgroundTexture()); // set these as transparent so that styled full screen theme background is visible palette->setColor(QPalette::AlternateBase, Qt::transparent); - palette->setBrush(QPalette::Window, QS60StylePrivate::backgroundTexture()); - palette->setColor(QPalette::Base, Qt::transparent); + palette->setBrush(QPalette::Base, Qt::transparent); // set button and tooltipbase based on pixel colors const QColor buttonColor = this->colorFromFrameGraphics(QS60StylePrivate::SF_ButtonNormal); palette->setColor(QPalette::Button, buttonColor ); + const QColor toolTipColor = this->colorFromFrameGraphics(QS60StylePrivate::SF_ToolTip); + palette->setColor(QPalette::ToolTipBase, toolTipColor ); palette->setColor(QPalette::Light, palette->color(QPalette::Button).lighter()); palette->setColor(QPalette::Dark, palette->color(QPalette::Button).darker()); palette->setColor(QPalette::Midlight, palette->color(QPalette::Button).lighter(125)); palette->setColor(QPalette::Mid, palette->color(QPalette::Button).darker(150)); palette->setColor(QPalette::Shadow, Qt::black); - QColor toolTipColor = this->colorFromFrameGraphics(QS60StylePrivate::SF_ToolTip); - palette->setColor(QPalette::ToolTipBase, toolTipColor ); setThemePaletteHash(palette); QS60StylePrivate::storeThemePalette(palette); @@ -728,6 +726,8 @@ void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const //store the original palette QPalette widgetPalette = *palette; + const QColor mainAreaTextColor = + QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0); widgetPalette.setColor(QPalette::All, QPalette::WindowText, QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnLineColors, 8, 0)); @@ -735,20 +735,16 @@ void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const // return to original palette after each widget widgetPalette = *palette; - widgetPalette.setColor(QPalette::Active, QPalette::ButtonText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); - widgetPalette.setColor(QPalette::Inactive, QPalette::ButtonText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); + widgetPalette.setColor(QPalette::Active, QPalette::ButtonText, mainAreaTextColor); + widgetPalette.setColor(QPalette::Inactive, QPalette::ButtonText, mainAreaTextColor); const QStyleOption opt; widgetPalette.setColor(QPalette::Disabled, QPalette::ButtonText, QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, &opt)); QApplication::setPalette(widgetPalette, "QPushButton"); widgetPalette = *palette; - widgetPalette.setColor(QPalette::Active, QPalette::ButtonText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); - widgetPalette.setColor(QPalette::Inactive, QPalette::ButtonText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); + widgetPalette.setColor(QPalette::Active, QPalette::ButtonText, mainAreaTextColor); + widgetPalette.setColor(QPalette::Inactive, QPalette::ButtonText, mainAreaTextColor); QApplication::setPalette(widgetPalette, "QToolButton"); widgetPalette = *palette; @@ -777,11 +773,10 @@ void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const QApplication::setPalette(widgetPalette, "QLineEdit"); widgetPalette = *palette; - const QColor color(QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); - widgetPalette.setColor(QPalette::WindowText, color); + widgetPalette.setColor(QPalette::WindowText, mainAreaTextColor); widgetPalette.setColor(QPalette::Button, QApplication::palette().color(QPalette::Button)); - widgetPalette.setColor(QPalette::Dark, color.darker()); - widgetPalette.setColor(QPalette::Light, color.lighter()); + widgetPalette.setColor(QPalette::Dark, mainAreaTextColor.darker()); + widgetPalette.setColor(QPalette::Light, mainAreaTextColor.lighter()); QApplication::setPalette(widgetPalette, "QDial"); widgetPalette = *palette; @@ -890,7 +885,7 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom horizontal ? QS60StylePrivate::SE_ScrollBarGrooveHorizontal : QS60StylePrivate::SE_ScrollBarGrooveVertical; QS60StylePrivate::drawSkinElement(grooveElement, painter, grooveRect, flags); - QStyle::SubControls subControls = optionSlider->subControls; + const QStyle::SubControls subControls = optionSlider->subControls; // select correct slider (horizontal/vertical/pressed) const bool sliderPressed = ((optionSlider->state & QStyle::State_Sunken) && (subControls & SC_ScrollBarSlider)); @@ -942,7 +937,6 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom if (const QStyleOptionComboBox *cmb = qstyleoption_cast(option)) { const QRect cmbxEditField = subControlRect(CC_ComboBox, option, SC_ComboBoxEditField, widget); const QRect cmbxFrame = subControlRect(CC_ComboBox, option, SC_ComboBoxFrame, widget); - const bool direction = cmb->direction == Qt::LeftToRight; // Button frame @@ -960,8 +954,9 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom const QS60StylePrivate::SkinElements skinElement = QS60StylePrivate::SE_FrameLineEdit; QS60StylePrivate::drawSkinElement(skinElement, painter, cmbxEditField, flags); + // Draw the combobox arrow if (sub & SC_ComboBoxArrow) { - // Draw the little arrow + // Make rect slightly smaller buttonOption.rect.adjust(1, 1, -1, -1); painter->save(); painter->setPen(option->palette.buttonText().color()); @@ -1102,14 +1097,13 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom if (spinBox->subControls & SC_SpinBoxUp) { copy.subControls = SC_SpinBoxUp; - QPalette pal2 = spinBox->palette; + QPalette spinBoxPal = spinBox->palette; if (!(spinBox->stepEnabled & QAbstractSpinBox::StepUpEnabled)) { - pal2.setCurrentColorGroup(QPalette::Disabled); + spinBoxPal.setCurrentColorGroup(QPalette::Disabled); copy.state &= ~State_Enabled; + copy.palette = spinBoxPal; } - copy.palette = pal2; - if (spinBox->activeSubControls == SC_SpinBoxUp && (spinBox->state & State_Sunken)) { copy.state |= State_On; copy.state |= State_Sunken; @@ -1117,8 +1111,9 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom copy.state |= State_Raised; copy.state &= ~State_Sunken; } - pe = (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus ? PE_IndicatorSpinPlus - : PE_IndicatorSpinUp); + pe = (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus) ? + PE_IndicatorSpinPlus : + PE_IndicatorSpinUp; copy.rect = subControlRect(CC_SpinBox, spinBox, SC_SpinBoxUp, widget); drawPrimitive(PE_PanelButtonBevel, ©, painter, widget); @@ -1129,12 +1124,12 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom if (spinBox->subControls & SC_SpinBoxDown) { copy.subControls = SC_SpinBoxDown; copy.state = spinBox->state; - QPalette pal2 = spinBox->palette; + QPalette spinBoxPal = spinBox->palette; if (!(spinBox->stepEnabled & QAbstractSpinBox::StepDownEnabled)) { - pal2.setCurrentColorGroup(QPalette::Disabled); + spinBoxPal.setCurrentColorGroup(QPalette::Disabled); copy.state &= ~State_Enabled; + copy.palette = spinBoxPal; } - copy.palette = pal2; if (spinBox->activeSubControls == SC_SpinBoxDown && (spinBox->state & State_Sunken)) { copy.state |= State_On; @@ -1143,8 +1138,9 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom copy.state |= State_Raised; copy.state &= ~State_Sunken; } - pe = (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus ? PE_IndicatorSpinMinus - : PE_IndicatorSpinDown); + pe = (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus) ? + PE_IndicatorSpinMinus : + PE_IndicatorSpinDown; copy.rect = subControlRect(CC_SpinBox, spinBox, SC_SpinBoxDown, widget); drawPrimitive(PE_PanelButtonBevel, ©, painter, widget); @@ -1352,13 +1348,12 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, // draw themed background for table unless background brush has been defined. if (vopt->backgroundBrush == Qt::NoBrush) { - // draw the background const QStyleOptionViewItemV4 *tableOption = qstyleoption_cast(option); const QTableView *table = qobject_cast(widget); if (table && tableOption) { const QModelIndex index = tableOption->index; //todo: Draw cell background only once - for the first cell. - QStyleOptionViewItemV4 voptAdj2 = voptAdj2; + QStyleOptionViewItemV4 voptAdj2 = voptAdj; const QModelIndex indexFirst = table->model()->index(0,0); const QModelIndex indexLast = table->model()->index( table->model()->rowCount()-1,table->model()->columnCount()-1); @@ -1384,7 +1379,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, listView && (listView->selectionMode() == QAbstractItemView::SingleSelection || listView->selectionMode() == QAbstractItemView::NoSelection); - QRect selectionRect = subElementRect(SE_ItemViewItemCheckIndicator, &voptAdj, widget); + const QRect selectionRect = subElementRect(SE_ItemViewItemCheckIndicator, &voptAdj, widget); if (voptAdj.state & QStyle::State_Selected && !singleSelection) { QStyleOptionViewItemV4 option(voptAdj); option.rect = selectionRect; @@ -1421,9 +1416,11 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, const QStyleOptionViewItemV4 *tableOption = qstyleoption_cast(option); if (isSelected) { if (qobject_cast(widget) && tableOption) - voptAdj.palette.setColor(QPalette::Text, QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 11, 0)); + voptAdj.palette.setColor( + QPalette::Text, QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 11, 0)); else - voptAdj.palette.setColor(QPalette::Text, QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 10, 0)); + voptAdj.palette.setColor( + QPalette::Text, QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 10, 0)); } painter->setPen(voptAdj.palette.text().color()); d->viewItemDrawText(painter, &voptAdj, textRect); @@ -1521,7 +1518,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, } painter->save(); QFont f = painter->font(); - f.setPointSizeF(f.pointSizeF() * 0.72); + f.setPointSizeF(f.pointSizeF() * KTabFontMul); painter->setFont(f); if (option->state & QStyle::State_Selected){ @@ -1529,27 +1526,27 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 3, option)); } - bool verticalTabs = optionTab.shape == QTabBar::RoundedEast + const bool verticalTabs = optionTab.shape == QTabBar::RoundedEast || optionTab.shape == QTabBar::RoundedWest || optionTab.shape == QTabBar::TriangularEast || optionTab.shape == QTabBar::TriangularWest; - bool selected = optionTab.state & State_Selected; + const bool selected = optionTab.state & State_Selected; if (verticalTabs) { painter->save(); - int newX, newY, newRot; + int newX, newY, newRotation; if (optionTab.shape == QTabBar::RoundedEast || optionTab.shape == QTabBar::TriangularEast) { newX = tr.width(); newY = tr.y(); - newRot = 90; + newRotation = 90; } else { newX = 0; newY = tr.y() + tr.height(); - newRot = -90; + newRotation = -90; } tr.setRect(0, 0, tr.height(), tr.width()); QTransform m; m.translate(newX, newY); - m.rotate(newRot); + m.rotate(newRotation); painter->setTransform(m, true); } tr.adjust(0, 0, pixelMetric(QStyle::PM_TabBarTabShiftHorizontal, tab, widget), @@ -1571,9 +1568,13 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, QPixmap tabIcon = optionTab.icon.pixmap(iconSize, (optionTab.state & State_Enabled) ? QIcon::Normal : QIcon::Disabled); if (tab->text.isEmpty()) - painter->drawPixmap(tr.center().x() - (tabIcon.height() >>1), tr.center().y() - (tabIcon.height() >>1), tabIcon); + painter->drawPixmap(tr.center().x() - (tabIcon.height() >>1), + tr.center().y() - (tabIcon.height() >>1), + tabIcon); else - painter->drawPixmap(tr.left() + tabOverlap, tr.center().y() - (tabIcon.height() >>1), tabIcon); + painter->drawPixmap(tr.left() + tabOverlap, + tr.center().y() - (tabIcon.height() >>1), + tabIcon); tr.setLeft(tr.left() + iconSize.width() + 4); } @@ -1583,13 +1584,13 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, if (optionTab.state & State_HasFocus) { const int OFFSET = 1 + pixelMetric(PM_DefaultFrameWidth); - const int x1 = optionTab.rect.left(); - const int x2 = optionTab.rect.right() - 1; + const int leftBorder = optionTab.rect.left(); + const int rightBorder = optionTab.rect.right() - 1; QStyleOptionFocusRect fropt; fropt.QStyleOption::operator=(*tab); - fropt.rect.setRect(x1 + 1 + OFFSET, optionTab.rect.y() + OFFSET, - x2 - x1 - 2*OFFSET, optionTab.rect.height() - 2*OFFSET); + fropt.rect.setRect(leftBorder + 1 + OFFSET, optionTab.rect.y() + OFFSET, + rightBorder - leftBorder - 2*OFFSET, optionTab.rect.height() - 2*OFFSET); drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget); } @@ -1639,25 +1640,12 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, } break; #endif // QT_NO_PROGRESSBAR -#ifndef QT_NO_MENUBAR -#endif //QT_NO_MENUBAR #ifndef QT_NO_MENU case CE_MenuItem: if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast(option)) { QStyleOptionMenuItem optionMenuItem = *menuItem; - const bool enabled = optionMenuItem.state & State_Enabled; - const bool checkable = optionMenuItem.checkType != QStyleOptionMenuItem::NotCheckable; - - uint text_flags = Qt::AlignLeading | Qt::TextShowMnemonic | Qt::TextDontClip - | Qt::TextSingleLine | Qt::AlignVCenter; - if (!styleHint(SH_UnderlineShortcut, menuItem, widget)) - text_flags |= Qt::TextHideMnemonic; - - QRect iconRect = - subElementRect(SE_ItemViewItemDecoration, &optionMenuItem, widget); - QRect textRect = subElementRect(SE_ItemViewItemText, &optionMenuItem, widget); + bool drawSubMenuIndicator = false; - switch(menuItem->menuItemType) { case QStyleOptionMenuItem::Scroller: case QStyleOptionMenuItem::Separator: @@ -1668,20 +1656,29 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, default: break; } + const bool enabled = optionMenuItem.state & State_Enabled; + const bool checkable = optionMenuItem.checkType != QStyleOptionMenuItem::NotCheckable; + + uint text_flags = Qt::AlignLeading | Qt::TextShowMnemonic | Qt::TextDontClip + | Qt::TextSingleLine | Qt::AlignVCenter; + if (!styleHint(SH_UnderlineShortcut, menuItem, widget)) + text_flags |= Qt::TextHideMnemonic; + + QRect iconRect = + subElementRect(SE_ItemViewItemDecoration, &optionMenuItem, widget); + QRect textRect = subElementRect(SE_ItemViewItemText, &optionMenuItem, widget); if ((option->state & State_Selected) && (option->state & State_Enabled)) QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ListHighlight, painter, option->rect, flags); //todo: move the vertical spacing stuff into subElementRect const int vSpacing = QS60StylePrivate::pixelMetric(QStyle::PM_LayoutVerticalSpacing); - QStyleOptionMenuItem optionCheckBox; if (checkable){ - QRect checkBoxRect = optionMenuItem.rect; - checkBoxRect.setWidth(pixelMetric(PM_IndicatorWidth)); - checkBoxRect.setHeight(pixelMetric(PM_IndicatorHeight)); + QStyleOptionMenuItem optionCheckBox; optionCheckBox.QStyleOption::operator=(*menuItem); - optionCheckBox.rect = checkBoxRect; - const int moveByX = checkBoxRect.width()+vSpacing; + optionCheckBox.rect.setWidth(pixelMetric(PM_IndicatorWidth)); + optionCheckBox.rect.setHeight(pixelMetric(PM_IndicatorHeight)); + const int moveByX = optionCheckBox.rect.width()+vSpacing; if (optionMenuItem.direction == Qt::LeftToRight) { textRect.translate(moveByX,0); iconRect.translate(moveByX, 0); @@ -1732,20 +1729,18 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, optionMenuItem.palette.color(QPalette::Disabled, QPalette::Text))); painter->save(); painter->setOpacity(0.5); - QCommonStyle::drawItemText(painter, textRect, text_flags, + } + QCommonStyle::drawItemText(painter, textRect, text_flags, optionMenuItem.palette, enabled, optionMenuItem.text, QPalette::Text); + if (!enabled) painter->restore(); - } else { - QCommonStyle::drawItemText(painter, textRect, text_flags, - optionMenuItem.palette, enabled, - optionMenuItem.text, QPalette::Text); - } } break; + case CE_MenuEmptyArea: + break; #endif //QT_NO_MENU - case CE_MenuEmptyArea: #ifndef QT_NO_MENUBAR case CE_MenuBarEmptyArea: break; @@ -1775,19 +1770,19 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, case CE_HeaderEmptyArea: { QS60StylePrivate::SkinElementFlags adjFlags = flags; - QRect mtyRect = option->rect; + QRect emptyAreaRect = option->rect; if (option->state & QStyle::State_Horizontal) { - mtyRect.adjust(-2,-2,2,-2); + emptyAreaRect.adjust(-2,-2,2,-2); } else { if ( option->direction == Qt::LeftToRight ) { - mtyRect.adjust(-2,-2,0,2); + emptyAreaRect.adjust(-2,-2,0,2); adjFlags |= QS60StylePrivate::SF_PointWest; } else { - mtyRect.adjust(2,2,0,-2); + emptyAreaRect.adjust(2,2,0,-2); adjFlags |= QS60StylePrivate::SF_PointEast; } } - QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_TableHeaderItem, painter, mtyRect, adjFlags); + QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_TableHeaderItem, painter, emptyAreaRect, adjFlags); } break; case CE_Header: @@ -1807,7 +1802,19 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, } } QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_TableHeaderItem, painter, mtyRect, adjFlags); - QCommonStyle::drawControl(element, header, painter, widget); + + QRegion clipRegion = painter->clipRegion(); + painter->setClipRect(option->rect); + drawControl(CE_HeaderSection, header, painter, widget); + QStyleOptionHeader subopt = *header; + subopt.rect = subElementRect(SE_HeaderLabel, header, widget); + if (subopt.rect.isValid()) + drawControl(CE_HeaderLabel, &subopt, painter, widget); + if (header->sortIndicator != QStyleOptionHeader::None) { + subopt.rect = subElementRect(SE_HeaderArrow, option, widget); + drawPrimitive(PE_IndicatorHeaderArrow, &subopt, painter, widget); + } + painter->setClipRegion(clipRegion); } break; #ifndef QT_NO_TOOLBAR @@ -1815,6 +1822,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, if (const QStyleOptionToolBar *toolBar = qstyleoption_cast(option)) { const QToolBar *tbWidget = qobject_cast(widget); + //toolbar within a toolbar, skip if (!tbWidget || (widget && qobject_cast(widget->parentWidget()))) break; @@ -1890,6 +1898,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti } break; case PE_IndicatorViewItemCheck: +#ifndef QT_NO_ITEMVIEWS if (const QListView *listItem = (qobject_cast(widget))) { if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast(option)) { const bool checkBoxVisible = vopt->features & QStyleOptionViewItemV2::HasCheckIndicator; @@ -1910,9 +1919,9 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti } } } +#endif //QT_NO_ITEMVIEWS break; - case PE_IndicatorRadioButton: - { + case PE_IndicatorRadioButton: { QRect buttonRect = option->rect; //there is empty (a. 33%) space in svg graphics for radiobutton const qreal reduceWidth = (qreal)buttonRect.width()/3.0; @@ -1935,8 +1944,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti case PE_PanelButtonCommand: case PE_PanelButtonTool: case PE_PanelButtonBevel: - case PE_FrameButtonBevel: - { + case PE_FrameButtonBevel: { const bool isPressed = option->state & QStyle::State_Sunken; const QS60StylePrivate::SkinElements skinElement = isPressed ? QS60StylePrivate::SE_ButtonPressed : QS60StylePrivate::SE_ButtonNormal; @@ -1947,8 +1955,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti case PE_IndicatorArrowDown: case PE_IndicatorArrowLeft: case PE_IndicatorArrowRight: - case PE_IndicatorArrowUp: - { + case PE_IndicatorArrowUp: { QS60StyleEnums::SkinParts skinPart; if (element==PE_IndicatorArrowDown) skinPart = QS60StyleEnums::SP_QgnGrafScrollArrowDown; @@ -2003,6 +2010,8 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti break; #endif //QT_NO_SPINBOX case PE_FrameFocusRect: +// Calendar widget and combox both do not use styled itemDelegate +#if not defined (QT_NO_CALENDARWIDGET) && not defined (QT_NO_COMBOBOX) if (!(widget && qobject_cast(widget->parent())) || qobject_cast(widget)) { // no focus selection for touch @@ -2031,13 +2040,19 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti painter->restore(); } } +#endif //!QT_NO_CALENDARWIDGET && !QT_NO_COMBOBOX break; case PE_Widget: - if (QS60StylePrivate::drawsOwnThemeBackground(widget) || - qobject_cast(widget) || - qobject_cast (widget)) { - QS60StylePrivate::SkinElements skinElement = QS60StylePrivate::SE_OptionsMenu; - QS60StylePrivate::drawSkinElement(skinElement, painter, option->rect, flags); + if (QS60StylePrivate::drawsOwnThemeBackground(widget) +#ifndef QT_NO_COMBOBOX + || qobject_cast(widget) +#endif //QT_NO_COMBOBOX +#ifndef QT_NO_MENU + || qobject_cast (widget) +#endif //QT_NO_MENU + ) { + QS60StylePrivate::SkinElements skinElement = QS60StylePrivate::SE_OptionsMenu; + QS60StylePrivate::drawSkinElement(skinElement, painter, option->rect, flags); } break; case PE_FrameWindow: @@ -2103,8 +2118,8 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti break; //disable frame in menu case PE_IndicatorBranch: - { #if defined(Q_WS_S60) + // 3.1 AVKON UI does not have tree view component, use common style for drawing there if (QSysInfo::s60Version() == QSysInfo::SV_S60_3_1) { #else if (true) { @@ -2146,7 +2161,6 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti QS60StylePrivate::drawSkinPart(skinPart, painter, iconRect, flags); } } - } break; // todo: items are below with #ifdefs "just in case". in final version, remove all non-required cases @@ -2179,9 +2193,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti } } -/*! - \reimp -*/ +/*! \reimp */ int QS60Style::pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const { int metricValue = QS60StylePrivate::pixelMetric(metric); @@ -2197,6 +2209,7 @@ int QS60Style::pixelMetric(PixelMetric metric, const QStyleOption *option, const } return metricValue; } + /*! \reimp */ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &csz, const QWidget *widget) const @@ -2219,22 +2232,19 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt, } return sz; } + /*! \reimp */ int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *widget, QStyleHintReturn *hret) const { int retValue = -1; switch (sh) { - case SH_Table_GridLineColor: { - QColor lineColor = QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnLineColors,2,0); - retValue = lineColor.rgb(); - } - break; - case SH_GroupBox_TextLabelColor: { - QColor groupBoxTxtColor = QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors,6,0); - retValue = groupBoxTxtColor.rgb(); - } - break; + case SH_Table_GridLineColor: + retValue = QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnLineColors,2,0).rgb(); + break; + case SH_GroupBox_TextLabelColor: + retValue = QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors,6,0).rgb(); + break; case SH_ScrollBar_ScrollWhenPointerLeavesControl: retValue = true; break; @@ -2260,10 +2270,7 @@ int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w return retValue; } - -/*! - \reimp -*/ +/*! \reimp */ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComplex *option, SubControl scontrol, const QWidget *widget) const { QRect ret; @@ -2298,35 +2305,33 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple scrollbarOption->upsideDown); switch (scontrol) { - case SC_ScrollBarSubLine: // top/left button - case SC_ScrollBarAddLine: // bottom/right button - break; - case SC_ScrollBarSubPage: // between top/left button and slider - if (isHorizontal) - ret.setRect(0, 0, sliderstart, scrollBarRect.height()); - else - ret.setRect(0, 0, scrollBarRect.width(), sliderstart); - break; - case SC_ScrollBarAddPage: // between bottom/right button and slider - { + case SC_ScrollBarSubPage: // between top/left button and slider + if (isHorizontal) + ret.setRect(0, 0, sliderstart, scrollBarRect.height()); + else + ret.setRect(0, 0, scrollBarRect.width(), sliderstart); + break; + case SC_ScrollBarAddPage: { // between bottom/right button and slider const int addPageLength = sliderstart + sliderlen; if (isHorizontal) ret = scrollBarRect.adjusted(addPageLength, 0, 0, 0); else ret = scrollBarRect.adjusted(0, addPageLength, 0, 0); - } - break; - case SC_ScrollBarGroove: - ret = scrollBarRect; - break; - case SC_ScrollBarSlider: - if (scrollbarOption->orientation == Qt::Horizontal) - ret.setRect(sliderstart, 0, sliderlen, scrollBarRect.height()); - else - ret.setRect(0, sliderstart, scrollBarRect.width(), sliderlen); - break; - default: - break; + } + break; + case SC_ScrollBarGroove: + ret = scrollBarRect; + break; + case SC_ScrollBarSlider: + if (scrollbarOption->orientation == Qt::Horizontal) + ret.setRect(sliderstart, 0, sliderlen, scrollBarRect.height()); + else + ret.setRect(0, sliderstart, scrollBarRect.width(), sliderlen); + break; + case SC_ScrollBarSubLine: // top/left button + case SC_ScrollBarAddLine: // bottom/right button + default: + break; } ret = visualRect(scrollbarOption->direction, scrollBarRect, ret); } @@ -2344,37 +2349,37 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple const int y = frameThickness + spinbox->rect.y(); const int x = spinbox->rect.x() + spinbox->rect.width() - frameThickness - 2*buttonSize.width(); - + switch (scontrol) { - case SC_SpinBoxUp: - if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons) - return QRect(); - ret = QRect(x, y, buttonWidth, buttonSize.height()); - break; - case SC_SpinBoxDown: - if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons) - return QRect(); - ret = QRect(x+buttonSize.width(), y, buttonWidth, buttonSize.height()); - break; - case SC_SpinBoxEditField: - if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons) - ret = QRect( - frameThickness, - frameThickness, - spinbox->rect.width() - 2*frameThickness, - spinbox->rect.height() - 2*frameThickness); - else - ret = QRect( - frameThickness, - frameThickness, - x - frameThickness, - spinbox->rect.height() - 2*frameThickness); - break; - case SC_SpinBoxFrame: - ret = spinbox->rect; - break; - default: - break; + case SC_SpinBoxUp: + if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons) + return QRect(); + ret = QRect(x, y, buttonWidth, buttonSize.height()); + break; + case SC_SpinBoxDown: + if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons) + return QRect(); + ret = QRect(x+buttonSize.width(), y, buttonWidth, buttonSize.height()); + break; + case SC_SpinBoxEditField: + if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons) + ret = QRect( + frameThickness, + frameThickness, + spinbox->rect.width() - 2*frameThickness, + spinbox->rect.height() - 2*frameThickness); + else + ret = QRect( + frameThickness, + frameThickness, + x - frameThickness, + spinbox->rect.height() - 2*frameThickness); + break; + case SC_SpinBoxFrame: + ret = spinbox->rect; + break; + default: + break; } ret = visualRect(spinbox->direction, spinbox->rect, ret); } @@ -2388,7 +2393,7 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple // lets use spinbox frame here as well, as no combobox specific value available. const int frameThickness = cmb->frame ? pixelMetric(PM_SpinBoxFrameWidth, cmb, widget) : 0; const int buttonWidth = QS60StylePrivate::pixelMetric(QStyle::PM_ButtonIconSize); - int xposMod = (cmb->rect.x()) + width - buttonMargin - buttonWidth; + const int xposMod = (cmb->rect.x()) + width - buttonMargin - buttonWidth; const int ypos = cmb->rect.y(); QSize buttonSize; @@ -2417,26 +2422,26 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast(option)) { ret = QCommonStyle::subControlRect(control, option, scontrol, widget); switch (scontrol) { - case SC_GroupBoxCheckBox: //fallthrough - case SC_GroupBoxLabel: { - //slightly indent text and boxes, so that dialog border does not mess with them. - const int horizontalSpacing = - QS60StylePrivate::pixelMetric(QStyle::PM_LayoutHorizontalSpacing); - ret.adjust(2,horizontalSpacing-3,0,0); - } - break; - case SC_GroupBoxFrame: { - const QRect textBox = subControlRect(control, option, SC_GroupBoxLabel, widget); - const int tbHeight = textBox.height(); - ret.translate(0, -ret.y()); - // include title to within the groupBox frame - ret.setHeight(ret.height()+tbHeight); - if (widget && ret.bottom() > widget->rect().bottom()) - ret.setBottom(widget->rect().bottom()); - } - break; - default: - break; + case SC_GroupBoxCheckBox: //fallthrough + case SC_GroupBoxLabel: { + //slightly indent text and boxes, so that dialog border does not mess with them. + const int horizontalSpacing = + QS60StylePrivate::pixelMetric(QStyle::PM_LayoutHorizontalSpacing); + ret.adjust(2,horizontalSpacing-3,0,0); + } + break; + case SC_GroupBoxFrame: { + const QRect textBox = subControlRect(control, option, SC_GroupBoxLabel, widget); + const int tbHeight = textBox.height(); + ret.translate(0, -ret.y()); + // include title to within the groupBox frame + ret.setHeight(ret.height()+tbHeight); + if (widget && ret.bottom() > widget->rect().bottom()) + ret.setBottom(widget->rect().bottom()); + } + break; + default: + break; } } break; @@ -2454,7 +2459,7 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con // in S60 the input text box doesn't start from line Edit's TL, but // a bit indented. QRect lineEditRect = opt->rect; - int adjustment = opt->rect.height()>>2; + const int adjustment = opt->rect.height()>>2; lineEditRect.adjust(adjustment,0,0,0); ret = lineEditRect; } @@ -2526,7 +2531,7 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con } } else if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast(opt)) { const bool checkable = menuItem->checkType != QStyleOptionMenuItem::NotCheckable; - int indicatorWidth = checkable ? + const int indicatorWidth = checkable ? pixelMetric(PM_ListViewIconSize, opt, widget) : pixelMetric(PM_SmallIconSize, opt, widget); ret = menuItem->rect; @@ -2546,11 +2551,10 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con // Make room for submenu indicator if (menuItem->menuItemType == QStyleOptionMenuItem::SubMenu){ // submenu indicator is very small, so lets halve the rect - indicatorWidth = indicatorWidth >> 1; if (menuItem->direction == Qt::LeftToRight) - ret.adjust(0,0,-indicatorWidth,0); + ret.adjust(0,0,-(indicatorWidth >> 1),0); else - ret.adjust(indicatorWidth,0,0,0); + ret.adjust((indicatorWidth >> 1),0,0,0); } } } @@ -2579,7 +2583,9 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con // Move rect and make it slightly smaller, so that // a) highlight border does not cross the rect // b) in s60 list checkbox is smaller than normal checkbox - ret.setRect(opt->rect.left()+3, opt->rect.top() + heightOffset, indicatorWidth-3, indicatorHeight-3); + //todo; magic three + ret.setRect(opt->rect.left()+3, opt->rect.top() + heightOffset, + indicatorWidth-3, indicatorHeight-3); } else { ret.setRect(opt->rect.right() - indicatorWidth - spacing, opt->rect.top() + heightOffset, indicatorWidth, indicatorHeight); @@ -2654,9 +2660,8 @@ void QS60Style::unpolish(QWidget *widget) #ifndef QT_NO_SCROLLBAR || qobject_cast(widget) #endif - ) { + ) widget->setAttribute(Qt::WA_OpaquePaintEvent); - } if (QS60StylePrivate::drawsOwnThemeBackground(widget)) { widget->setAttribute(Qt::WA_StyledBackground, false); @@ -2674,9 +2679,8 @@ void QS60Style::unpolish(QWidget *widget) widget->setAttribute(Qt::WA_StyledBackground, false); } - if (widget) { + if (widget) widget->setPalette(QPalette()); - } QCommonStyle::unpolish(widget); } @@ -2690,7 +2694,6 @@ void QS60Style::polish(QApplication *application) void QS60Style::unpolish(QApplication *application) { - Q_UNUSED(application) Q_D(QS60Style); const QPalette newPalette = QApplication::style()->standardPalette(); application->setPalette(newPalette); @@ -2717,7 +2720,9 @@ QIcon QS60Style::standardIconImplementation(StandardPixmap standardIcon, QS60StyleEnums::SkinParts part; QS60StylePrivate::SkinElementFlags adjustedFlags; if (option) - adjustedFlags = (option->state & State_Enabled) ? QS60StylePrivate::SF_StateEnabled : QS60StylePrivate::SF_StateDisabled; + adjustedFlags = (option->state & State_Enabled) ? + QS60StylePrivate::SF_StateEnabled : + QS60StylePrivate::SF_StateDisabled; switch(standardIcon) { case QStyle::SP_MessageBoxWarning: diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index 55e80b9..dbb98c5 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -77,8 +77,10 @@ enum TSupportRelease { ES60_3_1 = 0x0001, ES60_3_2 = 0x0002, ES60_5_0 = 0x0004, + ES60_5_1 = 0x0008, + ES60_5_2 = 0x0010, // Add all new releases here - ES60_AllReleases = ES60_3_1 | ES60_3_2 | ES60_5_0 + ES60_AllReleases = ES60_3_1 | ES60_3_2 | ES60_5_0 | ES60_5_1 | ES60_5_2 }; typedef struct { @@ -89,17 +91,6 @@ typedef struct { int newMinorSkinId; } partMapEntry; -enum TFallbackMbmFile { - EAvkonMbm = 0, - ELastMbm -}; - -typedef struct { - const QS60StyleEnums::SkinParts partID; - TFallbackMbmFile fallbackFileID; //to avoid putting large char strings to table, lets only have a mapping value - int fallbackGraphicID; -} fallbackMapEntry; - class QS60StyleModeSpecifics { public: @@ -644,7 +635,7 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL( Q_ASSERT(drawType != ENoDraw); const bool rotatedBy90or270 = (flags & (QS60StylePrivate::SF_PointEast | QS60StylePrivate::SF_PointWest)); - TSize targetSize = + const TSize targetSize = rotatedBy90or270 ? TSize(size.height(), size.width()) : qt_QSize2TSize(size); MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); @@ -719,7 +710,7 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL(QS60StylePrivate::SkinFra const bool rotatedBy90or270 = (flags & (QS60StylePrivate::SF_PointEast | QS60StylePrivate::SF_PointWest)); - TSize targetSize = + const TSize targetSize = rotatedBy90or270 ? TSize(size.height(), size.width()) : qt_QSize2TSize(size); MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); @@ -901,7 +892,7 @@ void QS60StyleModeSpecifics::checkAndUnCompressBitmapL(CFbsBitmap*& aOriginalBit QFont QS60StylePrivate::s60Font_specific( QS60StyleEnums::FontCategories fontCategory, int pointSize) { - enum TAknFontCategory aknFontCategory = EAknFontCategoryUndefined; + TAknFontCategory aknFontCategory = EAknFontCategoryUndefined; switch (fontCategory) { case QS60StyleEnums::FC_Primary: aknFontCategory = EAknFontCategoryPrimary; @@ -1176,8 +1167,8 @@ void QS60StyleModeSpecifics::unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap if (displayMode != aTrgBitmap->DisplayMode()) User::Leave(KErrArgument); - TSize trgSize = aTrgBitmap->SizeInPixels(); - TSize srcSize = aSrcBitmap->SizeInPixels(); + const TSize trgSize = aTrgBitmap->SizeInPixels(); + const TSize srcSize = aSrcBitmap->SizeInPixels(); // calculate the valid drawing area TRect drawRect = aTrgRect; @@ -1213,14 +1204,14 @@ void QS60StyleModeSpecifics::unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap const TInt drawWidth = drawRect.Width(); const TInt drawHeight = drawRect.Height(); - TRect offsetRect(aTrgRect.iTl, drawRect.iTl); + const TRect offsetRect(aTrgRect.iTl, drawRect.iTl); const TInt yPosOffset = ySkip * offsetRect.Height(); const TInt xPosOffset = xSkip * offsetRect.Width(); if ((displayMode == EGray256) || (displayMode == EColor256)) { - TInt srcScanLen8 = CFbsBitmap::ScanLineLength(srcSize.iWidth, + const TInt srcScanLen8 = CFbsBitmap::ScanLineLength(srcSize.iWidth, displayMode); - TInt trgScanLen8 = CFbsBitmap::ScanLineLength(trgSize.iWidth, + const TInt trgScanLen8 = CFbsBitmap::ScanLineLength(trgSize.iWidth, displayMode); TUint8* trgAddress8 = reinterpret_cast (trgAddress); @@ -1230,7 +1221,7 @@ void QS60StyleModeSpecifics::unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap trgAddress8 += trgScanLen8 * drawRect.iTl.iY + drawRect.iTl.iX; for (TInt y = 0; y < drawHeight; y++) { - TUint8* srcAddress8 = reinterpret_cast (srcAddress) + const TUint8* srcAddress8 = reinterpret_cast (srcAddress) + (srcScanLen8 * (yPos >> 8)); TInt xPos = xPosOffset; @@ -1244,9 +1235,9 @@ void QS60StyleModeSpecifics::unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap trgAddress8 += trgScanLen8 - drawWidth; } } else if (displayMode == EColor4K || displayMode == EColor64K) { - TInt srcScanLen16 = CFbsBitmap::ScanLineLength(srcSize.iWidth, + const TInt srcScanLen16 = CFbsBitmap::ScanLineLength(srcSize.iWidth, displayMode) >>1; - TInt trgScanLen16 = CFbsBitmap::ScanLineLength(trgSize.iWidth, + const TInt trgScanLen16 = CFbsBitmap::ScanLineLength(trgSize.iWidth, displayMode) >>1; TUint16* trgAddress16 = reinterpret_cast (trgAddress); @@ -1256,7 +1247,7 @@ void QS60StyleModeSpecifics::unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap trgAddress16 += trgScanLen16 * drawRect.iTl.iY + drawRect.iTl.iX; for (TInt y = 0; y < drawHeight; y++) { - TUint16* srcAddress16 = reinterpret_cast (srcAddress) + const TUint16* srcAddress16 = reinterpret_cast (srcAddress) + (srcScanLen16 * (yPos >> 8)); TInt xPos = xPosOffset; @@ -1270,9 +1261,9 @@ void QS60StyleModeSpecifics::unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap trgAddress16 += trgScanLen16 - drawWidth; } } else if (displayMode == EColor16MU || displayMode == EColor16MA) { - TInt srcScanLen32 = CFbsBitmap::ScanLineLength(srcSize.iWidth, + const TInt srcScanLen32 = CFbsBitmap::ScanLineLength(srcSize.iWidth, displayMode) >>2; - TInt trgScanLen32 = CFbsBitmap::ScanLineLength(trgSize.iWidth, + const TInt trgScanLen32 = CFbsBitmap::ScanLineLength(trgSize.iWidth, displayMode) >>2; TUint32* trgAddress32 = reinterpret_cast (trgAddress); @@ -1282,7 +1273,7 @@ void QS60StyleModeSpecifics::unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap trgAddress32 += trgScanLen32 * drawRect.iTl.iY + drawRect.iTl.iX; for (TInt y = 0; y < drawHeight; y++) { - TUint32* srcAddress32 = reinterpret_cast (srcAddress) + const TUint32* srcAddress32 = reinterpret_cast (srcAddress) + (srcScanLen32 * (yPos >> 8)); TInt xPos = xPosOffset; @@ -1302,8 +1293,8 @@ void QS60StyleModeSpecifics::unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap QSize QS60StylePrivate::screenSize() { - TSize mySize = QS60Data::screenDevice()->SizeInPixels(); - return QSize(mySize.iWidth, mySize.iHeight); + const TSize screenSize = QS60Data::screenDevice()->SizeInPixels(); + return QSize(screenSize.iWidth, screenSize.iHeight); } void QS60StyleModeSpecifics::colorGroupAndIndex( -- cgit v0.12 From d53a3282598b7bfa5c48627ffa0b04763cccfdf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Thu, 4 Jun 2009 12:19:03 +0300 Subject: S60Style: Missing constant --- src/gui/styles/qs60style.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 7db0992..e7ba1bb 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -146,6 +146,7 @@ static const int frameElementsCount = int(sizeof(QS60StylePrivate::m_frameElementsData)/sizeof(QS60StylePrivate::m_frameElementsData[0])); const int KNotFound = -909; +const double KTabFontMul = 0.72; QS60StylePrivate::~QS60StylePrivate() { -- cgit v0.12 From c4773c1b2372ac9119244c5af6d0f0dae3e8f685 Mon Sep 17 00:00:00 2001 From: Thomas Sondergaard Date: Thu, 4 Jun 2009 13:06:31 +0200 Subject: Don't use inactivatable timers to calculate time to wait for next timer. This patch prevents the eventloop from waking up needlessly. Without this patch the event loop will not sleep at all if a 0-timer is already 'inTimerEvent' Merge-request: 550 Reviewed-by: Olivier Goffart --- src/corelib/kernel/qeventdispatcher_unix.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp index 6aa3b56..f7293d4 100644 --- a/src/corelib/kernel/qeventdispatcher_unix.cpp +++ b/src/corelib/kernel/qeventdispatcher_unix.cpp @@ -420,10 +420,18 @@ bool QTimerInfoList::timerWait(timeval &tm) timeval currentTime = updateCurrentTime(); repairTimersIfNeeded(); - if (isEmpty()) - return false; + // Find first waiting timer not already active + QTimerInfo *t = 0; + for (QTimerInfoList::const_iterator it = constBegin(); it != constEnd(); ++it) { + if (!(*it)->inTimerEvent) { + t = *it; + break; + } + } + + if (!t) + return false; - QTimerInfo *t = first(); // first waiting timer if (currentTime < t->timeout) { // time to wait tm = t->timeout - currentTime; -- cgit v0.12 From 422905e301394dfd23b59a09ac9a725803ddf4e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Thu, 4 Jun 2009 14:41:07 +0300 Subject: S60Style: Buildbreak fix. Remove problematic #ifdef line. --- src/gui/styles/qs60style.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index e7ba1bb..83f5a6b 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2012,7 +2012,6 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti #endif //QT_NO_SPINBOX case PE_FrameFocusRect: // Calendar widget and combox both do not use styled itemDelegate -#if not defined (QT_NO_CALENDARWIDGET) && not defined (QT_NO_COMBOBOX) if (!(widget && qobject_cast(widget->parent())) || qobject_cast(widget)) { // no focus selection for touch @@ -2041,7 +2040,6 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti painter->restore(); } } -#endif //!QT_NO_CALENDARWIDGET && !QT_NO_COMBOBOX break; case PE_Widget: if (QS60StylePrivate::drawsOwnThemeBackground(widget) -- cgit v0.12 From 5ad68ce1cb5e80fa14e549f087e957030ef4baf0 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 4 Jun 2009 14:30:20 +0200 Subject: Add my changelog for 4.5.2 --- dist/changes-4.5.2 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index a54d8ba..4246a6b 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -46,6 +46,10 @@ Third party components Plugins (r41346, r43550, r43915, r43917, r43923) Clipboard (r41360) +- QtDBus + * [236955] Fixed an issue that would cause QtDBus to crash when + relaying a signal emitted from a class under certain conditions + - QAbstractItemView * [250754] Changing the font of the view would not update the size of the items if there is an application stylesheet. @@ -80,6 +84,10 @@ Third party components * [251467] do not allow cookies for domains like ".com" * [228974] allow cookies whose domain attribute is missing a leading dot +- QNetworkAccessManager + * [248838] Make QNetworkAccessManager reject invalid HTTP input + earlier + - QWidget * [250668] Don't send extra wheel events when using the scroll wheel in Cocoa. * [253448] Prevent a crash when using the Qt::WA_MacBrushedMetal attribute @@ -166,6 +174,7 @@ legacy freetype headers. [250326] Titlebar wasn't shown on X11 with Qt::CustomizeWindowHint for fixed-size windows. [251925] Improved showing QMessageBox on small screens. +[252042] Fixed the loading of the OpenSSL libraries on OpenBSD. Qt for Windows -------------- -- cgit v0.12 From f0f7da04358c82bb80c6670ca336ebd2154163a6 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 4 Jun 2009 14:30:51 +0200 Subject: Remove a Q_ASSERT that could be triggered under some conditions. Whenever an argument failed to marshall, this assert would be triggered. It's technically an error in the application, but it's hard to track it down. So remove it and let the execution continue (the function returns false indicating failure already and there's a warning from the marshalling code itself) Reviewed-by: TrustMe --- src/dbus/qdbusmessage.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/dbus/qdbusmessage.cpp b/src/dbus/qdbusmessage.cpp index 19f0b04..96dcd3b 100644 --- a/src/dbus/qdbusmessage.cpp +++ b/src/dbus/qdbusmessage.cpp @@ -161,7 +161,6 @@ DBusMessage *QDBusMessagePrivate::toDBusMessage(const QDBusMessage &message) // not ok; q_dbus_message_unref(msg); - Q_ASSERT(false); return 0; } -- cgit v0.12 From 80b63705a64a2029800805e1fefe350543b15a70 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 4 Jun 2009 14:35:10 +0200 Subject: Autotest: add some tests for sending (or failing to) invalid D-Bus calls Reviewed-by: TrustMe --- tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp b/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp index ad1a1b8..58bfabc 100644 --- a/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp +++ b/tests/auto/qdbusmarshall/tst_qdbusmarshall.cpp @@ -84,6 +84,8 @@ private slots: void sendArgument_data(); void sendArgument(); + void sendErrors(); + private: QProcess proc; }; @@ -782,5 +784,28 @@ void tst_QDBusMarshall::sendArgument() QCOMPARE(extracted, value); } +void tst_QDBusMarshall::sendErrors() +{ + QDBusConnection con = QDBusConnection::sessionBus(); + + QVERIFY(con.isConnected()); + QDBusMessage msg = QDBusMessage::createSignal("/foo", "local.interfaceName", + "signalName"); + msg << qVariantFromValue(QDBusObjectPath()); + + QTest::ignoreMessage(QtWarningMsg, "QDBusConnection: error: could not send signal path \"/foo\" interface \"local.interfaceName\" member \"signalName\""); + QVERIFY(!con.send(msg)); + + msg.setArguments(QVariantList()); + QDBusObjectPath path; + + QTest::ignoreMessage(QtWarningMsg, "QDBusObjectPath: invalid path \"abc\""); + path.setPath("abc"); + msg << qVariantFromValue(path); + + QTest::ignoreMessage(QtWarningMsg, "QDBusConnection: error: could not send signal path \"/foo\" interface \"local.interfaceName\" member \"signalName\""); + QVERIFY(!con.send(msg)); +} + QTEST_MAIN(tst_QDBusMarshall) #include "tst_qdbusmarshall.moc" -- cgit v0.12 From 398c022e8adefc6e71a6048da40c19f6169be831 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 4 Jun 2009 15:22:13 +0200 Subject: my public task ... --- dist/changes-4.5.2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 4246a6b..04a29ba 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -77,6 +77,9 @@ Third party components - QFontDialog * [252000] Ensure that QFontDialog::getFont() works on Mac OS X. +- QLocalSocket + * [247144] correctly handle remote disconnects + - QNetworkCookie * [251959] fix parsing of multiple cookies separated by a newline -- cgit v0.12 From da7b5677262254aada234ac2c71d54d8fee3c711 Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Thu, 4 Jun 2009 15:49:06 +0200 Subject: Implement a dummy QColorMap for Symbian. It seems that this class has been completely forgotten until now, but this never causes any problems because apparently no one uses it. Provide a quick little implementation to get things linking. Implementation brought to you courtesy of Qt/Mac. --- src/gui/painting/painting.pri | 3 +- src/gui/painting/qcolormap_s60.cpp | 112 +++++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 src/gui/painting/qcolormap_s60.cpp diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri index 33d53e4..693e506 100644 --- a/src/gui/painting/painting.pri +++ b/src/gui/painting/painting.pri @@ -190,7 +190,8 @@ embedded { symbian { SOURCES += \ painting/qpaintdevice_s60.cpp \ - painting/qregion_s60.cpp + painting/qregion_s60.cpp \ + painting/qcolormap_s60.cpp } x11|embedded { diff --git a/src/gui/painting/qcolormap_s60.cpp b/src/gui/painting/qcolormap_s60.cpp new file mode 100644 index 0000000..c21eba9 --- /dev/null +++ b/src/gui/painting/qcolormap_s60.cpp @@ -0,0 +1,112 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qcolormap.h" +#include "qcolor.h" + +QT_BEGIN_NAMESPACE + +class QColormapPrivate +{ +public: + inline QColormapPrivate() + : ref(1) + { } + + QAtomicInt ref; +}; +static QColormap *qt_symbian_color_map = 0; + +void QColormap::initialize() +{ + qt_symbian_color_map = new QColormap; +} + +void QColormap::cleanup() +{ + delete qt_symbian_color_map; + qt_symbian_color_map = 0; +} + +QColormap QColormap::instance(int) +{ + return *qt_symbian_color_map; +} + +QColormap::QColormap() : d(new QColormapPrivate) +{} + +QColormap::QColormap(const QColormap &colormap) :d (colormap.d) +{ d->ref.ref(); } + +QColormap::~QColormap() +{ + if (!d->ref.deref()) + delete d; +} + +QColormap::Mode QColormap::mode() const +{ return QColormap::Direct; } + +int QColormap::depth() const +{ + return 32; +} + +int QColormap::size() const +{ + return -1; +} + +uint QColormap::pixel(const QColor &color) const +{ return color.rgba(); } + +const QColor QColormap::colorAt(uint pixel) const +{ return QColor(pixel); } + +const QVector QColormap::colormap() const +{ return QVector(); } + +QColormap &QColormap::operator=(const QColormap &colormap) +{ qAtomicAssign(d, colormap.d); return *this; } + +QT_END_NAMESPACE + -- cgit v0.12 From 2b6dda723b168b3379684bc89b128ea1e792eddf Mon Sep 17 00:00:00 2001 From: Iain Date: Thu, 4 Jun 2009 17:18:59 +0200 Subject: Correctly scope local variables in switch statement (for GCC 4.3) --- src/corelib/tools/qlocale_symbian.cpp | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/corelib/tools/qlocale_symbian.cpp b/src/corelib/tools/qlocale_symbian.cpp index b58a5d5..c11a7b9 100644 --- a/src/corelib/tools/qlocale_symbian.cpp +++ b/src/corelib/tools/qlocale_symbian.cpp @@ -272,11 +272,14 @@ static QString s60ToQtFormat(const QString &sys_fmt) switch (c.unicode()) { case 'F': + { // locale indep mode on locale_indep_ordering = true; break; + } case '/': + { // date sep 0-3 ++i; if (i >= sys_fmt.size()) @@ -291,8 +294,10 @@ static QString s60ToQtFormat(const QString &sys_fmt) result += QChar(val); } break; + } case 'D': + { if (!locale_indep_ordering) break; @@ -302,8 +307,10 @@ static QString s60ToQtFormat(const QString &sys_fmt) result += QLatin1Char('d'); break; + } case 'M': + { if (!locale_indep_ordering) break; @@ -320,8 +327,10 @@ static QString s60ToQtFormat(const QString &sys_fmt) } break; + } case 'N': + { n_mode = true; if (!locale_indep_ordering) @@ -333,8 +342,10 @@ static QString s60ToQtFormat(const QString &sys_fmt) result += QLatin1String("MMM"); break; + } case 'Y': + { if (!locale_indep_ordering) break; @@ -344,16 +355,20 @@ static QString s60ToQtFormat(const QString &sys_fmt) result += QLatin1String("yy"); break; + } case 'E': + { if (!abbrev_next) result += QLatin1String("dddd"); else result += QLatin1String("ddd"); break; + } case ':': + { // timesep 0-3 ++i; if (i >= sys_fmt.size()) @@ -369,47 +384,60 @@ static QString s60ToQtFormat(const QString &sys_fmt) } break; + } case 'J': + { if (tf == ETime24 && !abbrev_next) result += QLatin1String("hh"); else result += QLatin1Char('h'); break; + } case 'H': + { if (!abbrev_next) result += QLatin1String("hh"); else result += QLatin1Char('h'); break; + } case 'I': + { result += QLatin1Char('h'); break; + } case 'T': + { if (!abbrev_next) result += QLatin1String("mm"); else result += QLatin1Char('m'); break; + } case 'S': + { if (!abbrev_next) result += QLatin1String("ss"); else result += QLatin1Char('s'); break; + } case 'B': + { // only done for 12h clock if (tf == ETime24) break; + } // fallthru to A case 'A': { @@ -445,6 +473,7 @@ static QString s60ToQtFormat(const QString &sys_fmt) break; case 'C': + { // six digits in s60, three digits in qt if (!abbrev_next) { result += QLatin1String("zzz"); @@ -468,6 +497,7 @@ static QString s60ToQtFormat(const QString &sys_fmt) } } break; + } // these cases fallthru case '1': @@ -475,6 +505,7 @@ static QString s60ToQtFormat(const QString &sys_fmt) case '3': case '4': case '5': + { // shouldn't parse these with %F if (locale_indep_ordering) @@ -503,17 +534,24 @@ static QString s60ToQtFormat(const QString &sys_fmt) result += QLatin1String(locale_dep[offset + (c.digitValue()-1)]); break; + } case '%': // fallthru percent + { // any junk gets copied as is + } default: + { result += c; break; + } case 'Z': // Qt doesn't support these :( case 'X': case 'W': + { break; + } } } else { // double any single quotes, don't begin escape -- cgit v0.12 From f7338759ef86deba18b27ee72b3afcf40f3a5aaf Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Thu, 4 Jun 2009 09:07:38 -0700 Subject: Make sure to retain alpha information in copy We need to set alpha to the right value when copying pixmaps. Reviewed-by: Donald --- src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index dba1b51..18754f5 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -202,11 +202,12 @@ void QDirectFBPixmapData::copy(const QPixmapData *data, const QRect &rect) } IDirectFBSurface *src = static_cast(data)->directFBSurface(); - const bool hasAlpha = data->hasAlphaChannel(); - format = (hasAlpha + alpha = data->hasAlphaChannel(); + format = (alpha ? QDirectFBScreen::instance()->alphaPixmapFormat() : QDirectFBScreen::instance()->pixelFormat()); + dfbSurface = screen->createDFBSurface(rect.size(), format, QDirectFBScreen::TrackSurface); if (!dfbSurface) { @@ -215,7 +216,7 @@ void QDirectFBPixmapData::copy(const QPixmapData *data, const QRect &rect) return; } - if (hasAlpha) { + if (alpha) { dfbSurface->Clear(dfbSurface, 0, 0, 0, 0); dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_BLEND_ALPHACHANNEL); } else { -- cgit v0.12 From 7b9b55e3a0deb69a6ff04ee9b76840a5f8d11545 Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Thu, 4 Jun 2009 18:31:49 +0200 Subject: Fix up the display mode conversion function. Few things here: - Add support for EGray2 and EGray256 - Change the define to disable EColor16MAP for old SDKs - Make the default case return Invalid instead of a fatal error - Fix indentation, tabs -> spaces --- src/gui/kernel/qt_s60_p.h | 65 +++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index aed8241..d2fa5da 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -242,37 +242,40 @@ static inline QFont qt_TFontSpec2QFontL(const TFontSpec &fontSpec) static inline QImage::Format qt_TDisplayMode2Format(TDisplayMode mode) { - QImage::Format format; - switch(mode) { - case EColor256: - // TODO: is the correct? - format = QImage::Format_Indexed8; - break; - case EColor4K: - format = QImage::Format_RGB444; - break; - case EColor64K: - format = QImage::Format_RGB16; - break; - case EColor16M: - format = QImage::Format_RGB666; - break; - case EColor16MU: - format = QImage::Format_RGB32; - break; - case EColor16MA: - format = QImage::Format_ARGB32; - break; -#ifdef __S60_50__ - case EColor16MAP: - format = QImage::Format_ARGB32_Premultiplied; - break; -#endif - default: - qFatal("Screen format not supported"); - break; - } - return format; + QImage::Format format; + switch(mode) { + case EGray2: + format = QImage::Format_MonoLSB; + break; + case EColor256: + case EGray256: + format = QImage::Format_Indexed8; + break; + case EColor4K: + format = QImage::Format_RGB444; + break; + case EColor64K: + format = QImage::Format_RGB16; + break; + case EColor16M: + format = QImage::Format_RGB666; + break; + case EColor16MU: + format = QImage::Format_RGB32; + break; + case EColor16MA: + format = QImage::Format_ARGB32; + break; +#if !defined(__SERIES60_31__) && !defined(__S60_32__) + case EColor16MAP: + format = QImage::Format_ARGB32_Premultiplied; + break; +#endif + default: + format = QImage::Format_Invalid; + break; + } + return format; } -- cgit v0.12 From 9196781f93fd60e869fededc83e32168868632cb Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Thu, 4 Jun 2009 23:26:40 +0200 Subject: Loading fonts from other /resource/fonts folders than the one on Z: Order is 'soft to hard' W:, X: ... A:, Z: Duplicated font file names are ignored. That should imitate the font loading behaviour in the fbSrv. --- src/gui/text/qfontdatabase_s60.cpp | 44 ++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp index ab9291f..416c3d1 100644 --- a/src/gui/text/qfontdatabase_s60.cpp +++ b/src/gui/text/qfontdatabase_s60.cpp @@ -55,6 +55,39 @@ QT_BEGIN_NAMESPACE +QFileInfoList alternativeFilePaths(const QString &path, const QStringList &nameFilters, + QDir::Filters filters = QDir::NoFilter, QDir::SortFlags sort = QDir::NoSort, + bool uniqueFileNames = true) +{ + QFileInfoList result; + + // Prepare a 'soft to hard' drive list: W:, X: ... A:, Z: + QStringList driveStrings; + foreach (const QFileInfo &drive, QDir::drives()) + driveStrings.append(drive.absolutePath()); + driveStrings.sort(); + const QString zDriveString("Z:/"); + driveStrings.removeAll(zDriveString); + driveStrings.prepend(zDriveString); + + QStringList uniqueFileNameList; + for (int i = driveStrings.count() - 1; i >= 0; --i) { + const QDir dirOnDrive(driveStrings.at(i) + path); + const QFileInfoList entriesOnDrive = dirOnDrive.entryInfoList(nameFilters, filters, sort); + if (uniqueFileNames) { + foreach(const QFileInfo &entry, entriesOnDrive) { + if (!uniqueFileNameList.contains(entry.fileName())) { + uniqueFileNameList.append(entry.fileName()); + result.append(entry); + } + } + } else { + result.append(entriesOnDrive); + } + } + return result; +} + #if defined(QT_NO_FREETYPE) class QFontDatabaseS60StoreImplementation : public QFontDatabaseS60Store { @@ -77,10 +110,13 @@ QFontDatabaseS60StoreImplementation::QFontDatabaseS60StoreImplementation() m_store = CFontStore::NewL(m_heap); m_rasterizer = COpenFontRasterizer::NewL(TUid::Uid(0x101F7F5E)); m_store->InstallRasterizerL(m_rasterizer); - QDir dir(QDesktopServices::storageLocation(QDesktopServices::FontsLocation)); - dir.setNameFilters(QStringList() << QLatin1String("*.ttf") << QLatin1String("*.ccc")); - for (int i = 0; i < int(dir.count()); ++i) { - const QString fontFile = QDir::toNativeSeparators(dir.absoluteFilePath(dir[i])); + + QStringList filters; + filters.append(QString::fromLatin1("*.ttf")); + filters.append(QString::fromLatin1("*.ccc")); + const QFileInfoList fontFiles = alternativeFilePaths(QString::fromLatin1("resource\\Fonts"), filters); + foreach (const QFileInfo &fontFileInfo, fontFiles) { + const QString fontFile = QDir::toNativeSeparators(fontFileInfo.absoluteFilePath()); m_store->AddFileL(qt_QString2TPtrC(fontFile)); } } -- cgit v0.12 From 958b66dd60aac48909a5ba32282e088e68d9a9c7 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 5 Jun 2009 11:05:01 +1000 Subject: Set UID for QtScriptTools --- src/scripttools/scripttools.pro | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/scripttools/scripttools.pro b/src/scripttools/scripttools.pro index faf0936a..5878db2 100644 --- a/src/scripttools/scripttools.pro +++ b/src/scripttools/scripttools.pro @@ -10,3 +10,5 @@ unix:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui QtScript include(../qbase.pri) include(debugging/debugging.pri) + +symbian:TARGET.UID3=0x2001E625 -- cgit v0.12 From 04b4e2254e59fcb8776044d5d627e7f0d8daeacf Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 5 Jun 2009 10:14:12 +0200 Subject: Turned off input methods on X11 when using certain hints. If any of those hints are present, complex input is not possible, so input methods should be turned off on X11. --- src/gui/inputmethod/qximinputcontext_x11.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/inputmethod/qximinputcontext_x11.cpp b/src/gui/inputmethod/qximinputcontext_x11.cpp index c320fb4..60ea15b 100644 --- a/src/gui/inputmethod/qximinputcontext_x11.cpp +++ b/src/gui/inputmethod/qximinputcontext_x11.cpp @@ -610,7 +610,7 @@ void QXIMInputContext::setFocusWidget(QWidget *w) QInputContext::setFocusWidget(w); - if (!w) + if (!w || w->inputMethodHints() & Qt::ImhExclusiveInputMask) return; ICData *data = ximData.value(w->effectiveWinId()); -- cgit v0.12 From fd6e80b7cc36ebc111d062301ba8bfca5e6e6f50 Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Thu, 4 Jun 2009 18:41:47 +0200 Subject: Introduce Symbian CFbsBitmap <-> QPixmap conversion functions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduce functions for converting to and from a CFbsBitmap on Symbian. Currently these functions unfortunately have to copy the data to the internal QImage stored in the raster pixmap data backend :( Hopefully we can improve this with a native Symbian pixmap backend in the future. The autotest generates both small and large CFbsBitmaps of different formats and then verifies that the color makes it into the QPixmap. Currently the indexed image formats don't seem to work, but this is most likely because we don't set a palette for them. The semi-trans bitmaps seem to work fine (verified visually), but the current QCOMPARE doesn't consider the fact that the color was alpha blended. Reviewed-by: Sami Merilä --- src/gui/image/qpixmap.h | 9 +++ src/gui/image/qpixmap_s60.cpp | 140 +++++++++++++++++++++++++++++++++++-- tests/auto/qpixmap/qpixmap.pro | 19 ++--- tests/auto/qpixmap/tst_qpixmap.cpp | 101 ++++++++++++++++++++++++++ 4 files changed, 251 insertions(+), 18 deletions(-) diff --git a/src/gui/image/qpixmap.h b/src/gui/image/qpixmap.h index 1863273..9ef5347 100644 --- a/src/gui/image/qpixmap.h +++ b/src/gui/image/qpixmap.h @@ -62,6 +62,10 @@ class QX11Info; class QPixmapData; +#if defined(Q_OS_SYMBIAN) +class CFbsBitmap; +#endif + class Q_GUI_EXPORT QPixmap : public QPaintDevice { public: @@ -152,6 +156,11 @@ public: static QPixmap fromMacCGImageRef(CGImageRef image); #endif +#if defined(Q_OS_SYMBIAN) + CFbsBitmap *toSymbianCFbsBitmap() const; + static QPixmap fromSymbianCFbsBitmap(CFbsBitmap *bitmap); +#endif + inline QPixmap copy(int x, int y, int width, int height) const; QPixmap copy(const QRect &rect = QRect()) const; diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp index 52e2fe7..879c980 100644 --- a/src/gui/image/qpixmap_s60.cpp +++ b/src/gui/image/qpixmap_s60.cpp @@ -91,14 +91,142 @@ QPixmap QPixmap::grabWindow(WId winId, int x, int y, int w, int h ) return QPixmap(); } - QImage::Format format = qt_TDisplayMode2Format( displayMode ); - int bytesPerLine = CFbsBitmap::ScanLineLength(temporary->SizeInPixels().iWidth,displayMode); - temporary->LockHeap(); - QImage image = QImage((uchar*)temporary->DataAddress(), srcRect.Width(), srcRect.Height(), bytesPerLine, format); - QPixmap pixmap = QPixmap::fromImage(image.copy()); - temporary->UnlockHeap(); + QPixmap pixmap = QPixmap::fromSymbianCFbsBitmap(temporary); CBase::Delete(temporary); return pixmap; +} + +/*! +\since 4.6 + +Returns a \c CFbsBitmap that is equivalent to the QPixmap by copying the data. + +It is the caller's responsibility to delete the \c CFbsBitmap after use. + +\warning This function is only available on Symbian OS. + +\sa fromSymbianCFbsBitmap() +*/ + +CFbsBitmap *QPixmap::toSymbianCFbsBitmap() const +{ + if (isNull()) + return 0; + + TDisplayMode mode; + const QImage img = toImage(); + QImage::Format destFormat = img.format(); + switch (img.format()) { + case QImage::Format_Mono: + destFormat = QImage::Format_MonoLSB; + // Fall through intended + case QImage::Format_MonoLSB: + mode = EGray2; + break; + case QImage::Format_Indexed8: + if (img.isGrayscale()) + mode = EGray256; + else + mode = EColor256; + break; + case QImage::Format_RGB32: + mode = EColor16MU; + break; + case QImage::Format_ARGB6666_Premultiplied: + case QImage::Format_ARGB8565_Premultiplied: + case QImage::Format_ARGB8555_Premultiplied: + destFormat = QImage::Format_ARGB32_Premultiplied; + // Fall through intended + case QImage::Format_ARGB32_Premultiplied: +#if !defined(__SERIES60_31__) && !defined(__S60_32__) + // ### TODO: Add runtime detection as well? + mode = EColor16MAP: + break; +#endif + destFormat = QImage::Format_ARGB32; + // Fall through intended + case QImage::Format_ARGB32: + mode = EColor16MA; + break; + case QImage::Format_RGB555: + destFormat = QImage::Format_RGB16; + // Fall through intended + case QImage::Format_RGB16: + mode = EColor64K; + break; + case QImage::Format_RGB666: + destFormat = QImage::Format_RGB888; + // Fall through intended + case QImage::Format_RGB888: + mode = EColor16M; + break; + case QImage::Format_RGB444: + mode = EColor4K; + break; + case QImage::Format_Invalid: + return 0; + default: + qWarning("Image format not supported: %d", img.format()); + return 0; + } + + CFbsBitmap* bitmap = new (ELeave) CFbsBitmap(); + TSize size(width(), height()); + if (bitmap->Create(size, mode) != KErrNone) { + CBase::Delete(bitmap); + return 0; + } + + const QImage converted = img.convertToFormat(destFormat); + bitmap->LockHeap(); + const uchar *sptr = converted.bits(); + uchar *dptr = (uchar*)bitmap->DataAddress(); + Mem::Copy(dptr, sptr, converted.numBytes()); + bitmap->UnlockHeap(); + return bitmap; } + +/*! +\since 4.6 + +Returns a QPixmap that is equivalent to the \c CFbsBitmap by copying the data. +If the CFbsBitmap is not valid or is compressed in memory, this function will +return a null QPixmap. + +\warning This function is only available on Symbian OS. + +\sa toSymbianCFbsBitmap(), {QPixmap#Pixmap Conversion}{Pixmap Conversion} +*/ + +QPixmap QPixmap::fromSymbianCFbsBitmap(CFbsBitmap *bitmap) +{ + int width = bitmap->SizeInPixels().iWidth; + int height = bitmap->SizeInPixels().iHeight; + + if (!bitmap || width <= 0 || height <= 0 || bitmap->IsCompressedInRAM()) + return QPixmap(); + + TDisplayMode displayMode = bitmap->DisplayMode(); + QImage::Format format = qt_TDisplayMode2Format(displayMode); + int bytesPerLine = CFbsBitmap::ScanLineLength(width, displayMode); + bitmap->LockHeap(); + QImage image = QImage((const uchar*)bitmap->DataAddress(), width, height, bytesPerLine, format); + if (displayMode == EGray2) { + image.setNumColors(2); + image.setColor(0, QColor(Qt::color0).rgba()); + image.setColor(1, QColor(Qt::color1).rgba()); + } else if (displayMode == EGray256) { + for (int i=0; i < 256; ++i) + image.setColor(i, qRgb(i, i, i)); + }else if (displayMode == EColor256) { + const TColor256Util *palette = TColor256Util::Default(); + for (int i=0; i < 256; ++i) + image.setColor(i, (QRgb)(palette->Color256(i).Value())); + } + QPixmap pixmap = QPixmap::fromImage(image.copy()); + bitmap->UnlockHeap(); + return pixmap; +} + QT_END_NAMESPACE diff --git a/tests/auto/qpixmap/qpixmap.pro b/tests/auto/qpixmap/qpixmap.pro index aa767aa..c992f6e 100644 --- a/tests/auto/qpixmap/qpixmap.pro +++ b/tests/auto/qpixmap/qpixmap.pro @@ -1,26 +1,21 @@ load(qttest_p4) SOURCES += tst_qpixmap.cpp contains(QT_CONFIG, qt3support): QT += qt3support -wince*: { +wince*|symbian*: { task31722_0.sources = convertFromImage/task31722_0/* task31722_0.path = convertFromImage/task31722_0 task31722_1.sources = convertFromImage/task31722_1/* task31722_1.path = convertFromImage/task31722_1 DEPLOYMENT += task31722_0 task31722_1 - DEFINES += SRCDIR=\\\".\\\" } -symbian*:{ - task31722_0.sources = convertFromImage/task31722_0/* - task31722_0.path = convertFromImage/task31722_0 - task31722_1.sources = convertFromImage/task31722_1/* - task31722_1.path = convertFromImage/task31722_1 - DEPLOYMENT += task31722_0 task31722_1 + +wince*: { + DEFINES += SRCDIR=\\\".\\\" +} symbian*: { DEPLOYMENT_PLUGIN += qmng -} -else { + LIBS += -lfbscli.lib -lbitgdi.lib -lgdi.lib +} else { DEFINES += SRCDIR=\\\"$$PWD\\\" win32:LIBS += -lgdi32 -luser32 } - - diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp index 493333b..9f73e34 100644 --- a/tests/auto/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/qpixmap/tst_qpixmap.cpp @@ -58,6 +58,14 @@ #include #endif +#ifdef Q_OS_SYMBIAN +#include +#include +#include +#include +#endif + + //TESTED_CLASS= //TESTED_FILES= #if defined(Q_OS_SYMBIAN) @@ -120,6 +128,11 @@ private slots: void fromWinHBITMAP(); #endif +#if defined(Q_WS_S60) + void fromSymbianCFbsBitmap_data(); + void fromSymbianCFbsBitmap(); +#endif + void onlyNullPixmapsOutsideGuiThread(); void refUnref(); @@ -798,6 +811,94 @@ void tst_QPixmap::fromWinHBITMAP() #endif +#if defined(Q_WS_S60) +Q_DECLARE_METATYPE(TDisplayMode) + +void tst_QPixmap::fromSymbianCFbsBitmap_data() +{ + QTest::addColumn("format"); + QTest::addColumn("width"); + QTest::addColumn("height"); + QTest::addColumn("color"); + + const int smallWidth = 20; + const int smallHeight = 20; + const int largeWidth = 240; + const int largeHeight = 320; + + // Indexed Color Formats - Disabled since images seem to be blank -> no palette? +// QTest::newRow("EGray2 small") << EGray2 << smallWidth << smallHeight << QColor(Qt::black); +// QTest::newRow("EGray2 big") << EGray2 << largeWidth << largeHeight << QColor(Qt::black); +// QTest::newRow("EGray256 small") << EGray256 << smallWidth << smallHeight << QColor(Qt::blue); +// QTest::newRow("EGray256 big") << EGray256 << largeWidth << largeHeight << QColor(Qt::blue); +// QTest::newRow("EColor256 small") << EColor256 << smallWidth << smallHeight << QColor(Qt::red); +// QTest::newRow("EColor256 big") << EColor256 << largeWidth << largeHeight << QColor(Qt::red); + + // Direct Color Formats + QTest::newRow("EColor4K small") << EColor4K << smallWidth << smallHeight << QColor(Qt::red); + QTest::newRow("EColor4K big") << EColor4K << largeWidth << largeHeight << QColor(Qt::red); + QTest::newRow("EColor64K small") << EColor64K << smallWidth << smallHeight << QColor(Qt::green); + QTest::newRow("EColor64K big") << EColor64K << largeWidth << largeHeight << QColor(Qt::green); + QTest::newRow("EColor16MU small") << EColor16MU << smallWidth << smallHeight << QColor(Qt::red); + QTest::newRow("EColor16MU big") << EColor16MU << largeWidth << largeHeight << QColor(Qt::red); + QTest::newRow("EColor16MA small opaque") << EColor16MA << smallWidth << smallHeight << QColor(255, 255, 0); + QTest::newRow("EColor16MA big opaque") << EColor16MA << largeWidth << largeHeight << QColor(255, 255, 0); + + // Semi-transparent Colors - Disabled for now, since the QCOMPARE fails, but visually confirmed to work +// QTest::newRow("EColor16MA small semi") << EColor16MA << smallWidth << smallHeight << QColor(255, 255, 0, 127); +// QTest::newRow("EColor16MA big semi") << EColor16MA << largeWidth << largeHeight << QColor(255, 255, 0, 127); +// QTest::newRow("EColor16MA small trans") << EColor16MA << smallWidth << smallHeight << QColor(255, 255, 0, 0); +// QTest::newRow("EColor16MA big trans") << EColor16MA << largeWidth << largeHeight << QColor(255, 255, 0, 0); + +#if !defined(__SERIES60_31__) && !defined(__S60_32__) + QTest::newRow("EColor16MAP small") << EColor16MAP << smallWidth << smallHeight << QColor(Qt::red); + QTest::newRow("EColor16MAP big") << EColor16MAP << largeWidth << largeHeight << QColor(Qt::red); +#endif +} + +void tst_QPixmap::fromSymbianCFbsBitmap() +{ + QFETCH(TDisplayMode, format); + QFETCH(int, width); + QFETCH(int, height); + QFETCH(QColor, color); + int expectedDepth = TDisplayModeUtils::NumDisplayModeBitsPerPixel(format); + + CFbsBitmap *nativeBitmap = 0; + CFbsBitmapDevice *bitmapDevice = 0; + CBitmapContext *bitmapContext = 0; + + nativeBitmap = new (ELeave) CFbsBitmap(); + TInt err = nativeBitmap->Create(TSize(width, height), format); + CleanupStack::PushL(nativeBitmap); + QVERIFY(err == KErrNone); + bitmapDevice = CFbsBitmapDevice::NewL(nativeBitmap); + CleanupStack::PushL(bitmapDevice); + + err = bitmapDevice->CreateBitmapContext(bitmapContext); + CleanupStack::PushL(bitmapContext); + QVERIFY(err == KErrNone); + TRgb symbianColor = TRgb(color.red(), color.green(), color.blue(), color.alpha()); + bitmapContext->SetBrushColor(symbianColor); + bitmapContext->Clear(); + + __UHEAP_MARK; + { // Test the normal case + QPixmap pixmap = QPixmap::fromSymbianCFbsBitmap(nativeBitmap); +// QCOMPARE(pixmap.depth(), expectedDepth); // Depth is not preserved now + QCOMPARE(pixmap.width(), width); + QCOMPARE(pixmap.height(), height); + QImage image = pixmap.toImage(); + + QColor actualColor(image.pixel(1, 1)); + QCOMPARE(actualColor, color); + } + __UHEAP_MARKEND; + + CleanupStack::PopAndDestroy(3); +} +#endif + void tst_QPixmap::onlyNullPixmapsOutsideGuiThread() { #if !defined(Q_WS_WIN) -- cgit v0.12 From ec4fd914b3b34ae14b996fd525f3f6f9b68ddd9e Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Fri, 5 Jun 2009 10:30:46 +0200 Subject: Make QColormap::instance() not crash. This doesn't really need a static instance lying around and this current implementation crashes since we never call the constructor. Just recreate it on the fly when instance() is called which apparently is never. --- src/gui/painting/qcolormap_s60.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/gui/painting/qcolormap_s60.cpp b/src/gui/painting/qcolormap_s60.cpp index c21eba9..1b58598 100644 --- a/src/gui/painting/qcolormap_s60.cpp +++ b/src/gui/painting/qcolormap_s60.cpp @@ -53,22 +53,18 @@ public: QAtomicInt ref; }; -static QColormap *qt_symbian_color_map = 0; void QColormap::initialize() { - qt_symbian_color_map = new QColormap; } void QColormap::cleanup() { - delete qt_symbian_color_map; - qt_symbian_color_map = 0; } QColormap QColormap::instance(int) { - return *qt_symbian_color_map; + return QColormap(); } QColormap::QColormap() : d(new QColormapPrivate) -- cgit v0.12 From cdb0222129a139dfe1b7e4fb4b401556989901b4 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Fri, 5 Jun 2009 10:45:26 +0200 Subject: My changelog for 4.5.2 --- dist/changes-4.5.2 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 04a29ba..5de0dbe 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -67,6 +67,17 @@ Third party components - QDir * Fix reentrency (listing directories in different threads) +- QFileSystemModel + * [254701] QFileSystemModel doesn't sort subfolders when using it in a QTreeView + * [251295] Windows path names incorrectly constructed in calls to updateIcon() + +- QFileDialog + * [251341] It is not possible to remove a directory of the sidebar if the directory does not exist + * [251321] Hidden path in QFileDialog's sidebar cannot be opened + * [226483] setSidebarUrls() handles the urls case sensitive so that adding the same directory twice is possible - Windows + * [252068] QFileDialog with QSortFilterProxyModel crashes + * [254490] QFileDialog selectFile doesn't clear the selection if we call it several times. + - QMacStyle * [253339] Don't draw arrows on toolbuttons that have a menu and text only. * [252301] Ensure that small and mini spin boxes are drawn correctly. -- cgit v0.12 From 3e1bbbda44258005b20862effe495cfb664627ca Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 5 Jun 2009 10:52:01 +0200 Subject: link qmake without /DEBUG on Windows Reviewed-by: mariusSO --- qmake/Makefile.win32 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32 index 39bac81..53130aa 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -41,7 +41,7 @@ CFLAGS = -c -Fo$@ \ CXXFLAGS = $(CFLAGS) LFLAGS = LIBS = ole32.lib advapi32.lib -LINKQMAKE = $(LINK) $(LFLAGS) -DEBUG -OUT:qmake.exe $(OBJS) $(QTOBJS) $(LIBS) +LINKQMAKE = $(LINK) $(LFLAGS) -OUT:qmake.exe $(OBJS) $(QTOBJS) $(LIBS) ADDCLEAN = vc60.pdb vc70.pdb qmake.pdb qmake.ilk !ELSE -- cgit v0.12 From 800b7e087f90e6253e4c496e816721c63b366e02 Mon Sep 17 00:00:00 2001 From: Aleksandar Sasha Babic Date: Fri, 5 Jun 2009 11:12:04 +0200 Subject: Enabling QGraphicsTextItem to handle input method events. On S60 one should get virtual keyboard. --- src/gui/graphicsview/qgraphicsitem.cpp | 129 ++++++++++++++++++++++++++++++++- 1 file changed, 128 insertions(+), 1 deletion(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index e8ace65..ed1891c 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -515,6 +515,7 @@ #include #include #include +#include #include #include @@ -7609,7 +7610,7 @@ class QGraphicsTextItemPrivate { public: QGraphicsTextItemPrivate() - : control(0), pageNumber(0), useDefaultImpl(false), tabChangesFocus(false) + : control(0), pageNumber(0), useDefaultImpl(false), tabChangesFocus(false), clickCausedFocus(0) { } mutable QTextControl *control; @@ -7630,6 +7631,8 @@ public: bool useDefaultImpl; bool tabChangesFocus; + uint clickCausedFocus : 1; + QGraphicsTextItem *qq; }; @@ -7956,7 +7959,13 @@ void QGraphicsTextItem::mousePressEvent(QGraphicsSceneMouseEvent *event) dd->useDefaultImpl = false; return; } + dd->sendControlEvent(event); + Q_ASSERT(event->widget()); + QInputContext *qic = event->widget()->inputContext(); + if(qic) { + qic->update(); + } } /*! @@ -7968,7 +7977,13 @@ void QGraphicsTextItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) QGraphicsItem::mouseMoveEvent(event); return; } + dd->sendControlEvent(event); + Q_ASSERT(event->widget()); + QInputContext *qic = event->widget()->inputContext(); + if(qic) { + qic->update(); + } } /*! @@ -7988,7 +8003,23 @@ void QGraphicsTextItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) } return; } + + if (event->button() == Qt::LeftButton && qApp->autoSipEnabled() + && (!dd->clickCausedFocus || qApp->autoSipOnMouseFocus())) { + QEvent _event(QEvent::RequestSoftwareInputPanel); + QApplication::sendEvent(event->widget(), &_event); + } else { + QGraphicsItem::mouseReleaseEvent(event); + } + dd->clickCausedFocus = 0; + dd->sendControlEvent(event); + + Q_ASSERT(event->widget()); + QInputContext *qic = event->widget()->inputContext(); + if(qic) { + qic->update(); + } } /*! @@ -8007,6 +8038,11 @@ void QGraphicsTextItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) } dd->sendControlEvent(event); + Q_ASSERT(event->widget()); + QInputContext *qic = event->widget()->inputContext(); + if(qic) { + qic->update(); + } } /*! @@ -8015,6 +8051,11 @@ void QGraphicsTextItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) void QGraphicsTextItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) { dd->sendControlEvent(event); + Q_ASSERT(event->widget()); + QInputContext *qic = event->widget()->inputContext(); + if(qic) { + qic->update(); + } } /*! @@ -8023,6 +8064,18 @@ void QGraphicsTextItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) void QGraphicsTextItem::keyPressEvent(QKeyEvent *event) { dd->sendControlEvent(event); + QList views = scene()->views(); + for (int i = 0; i < views.size(); ++i) { + QGraphicsView *view = views.at(i); + Q_ASSERT(view->viewport()); + if(view->viewport()->hasFocus()) { + QInputContext *qic = view->viewport()->inputContext(); + if(qic){ + qic->update(); + } + break; + } + } } /*! @@ -8031,6 +8084,18 @@ void QGraphicsTextItem::keyPressEvent(QKeyEvent *event) void QGraphicsTextItem::keyReleaseEvent(QKeyEvent *event) { dd->sendControlEvent(event); + QList views = scene()->views(); + for (int i = 0; i < views.size(); ++i) { + QGraphicsView *view = views.at(i); + Q_ASSERT(view->viewport()); + if(view->viewport()->hasFocus()) { + QInputContext *qic = view->viewport()->inputContext(); + if(qic){ + qic->update(); + } + break; + } + } } /*! @@ -8039,7 +8104,22 @@ void QGraphicsTextItem::keyReleaseEvent(QKeyEvent *event) void QGraphicsTextItem::focusInEvent(QFocusEvent *event) { dd->sendControlEvent(event); + if (event->reason() == Qt::MouseFocusReason) { + dd->clickCausedFocus = 1; + } update(); + QList views = scene()->views(); + for (int i = 0; i < views.size(); ++i) { + QGraphicsView *view = views.at(i); + Q_ASSERT(view->viewport()); + if(view->viewport()->hasFocus()) { + QInputContext *qic = view->viewport()->inputContext(); + if(qic){ + qic->reset(); + } + break; + } + } } /*! @@ -8049,6 +8129,18 @@ void QGraphicsTextItem::focusOutEvent(QFocusEvent *event) { dd->sendControlEvent(event); update(); + QList views = scene()->views(); + for (int i = 0; i < views.size(); ++i) { + QGraphicsView *view = views.at(i); + Q_ASSERT(view->viewport()); + if(view->viewport()->hasFocus()) { + QInputContext *qic = view->viewport()->inputContext(); + if(qic){ + qic->reset(); + } + break; + } + } } /*! @@ -8057,6 +8149,11 @@ void QGraphicsTextItem::focusOutEvent(QFocusEvent *event) void QGraphicsTextItem::dragEnterEvent(QGraphicsSceneDragDropEvent *event) { dd->sendControlEvent(event); + Q_ASSERT(event->widget()); + QInputContext *qic = event->widget()->inputContext(); + if(qic) { + qic->update(); + } } /*! @@ -8065,6 +8162,11 @@ void QGraphicsTextItem::dragEnterEvent(QGraphicsSceneDragDropEvent *event) void QGraphicsTextItem::dragLeaveEvent(QGraphicsSceneDragDropEvent *event) { dd->sendControlEvent(event); + Q_ASSERT(event->widget()); + QInputContext *qic = event->widget()->inputContext(); + if(qic) { + qic->update(); + } } /*! @@ -8073,6 +8175,11 @@ void QGraphicsTextItem::dragLeaveEvent(QGraphicsSceneDragDropEvent *event) void QGraphicsTextItem::dragMoveEvent(QGraphicsSceneDragDropEvent *event) { dd->sendControlEvent(event); + Q_ASSERT(event->widget()); + QInputContext *qic = event->widget()->inputContext(); + if(qic) { + qic->update(); + } } /*! @@ -8081,6 +8188,11 @@ void QGraphicsTextItem::dragMoveEvent(QGraphicsSceneDragDropEvent *event) void QGraphicsTextItem::dropEvent(QGraphicsSceneDragDropEvent *event) { dd->sendControlEvent(event); + Q_ASSERT(event->widget()); + QInputContext *qic = event->widget()->inputContext(); + if(qic) { + qic->update(); + } } /*! @@ -8097,6 +8209,11 @@ void QGraphicsTextItem::inputMethodEvent(QInputMethodEvent *event) void QGraphicsTextItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event) { dd->sendControlEvent(event); + Q_ASSERT(event->widget()); + QInputContext *qic = event->widget()->inputContext(); + if(qic) { + qic->update(); + } } /*! @@ -8105,6 +8222,11 @@ void QGraphicsTextItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event) void QGraphicsTextItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event) { dd->sendControlEvent(event); + Q_ASSERT(event->widget()); + QInputContext *qic = event->widget()->inputContext(); + if(qic) { + qic->update(); + } } /*! @@ -8113,6 +8235,11 @@ void QGraphicsTextItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event) void QGraphicsTextItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { dd->sendControlEvent(event); + Q_ASSERT(event->widget()); + QInputContext *qic = event->widget()->inputContext(); + if(qic) { + qic->update(); + } } /*! -- cgit v0.12 From ed0156a4269cd5c4ee13368b8c366bb7af2f489f Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Fri, 5 Jun 2009 11:35:34 +0200 Subject: Compile on newer SDKs >= S60 5.0. Semi-colons, colons, they all look the same to me. --- src/gui/image/qpixmap_s60.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp index 879c980..3ea50ff 100644 --- a/src/gui/image/qpixmap_s60.cpp +++ b/src/gui/image/qpixmap_s60.cpp @@ -140,7 +140,7 @@ CFbsBitmap *QPixmap::toSymbianCFbsBitmap() const case QImage::Format_ARGB32_Premultiplied: #if !defined(__SERIES60_31__) && !defined(__S60_32__) // ### TODO: Add runtime detection as well? - mode = EColor16MAP: + mode = EColor16MAP; break; #endif destFormat = QImage::Format_ARGB32; -- cgit v0.12 From 6fff92a31c4acd270d0ecb4cda336ba098801ffb Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Fri, 5 Jun 2009 12:12:21 +0200 Subject: Doc - cleaned up a sentence to improve clarity Reviewed-By: TrustMe --- doc/src/tutorials/addressbook.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/tutorials/addressbook.qdoc b/doc/src/tutorials/addressbook.qdoc index bf202b2..5a49901 100644 --- a/doc/src/tutorials/addressbook.qdoc +++ b/doc/src/tutorials/addressbook.qdoc @@ -454,7 +454,7 @@ \snippet tutorials/addressbook/part3/addressbook.cpp connecting navigation signals The image below is our expected graphical user interface. Notice that it - is getting closer to our expected final output. + is getting closer to our final application. \image addressbook-tutorial-part3-screenshot.png -- cgit v0.12 From 95ceabf52d79b922a87f7c023c9606e633ab1ea2 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 4 Jun 2009 15:03:31 +0200 Subject: Autotest: Fixed a race condition in the network self test. Some of the tests (including the httpsServer one) requested that the server close the connection (Connection: close). It could happen that, well, the server did close the connection and we noticed it while doing the waitForBytesWritten in the doSocketFlush function. Then we'd create an error in the next step because the socket wasn't connected. Reviewed-by: TrustMe --- tests/auto/_networkselftest/tst_networkselftest.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/auto/_networkselftest/tst_networkselftest.cpp b/tests/auto/_networkselftest/tst_networkselftest.cpp index 0fa001a..eac603f 100644 --- a/tests/auto/_networkselftest/tst_networkselftest.cpp +++ b/tests/auto/_networkselftest/tst_networkselftest.cpp @@ -190,12 +190,6 @@ static void netChat(int port, const QList &chat) // now start the chat QList::ConstIterator it = chat.constBegin(); for (int i = 1; it != chat.constEnd(); ++it, ++i) { - if (it->type != Chat::Reconnect - && socket.state() != QAbstractSocket::ConnectedState - && socket.state() != QAbstractSocket::ClosingState) - QFAIL(QString("Internal error: socket is in invalid state %1 in step %2") - .arg(socket.state()).arg(i).toLocal8Bit()); - switch (it->type) { case Chat::Expect: { qDebug() << i << "Expecting" << prettyByteArray(it->data); -- cgit v0.12 From 799a9ddf0a53ecdd6e097b2efd7418fd6ab9b655 Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Fri, 5 Jun 2009 12:29:27 +0200 Subject: Doc - fixed a typo Reviewed-By: TrustMe --- doc/src/tutorials/addressbook.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/tutorials/addressbook.qdoc b/doc/src/tutorials/addressbook.qdoc index 5a49901..4ab549a 100644 --- a/doc/src/tutorials/addressbook.qdoc +++ b/doc/src/tutorials/addressbook.qdoc @@ -510,7 +510,7 @@ \list \o If the iterator is at the end of \c contacts, we clear the display and return. - \o If the iterator is the beginning of \c contacts, we move it to + \o If the iterator is at the beginning of \c contacts, we move it to the end. \o We then decrement the iterator by one. \endlist -- cgit v0.12 From 35bdd8942716c716113e5b795186ca76199e8d96 Mon Sep 17 00:00:00 2001 From: Trond Kjernaasen Date: Fri, 5 Jun 2009 12:32:51 +0200 Subject: Fixed text drawing on Windows in 16 bit mode. There were several problems with antialiased text in 16 bit mode under Windows. No gamma correction was done, yet we prepared the cached glyphs for gamma correction. The mask format we rendered the glyphs into was also set to the desktop depth, which implied that information was lost and the text looked rather odd. Reviewed-by: Samuel BT: yes --- src/gui/text/qfontengine_win.cpp | 26 ++++++++++++++------------ src/gui/text/qfontengine_win_p.h | 3 ++- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp index 7341665..dc2e1ff 100644 --- a/src/gui/text/qfontengine_win.cpp +++ b/src/gui/text/qfontengine_win.cpp @@ -1335,7 +1335,7 @@ bool QFontEngineWin::getSfntTableData(uint tag, uchar *buffer, uint *length) con QNativeImage *QFontEngineWin::drawGDIGlyph(HFONT font, glyph_t glyph, int margin, - const QTransform &t) + const QTransform &t, QImage::Format mask_format) { glyph_metrics_t gm = boundingBox(glyph); @@ -1408,7 +1408,7 @@ QNativeImage *QFontEngineWin::drawGDIGlyph(HFONT font, glyph_t glyph, int margin QNativeImage *ni = new QNativeImage(iw + 2 * margin + 4, ih + 2 * margin + 4, - QNativeImage::systemFormat(), true); + mask_format, true); ni->image.fill(0xffffffff); HDC hdc = ni->hdc; @@ -1448,8 +1448,12 @@ QImage QFontEngineWin::alphaMapForGlyph(glyph_t glyph, const QTransform &xform) lf.lfQuality = ANTIALIASED_QUALITY; font = CreateFontIndirectW(&lf); } + QImage::Format mask_format = QNativeImage::systemFormat(); +#ifndef Q_OS_WINCE + mask_format = QImage::Format_RGB32; +#endif - QNativeImage *mask = drawGDIGlyph(font, glyph, 0, xform); + QNativeImage *mask = drawGDIGlyph(font, glyph, 0, xform, mask_format); if (mask == 0) return QImage(); @@ -1466,22 +1470,20 @@ QImage QFontEngineWin::alphaMapForGlyph(glyph_t glyph, const QTransform &xform) // Alpha channel of the ni.image pixels... for (int y=0; yheight(); ++y) { uchar *dest = indexed.scanLine(y); - if (mask->systemFormat() == QImage::Format_RGB16) { + if (mask->image.format() == QImage::Format_RGB16) { const qint16 *src = (qint16 *) ((const QImage &) mask->image).scanLine(y); - for (int x=0; xwidth(); ++x) { -#ifdef Q_OS_WINCE + for (int x=0; xwidth(); ++x) dest[x] = 255 - qGray(src[x]); -#else - dest[x] = 255 - (qt_pow_gamma[qGray(src[x])] * 255. / 2047.); -#endif - } } else { const uint *src = (uint *) ((const QImage &) mask->image).scanLine(y); for (int x=0; xwidth(); ++x) { #ifdef Q_OS_WINCE dest[x] = 255 - qGray(src[x]); #else - dest[x] = 255 - (qt_pow_gamma[qGray(src[x])] * 255. / 2047.); + if (QNativeImage::systemFormat() == QImage::Format_RGB16) + dest[x] = 255 - qGray(src[x]); + else + dest[x] = 255 - (qt_pow_gamma[qGray(src[x])] * 255. / 2047.); #endif } } @@ -1507,7 +1509,7 @@ QImage QFontEngineWin::alphaRGBMapForGlyph(glyph_t glyph, int margin, const QTra SystemParametersInfo(SPI_GETFONTSMOOTHINGCONTRAST, 0, &contrast, 0); SystemParametersInfo(SPI_SETFONTSMOOTHINGCONTRAST, 0, (void *) 1000, 0); - QNativeImage *mask = drawGDIGlyph(font, glyph, margin, t); + QNativeImage *mask = drawGDIGlyph(font, glyph, margin, t, QImage::Format_RGB32); SystemParametersInfo(SPI_SETFONTSMOOTHINGCONTRAST, 0, (void *) contrast, 0); if (mask == 0) diff --git a/src/gui/text/qfontengine_win_p.h b/src/gui/text/qfontengine_win_p.h index 6f37e91..f78bc6a 100644 --- a/src/gui/text/qfontengine_win_p.h +++ b/src/gui/text/qfontengine_win_p.h @@ -138,7 +138,8 @@ public: mutable int designAdvancesSize; private: - QNativeImage *drawGDIGlyph(HFONT font, glyph_t, int margin, const QTransform &xform); + QNativeImage *drawGDIGlyph(HFONT font, glyph_t, int margin, const QTransform &xform, + QImage::Format mask_format); }; -- cgit v0.12 From c2fe2efd1ee04a02858b7551fad07009d763f960 Mon Sep 17 00:00:00 2001 From: Espen Riskedal Date: Fri, 5 Jun 2009 13:07:12 +0200 Subject: make it more obvious where the Open C plugins are located --- doc/src/installation.qdoc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/src/installation.qdoc b/doc/src/installation.qdoc index 7cd7b0c..befc7b6 100644 --- a/doc/src/installation.qdoc +++ b/doc/src/installation.qdoc @@ -516,12 +516,12 @@ in the \l{Qt for Windows CE Requirements} document. Install this to all S60 SDKs you plan to use Qt with. \endlist - Make sure you have the following packages installed on any device you want to use to run Qt applications. - These packages can be found under \c nokia_plugin directory in any S60 SDK where you have installed Open C/C++: + Make sure you have the following plugins installed on your device. The packages can be found + in the S60 SDK where you installed Open C/C++: \list - \o pips_s60_.sis - \o openc_ssl_s60_.sis - \o stdcpp_s60_.sis + \o nokia_plugin\openc\s60opencsis\pips_s60_.sis + \o nokia_plugin\openc\s60opencsis\openc_ssl_s60_.sis + \o nokia_plugin\opencpp\s60opencppsis\stdcpp_s60_.sis \endlist These instructions assume the above tools are installed and -- cgit v0.12 From 72c003655c2009279d7360acce88d536122c8795 Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 5 Jun 2009 13:10:31 +0200 Subject: Made Selection updates relative to the block. Otherwise the update would always end up with the selection being in the first block. --- src/gui/text/qtextcontrol.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp index 6647558..69e1ee4 100644 --- a/src/gui/text/qtextcontrol.cpp +++ b/src/gui/text/qtextcontrol.cpp @@ -1841,8 +1841,9 @@ void QTextControlPrivate::inputMethodEvent(QInputMethodEvent *e) const QInputMethodEvent::Attribute &a = e->attributes().at(i); if (a.type == QInputMethodEvent::Selection) { QTextCursor oldCursor = cursor; - cursor.setPosition(a.start, QTextCursor::MoveAnchor); - cursor.setPosition(a.start + a.length, QTextCursor::KeepAnchor); + int blockStart = a.start + cursor.block().position(); + cursor.setPosition(blockStart, QTextCursor::MoveAnchor); + cursor.setPosition(blockStart + a.length, QTextCursor::KeepAnchor); q->ensureCursorVisible(); repaintOldAndNewSelection(oldCursor); } -- cgit v0.12 From 847f669fd49a8691f1e765c8f2c4abf94e40f1c5 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 5 Jun 2009 14:29:48 +0300 Subject: Cut the process priority lowering timeout to 100ms in Symbian eventdispatcher, as some demos were getting ViewSrv 11 panics with 500ms timeout. --- src/corelib/kernel/qeventdispatcher_symbian.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp index 30b865e..c5d91c2 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian.cpp +++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp @@ -454,8 +454,8 @@ void QSelectThread::requestSocketEvents ( QSocketNotifier *notifier, TRequestSta } QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex); - - Q_ASSERT(!m_AOStatuses.contains(notifier)); + + Q_ASSERT(!m_AOStatuses.contains(notifier)); m_AOStatuses.insert(notifier, status); @@ -711,7 +711,7 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla break; } block = false; - if (timeState == TimeStarted && time.elapsed() > 500) { + if (timeState == TimeStarted && time.elapsed() > 100) { priority = m_processHandle.Priority(); m_processHandle.SetPriority(EPriorityLow); time.start(); -- cgit v0.12 From 5740b034811794e0c33496cf0eeb81ba471cc018 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Fri, 5 Jun 2009 13:30:03 +0200 Subject: Example MDI: keybord focus not working correctly! The reason is that cocoa looses the first responder when we raise the fake window inside the MDA area. So we need to re-set the first responder again Task-number: 255040 Reviewed-by: Trenton Schulz --- src/gui/kernel/qwidget_mac.mm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index c82b87d..68eaf6f 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -3603,11 +3603,15 @@ void QWidgetPrivate::raise_sys() } } else { // Cocoa doesn't really have an idea of Z-ordering, but you can - // fake it by changing the order of it. + // fake it by changing the order of it. But beware, removing an + // NSView will also remove it as the first responder. So we re-set + // the first responder just in case: NSView *view = qt_mac_nativeview_for(q); NSView *parentView = [view superview]; + NSResponder *firstResponder = [[view window] firstResponder]; [view removeFromSuperview]; [parentView addSubview:view]; + [[view window] makeFirstResponder:firstResponder]; } #else if(q->isWindow()) { @@ -3645,6 +3649,7 @@ void QWidgetPrivate::lower_sys() NSArray *tmpViews = [parentView subviews]; NSMutableArray *subviews = [[NSMutableArray alloc] initWithCapacity:[tmpViews count]]; [subviews addObjectsFromArray:tmpViews]; + NSResponder *firstResponder = [[myview window] firstResponder]; // Implicit assumption that myViewIndex is included in subviews, that's why I'm not checking // myViewIndex. NSUInteger index = 0; @@ -3664,6 +3669,7 @@ void QWidgetPrivate::lower_sys() for (NSView *subview in subviews) [parentView addSubview:subview]; [subviews release]; + [[myview window] makeFirstResponder:firstResponder]; } #else if(q->isWindow()) { -- cgit v0.12 From c39d1df4ab303472df479ba6c3d59ec30ec2995e Mon Sep 17 00:00:00 2001 From: Espen Riskedal Date: Fri, 5 Jun 2009 13:53:25 +0200 Subject: Simplify binary package instructions for S60 --- doc/src/installation.qdoc | 41 ++++++++++++----------------------------- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/doc/src/installation.qdoc b/doc/src/installation.qdoc index befc7b6..697427d 100644 --- a/doc/src/installation.qdoc +++ b/doc/src/installation.qdoc @@ -532,55 +532,38 @@ in the \l{Qt for Windows CE Requirements} document. \o Depending on how you obtained the Qt for S60 release, follow the instructions in one of these pages: \list - \o \l{Installing Qt for S60 with installer} - \o \l{Installing Qt for S60 from source package} + \o \l{Installing Qt on S60 binary package} + \o \l{Installing Qt on S60 source package} \endlist \endlist */ /*! \page install-S60-installer.html -\title Installing Qt for S60 with installer +\title Installing Qt on S60 binary package \ingroup installation \ingroup qts60 -\brief How to install Qt on S60 using installer. +\brief How to install Qt on S60 using the binary package. \list 1 \o Install Qt - Run the \c{qt-s60-%VERSION%.exe} to install Qt. + Run \c{qt-s60-%VERSION%.exe} and follow the instructions. \note Qt must be installed on the same drive as the S60 SDK you are using, and the install path must not contain any spaces. - \o Environment variables - - In order to build and use Qt, the \c PATH environment variable needs - to be extended: - - \snippet doc/src/snippets/code/doc_src_installation.qdoc 18 - - This is done by adding \c{c:\Qt\%VERSION%\bin} to the \c PATH variable. - - On Windows the PATH can be extended by navigating to - "Control Panel->System->Advanced->Environment variables". - - \note Instead of modifying system path, you can also use the "Qt S60 Command Prompt" - to build your applications. It can be launched from start menu. - - In addition, you must configure the environment for use with the S60 - emulator. This is done by locating the Carbide.c++ submenu on the Start - menu, and choosing "Configure environment for WINSCW command line". - \o Running Qt demos We've included a subset of the Qt demos in this package for you to try out. An excellent starting point is the "fluidlauncher" demo. To run the demo on a real device, you first have to install - \c{qt_libs.sis} and \c{fluidlauncher.sis} - found at Qt installation directory to the device. + \c{qt_libs.sisx} and \c{fluidlauncher.sisx} found in the Qt installation + directory. In Windows Explorer right click on the \c{.sisx} files and select + "Install with Nokia Application Installer" and follow the instructions. - To run the demos and examples on the emulator, you need to build them first: + To run the demos and examples on the emulator, you need to build them. + Open the "Qt for S60 Command Prompt" from the Start menu and type: \snippet doc/src/snippets/code/doc_src_installation.qdoc 25 @@ -600,10 +583,10 @@ in the \l{Qt for Windows CE Requirements} document. */ /*! \page install-S60-sources.html -\title Installing Qt for S60 from source package +\title Installing Qt on S60 source package \ingroup installation \ingroup qts60 -\brief How to install Qt on S60 from source package. +\brief How to install Qt on S60 using the source package. \list 1 -- cgit v0.12 From 7656e903a72c2bcb6a73a909bd75ff8817d4b869 Mon Sep 17 00:00:00 2001 From: Espen Riskedal Date: Fri, 5 Jun 2009 13:54:36 +0200 Subject: The product is called Qt for... but for installation we say Installing Qt on... --- doc/src/emb-install.qdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/emb-install.qdoc b/doc/src/emb-install.qdoc index 11b3f03..eb75697 100644 --- a/doc/src/emb-install.qdoc +++ b/doc/src/emb-install.qdoc @@ -42,10 +42,10 @@ /*! \page qt-embedded-install.html - \title Installing Qt for Embedded Linux + \title Installing Qt on Embedded Linux \ingroup qt-embedded-linux \ingroup installation - \brief How to install Qt for Embedded Linux. + \brief How to install Qt on Embedded Linux. This document describes how to install \l{Qt for Embedded Linux} in your development environment: -- cgit v0.12 From a45ba34ead80d7e19e62eff571d094c9417fd876 Mon Sep 17 00:00:00 2001 From: jasplin Date: Fri, 5 Jun 2009 13:46:14 +0200 Subject: Revert "BT: Fixed crash on Mac caused by erroneous handling of native focus events." This reverts commit 7314c07a3e443b1d5349b419a03db8d41ca43f7e. As reported by Eike, this patch caused several problems for Qt Creator. Potentially it may cause problems for other (external) applications as well. An alternative fix (scheduled for 4.5.x) needs to be found for tasks 254456 and 254460. Reviewed-by: Richard Moe Gustavsen --- src/gui/kernel/qwidget_mac.mm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 68eaf6f..b2256cd 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -1296,11 +1296,8 @@ OSStatus QWidgetPrivate::qt_widget_event(EventHandlerCallRef er, EventRef event, if(part == kControlFocusNoPart){ if (widget->hasFocus()) QApplicationPrivate::setFocusWidget(0, Qt::OtherFocusReason); - } else if (widget->focusPolicy() != Qt::NoFocus) { + } else widget->setFocus(); - } else { - handled_event = false; - } } if(!HIObjectIsOfClass((HIObjectRef)hiview, kObjectQWidget)) CallNextEventHandler(er, event); -- cgit v0.12 From 5455f9c7a3ec8ed591666a2f4384c10de31f6a60 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Fri, 5 Jun 2009 14:06:03 +0200 Subject: My changes for 4.5.2 --- dist/changes-4.5.2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 5de0dbe..84460e3 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -210,7 +210,9 @@ Qt for Embedded Linux Qt for Windows CE ----------------- -[248846] handle the back soft key on Windows mobile. +[248846] Handle the back soft key on Windows mobile. +[252319] Fix regression in native menu integration. +[242484] Fixed crash if Qt::WindowCancelButtonHint is used for a QDialog **************************************************************************** -- cgit v0.12 From 541a387770966eb78958b38fe49fc62c2063b4c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 5 Jun 2009 15:52:34 +0300 Subject: S60Style: Drop middlesection from tab graphics, if there is very little of tab content. --- src/gui/styles/qs60style.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 83f5a6b..dbc0fe0 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -560,10 +560,20 @@ void QS60StylePrivate::drawRow(QS60StyleEnums::SkinParts start, startRect.setWidth(qMin(rect.width() >>1 - 1, startRect.width())); endRect = startRect.translated(rect.width() - startRect.width(), 0); middleRect.adjust(startRect.width(), 0, -startRect.width(), 0); + if (startRect.bottomRight().x() > endRect.topLeft().x()) { + const int overlap = (startRect.bottomRight().x() - endRect.topLeft().x())>>1; + startRect.setWidth(startRect.width()-overlap); + endRect.adjust(overlap,0,0,0); + } } else { startRect.setHeight(qMin(rect.height() >>1 - 1, startRect.height())); endRect = startRect.translated(0, rect.height() - startRect.height()); middleRect.adjust(0, startRect.height(), 0, -startRect.height()); + if (startRect.topRight().y() > endRect.bottomLeft().y()) { + const int overlap = (startRect.topRight().y() - endRect.bottomLeft().y())>>1; + startRect.setHeight(startRect.height()-overlap); + endRect.adjust(0,overlap,0,0); + } } #if 0 -- cgit v0.12 From 2734d8fa8c26c8498091348305b2616ecacfad85 Mon Sep 17 00:00:00 2001 From: jasplin Date: Fri, 5 Jun 2009 15:01:16 +0200 Subject: My changes for 4.5.2. --- dist/changes-4.5.2 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 84460e3..1984881 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -59,6 +59,10 @@ Third party components - QAbstractNetworkCache * Only cache responses to HTTP GET by default, not HTTP PUT or POST +- QApplication + * [249589] Fixed bug that prevented any part of the application to receive + focus when Graphics View was disabled using QT_NO_GRAPHICSVIEW. + - QComboBox * [253944] Changing the style doesn't reset custom item delegate anymore. * [254589] Fixed the frame appearing if setting a stylesheet with a border @@ -88,6 +92,9 @@ Third party components - QFontDialog * [252000] Ensure that QFontDialog::getFont() works on Mac OS X. +- QGraphicsWidget + * Fixed a bug with Qt::WidgetWithChildren shortcut context. + - QLocalSocket * [247144] correctly handle remote disconnects @@ -107,6 +114,10 @@ Third party components * [253448] Prevent a crash when using the Qt::WA_MacBrushedMetal attribute in conjunction with style sheets. +- QWizard + * [252662] Fixed crash that could happen when compiling on Windows XP and + running on older Windows versions like 98 and 2000. + - QObject * Fixed possible race condition if two QObject connected together with signals and slot are destroyed in different threads @@ -121,6 +132,9 @@ Third party components * [251534] Fixed issue where text with non-opaque color from widget palette would be blitted instead of blended. +- QProgressBar + * [252283] Fixed busy indicator for a QProgressBar with a style sheet applied to it. + - QSelectionModel * [252069] fix QSelectionModel::rowIntersectsSelection or QSelectionModel::columnsIntersectsSelection not reporting right result if some items are disabled. @@ -135,6 +149,10 @@ Third party components - QString * Fixed reentrency of QString::squeeze() +- QTabBar + * [252472] Fixed problem with the current tab not being visible after calling + setTabButton() on a scrolled tab bar. + - QTransform * Fixed issue in QTransform::type() causing a projective transform to be treated as a scaling transform. -- cgit v0.12 From bc88cd4796ef8845bbdc40b8b066d3ea1111fc3f Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Fri, 5 Jun 2009 16:13:50 +0300 Subject: Added subElementRect implementation for SE_ItemViewItemCheckIndicator. S60Style did not implement SE_ItemViewItemCheckIndicator if given option was somethign else than QStyleOptionViewItemV4. This causes some autotests to fail. Added appropriate query for QCommonStyle. --- src/gui/styles/qs60style.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 83f5a6b..068f5b3 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2589,6 +2589,8 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con ret.setRect(opt->rect.right() - indicatorWidth - spacing, opt->rect.top() + heightOffset, indicatorWidth, indicatorHeight); } + } else { + ret = QCommonStyle::subElementRect(element, opt, widget); } break; case SE_HeaderLabel: -- cgit v0.12 From f6fc34ea5b247d1b56e113663958176b095a58a6 Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Fri, 5 Jun 2009 15:44:24 +0200 Subject: Doc - fixed a typo Reviewed-By: TrustMe --- doc/src/tutorials/addressbook.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/tutorials/addressbook.qdoc b/doc/src/tutorials/addressbook.qdoc index 4ab549a..e5657e7 100644 --- a/doc/src/tutorials/addressbook.qdoc +++ b/doc/src/tutorials/addressbook.qdoc @@ -529,7 +529,7 @@ \example tutorials/addressbook/part4 \title Address Book 4 - Editing and Removing Addresses - In this chapter, we look at ways to modify the contents of contact stored + In this chapter, we look at ways to modify the contents of contacts stored in the address book application. \image addressbook-tutorial-screenshot.png -- cgit v0.12 From 426dc2fbefa8a901778c5fbafe6fb9ac61c4a004 Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 5 Jun 2009 15:53:56 +0200 Subject: Turned off input methods on Windows when using certain hints. If any of those hints are present, complex input is not possible, so input methods should be turned off on Windows. --- src/gui/inputmethod/qwininputcontext_win.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/inputmethod/qwininputcontext_win.cpp b/src/gui/inputmethod/qwininputcontext_win.cpp index e3e8aa4..d670f5a 100644 --- a/src/gui/inputmethod/qwininputcontext_win.cpp +++ b/src/gui/inputmethod/qwininputcontext_win.cpp @@ -759,7 +759,12 @@ void QInputContextPrivate::updateImeStatus(QWidget *w, bool hasFocus) { if (!w) return; - bool e = w->testAttribute(Qt::WA_InputMethodEnabled) && w->isEnabled(); + // It's always the proxy that carries the hints. + QWidget *focusProxyWidget = w->focusProxy(); + if (!focusProxyWidget) + focusProxyWidget = w; + bool e = w->testAttribute(Qt::WA_InputMethodEnabled) && w->isEnabled() + && !(focusProxyWidget->inputMethodHints() & Qt::ImhExclusiveInputMask); bool hasIme = e && hasFocus; #ifdef Q_IME_DEBUG qDebug("%s HasFocus = %d hasIme = %d e = %d ", w->className(), hasFocus, hasIme, e); -- cgit v0.12 From d0a2a16bfe73c4281277397dec0fdc8ca201f0fa Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 5 Jun 2009 15:58:30 +0200 Subject: Prevent double deletion of m_themePalette RevBy: Sami Merila --- src/gui/styles/qs60style.cpp | 29 ++++++++++++++++------------- src/gui/styles/qs60style_p.h | 7 ++++--- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 56b7e7c..fe24195 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -151,7 +151,7 @@ const double KTabFontMul = 0.72; QS60StylePrivate::~QS60StylePrivate() { clearCaches(); //deletes also background image - delete m_themePalette; + deleteThemePalette(); } void QS60StylePrivate::drawSkinElement(SkinElements element, QPainter *painter, @@ -470,12 +470,10 @@ QColor QS60StylePrivate::colorFromFrameGraphics(QS60StylePrivate::SkinFrameEleme void QS60StylePrivate::setThemePalette(QApplication *app) const { - if (!app) - return; - + Q_UNUSED(app) QPalette widgetPalette = QPalette(Qt::white); setThemePalette(&widgetPalette); - app->setPalette(widgetPalette); + QApplication::setPalette(widgetPalette); } void QS60StylePrivate::setThemePalette(QStyleOption *option) const @@ -490,11 +488,10 @@ QPalette* QS60StylePrivate::themePalette() void QS60StylePrivate::setBackgroundTexture(QApplication *app) const { - if (!app) - return; - QPalette applicationPalette = app->palette(); + Q_UNUSED(app) + QPalette applicationPalette = QApplication::palette(); applicationPalette.setBrush(QPalette::Window, QS60StylePrivate::backgroundTexture()); - app->setPalette(applicationPalette); + QApplication::setPalette(applicationPalette); } void QS60StylePrivate::deleteBackground() @@ -719,13 +716,18 @@ void QS60StylePrivate::setThemePalette(QPalette *palette) const QS60StylePrivate::storeThemePalette(palette); } -void QS60StylePrivate::storeThemePalette(QPalette *palette) +void QS60StylePrivate::deleteThemePalette() { - //store specified palette for latter use. if (m_themePalette) { delete m_themePalette; m_themePalette = 0; } +} + +void QS60StylePrivate::storeThemePalette(QPalette *palette) +{ + deleteThemePalette(); + //store specified palette for latter use. m_themePalette = new QPalette(*palette); } @@ -2705,9 +2707,10 @@ void QS60Style::polish(QApplication *application) void QS60Style::unpolish(QApplication *application) { + Q_UNUSED(application) Q_D(QS60Style); const QPalette newPalette = QApplication::style()->standardPalette(); - application->setPalette(newPalette); + QApplication::setPalette(newPalette); QApplicationPrivate::setSystemPalette(d->m_originalPalette); } @@ -2821,7 +2824,7 @@ bool qt_s60_fill_background(QPainter *painter, const QRegion &rgn, const QPoint const QPaintDevice *target = painter->device(); if (target->devType() == QInternal::Widget) { - const QWidget *widget = static_cast(target); + const QWidget *widget = static_cast(target); const QRegion translated = rgn.translated(offset); const QVector &rects = translated.rects(); for (int i = 0; i < rects.size(); ++i) { diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index 385c6e8..54da9e8 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -410,7 +410,7 @@ public: static bool isToolBarBackground(); // calculates average color based on button skin graphics (minus borders). - QColor colorFromFrameGraphics(QS60StylePrivate::SkinFrameElements frame) const; + QColor colorFromFrameGraphics(SkinFrameElements frame) const; //set theme palette for application void setThemePalette(QApplication *application) const; @@ -432,7 +432,7 @@ public: static const int m_numberOfLayouts; mutable QHash, QFont> m_mappedFontsCache; - mutable QHash m_colorCache; + mutable QHash m_colorCache; // Has one entry per SkinFrameElements static const struct frameElementCenter { @@ -465,7 +465,8 @@ private: void setThemePalette(QWidget *widget) const; void setThemePalette(QPalette *palette) const; void setThemePaletteHash(QPalette *palette) const; - static void QS60StylePrivate::storeThemePalette(QPalette *palette); + static void storeThemePalette(QPalette *palette); + static void deleteThemePalette(); static QSize partSize(QS60StyleEnums::SkinParts part, SkinElementFlags flags = KDefaultSkinElementFlags); -- cgit v0.12 From 4515b690829a639283a9b660893ff3f0f7ff598b Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Fri, 5 Jun 2009 15:59:59 +0200 Subject: Doc - fixed another typo Reviewed-By: TrustMe --- doc/src/tutorials/addressbook.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/tutorials/addressbook.qdoc b/doc/src/tutorials/addressbook.qdoc index e5657e7..4de334d 100644 --- a/doc/src/tutorials/addressbook.qdoc +++ b/doc/src/tutorials/addressbook.qdoc @@ -539,7 +539,7 @@ edit and remove functions so that a contact's details can be changed when needed. However, this requires a little improvement, in the form of enums. In our previous chapters, we had two modes: \c{AddingMode} and - \c{NavigationMode} - but they weren't defined as enums. Instead, we + \c{NavigationMode} - but they were not defined as enums. Instead, we enabled and disabled the corresponding buttons manually, resulting in multiple lines of repeated code. -- cgit v0.12 From b59d84fe67caedeb8c11d2530ddee2017a376920 Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Fri, 5 Jun 2009 16:31:24 +0200 Subject: Doc - fixed a typo Reviewed-By: TrustMe --- doc/src/tutorials/addressbook.qdoc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/src/tutorials/addressbook.qdoc b/doc/src/tutorials/addressbook.qdoc index 4de334d..9a1af85 100644 --- a/doc/src/tutorials/addressbook.qdoc +++ b/doc/src/tutorials/addressbook.qdoc @@ -573,8 +573,7 @@ \dots \snippet tutorials/addressbook/part4/addressbook.h mode declaration - Lastly, we declare \c currentMode to keep track of the current mode of the - enum. + Lastly, we declare \c currentMode to keep track of the enum's current mode. \section1 Implementing the AddressBook Class -- cgit v0.12 From ba753f45e472810739c04e3677b754671e62b76b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 5 Jun 2009 17:34:22 +0300 Subject: S60Style: More styleHints --- src/gui/styles/qs60style.cpp | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index fe24195..9a96c05 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2269,10 +2269,36 @@ int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w retValue = '*'; break; case SH_ComboBox_PopupFrameStyle: - retValue = QFrame::NoFrame; + retValue = QFrame::NoFrame | QFrame::Plain; break; case SH_Dial_BackgroundRole: retValue = QPalette::Base; + case SH_ItemView_ActivateItemOnSingleClick: + retValue = true; + break; + case SH_ProgressDialog_TextLabelAlignment: + retValue = (QApplication::layoutDirection() == Qt::LeftToRight) ? + Qt::AlignLeft : + Qt::AlignRight; + break; + case SH_Menu_SubMenuPopupDelay: + retValue = 300; + break; + case SH_Menu_Scrollable: + retValue = true; + break; + case SH_Menu_SelectionWrap: + retValue = true; + break; + case SH_ItemView_ShowDecorationSelected: + retValue = true; + break; + case SH_ToolBar_Movable: + retValue = false; + break; + case SH_BlinkCursorWhenTextSelected: + retValue = true; + break; default: break; } -- cgit v0.12 From 6e0bca84e9a306281831ffc2a4d12fdde8023735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 5 Jun 2009 17:35:15 +0300 Subject: S60Style: Missing break-statement --- src/gui/styles/qs60style.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 9a96c05..c394013 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2273,6 +2273,7 @@ int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w break; case SH_Dial_BackgroundRole: retValue = QPalette::Base; + break; case SH_ItemView_ActivateItemOnSingleClick: retValue = true; break; -- cgit v0.12 From e827ba44fbe7d30473855fe782ab2d02f8acf47f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 5 Jun 2009 17:36:17 +0300 Subject: S60Style: Remove some magic numbers. --- src/gui/styles/qs60style.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index c394013..ab2c2ff 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -1784,14 +1784,15 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, { QS60StylePrivate::SkinElementFlags adjFlags = flags; QRect emptyAreaRect = option->rect; + const int frameWidth = QS60StylePrivate::pixelMetric(PM_DefaultFrameWidth); if (option->state & QStyle::State_Horizontal) { - emptyAreaRect.adjust(-2,-2,2,-2); + emptyAreaRect.adjust(-frameWidth,-frameWidth,frameWidth,-frameWidth); } else { if ( option->direction == Qt::LeftToRight ) { - emptyAreaRect.adjust(-2,-2,0,2); + emptyAreaRect.adjust(-frameWidth,-frameWidth,0,frameWidth); adjFlags |= QS60StylePrivate::SF_PointWest; } else { - emptyAreaRect.adjust(2,2,0,-2); + emptyAreaRect.adjust(frameWidth,frameWidth,0,-frameWidth); adjFlags |= QS60StylePrivate::SF_PointEast; } } @@ -1803,14 +1804,15 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, QS60StylePrivate::SkinElementFlags adjFlags = flags; QRect mtyRect = header->rect; QRect parentRect = widget->parentWidget()->rect(); + const int frameWidth = QS60StylePrivate::pixelMetric(PM_DefaultFrameWidth); if (header->orientation == Qt::Horizontal) { - mtyRect.adjust(-2,-2,2,-2); + mtyRect.adjust(-frameWidth,-frameWidth,frameWidth,-frameWidth); } else { if ( header->direction == Qt::LeftToRight ) { - mtyRect.adjust(-2,-2,0,2); + mtyRect.adjust(-frameWidth,-frameWidth,0,frameWidth); adjFlags |= QS60StylePrivate::SF_PointWest; } else { - mtyRect.adjust(2,2,0,-2); + mtyRect.adjust(frameWidth,frameWidth,0,-frameWidth); adjFlags |= QS60StylePrivate::SF_PointEast; } } @@ -2016,7 +2018,8 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti else if (const QStyleOptionFrame *cmb = qstyleoption_cast(option)) { // We want to draw down arrow here for comboboxes as well. QStyleOptionFrame comboBox = *cmb; - comboBox.rect.adjust(0,2,0,-2); + const int frameWidth = QS60StylePrivate::pixelMetric(PM_DefaultFrameWidth); + comboBox.rect.adjust(0,frameWidth,0,-frameWidth); QCommonStyle::drawPrimitive(element, &comboBox, painter, widget); } #endif //QT_NO_COMBOBOX -- cgit v0.12 From d29da4699a2887cdf0836ff39652524d015431c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Fri, 5 Jun 2009 16:41:23 +0200 Subject: Fixed an issue with graphicssystem raster on 8 and 16 bit X servers. We didn't actually check the depth of the target window before calling the qt_x11_drawImage() fu, that will only work with depths >= 24. Task-number: 255311 Reviewed-by: Samuel BT: yes --- src/gui/painting/qwindowsurface_raster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qwindowsurface_raster.cpp b/src/gui/painting/qwindowsurface_raster.cpp index 110ba2f..0a6a04e 100644 --- a/src/gui/painting/qwindowsurface_raster.cpp +++ b/src/gui/painting/qwindowsurface_raster.cpp @@ -229,7 +229,7 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi { const QImage &src = d->image->image; br = br.intersected(src.rect()); - if (src.format() != QImage::Format_RGB32) { + if (src.format() != QImage::Format_RGB32 || widget->x11Info().depth() < 24) { QX11PixmapData *data = new QX11PixmapData(QPixmapData::PixmapType); data->xinfo = widget->x11Info(); data->fromImage(src, Qt::AutoColor); -- cgit v0.12 From dc177883bf98a68e61c9a9cda7e1ba9464079275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 5 Jun 2009 17:59:37 +0300 Subject: S60Style: Styled graphic support for editors. --- src/gui/styles/qs60style.cpp | 11 +++++++++++ src/gui/styles/qs60style_p.h | 13 ++++++++++++- src/gui/styles/qs60style_s60.cpp | 12 +++++++++++- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index ab2c2ff..6d24d54 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -63,6 +63,7 @@ #include "qtabbar.h" #include "qtablewidget.h" #include "qtableview.h" +#include "qtextedit.h" #include "qtoolbar.h" #include "qtoolbutton.h" #include "qtreeview.h" @@ -140,6 +141,7 @@ const struct QS60StylePrivate::frameElementCenter QS60StylePrivate::m_frameEleme {SE_ToolBarButtonPressed, QS60StyleEnums::SP_QsnFrSctrlButtonCenterPressed}, {SE_PanelBackground, QS60StyleEnums::SP_QsnFrSetOptCenter}, {SE_ButtonInactive, QS60StyleEnums::SP_QsnFrButtonCenterInactive}, + {SE_Editor, QS60StyleEnums::SP_QsnFrNotepadCenter}, }; static const int frameElementsCount = @@ -276,6 +278,9 @@ void QS60StylePrivate::drawSkinElement(SkinElements element, QPainter *painter, case SE_ButtonInactive: drawFrame(SF_ButtonInactive, painter, rect, flags | SF_PointNorth); break; + case SE_Editor: + drawFrame(SF_Editor, painter, rect, flags | SF_PointNorth); + break; default: break; } @@ -1875,6 +1880,12 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, } break; #endif //QT_NO_TOOLBAR + case CE_ShapedFrame: { + const QTextEdit *txt = qobject_cast(widget); + if (txt) + QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_Editor, painter, option->rect, flags); + } + break; default: QCommonStyle::drawControl(element, option, painter, widget); } diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index 54da9e8..7240978 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -270,7 +270,16 @@ public: SP_QsnFrButtonSideBInactive, SP_QsnFrButtonSideLInactive, SP_QsnFrButtonSideRInactive, - SP_QsnFrButtonCenterInactive + SP_QsnFrButtonCenterInactive, + SP_QsnFrNotepadCornerTl, + SP_QsnFrNotepadCornerTr, + SP_QsnFrNotepadCornerBl, + SP_QsnFrNotepadCornerBr, + SP_QsnFrNotepadSideT, + SP_QsnFrNotepadSideB, + SP_QsnFrNotepadSideL, + SP_QsnFrNotepadSideR, + SP_QsnFrNotepadCenter }; enum ColorLists { @@ -332,6 +341,7 @@ public: SE_ScrollBarHandlePressedHorizontal, //only for 5.0+ SE_ScrollBarHandlePressedVertical, SE_ButtonInactive, + SE_Editor, }; enum SkinFrameElements { @@ -349,6 +359,7 @@ public: SF_ToolBarButtonPressed, SF_PanelBackground, SF_ButtonInactive, + SF_Editor, }; enum SkinElementFlag { diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index dbb98c5..1f02efa 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -317,7 +317,17 @@ const partMapEntry QS60StyleModeSpecifics::m_partMap[] = { /* SP_QsnFrButtonSideBInactive */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b6}, /* SP_QsnFrButtonSideLInactive */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b7}, /* SP_QsnFrButtonSideRInactive */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b8}, - /* SP_QsnFrButtonCenterInactive */ {KAknsIIDQsnFrButtonTbCenter, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b9} + /* SP_QsnFrButtonCenterInactive */ {KAknsIIDQsnFrButtonTbCenter, EDrawIcon, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x21b9}, + + /*SP_QsnFrNotepadCornerTl */ {KAknsIIDQsnFrNotepadCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrNotepadCornerTr */ {KAknsIIDQsnFrNotepadCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrNotepadCornerBl */ {KAknsIIDQsnFrNotepadCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrNotepadCornerBr */ {KAknsIIDQsnFrNotepadCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrNotepadSideT */ {KAknsIIDQsnFrNotepadSideT, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrNotepadSideB */ {KAknsIIDQsnFrNotepadSideB, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrNotepadSideL */ {KAknsIIDQsnFrNotepadSideL, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrNotepadSideR */ {KAknsIIDQsnFrNotepadSideR, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrNotepadCenter */ {KAknsIIDQsnFrNotepadCenter, EDrawIcon, ES60_AllReleases, -1,-1} }; -- cgit v0.12 From dfffbd4d134f9b8adc75b2c33c31a2ee859903e6 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Fri, 5 Jun 2009 17:02:56 +0200 Subject: Initial version of softkey implementation that doesn't use softkeystack but instead softkeys are stored in QWidgets. --- src/gui/kernel/qwidget.cpp | 35 +++++++++++++- src/gui/kernel/qwidget.h | 4 ++ src/gui/kernel/qwidget_p.h | 4 ++ src/gui/kernel/qwidget_s60.cpp | 91 +++++++++++++++++++++++++++++++++++ src/gui/widgets/qmainwindow.cpp | 11 +++-- src/gui/widgets/qsoftkeystack.cpp | 2 + src/gui/widgets/qsoftkeystack_s60.cpp | 1 + 7 files changed, 144 insertions(+), 4 deletions(-) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 955ac8b..157a18e 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -5715,9 +5715,12 @@ bool QWidget::hasFocus() const void QWidget::setFocus(Qt::FocusReason reason) { + Q_D(QWidget); + d->setNativeSoftKeys(softKeys()); + if (!isEnabled()) return; - + QWidget *f = this; while (f->d_func()->extra && f->d_func()->extra->focus_proxy) f = f->d_func()->extra->focus_proxy; @@ -11509,6 +11512,36 @@ void QWidget::clearMask() setMask(QRegion()); } +const QList& QWidget::softKeys() const +{ + Q_D(const QWidget); + if( d->softKeys.count() > 0) + return d->softKeys; + + if (isWindow() || !parentWidget()) + return d->softKeys; + + return parentWidget()->softKeys(); +} + +void QWidget::setSoftKeys(QSoftKeyAction *softKey) +{ + Q_D(QWidget); + qDeleteAll(d->softKeys); + d->softKeys.append(softKey); +// d->setNativeSoftKeys(softkeys); +} + +void QWidget::setSoftKeys(const QList &softKeys) +{ + Q_D(QWidget); + qDeleteAll(d->softKeys); + for(int i = 0; i < softKeys.count(); i++) + d->softKeys.append(softKeys.at(i)); + + // d->setNativeSoftKeys(softkeys); +} + /*! \fn const QX11Info &QWidget::x11Info() const Returns information about the configuration of the X display used to display the widget. diff --git a/src/gui/kernel/qwidget.h b/src/gui/kernel/qwidget.h index 0dd470d..516d69a 100644 --- a/src/gui/kernel/qwidget.h +++ b/src/gui/kernel/qwidget.h @@ -70,6 +70,7 @@ class QWSRegionManager; class QStyle; class QAction; class QVariant; +class QSoftKeyAction; class QActionEvent; class QMouseEvent; @@ -554,6 +555,9 @@ public: void removeAction(QAction *action); QList actions() const; #endif + const QList& softKeys() const; + void setSoftKeys(QSoftKeyAction *softKey); + void setSoftKeys(const QList &softKeys); QWidget *parentWidget() const; diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index d5f1b98..90d9c93 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -85,6 +85,7 @@ class CCoeControl; class CAknTitlePane; class CAknContextPane; #endif +class QSoftKeyAction; QT_BEGIN_NAMESPACE @@ -102,6 +103,7 @@ class QPixmap; class QWidgetBackingStore; class QGraphicsProxyWidget; class QWidgetItemV2; +class QSoftKeyAction; class QStyle; @@ -224,6 +226,7 @@ public: explicit QWidgetPrivate(int version = QObjectPrivateVersion); ~QWidgetPrivate(); + void setNativeSoftKeys(const QList &softkeys); QWExtra *extraData() const; QTLWExtra *topData() const; QTLWExtra *maybeTopData() const; @@ -511,6 +514,7 @@ public: #ifndef QT_NO_ACTION QList actions; #endif + QList softKeys; QLayout *layout; QWidgetItemV2 *widgetItem; #if !defined(QT_NO_IM) diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 11cb974..c39dbf4 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -52,6 +52,9 @@ #include +#include +#include "qsoftkeyaction.h" + QT_BEGIN_NAMESPACE extern bool qt_nograb(); @@ -59,6 +62,83 @@ extern bool qt_nograb(); QWidget *QWidgetPrivate::mouseGrabber = 0; QWidget *QWidgetPrivate::keyboardGrabber = 0; +#define QSoftkeySet QList +// The following 2 defines may only be needed for s60. To be seen. +#define SOFTKEYSTART 5000 +#define SOFTKEYEND (5000 + Qt::Key_Context4-Qt::Key_Context1) + +static void mapSoftKeys(const QSoftkeySet &softkeys) +{ + if (softkeys.count() == 1 && softkeys.at(0)->role()==QSoftKeyAction::Menu) { + softkeys.at(0)->setNativePosition(0); + softkeys.at(0)->setQtContextKey(Qt::Key_Context1); + } + else if(softkeys.count() == 1 && softkeys.at(0)->role()!=QSoftKeyAction::Menu) { + softkeys.at(0)->setNativePosition(2); + softkeys.at(0)->setQtContextKey(Qt::Key_Context1); + } + else { + // FIX THIS + // veryWeirdMagic is needes as s60 5th edition sdk always panics if cba is set with index 1, this hops over it + // This needs further investigation why so that the hack can be removed + int veryWeirdMagic = 0; + for (int index = 0; index < softkeys.count(); index++) { + softkeys.at(index)->setNativePosition(index + veryWeirdMagic); + softkeys.at(index)->setQtContextKey(Qt::Key_Context1 + index); + if (veryWeirdMagic == 0) + veryWeirdMagic = 1; + } + } +} + +static bool isSame(const QList& a, const QList& b) +{ + bool isSame=true; + if ( a.count() != b.count()) + return false; + int index=0; + while (indexrole() != b.at(index)->role()) + return false; + if (a.at(index)->text().compare(b.at(index)->text())!=0) + return false; + index++; + } + return true; +} + + +void QWidgetPrivate::setNativeSoftKeys(const QList &softkeys) +{ + if (QApplication::focusWidget()) { + QList old = QApplication::focusWidget()->softKeys(); + if (isSame(old, softkeys )) + return; + } + + CCoeAppUi* appui = CEikonEnv::Static()->AppUi(); + CAknAppUi* aknAppUi = static_cast (appui); + CEikButtonGroupContainer* nativeContainer = aknAppUi->Cba(); + nativeContainer->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY_WITH_IDS); + + mapSoftKeys(softkeys); + + for (int index = 0; index < softkeys.count(); index++) { + const QSoftKeyAction* softKeyAction = softkeys.at(index); + if (softKeyAction->role() != QSoftKeyAction::ContextMenu) { + + HBufC* text = qt_QString2HBufCNewL(softKeyAction->text()); + CleanupStack::PushL(text); + if (softKeyAction->role() == QSoftKeyAction::Menu) { + nativeContainer->SetCommandL(softKeyAction->nativePosition(), EAknSoftkeyOptions, *text); + } else { + nativeContainer->SetCommandL(softKeyAction->nativePosition(), SOFTKEYSTART + softKeyAction->qtContextKey()-Qt::Key_Context1, *text); + } + CleanupStack::PopAndDestroy(); + } + } +} + void QWidgetPrivate::setWSGeometry(bool dontShow) { @@ -1003,5 +1083,16 @@ void QWidget::activateWindow() rw->SetOrdinalPosition(0); } } +/* +void QWidget::setSoftKeys(QSoftKeyAction *softKey) +{ + Q_D(QWidget); + d-> +} +void QWidget::setSoftKeys(const QList &softkeys) +{ + Q_D(QWidget); +} +*/ QT_END_NAMESPACE diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index 37b1398..20270b4 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -69,6 +69,7 @@ QT_END_NAMESPACE #ifndef QT_NO_SOFTKEYSTACK #include #endif +#include QT_BEGIN_NAMESPACE @@ -121,9 +122,9 @@ void QMainWindowPrivate::init() explicitIconSize = false; q->setAttribute(Qt::WA_Hover); -#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_SOFTKEYSTACK) - softKeyStack = new QSoftKeyStack(q); -#endif +//#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_SOFTKEYSTACK) +// softKeyStack = new QSoftKeyStack(q); +//#endif } /* @@ -495,6 +496,10 @@ void QMainWindow::setMenuBar(QMenuBar *menuBar) oldMenuBar->deleteLater(); } d->layout->setMenuBar(menuBar); + if (menuBar) { + QSoftKeyAction* menu = new QSoftKeyAction(QSoftKeyAction::Menu, QString::fromLatin1("Menu"), this); + setSoftKeys(menu); + } } /*! diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index 9a5a66c..6c00d35 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -196,6 +196,7 @@ QList menuActionList(QWidget *widget) void QSoftKeyStack::handleFocusChanged(QWidget *old, QWidget *now) { + return; if (!now) return; QWidget *w = qApp->activeWindow(); @@ -252,6 +253,7 @@ QToolBar* softKeyToolBar(QMainWindow *mainWindow) void QSoftKeyStackPrivate::setNativeSoftKeys() { + return; Q_Q(QSoftKeyStack); QMainWindow *parent = qobject_cast(q->parent()); if (!parent) diff --git a/src/gui/widgets/qsoftkeystack_s60.cpp b/src/gui/widgets/qsoftkeystack_s60.cpp index 8dfd5dd..a315a3b 100644 --- a/src/gui/widgets/qsoftkeystack_s60.cpp +++ b/src/gui/widgets/qsoftkeystack_s60.cpp @@ -73,6 +73,7 @@ void QSoftKeyStackPrivate::mapSoftKeys(const QSoftkeySet &top) void QSoftKeyStackPrivate::setNativeSoftKeys() { + return; CCoeAppUi* appui = CEikonEnv::Static()->AppUi(); CAknAppUi* aknAppUi = static_cast (appui); CEikButtonGroupContainer* nativeContainer = aknAppUi->Cba(); -- cgit v0.12 From 7f21512826689df38678c4cb954e9c347c01df8b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 5 Jun 2009 17:13:17 +0200 Subject: explicitly handle windows and mac9 line endings in practice, this matters only for backslashed line continuations Task-number: 255336 --- tools/linguist/shared/cpp.cpp | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/tools/linguist/shared/cpp.cpp b/tools/linguist/shared/cpp.cpp index 2e137cf..0aab661 100644 --- a/tools/linguist/shared/cpp.cpp +++ b/tools/linguist/shared/cpp.cpp @@ -134,13 +134,28 @@ static uint getChar() if (yyInPos >= yyInStr.size()) return EOF; uint c = yyInStr[yyInPos++].unicode(); - if (c == '\\' && yyInPos < yyInStr.size() && yyInStr[yyInPos].unicode() == '\n') { - ++yyCurLineNo; - ++yyInPos; - continue; + if (c == '\\' && yyInPos < yyInStr.size()) { + if (yyInStr[yyInPos].unicode() == '\n') { + ++yyCurLineNo; + ++yyInPos; + continue; + } + if (yyInStr[yyInPos].unicode() == '\r') { + ++yyCurLineNo; + ++yyInPos; + if (yyInPos < yyInStr.size() && yyInStr[yyInPos].unicode() == '\n') + ++yyInPos; + continue; + } } - if (c == '\n') + if (c == '\r') { + if (yyInPos < yyInStr.size() && yyInStr[yyInPos].unicode() == '\n') + ++yyInPos; + c = '\n'; ++yyCurLineNo; + } else if (c == '\n') { + ++yyCurLineNo; + } return c; } } -- cgit v0.12 From dabeec5e1d3f43b54a58b2f8667ac552a7c24685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Fri, 5 Jun 2009 17:46:48 +0200 Subject: My 4.5.2 changes. --- dist/changes-4.5.2 | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 1984881..810c022 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -131,6 +131,8 @@ Third party components * Fixed crash when drawing on a null pixmap. * [251534] Fixed issue where text with non-opaque color from widget palette would be blitted instead of blended. + * [253663] Fixed an issue with implicitly closed poly lines when using + perspective transforms. - QProgressBar * [252283] Fixed busy indicator for a QProgressBar with a style sheet applied to it. @@ -165,6 +167,8 @@ Third party components engine. * [251485] Fixed crash that could occur with projective transforms and high quality antialiasing. + * [253468] Fixed a crash in the GL 2 paint engine that could occur + when drawing text. - QCssParser * [252311] "font-family:" now handle fallback font specified with a comas @@ -186,6 +190,28 @@ Third party components - QPrintDialog * [253135] Crash in QPrintDialog when editing output filename + * [252873] Fixed an issue that could cause QPrintDialog to invalidate + a valid QPrinter object. + * [224728] Fixed an issue under X11 where QPrintDialog didn't update + the print-to-file state, if it was passed a QPrinter set up to + print PDF or PostScript. + +- QPrinter + * [252873] Fixed an issue with QPrinter::NativeFormat printers not + being valid. + * [248881] Fixed an issue under Windows where QPrinter::pageRect() returned + the wrong rect when QPrinter::fullPage() was set. + * [199271] Fixed an issue with QPrinter::setPrinterName()/printerName() + on Mac. + +- QSvg + * [253614] Fixed an issue with parsing the 'stroke-dasharray' SVG attribute. + +- QSvgIconEngine + * [251106] Fixed an issue that would cause QIcon::actualSize() to reparse + the SVG file for each acutalSize() call, until QIcon::pixmap() was called. + * [248848] Fixed an issue that would cause QIcon::pixmap() to reparse the + SVG file, even though there was a cached pixmap for that size available. **************************************************************************** * Database Drivers * @@ -202,17 +228,30 @@ Qt for Linux/X11 legacy freetype headers. [241361] Prevented asynchronous access to non-thread safe libfontconfig API. [244362] Worked around X server crash when calling XFillPolygon with more than -200000 points by falling back to raster paint engine. + 200000 points by falling back to raster paint engine. [250326] Titlebar wasn't shown on X11 with Qt::CustomizeWindowHint for fixed-size windows. [251925] Improved showing QMessageBox on small screens. [252042] Fixed the loading of the OpenSSL libraries on OpenBSD. +[255311] Fixed an issue with '-graphicssystem raster' on 8 and 16 bit X servers. +[252328] Fixed an issue when rendering old XLFD fonts on X11 with Xrender and + fontconfig enabled. +[248720] Fixed and issue with using '-graphicssystem raster' on X servers with + BGR color layout. +[196152] Fixed a problem with QPixmap::toImage() on big endian systems that + would cause the R and B channels to be swapped for 32 bit pixmaps. Qt for Windows -------------- +Fixed and issue with text rendering in 16 bit mode. + +[246196] Fixed an issue with clipped glyphs when rendering text with + certain fonts. [251259] Switching to another app left text cursor in line edits with QtMfc framework. +[253367] Fixed a memory leak when loading system icons on Windows. + Qt for Mac OS X --------------- @@ -220,6 +259,9 @@ Qt for Mac OS X [252176] Fix regression in drawing parts of pixmaps on Panther. [253402] Fix a crash when a Cocoa window that used to be a QWidget would get events after the QWidget was destroyed. +[249178] Fixed an issue with drawing text to QImages on Mac/Cocoa. +[250066] Fixed an issue that caused reparenting of QGLWidgets to output warnings + on Mac/Cocoa. Qt for Embedded Linux -- cgit v0.12 From f2b307342a0effed58436dd199a0d80c5e651755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Fri, 5 Jun 2009 17:48:37 +0200 Subject: Fixed typos. --- dist/changes-4.5.2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 810c022..39082f6 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -236,7 +236,7 @@ legacy freetype headers. [255311] Fixed an issue with '-graphicssystem raster' on 8 and 16 bit X servers. [252328] Fixed an issue when rendering old XLFD fonts on X11 with Xrender and fontconfig enabled. -[248720] Fixed and issue with using '-graphicssystem raster' on X servers with +[248720] Fixed an issue with using '-graphicssystem raster' on X servers with BGR color layout. [196152] Fixed a problem with QPixmap::toImage() on big endian systems that would cause the R and B channels to be swapped for 32 bit pixmaps. @@ -244,7 +244,7 @@ legacy freetype headers. Qt for Windows -------------- -Fixed and issue with text rendering in 16 bit mode. +Fixed an issue with text rendering in 16 bit mode. [246196] Fixed an issue with clipped glyphs when rendering text with certain fonts. -- cgit v0.12 From b8d6e02fc73fec1c1bc6b5b21e80104be61b946e Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Sat, 6 Jun 2009 13:09:26 +0200 Subject: Added SoftKeyRole --- src/gui/kernel/qaction.cpp | 25 +++++++++++++++++++++++++ src/gui/kernel/qaction.h | 9 +++++++++ src/gui/kernel/qaction_p.h | 1 + 3 files changed, 35 insertions(+) diff --git a/src/gui/kernel/qaction.cpp b/src/gui/kernel/qaction.cpp index abb17d7..e32416a 100644 --- a/src/gui/kernel/qaction.cpp +++ b/src/gui/kernel/qaction.cpp @@ -1348,6 +1348,31 @@ QAction::MenuRole QAction::menuRole() const } /*! + \property QAction::softKeyRole + \brief the action's softkey role + \since 4.6 + + This indicates what softkey action this action is. Usually used on mobile + platforms to map QActions no hardware keys. + + The softkey role can be changed any time. +*/ +void QAction::setSoftKeyRole(SoftKeyRole softKeyRole) +{ + Q_D(QAction); + if (d->softKeyRole == softKeyRole) + return; + + d->softKeyRole = softKeyRole; + d->sendDataChanged(); +} + +QAction::SoftKeyRole QAction::softKeyRole() const +{ + Q_D(const QAction); + return d->softKeyRole; +} +/*! \property QAction::iconVisibleInMenu \brief Whether or not an action should show an icon in a menu \since 4.4 diff --git a/src/gui/kernel/qaction.h b/src/gui/kernel/qaction.h index d7bf8c3..e9c64c8 100644 --- a/src/gui/kernel/qaction.h +++ b/src/gui/kernel/qaction.h @@ -67,6 +67,7 @@ class Q_GUI_EXPORT QAction : public QObject Q_DECLARE_PRIVATE(QAction) Q_ENUMS(MenuRole) + Q_ENUMS(SoftKeyRole) Q_PROPERTY(bool checkable READ isCheckable WRITE setCheckable) Q_PROPERTY(bool checked READ isChecked WRITE setChecked DESIGNABLE isCheckable NOTIFY toggled) Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled) @@ -84,11 +85,16 @@ class Q_GUI_EXPORT QAction : public QObject #endif Q_PROPERTY(bool visible READ isVisible WRITE setVisible) Q_PROPERTY(MenuRole menuRole READ menuRole WRITE setMenuRole) + Q_PROPERTY(SoftKeyRole softKeyRole READ softKeyRole WRITE setSoftKeyRole) Q_PROPERTY(bool iconVisibleInMenu READ isIconVisibleInMenu WRITE setIconVisibleInMenu) public: enum MenuRole { NoRole, TextHeuristicRole, ApplicationSpecificRole, AboutQtRole, AboutRole, PreferencesRole, QuitRole }; + enum SoftKeyRole { Options, Select, Back, Next, Previous, Ok, Cancel, Edit, + View, BackSpace, EndEdit, RevertEdit, Deselect, Finish, Menu, + ContextMenu, Custom, SoftKey1, SoftKey2, SoftKey3, SoftKey4 }; + explicit QAction(QObject* parent); QAction(const QString &text, QObject* parent); QAction(const QIcon &icon, const QString &text, QObject* parent); @@ -168,6 +174,9 @@ public: void setMenuRole(MenuRole menuRole); MenuRole menuRole() const; + void setSoftKeyRole(SoftKeyRole softKeyRole); + SoftKeyRole softKeyRole() const; + void setIconVisibleInMenu(bool visible); bool isIconVisibleInMenu() const; diff --git a/src/gui/kernel/qaction_p.h b/src/gui/kernel/qaction_p.h index 0617ef5..6051d9a 100644 --- a/src/gui/kernel/qaction_p.h +++ b/src/gui/kernel/qaction_p.h @@ -102,6 +102,7 @@ public: uint separator : 1; uint fontSet : 1; QAction::MenuRole menuRole; + QAction::SoftKeyRole softKeyRole; int iconVisibleInMenu : 3; // Only has values -1, 0, and 1 QList widgets; #ifndef QT_NO_GRAPHICSVIEW -- cgit v0.12 From f87e69fcb26387e8d22546778bb1f5d43ba8e200 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Sat, 6 Jun 2009 14:11:10 +0200 Subject: Renamed SoftKeyRoles to be more descriptive --- src/gui/kernel/qaction.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qaction.h b/src/gui/kernel/qaction.h index e9c64c8..6725f42 100644 --- a/src/gui/kernel/qaction.h +++ b/src/gui/kernel/qaction.h @@ -91,9 +91,11 @@ class Q_GUI_EXPORT QAction : public QObject public: enum MenuRole { NoRole, TextHeuristicRole, ApplicationSpecificRole, AboutQtRole, AboutRole, PreferencesRole, QuitRole }; - enum SoftKeyRole { Options, Select, Back, Next, Previous, Ok, Cancel, Edit, - View, BackSpace, EndEdit, RevertEdit, Deselect, Finish, Menu, - ContextMenu, Custom, SoftKey1, SoftKey2, SoftKey3, SoftKey4 }; + enum SoftKeyRole { OptionsSoftKey, SelectSoftKey, BackSoftKey, NextSoftKey, PreviousSoftKey, + OkSoftKey, CancelSoftKey, EditSoftKey, ViewSoftKey, BackSpaceSoftKey, + EndEditSoftKey, RevertEditSoftKey, DeselectSoftKey, FinishSoftKey, + MenuSoftKey, ContextMenuSoftKey, Key1SoftKey, Key2SoftKey, + Key3SoftKey, Key4SoftKey, CustomSoftKey }; explicit QAction(QObject* parent); QAction(const QString &text, QObject* parent); -- cgit v0.12 From 449d4b00c6e3d8a277821e5fb5837e3da2e6b920 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Sat, 6 Jun 2009 14:11:53 +0200 Subject: Replaced usage of QSoftKeyActions with QActions+SoftKeyRoles --- src/gui/kernel/qwidget.cpp | 6 +++--- src/gui/kernel/qwidget.h | 7 +++---- src/gui/kernel/qwidget_p.h | 5 ++--- src/gui/kernel/qwidget_s60.cpp | 33 +++++++++++++++++++-------------- src/gui/widgets/qmainwindow.cpp | 3 ++- 5 files changed, 29 insertions(+), 25 deletions(-) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 157a18e..e18b66b 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -11512,7 +11512,7 @@ void QWidget::clearMask() setMask(QRegion()); } -const QList& QWidget::softKeys() const +const QList& QWidget::softKeys() const { Q_D(const QWidget); if( d->softKeys.count() > 0) @@ -11524,7 +11524,7 @@ const QList& QWidget::softKeys() const return parentWidget()->softKeys(); } -void QWidget::setSoftKeys(QSoftKeyAction *softKey) +void QWidget::setSoftKeys(QAction *softKey) { Q_D(QWidget); qDeleteAll(d->softKeys); @@ -11532,7 +11532,7 @@ void QWidget::setSoftKeys(QSoftKeyAction *softKey) // d->setNativeSoftKeys(softkeys); } -void QWidget::setSoftKeys(const QList &softKeys) +void QWidget::setSoftKeys(const QList &softKeys) { Q_D(QWidget); qDeleteAll(d->softKeys); diff --git a/src/gui/kernel/qwidget.h b/src/gui/kernel/qwidget.h index 516d69a..36a30ac 100644 --- a/src/gui/kernel/qwidget.h +++ b/src/gui/kernel/qwidget.h @@ -70,7 +70,6 @@ class QWSRegionManager; class QStyle; class QAction; class QVariant; -class QSoftKeyAction; class QActionEvent; class QMouseEvent; @@ -555,9 +554,9 @@ public: void removeAction(QAction *action); QList actions() const; #endif - const QList& softKeys() const; - void setSoftKeys(QSoftKeyAction *softKey); - void setSoftKeys(const QList &softKeys); + const QList& softKeys() const; + void setSoftKeys(QAction *softKey); + void setSoftKeys(const QList &softKeys); QWidget *parentWidget() const; diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index 90d9c93..645b13d 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -85,7 +85,6 @@ class CCoeControl; class CAknTitlePane; class CAknContextPane; #endif -class QSoftKeyAction; QT_BEGIN_NAMESPACE @@ -226,7 +225,7 @@ public: explicit QWidgetPrivate(int version = QObjectPrivateVersion); ~QWidgetPrivate(); - void setNativeSoftKeys(const QList &softkeys); + void setNativeSoftKeys(const QList &softkeys); QWExtra *extraData() const; QTLWExtra *topData() const; QTLWExtra *maybeTopData() const; @@ -514,7 +513,7 @@ public: #ifndef QT_NO_ACTION QList actions; #endif - QList softKeys; + QList softKeys; QLayout *layout; QWidgetItemV2 *widgetItem; #if !defined(QT_NO_IM) diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index c39dbf4..a23469e 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -53,7 +53,6 @@ #include #include -#include "qsoftkeyaction.h" QT_BEGIN_NAMESPACE @@ -62,18 +61,18 @@ extern bool qt_nograb(); QWidget *QWidgetPrivate::mouseGrabber = 0; QWidget *QWidgetPrivate::keyboardGrabber = 0; -#define QSoftkeySet QList +#define QSoftkeySet QList // The following 2 defines may only be needed for s60. To be seen. #define SOFTKEYSTART 5000 #define SOFTKEYEND (5000 + Qt::Key_Context4-Qt::Key_Context1) static void mapSoftKeys(const QSoftkeySet &softkeys) { - if (softkeys.count() == 1 && softkeys.at(0)->role()==QSoftKeyAction::Menu) { +/* if (softkeys.count() == 1 && softkeys.at(0)->menuRole()==QAction::MenuSoftKey) { softkeys.at(0)->setNativePosition(0); softkeys.at(0)->setQtContextKey(Qt::Key_Context1); } - else if(softkeys.count() == 1 && softkeys.at(0)->role()!=QSoftKeyAction::Menu) { + else if(softkeys.count() == 1 && softkeys.at(0)->menuRole()!=QAction::MenuSoftKey) { softkeys.at(0)->setNativePosition(2); softkeys.at(0)->setQtContextKey(Qt::Key_Context1); } @@ -89,16 +88,17 @@ static void mapSoftKeys(const QSoftkeySet &softkeys) veryWeirdMagic = 1; } } +*/ } -static bool isSame(const QList& a, const QList& b) +static bool isSame(const QList& a, const QList& b) { bool isSame=true; if ( a.count() != b.count()) return false; int index=0; while (indexrole() != b.at(index)->role()) + if (a.at(index)->softKeyRole() != b.at(index)->softKeyRole()) return false; if (a.at(index)->text().compare(b.at(index)->text())!=0) return false; @@ -108,10 +108,10 @@ static bool isSame(const QList& a, const QList } -void QWidgetPrivate::setNativeSoftKeys(const QList &softkeys) +void QWidgetPrivate::setNativeSoftKeys(const QList &softkeys) { if (QApplication::focusWidget()) { - QList old = QApplication::focusWidget()->softKeys(); + QList old = QApplication::focusWidget()->softKeys(); if (isSame(old, softkeys )) return; } @@ -122,20 +122,25 @@ void QWidgetPrivate::setNativeSoftKeys(const QList &softkeys) nativeContainer->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY_WITH_IDS); mapSoftKeys(softkeys); - + int placeInScreen=0; + for (int index = 0; index < softkeys.count(); index++) { - const QSoftKeyAction* softKeyAction = softkeys.at(index); - if (softKeyAction->role() != QSoftKeyAction::ContextMenu) { + const QAction* softKeyAction = softkeys.at(index); + if (softKeyAction->softKeyRole() != QAction::ContextMenuSoftKey) { HBufC* text = qt_QString2HBufCNewL(softKeyAction->text()); CleanupStack::PushL(text); - if (softKeyAction->role() == QSoftKeyAction::Menu) { - nativeContainer->SetCommandL(softKeyAction->nativePosition(), EAknSoftkeyOptions, *text); + if (softKeyAction->softKeyRole() == QAction::MenuSoftKey) { + nativeContainer->SetCommandL(placeInScreen, EAknSoftkeyOptions, *text); } else { - nativeContainer->SetCommandL(softKeyAction->nativePosition(), SOFTKEYSTART + softKeyAction->qtContextKey()-Qt::Key_Context1, *text); + nativeContainer->SetCommandL(placeInScreen, SOFTKEYSTART + index, *text); } CleanupStack::PopAndDestroy(); + placeInScreen++; } + if (placeInScreen==1) + placeInScreen=2; + } } diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index 20270b4..a12c32b 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -497,7 +497,8 @@ void QMainWindow::setMenuBar(QMenuBar *menuBar) } d->layout->setMenuBar(menuBar); if (menuBar) { - QSoftKeyAction* menu = new QSoftKeyAction(QSoftKeyAction::Menu, QString::fromLatin1("Menu"), this); + QAction* menu = new QAction(QString::fromLatin1("Menu"), this); + menu->setSoftKeyRole(QAction::MenuSoftKey); setSoftKeys(menu); } } -- cgit v0.12 From 4dd8985db4653a3f4f406f4fe7c910ffd02643b3 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Sat, 6 Jun 2009 14:29:00 +0200 Subject: Added mapping from native hardware keys to softkeys. This enables the QActions with softKeyRole to be triggered --- src/gui/kernel/qapplication_s60.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 94e59b3..2c7fc02 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1064,8 +1064,15 @@ void QApplication::symbianHandleCommand(int command) exit(); break; default: - if (command >= SOFTKEYSTART && command <= SOFTKEYEND) - QSoftKeyStackPrivate::handleSoftKeyPress(command); + if (command >= SOFTKEYSTART && command <= SOFTKEYEND) { + int index= command-SOFTKEYSTART; + QWidget* focused = QApplication::focusWidget(); + const QList& softKeys = focused->softKeys(); + if (index>=softKeys.count()) { + // Assert horrible state error + } + softKeys.at(index)->activate(QAction::Trigger); + } else QMenuBarPrivate::symbianCommands(command); break; -- cgit v0.12 From d0432c7d7c06c83ccaa2266217e5b1823fa8dba6 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Sat, 6 Jun 2009 14:30:32 +0200 Subject: Replaced usage of QSoftKeyStack with QActions having SoftKeyRole --- src/gui/widgets/qmainwindow.cpp | 62 ----------------------------------------- src/gui/widgets/qmainwindow.h | 9 +----- 2 files changed, 1 insertion(+), 70 deletions(-) diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index a12c32b..90c5db9 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -66,11 +66,6 @@ extern OSWindowRef qt_mac_window_for(const QWidget *); // qwidget_mac.cpp QT_END_NAMESPACE #endif -#ifndef QT_NO_SOFTKEYSTACK -#include -#endif -#include - QT_BEGIN_NAMESPACE class QMainWindowPrivate : public QWidgetPrivate @@ -85,9 +80,6 @@ public: #if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_CURSOR) , hasOldCursor(false) , cursorAdjusted(false) #endif -#ifndef QT_NO_SOFTKEYSTACK - , softKeyStack(0) -#endif { } QMainWindowLayout *layout; QSize iconSize; @@ -107,10 +99,6 @@ public: uint hasOldCursor : 1; uint cursorAdjusted : 1; #endif - -#ifndef QT_NO_SOFTKEYSTACK - QSoftKeyStack *softKeyStack; -#endif }; void QMainWindowPrivate::init() @@ -122,9 +110,6 @@ void QMainWindowPrivate::init() explicitIconSize = false; q->setAttribute(Qt::WA_Hover); -//#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_SOFTKEYSTACK) -// softKeyStack = new QSoftKeyStack(q); -//#endif } /* @@ -534,53 +519,6 @@ void QMainWindow::setMenuWidget(QWidget *menuBar) } #endif // QT_NO_MENUBAR -#ifndef QT_NO_SOFTKEYSTACK -/*! - Returns the softkey stack for the main window. This function creates - and returns an empty soft key stack if the stack does not exist. - - \sa softKeyStack() -*/ -QSoftKeyStack *QMainWindow::softKeyStack() const -{ - if (!d_func()->softKeyStack) { - QMainWindow *self = const_cast(this); - QSoftKeyStack* softKeyStack = new QSoftKeyStack(self); - self->setSoftKeyStack(softKeyStack); - } - return d_func()->softKeyStack; -} - -/*! - Sets the softkey stack for the main window to \a softKeyStack. - - Note: QMainWindow takes ownership of the \a softKeyStack pointer and - deletes it at the appropriate time. - - \sa softKeyStack() -*/ -void QMainWindow::setSoftKeyStack(QSoftKeyStack *softKeyStack) -{ - Q_D(QMainWindow); - if (d->softKeyStack && d->softKeyStack != softKeyStack) { - QSoftKeyStack *oldSoftKeyStack = d->softKeyStack; - delete oldSoftKeyStack; - } - d->softKeyStack = softKeyStack; -} - -/*! - Returns true if QMainWindow has a softkeystack and false otherwise - - \sa softKeyStack() -*/ -bool QMainWindow::hasSoftKeyStack() const -{ - Q_D(const QMainWindow); - return d->softKeyStack != 0; -} -#endif // QT_NO_SOFTKEYSTACK - #ifndef QT_NO_STATUSBAR /*! Returns the status bar for the main window. This function creates diff --git a/src/gui/widgets/qmainwindow.h b/src/gui/widgets/qmainwindow.h index 81457d6..9983c7a 100644 --- a/src/gui/widgets/qmainwindow.h +++ b/src/gui/widgets/qmainwindow.h @@ -59,7 +59,6 @@ class QMenuBar; class QStatusBar; class QToolBar; class QMenu; -class QSoftKeyStack; class Q_GUI_EXPORT QMainWindow : public QWidget { @@ -130,13 +129,7 @@ public: QWidget *menuWidget() const; void setMenuWidget(QWidget *menubar); #endif - -#ifndef QT_NO_SOFTKEYSTACK - QSoftKeyStack *softKeyStack() const; - void setSoftKeyStack(QSoftKeyStack *softKeyStack); - bool hasSoftKeyStack() const; -#endif - + #ifndef QT_NO_STATUSBAR QStatusBar *statusBar() const; void setStatusBar(QStatusBar *statusbar); -- cgit v0.12 From 934ebcd3e3c1c568ac8371dbb1d96cd06385883d Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Sat, 6 Jun 2009 14:31:22 +0200 Subject: Disabled context sensitive menu because it would cause compilation failure. Context menu will be enabled again once the QAction SoftKeyRole implementation is in state where context menu can be properly supported --- src/gui/widgets/qmenu_symbian.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index f27e580..df95061 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -214,7 +214,7 @@ static void rebuildMenu() QMenuBarPrivate *mb = 0; QWidget *w = qApp->activeWindow(); QMainWindow *mainWindow = qobject_cast(w); - if ((mainWindow) && mainWindow->hasSoftKeyStack()) { + /* if ((mainWindow) && mainWindow->hasSoftKeyStack()) { QSoftKeyStack* softKeyStack = mainWindow->softKeyStack(); if (!softKeyStack->isEmpty()) { const QSoftkeySet& softKeyTop = softKeyStack->top(); @@ -231,7 +231,7 @@ static void rebuildMenu() } } } - +*/ if (w) { mb = menubars()->value(w); qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM; -- cgit v0.12 From 7749376ff1536c703d223e16506eed1a61132a41 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Sat, 6 Jun 2009 16:17:01 +0200 Subject: Removed QSoftKeyStack and replaced places using it with the new improved softkey interface in QWidget --- src/gui/itemviews/qabstractitemview.cpp | 5 +- src/gui/kernel/qapplication_s60.cpp | 1 - src/gui/kernel/qwidget.cpp | 3 +- src/gui/kernel/qwidget_p.h | 1 - src/gui/widgets/qcombobox.cpp | 7 +- src/gui/widgets/qmenu.cpp | 8 +- src/gui/widgets/qmenu_symbian.cpp | 2 - src/gui/widgets/qsoftkeyaction.cpp | 234 ------------------------ src/gui/widgets/qsoftkeyaction.h | 106 ----------- src/gui/widgets/qsoftkeystack.cpp | 306 -------------------------------- src/gui/widgets/qsoftkeystack.h | 89 ---------- src/gui/widgets/qsoftkeystack_p.h | 111 ------------ src/gui/widgets/qsoftkeystack_s60.cpp | 120 ------------- src/gui/widgets/widgets.pri | 8 +- 14 files changed, 10 insertions(+), 991 deletions(-) delete mode 100644 src/gui/widgets/qsoftkeyaction.cpp delete mode 100644 src/gui/widgets/qsoftkeyaction.h delete mode 100644 src/gui/widgets/qsoftkeystack.cpp delete mode 100644 src/gui/widgets/qsoftkeystack.h delete mode 100644 src/gui/widgets/qsoftkeystack_p.h delete mode 100644 src/gui/widgets/qsoftkeystack_s60.cpp diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index 565bc28..187e2cd 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -61,9 +61,6 @@ #ifndef QT_NO_ACCESSIBILITY #include #endif -#ifdef QT_KEYPAD_NAVIGATION -#include -#endif QT_BEGIN_NAMESPACE @@ -2006,7 +2003,7 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event) if (QApplication::keypadNavigationEnabled()) { if (!hasEditFocus()) { setEditFocus(true); - QKeyEventSoftKey::addSoftKey(QSoftKeyAction::Back, Qt::Key_Back, this); + QKeyEventSoftKey::addSoftKey(QAction::Back, Qt::Key_Back, this); return; } } diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 2c7fc02..6ee7899 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -58,7 +58,6 @@ #endif #include "private/qwindowsurface_s60_p.h" #include "qpaintengine.h" -#include "private/qsoftkeystack_p.h" #include "private/qmenubar_p.h" #include "apgwgnam.h" // For CApaWindowGroupName diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index e18b66b..0a7fea3 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -11528,7 +11528,8 @@ void QWidget::setSoftKeys(QAction *softKey) { Q_D(QWidget); qDeleteAll(d->softKeys); - d->softKeys.append(softKey); + if (softKey) + d->softKeys.append(softKey); // d->setNativeSoftKeys(softkeys); } diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index 645b13d..9a606dc 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -102,7 +102,6 @@ class QPixmap; class QWidgetBackingStore; class QGraphicsProxyWidget; class QWidgetItemV2; -class QSoftKeyAction; class QStyle; diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp index 59b740f..aa90909 100644 --- a/src/gui/widgets/qcombobox.cpp +++ b/src/gui/widgets/qcombobox.cpp @@ -63,7 +63,7 @@ #include #include #include - +#include #ifdef Q_WS_X11 #include #endif @@ -75,9 +75,6 @@ #ifndef QT_NO_EFFECTS # include #endif -#ifdef QT_KEYPAD_NAVIGATION -# include -#endif QT_BEGIN_NAMESPACE extern QHash *qt_app_fonts_hash(); @@ -2441,7 +2438,7 @@ void QComboBox::showPopup() #ifdef QT_KEYPAD_NAVIGATION if (QApplication::keypadNavigationEnabled()) view()->setEditFocus(true); - QKeyEventSoftKey::addSoftKey(QSoftKeyAction::Cancel, Qt::Key_Back, this); + QKeyEventSoftKey::addSoftKey(QAction::CancelSoftKey, Qt::Key_Back, this); #endif } diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index c4db539..d713081 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -60,9 +60,7 @@ #ifndef QT_NO_WHATSTHIS # include #endif -#ifdef QT_KEYPAD_NAVIGATION -# include -#endif +#include #include "qmenu_p.h" #include "qmenubar_p.h" @@ -586,7 +584,7 @@ void QMenuPrivate::setCurrentAction(QAction *action, int popup, SelectionReason #ifdef QT_KEYPAD_NAVIGATION // TODO: aportale, remove KEYPAD_NAVIGATION_HACK when softkey stack // handles focus related and user related actions separately... - QKeyEventSoftKey::addSoftKey(QSoftKeyAction::Cancel, Qt::Key_Back, q); + QKeyEventSoftKey::addSoftKey(QAction::CancelSoftKey, Qt::Key_Back, q); #endif } } @@ -1947,7 +1945,7 @@ void QMenu::popup(const QPoint &p, QAction *atAction) QAccessible::updateAccessibility(this, 0, QAccessible::PopupMenuStart); #endif #ifdef QT_KEYPAD_NAVIGATION - QKeyEventSoftKey::addSoftKey(QSoftKeyAction::Cancel, Qt::Key_Back, this); + QKeyEventSoftKey::addSoftKey(QAction::CancelSoftKey, Qt::Key_Back, this); #endif } diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index df95061..e422882 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -56,8 +56,6 @@ #include #include #include -#include -#include #ifndef QT_NO_MENUBAR QT_BEGIN_NAMESPACE diff --git a/src/gui/widgets/qsoftkeyaction.cpp b/src/gui/widgets/qsoftkeyaction.cpp deleted file mode 100644 index 302850c..0000000 --- a/src/gui/widgets/qsoftkeyaction.cpp +++ /dev/null @@ -1,234 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qsoftkeyaction.h" -#include - -/*! - \class QSoftKeyAction - \brief The QSoftKeyAction class defines a special kind of QAction that may also be displayed in a QSoftKeyBar. -*/ - -class QSoftKeyActionPrivate : public QActionPrivate -{ -public: - QSoftKeyActionPrivate(QSoftKeyAction::StandardRole role = QSoftKeyAction::Custom) - { - this->role = role; - } - - static QString roleText(QSoftKeyAction::StandardRole role); - - QSoftKeyAction::StandardRole role; - QString roleName; - int nativePosition; - int qtContextKey; -}; - -QString QSoftKeyActionPrivate::roleText(QSoftKeyAction::StandardRole role) -{ - switch (role) { - case QSoftKeyAction::Options: - return QSoftKeyAction::tr("Options"); - case QSoftKeyAction::Select: - return QSoftKeyAction::tr("Select"); - case QSoftKeyAction::Back: - return QSoftKeyAction::tr("Back"); - case QSoftKeyAction::Next: - return QSoftKeyAction::tr("Next"); - case QSoftKeyAction::Previous: - return QSoftKeyAction::tr("Previous"); - case QSoftKeyAction::Ok: - return QSoftKeyAction::tr("Ok"); - case QSoftKeyAction::Cancel: - return QSoftKeyAction::tr("Cancel"); - case QSoftKeyAction::Edit: - return QSoftKeyAction::tr("Edit"); - case QSoftKeyAction::View: - return QSoftKeyAction::tr("View"); - default: - return QString(); - }; -} - -/*! - \enum QSoftKeyAction::StandardRole - This enum defines the standard role for a QSoftKeyAction. - - \value Options - \value Select - \value Back - \value Next - \value Previous - \value Ok - \value Cancel - \value Edit - \value View - \value BackSpace - \value EndEdit - \value RevertEdit - \value Deselect - \value Finish - \value Custom -*/ - -QSoftKeyAction::QSoftKeyAction(QObject *parent) - : QAction(*new QSoftKeyActionPrivate(), parent) -{ -} - -QSoftKeyAction::QSoftKeyAction(StandardRole role, QObject *parent) - : QAction(*new QSoftKeyActionPrivate(), parent) -{ - Q_D(QSoftKeyAction); - d->role = role; - setText(QSoftKeyActionPrivate::roleText(role)); -} - -QSoftKeyAction::QSoftKeyAction(const QString &text, QObject* parent) - : QAction(*new QSoftKeyActionPrivate(), parent) -{ - setText(text); -} - -QSoftKeyAction::QSoftKeyAction(StandardRole role, const QString &text, QObject* parent) - : QAction(*new QSoftKeyActionPrivate(), parent) -{ - setText(text); - Q_D(QSoftKeyAction); - d->role = role; -} - -QSoftKeyAction::QSoftKeyAction(const QIcon &icon, const QString &text, QObject* parent) - : QAction(*new QSoftKeyActionPrivate(), parent) -{ - setIcon(icon); - setText(text); -} - -QSoftKeyAction::QSoftKeyAction(StandardRole role, const QIcon &icon, const QString &text, QObject* parent) - : QAction(*new QSoftKeyActionPrivate(), parent) -{ - setIcon(icon); - setText(text); - Q_D(QSoftKeyAction); - d->role = role; -} - -QSoftKeyAction::~QSoftKeyAction() -{ -} - -/*! - Returns the standard role associated with this action, or Custom - if the role is defined by roleName(). - - \sa setRole(), roleName() -*/ -QSoftKeyAction::StandardRole QSoftKeyAction::role() const -{ - Q_D(const QSoftKeyAction); - return d->role; -} - -/*! - Returns the custom role name if role() is Custom, or an empty - string otherwise. - - \sa role(), setRole() -*/ -QString QSoftKeyAction::roleName() const -{ - Q_D(const QSoftKeyAction); - return d->roleName; -} - -/*! - Sets the standard role associated with this action to \a role, - and also sets roleName() to the empty string. - - \sa role(), roleName() -*/ -void QSoftKeyAction::setRole(StandardRole role) -{ - Q_D(QSoftKeyAction); - d->role = role; - d->roleName = QString(); - emit changed(); -} - -/*! - Sets the custom roleName() associated with this action to \a role, - and also sets role() to Custom. - - \sa role(), roleName() -*/ -void QSoftKeyAction::setRole(const QString& role) -{ - Q_D(QSoftKeyAction); - d->role = Custom; - d->roleName = role; - emit changed(); -} - -int QSoftKeyAction::nativePosition() const -{ - Q_D(const QSoftKeyAction); - return d->nativePosition; -} - -void QSoftKeyAction::setNativePosition(int position) -{ - Q_D(QSoftKeyAction); - d->nativePosition = position; -} - -int QSoftKeyAction::qtContextKey() const -{ - Q_D(const QSoftKeyAction); - return d->qtContextKey; -} - -void QSoftKeyAction::setQtContextKey(int key) -{ - Q_D(QSoftKeyAction); - d->qtContextKey = key; -} diff --git a/src/gui/widgets/qsoftkeyaction.h b/src/gui/widgets/qsoftkeyaction.h deleted file mode 100644 index 77aeac0..0000000 --- a/src/gui/widgets/qsoftkeyaction.h +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QSOFTKEYACTION_H -#define QSOFTKEYACTION_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Gui) - -class QSoftKeyActionPrivate; - -class Q_GUI_EXPORT QSoftKeyAction : public QAction -{ - Q_OBJECT -public: - enum StandardRole { - Options=0, - Select, - Back, - Next, - Previous, - Ok, - Cancel, - Edit, - View, - BackSpace, - EndEdit, - RevertEdit, - Deselect, - Finish, - Menu, - ContextMenu, - Custom - }; - - QSoftKeyAction(QObject *parent); - QSoftKeyAction(StandardRole role, QObject *parent); - QSoftKeyAction(const QString &text, QObject *parent); - QSoftKeyAction(StandardRole role, const QString &text, QObject *parent); - QSoftKeyAction(const QIcon &icon, const QString &text, QObject *parent); - QSoftKeyAction(StandardRole role, const QIcon &icon, const QString &text, QObject *parent); - ~QSoftKeyAction(); - - StandardRole role() const; - QString roleName() const; - - void setRole(StandardRole role); - void setRole(const QString &role); - int nativePosition() const; - void setNativePosition(int position); - int qtContextKey() const; - void setQtContextKey(int position); - -private: - Q_DECLARE_PRIVATE(QSoftKeyAction) - Q_DISABLE_COPY(QSoftKeyAction) -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QSOFTKEYACTION_H diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp deleted file mode 100644 index 6c00d35..0000000 --- a/src/gui/widgets/qsoftkeystack.cpp +++ /dev/null @@ -1,306 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qsoftkeystack.h" -#include "qsoftkeystack_p.h" -#include "qapplication.h" -#include "qmainwindow.h" -#include "qevent.h" - -#if !defined(Q_WS_S60) -#include "qtoolbar.h" -#endif - -static bool isSame(const QSoftkeySet& a, const QSoftkeySet& b) -{ - bool isSame=true; - if ( a.count() != b.count()) - return false; - int index=0; - while (indexrole() != b.at(index)->role()) - return false; - if (a.at(index)->text().compare(b.at(index)->text())!=0) - return false; - index++; - } - return true; -} - -QSoftKeyStackPrivate::QSoftKeyStackPrivate() -{ - -} - -QSoftKeyStackPrivate::~QSoftKeyStackPrivate() -{ - -} - -void QSoftKeyStackPrivate::push(QSoftKeyAction *softKey) -{ - QSoftkeySet softKeySet; - softKeySet.append(softKey); - push(softKeySet); -} - -void QSoftKeyStackPrivate::push(const QList &softkeys) -{ - QSoftkeySet softKeySet(softkeys); - softKeyStack.push(softKeySet); - setNativeSoftKeys(); -} - -void QSoftKeyStackPrivate::pop() -{ - qDeleteAll(softKeyStack.pop()); - setNativeSoftKeys(); -} - -void QSoftKeyStackPrivate::popandPush(QSoftKeyAction *softKey) -{ - QSoftkeySet newSoftKeySet; - newSoftKeySet.append(softKey); - popandPush(newSoftKeySet); -} - -void QSoftKeyStackPrivate::popandPush(const QList &softkeys) -{ - QSoftkeySet oldSoftKeySet = softKeyStack.pop(); - QSoftkeySet newSoftKeySet(softkeys); - softKeyStack.push(newSoftKeySet); -#ifdef Q_WS_S60 - // Don't flicker on Symbian. - // Platforms that use QActions as native SoftKeys must always call setNativeSoftKeys - // Otherwise the following deletion of oldSoftKeySet would remove the softkeys - if (!isSame(oldSoftKeySet, newSoftKeySet)) -#endif - setNativeSoftKeys(); - qDeleteAll(oldSoftKeySet); -} - -const QSoftkeySet& QSoftKeyStackPrivate::top() -{ - return softKeyStack.top(); -} - -bool QSoftKeyStackPrivate::isEmpty() -{ - return softKeyStack.isEmpty(); -} - -QSoftKeyStack::QSoftKeyStack(QWidget *parent) - : QObject(*new QSoftKeyStackPrivate, parent) -{ - connect(qApp, SIGNAL(focusChanged(QWidget*, QWidget*)), SLOT(handleFocusChanged(QWidget*, QWidget*))); -} - -QSoftKeyStack::~QSoftKeyStack() -{ -} - -void QSoftKeyStack::push(QSoftKeyAction *softKey) -{ - Q_D(QSoftKeyStack); - d->push(softKey); -} - -void QSoftKeyStack::push(const QList &softKeys) -{ - Q_D(QSoftKeyStack); - d->push(softKeys); -} - -void QSoftKeyStack::pop() -{ - Q_D(QSoftKeyStack); - d->pop(); -} - -void QSoftKeyStack::popandPush(QSoftKeyAction *softKey) -{ - Q_D(QSoftKeyStack); - d->popandPush(softKey); -} - -void QSoftKeyStack::popandPush(const QList &softkeys) -{ - Q_D(QSoftKeyStack); - d->popandPush(softkeys); -} - -const QSoftkeySet& QSoftKeyStack::top() -{ - Q_D(QSoftKeyStack); - return d->top(); -} - -bool QSoftKeyStack::isEmpty() -{ - Q_D(QSoftKeyStack); - return d->isEmpty(); -} - -QList menuActionList(QWidget *widget) -{ - QList result; - - QSoftKeyAction* menu = new QSoftKeyAction(QSoftKeyAction::Menu, QString::fromLatin1("Menu"), widget); - result.append(menu); - const Qt::ContextMenuPolicy policy = widget->contextMenuPolicy(); - if (policy != Qt::NoContextMenu && policy != Qt::PreventContextMenu ) { - QSoftKeyAction* contextMenu = new QSoftKeyAction(QSoftKeyAction::ContextMenu, QString::fromLatin1("ContextMenu"), widget); - result.append(contextMenu); - } - - return result; -} - -void QSoftKeyStack::handleFocusChanged(QWidget *old, QWidget *now) -{ - return; - if (!now) - return; - QWidget *w = qApp->activeWindow(); - QMainWindow *mainWindow = qobject_cast(w); - if( !mainWindow) - return; - if (!mainWindow->hasSoftKeyStack()) - return; - QSoftKeyStack* softKeyStack = mainWindow->softKeyStack(); - if (mainWindow->menuWidget()) { - QList actionList = menuActionList(now); - if (old) - softKeyStack->popandPush(actionList); - else - softKeyStack->push(actionList); - } -} - -QMainWindow *QSoftKeyStack::mainWindowOfWidget(QWidget *widget) -{ - for (QWidget *widgetParent = widget; widgetParent; widgetParent = widgetParent->parentWidget()) - if (QMainWindow *mainWindow = qobject_cast(widgetParent)) - return mainWindow; - - return 0; -} - -QSoftKeyStack *QSoftKeyStack::softKeyStackOfWidget(QWidget *widget) -{ - QMainWindow *mainWindow = mainWindowOfWidget(widget); - return (mainWindow && mainWindow->hasSoftKeyStack()) ? mainWindow->softKeyStack() : 0; -} - -#if !defined(Q_WS_S60) -void QSoftKeyStackPrivate::handleSoftKeyPress(int command) -{ - Q_UNUSED(command) -} - -QToolBar* softKeyToolBar(QMainWindow *mainWindow) -{ - Q_ASSERT(mainWindow); - const QString toolBarName = QString::fromLatin1("SoftKeyToolBarForDebugging"); - QToolBar *result = 0; - foreach (QObject *child, mainWindow->children()) { - result = qobject_cast(child); - if (result && result->objectName() == toolBarName) - return result; - } - result = mainWindow->addToolBar(toolBarName); - result->setObjectName(toolBarName); - return result; -} - -void QSoftKeyStackPrivate::setNativeSoftKeys() -{ - return; - Q_Q(QSoftKeyStack); - QMainWindow *parent = qobject_cast(q->parent()); - if (!parent) - return; - QToolBar* toolbar = softKeyToolBar(parent); - toolbar->clear(); - foreach (const QSoftkeySet &set, softKeyStack) { - foreach (QSoftKeyAction *skAction, set) - toolbar->addAction(skAction); - toolbar->addSeparator(); - } - if (toolbar->actions().isEmpty()) { - parent->removeToolBar(toolbar); - delete toolbar; - } -} -#endif // !defined(Q_WS_S60) - -QKeyEventSoftKey::QKeyEventSoftKey(QSoftKeyAction *softKeyAction, Qt::Key key, QObject *parent) - : QObject(parent) - , m_softKeyAction(softKeyAction) - , m_key(key) -{ -} - -void QKeyEventSoftKey::addSoftKey(QSoftKeyAction::StandardRole standardRole, Qt::Key key, QWidget *actionWidget) -{ - QSoftKeyStack *stack = QSoftKeyStack::softKeyStackOfWidget(actionWidget); - if (!stack) - return; - QSoftKeyAction *action = new QSoftKeyAction(standardRole, actionWidget); - QKeyEventSoftKey *softKey = new QKeyEventSoftKey(action, key, actionWidget); - connect(action, SIGNAL(triggered()), softKey, SLOT(sendKeyEvent())); - connect(action, SIGNAL(destroyed()), softKey, SLOT(deleteLater())); - stack->popandPush(action); -} - -void QKeyEventSoftKey::removeSoftkey(QWidget *focussedWidget) -{ - QSoftKeyStack *stack = QSoftKeyStack::softKeyStackOfWidget(focussedWidget); - if (!stack) - return; - QList actionList = menuActionList(focussedWidget); - stack->popandPush(actionList); -} - -void QKeyEventSoftKey::sendKeyEvent() -{ - QApplication::postEvent(parent(), new QKeyEvent(QEvent::KeyPress, m_key, Qt::NoModifier)); -} diff --git a/src/gui/widgets/qsoftkeystack.h b/src/gui/widgets/qsoftkeystack.h deleted file mode 100644 index 423da66..0000000 --- a/src/gui/widgets/qsoftkeystack.h +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QSOFTKEYSTACK_H -#define QSOFTKEYSTACK_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Gui) - -#define QSoftkeySet QList - -class QSoftKeyStackPrivate; -class QSoftKeyAction; -class QMainWindow; - -class Q_GUI_EXPORT QSoftKeyStack : public QObject -{ - Q_OBJECT -public: - QSoftKeyStack(QWidget *parent); - ~QSoftKeyStack(); - - void push(QSoftKeyAction *softKey); - void push(const QList &softkeys); - void pop(); - void popandPush(QSoftKeyAction *softKey); - void popandPush(const QList &softkeys); - const QSoftkeySet& top(); - bool isEmpty(); - - static QMainWindow *mainWindowOfWidget(QWidget *widget); - static QSoftKeyStack *softKeyStackOfWidget(QWidget *widget); - -private Q_SLOTS: - void handleFocusChanged(QWidget *old, QWidget *now); - -private: - Q_DECLARE_PRIVATE(QSoftKeyStack) - Q_DISABLE_COPY(QSoftKeyStack) -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QSOFTKEYSTACK_H diff --git a/src/gui/widgets/qsoftkeystack_p.h b/src/gui/widgets/qsoftkeystack_p.h deleted file mode 100644 index 4532515..0000000 --- a/src/gui/widgets/qsoftkeystack_p.h +++ /dev/null @@ -1,111 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QSOFTKEYSTACK_P_H -#define QSOFTKEYSTACK_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - - -#include "qstack.h" -#include - -#include "qsoftkeyaction.h" -#include "qsoftkeystack.h" - -QT_BEGIN_NAMESPACE - -// The following 2 defines may only be needed for s60. To be seen. -#define SOFTKEYSTART 5000 -#define SOFTKEYEND (5000 + Qt::Key_Context4-Qt::Key_Context1) - -#define QSoftkeySet QList - -class QSoftKeyStackPrivate : public QObjectPrivate -{ - Q_DECLARE_PUBLIC(QSoftKeyStack) -public: - QSoftKeyStackPrivate(); - ~QSoftKeyStackPrivate(); - - void push(QSoftKeyAction *softKey); - void push(const QList &softKeys); - void pop(); - void popandPush(QSoftKeyAction *softKey); - void popandPush(const QList &softkeys); - const QSoftkeySet& top(); - bool isEmpty(); - static void handleSoftKeyPress(int command); - -private: - void mapSoftKeys(const QSoftkeySet &top); - void setNativeSoftKeys(); - -private: - QStack softKeyStack; -}; - -class QKeyEventSoftKey : QObject -{ - Q_OBJECT -public: - QKeyEventSoftKey(QSoftKeyAction *softKeyAction, Qt::Key key, QObject *parent); - static void addSoftKey(QSoftKeyAction::StandardRole standardRole, Qt::Key key, QWidget *actionWidget); - static void removeSoftkey(QWidget *focussedWidget); -private: - QSoftKeyAction *m_softKeyAction; - Qt::Key m_key; -private Q_SLOTS: - void sendKeyEvent(); -}; - -QT_END_NAMESPACE - -#endif // QSOFTKEYSTACK_P_H diff --git a/src/gui/widgets/qsoftkeystack_s60.cpp b/src/gui/widgets/qsoftkeystack_s60.cpp deleted file mode 100644 index a315a3b..0000000 --- a/src/gui/widgets/qsoftkeystack_s60.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include -#include -#include - -#include "private/qcore_symbian_p.h" - -#include "qsoftkeystack_p.h" -#include "qapplication.h" -#include "qmainwindow.h" - -void QSoftKeyStackPrivate::mapSoftKeys(const QSoftkeySet &top) -{ - if (top.count() == 1) { - top.at(0)->setNativePosition(2); - top.at(0)->setQtContextKey(Qt::Key_Context1); - } - else { - // FIX THIS - // veryWeirdMagic is needes as s60 5th edition sdk always panics if cba is set with index 1, this hops over it - // This needs further investigation why so that the hack can be removed - int veryWeirdMagic = 0; - for (int index = 0; index < top.count(); index++) { - top.at(index)->setNativePosition(index + veryWeirdMagic); - top.at(index)->setQtContextKey(Qt::Key_Context1 + index); - if (veryWeirdMagic == 0) - veryWeirdMagic = 1; - } - } -} - -void QSoftKeyStackPrivate::setNativeSoftKeys() -{ - return; - CCoeAppUi* appui = CEikonEnv::Static()->AppUi(); - CAknAppUi* aknAppUi = static_cast (appui); - CEikButtonGroupContainer* nativeContainer = aknAppUi->Cba(); - nativeContainer->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY_WITH_IDS); - if (softKeyStack.isEmpty()) - return; - - const QSoftkeySet top = softKeyStack.top(); - mapSoftKeys(top); - - for (int index = 0; index < top.count(); index++) { - const QSoftKeyAction* softKeyAction = top.at(index); - if (softKeyAction->role() != QSoftKeyAction::ContextMenu) { - - HBufC* text = qt_QString2HBufCNewL(softKeyAction->text()); - CleanupStack::PushL(text); - if (softKeyAction->role() == QSoftKeyAction::Menu) { - nativeContainer->SetCommandL(softKeyAction->nativePosition(), EAknSoftkeyOptions, *text); - } else { - nativeContainer->SetCommandL(softKeyAction->nativePosition(), SOFTKEYSTART + softKeyAction->qtContextKey()-Qt::Key_Context1, *text); - } - CleanupStack::PopAndDestroy(); - } - } -} - -void QSoftKeyStackPrivate::handleSoftKeyPress(int command) -{ - const QMainWindow *activeMainWindow = - qobject_cast(QApplication::activeWindow()); - if (!activeMainWindow) - return; - QSoftKeyStackPrivate *d_ptr = activeMainWindow->softKeyStack()->d_func(); - - const QSoftkeySet top = d_ptr->softKeyStack.top(); - int index = command-SOFTKEYSTART; - if (index < 0 || index >= top.count()) { - // ### FIX THIS, add proper error handling, now fail quietly - return; - } - - top.at(index)->activate(QAction::Trigger); -} - diff --git a/src/gui/widgets/widgets.pri b/src/gui/widgets/widgets.pri index 0c0641a..150eed7 100644 --- a/src/gui/widgets/widgets.pri +++ b/src/gui/widgets/widgets.pri @@ -79,9 +79,7 @@ HEADERS += \ widgets/qplaintextedit.h \ widgets/qplaintextedit_p.h \ widgets/qprintpreviewwidget.h \ - widgets/qsoftkeyaction.h \ - widgets/qsoftkeystack.h \ - widgets/qsoftkeystack_p.h + widgets/qkeyeventsoftkey.h \ SOURCES += \ widgets/qabstractbutton.cpp \ widgets/qabstractslider.cpp \ @@ -141,8 +139,7 @@ SOURCES += \ widgets/qtoolbararealayout.cpp \ widgets/qplaintextedit.cpp \ widgets/qprintpreviewwidget.cpp \ - widgets/qsoftkeyaction.cpp \ - widgets/qsoftkeystack.cpp + widgets/qkeyeventsoftkey.cpp \ !embedded:mac { HEADERS += widgets/qmacnativewidget_mac.h \ @@ -167,5 +164,4 @@ wince*: { symbian*: { SOURCES += \ widgets/qmenu_symbian.cpp \ - widgets/qsoftkeystack_s60.cpp } -- cgit v0.12 From fcb5ca1ef0a1c1639624d951b03750abc631e60d Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Sat, 6 Jun 2009 16:18:14 +0200 Subject: Added helper class to make adding/removing softkeys easier --- src/gui/widgets/qkeyeventsoftkey.cpp | 78 ++++++++++++++++++++++++++++++++++++ src/gui/widgets/qkeyeventsoftkey.h | 71 ++++++++++++++++++++++++++++++++ 2 files changed, 149 insertions(+) create mode 100644 src/gui/widgets/qkeyeventsoftkey.cpp create mode 100644 src/gui/widgets/qkeyeventsoftkey.h diff --git a/src/gui/widgets/qkeyeventsoftkey.cpp b/src/gui/widgets/qkeyeventsoftkey.cpp new file mode 100644 index 0000000..e836dfe --- /dev/null +++ b/src/gui/widgets/qkeyeventsoftkey.cpp @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qkeyeventsoftkey.h" + +QT_BEGIN_NAMESPACE + +QKeyEventSoftKey::QKeyEventSoftKey(QAction *softKeyAction, Qt::Key key, QObject *parent) + : QObject(parent) + , m_softKeyAction(softKeyAction) + , m_key(key) +{ + +} + +void QKeyEventSoftKey::addSoftKey(QAction::SoftKeyRole standardRole, Qt::Key key, QWidget *actionWidget) +{ + QAction *action = new QAction(actionWidget); + action->setSoftKeyRole(standardRole); + QKeyEventSoftKey *softKey = new QKeyEventSoftKey(action, key, actionWidget); + connect(action, SIGNAL(triggered()), softKey, SLOT(sendKeyEvent())); + connect(action, SIGNAL(destroyed()), softKey, SLOT(deleteLater())); + actionWidget->setSoftKeys(action); +} + +void QKeyEventSoftKey::removeSoftkey(QWidget *focussedWidget) +{ + focussedWidget->setSoftKeys(0); +} + +void QKeyEventSoftKey::sendKeyEvent() +{ + QApplication::postEvent(parent(), new QKeyEvent(QEvent::KeyPress, m_key, Qt::NoModifier)); +} + +QT_END_NAMESPACE + +#include "moc_qkeyeventsoftkey.cpp" + +#endif // QT_NO_ACTION diff --git a/src/gui/widgets/qkeyeventsoftkey.h b/src/gui/widgets/qkeyeventsoftkey.h new file mode 100644 index 0000000..92cf0df --- /dev/null +++ b/src/gui/widgets/qkeyeventsoftkey.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QKEYEVENSOFTKEY_H +#define QKEYEVENSOFTKEY_H + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Gui) + +#include "qaction.h" + +class QKeyEventSoftKey : QObject +{ + Q_OBJECT +public: + QKeyEventSoftKey(QAction *softKeyAction, Qt::Key key, QObject *parent); + static void addSoftKey(QAction::StandardRole standardRole, Qt::Key key, QWidget *actionWidget); + static void removeSoftkey(QWidget *focussedWidget); +private: + QAction *m_softKeyAction; + Qt::Key m_key; +private Q_SLOTS: + void sendKeyEvent(); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif //QKEYEVENSOFTKEY_H -- cgit v0.12 From 93922e26a2411c0f11e7cdc49b306823e23cda8b Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Sat, 6 Jun 2009 18:40:00 +0200 Subject: Fixes to make gui compile after clean configure. Removal of QSoftKeyStack broke compilation on clean environment... --- examples/widgets/stylesheet/mainwindow.cpp | 3 --- src/gui/itemviews/qabstractitemview.cpp | 3 ++- src/gui/kernel/qwidget_p.h | 3 +++ src/gui/kernel/qwidget_s60.cpp | 3 --- src/gui/widgets/qkeyeventsoftkey.cpp | 3 ++- src/gui/widgets/qkeyeventsoftkey.h | 8 +++++--- src/gui/widgets/widgets.pri | 12 ++++++------ 7 files changed, 18 insertions(+), 17 deletions(-) diff --git a/examples/widgets/stylesheet/mainwindow.cpp b/examples/widgets/stylesheet/mainwindow.cpp index a0a38ad..a1307a8 100644 --- a/examples/widgets/stylesheet/mainwindow.cpp +++ b/examples/widgets/stylesheet/mainwindow.cpp @@ -46,9 +46,6 @@ MainWindow::MainWindow() { - QSoftKeyStack* stack = new QSoftKeyStack(this); - setSoftKeyStack(stack); - ui.setupUi(this); ui.nameLabel->setProperty("class", "mandatory QLabel"); diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index 187e2cd..69e630e 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -61,6 +61,7 @@ #ifndef QT_NO_ACCESSIBILITY #include #endif +#include QT_BEGIN_NAMESPACE @@ -2003,7 +2004,7 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event) if (QApplication::keypadNavigationEnabled()) { if (!hasEditFocus()) { setEditFocus(true); - QKeyEventSoftKey::addSoftKey(QAction::Back, Qt::Key_Back, this); + QKeyEventSoftKey::addSoftKey(QAction::BackSoftKey, Qt::Key_Back, this); return; } } diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index 9a606dc..2119849 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -84,6 +84,9 @@ class RDrawableWindow; class CCoeControl; class CAknTitlePane; class CAknContextPane; +// The following 2 defines may only be needed for s60. To be seen. +#define SOFTKEYSTART 5000 +#define SOFTKEYEND (5000 + Qt::Key_Context4-Qt::Key_Context1) #endif QT_BEGIN_NAMESPACE diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index a23469e..4e03206 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -62,9 +62,6 @@ QWidget *QWidgetPrivate::mouseGrabber = 0; QWidget *QWidgetPrivate::keyboardGrabber = 0; #define QSoftkeySet QList -// The following 2 defines may only be needed for s60. To be seen. -#define SOFTKEYSTART 5000 -#define SOFTKEYEND (5000 + Qt::Key_Context4-Qt::Key_Context1) static void mapSoftKeys(const QSoftkeySet &softkeys) { diff --git a/src/gui/widgets/qkeyeventsoftkey.cpp b/src/gui/widgets/qkeyeventsoftkey.cpp index e836dfe..08f5c6f 100644 --- a/src/gui/widgets/qkeyeventsoftkey.cpp +++ b/src/gui/widgets/qkeyeventsoftkey.cpp @@ -39,6 +39,8 @@ ** ****************************************************************************/ +#include "qapplication.h" +#include "qevent.h" #include "qkeyeventsoftkey.h" QT_BEGIN_NAMESPACE @@ -75,4 +77,3 @@ QT_END_NAMESPACE #include "moc_qkeyeventsoftkey.cpp" -#endif // QT_NO_ACTION diff --git a/src/gui/widgets/qkeyeventsoftkey.h b/src/gui/widgets/qkeyeventsoftkey.h index 92cf0df..fd69907 100644 --- a/src/gui/widgets/qkeyeventsoftkey.h +++ b/src/gui/widgets/qkeyeventsoftkey.h @@ -42,20 +42,22 @@ #ifndef QKEYEVENSOFTKEY_H #define QKEYEVENSOFTKEY_H +#include +#include "QtGui/qaction.h" QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Gui) -#include "qaction.h" -class QKeyEventSoftKey : QObject + +class Q_GUI_EXPORT QKeyEventSoftKey : QObject { Q_OBJECT public: QKeyEventSoftKey(QAction *softKeyAction, Qt::Key key, QObject *parent); - static void addSoftKey(QAction::StandardRole standardRole, Qt::Key key, QWidget *actionWidget); + static void addSoftKey(QAction::SoftKeyRole standardRole, Qt::Key key, QWidget *actionWidget); static void removeSoftkey(QWidget *focussedWidget); private: QAction *m_softKeyAction; diff --git a/src/gui/widgets/widgets.pri b/src/gui/widgets/widgets.pri index 150eed7..d0f981c 100644 --- a/src/gui/widgets/widgets.pri +++ b/src/gui/widgets/widgets.pri @@ -25,6 +25,7 @@ HEADERS += \ widgets/qframe.h \ widgets/qframe_p.h \ widgets/qgroupbox.h \ + widgets/qkeyeventsoftkey.h \ widgets/qlabel.h \ widgets/qlabel_p.h \ widgets/qlcdnumber.h \ @@ -78,8 +79,8 @@ HEADERS += \ widgets/qtoolbararealayout_p.h \ widgets/qplaintextedit.h \ widgets/qplaintextedit_p.h \ - widgets/qprintpreviewwidget.h \ - widgets/qkeyeventsoftkey.h \ + widgets/qprintpreviewwidget.h + SOURCES += \ widgets/qabstractbutton.cpp \ widgets/qabstractslider.cpp \ @@ -97,6 +98,7 @@ SOURCES += \ widgets/qfontcombobox.cpp \ widgets/qframe.cpp \ widgets/qgroupbox.cpp \ + widgets/qkeyeventsoftkey.cpp \ widgets/qlabel.cpp \ widgets/qlcdnumber.cpp \ widgets/qlineedit.cpp \ @@ -138,8 +140,7 @@ SOURCES += \ widgets/qwidgetanimator.cpp \ widgets/qtoolbararealayout.cpp \ widgets/qplaintextedit.cpp \ - widgets/qprintpreviewwidget.cpp \ - widgets/qkeyeventsoftkey.cpp \ + widgets/qprintpreviewwidget.cpp !embedded:mac { HEADERS += widgets/qmacnativewidget_mac.h \ @@ -162,6 +163,5 @@ wince*: { } symbian*: { - SOURCES += \ - widgets/qmenu_symbian.cpp \ + SOURCES += widgets/qmenu_symbian.cpp } -- cgit v0.12 From 9420db9284f20e28239d1c6e8a4cccf7707c014e Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Sat, 6 Jun 2009 18:50:17 +0200 Subject: Fixed bug that caused the softkeys list not to be cleared after the softkeys in the list were deleted --- src/gui/kernel/qwidget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 0a7fea3..7a8b143 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -11528,6 +11528,7 @@ void QWidget::setSoftKeys(QAction *softKey) { Q_D(QWidget); qDeleteAll(d->softKeys); + d->softKeys.clear(); if (softKey) d->softKeys.append(softKey); // d->setNativeSoftKeys(softkeys); @@ -11537,6 +11538,7 @@ void QWidget::setSoftKeys(const QList &softKeys) { Q_D(QWidget); qDeleteAll(d->softKeys); + d->softKeys.clear(); for(int i = 0; i < softKeys.count(); i++) d->softKeys.append(softKeys.at(i)); -- cgit v0.12 From ef0f6267822c782f0b555e15ddab24c41c51d2e8 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Sat, 6 Jun 2009 19:37:37 +0200 Subject: Added support for setting softkeys dynamically --- src/gui/kernel/qwidget.cpp | 6 ++++-- src/gui/kernel/qwidget_s60.cpp | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 7a8b143..e82fbd2 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -11531,7 +11531,8 @@ void QWidget::setSoftKeys(QAction *softKey) d->softKeys.clear(); if (softKey) d->softKeys.append(softKey); -// d->setNativeSoftKeys(softkeys); + if (QApplication::focusWidget() == this) + d->setNativeSoftKeys(this->softKeys()); } void QWidget::setSoftKeys(const QList &softKeys) @@ -11542,7 +11543,8 @@ void QWidget::setSoftKeys(const QList &softKeys) for(int i = 0; i < softKeys.count(); i++) d->softKeys.append(softKeys.at(i)); - // d->setNativeSoftKeys(softkeys); + if (QApplication::focusWidget() == this) + d->setNativeSoftKeys(this->softKeys()); } /*! \fn const QX11Info &QWidget::x11Info() const diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 4e03206..cb2fc8f 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -107,7 +107,8 @@ static bool isSame(const QList& a, const QList& b) void QWidgetPrivate::setNativeSoftKeys(const QList &softkeys) { - if (QApplication::focusWidget()) { + Q_Q(QWidget); + if (QApplication::focusWidget() && q!=QApplication::focusWidget()) { QList old = QApplication::focusWidget()->softKeys(); if (isSame(old, softkeys )) return; -- cgit v0.12 From 5edc6f4e88aa7896be0e69a6bcf2365adb6b70b4 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Sat, 6 Jun 2009 19:38:17 +0200 Subject: Added implementation to get default role names --- src/gui/widgets/qkeyeventsoftkey.cpp | 26 ++++++++++++++++++++++++++ src/gui/widgets/qkeyeventsoftkey.h | 1 + 2 files changed, 27 insertions(+) diff --git a/src/gui/widgets/qkeyeventsoftkey.cpp b/src/gui/widgets/qkeyeventsoftkey.cpp index 08f5c6f..bb236cc 100644 --- a/src/gui/widgets/qkeyeventsoftkey.cpp +++ b/src/gui/widgets/qkeyeventsoftkey.cpp @@ -53,10 +53,36 @@ QKeyEventSoftKey::QKeyEventSoftKey(QAction *softKeyAction, Qt::Key key, QObject } +QString QKeyEventSoftKey::roleText(QAction::SoftKeyRole role) +{ + switch (role) { + case QAction::OptionsSoftKey: + return QAction::tr("Options"); + case QAction::SelectSoftKey: + return QAction::tr("Select"); + case QAction::BackSoftKey: + return QAction::tr("Back"); + case QAction::NextSoftKey: + return QAction::tr("Next"); + case QAction::PreviousSoftKey: + return QAction::tr("Previous"); + case QAction::OkSoftKey: + return QAction::tr("Ok"); + case QAction::CancelSoftKey: + return QAction::tr("Cancel"); + case QAction::EditSoftKey: + return QAction::tr("Edit"); + case QAction::ViewSoftKey: + return QAction::tr("View"); + default: + return QString(); + }; +} void QKeyEventSoftKey::addSoftKey(QAction::SoftKeyRole standardRole, Qt::Key key, QWidget *actionWidget) { QAction *action = new QAction(actionWidget); action->setSoftKeyRole(standardRole); + action->setText(roleText(standardRole)); QKeyEventSoftKey *softKey = new QKeyEventSoftKey(action, key, actionWidget); connect(action, SIGNAL(triggered()), softKey, SLOT(sendKeyEvent())); connect(action, SIGNAL(destroyed()), softKey, SLOT(deleteLater())); diff --git a/src/gui/widgets/qkeyeventsoftkey.h b/src/gui/widgets/qkeyeventsoftkey.h index fd69907..83449c7 100644 --- a/src/gui/widgets/qkeyeventsoftkey.h +++ b/src/gui/widgets/qkeyeventsoftkey.h @@ -57,6 +57,7 @@ class Q_GUI_EXPORT QKeyEventSoftKey : QObject Q_OBJECT public: QKeyEventSoftKey(QAction *softKeyAction, Qt::Key key, QObject *parent); + static QString roleText(QAction::SoftKeyRole role); static void addSoftKey(QAction::SoftKeyRole standardRole, Qt::Key key, QWidget *actionWidget); static void removeSoftkey(QWidget *focussedWidget); private: -- cgit v0.12 From 267891cb23e0e751873f9a6cf5dd951287c0e5e5 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Sat, 6 Jun 2009 19:38:52 +0200 Subject: Changed combobox to use popup as a parent when setting softkeys. This enables the softkeys to actually be visible on the screen --- src/gui/widgets/qcombobox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp index aa90909..01fcf34 100644 --- a/src/gui/widgets/qcombobox.cpp +++ b/src/gui/widgets/qcombobox.cpp @@ -2438,7 +2438,7 @@ void QComboBox::showPopup() #ifdef QT_KEYPAD_NAVIGATION if (QApplication::keypadNavigationEnabled()) view()->setEditFocus(true); - QKeyEventSoftKey::addSoftKey(QAction::CancelSoftKey, Qt::Key_Back, this); + QKeyEventSoftKey::addSoftKey(QAction::CancelSoftKey, Qt::Key_Back, view()); #endif } -- cgit v0.12 From 8411fe233021f8609250b7cf47353e3128521406 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Sat, 6 Jun 2009 23:17:29 +0200 Subject: Add a comment for the translator so the placeholders are described Reviewed-by: TrustMe --- tools/assistant/lib/qhelpdbreader.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/assistant/lib/qhelpdbreader.cpp b/tools/assistant/lib/qhelpdbreader.cpp index 76994a7..27bc4d7 100644 --- a/tools/assistant/lib/qhelpdbreader.cpp +++ b/tools/assistant/lib/qhelpdbreader.cpp @@ -92,6 +92,9 @@ bool QHelpDBReader::init() QSqlDatabase db = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), m_uniqueId); db.setDatabaseName(m_dbName); if (!db.open()) { + /*: The placeholders are: %1 - The name of the database which cannot be opened + %2 - The unique id for the connection + %3 - The actual error string */ m_error = tr("Cannot open database '%1' '%2': %3").arg(m_dbName, m_uniqueId, db.lastError().text()); QSqlDatabase::removeDatabase(m_uniqueId); return false; -- cgit v0.12 From 9d49d50c55311afdbcb5fc70a39137d3dff0ea2f Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Sun, 7 Jun 2009 19:40:38 +0200 Subject: 's60theme' is a commandline tool which converts Carbide.ui themes into an intermediate binary format that can be read by the simulated QS60Style. So, for example Designer (standalone or in Carbide) will be able to display a realistic S60 Ui. The intermediate binary format hashes of QPictures and QColors, streamed to a QByteArray and compressed. The QS60Style could not load the Carbide.ui theme directly because SVG handling is unfortunately not part of QtGui, and would require a dependency on the QtSvg module. Also, 's60theme' uses QWebkit to parse the SVG graphics (inspired by Ariya's 'WebKit-based SVG rasterizer' labs post). QtSvg had some issues with the SVGs that come with Carbide.ui. --- util/s60theme/main.cpp | 78 ++++++++++ util/s60theme/s60theme.pro | 9 ++ util/s60theme/s60themeconvert.cpp | 300 ++++++++++++++++++++++++++++++++++++++ util/s60theme/s60themeconvert.h | 54 +++++++ 4 files changed, 441 insertions(+) create mode 100644 util/s60theme/main.cpp create mode 100644 util/s60theme/s60theme.pro create mode 100644 util/s60theme/s60themeconvert.cpp create mode 100644 util/s60theme/s60themeconvert.h diff --git a/util/s60theme/main.cpp b/util/s60theme/main.cpp new file mode 100644 index 0000000..f092a9a --- /dev/null +++ b/util/s60theme/main.cpp @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include "s60themeconvert.h" + +int help() +{ + qDebug() << "Usage: s60theme [modeldir|theme.tdf] output.blob"; + qDebug() << ""; + qDebug() << "Options:"; + qDebug() << " modeldir: Theme 'model' directory in Carbide.ui tree"; + qDebug() << " theme.tdf: Theme .tdf file"; + qDebug() << " output.blob: Theme blob output filename"; + qDebug() << ""; + qDebug() << "s60theme takes an S60 theme from Carbide.ui and converts"; + qDebug() << "it into a compact, binary format, that can be directly loaded by"; + qDebug() << "the QtS60Style."; + qDebug() << ""; + qDebug() << "Visit http://www.forum.nokia.com for details about Carbide.ui"; + return 1; +} + +int main(int argc, char *argv[]) +{ + if (argc != 3) + return help(); + + QApplication app(argc, argv); + + const QString input = QString::fromLatin1(argv[1]); + const QFileInfo inputInfo(input); + const QString output = QString::fromLatin1(argv[2]); + if (inputInfo.isDir()) + return S60ThemeConvert::convertDefaultThemeToBlob(input, output); + else if (inputInfo.suffix().compare(QString::fromLatin1("tdf"), Qt::CaseInsensitive) == 0) + return S60ThemeConvert::convertTdfToBlob(input, output); + + return help(); +} diff --git a/util/s60theme/s60theme.pro b/util/s60theme/s60theme.pro new file mode 100644 index 0000000..02c2449 --- /dev/null +++ b/util/s60theme/s60theme.pro @@ -0,0 +1,9 @@ +SOURCES += \ + s60themeconvert.cpp \ + main.cpp + +HEADERS += \ + s60themeconvert.h + +QT += \ + webkit diff --git a/util/s60theme/s60themeconvert.cpp b/util/s60theme/s60themeconvert.cpp new file mode 100644 index 0000000..4fe2980 --- /dev/null +++ b/util/s60theme/s60themeconvert.cpp @@ -0,0 +1,300 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "s60themeconvert.h" + +#include +#include + +static const int pictureSize = 256; + +void dumpPartPictures(const QHash &partPictures) { + foreach (const QString &partKey, partPictures.keys()) { + QPicture partPicture = partPictures.value(partKey); + qDebug() << partKey << partPicture.boundingRect(); + QImage image(partPicture.boundingRect().size(), QImage::Format_ARGB32); + image.fill(Qt::transparent); + QPainter p(&image); + partPicture.play(&p); + image.save(partKey + QString::fromLatin1(".png")); + } +} + +void dumpColors(const QHash, QColor> &colors) { + foreach (const QColor &color, colors.values()) { + const QPair key = colors.key(color); + qDebug() << key << color; + } +} + +class WebKitSVGRenderer : public QWebView +{ + Q_OBJECT + +public: + WebKitSVGRenderer(QWidget *parent = 0); + QPicture svgToQPicture(const QString &svgFileName); + +private slots: + void loadFinishedSlot(bool ok); + +private: + QEventLoop m_loop; + QPicture m_result; +}; + +WebKitSVGRenderer::WebKitSVGRenderer(QWidget *parent) + : QWebView(parent) +{ + connect(this, SIGNAL(loadFinished(bool)), SLOT(loadFinishedSlot(bool))); + setFixedSize(pictureSize, pictureSize); + QPalette pal = palette(); + pal.setColor(QPalette::Base, Qt::transparent); + setPalette(pal); +} + +QPicture WebKitSVGRenderer::svgToQPicture(const QString &svgFileName) +{ + load(QUrl::fromLocalFile(svgFileName)); + m_loop.exec(); + return m_result; +} + +void WebKitSVGRenderer::loadFinishedSlot(bool ok) +{ + // crude error-checking + if (!ok) + qDebug() << "Failed loading " << qPrintable(url().toString()); + + page()->mainFrame()->evaluateJavaScript(QString::fromLatin1( + "document.rootElement.preserveAspectRatio.baseVal.align = SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_NONE;" + "document.rootElement.style.width = '100%';" + "document.rootElement.style.height = '100%';" + "document.rootElement.width.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PERCENTAGE, 100);" + "document.rootElement.height.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PERCENTAGE, 100);" + )); + + m_result = QPicture(); // "Clear" + QPainter p(&m_result); + page()->mainFrame()->render(&p); + p.end(); + m_result.setBoundingRect(QRect(0, 0, pictureSize, pictureSize)); + + m_loop.exit(); +} + +QPair colorIdPair(const QString &colorID) +{ + QPair result; + QString idText = colorID; + idText.remove(QRegExp(QString::fromLatin1("[0-9]"))); + if (QS60Style::colorListKeys().contains(idText)) { + QString idNumber = colorID; + idNumber.remove(QRegExp(QString::fromLatin1("[a-zA-Z]"))); + result.first = idText; + result.second = idNumber.toInt(); + } + return result; +} + +bool parseTdfFile(const QString &tdfFile, + QHash &partSvgs, + QHash, QColor> &colors) +{ + QFile file(tdfFile); + if (!file.open(QIODevice::ReadOnly)) + return false; + + const QLatin1String elementKey("element"); + const QLatin1String partKey("part"); + const QLatin1String elementIdKey("id"); + const QLatin1String layerKey("layer"); + const QLatin1String layerFileNameKey("filename"); + const QLatin1String layerColourrgbKey("colourrgb"); + const QString annoyingPrefix = QString::fromLatin1("S60_2_6%"); + + QXmlStreamReader reader(&file); + QString partId; + QPair colorId; + // Somebody with a sense of aesthetics may implement proper XML parsing, here. + while (!reader.atEnd()) { + const QXmlStreamReader::TokenType token = reader.readNext(); + switch (token) { + case QXmlStreamReader::StartElement: + if (reader.name() == elementKey || reader.name() == partKey) { + QString id = reader.attributes().value(elementIdKey).toString(); + if (QS60Style::partKeys().contains(id)) + partId = id; + else if (!id.isEmpty() && id.at(id.length()-1).isDigit()) + colorId = colorIdPair(id); + else if (QS60Style::partKeys().contains(id.mid(annoyingPrefix.length()))) + partId = id.mid(annoyingPrefix.length()); + } else if(reader.name() == layerKey) { + if (!partId.isEmpty()) { + const QString svgFile = reader.attributes().value(layerFileNameKey).toString(); + partSvgs.insert(partId, svgFile); + partId.clear(); + } else if (!colorId.first.isEmpty()) { + const QColor colorValue(reader.attributes().value(layerColourrgbKey).toString().toInt(NULL, 16)); + colors.insert(colorId, colorValue); + colorId.first.clear(); + } + } + break; + case QXmlStreamReader::EndElement: + if (reader.tokenString() == elementKey || reader.name() == partKey) + partId.clear(); + break; + default: + break; + } + } + return true; +} + +bool loadThemeFromTdf(const QString &tdfFile, + QHash &partPictures, + QHash, QColor> &colors) +{ + QHash parsedPartSvgs; + QHash parsedPartPictures; + QHash, QColor> parsedColors; + bool success = parseTdfFile(tdfFile, parsedPartSvgs, parsedColors); + if (!success) + return false; + const QString tdfBasePath = QFileInfo(tdfFile).absolutePath(); + WebKitSVGRenderer renderer; + foreach(const QString& partKey, parsedPartSvgs.keys()) { + const QString tdfFullName = + tdfBasePath + QDir::separator() + parsedPartSvgs.value(partKey); + if (!QFile(tdfFullName).exists()) + qWarning() << "Could not load part " << tdfFullName; + const QPicture partPicture = renderer.svgToQPicture(tdfFullName); + parsedPartPictures.insert(partKey, partPicture); + } +// dumpPartPictures(parsedPartPictures); +// dumpColors(colors); + partPictures = parsedPartPictures; + colors = parsedColors; + return true; +} + +bool S60ThemeConvert::convertTdfToBlob(const QString &themeTdf, const QString &themeBlob) +{ + QHash partPictures; + QHash, QColor> colors; + + if (!::loadThemeFromTdf(themeTdf, partPictures, colors)) + return false; + + QS60Style style; + style.setS60Theme(partPictures, colors); + return style.saveS60ThemeToBlob(themeBlob); +} + +bool parseDesignFile(const QString &designFile, + QHash, QColor> &colors) +{ + const QLatin1String elementKey("element"); + const QLatin1String elementIdKey("id"); + const QLatin1String colorKey("defaultcolour_rgb"); + QFile file(designFile); + if (!file.open(QIODevice::ReadOnly)) + return false; + QXmlStreamReader reader(&file); + QPair colorId; + // Somebody with a sense of aesthetics may implement proper XML parsing, here. + while (!reader.atEnd()) { + const QXmlStreamReader::TokenType token = reader.readNext(); + switch (token) { + case QXmlStreamReader::StartElement: + if (reader.name() == elementKey) { + const QString colorString = reader.attributes().value(colorKey).toString(); + if (!colorString.isEmpty()) { + const QString colorId = reader.attributes().value(elementIdKey).toString(); + colors.insert(colorIdPair(colorId), colorString.toInt(NULL, 16)); + } + } + default: + break; + } + } + return true; +} + +bool loadDefaultTheme(const QString &themePath, + QHash &partPictures, + QHash, QColor> &colors) +{ + const QDir dir(themePath); + if (!dir.exists()) + return false; + + if (!parseDesignFile(themePath + QDir::separator() + QString::fromLatin1("defaultdesign.xml"), colors)) + return false; + + WebKitSVGRenderer renderer; + foreach (const QString &partKey, QS60Style::partKeys()) { + const QString partFile(dir.absolutePath() + QDir::separator() + partKey + QLatin1String(".svg")); + if (!QFile::exists(partFile)) { + qWarning() << "Could not load part " << partFile; + continue; + } + const QPicture partPicture = renderer.svgToQPicture(partFile); + partPictures.insert(partKey, partPicture); + } + return true; +} + +bool S60ThemeConvert::convertDefaultThemeToBlob(const QString &themePath, const QString &themeBlob) +{ + QHash partPictures; + QHash, QColor> colors; + + if (!::loadDefaultTheme(themePath, partPictures, colors)) + return false; + + QS60Style style; + style.setS60Theme(partPictures, colors); + return style.saveS60ThemeToBlob(themeBlob); +} + +#include "s60themeconvert.moc" diff --git a/util/s60theme/s60themeconvert.h b/util/s60theme/s60themeconvert.h new file mode 100644 index 0000000..e48922f --- /dev/null +++ b/util/s60theme/s60themeconvert.h @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef S60THEMECONVERT_H +#define S60THEMECONVERT_H + +#include + +class S60ThemeConvert +{ +public: + static bool convertTdfToBlob(const QString &themeTdf, const QString &themeBlob); + static bool convertDefaultThemeToBlob(const QString &themePath, const QString &themeBlob); +}; + +#endif // S60THEMECONVERT_H -- cgit v0.12 From 0a44379cff84c32f608ced0b5b43abe155cefd81 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Sun, 7 Jun 2009 20:02:56 +0200 Subject: Added a README to give people a hint of what this obscure piece of code does. --- util/s60theme/README | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 util/s60theme/README diff --git a/util/s60theme/README b/util/s60theme/README new file mode 100644 index 0000000..f408d47 --- /dev/null +++ b/util/s60theme/README @@ -0,0 +1,31 @@ +'s60theme' is a commandline tool which converts Carbide.ui themes into +an intermediate binary format that can be read by the simulated +QS60Style. So, for example Designer (standalone or in Carbide) will +be able to display a realistic S60 Ui. + +The intermediate binary format hashes of QPictures and QColors, +streamed to a QByteArray and compressed. The QS60Style could not load +the Carbide.ui theme directly because SVG handling is unfortunately +not part of QtGui, and would require a dependency on the QtSvg module. + +Also, 's60theme' uses QWebkit to parse the SVG graphics (inspired by +Ariya's 'WebKit-based SVG rasterizer' labs post). QtSvg had some issues +with the SVGs that come with Carbide.ui. + +Usage examples: +> s60theme "com.nokia.tools.theme.s60.50_3.4.0.0\config\model" Default.blob + (Reads the default 's60.50' theme and saves it as 'Default.blob') + +> s60theme "Eclipse\Examples\Haze\Haze.tdf" Haze.blob + (Reads the Haze theme and saves it as 'Haze.blob') + +To use te blob in a Qt application, get an instance of a QS60Style and call + style->loadS60ThemeFromBlob("Theme.blob"); + +The simulated QS60Style will in its constructor by default try to load a +":/s60Stylethemes/Default.blob". If your application has that resouce width +exaclty that filename, it will be used by default. +'Default.blob' is not included in the current Qt source package. But it can +easily be created with 's60theme' and a fresh install of Carbide.ui + +Visit http://www.forum.nokia.com for details about Carbide.ui -- cgit v0.12 From 7087433fb6f77746678963b1a97fc18daab831fa Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Sun, 7 Jun 2009 20:40:49 +0200 Subject: Proper English sentence --- util/s60theme/README | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/s60theme/README b/util/s60theme/README index f408d47..3a006ec 100644 --- a/util/s60theme/README +++ b/util/s60theme/README @@ -3,8 +3,8 @@ an intermediate binary format that can be read by the simulated QS60Style. So, for example Designer (standalone or in Carbide) will be able to display a realistic S60 Ui. -The intermediate binary format hashes of QPictures and QColors, -streamed to a QByteArray and compressed. The QS60Style could not load +The intermediate binary format consists of hashes of QPictures and +QColors, streamed to a QByteArray and compressed. QS60Style could not load the Carbide.ui theme directly because SVG handling is unfortunately not part of QtGui, and would require a dependency on the QtSvg module. -- cgit v0.12 From 7661082e4c1851ab2fd6409d8689dc8b08d793b9 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Sun, 7 Jun 2009 23:21:47 +0200 Subject: Make the linker happy on non-Q_WS_S60 --- src/gui/kernel/qwidget.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index e82fbd2..69e2d84 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -4880,6 +4880,13 @@ void QWidget::render(QPainter *painter, const QPoint &targetOffset, d->extra->inRenderWithPainter = false; } +#if !defined(Q_WS_S60) +void QWidgetPrivate::setNativeSoftKeys(const QList &softkeys) +{ + Q_UNUSED(softkeys) +} +#endif // !defined(Q_WS_S60) + bool QWidgetPrivate::isAboutToShow() const { if (data.in_show) -- cgit v0.12 From 0fafad31feb518453c7c25b2e29a8b26d7018978 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 8 Jun 2009 07:53:58 +0200 Subject: Ensure that the manifest files are placed correctly If OBJECTS_DIR was empty then it would create a directory for the manifest files in the root directory. This is not desired as it should create a directory in the build directory instead. Reviewed-by: Marius Storm-Olsen --- mkspecs/features/win32/embed_manifest_dll.prf | 8 +++++--- mkspecs/features/win32/embed_manifest_exe.prf | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/mkspecs/features/win32/embed_manifest_dll.prf b/mkspecs/features/win32/embed_manifest_dll.prf index 90d9a2b..76a8ed1 100644 --- a/mkspecs/features/win32/embed_manifest_dll.prf +++ b/mkspecs/features/win32/embed_manifest_dll.prf @@ -1,11 +1,13 @@ +MANIFEST_DIR = $$OBJECTS_DIR +isEmpty(MANIFEST_DIR):MANIFEST_DIR = . !if(plugin:no_plugin_manifest):if(win32-msvc2005|win32-msvc2008):!static:!equals(TEMPLATE_PREFIX, "vc"):equals(TEMPLATE, "lib") { NOPATH_TARGET = $$TARGET NOPATH_TARGET ~= s,\\ , ,q # Remove space escaping (NOPATH_TARGET is quoted) NOPATH_TARGET ~= s,\\,/,g # Change to single type separators NOPATH_TARGET ~= s,^(.*/)+,, # Remove all paths - QMAKE_LFLAGS += /MANIFEST $$quote(/MANIFESTFILE:\"$${OBJECTS_DIR}\\$${NOPATH_TARGET}.intermediate.manifest\") + QMAKE_LFLAGS += /MANIFEST $$quote(/MANIFESTFILE:\"$${MANIFEST_DIR}\\$${NOPATH_TARGET}.intermediate.manifest\") QMAKE_PREV_POST_LINK = $$QMAKE_POST_LINK - QMAKE_POST_LINK = $$quote(mt.exe -nologo -manifest \"$$replace(OBJECTS_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" -outputresource:$(DESTDIR_TARGET);2$$escape_expand(\n\t)) + QMAKE_POST_LINK = $$quote(mt.exe -nologo -manifest \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" -outputresource:$(DESTDIR_TARGET);2$$escape_expand(\n\t)) QMAKE_POST_LINK += $$QMAKE_PREV_POST_LINK - QMAKE_CLEAN += \"$$replace(OBJECTS_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" + QMAKE_CLEAN += \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" } diff --git a/mkspecs/features/win32/embed_manifest_exe.prf b/mkspecs/features/win32/embed_manifest_exe.prf index e1747f1..d2800a1 100644 --- a/mkspecs/features/win32/embed_manifest_exe.prf +++ b/mkspecs/features/win32/embed_manifest_exe.prf @@ -1,11 +1,13 @@ +MANIFEST_DIR = $$OBJECTS_DIR +isEmpty(MANIFEST_DIR):MANIFEST_DIR = . if(win32-msvc2005|win32-msvc2008):!equals(TEMPLATE_PREFIX, "vc"):equals(TEMPLATE, "app") { NOPATH_TARGET = $$TARGET NOPATH_TARGET ~= s,\\ , ,q # Remove space escaping (NOPATH_TARGET is quoted) NOPATH_TARGET ~= s,\\,/,g # Change to single type separators NOPATH_TARGET ~= s,^(.*/)+,, # Remove all paths - QMAKE_LFLAGS += /MANIFEST $$quote(/MANIFESTFILE:\"$${OBJECTS_DIR}\\$${NOPATH_TARGET}.intermediate.manifest\") + QMAKE_LFLAGS += /MANIFEST $$quote(/MANIFESTFILE:\"$${MANIFEST_DIR}\\$${NOPATH_TARGET}.intermediate.manifest\") QMAKE_PREV_POST_LINK = $$QMAKE_POST_LINK - QMAKE_POST_LINK = $$quote(mt.exe -nologo -manifest \"$$replace(OBJECTS_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" -outputresource:$(DESTDIR_TARGET);1$$escape_expand(\n\t)) + QMAKE_POST_LINK = $$quote(mt.exe -nologo -manifest \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" -outputresource:$(DESTDIR_TARGET);1$$escape_expand(\n\t)) QMAKE_POST_LINK += $$QMAKE_PREV_POST_LINK - QMAKE_CLEAN += \"$$replace(OBJECTS_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" + QMAKE_CLEAN += \"$$replace(MANIFEST_DIR,/,\\)\\$${NOPATH_TARGET}.intermediate.manifest\" } -- cgit v0.12 From 3b2b9d727f0fadf607968c73003e7550c8bd0296 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 8 Jun 2009 08:03:17 +0200 Subject: Set the error to be HostUnreacheable if WSAEHOSTUNREACH is recieved This was a contribution sent via the public bugs channel. Task-number: 255161 Reviewed-by: Marius Storm-Olsen --- src/network/socket/qnativesocketengine_win.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp index b08d7b0..8c6cd31 100644 --- a/src/network/socket/qnativesocketengine_win.cpp +++ b/src/network/socket/qnativesocketengine_win.cpp @@ -570,6 +570,11 @@ bool QNativeSocketEnginePrivate::nativeConnect(const QHostAddress &address, quin socketState = QAbstractSocket::UnconnectedState; break; } + if (value == WSAEHOSTUNREACH) { + setError(QAbstractSocket::NetworkError, HostUnreachableErrorString); + socketState = QAbstractSocket::UnconnectedState; + break; + } } // fall through } -- cgit v0.12 From 5163d6e1a36f48bf9d8483d3ca23ec730b5188c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Mon, 8 Jun 2009 09:35:03 +0300 Subject: S60theme util's README typos fixed. --- util/s60theme/README | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/s60theme/README b/util/s60theme/README index 3a006ec..da4e81a 100644 --- a/util/s60theme/README +++ b/util/s60theme/README @@ -19,12 +19,12 @@ Usage examples: > s60theme "Eclipse\Examples\Haze\Haze.tdf" Haze.blob (Reads the Haze theme and saves it as 'Haze.blob') -To use te blob in a Qt application, get an instance of a QS60Style and call +To use the blob in a Qt application, get an instance of a QS60Style and call style->loadS60ThemeFromBlob("Theme.blob"); -The simulated QS60Style will in its constructor by default try to load a -":/s60Stylethemes/Default.blob". If your application has that resouce width -exaclty that filename, it will be used by default. +The simulated QS60Style will, in its constructor by default, try to load a +":/s60Stylethemes/Default.blob". If your application has that a resource with +exactly that filename, it will be used by default. 'Default.blob' is not included in the current Qt source package. But it can easily be created with 's60theme' and a fresh install of Carbide.ui -- cgit v0.12 From 768cab51239a45f00d5ee3857efecd3d2cdcb99b Mon Sep 17 00:00:00 2001 From: ikause Date: Fri, 5 Jun 2009 16:23:01 +0300 Subject: Bug fix for 251870 A correction to this defect: 251870 QPluginLoader will only look for stubs from single drive, though plugins themselves can be located on any drive. Now the implementation goes through all the available drives if given path does not find corresponding stub-file in QPluginLoader::setFileName(). Since this is Symbian specific functionality, all the changes are behind Q_OS_SYMBIAN-flags. Note: Updated tests now need memory card being installed to device under test. Otherwise the test will be skipped. In case needed, drive is easy to change to tests. D-drive could also be a good option. modified: src/corelib/plugin/qpluginloader.cpp modified: tests/auto/qpluginloader/tst_qpluginloader.cpp Reviewed-By: Miikka Heikkinen --- src/corelib/plugin/qpluginloader.cpp | 19 ++++++++++ tests/auto/qpluginloader/tst_qpluginloader.cpp | 52 +++++++++++++++++++++++++- 2 files changed, 70 insertions(+), 1 deletion(-) diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp index a911f1d..8d1c0f7 100644 --- a/src/corelib/plugin/qpluginloader.cpp +++ b/src/corelib/plugin/qpluginloader.cpp @@ -46,6 +46,7 @@ #include #include "qlibrary_p.h" #include "qdebug.h" +#include "qdir.h" #ifndef QT_NO_LIBRARY @@ -301,6 +302,24 @@ void QPluginLoader::setFileName(const QString &fileName) } QString fn = fi.canonicalFilePath(); + // If not found directly, check also all the available drives + if (!fn.length()) { + QString stubPath(fi.fileName().length() ? fi.absoluteFilePath() : QString()); + if (stubPath.length() > 1) { + if (stubPath.at(1).toAscii() == ':') + stubPath.remove(0,2); + QFileInfoList driveList(QDir::drives()); + foreach(const QFileInfo& drive, driveList) { + QString testFilePath(drive.absolutePath() + stubPath); + testFilePath = QDir::cleanPath(testFilePath); + if (QFile::exists(testFilePath)) { + fn = testFilePath; + break; + } + } + } + } + #else QString fn = QFileInfo(fileName).canonicalFilePath(); #endif diff --git a/tests/auto/qpluginloader/tst_qpluginloader.cpp b/tests/auto/qpluginloader/tst_qpluginloader.cpp index 20ca997..3b2cb66 100644 --- a/tests/auto/qpluginloader/tst_qpluginloader.cpp +++ b/tests/auto/qpluginloader/tst_qpluginloader.cpp @@ -122,7 +122,7 @@ private slots: void errorString(); void loadHints(); void deleteinstanceOnUnload(); - + void checkingStubsFromDifferentDrives(); }; tst_QPluginLoader::tst_QPluginLoader() @@ -297,6 +297,56 @@ void tst_QPluginLoader::deleteinstanceOnUnload() } } +void tst_QPluginLoader::checkingStubsFromDifferentDrives() +{ +#if defined(Q_OS_SYMBIAN) + + // This test needs C-drive + some additional drive (driveForStubs) + + const QString driveForStubs("E:/");// != "C:/" + const QString stubDir("system/temp/stubtest/"); + const QString stubName("dummyStub.qtplugin"); + const QString fullStubFileName(stubDir + stubName); + QDir dir(driveForStubs); + bool test1(false); bool test2(false); + + // initial clean up + QFile::remove(driveForStubs + fullStubFileName); + dir.rmdir(driveForStubs + stubDir); + + // create a stub dir and do stub drive check + if (!dir.mkpath(stubDir)) + QSKIP("Required drive not available for this test", SkipSingle); + + {// test without stub, should not be found + QPluginLoader loader("C:/" + fullStubFileName); + test1 = !loader.fileName().length(); + } + + // create a stub to defined drive + QFile tempFile(driveForStubs + fullStubFileName); + tempFile.open(QIODevice::ReadWrite); + QFileInfo fileInfo(tempFile); + + {// now should be found even tried to find from C: + QPluginLoader loader("C:/" + fullStubFileName); + test2 = (loader.fileName() == fileInfo.absoluteFilePath()); + } + + // clean up + tempFile.close(); + if (!QFile::remove(driveForStubs + fullStubFileName)) + QWARN("Could not remove stub file"); + if (!dir.rmdir(driveForStubs + stubDir)) + QWARN("Could not remove stub directory"); + + // test after cleanup + QVERIFY(test1); + QVERIFY(test2); + +#endif//Q_OS_SYMBIAN +} + QTEST_APPLESS_MAIN(tst_QPluginLoader) #include "tst_qpluginloader.moc" -- cgit v0.12 From 5d749ad1b67a8d5ba77800567ffa473f5ad1d9f5 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Mon, 8 Jun 2009 09:49:05 +0200 Subject: Fixed parsing error when doing configure+compile in clean environment --- src/gui/widgets/widgets.pri | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gui/widgets/widgets.pri b/src/gui/widgets/widgets.pri index d0f981c..f395c76 100644 --- a/src/gui/widgets/widgets.pri +++ b/src/gui/widgets/widgets.pri @@ -25,7 +25,6 @@ HEADERS += \ widgets/qframe.h \ widgets/qframe_p.h \ widgets/qgroupbox.h \ - widgets/qkeyeventsoftkey.h \ widgets/qlabel.h \ widgets/qlabel_p.h \ widgets/qlcdnumber.h \ @@ -79,8 +78,8 @@ HEADERS += \ widgets/qtoolbararealayout_p.h \ widgets/qplaintextedit.h \ widgets/qplaintextedit_p.h \ - widgets/qprintpreviewwidget.h - + widgets/qprintpreviewwidget.h \ + widgets/qkeyeventsoftkey.h SOURCES += \ widgets/qabstractbutton.cpp \ widgets/qabstractslider.cpp \ @@ -98,7 +97,6 @@ SOURCES += \ widgets/qfontcombobox.cpp \ widgets/qframe.cpp \ widgets/qgroupbox.cpp \ - widgets/qkeyeventsoftkey.cpp \ widgets/qlabel.cpp \ widgets/qlcdnumber.cpp \ widgets/qlineedit.cpp \ @@ -140,7 +138,8 @@ SOURCES += \ widgets/qwidgetanimator.cpp \ widgets/qtoolbararealayout.cpp \ widgets/qplaintextedit.cpp \ - widgets/qprintpreviewwidget.cpp + widgets/qprintpreviewwidget.cpp \ + widgets/qkeyeventsoftkey.cpp !embedded:mac { HEADERS += widgets/qmacnativewidget_mac.h \ -- cgit v0.12 From 8938f242414cc67f8a4081222857bfeb16bb5f37 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Mon, 8 Jun 2009 10:33:38 +0200 Subject: Implemented context sensitive menu item --- src/gui/widgets/qmenu_symbian.cpp | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index e422882..ed2ea46 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -90,6 +90,16 @@ bool menuExists() return true; } +static bool hasContextMenu(QWidget* widget) +{ + if (!widget) + return false; + const Qt::ContextMenuPolicy policy = widget->contextMenuPolicy(); + if (policy != Qt::NoContextMenu && policy != Qt::PreventContextMenu ) { + return true; + } + return false; +} // ### FIX THIS, copy/paste of original (faulty) stripped text implementation. // Implementation should be removed from QAction implementation to some generic place static QString qt_strippedText_copy_from_qaction(QString s) @@ -212,24 +222,12 @@ static void rebuildMenu() QMenuBarPrivate *mb = 0; QWidget *w = qApp->activeWindow(); QMainWindow *mainWindow = qobject_cast(w); - /* if ((mainWindow) && mainWindow->hasSoftKeyStack()) { - QSoftKeyStack* softKeyStack = mainWindow->softKeyStack(); - if (!softKeyStack->isEmpty()) { - const QSoftkeySet& softKeyTop = softKeyStack->top(); - int index=0; - bool found=false; - while( indexrole(); - if(softAction->role() == QSoftKeyAction::ContextMenu) { - widgetWithContextMenu = softAction->parentWidget(); - found=true; - } - index++; - } - } + QWidget* focusWidget = QApplication::focusWidget(); + if (focusWidget) { + if (hasContextMenu(focusWidget)) + widgetWithContextMenu = focusWidget; } -*/ + if (w) { mb = menubars()->value(w); qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM; -- cgit v0.12 From 5b0f60b7eae6daac9ef45726cdc8cde18bcb69f9 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Mon, 8 Jun 2009 10:47:00 +0200 Subject: Set empty buttons by default --- src/s60main/qts60mainappui.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/s60main/qts60mainappui.cpp b/src/s60main/qts60mainappui.cpp index 47312af..7d38f33 100644 --- a/src/s60main/qts60mainappui.cpp +++ b/src/s60main/qts60mainappui.cpp @@ -68,6 +68,9 @@ void CQtS60MainAppUi::ConstructL() // even these flags are defined BaseConstructL(CAknAppUi::EAknEnableSkin); + CEikButtonGroupContainer* nativeContainer = Cba(); + nativeContainer->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY_WITH_IDS); + // Create async callback to call Qt main, // this is required to give S60 app FW to finish starting correctly TCallBack callBack( OpenCMainStaticCallBack, this ); -- cgit v0.12 From fb8dccabd68a854c50adfc3f1e77badc3ff50ec8 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Mon, 8 Jun 2009 12:00:42 +0200 Subject: Removed QSoftkeySet as it wasn't used anymore --- src/gui/kernel/qwidget_s60.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index cb2fc8f..858320c 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -61,9 +61,7 @@ extern bool qt_nograb(); QWidget *QWidgetPrivate::mouseGrabber = 0; QWidget *QWidgetPrivate::keyboardGrabber = 0; -#define QSoftkeySet QList - -static void mapSoftKeys(const QSoftkeySet &softkeys) +static void mapSoftKeys(const QList &softkeys) { /* if (softkeys.count() == 1 && softkeys.at(0)->menuRole()==QAction::MenuSoftKey) { softkeys.at(0)->setNativePosition(0); -- cgit v0.12 From a73a43e036159f49a3d422790acfbdbaed5610b9 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 8 Jun 2009 14:48:19 +0300 Subject: Changed created sisx package extension to sis and also cleaned up the createpackage script a bit in general. --- bin/createpackage.bat | 63 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 44 insertions(+), 19 deletions(-) diff --git a/bin/createpackage.bat b/bin/createpackage.bat index 1c6e94d..116d52b 100644 --- a/bin/createpackage.bat +++ b/bin/createpackage.bat @@ -1,5 +1,16 @@ @echo off +set installsigned_old=%installsigned% +set pkgfile_old=%pkgfile% +set basename_old=%basename% +set signsis1_old=%signsis1% +set signsis2_old=%signsis2% +set signsis3_old=%signsis3% +set unsigned_sis_name_old=%unsigned_sis_name% +set signed_sis_name_old=%signed_sis_name% +set scriptpath_old=%scriptpath% +set certificate_old=%certificate% + rem Help text if "%1"=="" ( echo Convenience script for creating signed packages you can install on your phone. @@ -13,14 +24,14 @@ if "%1"=="" ( ) if "%1"=="-i" ( - set installsisx=true + set installsigned=true set pkgfile=%2 set basename=%~n2 set signsis1=%3 set signsis2=%4 set signsis3=%5 ) else ( - set installsisx=false + set installsigned=false set pkgfile=%1 set basename=%~n1 set signsis1=%2 @@ -28,34 +39,37 @@ if "%1"=="-i" ( set signsis3=%4 ) +set unsigned_sis_name=%basename%_unsigned.sis +set signed_sis_name=%basename%.sis + +rem Get absolute path to this script +set scriptpath=%~dp0 + rem Check the .pkg actually exists. if not exist %pkgfile% ( echo Error: Package description file '%pkgfile%' does not exist. goto done ) -rem Get absolute path to this script -set scriptpath=%~dp0 - -rem Remove any existing .sis or .sisx packages -if exist %basename%.sis del %basename%.sis -if exist %basename%.sisx del %basename%.sisx +rem Remove any existing .sis packages +if exist %signed_sis_name% del %signed_sis_name% +if exist %unsigned_sis_name% del %unsigned_sis_name% rem Create .sis package -makesis %pkgfile% +makesis %pkgfile% %unsigned_sis_name% rem If no certificate is given, check default options if x%signsis1% == x ( rem If RnD certificate is not found, sign with self signed certificate if not exist %scriptpath%..\rd.cer ( set certificate=Self signed - signsis %basename%.sis %basename%.sisx %scriptpath%..\selfsigned.cer %scriptpath%..\selfsigned.key + signsis %unsigned_sis_name% %signed_sis_name% %scriptpath%..\selfsigned.cer %scriptpath%..\selfsigned.key goto install ) rem Sign with RnD certificate set certificate=RnD - signsis %basename%.sis %basename%.sisx %scriptpath%..\rd.cer %scriptpath%..\rd-key.pem + signsis %unsigned_sis_name% %signed_sis_name% %scriptpath%..\rd.cer %scriptpath%..\rd-key.pem ) else ( if x%signsis2% == x ( echo Custom certificate key file parameter missing. @@ -63,19 +77,30 @@ if x%signsis1% == x ( ) set certificate=%signsis1% - signsis %basename%.sis %basename%.sisx %signsis1% %signsis2% %signsis3% + signsis %unsigned_sis_name% %signed_sis_name% %signsis1% %signsis2% %signsis3% ) :install -if exist %basename%.sisx ( - echo Successfully created %basename%.sisx using certificate %certificate% - if "%installsisx%" == "true" ( - echo Installing %basename%.sisx... - call %basename%.sisx +if exist %signed_sis_name% ( + echo Successfully created %signed_sis_name% using certificate %certificate% + if "%installsigned%" == "true" ( + echo Installing %signed_sis_name%... + call %signed_sis_name% ) ) :cleanup -if exist %basename%.sis del %basename%.sis +if exist %unsigned_sis_name% del %unsigned_sis_name% + +:done -:done \ No newline at end of file +set installsigned=%installsigned_old% +set pkgfile=%pkgfile_old% +set basename=%basename_old% +set signsis1=%signsis1_old% +set signsis2=%signsis2_old% +set signsis3=%signsis3_old% +set unsigned_sis_name=%unsigned_sis_name_old% +set signed_sis_name=%signed_sis_name_old% +set scriptpath=%scriptpath_old% +set certificate=%certificate_old% -- cgit v0.12 From b3b5ae13763c97bad4bfcdda539acf8656c34938 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Mon, 8 Jun 2009 14:56:21 +0300 Subject: Fixed tst_QTemporaryFile::renameFdLeak test case for Symbian. Test data for Symbian was not deployed correctly. --- tests/auto/qtemporaryfile/qtemporaryfile.pro | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/auto/qtemporaryfile/qtemporaryfile.pro b/tests/auto/qtemporaryfile/qtemporaryfile.pro index a3a3910..0f2a6ea 100644 --- a/tests/auto/qtemporaryfile/qtemporaryfile.pro +++ b/tests/auto/qtemporaryfile/qtemporaryfile.pro @@ -2,4 +2,11 @@ load(qttest_p4) SOURCES += tst_qtemporaryfile.cpp QT = core -!symbian:DEFINES += SRCDIR=\\\"$$PWD/\\\" + +symbian { + testData.sources = tst_qtemporaryfile.cpp + testData.path = . + DEPLOYMENT += testData +}else { + DEFINES += SRCDIR=\\\"$$PWD/\\\" +} -- cgit v0.12 From efc999e95a74eee7e282e8d34e681c5b18cb60ad Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Mon, 8 Jun 2009 14:57:34 +0300 Subject: Avoid unnecessary calls to FocusChanged in Symbian. Called setFocus only when the widget does not already have the focus. This should remove unncessary calls to FocusChanged since CCoeControl always calls FocusChanged when SetFocus is called, even there was no changes in focus. --- src/gui/kernel/qwidget_s60.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 11cb974..e32e272 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -319,7 +319,8 @@ void QWidgetPrivate::hide_sys() deactivateWidgetCleanup(); WId id = q->internalWinId(); if (q->isWindow() && id) { - id->SetFocus(false); + if(id->IsFocused()) // Avoid unnecessry calls to FocusChanged() + id->SetFocus(false); id->MakeVisible(false); id->ControlEnv()->AppUi()->RemoveFromStack(id); if (QWidgetBackingStore *bs = maybeBackingStore()) @@ -335,7 +336,8 @@ void QWidgetPrivate::setFocus_sys() { Q_Q(QWidget); if (q->testAttribute(Qt::WA_WState_Created) && q->window()->windowType() != Qt::Popup) - q->effectiveWinId()->SetFocus(true); + if(!q->effectiveWinId()->IsFocused()) // Avoid unnecessry calls to FocusChanged() + q->effectiveWinId()->SetFocus(true); } void QWidgetPrivate::raise_sys() @@ -922,7 +924,8 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) releaseKeyboard(); if (destroyWindow && !(windowType() == Qt::Desktop) && internalWinId()) { WId id = internalWinId(); - id->SetFocus(false); + if(id->IsFocused()) // Avoid unnecessry calls to FocusChanged() + id->SetFocus(false); id->ControlEnv()->AppUi()->RemoveFromStack(id); CBase::Delete(id); -- cgit v0.12 From 745fb79189b57f88ec926a0b169c090cfd9b0571 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 8 Jun 2009 15:01:12 +0300 Subject: S60 install docs updates. --- doc/src/installation.qdoc | 120 +++++++++++------------- doc/src/s60-introduction.qdoc | 14 ++- doc/src/snippets/code/doc_src_installation.qdoc | 5 - 3 files changed, 67 insertions(+), 72 deletions(-) diff --git a/doc/src/installation.qdoc b/doc/src/installation.qdoc index 697427d..13af50c 100644 --- a/doc/src/installation.qdoc +++ b/doc/src/installation.qdoc @@ -499,51 +499,15 @@ in the \l{Qt for Windows CE Requirements} document. We hope you will enjoy using Qt. Good luck! */ -/*! \page install-S60.html - -\title Installing Qt on S60 -\ingroup installation -\ingroup qts60 -\brief How to install Qt on S60. -\list 1 - \o Install needed IDE and SDKs - - Make sure you have the following installed on your development PC: - \list - \o \l{http://www.forum.nokia.com/main/resources/tools_and_sdks/carbide_cpp/}{Carbide.c++ v2.0.0 or higher} - \o \l{http://www.forum.nokia.com/main/resources/tools_and_sdks/S60SDK/}{S60 Platform SDK 3rd Edition FP1 or higher} - \o \l{http://www.forum.nokia.com/main/resources/technologies/openc_cpp/}{Open C/C++ v1.6.0 or higher}. - Install this to all S60 SDKs you plan to use Qt with. - \endlist - - Make sure you have the following plugins installed on your device. The packages can be found - in the S60 SDK where you installed Open C/C++: - \list - \o nokia_plugin\openc\s60opencsis\pips_s60_.sis - \o nokia_plugin\openc\s60opencsis\openc_ssl_s60_.sis - \o nokia_plugin\opencpp\s60opencppsis\stdcpp_s60_.sis - \endlist - - These instructions assume the above tools are installed and - that the enviroment variables for your compiler are set correctly. - - \note Users of \bold{S60 Platform SDK 3rd Edition FP1} also need special updates. The update can be found - \l{http://pepper.troll.no/s60prereleases/patches/}{here}. - - \o Depending on how you obtained the Qt for S60 release, follow the instructions in one of these pages: - \list - \o \l{Installing Qt on S60 binary package} - \o \l{Installing Qt on S60 source package} - \endlist -\endlist -*/ - /*! \page install-S60-installer.html -\title Installing Qt on S60 binary package -\ingroup installation +\title Installing Qt on S60 using binary package \ingroup qts60 \brief How to install Qt on S60 using the binary package. + +\note Qt for S60 has some requirements that are given in more detail +in the \l{Qt for S60 Requirements} document. + \list 1 \o Install Qt @@ -558,20 +522,19 @@ in the \l{Qt for Windows CE Requirements} document. We've included a subset of the Qt demos in this package for you to try out. An excellent starting point is the "fluidlauncher" demo. To run the demo on a real device, you first have to install - \c{qt_libs.sisx} and \c{fluidlauncher.sisx} found in the Qt installation - directory. In Windows Explorer right click on the \c{.sisx} files and select + \c{qt_libs.sis} and \c{fluidlauncher.sis} found in the Qt installation + directory. In Windows Explorer right click on the \c{.sis} files and select "Install with Nokia Application Installer" and follow the instructions. - To run the demos and examples on the emulator, you need to build them. + To run the demos and examples on the emulator, you need to build them first. Open the "Qt for S60 Command Prompt" from the Start menu and type: \snippet doc/src/snippets/code/doc_src_installation.qdoc 25 - After building, you can run demos and examples by navigating to - \c{%EPOCROOT%\Epoc32\release\winscw\udeb\} and starting any of the - Qt demos and examples located there. For example: + To run the demos on the emulator simply navigate to the directory of the demo + you want to see and run: - \snippet doc/src/snippets/code/doc_src_installation.qdoc 26 + \snippet doc/src/snippets/code/doc_src_installation.qdoc 27 For more information about building and running Qt programs on S60, see \l{S60 - Introduction to using Qt}. @@ -581,19 +544,21 @@ in the \l{Qt for Windows CE Requirements} document. \endlist */ -/*! \page install-S60-sources.html +/*! \page install-S60.html -\title Installing Qt on S60 source package +\title Installing Qt on S60 \ingroup installation \ingroup qts60 -\brief How to install Qt on S60 using the source package. +\brief How to install Qt on S60 -\list 1 +\note Qt for S60 has some requirements that are given in more detail +in the \l{Qt for S60 Requirements} document. - \o Install needed tools - - Building Qt libraries requires \l{http://www.arm.com/products/DevTools/RVCT.html}{RVCT} 2.2 [build 616] or later, - which is not available free of charge. +\note This document describes how to install Qt for S60 from the source package. +Go \l{Installing Qt on S60 using binary package}{here} for instructions on how to install +Qt using binary package. + +\list 1 \o Install Qt @@ -656,19 +621,14 @@ in the \l{Qt for Windows CE Requirements} document. \snippet doc/src/snippets/code/doc_src_installation.qdoc 30 - This will create a self-signed \c fluidlauncher_armv5_urel.sisx and + This will create a self-signed \c fluidlauncher_armv5_urel.sis and install it to your device. - To run the demos on the emulator simply run: + To run the demos on the emulator simply navigate to the directory of the demo + you want to see and run: \snippet doc/src/snippets/code/doc_src_installation.qdoc 27 - Or, if you need to supply arguments to the program, navigate to - \c{%EPOCROOT%\Epoc32\release\winscw\udeb\} and start any of the - Qt demos located there, for example: - - \snippet doc/src/snippets/code/doc_src_installation.qdoc 26 - For more information about building and running Qt programs on S60, see \l{S60 - Introduction to using Qt}. @@ -700,6 +660,7 @@ in the \l{Qt for Windows CE Requirements} document. \list \o \l{Qt for Embedded Linux Requirements} \o \l{Qt for Mac OS X Requirements} + \o \l{Qt for S60 Requirements} \o \l{Qt for Windows CE Requirements} \o \l{Qt for Windows Requirements} \o \l{Qt for X11 Requirements} @@ -933,3 +894,34 @@ in the \l{Qt for Windows CE Requirements} document. enables the use of the Record extension to the X protocol to be used in applications. */ + +/*! + \page requirements-s60.html + \title Qt for S60 Requirements + \ingroup installation + \brief Setting up the S60 environment for Qt. + \previouspage General Qt Requirements + + Qt for S60 requires the following software installed on your development PC: + \list + \o \l{http://www.forum.nokia.com/main/resources/tools_and_sdks/carbide_cpp/}{Carbide.c++ v2.0.0 or higher} + \o \l{http://www.forum.nokia.com/main/resources/tools_and_sdks/S60SDK/}{S60 Platform SDK 3rd Edition FP1 or higher} + \o \l{http://www.forum.nokia.com/main/resources/technologies/openc_cpp/}{Open C/C++ v1.6.0 or higher}. + Install this to all S60 SDKs you plan to use Qt with. + \o Building Qt libraries requires \l{http://www.arm.com/products/DevTools/RVCT.html}{RVCT} 2.2 [build 616] or later, + which is not available free of charge. + \endlist + + Running Qt on real device requires the following packages to be installed on your device. + The packages can be found in the S60 SDK where you installed Open C/C++: + \list + \o \c{nokia_plugin\openc\s60opencsis\pips_s60_.sis} + \o \c{nokia_plugin\openc\s60opencsis\openc_ssl_s60_.sis} + \o \c{nokia_plugin\opencpp\s60opencppsis\stdcpp_s60_.sis} + \endlist + + \note Users of \bold{S60 Platform SDK 3rd Edition FP1} also need special updates. The update can be found + \l{http://pepper.troll.no/s60prereleases/patches/}{here}. + + \sa {Known Issues in %VERSION%} +*/ diff --git a/doc/src/s60-introduction.qdoc b/doc/src/s60-introduction.qdoc index af67a8a..537b37d 100644 --- a/doc/src/s60-introduction.qdoc +++ b/doc/src/s60-introduction.qdoc @@ -49,9 +49,17 @@ \tableofcontents - \section1 Installing Qt + \section1 Required tools + + See \l{Qt for S60 Requirements} to see what tools are required to use Qt for S60. - Follow the instructions found in \l{Installing Qt on S60}. + \section1 Installing Qt and running demos + + Follow the instructions found in \l{Installing Qt on S60 using binary package} to learn how + to install Qt using binary package and how to build and run Qt demos. + + Follow the instructions found in \l{Installing Qt on S60} to learn how to install Qt using + using source package and how to build and run the Qt demos. \section1 Building your own applications @@ -96,7 +104,7 @@ To install your own applications on hardware, Qt comes with a tool called \c createpackage. When used on the \c .pkg files created by qmake, it - will produce a \c .sisx file that can be installed to the device. For + will produce a signed \c .sis file that can be installed to the device. For example: \snippet doc/src/snippets/code/doc_src_s60-introduction.qdoc 2 diff --git a/doc/src/snippets/code/doc_src_installation.qdoc b/doc/src/snippets/code/doc_src_installation.qdoc index d698f4a..489016d 100644 --- a/doc/src/snippets/code/doc_src_installation.qdoc +++ b/doc/src/snippets/code/doc_src_installation.qdoc @@ -146,11 +146,6 @@ qmake make //! [25] - -//! [26] -wiggly.exe -small-screen -//! [26] - //! [27] make run //! [27] -- cgit v0.12 From 320e003d2ee71b8c58e930dabf0603f6dc1b1647 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Mon, 8 Jun 2009 15:15:56 +0300 Subject: Fix to qplaintextedit::getSetCheck auto test in Symbian. We cannot use INT_MAX since qreal is typedef to float in Symbian OS. --- tests/auto/qplaintextedit/tst_qplaintextedit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qplaintextedit/tst_qplaintextedit.cpp b/tests/auto/qplaintextedit/tst_qplaintextedit.cpp index 6835c21..456ab7b 100644 --- a/tests/auto/qplaintextedit/tst_qplaintextedit.cpp +++ b/tests/auto/qplaintextedit/tst_qplaintextedit.cpp @@ -221,7 +221,7 @@ void tst_QPlainTextEdit::getSetCheck() QCOMPARE(0, obj1.tabStopWidth()); obj1.setTabStopWidth(INT_MIN); QCOMPARE(0, obj1.tabStopWidth()); // Makes no sense to set a negative tabstop value -#if defined(QT_ARCH_WINDOWSCE) +#if defined(QT_ARCH_WINDOWSCE) || defined (QT_ARCH_SYMBIAN) // due to rounding error in qRound when qreal==float // we cannot use INT_MAX for this check obj1.setTabStopWidth(SHRT_MAX*2); -- cgit v0.12 From 3e5b3a45a23d50732b3fcd5c44ab824d32deb1d8 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Mon, 8 Jun 2009 14:16:29 +0200 Subject: pointSize = 7 seems to be a good desfault for S60 There were no objections from the field with ing one Year of Tech Previews. --- src/gui/text/qfont.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index 930e8af..dd50d12 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -796,7 +796,6 @@ QFont::QFont(const QString &family, int pointSize, int weight, bool italic) if (pointSize <= 0) { #ifdef Q_WS_S60 - // TODO: What should the default QFont pointSize for Q_WS_S60 be? pointSize = 7; #else pointSize = 12; -- cgit v0.12 From 46cb3a09f4eedb2d4c612a6d73e9e0f14237350c Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Mon, 8 Jun 2009 17:08:26 +0200 Subject: Fixes from code review --- src/gui/kernel/qaction.cpp | 3 ++- src/gui/kernel/qaction.h | 1 - src/gui/kernel/qapplication_s60.cpp | 6 ++--- src/gui/kernel/qwidget.cpp | 39 ++++++++++++++++++++++++-------- src/gui/kernel/qwidget.h | 2 +- src/gui/kernel/qwidget_p.h | 6 ++--- src/gui/kernel/qwidget_s60.cpp | 7 +++--- src/gui/widgets/qkeyeventsoftkey.cpp | 44 ++++++++++++++++++------------------ src/gui/widgets/qkeyeventsoftkey.h | 4 ++-- src/gui/widgets/qmainwindow.cpp | 2 +- src/gui/widgets/qmenu_symbian.cpp | 11 ++++----- src/gui/widgets/qmenubar_p.h | 2 +- 12 files changed, 70 insertions(+), 57 deletions(-) diff --git a/src/gui/kernel/qaction.cpp b/src/gui/kernel/qaction.cpp index e32416a..8263cbc 100644 --- a/src/gui/kernel/qaction.cpp +++ b/src/gui/kernel/qaction.cpp @@ -1353,7 +1353,7 @@ QAction::MenuRole QAction::menuRole() const \since 4.6 This indicates what softkey action this action is. Usually used on mobile - platforms to map QActions no hardware keys. + platforms to map QActions to hardware keys. The softkey role can be changed any time. */ @@ -1372,6 +1372,7 @@ QAction::SoftKeyRole QAction::softKeyRole() const Q_D(const QAction); return d->softKeyRole; } + /*! \property QAction::iconVisibleInMenu \brief Whether or not an action should show an icon in a menu diff --git a/src/gui/kernel/qaction.h b/src/gui/kernel/qaction.h index 6725f42..8791a5c 100644 --- a/src/gui/kernel/qaction.h +++ b/src/gui/kernel/qaction.h @@ -96,7 +96,6 @@ public: EndEditSoftKey, RevertEditSoftKey, DeselectSoftKey, FinishSoftKey, MenuSoftKey, ContextMenuSoftKey, Key1SoftKey, Key2SoftKey, Key3SoftKey, Key4SoftKey, CustomSoftKey }; - explicit QAction(QObject* parent); QAction(const QString &text, QObject* parent); QAction(const QIcon &icon, const QString &text, QObject* parent); diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 6ee7899..0ae4c00 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -1** +** ** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** @@ -1067,9 +1067,7 @@ void QApplication::symbianHandleCommand(int command) int index= command-SOFTKEYSTART; QWidget* focused = QApplication::focusWidget(); const QList& softKeys = focused->softKeys(); - if (index>=softKeys.count()) { - // Assert horrible state error - } + Q_ASSERT(indexactivate(QAction::Trigger); } else diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 9d4f176..3a22ee9 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -4881,7 +4881,7 @@ void QWidget::render(QPainter *painter, const QPoint &targetOffset, } #if !defined(Q_WS_S60) -void QWidgetPrivate::setNativeSoftKeys(const QList &softkeys) +void QWidgetPrivate::setSoftKeys_sys(const QList &softkeys) { Q_UNUSED(softkeys) } @@ -5723,7 +5723,7 @@ bool QWidget::hasFocus() const void QWidget::setFocus(Qt::FocusReason reason) { Q_D(QWidget); - d->setNativeSoftKeys(softKeys()); + d->setSoftKeys_sys(softKeys()); if (!isEnabled()) return; @@ -11520,19 +11520,33 @@ void QWidget::clearMask() setMask(QRegion()); } +/*! + Returns the (possibly empty) list of this widget's softkeys. + Returned list cannot be changed. Softkeys should be added + and removed via method called setSoftKeys + + \sa setSoftKey(), setSoftKeys() +*/ const QList& QWidget::softKeys() const { Q_D(const QWidget); if( d->softKeys.count() > 0) return d->softKeys; - if (isWindow() || !parentWidget()) return d->softKeys; - + return parentWidget()->softKeys(); } -void QWidget::setSoftKeys(QAction *softKey) +/*! + Sets the softkey \a softkey to this widget's list of softkeys, + Setting 0 as softkey will clear all the existing softkeys set + to the widget + A QWidget can have 0 or more softkeys + + \sa softKeys(), setSoftKeys() +*/ +void QWidget::setSoftKey(QAction *softKey) { Q_D(QWidget); qDeleteAll(d->softKeys); @@ -11540,19 +11554,24 @@ void QWidget::setSoftKeys(QAction *softKey) if (softKey) d->softKeys.append(softKey); if (QApplication::focusWidget() == this) - d->setNativeSoftKeys(this->softKeys()); + d->setSoftKeys_sys(this->softKeys()); } +/*! + Sets the list of softkeys \a softkeys to this widget's list of softkeys, + A QWidget can have 0 or more softkeys + + \sa softKeys(), setSoftKey() +*/ void QWidget::setSoftKeys(const QList &softKeys) { Q_D(QWidget); qDeleteAll(d->softKeys); d->softKeys.clear(); - for(int i = 0; i < softKeys.count(); i++) - d->softKeys.append(softKeys.at(i)); - + d->softKeys = softKeys; + if (QApplication::focusWidget() == this) - d->setNativeSoftKeys(this->softKeys()); + d->setSoftKeys_sys(this->softKeys()); } /*! \fn const QX11Info &QWidget::x11Info() const diff --git a/src/gui/kernel/qwidget.h b/src/gui/kernel/qwidget.h index 36a30ac..3f9caee 100644 --- a/src/gui/kernel/qwidget.h +++ b/src/gui/kernel/qwidget.h @@ -555,7 +555,7 @@ public: QList actions() const; #endif const QList& softKeys() const; - void setSoftKeys(QAction *softKey); + void setSoftKey(QAction *softKey); void setSoftKeys(const QList &softKeys); QWidget *parentWidget() const; diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index 2119849..084439c 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -85,8 +85,8 @@ class CCoeControl; class CAknTitlePane; class CAknContextPane; // The following 2 defines may only be needed for s60. To be seen. -#define SOFTKEYSTART 5000 -#define SOFTKEYEND (5000 + Qt::Key_Context4-Qt::Key_Context1) +const int SOFTKEYSTART=5000; +const int SOFTKEYEND=5004; #endif QT_BEGIN_NAMESPACE @@ -227,7 +227,7 @@ public: explicit QWidgetPrivate(int version = QObjectPrivateVersion); ~QWidgetPrivate(); - void setNativeSoftKeys(const QList &softkeys); + void setSoftKeys_sys(const QList &softkeys); QWExtra *extraData() const; QTLWExtra *topData() const; QTLWExtra *maybeTopData() const; diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 858320c..2a83fc7 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -86,9 +86,8 @@ static void mapSoftKeys(const QList &softkeys) */ } -static bool isSame(const QList& a, const QList& b) +static bool isEqual(const QList& a, const QList& b) { - bool isSame=true; if ( a.count() != b.count()) return false; int index=0; @@ -103,12 +102,12 @@ static bool isSame(const QList& a, const QList& b) } -void QWidgetPrivate::setNativeSoftKeys(const QList &softkeys) +void QWidgetPrivate::setSoftKeys_sys(const QList &softkeys) { Q_Q(QWidget); if (QApplication::focusWidget() && q!=QApplication::focusWidget()) { QList old = QApplication::focusWidget()->softKeys(); - if (isSame(old, softkeys )) + if (isEqual(old, softkeys )) return; } diff --git a/src/gui/widgets/qkeyeventsoftkey.cpp b/src/gui/widgets/qkeyeventsoftkey.cpp index bb236cc..f5f10fc 100644 --- a/src/gui/widgets/qkeyeventsoftkey.cpp +++ b/src/gui/widgets/qkeyeventsoftkey.cpp @@ -56,26 +56,26 @@ QKeyEventSoftKey::QKeyEventSoftKey(QAction *softKeyAction, Qt::Key key, QObject QString QKeyEventSoftKey::roleText(QAction::SoftKeyRole role) { switch (role) { - case QAction::OptionsSoftKey: - return QAction::tr("Options"); - case QAction::SelectSoftKey: - return QAction::tr("Select"); - case QAction::BackSoftKey: - return QAction::tr("Back"); - case QAction::NextSoftKey: - return QAction::tr("Next"); - case QAction::PreviousSoftKey: - return QAction::tr("Previous"); - case QAction::OkSoftKey: - return QAction::tr("Ok"); - case QAction::CancelSoftKey: - return QAction::tr("Cancel"); - case QAction::EditSoftKey: - return QAction::tr("Edit"); - case QAction::ViewSoftKey: - return QAction::tr("View"); - default: - return QString(); + case QAction::OptionsSoftKey: + return QAction::tr("Options"); + case QAction::SelectSoftKey: + return QAction::tr("Select"); + case QAction::BackSoftKey: + return QAction::tr("Back"); + case QAction::NextSoftKey: + return QAction::tr("Next"); + case QAction::PreviousSoftKey: + return QAction::tr("Previous"); + case QAction::OkSoftKey: + return QAction::tr("Ok"); + case QAction::CancelSoftKey: + return QAction::tr("Cancel"); + case QAction::EditSoftKey: + return QAction::tr("Edit"); + case QAction::ViewSoftKey: + return QAction::tr("View"); + default: + return QString(); }; } void QKeyEventSoftKey::addSoftKey(QAction::SoftKeyRole standardRole, Qt::Key key, QWidget *actionWidget) @@ -86,12 +86,12 @@ void QKeyEventSoftKey::addSoftKey(QAction::SoftKeyRole standardRole, Qt::Key key QKeyEventSoftKey *softKey = new QKeyEventSoftKey(action, key, actionWidget); connect(action, SIGNAL(triggered()), softKey, SLOT(sendKeyEvent())); connect(action, SIGNAL(destroyed()), softKey, SLOT(deleteLater())); - actionWidget->setSoftKeys(action); + actionWidget->setSoftKey(action); } void QKeyEventSoftKey::removeSoftkey(QWidget *focussedWidget) { - focussedWidget->setSoftKeys(0); + focussedWidget->setSoftKey(0); } void QKeyEventSoftKey::sendKeyEvent() diff --git a/src/gui/widgets/qkeyeventsoftkey.h b/src/gui/widgets/qkeyeventsoftkey.h index 83449c7..0b95efb 100644 --- a/src/gui/widgets/qkeyeventsoftkey.h +++ b/src/gui/widgets/qkeyeventsoftkey.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QKEYEVENSOFTKEY_H -#define QKEYEVENSOFTKEY_H +#ifndef QKEYEVENTSOFTKEY_H +#define QKEYEVENTSOFTKEY_H #include #include "QtGui/qaction.h" diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index 90c5db9..2f3b412 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -484,7 +484,7 @@ void QMainWindow::setMenuBar(QMenuBar *menuBar) if (menuBar) { QAction* menu = new QAction(QString::fromLatin1("Menu"), this); menu->setSoftKeyRole(QAction::MenuSoftKey); - setSoftKeys(menu); + setSoftKey(menu); } } diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index ed2ea46..49bcc21 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -40,8 +40,6 @@ #include "qmenu.h" #include "qapplication.h" -#include "qmainwindow.h" -#include "qtoolbar.h" #include "qevent.h" #include "qstyle.h" #include "qdebug.h" @@ -221,13 +219,12 @@ static void rebuildMenu() widgetWithContextMenu = 0; QMenuBarPrivate *mb = 0; QWidget *w = qApp->activeWindow(); - QMainWindow *mainWindow = qobject_cast(w); QWidget* focusWidget = QApplication::focusWidget(); if (focusWidget) { if (hasContextMenu(focusWidget)) widgetWithContextMenu = focusWidget; } - + if (w) { mb = menubars()->value(w); qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM; @@ -389,7 +386,7 @@ void QMenuBarPrivate::QSymbianMenuBarPrivate::removeAction(QSymbianMenuAction *a rebuild(); } -void QMenuBarPrivate::QSymbianMenuBarPrivate::InsertNativeMenuItems(const QList &actions) +void QMenuBarPrivate::QSymbianMenuBarPrivate::insertNativeMenuItems(const QList &actions) { for (int i = 0; i actions); + insertNativeMenuItems(d->actions); contextMenuActionList.clear(); if (widgetWithContextMenu) { contexMenuCommand = qt_symbian_menu_static_cmd_id; contextAction.setText(QString("Actions")); contextMenuActionList.append(&contextAction); - InsertNativeMenuItems(contextMenuActionList); + insertNativeMenuItems(contextMenuActionList); } } diff --git a/src/gui/widgets/qmenubar_p.h b/src/gui/widgets/qmenubar_p.h index 429605a..9e7d511 100644 --- a/src/gui/widgets/qmenubar_p.h +++ b/src/gui/widgets/qmenubar_p.h @@ -257,7 +257,7 @@ public: } return 0; } - void InsertNativeMenuItems(const QList &actions); + void insertNativeMenuItems(const QList &actions); } *symbian_menubar; static void symbianCommands(int command); -- cgit v0.12 From 40e305dee4d93a445721cfec37d00cb7f4f3fc0e Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Mon, 8 Jun 2009 18:16:16 +0200 Subject: Removal of inneccessary QS60StylePrivate scopes --- src/gui/styles/qs60style.cpp | 62 ++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 6d24d54..971ba90 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -318,8 +318,8 @@ QVariant QS60StylePrivate::styleProperty(const char *name) const if (name == propertyKeyLayouts) { static QStringList layouts; if (layouts.isEmpty()) - for (int i = 0; i < QS60StylePrivate::m_numberOfLayouts; i++) - layouts.append(QS60StylePrivate::m_layoutHeaders[i].layoutName); + for (int i = 0; i < m_numberOfLayouts; i++) + layouts.append(m_layoutHeaders[i].layoutName); return layouts; } return QVariant(); @@ -388,7 +388,7 @@ QFont QS60StylePrivate::s60Font( return result; } -void QS60StylePrivate::clearCaches(QS60StylePrivate::CacheClearReason reason) +void QS60StylePrivate::clearCaches(CacheClearReason reason) { switch(reason){ case CC_LayoutChange: @@ -416,12 +416,12 @@ void QS60StylePrivate::clearCaches(QS60StylePrivate::CacheClearReason reason) // for QPalette::Button and QPalette::ToolTipBase. Therefore S60Style needs to guesstimate // palette colors by calculating average rgb values for button pixels. // Returns Qt::black if there is an issue with the graphics (image is NULL, or no bits() found). -QColor QS60StylePrivate::colorFromFrameGraphics(QS60StylePrivate::SkinFrameElements frame) const +QColor QS60StylePrivate::colorFromFrameGraphics(SkinFrameElements frame) const { const bool cachedColorExists = m_colorCache.contains(frame); if (!cachedColorExists) { - const int frameCornerWidth = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth); - const int frameCornerHeight = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerHeight); + const int frameCornerWidth = pixelMetric(PM_Custom_FrameCornerWidth); + const int frameCornerHeight = pixelMetric(PM_Custom_FrameCornerHeight); Q_ASSERT(2*frameCornerWidth<32); Q_ASSERT(2*frameCornerHeight<32); @@ -495,15 +495,15 @@ void QS60StylePrivate::setBackgroundTexture(QApplication *app) const { Q_UNUSED(app) QPalette applicationPalette = QApplication::palette(); - applicationPalette.setBrush(QPalette::Window, QS60StylePrivate::backgroundTexture()); + applicationPalette.setBrush(QPalette::Window, backgroundTexture()); QApplication::setPalette(applicationPalette); } void QS60StylePrivate::deleteBackground() { - if (QS60StylePrivate::m_background) { - delete QS60StylePrivate::m_background; - QS60StylePrivate::m_background = 0; + if (m_background) { + delete m_background; + m_background = 0; } } @@ -670,7 +670,7 @@ void QS60StylePrivate::setThemePalette(QWidget *widget) const //draw transparent theme graphics to table column and row headers. if (qobject_cast(widget)){ widgetPalette.setColor(QPalette::Active, QPalette::ButtonText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 23, 0)); + s60Color(QS60StyleEnums::CL_QsnTextColors, 23, 0)); QHeaderView* header = qobject_cast(widget); widgetPalette.setColor(QPalette::Button, Qt::transparent ); if ( header->viewport() ) @@ -686,30 +686,30 @@ void QS60StylePrivate::setThemePalette(QPalette *palette) const // basic colors palette->setColor(QPalette::WindowText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); + s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); palette->setColor(QPalette::ButtonText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); + s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); palette->setColor(QPalette::Text, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); + s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0)); palette->setColor(QPalette::ToolTipText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 55, 0)); + s60Color(QS60StyleEnums::CL_QsnTextColors, 55, 0)); palette->setColor(QPalette::BrightText, palette->color(QPalette::WindowText).lighter()); palette->setColor(QPalette::HighlightedText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 10, 0)); + s60Color(QS60StyleEnums::CL_QsnTextColors, 10, 0)); palette->setColor(QPalette::Link, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnHighlightColors, 3, 0)); + s60Color(QS60StyleEnums::CL_QsnHighlightColors, 3, 0)); palette->setColor(QPalette::LinkVisited, palette->color(QPalette::Link).darker()); palette->setColor(QPalette::Highlight, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnHighlightColors, 2, 0)); + s60Color(QS60StyleEnums::CL_QsnHighlightColors, 2, 0)); // set background image as a texture brush - palette->setBrush(QPalette::Window, QS60StylePrivate::backgroundTexture()); + palette->setBrush(QPalette::Window, backgroundTexture()); // set these as transparent so that styled full screen theme background is visible palette->setColor(QPalette::AlternateBase, Qt::transparent); palette->setBrush(QPalette::Base, Qt::transparent); // set button and tooltipbase based on pixel colors - const QColor buttonColor = this->colorFromFrameGraphics(QS60StylePrivate::SF_ButtonNormal); + const QColor buttonColor = this->colorFromFrameGraphics(SF_ButtonNormal); palette->setColor(QPalette::Button, buttonColor ); - const QColor toolTipColor = this->colorFromFrameGraphics(QS60StylePrivate::SF_ToolTip); + const QColor toolTipColor = this->colorFromFrameGraphics(SF_ToolTip); palette->setColor(QPalette::ToolTipBase, toolTipColor ); palette->setColor(QPalette::Light, palette->color(QPalette::Button).lighter()); palette->setColor(QPalette::Dark, palette->color(QPalette::Button).darker()); @@ -718,7 +718,7 @@ void QS60StylePrivate::setThemePalette(QPalette *palette) const palette->setColor(QPalette::Shadow, Qt::black); setThemePaletteHash(palette); - QS60StylePrivate::storeThemePalette(palette); + storeThemePalette(palette); } void QS60StylePrivate::deleteThemePalette() @@ -745,10 +745,10 @@ void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const //store the original palette QPalette widgetPalette = *palette; const QColor mainAreaTextColor = - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0); + s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0); widgetPalette.setColor(QPalette::All, QPalette::WindowText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnLineColors, 8, 0)); + s60Color(QS60StyleEnums::CL_QsnLineColors, 8, 0)); QApplication::setPalette(widgetPalette, "QSlider"); // return to original palette after each widget widgetPalette = *palette; @@ -757,7 +757,7 @@ void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const widgetPalette.setColor(QPalette::Inactive, QPalette::ButtonText, mainAreaTextColor); const QStyleOption opt; widgetPalette.setColor(QPalette::Disabled, QPalette::ButtonText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 6, &opt)); + s60Color(QS60StyleEnums::CL_QsnTextColors, 6, &opt)); QApplication::setPalette(widgetPalette, "QPushButton"); widgetPalette = *palette; @@ -767,27 +767,27 @@ void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const widgetPalette = *palette; widgetPalette.setColor(QPalette::Active, QPalette::ButtonText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 23, 0)); + s60Color(QS60StyleEnums::CL_QsnTextColors, 23, 0)); QApplication::setPalette(widgetPalette, "QHeaderView"); widgetPalette = *palette; widgetPalette.setColor(QPalette::All, QPalette::ButtonText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 8, 0)); + s60Color(QS60StyleEnums::CL_QsnTextColors, 8, 0)); QApplication::setPalette(widgetPalette, "QMenuBar"); widgetPalette = *palette; widgetPalette.setColor(QPalette::Active, QPalette::WindowText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 4, 0)); + s60Color(QS60StyleEnums::CL_QsnTextColors, 4, 0)); QApplication::setPalette(widgetPalette, "QTabBar"); widgetPalette = *palette; widgetPalette.setColor(QPalette::All, QPalette::Text, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 22, 0)); + s60Color(QS60StyleEnums::CL_QsnTextColors, 22, 0)); QApplication::setPalette(widgetPalette, "QTableView"); widgetPalette = *palette; widgetPalette.setColor(QPalette::All, QPalette::HighlightedText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0)); + s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0)); QApplication::setPalette(widgetPalette, "QLineEdit"); widgetPalette = *palette; @@ -861,7 +861,7 @@ QSize QS60StylePrivate::partSize(QS60StyleEnums::SkinParts part, SkinElementFlag } break; } - if (flags & (QS60StylePrivate::SF_PointEast | QS60StylePrivate::SF_PointWest)) { + if (flags & (SF_PointEast | SF_PointWest)) { const int temp = result.width(); result.setWidth(result.height()); result.setHeight(temp); -- cgit v0.12 From 806e0081bf8c77d990e4b0fafdec93f07bdcbfab Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Mon, 8 Jun 2009 18:17:10 +0200 Subject: Attempt to load default skin only if it is present. --- src/gui/styles/qs60style_simulated.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index a94d73e..7667f92 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -359,7 +359,9 @@ QS60Style::QS60Style() : QCommonStyle(*new QS60StylePrivate) { // Assume, that the resource system has a ':/s60Stylethemes/Default.blob' - loadS60ThemeFromBlob(QString::fromLatin1(":/s60Stylethemes/Default.blob")); + const QString defaultBlob = QString::fromLatin1(":/s60Stylethemes/Default.blob"); + if (QFile::exists(defaultBlob)) + loadS60ThemeFromBlob(defaultBlob); } Q_GLOBAL_STATIC_WITH_INITIALIZER(QStringList, enumPartKeys, { -- cgit v0.12 From b84811da86a7c3c9be153a2c4f9a52a759bc70d0 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Mon, 8 Jun 2009 18:17:54 +0200 Subject: More usable output of the s60theme utility --- util/s60theme/s60theme.pro | 3 +++ util/s60theme/s60themeconvert.cpp | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/util/s60theme/s60theme.pro b/util/s60theme/s60theme.pro index 02c2449..83c0cf2 100644 --- a/util/s60theme/s60theme.pro +++ b/util/s60theme/s60theme.pro @@ -7,3 +7,6 @@ HEADERS += \ QT += \ webkit + +CONFIG += \ + console diff --git a/util/s60theme/s60themeconvert.cpp b/util/s60theme/s60themeconvert.cpp index 4fe2980..a1e1d58 100644 --- a/util/s60theme/s60themeconvert.cpp +++ b/util/s60theme/s60themeconvert.cpp @@ -206,7 +206,7 @@ bool loadThemeFromTdf(const QString &tdfFile, const QString tdfFullName = tdfBasePath + QDir::separator() + parsedPartSvgs.value(partKey); if (!QFile(tdfFullName).exists()) - qWarning() << "Could not load part " << tdfFullName; + qWarning() << "Could not find part:" << parsedPartSvgs.value(partKey); const QPicture partPicture = renderer.svgToQPicture(tdfFullName); parsedPartPictures.insert(partKey, partPicture); } @@ -273,9 +273,10 @@ bool loadDefaultTheme(const QString &themePath, WebKitSVGRenderer renderer; foreach (const QString &partKey, QS60Style::partKeys()) { - const QString partFile(dir.absolutePath() + QDir::separator() + partKey + QLatin1String(".svg")); + const QString partFileName = partKey + QLatin1String(".svg"); + const QString partFile(dir.absolutePath() + QDir::separator() + partFileName); if (!QFile::exists(partFile)) { - qWarning() << "Could not load part " << partFile; + qWarning() << "Could not find part:" << partFileName; continue; } const QPicture partPicture = renderer.svgToQPicture(partFile); -- cgit v0.12 From 846c49cd1c0730143888a1deb0ab32811583014f Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Tue, 9 Jun 2009 13:37:09 +0300 Subject: Fixed STL dependency for Symbian. The STL config is stored in CONFIG qmake variable, not in QT_CONFIG. --- src/s60installs/qt_libs.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/s60installs/qt_libs.pro b/src/s60installs/qt_libs.pro index 9aadfc0..e9da90d 100644 --- a/src/s60installs/qt_libs.pro +++ b/src/s60installs/qt_libs.pro @@ -41,7 +41,7 @@ symbian: { contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) { qtlibraries.depends += "(0x200110CB), 1, 5, 1, {\"Open C LIBSSL Common\"}" } - contains(QT_CONFIG, stl) { + contains(CONFIG, stl) { qtlibraries.depends += "(0x2000F866), 1, 0, 0, {\"Standard C++ Library Common\"}" } -- cgit v0.12 From 9bdd939c508dfe784402c5c3e85e26d135f7643c Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Tue, 9 Jun 2009 14:40:56 +0200 Subject: Fixes from code review --- src/gui/itemviews/qabstractitemview.cpp | 6 +- src/gui/kernel/qwidget_s60.cpp | 41 ----------- src/gui/widgets/qactiontokeyeventmapper.cpp | 103 +++++++++++++++++++++++++++ src/gui/widgets/qactiontokeyeventmapper_p.h | 70 +++++++++++++++++++ src/gui/widgets/qcombobox.cpp | 8 +-- src/gui/widgets/qkeyeventsoftkey.cpp | 105 ---------------------------- src/gui/widgets/qkeyeventsoftkey.h | 74 -------------------- src/gui/widgets/qmenu.cpp | 8 +-- src/gui/widgets/widgets.pri | 4 +- 9 files changed, 186 insertions(+), 233 deletions(-) create mode 100644 src/gui/widgets/qactiontokeyeventmapper.cpp create mode 100644 src/gui/widgets/qactiontokeyeventmapper_p.h delete mode 100644 src/gui/widgets/qkeyeventsoftkey.cpp delete mode 100644 src/gui/widgets/qkeyeventsoftkey.h diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index 69e630e..af84ea6 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -61,7 +61,7 @@ #ifndef QT_NO_ACCESSIBILITY #include #endif -#include +#include QT_BEGIN_NAMESPACE @@ -2004,14 +2004,14 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event) if (QApplication::keypadNavigationEnabled()) { if (!hasEditFocus()) { setEditFocus(true); - QKeyEventSoftKey::addSoftKey(QAction::BackSoftKey, Qt::Key_Back, this); + QActionToKeyEventMapper::addSoftKey(QAction::BackSoftKey, Qt::Key_Back, this); return; } } break; case Qt::Key_Back: if (QApplication::keypadNavigationEnabled() && hasEditFocus()) { - QKeyEventSoftKey::removeSoftkey(this); + QActionToKeyEventMapper::removeSoftkey(this); setEditFocus(false); } else { event->ignore(); diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 2a83fc7..cc6f794 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -61,31 +61,6 @@ extern bool qt_nograb(); QWidget *QWidgetPrivate::mouseGrabber = 0; QWidget *QWidgetPrivate::keyboardGrabber = 0; -static void mapSoftKeys(const QList &softkeys) -{ -/* if (softkeys.count() == 1 && softkeys.at(0)->menuRole()==QAction::MenuSoftKey) { - softkeys.at(0)->setNativePosition(0); - softkeys.at(0)->setQtContextKey(Qt::Key_Context1); - } - else if(softkeys.count() == 1 && softkeys.at(0)->menuRole()!=QAction::MenuSoftKey) { - softkeys.at(0)->setNativePosition(2); - softkeys.at(0)->setQtContextKey(Qt::Key_Context1); - } - else { - // FIX THIS - // veryWeirdMagic is needes as s60 5th edition sdk always panics if cba is set with index 1, this hops over it - // This needs further investigation why so that the hack can be removed - int veryWeirdMagic = 0; - for (int index = 0; index < softkeys.count(); index++) { - softkeys.at(index)->setNativePosition(index + veryWeirdMagic); - softkeys.at(index)->setQtContextKey(Qt::Key_Context1 + index); - if (veryWeirdMagic == 0) - veryWeirdMagic = 1; - } - } -*/ -} - static bool isEqual(const QList& a, const QList& b) { if ( a.count() != b.count()) @@ -110,15 +85,12 @@ void QWidgetPrivate::setSoftKeys_sys(const QList &softkeys) if (isEqual(old, softkeys )) return; } - CCoeAppUi* appui = CEikonEnv::Static()->AppUi(); CAknAppUi* aknAppUi = static_cast (appui); CEikButtonGroupContainer* nativeContainer = aknAppUi->Cba(); nativeContainer->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY_WITH_IDS); - mapSoftKeys(softkeys); int placeInScreen=0; - for (int index = 0; index < softkeys.count(); index++) { const QAction* softKeyAction = softkeys.at(index); if (softKeyAction->softKeyRole() != QAction::ContextMenuSoftKey) { @@ -135,7 +107,6 @@ void QWidgetPrivate::setSoftKeys_sys(const QList &softkeys) } if (placeInScreen==1) placeInScreen=2; - } } @@ -1083,16 +1054,4 @@ void QWidget::activateWindow() rw->SetOrdinalPosition(0); } } -/* -void QWidget::setSoftKeys(QSoftKeyAction *softKey) -{ - Q_D(QWidget); - d-> -} - -void QWidget::setSoftKeys(const QList &softkeys) -{ - Q_D(QWidget); -} -*/ QT_END_NAMESPACE diff --git a/src/gui/widgets/qactiontokeyeventmapper.cpp b/src/gui/widgets/qactiontokeyeventmapper.cpp new file mode 100644 index 0000000..5cce415 --- /dev/null +++ b/src/gui/widgets/qactiontokeyeventmapper.cpp @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qapplication.h" +#include "qevent.h" +#include "QActionToKeyEventMapper_p.h" + +QT_BEGIN_NAMESPACE + +QActionToKeyEventMapper::QActionToKeyEventMapper(QAction *softKeyAction, Qt::Key key, QObject *parent) + : QObject(parent) + , m_softKeyAction(softKeyAction) + , m_key(key) +{ + +} + +QString QActionToKeyEventMapper::roleText(QAction::SoftKeyRole role) +{ + switch (role) { + case QAction::OptionsSoftKey: + return QAction::tr("Options"); + case QAction::SelectSoftKey: + return QAction::tr("Select"); + case QAction::BackSoftKey: + return QAction::tr("Back"); + case QAction::NextSoftKey: + return QAction::tr("Next"); + case QAction::PreviousSoftKey: + return QAction::tr("Previous"); + case QAction::OkSoftKey: + return QAction::tr("Ok"); + case QAction::CancelSoftKey: + return QAction::tr("Cancel"); + case QAction::EditSoftKey: + return QAction::tr("Edit"); + case QAction::ViewSoftKey: + return QAction::tr("View"); + default: + return QString(); + }; +} +void QActionToKeyEventMapper::addSoftKey(QAction::SoftKeyRole standardRole, Qt::Key key, QWidget *actionWidget) +{ + QAction *action = new QAction(actionWidget); + action->setSoftKeyRole(standardRole); + action->setText(roleText(standardRole)); + QActionToKeyEventMapper *softKey = new QActionToKeyEventMapper(action, key, actionWidget); + connect(action, SIGNAL(triggered()), softKey, SLOT(sendKeyEvent())); + connect(action, SIGNAL(destroyed()), softKey, SLOT(deleteLater())); + actionWidget->setSoftKey(action); +} + +void QActionToKeyEventMapper::removeSoftkey(QWidget *focussedWidget) +{ + focussedWidget->setSoftKey(0); +} + +void QActionToKeyEventMapper::sendKeyEvent() +{ + QApplication::postEvent(parent(), new QKeyEvent(QEvent::KeyPress, m_key, Qt::NoModifier)); +} + +QT_END_NAMESPACE + diff --git a/src/gui/widgets/qactiontokeyeventmapper_p.h b/src/gui/widgets/qactiontokeyeventmapper_p.h new file mode 100644 index 0000000..da336e8 --- /dev/null +++ b/src/gui/widgets/qactiontokeyeventmapper_p.h @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QACTIONTOKEYEVENTMAPPER_P_H +#define QACTIONTOKEYEVENTMAPPER_P_H + +#include +#include "QtGui/qaction.h" +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QActionToKeyEventMapper : public QObject +{ + Q_OBJECT +public: + QActionToKeyEventMapper(QAction *softKeyAction, Qt::Key key, QObject *parent); + static QString roleText(QAction::SoftKeyRole role); + static void addSoftKey(QAction::SoftKeyRole standardRole, Qt::Key key, QWidget *actionWidget); + static void removeSoftkey(QWidget *focussedWidget); +private: + QAction *m_softKeyAction; + Qt::Key m_key; +private Q_SLOTS: + void sendKeyEvent(); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif //QACTIONTOKEYEVENTMAPPER_H diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp index 01fcf34..2da5cd0 100644 --- a/src/gui/widgets/qcombobox.cpp +++ b/src/gui/widgets/qcombobox.cpp @@ -63,7 +63,7 @@ #include #include #include -#include +#include #ifdef Q_WS_X11 #include #endif @@ -629,7 +629,7 @@ bool QComboBoxPrivateContainer::eventFilter(QObject *o, QEvent *e) #endif if (view->currentIndex().isValid() && (view->currentIndex().flags() & Qt::ItemIsEnabled) ) { #ifdef QT_KEYPAD_NAVIGATION - QKeyEventSoftKey::removeSoftkey(this); + QActionToKeyEventMapper::removeSoftkey(this); #endif combo->hidePopup(); emit itemSelected(view->currentIndex()); @@ -643,7 +643,7 @@ bool QComboBoxPrivateContainer::eventFilter(QObject *o, QEvent *e) case Qt::Key_Escape: #ifdef QT_KEYPAD_NAVIGATION case Qt::Key_Back: - QKeyEventSoftKey::removeSoftkey(this); + QActionToKeyEventMapper::removeSoftkey(this); #endif combo->hidePopup(); return true; @@ -2438,7 +2438,7 @@ void QComboBox::showPopup() #ifdef QT_KEYPAD_NAVIGATION if (QApplication::keypadNavigationEnabled()) view()->setEditFocus(true); - QKeyEventSoftKey::addSoftKey(QAction::CancelSoftKey, Qt::Key_Back, view()); + QActionToKeyEventMapper::addSoftKey(QAction::CancelSoftKey, Qt::Key_Back, view()); #endif } diff --git a/src/gui/widgets/qkeyeventsoftkey.cpp b/src/gui/widgets/qkeyeventsoftkey.cpp deleted file mode 100644 index f5f10fc..0000000 --- a/src/gui/widgets/qkeyeventsoftkey.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qapplication.h" -#include "qevent.h" -#include "qkeyeventsoftkey.h" - -QT_BEGIN_NAMESPACE - -QKeyEventSoftKey::QKeyEventSoftKey(QAction *softKeyAction, Qt::Key key, QObject *parent) - : QObject(parent) - , m_softKeyAction(softKeyAction) - , m_key(key) -{ - -} - -QString QKeyEventSoftKey::roleText(QAction::SoftKeyRole role) -{ - switch (role) { - case QAction::OptionsSoftKey: - return QAction::tr("Options"); - case QAction::SelectSoftKey: - return QAction::tr("Select"); - case QAction::BackSoftKey: - return QAction::tr("Back"); - case QAction::NextSoftKey: - return QAction::tr("Next"); - case QAction::PreviousSoftKey: - return QAction::tr("Previous"); - case QAction::OkSoftKey: - return QAction::tr("Ok"); - case QAction::CancelSoftKey: - return QAction::tr("Cancel"); - case QAction::EditSoftKey: - return QAction::tr("Edit"); - case QAction::ViewSoftKey: - return QAction::tr("View"); - default: - return QString(); - }; -} -void QKeyEventSoftKey::addSoftKey(QAction::SoftKeyRole standardRole, Qt::Key key, QWidget *actionWidget) -{ - QAction *action = new QAction(actionWidget); - action->setSoftKeyRole(standardRole); - action->setText(roleText(standardRole)); - QKeyEventSoftKey *softKey = new QKeyEventSoftKey(action, key, actionWidget); - connect(action, SIGNAL(triggered()), softKey, SLOT(sendKeyEvent())); - connect(action, SIGNAL(destroyed()), softKey, SLOT(deleteLater())); - actionWidget->setSoftKey(action); -} - -void QKeyEventSoftKey::removeSoftkey(QWidget *focussedWidget) -{ - focussedWidget->setSoftKey(0); -} - -void QKeyEventSoftKey::sendKeyEvent() -{ - QApplication::postEvent(parent(), new QKeyEvent(QEvent::KeyPress, m_key, Qt::NoModifier)); -} - -QT_END_NAMESPACE - -#include "moc_qkeyeventsoftkey.cpp" - diff --git a/src/gui/widgets/qkeyeventsoftkey.h b/src/gui/widgets/qkeyeventsoftkey.h deleted file mode 100644 index 0b95efb..0000000 --- a/src/gui/widgets/qkeyeventsoftkey.h +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QKEYEVENTSOFTKEY_H -#define QKEYEVENTSOFTKEY_H - -#include -#include "QtGui/qaction.h" -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Gui) - - - -class Q_GUI_EXPORT QKeyEventSoftKey : QObject -{ - Q_OBJECT -public: - QKeyEventSoftKey(QAction *softKeyAction, Qt::Key key, QObject *parent); - static QString roleText(QAction::SoftKeyRole role); - static void addSoftKey(QAction::SoftKeyRole standardRole, Qt::Key key, QWidget *actionWidget); - static void removeSoftkey(QWidget *focussedWidget); -private: - QAction *m_softKeyAction; - Qt::Key m_key; -private Q_SLOTS: - void sendKeyEvent(); -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif //QKEYEVENSOFTKEY_H diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index d713081..3486574 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -60,7 +60,7 @@ #ifndef QT_NO_WHATSTHIS # include #endif -#include +#include #include "qmenu_p.h" #include "qmenubar_p.h" @@ -584,7 +584,7 @@ void QMenuPrivate::setCurrentAction(QAction *action, int popup, SelectionReason #ifdef QT_KEYPAD_NAVIGATION // TODO: aportale, remove KEYPAD_NAVIGATION_HACK when softkey stack // handles focus related and user related actions separately... - QKeyEventSoftKey::addSoftKey(QAction::CancelSoftKey, Qt::Key_Back, q); + QActionToKeyEventMapper::addSoftKey(QAction::CancelSoftKey, Qt::Key_Back, q); #endif } } @@ -1945,7 +1945,7 @@ void QMenu::popup(const QPoint &p, QAction *atAction) QAccessible::updateAccessibility(this, 0, QAccessible::PopupMenuStart); #endif #ifdef QT_KEYPAD_NAVIGATION - QKeyEventSoftKey::addSoftKey(QAction::CancelSoftKey, Qt::Key_Back, this); + QActionToKeyEventMapper::addSoftKey(QAction::CancelSoftKey, Qt::Key_Back, this); #endif } @@ -2597,7 +2597,7 @@ void QMenu::keyPressEvent(QKeyEvent *e) case Qt::Key_Escape: #ifdef QT_KEYPAD_NAVIGATION case Qt::Key_Back: - QKeyEventSoftKey::removeSoftkey(this); + QActionToKeyEventMapper::removeSoftkey(this); #endif key_consumed = true; if (d->tornoff) { diff --git a/src/gui/widgets/widgets.pri b/src/gui/widgets/widgets.pri index f395c76..9e226e2 100644 --- a/src/gui/widgets/widgets.pri +++ b/src/gui/widgets/widgets.pri @@ -79,7 +79,7 @@ HEADERS += \ widgets/qplaintextedit.h \ widgets/qplaintextedit_p.h \ widgets/qprintpreviewwidget.h \ - widgets/qkeyeventsoftkey.h + widgets/qactiontokeyeventmapper_p.h SOURCES += \ widgets/qabstractbutton.cpp \ widgets/qabstractslider.cpp \ @@ -139,7 +139,7 @@ SOURCES += \ widgets/qtoolbararealayout.cpp \ widgets/qplaintextedit.cpp \ widgets/qprintpreviewwidget.cpp \ - widgets/qkeyeventsoftkey.cpp + widgets/qactiontokeyeventmapper.cpp !embedded:mac { HEADERS += widgets/qmacnativewidget_mac.h \ -- cgit v0.12 From 3b4a2650064e1333684d2b2d2c3923d0b798ed82 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 9 Jun 2009 17:50:13 +0200 Subject: Itemviews have go their focus frame back. Got lost with dc177883bf98a68e61c9a9cda7e1ba9464079275 --- src/gui/styles/qs60style.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 971ba90..180937f 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -1880,11 +1880,11 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, } break; #endif //QT_NO_TOOLBAR - case CE_ShapedFrame: { - const QTextEdit *txt = qobject_cast(widget); - if (txt) + case CE_ShapedFrame: + if (qobject_cast(widget)) QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_Editor, painter, option->rect, flags); - } + if (option->state & State_HasFocus) + drawPrimitive(PE_FrameFocusRect, option, painter, widget); break; default: QCommonStyle::drawControl(element, option, painter, widget); -- cgit v0.12 From 4df7621c7ab1b38416002430377a451a4c416100 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 9 Jun 2009 17:50:13 +0200 Subject: Itemviews have go their focus frame back. Got lost with dc177883bf98a68e61c9a9cda7e1ba9464079275 --- src/gui/styles/qs60style.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 6d24d54..3236928 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -1880,11 +1880,11 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, } break; #endif //QT_NO_TOOLBAR - case CE_ShapedFrame: { - const QTextEdit *txt = qobject_cast(widget); - if (txt) + case CE_ShapedFrame: + if (qobject_cast(widget)) QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_Editor, painter, option->rect, flags); - } + if (option->state & State_HasFocus) + drawPrimitive(PE_FrameFocusRect, option, painter, widget); break; default: QCommonStyle::drawControl(element, option, painter, widget); -- cgit v0.12 From dcaa6ab545e7532b5455734bd8d234cb76b152fa Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 10 Jun 2009 09:29:19 +0300 Subject: Enabled default iap setting for FTP example. This should remove multiple IAP queries when using FTP example. The used IAP is now asked from user when application is started. --- examples/network/ftp/ftp.pro | 4 +--- examples/network/ftp/main.cpp | 23 +++++++++++------------ 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/examples/network/ftp/ftp.pro b/examples/network/ftp/ftp.pro index 90594f5..b958f6a 100644 --- a/examples/network/ftp/ftp.pro +++ b/examples/network/ftp/ftp.pro @@ -13,9 +13,7 @@ INSTALLS += target sources include($$QT_SOURCE_TREE/examples/examplebase.pri) symbian { - #Enable this macro if you have latest Open C and you want to get rid of IAP queries - #DEFINES += SETDEFAULTIF_AVAILABLE TARGET.CAPABILITY="NetworkServices" TARGET.UID3 = 0xA000A648 - contains( DEFINES, SETDEFAULTIF_AVAILABLE ):LIBS+=-lesock + LIBS+=-lesock # For IAP selection } \ No newline at end of file diff --git a/examples/network/ftp/main.cpp b/examples/network/ftp/main.cpp index a472fd7..a92a8b2 100644 --- a/examples/network/ftp/main.cpp +++ b/examples/network/ftp/main.cpp @@ -40,13 +40,12 @@ ****************************************************************************/ #include +#include "ftpwindow.h" + #ifdef Q_OS_SYMBIAN #include #include -#endif -#include "ftpwindow.h" -#if defined Q_OS_SYMBIAN && defined SETDEFAULTIF_AVAILABLE #include #include #include @@ -66,13 +65,15 @@ static void setDefaultIapL() _LIT(KIapNameSetting, "IAP\\Name"); TBuf8<50> iapName; User::LeaveIfError(conn.GetDesSetting(TPtrC(KIapNameSetting), iapName)); + iapName.ZeroTerminate(); + + conn.Stop(); + CleanupStack::PopAndDestroy(&conn); + CleanupStack::PopAndDestroy(&serv); - struct ifreq ifReq; + struct ifreq ifReq; strcpy( ifReq.ifr_name, (char*)iapName.Ptr()); User::LeaveIfError(setdefaultif( &ifReq )); - - CleanupStack::PopAndDestroy(&conn); - CleanupStack::PopAndDestroy(&serv); } static int setDefaultIap() @@ -80,7 +81,6 @@ static int setDefaultIap() TRAPD(err, setDefaultIapL()); return err; } - #endif int main(int argc, char *argv[]) @@ -88,9 +88,7 @@ int main(int argc, char *argv[]) Q_INIT_RESOURCE(ftp); #ifdef Q_OS_SYMBIAN -#ifdef SETDEFAULTIF_AVAILABLE - setDefaultIap(); -#endif + setDefaultIap(); // Change current directory from default private to c:\data // in order that user can access the downloaded content QDir::setCurrent( "c:\\data" ); @@ -100,7 +98,8 @@ int main(int argc, char *argv[]) #ifdef Q_OS_SYMBIAN // Make application better looking and more usable on small screen ftpWin.showMaximized(); -#endif +#else ftpWin.show(); +#endif return ftpWin.exec(); } -- cgit v0.12 From b97671a3b40623c1499c13c3d74c896ac6b9406f Mon Sep 17 00:00:00 2001 From: makuukka Date: Fri, 29 May 2009 10:08:27 +0300 Subject: Force qRound64() to take a double on platforms where qreal is a float. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In Symbian qreal is defined as float. And in qround64 the parameter was qreal. This qround64 is used (only) in qvariant::convert, when converting from double to e.g. int. This caused overflow bug for some (close to max int) values, because in convert chain double value was casted to float. Task-number: 250267 Reviewed-By: Samuel Rødal Reviewed-By: Jason Barron --- src/corelib/global/qglobal.h | 5 +++++ tests/auto/qvariant/tst_qvariant.cpp | 26 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 27aaac1..b075db6 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1055,8 +1055,13 @@ inline T qAbs(const T &t) { return t >= 0 ? t : -t; } inline int qRound(qreal d) { return d >= 0.0 ? int(d + 0.5) : int(d - int(d-1) + 0.5) + int(d-1); } +#if defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) || defined(QT_ARCH_SYMBIAN) +inline qint64 qRound64(double d) +{ return d >= 0.0 ? qint64(d + 0.5) : qint64(d - qint64(d-1) + 0.5) + qint64(d-1); } +#else inline qint64 qRound64(qreal d) { return d >= 0.0 ? qint64(d + 0.5) : qint64(d - qint64(d-1) + 0.5) + qint64(d-1); } +#endif template inline const T &qMin(const T &a, const T &b) { if (a < b) return a; return b; } diff --git a/tests/auto/qvariant/tst_qvariant.cpp b/tests/auto/qvariant/tst_qvariant.cpp index d15f9c8..9c9ff33 100644 --- a/tests/auto/qvariant/tst_qvariant.cpp +++ b/tests/auto/qvariant/tst_qvariant.cpp @@ -255,6 +255,7 @@ private slots: void convertByteArrayToBool() const; void convertByteArrayToBool_data() const; void toIntFromQString() const; + void toIntFromDouble() const; }; Q_DECLARE_METATYPE(QDate) @@ -2909,5 +2910,30 @@ void tst_QVariant::toIntFromQString() const QVERIFY(ok); } +/*! + We verify that: + 1. Conversion from (64 bit) double to int works (no overflow). + 2. Same conversion works for QVariant::convert. + + Rationale: if 2147483630 is set in float and then converted to int, + there will be overflow and the result will be -2147483648. + + See task 250267. + */ +void tst_QVariant::toIntFromDouble() const +{ + double d = 2147483630; // max int 2147483647 + QVERIFY((int)d == 2147483630); + + QVariant var(d); + QVERIFY( var.canConvert( QVariant::Int ) ); + + bool ok; + int result = var.toInt(&ok); + + QVERIFY( ok == true ); + QCOMPARE(result, 2147483630); +} + QTEST_MAIN(tst_QVariant) #include "tst_qvariant.moc" -- cgit v0.12 From 2d34a0f7cc4a7302871c942a827bd4278cdde10b Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 10 Jun 2009 09:53:50 +0300 Subject: Implemented content filters for desktopservices example. Now only the relevant files are shown under images and music tabs, even the folder would contain other content types. --- demos/embedded/desktopservices/contenttab.cpp | 6 +++++- demos/embedded/desktopservices/contenttab.h | 1 + demos/embedded/desktopservices/desktopwidget.cpp | 10 +++++++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/demos/embedded/desktopservices/contenttab.cpp b/demos/embedded/desktopservices/contenttab.cpp index 12e80f6..450a080 100644 --- a/demos/embedded/desktopservices/contenttab.cpp +++ b/demos/embedded/desktopservices/contenttab.cpp @@ -66,9 +66,13 @@ ContentTab::~ContentTab() // NEW PUBLIC METHODS void ContentTab::init(const QDesktopServices::StandardLocation &location, + const QString &filter, const QString &icon) { setContentDir(location); + QStringList filterList; + filterList = filter.split(";"); + m_ContentDir.setNameFilters(filterList); setIcon(icon); connect(this, SIGNAL(itemClicked(QListWidgetItem *)), @@ -90,7 +94,7 @@ void ContentTab::setIcon(const QString &icon) void ContentTab::populateListWidget() { - QFileInfoList fileList = m_ContentDir.entryInfoList(QStringList(), QDir::Files, QDir::Time); + QFileInfoList fileList = m_ContentDir.entryInfoList(QDir::Files, QDir::Time); foreach(QFileInfo item, fileList) { new QListWidgetItem(m_Icon, itemName(item), this); } diff --git a/demos/embedded/desktopservices/contenttab.h b/demos/embedded/desktopservices/contenttab.h index af1b7bb..a5a402e 100644 --- a/demos/embedded/desktopservices/contenttab.h +++ b/demos/embedded/desktopservices/contenttab.h @@ -74,6 +74,7 @@ public: // Constructors & Destructors public: // New Methods virtual void init(const QDesktopServices::StandardLocation &location, + const QString &filter, const QString &icon); protected: // New Methods diff --git a/demos/embedded/desktopservices/desktopwidget.cpp b/demos/embedded/desktopservices/desktopwidget.cpp index e8a654e..3abe591 100644 --- a/demos/embedded/desktopservices/desktopwidget.cpp +++ b/demos/embedded/desktopservices/desktopwidget.cpp @@ -59,18 +59,22 @@ DesktopWidget::DesktopWidget(QWidget *parent) : QWidget(parent) // Images ContentTab* imageTab = new ContentTab(tabWidget); - imageTab->init(QDesktopServices::PicturesLocation, ":/resources/photo.png"); + imageTab->init(QDesktopServices::PicturesLocation, + "*.png;*.jpg;*.jpeg;*.bmp;*.gif", + ":/resources/photo.png"); tabWidget->addTab(imageTab, tr("Images")); // Music ContentTab* musicTab = new ContentTab(tabWidget); - musicTab->init(QDesktopServices::MusicLocation, ":/resources/music.png"); + musicTab->init(QDesktopServices::MusicLocation, + "*.wav;*.mp3;*.mp4", + ":/resources/music.png"); tabWidget->addTab(musicTab, tr("Music")); // Links LinkTab* othersTab = new LinkTab(tabWidget);; // Given icon file will be overriden by LinkTab - othersTab->init(QDesktopServices::PicturesLocation, ""); + othersTab->init(QDesktopServices::PicturesLocation, "", ""); tabWidget->addTab(othersTab, tr("Links")); // Layout -- cgit v0.12 From 9108392448f4906bbd6916dcb0bc8117171c7804 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 10 Jun 2009 10:02:44 +0300 Subject: Added proper UID3 for some demos and examples. --- demos/mediaplayer/mediaplayer.pro | 2 ++ examples/draganddrop/delayedencoding/delayedencoding.pro | 2 ++ examples/draganddrop/draggableicons/draggableicons.pro | 2 ++ examples/draganddrop/draggabletext/draggabletext.pro | 2 ++ examples/draganddrop/puzzle/puzzle.pro | 1 + examples/mainwindows/menus/menus.pro | 2 ++ examples/network/securesocketclient/securesocketclient.pro | 2 ++ examples/painting/svggenerator/svggenerator.pro | 2 ++ examples/phonon/capabilities/capabilities.pro | 2 ++ examples/phonon/musicplayer/musicplayer.pro | 1 + 10 files changed, 18 insertions(+) diff --git a/demos/mediaplayer/mediaplayer.pro b/demos/mediaplayer/mediaplayer.pro index 001989d..ef07a3f 100644 --- a/demos/mediaplayer/mediaplayer.pro +++ b/demos/mediaplayer/mediaplayer.pro @@ -26,3 +26,5 @@ DEPLOYMENT_PLUGIN += phonon_ds9 phonon_waveout } include($$QT_SOURCE_TREE/demos/demobase.pri) + +symbian:TARGET.UID3 = 0xA000C613 \ No newline at end of file diff --git a/examples/draganddrop/delayedencoding/delayedencoding.pro b/examples/draganddrop/delayedencoding/delayedencoding.pro index c7b95b6..7315ac5 100644 --- a/examples/draganddrop/delayedencoding/delayedencoding.pro +++ b/examples/draganddrop/delayedencoding/delayedencoding.pro @@ -12,3 +12,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/delayedencoding sources.files = $$SOURCES $$HEADERS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/itemviews/delayedencoding INSTALLS += target sources + +symbian:TARGET.UID3 = 0xA000C614 \ No newline at end of file diff --git a/examples/draganddrop/draggableicons/draggableicons.pro b/examples/draganddrop/draggableicons/draggableicons.pro index 5212abc..6d53baa 100644 --- a/examples/draganddrop/draggableicons/draggableicons.pro +++ b/examples/draganddrop/draggableicons/draggableicons.pro @@ -10,3 +10,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/draggableicons INSTALLS += target sources include($$QT_SOURCE_TREE/examples/examplebase.pri) + +symbian:TARGET.UID3 = 0xA000C615 \ No newline at end of file diff --git a/examples/draganddrop/draggabletext/draggabletext.pro b/examples/draganddrop/draggabletext/draggabletext.pro index 109be5d..15d909d 100644 --- a/examples/draganddrop/draggabletext/draggabletext.pro +++ b/examples/draganddrop/draggabletext/draggabletext.pro @@ -12,3 +12,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/draggabletext INSTALLS += target sources include($$QT_SOURCE_TREE/examples/examplebase.pri) + +symbian:TARGET.UID3 = 0xA000CF64 \ No newline at end of file diff --git a/examples/draganddrop/puzzle/puzzle.pro b/examples/draganddrop/puzzle/puzzle.pro index e51eb78..ecaf706 100644 --- a/examples/draganddrop/puzzle/puzzle.pro +++ b/examples/draganddrop/puzzle/puzzle.pro @@ -19,6 +19,7 @@ symbian:{ addFile.sources = example.jpg addFile.path = . DEPLOYMENT += addFile + TARGET.UID3 = 0xA000CF65 } wince*: { addFile.sources = example.jpg diff --git a/examples/mainwindows/menus/menus.pro b/examples/mainwindows/menus/menus.pro index 448e779..8cf60bf 100644 --- a/examples/mainwindows/menus/menus.pro +++ b/examples/mainwindows/menus/menus.pro @@ -9,3 +9,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/mainwindows/menus INSTALLS += target sources include($$QT_SOURCE_TREE/examples/examplebase.pri) + +symbian:TARGET.UID3 = 0xA000CF66 \ No newline at end of file diff --git a/examples/network/securesocketclient/securesocketclient.pro b/examples/network/securesocketclient/securesocketclient.pro index 166d7ad..2e9141d 100644 --- a/examples/network/securesocketclient/securesocketclient.pro +++ b/examples/network/securesocketclient/securesocketclient.pro @@ -16,3 +16,5 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/network/securesocketclient INSTALLS += target sources include($$QT_SOURCE_TREE/examples/examplebase.pri) + +symbian:TARGET.UID3 = 0xA000CF67 \ No newline at end of file diff --git a/examples/painting/svggenerator/svggenerator.pro b/examples/painting/svggenerator/svggenerator.pro index 4d08ba4..1134619 100644 --- a/examples/painting/svggenerator/svggenerator.pro +++ b/examples/painting/svggenerator/svggenerator.pro @@ -13,3 +13,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/painting/svggenerator sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS svggenerator.pro sources.path = $$[QT_INSTALL_EXAMPLES]/painting/svggenerator INSTALLS += target sources + +symbian:TARGET.UID3 = 0xA000CF68 \ No newline at end of file diff --git a/examples/phonon/capabilities/capabilities.pro b/examples/phonon/capabilities/capabilities.pro index 29d7501..7f1ca76 100644 --- a/examples/phonon/capabilities/capabilities.pro +++ b/examples/phonon/capabilities/capabilities.pro @@ -9,3 +9,5 @@ target.path = $$[QT_INSTALL_EXAMPLES]/phonon/capabilities sources.files = $$SOURCES $$HEADERS capabilities.pro sources.path = $$[QT_INSTALL_EXAMPLES]/phonon/capabilities INSTALLS += target sources + +symbian:TARGET.UID3 = 0xA000CF69 \ No newline at end of file diff --git a/examples/phonon/musicplayer/musicplayer.pro b/examples/phonon/musicplayer/musicplayer.pro index 0a93dc2..e17d29c 100644 --- a/examples/phonon/musicplayer/musicplayer.pro +++ b/examples/phonon/musicplayer/musicplayer.pro @@ -14,3 +14,4 @@ wince*{ DEPLOYMENT_PLUGIN += phonon_ds9 phonon_waveout } +symbian:TARGET.UID3 = 0xA000CF6A \ No newline at end of file -- cgit v0.12 From de32770849417fbca964f52eb4d16e7913b28ea1 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 10 Jun 2009 11:54:36 +0300 Subject: Switched QDesktopServices mail-to URL handling to RSendAs in Symbian. Earlier used CSendUi required extensiva capabilities to work correctly, that's why "new email" option in desktop services example application did not work correctly with self signed capabilities. RSendAs requires lower capabilities since SendAs server (separate process) takes care of necessary actions to send the message. --- mkspecs/common/symbian/symbian.conf | 2 +- src/gui/util/qdesktopservices_s60.cpp | 54 +++++++++++++++-------------------- src/gui/util/util.pri | 5 ---- 3 files changed, 24 insertions(+), 37 deletions(-) diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf index 5a61a23..6ae4c4a 100644 --- a/mkspecs/common/symbian/symbian.conf +++ b/mkspecs/common/symbian/symbian.conf @@ -62,7 +62,7 @@ QMAKE_LFLAGS_DLL = -shared QMAKE_LINK_OBJECT_MAX = 10 QMAKE_LINK_OBJECT_SCRIPT= object_script -QMAKE_DESKTOPSERVICES_LIBS = -lsendui -lplatformenv -lcommonui -letext -lapmime +QMAKE_DESKTOPSERVICES_LIBS = -lsendas2 -lplatformenv -lcommonui -letext -lapmime QMAKE_STATUSPANE_LIBS = -lavkon -leikcoctl QMAKE_LIBS = -llibc -llibm -leuser -llibdl diff --git a/src/gui/util/qdesktopservices_s60.cpp b/src/gui/util/qdesktopservices_s60.cpp index a30e2ed..d53c046 100644 --- a/src/gui/util/qdesktopservices_s60.cpp +++ b/src/gui/util/qdesktopservices_s60.cpp @@ -54,8 +54,8 @@ #include // CEikonEnv #include // RApaLsSession #include // TApaTaskList, TApaTask -#include // CSendUi -#include // CMessageData +#include // RSendAs +#include // RSendAsMessage #include // PathInfo #ifdef USE_DOCUMENTHANDLER #include // CDocumentHandler @@ -85,52 +85,44 @@ static void handleMailtoSchemeL(const QUrl &url) QStringList bccs = bcc.split(","); - CSendUi* sendUi = CSendUi::NewLC(); + RSendAs sendAs; + User::LeaveIfError(sendAs.Connect()); + CleanupClosePushL(sendAs); + + RSendAsMessage sendAsMessage; + sendAsMessage.CreateL(sendAs, KUidMsgTypeSMTP); + CleanupClosePushL(sendAsMessage); - // Construct symbian sendUI data holder - CMessageData* messageData = CMessageData::NewLC(); // Subject - TPtrC subj( qt_QString2TPtrC(subject) ); - messageData->SetSubjectL( &subj ); + sendAsMessage.SetSubjectL(qt_QString2TPtrC(subject)); // Body - CParaFormatLayer* paraFormat = CParaFormatLayer::NewL(); - CleanupStack::PushL( paraFormat ); - CCharFormatLayer* charFormat = CCharFormatLayer::NewL(); - CleanupStack::PushL( charFormat ); - CRichText* bodyRichText = CRichText::NewL( paraFormat, charFormat ); - CleanupStack::PushL( bodyRichText ); - - TPtrC bodyPtr( qt_QString2TPtrC(body) ); - if( bodyPtr.Length() ) - { - bodyRichText->InsertL( 0, bodyPtr ); - } - else - { - bodyRichText->InsertL( 0, KNullDesC ); - } - - messageData->SetBodyTextL( bodyRichText ); + sendAsMessage.SetBodyTextL(qt_QString2TPtrC(body)); // To foreach(QString item, recipients) - messageData->AppendToAddressL(qt_QString2TPtrC(item)); + sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientTo ); foreach(QString item, tos) - messageData->AppendToAddressL(qt_QString2TPtrC(item)); + sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientTo ); // Cc foreach(QString item, ccs) - messageData->AppendCcAddressL(qt_QString2TPtrC(item)); + sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientCc ); // Bcc foreach(QString item, bccs) - messageData->AppendBccAddressL(qt_QString2TPtrC(item)); + sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientBcc ); + + // send the message + sendAsMessage.LaunchEditorAndCloseL(); + + // sendAsMessage (already closed) + CleanupStack::Pop(); - sendUi->CreateAndSendMessageL( KUidMsgTypeSMTP, messageData ); - CleanupStack::PopAndDestroy( 5 ); // bodyRichText, charFormat, paraFormat, messageData, sendUi + // sendAs + CleanupStack::PopAndDestroy(); } static bool handleMailtoScheme(const QUrl &url) diff --git a/src/gui/util/util.pri b/src/gui/util/util.pri index 69c53ae..e628229 100644 --- a/src/gui/util/util.pri +++ b/src/gui/util/util.pri @@ -35,11 +35,6 @@ embedded { util/qsystemtrayicon_qws.cpp } -symbian { - # QDesktopServices uses CSendUi which is located on app layer - INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE -} - !embedded:!x11:mac { OBJECTIVE_SOURCES += util/qsystemtrayicon_mac.mm } -- cgit v0.12 From 00f2dd2175f80736442a3eb8443499c02062b3fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Wed, 10 Jun 2009 12:22:36 +0300 Subject: S60Style: Fix scrollbar error, when scrollbar PM minimum length is less than its width on horizontal scrollbar (and height on vertical scrollbar). --- src/gui/styles/qs60style.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 180937f..6ee63e6 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2342,6 +2342,11 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple sliderlen = (qint64(scrollbarOption->pageStep) * maxlen) / (range + scrollbarOption->pageStep); int slidermin = pixelMetric(PM_ScrollBarSliderMin, scrollbarOption, widget); + if (isHorizontal && slidermin < scrollBarRect.height()) + slidermin = scrollBarRect.height(); + else if (!isHorizontal && slidermin < scrollBarRect.width()) + slidermin = scrollBarRect.width(); + if (sliderlen < slidermin || range > (INT_MAX>>1)) sliderlen = slidermin; if (sliderlen > maxlen) -- cgit v0.12 From 37524a8b9ffa41f960fcc595039def4ae4167f3e Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 10 Jun 2009 12:02:27 +0200 Subject: Call DrawDeferred() after setting softkeys SDK 3.1 and maybe also 3.2 need an extra invitation. RevvBy: maluukka --- src/gui/kernel/qwidget_s60.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index cc6f794..a912b64 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -108,6 +108,7 @@ void QWidgetPrivate::setSoftKeys_sys(const QList &softkeys) if (placeInScreen==1) placeInScreen=2; } + nativeContainer->DrawDeferred(); // 3.1 needs an extra invitation } void QWidgetPrivate::setWSGeometry(bool dontShow) -- cgit v0.12 From 29189c3112cbfb24d9e5855240e352af18088db9 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Wed, 10 Jun 2009 12:06:31 +0200 Subject: Better handling for setting softkeys --- src/gui/kernel/qwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 3a22ee9..eaa9491 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -11570,7 +11570,7 @@ void QWidget::setSoftKeys(const QList &softKeys) d->softKeys.clear(); d->softKeys = softKeys; - if (QApplication::focusWidget() == this) + if ((QApplication::focusWidget() == this) || (QApplication::focusWidget()==0)) d->setSoftKeys_sys(this->softKeys()); } -- cgit v0.12 From 5d924cb69ea03921a9b4bc5f701063cf45ded508 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Wed, 10 Jun 2009 12:07:36 +0200 Subject: Skeleton implementation for softkeys example --- src/gui/softkeys/main.cpp | 108 +----------------------------------------- src/gui/softkeys/softkeys.cpp | 61 ++++++++++++++++++++++++ src/gui/softkeys/softkeys.h | 79 ++++++++++++++++++++++++++++++ src/gui/softkeys/softkeys.pro | 4 +- 4 files changed, 145 insertions(+), 107 deletions(-) create mode 100644 src/gui/softkeys/softkeys.cpp create mode 100644 src/gui/softkeys/softkeys.h diff --git a/src/gui/softkeys/main.cpp b/src/gui/softkeys/main.cpp index a92e2c2..a355f93 100644 --- a/src/gui/softkeys/main.cpp +++ b/src/gui/softkeys/main.cpp @@ -10,116 +10,12 @@ ****************************************************************************/ #include - -class MainWindow : public QMainWindow -{ - Q_OBJECT -public: - -private slots: - void context1Slot(); - void context3Slot(); - void softKeySlot(); -public: - - MainWindow(QWidget *parent = 0); - ~MainWindow(); - QMenu *contextMenu; - QAction* context1; - QAction* context2; - QAction* context3; - QSoftKeyAction *action1; - QSoftKeyAction *action2; - QSoftKeyAction *action3; - QSoftKeyAction *action4; - QSoftKeyAction *action5; -}; - -MainWindow::MainWindow(QWidget *parent) - : QMainWindow(parent), - contextMenu(0), - context1(0), context2(0), context3(0), - action1(0),action2(0),action3(0),action4(0),action5(0) - -{ - QWidget *central = new QWidget(this); - contextMenu = new QMenu(); - - central->setLayout(new QVBoxLayout); - central->layout()->addWidget(new QPushButton); - central->layout()->addWidget(new QPushButton); - central->layout()->addWidget(new QPushButton); - context1 = new QAction(QString("Context1"), central); - context2 = new QAction(QString("Context2"), central); - - context3 = new QAction(QString("Context3"), contextMenu); - central->addAction(context1); - central->addAction(context2); - QMenuBar* menuBar = new QMenuBar(this); - menuBar->addAction("MyMenuItem1"); - this->setMenuBar(menuBar); - context2->setMenu(contextMenu); - contextMenu->addAction(context3); - - connect(context1, SIGNAL(triggered()), this, SLOT(context1Slot())); - connect(context3, SIGNAL(triggered()), this, SLOT(context3Slot())); - action1 = new QSoftKeyAction(QSoftKeyAction::Ok, QString("Ok"), central); - action2 = new QSoftKeyAction(QSoftKeyAction::Back, QString("Back"), central); - action3 = new QSoftKeyAction(QSoftKeyAction::Cancel, QString("Cancel"), central); - action4 = new QSoftKeyAction(QSoftKeyAction::Menu, QString("Menu"), central); - action5 = new QSoftKeyAction(QSoftKeyAction::ContextMenu,QString("ContextMenu"), central); - - connect(action2, SIGNAL(triggered()), this, SLOT(softKeySlot())); - - QList myActionList; - myActionList.append(action1); - myActionList.append(action2); - myActionList.append(action3); - softKeyStack()->push(myActionList); - softKeyStack()->pop(); - softKeyStack()->push(action1); - softKeyStack()->pop(); - - QList myActionList2; - myActionList2.append(action4); - myActionList2.append(action2); - myActionList2.append(action5); - softKeyStack()->push(myActionList2); - - - setCentralWidget(central); -} -MainWindow::~MainWindow() -{ - delete context1; - delete context2; - delete context3; - delete action1; - delete action2; - delete action3; - delete action4; - delete action5; - delete contextMenu; -} - -void MainWindow::context1Slot() - { - } -void MainWindow::context3Slot() - { - } - -void MainWindow::softKeySlot() -{ - -} +#include "softkeys.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); MainWindow mw; - mw.show(); + mw.showMaximized(); return app.exec(); } - -#include "main.moc" diff --git a/src/gui/softkeys/softkeys.cpp b/src/gui/softkeys/softkeys.cpp new file mode 100644 index 0000000..edf38b9 --- /dev/null +++ b/src/gui/softkeys/softkeys.cpp @@ -0,0 +1,61 @@ +#include "softkeys.h" + +MainWindow::MainWindow(QWidget *parent) + : QMainWindow(parent) +{ + fileMenu = menuBar()->addMenu(tr("&File")); + openDialogAct = new QAction(tr("&Open Dialog"), this); + addSoftKeysAct = new QAction(tr("&Add Softkeys"), this); + clearSoftKeysAct = new QAction(tr("&Clear Softkeys"), this); + fileMenu->addAction(openDialogAct); + fileMenu->addAction(addSoftKeysAct); + fileMenu->addAction(clearSoftKeysAct); + connect(openDialogAct, SIGNAL(triggered()), this, SLOT(openDialog())); + connect(addSoftKeysAct, SIGNAL(triggered()), this, SLOT(addSoftKeys())); + connect(clearSoftKeysAct, SIGNAL(triggered()), this, SLOT(clearSoftKeys())); + QWidget *central = new QWidget(this); + central->setLayout(new QVBoxLayout); +// central->setFocus(); + setCentralWidget(central); + QPushButton button1; +// QAction* menuAction = +} + +MainWindow::~MainWindow() +{ +} + +void MainWindow::openDialog() +{ + QFileDialog::getOpenFileName(this); +} + +void MainWindow::addSoftKeys() +{ + ok = new QAction(tr("Ok"), this); + ok->setSoftKeyRole(QAction::OkSoftKey); + connect(ok, SIGNAL(triggered()), this, SLOT(okPressed())); + + cancel = new QAction(tr("Cancel"), this); + cancel->setSoftKeyRole(QAction::OkSoftKey); + connect(cancel, SIGNAL(triggered()), this, SLOT(cancelPressed())); + + QList softkeys; + softkeys.append(ok); + softkeys.append(cancel); + setSoftKeys(softkeys); + +} + +void MainWindow::clearSoftKeys() +{ + setSoftKey(0); +} + +void MainWindow::okPressed() +{ +} + +void MainWindow::cancelPressed() +{ +} diff --git a/src/gui/softkeys/softkeys.h b/src/gui/softkeys/softkeys.h new file mode 100644 index 0000000..2bc74ba --- /dev/null +++ b/src/gui/softkeys/softkeys.h @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef SOFTKEYS_H +#define SOFTKEYS_H + +#include + +class MainWindow : public QMainWindow +{ + Q_OBJECT +public: + +private slots: + void openDialog(); + void addSoftKeys(); + void clearSoftKeys(); + void okPressed(); + void cancelPressed(); +public: + MainWindow(QWidget *parent = 0); + ~MainWindow(); +private: + QMenu* fileMenu; + QAction* openDialogAct; + QAction* addSoftKeysAct; + QAction* clearSoftKeysAct; + QAction* ok; + QAction* cancel; +}; + +//! [0] +class SoftKey : public QWidget +{ + Q_OBJECT +public: + SoftKey(QWidget *parent = 0); +}; +//! [0] + +#endif diff --git a/src/gui/softkeys/softkeys.pro b/src/gui/softkeys/softkeys.pro index a16103e..4cb8672 100644 --- a/src/gui/softkeys/softkeys.pro +++ b/src/gui/softkeys/softkeys.pro @@ -1,2 +1,4 @@ +HEADERS = softkeys.h SOURCES += \ - main.cpp + main.cpp \ + softkeys.cpp \ No newline at end of file -- cgit v0.12 From 39c796e57be1830133e6189abe8f796b6846904f Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Wed, 10 Jun 2009 12:08:47 +0200 Subject: Moved softkeys example to a better place --- examples/widgets/softkeys/main.cpp | 21 +++++++++ examples/widgets/softkeys/softkeys.cpp | 61 ++++++++++++++++++++++++++ examples/widgets/softkeys/softkeys.h | 79 ++++++++++++++++++++++++++++++++++ examples/widgets/softkeys/softkeys.pro | 4 ++ src/gui/softkeys/main.cpp | 21 --------- src/gui/softkeys/softkeys.cpp | 61 -------------------------- src/gui/softkeys/softkeys.h | 79 ---------------------------------- src/gui/softkeys/softkeys.pro | 4 -- 8 files changed, 165 insertions(+), 165 deletions(-) create mode 100644 examples/widgets/softkeys/main.cpp create mode 100644 examples/widgets/softkeys/softkeys.cpp create mode 100644 examples/widgets/softkeys/softkeys.h create mode 100644 examples/widgets/softkeys/softkeys.pro delete mode 100644 src/gui/softkeys/main.cpp delete mode 100644 src/gui/softkeys/softkeys.cpp delete mode 100644 src/gui/softkeys/softkeys.h delete mode 100644 src/gui/softkeys/softkeys.pro diff --git a/examples/widgets/softkeys/main.cpp b/examples/widgets/softkeys/main.cpp new file mode 100644 index 0000000..a355f93 --- /dev/null +++ b/examples/widgets/softkeys/main.cpp @@ -0,0 +1,21 @@ +/**************************************************************************** +** +** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the $MODULE$ of the Qt Toolkit. +** +** $TROLLTECH_DUAL_LICENSE$ +** +****************************************************************************/ + +#include +#include "softkeys.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + MainWindow mw; + mw.showMaximized(); + return app.exec(); +} diff --git a/examples/widgets/softkeys/softkeys.cpp b/examples/widgets/softkeys/softkeys.cpp new file mode 100644 index 0000000..edf38b9 --- /dev/null +++ b/examples/widgets/softkeys/softkeys.cpp @@ -0,0 +1,61 @@ +#include "softkeys.h" + +MainWindow::MainWindow(QWidget *parent) + : QMainWindow(parent) +{ + fileMenu = menuBar()->addMenu(tr("&File")); + openDialogAct = new QAction(tr("&Open Dialog"), this); + addSoftKeysAct = new QAction(tr("&Add Softkeys"), this); + clearSoftKeysAct = new QAction(tr("&Clear Softkeys"), this); + fileMenu->addAction(openDialogAct); + fileMenu->addAction(addSoftKeysAct); + fileMenu->addAction(clearSoftKeysAct); + connect(openDialogAct, SIGNAL(triggered()), this, SLOT(openDialog())); + connect(addSoftKeysAct, SIGNAL(triggered()), this, SLOT(addSoftKeys())); + connect(clearSoftKeysAct, SIGNAL(triggered()), this, SLOT(clearSoftKeys())); + QWidget *central = new QWidget(this); + central->setLayout(new QVBoxLayout); +// central->setFocus(); + setCentralWidget(central); + QPushButton button1; +// QAction* menuAction = +} + +MainWindow::~MainWindow() +{ +} + +void MainWindow::openDialog() +{ + QFileDialog::getOpenFileName(this); +} + +void MainWindow::addSoftKeys() +{ + ok = new QAction(tr("Ok"), this); + ok->setSoftKeyRole(QAction::OkSoftKey); + connect(ok, SIGNAL(triggered()), this, SLOT(okPressed())); + + cancel = new QAction(tr("Cancel"), this); + cancel->setSoftKeyRole(QAction::OkSoftKey); + connect(cancel, SIGNAL(triggered()), this, SLOT(cancelPressed())); + + QList softkeys; + softkeys.append(ok); + softkeys.append(cancel); + setSoftKeys(softkeys); + +} + +void MainWindow::clearSoftKeys() +{ + setSoftKey(0); +} + +void MainWindow::okPressed() +{ +} + +void MainWindow::cancelPressed() +{ +} diff --git a/examples/widgets/softkeys/softkeys.h b/examples/widgets/softkeys/softkeys.h new file mode 100644 index 0000000..2bc74ba --- /dev/null +++ b/examples/widgets/softkeys/softkeys.h @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef SOFTKEYS_H +#define SOFTKEYS_H + +#include + +class MainWindow : public QMainWindow +{ + Q_OBJECT +public: + +private slots: + void openDialog(); + void addSoftKeys(); + void clearSoftKeys(); + void okPressed(); + void cancelPressed(); +public: + MainWindow(QWidget *parent = 0); + ~MainWindow(); +private: + QMenu* fileMenu; + QAction* openDialogAct; + QAction* addSoftKeysAct; + QAction* clearSoftKeysAct; + QAction* ok; + QAction* cancel; +}; + +//! [0] +class SoftKey : public QWidget +{ + Q_OBJECT +public: + SoftKey(QWidget *parent = 0); +}; +//! [0] + +#endif diff --git a/examples/widgets/softkeys/softkeys.pro b/examples/widgets/softkeys/softkeys.pro new file mode 100644 index 0000000..4cb8672 --- /dev/null +++ b/examples/widgets/softkeys/softkeys.pro @@ -0,0 +1,4 @@ +HEADERS = softkeys.h +SOURCES += \ + main.cpp \ + softkeys.cpp \ No newline at end of file diff --git a/src/gui/softkeys/main.cpp b/src/gui/softkeys/main.cpp deleted file mode 100644 index a355f93..0000000 --- a/src/gui/softkeys/main.cpp +++ /dev/null @@ -1,21 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the $MODULE$ of the Qt Toolkit. -** -** $TROLLTECH_DUAL_LICENSE$ -** -****************************************************************************/ - -#include -#include "softkeys.h" - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - MainWindow mw; - mw.showMaximized(); - return app.exec(); -} diff --git a/src/gui/softkeys/softkeys.cpp b/src/gui/softkeys/softkeys.cpp deleted file mode 100644 index edf38b9..0000000 --- a/src/gui/softkeys/softkeys.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include "softkeys.h" - -MainWindow::MainWindow(QWidget *parent) - : QMainWindow(parent) -{ - fileMenu = menuBar()->addMenu(tr("&File")); - openDialogAct = new QAction(tr("&Open Dialog"), this); - addSoftKeysAct = new QAction(tr("&Add Softkeys"), this); - clearSoftKeysAct = new QAction(tr("&Clear Softkeys"), this); - fileMenu->addAction(openDialogAct); - fileMenu->addAction(addSoftKeysAct); - fileMenu->addAction(clearSoftKeysAct); - connect(openDialogAct, SIGNAL(triggered()), this, SLOT(openDialog())); - connect(addSoftKeysAct, SIGNAL(triggered()), this, SLOT(addSoftKeys())); - connect(clearSoftKeysAct, SIGNAL(triggered()), this, SLOT(clearSoftKeys())); - QWidget *central = new QWidget(this); - central->setLayout(new QVBoxLayout); -// central->setFocus(); - setCentralWidget(central); - QPushButton button1; -// QAction* menuAction = -} - -MainWindow::~MainWindow() -{ -} - -void MainWindow::openDialog() -{ - QFileDialog::getOpenFileName(this); -} - -void MainWindow::addSoftKeys() -{ - ok = new QAction(tr("Ok"), this); - ok->setSoftKeyRole(QAction::OkSoftKey); - connect(ok, SIGNAL(triggered()), this, SLOT(okPressed())); - - cancel = new QAction(tr("Cancel"), this); - cancel->setSoftKeyRole(QAction::OkSoftKey); - connect(cancel, SIGNAL(triggered()), this, SLOT(cancelPressed())); - - QList softkeys; - softkeys.append(ok); - softkeys.append(cancel); - setSoftKeys(softkeys); - -} - -void MainWindow::clearSoftKeys() -{ - setSoftKey(0); -} - -void MainWindow::okPressed() -{ -} - -void MainWindow::cancelPressed() -{ -} diff --git a/src/gui/softkeys/softkeys.h b/src/gui/softkeys/softkeys.h deleted file mode 100644 index 2bc74ba..0000000 --- a/src/gui/softkeys/softkeys.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef SOFTKEYS_H -#define SOFTKEYS_H - -#include - -class MainWindow : public QMainWindow -{ - Q_OBJECT -public: - -private slots: - void openDialog(); - void addSoftKeys(); - void clearSoftKeys(); - void okPressed(); - void cancelPressed(); -public: - MainWindow(QWidget *parent = 0); - ~MainWindow(); -private: - QMenu* fileMenu; - QAction* openDialogAct; - QAction* addSoftKeysAct; - QAction* clearSoftKeysAct; - QAction* ok; - QAction* cancel; -}; - -//! [0] -class SoftKey : public QWidget -{ - Q_OBJECT -public: - SoftKey(QWidget *parent = 0); -}; -//! [0] - -#endif diff --git a/src/gui/softkeys/softkeys.pro b/src/gui/softkeys/softkeys.pro deleted file mode 100644 index 4cb8672..0000000 --- a/src/gui/softkeys/softkeys.pro +++ /dev/null @@ -1,4 +0,0 @@ -HEADERS = softkeys.h -SOURCES += \ - main.cpp \ - softkeys.cpp \ No newline at end of file -- cgit v0.12 From abff7b88fed5d2cb555972d3db11a8d2f3745bf9 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 10 Jun 2009 14:22:52 +0300 Subject: Also patch vendor id in patch_capabilities.pl script. --- bin/patch_capabilities.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/patch_capabilities.pl b/bin/patch_capabilities.pl index d75605b..f18aaba 100644 --- a/bin/patch_capabilities.pl +++ b/bin/patch_capabilities.pl @@ -59,7 +59,7 @@ if (@ARGV) print ("\n"); - my $baseCommandToExecute = "elftran -capability \""; + my $baseCommandToExecute = "elftran -vid 0x0 -capability \""; if (@capabilitiesToSet) { $baseCommandToExecute .= join(" ", @capabilitiesToSet); -- cgit v0.12 From 8c265860b41214daade7c8a28237c1e07ea71a3c Mon Sep 17 00:00:00 2001 From: axis Date: Tue, 9 Jun 2009 14:35:40 +0200 Subject: Fixed the mouse handler of FEP when in inline edit mode. We now commit the text if the mouse handler is invoked. This prevents the case where the VK cannot be brought up because the widget is the only focusable widget and is stuck in inline edit mode. --- src/gui/inputmethod/qcoefepinputcontext_p.h | 2 +- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 71 ++++++------------------- 2 files changed, 18 insertions(+), 55 deletions(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h index c2677b1..b33489e 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_p.h +++ b/src/gui/inputmethod/qcoefepinputcontext_p.h @@ -92,7 +92,7 @@ public: TCoeInputCapabilities inputCapabilities(); private: - void commitCurrentString(); + void commitCurrentString(bool triggeredBySymbian); void updateHints(); void applyHints(Qt::InputMethodHints hints); void applyFormat(QList *attributes); diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 0a5fd22..1dfb012 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -123,9 +123,7 @@ void QCoeFepInputContext::update() void QCoeFepInputContext::setFocusWidget(QWidget *w) { - commitCurrentString(); - - CCoeEnv::Static()->Fep()->CancelTransaction(); + commitCurrentString(false); QInputContext::setFocusWidget(w); @@ -292,56 +290,17 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event) void QCoeFepInputContext::mouseHandler( int x, QMouseEvent *event) { Q_ASSERT(m_isEditing); + Q_ASSERT(focusWidget()); - if (!m_pointerHandler) { - QInputContext::mouseHandler(x, event); - } - - TPointerEvent::TType type; - TUint modifiers = 0; - - if (event->type() == QEvent::MouseButtonPress) { - if (event->button() == Qt::LeftButton) { - type = TPointerEvent::EButton1Down; - } else if (event->button() == Qt::RightButton) { - type = TPointerEvent::EButton3Down; - } else if (event->button() == Qt::MidButton) { - type = TPointerEvent::EButton2Down; - } else { - return; - } - } else if (event->type() == QEvent::MouseButtonRelease) { - if (event->button() == Qt::LeftButton) { - type = TPointerEvent::EButton1Up; - } else if (event->button() == Qt::RightButton) { - type = TPointerEvent::EButton3Up; - } else if (event->button() == Qt::MidButton) { - type = TPointerEvent::EButton2Up; - } else { - return; - } - } else if (event->type() == QEvent::MouseMove) { - type = TPointerEvent::EMove; - } else if (event->type() == QEvent::DragMove) { - type = TPointerEvent::EDrag; - } else { - return; - } + if (event->type() == QEvent::MouseButtonPress && event->button() == Qt::LeftButton) { + commitCurrentString(false); + int pos = focusWidget()->inputMethodQuery(Qt::ImCursorPosition).toInt(); - if (event->modifiers() & Qt::ShiftModifier) { - modifiers |= EModifierShift; - } - if (event->modifiers() & Qt::AltModifier) { - modifiers |= EModifierAlt; + QList attributes; + attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, pos + x, 0, QVariant()); + QInputMethodEvent event("", attributes); + sendEvent(event); } - if (event->modifiers() & Qt::ControlModifier) { - modifiers |= EModifierCtrl; - } - if (event->modifiers() & Qt::KeypadModifier) { - modifiers |= EModifierKeypad; - } - - m_pointerHandler->HandlePointerEventInInlineTextL(type, modifiers, x); } TCoeInputCapabilities QCoeFepInputContext::inputCapabilities() @@ -712,12 +671,10 @@ void QCoeFepInputContext::GetScreenCoordinatesForFepL(TPoint& aLeftSideOfBaseLin void QCoeFepInputContext::DoCommitFepInlineEditL() { - commitCurrentString(); - - m_isEditing = false; + commitCurrentString(true); } -void QCoeFepInputContext::commitCurrentString() +void QCoeFepInputContext::commitCurrentString(bool triggeredBySymbian) { if (m_preeditString.size() == 0) { return; @@ -728,6 +685,12 @@ void QCoeFepInputContext::commitCurrentString() event.setCommitString(m_preeditString, 0, 0);//m_preeditString.size()); m_preeditString.clear(); sendEvent(event); + + m_isEditing = false; + + if (!triggeredBySymbian) { + CCoeEnv::Static()->Fep()->CancelTransaction(); + } } MCoeFepAwareTextEditor_Extension1* QCoeFepInputContext::Extension1(TBool& aSetToTrue) -- cgit v0.12 From 7604f8087f88171ef933d8ae08f501467e647338 Mon Sep 17 00:00:00 2001 From: Robert Griebl Date: Wed, 10 Jun 2009 13:46:23 +0200 Subject: Make Qt exception safer. Squashed commit of the branch haralds-haralds-qt-s60-topics/topic/exceptions, which also contains the full history. Rev-By: Harald Fernengel Rev-By: Ralf Engels --- configure.exe | Bin 868352 -> 868352 bytes .../code/src_corelib_tools_qscopedpointer.cpp | 64 +++ mkspecs/features/symbian/platform_paths.prf | 15 +- mkspecs/features/symbian/stl.prf | 27 +- src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp | 8 + src/3rdparty/phonon/phonon/abstractmediastream.cpp | 1 - src/3rdparty/phonon/phonon/abstractmediastream.h | 2 +- src/3rdparty/phonon/phonon/abstractmediastream_p.h | 2 +- src/corelib/codecs/qisciicodec.cpp | 1 - src/corelib/codecs/qtextcodec.cpp | 21 +- src/corelib/concurrent/qthreadpool.cpp | 6 +- src/corelib/global/qglobal.cpp | 143 ++++- src/corelib/global/qglobal.h | 97 +++- src/corelib/global/qlibraryinfo.cpp | 28 +- src/corelib/io/qabstractfileengine.cpp | 3 - src/corelib/io/qabstractfileengine.h | 4 +- src/corelib/io/qdebug.h | 7 +- src/corelib/io/qdir.cpp | 3 +- src/corelib/io/qdir.h | 3 +- src/corelib/io/qfile.cpp | 5 +- src/corelib/io/qfileinfo.cpp | 2 - src/corelib/io/qfileinfo.h | 3 +- src/corelib/io/qfilesystemwatcher_symbian.cpp | 8 +- src/corelib/io/qfsfileengine_unix.cpp | 24 +- src/corelib/io/qiodevice.h | 3 +- src/corelib/io/qprocess_symbian.cpp | 1 + src/corelib/io/qresource.cpp | 1 - src/corelib/io/qresource.h | 2 +- src/corelib/io/qsettings.cpp | 68 +-- src/corelib/io/qsettings.h | 2 +- src/corelib/io/qsettings_p.h | 2 +- src/corelib/io/qtextstream.cpp | 3 - src/corelib/io/qtextstream.h | 3 +- src/corelib/kernel/qcore_symbian_p.cpp | 19 +- src/corelib/kernel/qcore_symbian_p.h | 4 +- src/corelib/kernel/qcoreapplication.cpp | 91 +-- src/corelib/kernel/qcoreapplication.h | 2 + src/corelib/kernel/qeventdispatcher_symbian.cpp | 195 ++++--- src/corelib/kernel/qeventdispatcher_symbian_p.h | 3 + src/corelib/kernel/qeventdispatcher_unix.cpp | 21 +- src/corelib/kernel/qeventdispatcher_unix_p.h | 1 + src/corelib/kernel/qobject.cpp | 44 +- src/corelib/kernel/qobject.h | 3 +- src/corelib/kernel/qsharedmemory_symbian.cpp | 14 +- src/corelib/kernel/qsystemsemaphore.cpp | 3 +- src/corelib/kernel/qsystemsemaphore.h | 3 +- src/corelib/kernel/qsystemsemaphore_symbian.cpp | 7 +- src/corelib/plugin/qlibrary.cpp | 7 +- src/corelib/thread/qthread.cpp | 15 +- src/corelib/thread/qthread_unix.cpp | 9 +- src/corelib/thread/qthread_win.cpp | 9 +- src/corelib/thread/qthreadstorage.cpp | 14 +- src/corelib/tools/qbitarray.cpp | 2 + src/corelib/tools/qbytearray.cpp | 55 +- src/corelib/tools/qdatetime.cpp | 14 +- src/corelib/tools/qdatetime.h | 3 +- src/corelib/tools/qharfbuzz.cpp | 1 + src/corelib/tools/qhash.cpp | 78 ++- src/corelib/tools/qhash.h | 39 +- src/corelib/tools/qlinkedlist.h | 44 +- src/corelib/tools/qlist.h | 101 +++- src/corelib/tools/qlistdata.cpp | 22 +- src/corelib/tools/qlocale.cpp | 3 + src/corelib/tools/qmap.cpp | 35 +- src/corelib/tools/qmap.h | 35 +- src/corelib/tools/qpodlist_p.h | 192 +------ src/corelib/tools/qregexp.cpp | 25 +- src/corelib/tools/qringbuffer_p.h | 5 +- src/corelib/tools/qscopedpointer.cpp | 132 +++++ src/corelib/tools/qscopedpointer.h | 199 +++++++ src/corelib/tools/qshareddata.cpp | 2 +- src/corelib/tools/qsharedpointer.cpp | 9 +- src/corelib/tools/qstring.cpp | 138 ++--- src/corelib/tools/qtextboundaryfinder.cpp | 10 +- src/corelib/tools/qvarlengtharray.h | 80 +-- src/corelib/tools/qvector.cpp | 1 + src/corelib/tools/qvector.h | 98 ++-- src/corelib/tools/tools.pri | 3 +- src/corelib/xml/qxmlstream.cpp | 5 +- src/corelib/xml/qxmlstream.h | 5 +- src/dbus/qdbusabstractadaptor.cpp | 2 +- src/dbus/qdbuscontext.h | 2 +- src/gui/dialogs/dialogs.pri | 1 + src/gui/dialogs/qdialog.cpp | 10 +- src/gui/dialogs/qfiledialog.cpp | 21 +- src/gui/dialogs/qfiledialog_p.h | 29 +- src/gui/dialogs/qfileinfogatherer.cpp | 28 +- src/gui/dialogs/qfscompleter_p.h | 81 +++ src/gui/dialogs/qpagesetupdialog_win.cpp | 2 +- src/gui/dialogs/qprintdialog_unix.cpp | 4 +- src/gui/dialogs/qprintpreviewdialog.cpp | 13 +- src/gui/dialogs/qprintpreviewdialog.h | 2 +- src/gui/embedded/qsoundqss_qws.cpp | 36 +- src/gui/embedded/qwindowsystem_qws.cpp | 44 +- src/gui/embedded/qwscursor_qws.cpp | 2 +- src/gui/graphicsview/qgraphicsitem.cpp | 6 +- src/gui/graphicsview/qgraphicsitem.h | 3 +- src/gui/graphicsview/qgraphicslayoutitem.cpp | 1 - src/gui/graphicsview/qgraphicslayoutitem.h | 3 +- src/gui/graphicsview/qgraphicsproxywidget.h | 2 +- src/gui/graphicsview/qgraphicsscene.cpp | 10 +- src/gui/graphicsview/qgraphicssceneevent.cpp | 1 - src/gui/graphicsview/qgraphicssceneevent.h | 3 +- src/gui/graphicsview/qgraphicsview.cpp | 2 +- src/gui/graphicsview/qgraphicswidget.cpp | 2 +- src/gui/graphicsview/qgraphicswidget.h | 2 +- src/gui/image/qimage.cpp | 17 +- src/gui/image/qimageiohandler.cpp | 1 - src/gui/image/qimageiohandler.h | 3 +- src/gui/image/qpicture.cpp | 17 +- src/gui/image/qpicture.h | 4 +- src/gui/image/qpicture_p.h | 2 +- src/gui/image/qpixmap_s60.cpp | 1 + src/gui/image/qpixmapcache.cpp | 7 +- src/gui/itemviews/qabstractitemview_p.h | 2 +- src/gui/itemviews/qfileiconprovider.cpp | 1 - src/gui/itemviews/qfileiconprovider.h | 5 +- src/gui/itemviews/qstandarditemmodel.cpp | 2 - src/gui/itemviews/qstandarditemmodel.h | 2 +- src/gui/itemviews/qtreewidget.cpp | 2 +- src/gui/itemviews/qtreewidgetitemiterator.cpp | 3 +- src/gui/itemviews/qtreewidgetitemiterator.h | 3 +- src/gui/kernel/qapplication.cpp | 8 +- src/gui/kernel/qapplication_p.h | 2 + src/gui/kernel/qapplication_qws.cpp | 27 +- src/gui/kernel/qapplication_s60.cpp | 7 + src/gui/kernel/qcursor_qws.cpp | 6 +- src/gui/kernel/qeventdispatcher_s60.cpp | 24 +- src/gui/kernel/qshortcutmap.cpp | 5 +- src/gui/kernel/qshortcutmap_p.h | 3 +- src/gui/kernel/qsound_s60.cpp | 7 +- src/gui/kernel/qt_s60_p.h | 1 + src/gui/kernel/qwidget.cpp | 46 +- src/gui/kernel/qwidget.h | 1 + src/gui/kernel/qwidget_mac.mm | 2 +- src/gui/kernel/qwidget_qws.cpp | 3 +- src/gui/painting/qbrush.cpp | 113 ++-- src/gui/painting/qbrush.h | 6 +- src/gui/painting/qdrawhelper.cpp | 4 +- src/gui/painting/qpaintengine.cpp | 1 - src/gui/painting/qpaintengine.h | 3 +- src/gui/painting/qpaintengine_raster.cpp | 168 +++--- src/gui/painting/qpainter.cpp | 61 +- src/gui/painting/qpainter.h | 5 +- src/gui/painting/qpainterpath.cpp | 21 +- src/gui/painting/qpainterpath.h | 9 +- src/gui/painting/qprinter.cpp | 1 - src/gui/painting/qprinter.h | 5 +- src/gui/painting/qprinterinfo.h | 3 +- src/gui/painting/qprinterinfo_mac.cpp | 32 +- src/gui/painting/qprinterinfo_unix.cpp | 33 +- src/gui/painting/qprinterinfo_win.cpp | 30 +- src/gui/painting/qrasterizer.cpp | 7 +- src/gui/painting/qregion.cpp | 160 +++--- src/gui/painting/qwindowsurface_raster.cpp | 2 - src/gui/painting/qwindowsurface_raster_p.h | 2 +- src/gui/styles/qs60style.h | 4 +- src/gui/text/qfont.cpp | 62 +- src/gui/text/qfont.h | 3 +- src/gui/text/qfontdatabase.cpp | 41 +- src/gui/text/qfontdatabase_qws.cpp | 81 ++- src/gui/text/qfontengine.cpp | 22 +- src/gui/text/qfontengine_ft.cpp | 84 +-- src/gui/text/qfontengine_ft_p.h | 1 + src/gui/text/qfontengine_qpf.cpp | 31 +- src/gui/text/qfontengine_qpf_p.h | 1 + src/gui/text/qfontmetrics.cpp | 8 +- src/gui/text/qfragmentmap_p.h | 8 +- src/gui/text/qtextengine.cpp | 10 +- src/gui/text/qtextlayout.cpp | 2 +- src/gui/text/qtextoption.cpp | 10 +- src/gui/text/qtexttable.cpp | 15 +- src/gui/text/qzip.cpp | 10 +- src/gui/widgets/qabstractscrollarea.cpp | 23 +- src/gui/widgets/qabstractscrollarea_p.h | 2 +- src/gui/widgets/qmacnativewidget_mac.h | 2 +- src/gui/widgets/qmenu_symbian.cpp | 7 +- src/gui/widgets/qmenudata.h | 2 + src/gui/widgets/qprintpreviewwidget.cpp | 13 +- src/gui/widgets/qprintpreviewwidget.h | 2 +- src/network/access/qftp.cpp | 12 +- src/network/access/qhttp.cpp | 1 - src/network/access/qhttp.h | 3 +- src/network/access/qhttpnetworkconnection.cpp | 6 +- src/network/access/qhttpnetworkconnection_p.h | 4 +- src/network/access/qnetworkaccesshttpbackend.cpp | 12 +- src/network/access/qnetworkaccessmanager.cpp | 2 +- src/network/access/qnetworkdiskcache.cpp | 42 +- src/network/access/qnetworkrequest.cpp | 3 +- src/network/kernel/qhostaddress.cpp | 5 +- src/network/kernel/qhostaddress.h | 3 +- src/network/kernel/qhostinfo.cpp | 20 +- src/network/kernel/qhostinfo.h | 3 +- src/network/kernel/qhostinfo_unix.cpp | 2 + src/network/kernel/qnetworkinterface.cpp | 5 +- src/network/kernel/qnetworkinterface.h | 3 +- src/network/kernel/qnetworkinterface_win.cpp | 11 +- src/network/socket/qlocalsocket_unix.cpp | 2 +- src/network/socket/qsocks5socketengine.cpp | 4 +- src/network/socket/qtcpserver.cpp | 7 +- src/network/ssl/qsslcertificate.cpp | 13 +- src/network/ssl/qsslcertificate.h | 2 +- src/network/ssl/qsslcipher.cpp | 5 +- src/network/ssl/qsslcipher.h | 3 +- src/network/ssl/qsslerror.cpp | 5 +- src/network/ssl/qsslerror.h | 2 +- src/network/ssl/qsslkey.cpp | 17 +- src/network/ssl/qsslkey.h | 3 +- src/opengl/qgl.cpp | 5 +- src/opengl/qgl.h | 3 +- src/opengl/qglframebufferobject.cpp | 1 - src/opengl/qglframebufferobject.h | 2 +- src/opengl/qglpaintdevice_qws.cpp | 2 - src/opengl/qglpaintdevice_qws_p.h | 3 +- src/opengl/qglpixelbuffer.cpp | 1 - src/opengl/qglpixelbuffer.h | 2 +- src/opengl/qpaintengine_opengl.cpp | 2 +- src/phonon/phonon.pro | 3 +- src/plugins/imageformats/mng/qmnghandler.cpp | 2 - src/plugins/imageformats/mng/qmnghandler.h | 3 +- src/plugins/s60/src/qlocale_3_2.cpp | 1 + src/qt3support/itemviews/q3table.cpp | 1 + src/qt3support/other/q3accel.cpp | 2 +- src/qt3support/painting/q3painter.h | 2 + src/s60main/qts60main.cpp | 1 + src/s60main/qts60main_mcrt0.cpp | 10 +- src/s60main/qts60mainapplication.cpp | 1 + src/s60main/qts60mainappui.cpp | 8 +- src/s60main/qts60maindocument.cpp | 1 + src/script/qscriptable.cpp | 2 - src/script/qscriptable.h | 4 +- src/script/qscriptclass.cpp | 2 - src/script/qscriptclass.h | 3 +- src/script/qscriptclasspropertyiterator.cpp | 2 - src/script/qscriptclasspropertyiterator.h | 3 +- src/script/qscriptcontext.cpp | 2 - src/script/qscriptcontext.h | 3 +- src/script/qscriptcontextinfo.cpp | 23 +- src/script/qscriptcontextinfo.h | 3 +- src/script/qscriptengine.cpp | 20 +- src/script/qscriptengine.h | 5 +- src/script/qscriptengineagent.cpp | 2 - src/script/qscriptengineagent.h | 3 +- src/script/qscriptstring.cpp | 48 +- src/script/qscriptstring.h | 5 +- src/script/qscriptvalue.cpp | 76 +-- src/script/qscriptvalue.h | 8 +- src/script/qscriptvalue_p.h | 2 +- src/script/qscriptvalueiterator.cpp | 18 +- src/script/qscriptvalueiterator.h | 4 +- .../debugging/qscriptbreakpointdata.cpp | 5 +- .../debugging/qscriptbreakpointdata_p.h | 4 +- .../debugging/qscriptdebuggerbackend.cpp | 1 - .../debugging/qscriptdebuggerbackend_p.h | 2 +- .../debugging/qscriptdebuggercommand.cpp | 5 +- .../debugging/qscriptdebuggercommand_p.h | 4 +- .../debugging/qscriptdebuggercommandexecutor.cpp | 1 - .../debugging/qscriptdebuggercommandexecutor_p.h | 3 +- .../debugging/qscriptdebuggerconsole.cpp | 1 - .../debugging/qscriptdebuggerconsole_p.h | 3 +- .../debugging/qscriptdebuggerconsolecommand.cpp | 1 - .../debugging/qscriptdebuggerconsolecommand_p.h | 4 +- .../qscriptdebuggerconsolecommandgroupdata.cpp | 14 +- .../qscriptdebuggerconsolecommandgroupdata_p.h | 4 +- .../qscriptdebuggerconsolecommandmanager.cpp | 1 - .../qscriptdebuggerconsolecommandmanager_p.h | 4 +- src/scripttools/debugging/qscriptdebuggerevent.cpp | 5 +- src/scripttools/debugging/qscriptdebuggerevent_p.h | 3 +- .../debugging/qscriptdebuggerfrontend.cpp | 1 - .../debugging/qscriptdebuggerfrontend_p.h | 4 +- src/scripttools/debugging/qscriptdebuggerjob.cpp | 1 - src/scripttools/debugging/qscriptdebuggerjob_p.h | 3 +- .../debugging/qscriptdebuggerresponse.cpp | 5 +- .../debugging/qscriptdebuggerresponse_p.h | 4 +- src/scripttools/debugging/qscriptdebuggervalue.cpp | 16 +- src/scripttools/debugging/qscriptdebuggervalue_p.h | 4 +- .../debugging/qscriptdebuggervalueproperty.cpp | 14 +- .../debugging/qscriptdebuggervalueproperty_p.h | 3 +- src/scripttools/debugging/qscriptscriptdata.cpp | 20 +- src/scripttools/debugging/qscriptscriptdata_p.h | 4 +- .../debugging/qscriptstdmessagehandler.cpp | 1 - .../debugging/qscriptstdmessagehandler_p.h | 4 +- src/scripttools/debugging/qscriptvalueproperty.cpp | 14 +- src/scripttools/debugging/qscriptvalueproperty_p.h | 3 +- src/svg/qgraphicssvgitem.h | 6 +- src/svg/qsvggenerator.cpp | 1 - src/svg/qsvggenerator.h | 3 +- src/testlib/3rdparty/cycle_p.h | 2 + src/testlib/qtestcase.cpp | 10 +- src/xml/dom/qdom.cpp | 88 ++- src/xml/sax/qxml.cpp | 81 +-- src/xml/sax/qxml.h | 5 +- src/xmlpatterns/api/qabstractxmlnodemodel.cpp | 1 - src/xmlpatterns/api/qabstractxmlnodemodel.h | 3 +- src/xmlpatterns/api/qabstractxmlreceiver.cpp | 1 - src/xmlpatterns/api/qabstractxmlreceiver.h | 3 +- src/xmlpatterns/api/qxmlresultitems.cpp | 1 - src/xmlpatterns/api/qxmlresultitems.h | 3 +- tests/auto/auto.pro | 1 + tests/auto/collections/tst_collections.cpp | 6 + tests/auto/exceptionsafety/tst_exceptionsafety.cpp | 628 ++++++++++++++++++++- tests/auto/network-settings.h | 42 +- tests/auto/qbitarray/tst_qbitarray.cpp | 27 + tests/auto/qeventloop/tst_qeventloop.cpp | 2 + tests/auto/qfiledialog/tst_qfiledialog.cpp | 9 +- tests/auto/qfontdatabase/tst_qfontdatabase.cpp | 2 +- tests/auto/qglobal/tst_qglobal.cpp | 62 ++ tests/auto/qitemdelegate/tst_qitemdelegate.cpp | 7 +- tests/auto/qscopedpointer/.gitignore | 1 + tests/auto/qscopedpointer/qscopedpointer.pro | 3 + tests/auto/qscopedpointer/tst_qscopedpointer.cpp | 282 +++++++++ tests/auto/qtcpsocket/tst_qtcpsocket.cpp | 4 +- tests/auto/qudpsocket/tst_qudpsocket.cpp | 2 +- tools/configure/configureapp.cpp | 4 +- .../components/formeditor/brushmanagerproxy.cpp | 4 +- .../src/components/formeditor/brushmanagerproxy.h | 2 +- .../src/components/formeditor/qtbrushmanager.cpp | 5 +- .../src/components/formeditor/qtbrushmanager.h | 2 +- tools/designer/src/lib/shared/iconselector.cpp | 5 +- tools/designer/src/lib/shared/iconselector_p.h | 4 +- .../src/lib/shared/qtresourceeditordialog.cpp | 5 +- .../src/lib/shared/qtresourceeditordialog_p.h | 3 +- tools/designer/src/lib/shared/qtresourcemodel.cpp | 2 - tools/designer/src/lib/shared/qtresourcemodel_p.h | 5 +- tools/designer/src/lib/shared/qtresourceview.cpp | 4 - tools/designer/src/lib/shared/qtresourceview_p.h | 4 +- tools/designer/src/uitools/quiloader.cpp | 1 - tools/designer/src/uitools/quiloader.h | 3 +- tools/shared/qtgradienteditor/qtcolorbutton.cpp | 4 +- tools/shared/qtgradienteditor/qtcolorbutton.h | 2 +- tools/shared/qtgradienteditor/qtcolorline.cpp | 4 +- tools/shared/qtgradienteditor/qtcolorline.h | 2 +- tools/shared/qtgradienteditor/qtgradientdialog.cpp | 4 +- tools/shared/qtgradienteditor/qtgradientdialog.h | 2 +- tools/shared/qtgradienteditor/qtgradienteditor.cpp | 4 +- tools/shared/qtgradienteditor/qtgradienteditor.h | 2 +- .../qtgradienteditor/qtgradientstopscontroller.cpp | 4 +- .../qtgradienteditor/qtgradientstopscontroller.h | 2 +- .../qtgradienteditor/qtgradientstopsmodel.cpp | 7 +- .../shared/qtgradienteditor/qtgradientstopsmodel.h | 4 +- .../qtgradienteditor/qtgradientstopswidget.cpp | 4 +- .../qtgradienteditor/qtgradientstopswidget.h | 2 +- tools/shared/qtgradienteditor/qtgradientwidget.cpp | 4 +- tools/shared/qtgradienteditor/qtgradientwidget.h | 2 +- .../qtpropertybrowser/qtbuttonpropertybrowser.cpp | 4 +- .../qtpropertybrowser/qtbuttonpropertybrowser.h | 2 +- tools/shared/qtpropertybrowser/qteditorfactory.cpp | 54 +- tools/shared/qtpropertybrowser/qteditorfactory.h | 30 +- .../qtgroupboxpropertybrowser.cpp | 4 +- .../qtpropertybrowser/qtgroupboxpropertybrowser.h | 2 +- .../shared/qtpropertybrowser/qtpropertybrowser.cpp | 14 +- tools/shared/qtpropertybrowser/qtpropertybrowser.h | 8 +- .../shared/qtpropertybrowser/qtpropertymanager.cpp | 128 ++--- tools/shared/qtpropertybrowser/qtpropertymanager.h | 44 +- .../qtpropertybrowser/qttreepropertybrowser.cpp | 4 +- .../qtpropertybrowser/qttreepropertybrowser.h | 2 +- .../shared/qtpropertybrowser/qtvariantproperty.cpp | 12 +- tools/shared/qtpropertybrowser/qtvariantproperty.h | 6 +- tools/shared/qttoolbardialog/qttoolbardialog.cpp | 14 +- tools/shared/qttoolbardialog/qttoolbardialog.h | 4 +- 360 files changed, 4165 insertions(+), 2217 deletions(-) create mode 100644 doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp create mode 100644 src/corelib/tools/qscopedpointer.cpp create mode 100644 src/corelib/tools/qscopedpointer.h create mode 100644 src/gui/dialogs/qfscompleter_p.h create mode 100644 tests/auto/qscopedpointer/.gitignore create mode 100644 tests/auto/qscopedpointer/qscopedpointer.pro create mode 100644 tests/auto/qscopedpointer/tst_qscopedpointer.cpp diff --git a/configure.exe b/configure.exe index 7d8861e..c90e029 100755 Binary files a/configure.exe and b/configure.exe differ diff --git a/doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp b/doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp new file mode 100644 index 0000000..05377dd --- /dev/null +++ b/doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp @@ -0,0 +1,64 @@ +//! [0] +void myFunction(bool useSubClass) +{ + MyClass *p = useSubClass ? new MyClass() : new MySubClass; + QIODevice *device = handsOverOwnership(); + QIODevi + + if (m_value > 3) { + delete p; + delete device; + return; + } + + try { + process(device); + } + catch (...) { + delete p; + delete device; + throw; + } + + delete p; + delete device; +} +//! [0] + +//! [1] +void myFunction(bool useSubClass) +{ + QScopedPointer p(useSubClass ? new MyClass() : new MySubClass); + QScopedPointer device(handsOverOwnership()); + + if (m_value > 3) + return; + + process(device); +} +//! [1] + +//! [2] + const QWidget *const p = new QWidget(); + // is equivalent to: + const QScopedPointer p(new QWidget()); + + QWidget *const p = new QWidget(); + // is equivalent to: + const QScopedPointer p(new QWidget()); + + QWidget *const p = new QWidget(); + // is equivalent to: + const QScopedPointer p(new QWidget()); + + const QWidget *p = new QWidget(); + // is equivalent to: + QScopedPointer p(new QWidget()); + +//! [2] + +//! [3] +if (scopedPointer) { + ... +} +//! [3] diff --git a/mkspecs/features/symbian/platform_paths.prf b/mkspecs/features/symbian/platform_paths.prf index 31ba09e..c9972cc 100644 --- a/mkspecs/features/symbian/platform_paths.prf +++ b/mkspecs/features/symbian/platform_paths.prf @@ -214,8 +214,12 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { OS_LAYER_SSL_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/openssl) - OS_LAYER_STDCPP_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlport) - + exists($$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5)) { + OS_LAYER_STDCPP_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5) + } else { + OS_LAYER_STDCPP_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlport) + } + OS_LAYER_BOOST_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/boost) OS_LAYER_DBUS_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/dbus-1.0) \ @@ -413,7 +417,12 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { OS_LAYER_SSL_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/openssl) - OS_LAYER_STDCPP_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlport) + # stlportv5 is preferred over stlport as it has the throwing version of operator new + exists($$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5)) { + OS_LAYER_STDCPP_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5) + } else { + OS_LAYER_STDCPP_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlport) + } OS_LAYER_BOOST_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/boost) diff --git a/mkspecs/features/symbian/stl.prf b/mkspecs/features/symbian/stl.prf index b91d783..f01cc18 100644 --- a/mkspecs/features/symbian/stl.prf +++ b/mkspecs/features/symbian/stl.prf @@ -9,11 +9,30 @@ DEFINES *= $$STLLIB_USAGE_DEFINES # Legacy support requires some hardcoded stdapis paths. # Note: Also the new header is used from STL when it is enabled -INCLUDEPATH += \ - $${EPOCROOT}epoc32/include/stdapis/stlport \ - $$OS_LAYER_STDCPP_SYSTEMINCLUDE -LIBS *= -llibstdcpp.dll +INCLUDEPATH += $$OS_LAYER_STDCPP_SYSTEMINCLUDE \ + $${EPOCROOT}epoc32/include/stdapis/stlport # Remove mkspecs/common/symbian/stl-off from beginning of includepath # in order to use new and delete operators from STL INCLUDEPATH -= $$[QT_INSTALL_PREFIX]/mkspecs/common/symbian/stl-off + +# libstdcppv5 is preferred over libstdcpp as it has/uses the throwing version of operator new +exists($${EPOCROOT}epoc32/release/armv5/urel/libstdcppv5.dll ) { + LIBS *= -llibstdcppv5.dll + + # STDCPP turns on standard C++ new behaviour in SBSv2 + MMP_RULES += "STDCPP" + + # defining __SYMBIAN_STDCPP_SUPPORT__ turns on standard C++ new behaviour pre SBSv2 + DEFINES += "__SYMBIAN_STDCPP_SUPPORT__" + + # operator new is actually supplied in stdnew.lib for hardware builds + eabiStdNewLibBlock = \ + "$${LITERAL_HASH}ifdef EABI" \ + "LIBRARY stdnew.lib" \ + "$${LITERAL_HASH}endif" + + MMP_RULES += eabiStdNewLibBlock +} else { + LIBS *= -llibstdcpp.dll +} diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp index 36b9282..2e3ef38 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp +++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp @@ -935,7 +935,13 @@ static HB_Stream getTableStream(void *font, HB_GetFontTableFunc tableFunc, HB_Ta if (error) return 0; stream = (HB_Stream)malloc(sizeof(HB_StreamRec)); + if (!stream) + return 0; stream->base = (HB_Byte*)malloc(length); + if (!stream->base) { + free(stream); + return 0; + } error = tableFunc(font, tag, stream->base, &length); if (error) { _hb_close_stream(stream); @@ -950,6 +956,8 @@ static HB_Stream getTableStream(void *font, HB_GetFontTableFunc tableFunc, HB_Ta HB_Face HB_NewFace(void *font, HB_GetFontTableFunc tableFunc) { HB_Face face = (HB_Face )malloc(sizeof(HB_FaceRec)); + if (!face) + return 0; face->isSymbolFont = false; face->gdef = 0; diff --git a/src/3rdparty/phonon/phonon/abstractmediastream.cpp b/src/3rdparty/phonon/phonon/abstractmediastream.cpp index a661702..5b860f3 100644 --- a/src/3rdparty/phonon/phonon/abstractmediastream.cpp +++ b/src/3rdparty/phonon/phonon/abstractmediastream.cpp @@ -49,7 +49,6 @@ AbstractMediaStream::AbstractMediaStream(AbstractMediaStreamPrivate &dd, QObject AbstractMediaStream::~AbstractMediaStream() { - delete d_ptr; } qint64 AbstractMediaStream::streamSize() const diff --git a/src/3rdparty/phonon/phonon/abstractmediastream.h b/src/3rdparty/phonon/phonon/abstractmediastream.h index 0daa92a..c4cde85 100644 --- a/src/3rdparty/phonon/phonon/abstractmediastream.h +++ b/src/3rdparty/phonon/phonon/abstractmediastream.h @@ -214,7 +214,7 @@ class PHONON_EXPORT AbstractMediaStream : public QObject virtual void seekStream(qint64 offset); AbstractMediaStream(AbstractMediaStreamPrivate &dd, QObject *parent); - AbstractMediaStreamPrivate *d_ptr; + QScopedPointer d_ptr; }; } // namespace Phonon diff --git a/src/3rdparty/phonon/phonon/abstractmediastream_p.h b/src/3rdparty/phonon/phonon/abstractmediastream_p.h index a9d6489..0e87c4d 100644 --- a/src/3rdparty/phonon/phonon/abstractmediastream_p.h +++ b/src/3rdparty/phonon/phonon/abstractmediastream_p.h @@ -45,6 +45,7 @@ class PHONON_EXPORT AbstractMediaStreamPrivate : private MediaNodeDestructionHan public: void setStreamInterface(StreamInterface *); void setMediaObjectPrivate(MediaObjectPrivate *); + ~AbstractMediaStreamPrivate(); protected: AbstractMediaStreamPrivate() @@ -56,7 +57,6 @@ class PHONON_EXPORT AbstractMediaStreamPrivate : private MediaNodeDestructionHan errorType(NoError) { } - ~AbstractMediaStreamPrivate(); virtual void setStreamSize(qint64 newSize); virtual void setStreamSeekable(bool s); diff --git a/src/corelib/codecs/qisciicodec.cpp b/src/corelib/codecs/qisciicodec.cpp index dd2bc8d..5619580 100644 --- a/src/corelib/codecs/qisciicodec.cpp +++ b/src/corelib/codecs/qisciicodec.cpp @@ -38,7 +38,6 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - #include "qisciicodec_p.h" #include "qlist.h" diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp index 6e8ffa1..cfb62c7 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp @@ -92,6 +92,11 @@ # define QT_NO_SETLOCALE #endif +#if 0 // ### TODO - remove me! +// enabling this is not exception safe! +#define Q_DEBUG_TEXTCODEC +#endif + QT_BEGIN_NAMESPACE #ifndef QT_NO_TEXTCODECPLUGIN @@ -165,7 +170,9 @@ static QTextCodec *createForMib(int mib) } static QList *all = 0; +#ifdef Q_DEBUG_TEXTCODEC static bool destroying_is_ok = false; +#endif static QTextCodec *localeMapper = 0; QTextCodec *QTextCodec::cftr = 0; @@ -187,15 +194,21 @@ QTextCodecCleanup::~QTextCodecCleanup() if (!all) return; +#ifdef Q_DEBUG_TEXTCODEC destroying_is_ok = true; +#endif - while (all->size()) - delete all->takeFirst(); + for (QList::const_iterator it = all->constBegin() + ; it != all->constEnd(); ++it) { + delete *it; + } delete all; all = 0; localeMapper = 0; +#ifdef Q_DEBUG_TEXTCODEC destroying_is_ok = false; +#endif } Q_GLOBAL_STATIC(QTextCodecCleanup, createQTextCodecCleanup) @@ -659,8 +672,10 @@ static void setup() if (all) return; +#ifdef Q_DEBUG_TEXTCODEC if (destroying_is_ok) qWarning("QTextCodec: Creating new codec during codec cleanup"); +#endif all = new QList; // create the cleanup object to cleanup all codecs on exit (void) createQTextCodecCleanup(); @@ -915,8 +930,10 @@ QTextCodec::QTextCodec() */ QTextCodec::~QTextCodec() { +#ifdef Q_DEBUG_TEXTCODEC if (!destroying_is_ok) qWarning("QTextCodec::~QTextCodec: Called by application"); +#endif if (all) all->removeAll(this); } diff --git a/src/corelib/concurrent/qthreadpool.cpp b/src/corelib/concurrent/qthreadpool.cpp index 30edfd4..8913b56 100644 --- a/src/corelib/concurrent/qthreadpool.cpp +++ b/src/corelib/concurrent/qthreadpool.cpp @@ -246,14 +246,14 @@ bool QThreadPoolPrivate::tooManyThreadsActive() const */ void QThreadPoolPrivate::startThread(QRunnable *runnable) { - QThreadPoolThread *thread = new QThreadPoolThread(this); - allThreads.insert(thread); + QScopedPointer thread(new QThreadPoolThread(this)); + allThreads.insert(thread.data()); ++activeThreads; if (runnable->autoDelete()) ++runnable->ref; thread->runnable = runnable; - thread->start(); + thread.take()->start(); } /*! \internal diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index ca243e7..484c618 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1929,6 +1929,15 @@ void qt_check_pointer(const char *n, int l) qWarning("In file %s, line %d: Out of memory", n, l); } +/* \internal + Allows you to throw an exception without including + Called internally from Q_CHECK_PTR on certain OS combinations +*/ +void qBadAlloc() +{ + QT_THROW(std::bad_alloc()); +} + /* The Q_ASSERT macro calls this function when the test fails. */ @@ -2177,7 +2186,11 @@ void qt_message_output(QtMsgType msgType, const char *buf) #if defined(Q_OS_SYMBIAN) __DEBUGGER(); // on the emulator, get the debugger to kick in if there's one around - User::Invariant(); // Panic the current thread + TBuf<256> tmp; + TPtrC8 ptr(reinterpret_cast(buf)); + TInt len = Min(tmp.MaxLength(), ptr.Length()); + tmp.Copy(ptr.Left(len)); + User::Panic(tmp, 0); // Panic the current thread #elif (defined(Q_OS_UNIX) || defined(Q_CC_MINGW)) abort(); // trap; generates core dump #else @@ -2186,6 +2199,48 @@ void qt_message_output(QtMsgType msgType, const char *buf) } } +#if !defined(QT_NO_EXCEPTIONS) +/*! + \internal + Uses a local buffer to output the message. Not locale safe + cuts off + everything after character 1023, but will work in out of memory situations. +*/ +static void qEmergencyOut(QtMsgType msgType, const char *msg, va_list ap) +{ + char emergency_buf[1024] = { '\0' }; + emergency_buf[1023] = '\0'; + if (msg) + qvsnprintf(emergency_buf, 1023, msg, ap); + qt_message_output(msgType, emergency_buf); +} +#endif + +/*! + \internal +*/ +static void qt_message(QtMsgType msgType, const char *msg, va_list ap) +{ +#if !defined(QT_NO_EXCEPTIONS) + if (std::uncaught_exception()) { + qEmergencyOut(msgType, msg, ap); + return; + } +#endif + QByteArray buf; + if (msg) { + QT_TRY { + buf = QString().vsprintf(msg, ap).toLocal8Bit(); + } QT_CATCH(const std::bad_alloc &) { +#if !defined(QT_NO_EXCEPTIONS) + qEmergencyOut(msgType, msg, ap); + // don't rethrow - we use qWarning and friends in destructors. + return; +#endif + } + } + qt_message_output(msgType, buf.constData()); +} + #undef qDebug /*! \relates @@ -2223,14 +2278,10 @@ void qt_message_output(QtMsgType msgType, const char *buf) */ void qDebug(const char *msg, ...) { - QString buf; va_list ap; - va_start(ap, msg); // use variable arg list - if (msg) - buf.vsprintf(msg, ap); + va_start(ap, msg); // use variable arg list + qt_message(QtDebugMsg, msg, ap); va_end(ap); - - qt_message_output(QtDebugMsg, buf.toLocal8Bit().constData()); } #undef qWarning @@ -2267,14 +2318,10 @@ void qDebug(const char *msg, ...) */ void qWarning(const char *msg, ...) { - QString buf; va_list ap; va_start(ap, msg); // use variable arg list - if (msg) - buf.vsprintf(msg, ap); + qt_message(QtWarningMsg, msg, ap); va_end(ap); - - qt_message_output(QtWarningMsg, buf.toLocal8Bit().constData()); } /*! @@ -2307,15 +2354,12 @@ void qWarning(const char *msg, ...) */ void qCritical(const char *msg, ...) { - QString buf; va_list ap; va_start(ap, msg); // use variable arg list - if (msg) - buf.vsprintf(msg, ap); + qt_message(QtCriticalMsg, msg, ap); va_end(ap); - - qt_message_output(QtCriticalMsg, buf.toLocal8Bit().constData()); } + #ifdef QT3_SUPPORT void qSystemWarning(const char *msg, int code) { qCritical("%s (%s)", msg, qt_error_string(code).toLocal8Bit().constData()); } @@ -2323,6 +2367,8 @@ void qSystemWarning(const char *msg, int code) void qErrnoWarning(const char *msg, ...) { + // qt_error_string() will allocate anyway, so we don't have + // to be careful here (like we do in plain qWarning()) QString buf; va_list ap; va_start(ap, msg); @@ -2335,6 +2381,8 @@ void qErrnoWarning(const char *msg, ...) void qErrnoWarning(int code, const char *msg, ...) { + // qt_error_string() will allocate anyway, so we don't have + // to be careful here (like we do in plain qWarning()) QString buf; va_list ap; va_start(ap, msg); @@ -2371,14 +2419,10 @@ void qErrnoWarning(int code, const char *msg, ...) */ void qFatal(const char *msg, ...) { - QString buf; va_list ap; va_start(ap, msg); // use variable arg list - if (msg) - buf.vsprintf(msg, ap); + qt_message(QtFatalMsg, msg, ap); va_end(ap); - - qt_message_output(QtFatalMsg, buf.toLocal8Bit().constData()); } // getenv is declared as deprecated in VS2005. This function @@ -3166,4 +3210,59 @@ bool QInternal::callFunction(InternalFunction func, void **args) \sa Q_DECL_EXPORT */ +#if defined(Q_OS_SYMBIAN) + +#include + +const char* QSymbianLeaveException::what() const throw() +{ + static const char str[] = "Symbian leave exception %d"; + static char msg[sizeof(str)+12]; + sprintf(msg, str, error); + return msg; +} + +void qt_translateSymbianErrorToException(int error) +{ + if (error >= KErrNone) + return; // do nothing - not an exception + switch (error) { + case KErrNoMemory: + throw std::bad_alloc(); + default: + throw QSymbianLeaveException(error); + } +} + +void qt_translateExceptionToSymbianErrorL(const std::exception& aThrow) +{ + User::Leave(qt_translateExceptionToSymbianError(aThrow)); +} + +int qt_translateExceptionToSymbianError(const std::exception& aThrow) +{ + const std::type_info& atype = typeid(aThrow); + int err = KErrGeneral; + + if(atype == typeid (std::bad_alloc)) + err = KErrNoMemory; + else if(atype == typeid(QSymbianLeaveException)) + err = static_cast(aThrow).error; + else if(atype == typeid(std::invalid_argument)) + err = KErrArgument; + else if(atype == typeid(std::out_of_range)) + // std::out_of_range is of type logic_error which by definition means that it is + // "presumably detectable before the program executes". + // std::out_of_range is used to report an argument is not within the expected range. + // The description of KErrArgument says an argument is out of range. Hence the mapping. + err = KErrArgument; + else if(atype == typeid(std::overflow_error)) + err = KErrOverflow; + else if(atype == typeid(std::underflow_error)) + err = KErrUnderflow; + + return err; +} +#endif + QT_END_NAMESPACE diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index b075db6..030840e 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1301,6 +1301,32 @@ class QDataStream; # define Q_AUTOTEST_EXPORT #endif +inline void qt_noop() {} + +/* These wrap try/catch so we can switch off exceptions later. + + Beware - do not use more than one QT_CATCH per QT_TRY, and do not use + the exception instance in the catch block. + If you can't live with those constraints, don't use these macros. + Use the QT_NO_EXCEPTIONS macro to protect your code instead. +*/ + +#ifdef QT_BOOTSTRAPPED +# define QT_NO_EXCEPTIONS +#endif + +#ifdef QT_NO_EXCEPTIONS +# define QT_TRY if (true) +# define QT_CATCH(A) else +# define QT_THROW(A) qt_noop() +# define QT_RETHROW qt_noop() +#else +# define QT_TRY try +# define QT_CATCH(A) catch (A) +# define QT_THROW(A) throw A +# define QT_RETHROW throw +#endif + /* System information */ @@ -1554,8 +1580,6 @@ inline QNoDebug qDebug(); #endif -inline void qt_noop() {} - Q_CORE_EXPORT void qt_assert(const char *assertion, const char *file, int line); #if !defined(Q_ASSERT) @@ -1581,11 +1605,16 @@ Q_CORE_EXPORT void qt_assert_x(const char *where, const char *what, const char * #endif Q_CORE_EXPORT void qt_check_pointer(const char *, int); +Q_CORE_EXPORT void qBadAlloc(); -#ifndef QT_NO_DEBUG -# define Q_CHECK_PTR(p) do {if(!(p))qt_check_pointer(__FILE__,__LINE__);} while (0) +#ifdef QT_NO_EXCEPTIONS +# if defined(QT_NO_DEBUG) +# define Q_CHECK_PTR(p) qt_noop(); +# else +# define Q_CHECK_PTR(p) do {if(!(p))qt_check_pointer(__FILE__,__LINE__);} while (0) +# endif #else -# define Q_CHECK_PTR(p) +# define Q_CHECK_PTR(p) do { if (!(p)) qBadAlloc(); } while (0) #endif #if (defined(Q_CC_GNU) && !defined(Q_OS_SOLARIS)) || defined(Q_CC_HPACC) @@ -1734,12 +1763,12 @@ public: static TYPE *NAME() \ { \ if (!this_##NAME.pointer && !this_##NAME.destroyed) { \ - TYPE *x = new TYPE; \ + QScopedPointer x(new TYPE); \ INITIALIZER; \ - if (!this_##NAME.pointer.testAndSetOrdered(0, x)) \ - delete x; \ - else \ + if (this_##NAME.pointer.testAndSetOrdered(0, x.data())) { \ static QGlobalStaticDeleter cleanup(this_##NAME); \ + x.take(); \ + } \ } \ return this_##NAME.pointer; \ } @@ -2193,8 +2222,8 @@ inline const QForeachContainer *qForeachContainer(const QForeachContainerBase #endif #define Q_DECLARE_PRIVATE(Class) \ - inline Class##Private* d_func() { return reinterpret_cast(d_ptr); } \ - inline const Class##Private* d_func() const { return reinterpret_cast(d_ptr); } \ + inline Class##Private* d_func() { return reinterpret_cast(d_ptr.data()); } \ + inline const Class##Private* d_func() const { return reinterpret_cast(d_ptr.data()); } \ friend class Class##Private; #define Q_DECLARE_PRIVATE_D(Dptr, Class) \ @@ -2242,7 +2271,9 @@ inline const QForeachContainer *qForeachContainer(const QForeachContainerBase Class(const Class &); \ Class &operator=(const Class &); #else -# define Q_DISABLE_COPY(Class) +# define Q_DISABLE_COPY(Class) \ + Class(const Class &); \ + Class &operator=(const Class &); #endif class QByteArray; @@ -2434,6 +2465,48 @@ QT_LICENSED_MODULE(DBus) # define QT_NO_CONCURRENT_FILTER #endif +#if defined(Q_OS_SYMBIAN) + +#include +class QSymbianLeaveException : public std::exception +{ +public: + QSymbianLeaveException(int err) : error(err){ } + const char* what() const throw(); +public: + int error; +}; + +Q_CORE_EXPORT void qt_translateSymbianErrorToException(int error); +Q_CORE_EXPORT void qt_translateExceptionToSymbianErrorL(const std::exception& ex); +Q_CORE_EXPORT int qt_translateExceptionToSymbianError(const std::exception& ex); + +#define QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(f) \ + { \ + TInt error; \ + TRAP(error, f); \ + if (error) \ + qt_translateSymbianErrorToException(error); \ + } + +#define QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, f) \ + { \ + err = KErrNone; \ + try { \ + f; \ + } catch (const std::exception &ex) { \ + err = qt_translateExceptionToSymbianError(ex); \ + } \ + } + +#define QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(f) \ + { \ + TInt err; \ + QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, f) \ + User::LeaveIfError(err); \ + } +#endif + QT_END_NAMESPACE QT_END_HEADER diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index 29e356e..5e4b9bd 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -40,11 +40,11 @@ ****************************************************************************/ #include "qdir.h" -#include "qfile.h" +#include "qfile.h" #include "qconfig.h" #include "qsettings.h" #include "qlibraryinfo.h" -#include "qpointer.h" +#include "qscopedpointer.h" #ifdef QT_BUILD_QMAKE QT_BEGIN_NAMESPACE @@ -67,8 +67,7 @@ QT_BEGIN_NAMESPACE struct QLibrarySettings { QLibrarySettings(); - ~QLibrarySettings() { delete static_cast(settings); } - QSettings *settings; + QScopedPointer settings; }; Q_GLOBAL_STATIC(QLibrarySettings, qt_library_settings) @@ -79,32 +78,19 @@ public: static void cleanup() { QLibrarySettings *ls = qt_library_settings(); - if (ls) { - delete static_cast(ls->settings); - ls->settings = 0; - } + if (ls) + ls->settings.reset(0); } static QSettings *configuration() { -#ifdef QT_NO_THREAD - // This recursion guard should be a temporary solution; the recursive - // dependency should be found and removed. - static bool initializing = false; - if (initializing) - return 0; - initializing = true; -#endif QLibrarySettings *ls = qt_library_settings(); -#ifdef QT_NO_THREAD - initializing = false; -#endif - return ls ? static_cast(qt_library_settings()->settings) : (QSettings*)0; + return ls ? ls->settings.data() : 0; } }; QLibrarySettings::QLibrarySettings() + : settings(QLibraryInfoPrivate::findConfiguration()) { - settings = QLibraryInfoPrivate::findConfiguration(); #ifndef QT_BUILD_QMAKE qAddPostRoutine(QLibraryInfoPrivate::cleanup); #endif diff --git a/src/corelib/io/qabstractfileengine.cpp b/src/corelib/io/qabstractfileengine.cpp index bedc121..63d4944 100644 --- a/src/corelib/io/qabstractfileengine.cpp +++ b/src/corelib/io/qabstractfileengine.cpp @@ -352,8 +352,6 @@ QAbstractFileEngine::QAbstractFileEngine(QAbstractFileEnginePrivate &dd) : d_ptr */ QAbstractFileEngine::~QAbstractFileEngine() { - delete d_ptr; - d_ptr = 0; } /*! @@ -881,7 +879,6 @@ QAbstractFileEngineIterator::QAbstractFileEngineIterator(QDir::Filters filters, */ QAbstractFileEngineIterator::~QAbstractFileEngineIterator() { - delete d; } /*! diff --git a/src/corelib/io/qabstractfileengine.h b/src/corelib/io/qabstractfileengine.h index d742467..5b75343 100644 --- a/src/corelib/io/qabstractfileengine.h +++ b/src/corelib/io/qabstractfileengine.h @@ -193,7 +193,7 @@ protected: QAbstractFileEngine(); QAbstractFileEngine(QAbstractFileEnginePrivate &); - QAbstractFileEnginePrivate *d_ptr; + QScopedPointer d_ptr; private: Q_DECLARE_PRIVATE(QAbstractFileEngine) Q_DISABLE_COPY(QAbstractFileEngine) @@ -237,7 +237,7 @@ private: friend class QDirIterator; friend class QDirIteratorPrivate; void setPath(const QString &path); - QAbstractFileEngineIteratorPrivate *d; + QScopedPointer d; }; QT_END_NAMESPACE diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index 8334146..60dc688 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -79,8 +79,11 @@ public: inline QDebug &operator=(const QDebug &other); inline ~QDebug() { if (!--stream->ref) { - if(stream->message_output) - qt_message_output(stream->type, stream->buffer.toLocal8Bit().data()); + if(stream->message_output) { + QT_TRY { + qt_message_output(stream->type, stream->buffer.toLocal8Bit().data()); + } QT_CATCH(std::bad_alloc) { /* We're out of memory - give up. */ } + } delete stream; } } diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index 901641c..e1cc7ac 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -83,6 +83,7 @@ class QDirPrivate QDir *q_ptr; Q_DECLARE_PUBLIC(QDir) + friend class QScopedPointer; protected: QDirPrivate(QDir*, const QDir *copy=0); ~QDirPrivate(); @@ -573,8 +574,6 @@ QDir::QDir(const QDir &dir) : d_ptr(new QDirPrivate(this, &dir)) QDir::~QDir() { - delete d_ptr; - d_ptr = 0; } /*! diff --git a/src/corelib/io/qdir.h b/src/corelib/io/qdir.h index c4f6b1a..ac80094 100644 --- a/src/corelib/io/qdir.h +++ b/src/corelib/io/qdir.h @@ -45,6 +45,7 @@ #include #include #include +#include QT_BEGIN_HEADER @@ -57,7 +58,7 @@ class QDirPrivate; class Q_CORE_EXPORT QDir { protected: - QDirPrivate *d_ptr; + QScopedPointer d_ptr; private: Q_DECLARE_PRIVATE(QDir) public: diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index 551485d..1e3d5a3 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -109,6 +109,7 @@ QFilePrivate::openExternalFile(int flags, int fd) return false; #else delete fileEngine; + fileEngine = 0; QFSFileEngine *fe = new QFSFileEngine; fe->setFileName(fileName); fileEngine = fe; @@ -125,6 +126,7 @@ QFilePrivate::openExternalFile(int flags, FILE *fh) return false; #else delete fileEngine; + fileEngine = 0; QFSFileEngine *fe = new QFSFileEngine; fe->setFileName(fileName); fileEngine = fe; @@ -410,9 +412,6 @@ QFile::QFile(QFilePrivate &dd, QObject *parent) QFile::~QFile() { close(); -#ifdef QT_NO_QOBJECT - delete d_ptr; -#endif } /*! diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp index 96e0f82..b36fb69 100644 --- a/src/corelib/io/qfileinfo.cpp +++ b/src/corelib/io/qfileinfo.cpp @@ -439,8 +439,6 @@ QFileInfo::QFileInfo(const QFileInfo &fileinfo) : d_ptr(new QFileInfoPrivate(&fi QFileInfo::~QFileInfo() { - delete d_ptr; - d_ptr = 0; } /*! diff --git a/src/corelib/io/qfileinfo.h b/src/corelib/io/qfileinfo.h index 97997a3..6c01f63 100644 --- a/src/corelib/io/qfileinfo.h +++ b/src/corelib/io/qfileinfo.h @@ -44,6 +44,7 @@ #include #include +#include QT_BEGIN_HEADER @@ -165,7 +166,7 @@ public: #endif protected: - QFileInfoPrivate *d_ptr; + QScopedPointer d_ptr; private: Q_DECLARE_PRIVATE(QFileInfo) }; diff --git a/src/corelib/io/qfilesystemwatcher_symbian.cpp b/src/corelib/io/qfilesystemwatcher_symbian.cpp index b1a6188..aeb19db 100644 --- a/src/corelib/io/qfilesystemwatcher_symbian.cpp +++ b/src/corelib/io/qfilesystemwatcher_symbian.cpp @@ -80,7 +80,7 @@ void CNotifyChangeEvent::RunL() if (iStatus.Int() == KErrNone){ fsSession.NotifyChange(ENotifyAll, iStatus, watchedPath); SetActive(); - engine->emitPathChanged(this); + QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(engine->emitPathChanged(this)); } else { qWarning("CNotifyChangeEvent::RunL() - Failed to order change notifications: %d", iStatus.Int()); } @@ -262,9 +262,9 @@ void QSymbianFileSystemWatcherEngine::run() void QSymbianFileSystemWatcherEngine::addNativeListener(const QString &directoryPath) { QMutexLocker locker(&mutex); - HBufC* buffer = qt_QString2HBufCNewL(QDir::toNativeSeparators(directoryPath)); - currentEvent = CNotifyChangeEvent::New(fsSession, *buffer, this); - delete buffer; + QString nativeDir(QDir::toNativeSeparators(directoryPath)); + TPtrC ptr(qt_QString2TPtrC(nativeDir)); + currentEvent = CNotifyChangeEvent::New(fsSession, ptr, this); syncCondition.wakeOne(); } diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp index e595f15..45e547f 100644 --- a/src/corelib/io/qfsfileengine_unix.cpp +++ b/src/corelib/io/qfsfileengine_unix.cpp @@ -404,23 +404,21 @@ bool QFSFileEngine::copy(const QString &newName) TInt err = rfs.Connect(); if (err == KErrNone) { CFileMan* fm = NULL; - HBufC* oldBuf = NULL; - HBufC* newBuf = NULL; + QString oldNative(QDir::toNativeSeparators(d->filePath)); + TPtrC oldPtr(qt_QString2TPtrC(oldNative)); + QFileInfo fi(newName); + QString absoluteNewName = fi.absolutePath() + QDir::separator() + fi.fileName(); + QString newNative(QDir::toNativeSeparators(absoluteNewName)); + TPtrC newPtr(qt_QString2TPtrC(newNative)); TRAP (err, fm = CFileMan::NewL(rfs); - oldBuf = qt_QString2HBufCNewL(QDir::toNativeSeparators(d->filePath)); RFile rfile; - err = rfile.Open(rfs, *oldBuf, EFileShareReadersOrWriters); + err = rfile.Open(rfs, oldPtr, EFileShareReadersOrWriters); if (err == KErrNone) { - QFileInfo fi(newName); - QString absoluteNewName = fi.absolutePath() + QDir::separator() + fi.fileName(); - newBuf = qt_QString2HBufCNewL(QDir::toNativeSeparators(absoluteNewName)); - err = fm->Copy(rfile, *newBuf); + err = fm->Copy(rfile, newPtr); rfile.Close(); } ) // End TRAP - delete oldBuf; - delete newBuf; delete fm; rfs.Close(); } @@ -675,10 +673,10 @@ static bool _q_isSymbianHidden(const QString &path, bool isDir) if (isDir && absPath.at(absPath.size()-1) != QChar('/')) { absPath += QChar('/'); } - HBufC* buffer = qt_QString2HBufCNewL(QDir::toNativeSeparators(absPath)); + QString native(QDir::toNativeSeparators(absPath)); + TPtrC ptr(qt_QString2TPtrC(native)); TUint attributes; - err = rfs.Att(*buffer, attributes); - delete buffer; + err = rfs.Att(ptr, attributes); rfs.Close(); if (err == KErrNone && (attributes & KEntryAttHidden)) { retval = true; diff --git a/src/corelib/io/qiodevice.h b/src/corelib/io/qiodevice.h index 76d47ca..ad87125 100644 --- a/src/corelib/io/qiodevice.h +++ b/src/corelib/io/qiodevice.h @@ -46,6 +46,7 @@ #include #else #include +#include #endif #include @@ -160,7 +161,7 @@ protected: void setErrorString(const QString &errorString); #ifdef QT_NO_QOBJECT - QIODevicePrivate *d_ptr; + QScopedPointer d_ptr; #endif private: diff --git a/src/corelib/io/qprocess_symbian.cpp b/src/corelib/io/qprocess_symbian.cpp index a59976c..26e7cdc 100644 --- a/src/corelib/io/qprocess_symbian.cpp +++ b/src/corelib/io/qprocess_symbian.cpp @@ -56,6 +56,7 @@ User::Panic(KQProcessPanic, panicReason); \ } +#include #include #include #include diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp index 1f77caa..0cbcc41 100644 --- a/src/corelib/io/qresource.cpp +++ b/src/corelib/io/qresource.cpp @@ -334,7 +334,6 @@ QResource::QResource(const QString &file, const QLocale &locale) : d_ptr(new QRe */ QResource::~QResource() { - delete d_ptr; } /*! diff --git a/src/corelib/io/qresource.h b/src/corelib/io/qresource.h index 1e9b2d5..f260b68 100644 --- a/src/corelib/io/qresource.h +++ b/src/corelib/io/qresource.h @@ -91,7 +91,7 @@ protected: QStringList children() const; protected: - QResourcePrivate *d_ptr; + QScopedPointer d_ptr; private: Q_DECLARE_PRIVATE(QResource) diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index 6152518..afaaf28 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -1106,10 +1106,10 @@ static QString getPath(QSettings::Format format, QSettings::Scope scope) QString homePath = QDir::homePath(); QString systemPath; - globalMutex()->lock(); + QMutexLocker locker(globalMutex()); PathHash *pathHash = pathHashFunc(); bool loadSystemPath = pathHash->isEmpty(); - globalMutex()->unlock(); + locker.unlock(); if (loadSystemPath) { /* @@ -1121,7 +1121,7 @@ static QString getPath(QSettings::Format format, QSettings::Scope scope) systemPath += QLatin1Char('/'); } - QMutexLocker locker(globalMutex()); + locker.relock(); if (pathHash->isEmpty()) { /* Lazy initialization of pathHash. We initialize the @@ -1181,9 +1181,6 @@ QConfFileSettingsPrivate::QConfFileSettingsPrivate(QSettings::Format format, int i; initFormat(); - for (i = 0; i < NumConfFiles; ++i) - confFiles[i] = 0; - QString org = organization; if (org.isEmpty()) { setStatus(QSettings::AccessError); @@ -1196,14 +1193,14 @@ QConfFileSettingsPrivate::QConfFileSettingsPrivate(QSettings::Format format, if (scope == QSettings::UserScope) { QString userPath = getPath(format, QSettings::UserScope); if (!application.isEmpty()) - confFiles[F_User | F_Application] = QConfFile::fromName(userPath + appFile, true); - confFiles[F_User | F_Organization] = QConfFile::fromName(userPath + orgFile, true); + confFiles[F_User | F_Application].reset(QConfFile::fromName(userPath + appFile, true)); + confFiles[F_User | F_Organization].reset(QConfFile::fromName(userPath + orgFile, true)); } QString systemPath = getPath(format, QSettings::SystemScope); if (!application.isEmpty()) - confFiles[F_System | F_Application] = QConfFile::fromName(systemPath + appFile, false); - confFiles[F_System | F_Organization] = QConfFile::fromName(systemPath + orgFile, false); + confFiles[F_System | F_Application].reset(QConfFile::fromName(systemPath + appFile, false)); + confFiles[F_System | F_Organization].reset(QConfFile::fromName(systemPath + orgFile, false)); for (i = 0; i < NumConfFiles; ++i) { if (confFiles[i]) { @@ -1222,9 +1219,7 @@ QConfFileSettingsPrivate::QConfFileSettingsPrivate(const QString &fileName, { initFormat(); - confFiles[0] = QConfFile::fromName(fileName, true); - for (int i = 1; i < NumConfFiles; ++i) - confFiles[i] = 0; + confFiles[0].reset(QConfFile::fromName(fileName, true)); initAccess(); } @@ -1241,19 +1236,27 @@ QConfFileSettingsPrivate::~QConfFileSettingsPrivate() usedHash->remove(confFiles[i]->name); if (confFiles[i]->size == 0) { - delete confFiles[i]; + delete confFiles[i].take(); } else if (unusedCache) { - // compute a better size? - unusedCache->insert(confFiles[i]->name, confFiles[i], + QT_TRY { + // compute a better size? + unusedCache->insert(confFiles[i]->name, confFiles[i].data(), 10 + (confFiles[i]->originalKeys.size() / 4)); + confFiles[i].take(); + } QT_CATCH(...) { + // out of memory. Do not cache the file. + delete confFiles[i].take(); + } } } + // prevent the ScopedPointer to deref it again. + confFiles[i].take(); } } void QConfFileSettingsPrivate::remove(const QString &key) { - QConfFile *confFile = confFiles[spec]; + QConfFile *confFile = confFiles[spec].data(); if (!confFile) return; @@ -1280,7 +1283,7 @@ void QConfFileSettingsPrivate::remove(const QString &key) void QConfFileSettingsPrivate::set(const QString &key, const QVariant &value) { - QConfFile *confFile = confFiles[spec]; + QConfFile *confFile = confFiles[spec].data(); if (!confFile) return; @@ -1297,7 +1300,7 @@ bool QConfFileSettingsPrivate::get(const QString &key, QVariant *value) const bool found = false; for (int i = 0; i < NumConfFiles; ++i) { - if (QConfFile *confFile = confFiles[i]) { + if (QConfFile *confFile = confFiles[i].data()) { QMutexLocker locker(&confFile->mutex); if (!confFile->addedKeys.isEmpty()) { @@ -1332,7 +1335,7 @@ QStringList QConfFileSettingsPrivate::children(const QString &prefix, ChildSpec int startPos = prefix.size(); for (int i = 0; i < NumConfFiles; ++i) { - if (QConfFile *confFile = confFiles[i]) { + if (QConfFile *confFile = confFiles[i].data()) { QMutexLocker locker(&confFile->mutex); if (thePrefix.isEmpty()) { @@ -1365,7 +1368,7 @@ QStringList QConfFileSettingsPrivate::children(const QString &prefix, ChildSpec void QConfFileSettingsPrivate::clear() { - QConfFile *confFile = confFiles[spec]; + QConfFile *confFile = confFiles[spec].data(); if (!confFile) return; @@ -1381,7 +1384,7 @@ void QConfFileSettingsPrivate::sync() // error we just try to go on and make the best of it for (int i = 0; i < NumConfFiles; ++i) { - QConfFile *confFile = confFiles[i]; + QConfFile *confFile = confFiles[i].data(); if (confFile) { QMutexLocker locker(&confFile->mutex); syncConfFile(i); @@ -1396,7 +1399,7 @@ void QConfFileSettingsPrivate::flush() QString QConfFileSettingsPrivate::fileName() const { - QConfFile *confFile = confFiles[spec]; + QConfFile *confFile = confFiles[spec].data(); if (!confFile) return QString(); return confFile->name; @@ -1407,7 +1410,7 @@ bool QConfFileSettingsPrivate::isWritable() const if (format > QSettings::IniFormat && !writeFunc) return false; - QConfFile *confFile = confFiles[spec]; + QConfFile *confFile = confFiles[spec].data(); if (!confFile) return false; @@ -1416,7 +1419,7 @@ bool QConfFileSettingsPrivate::isWritable() const void QConfFileSettingsPrivate::syncConfFile(int confFileNo) { - QConfFile *confFile = confFiles[confFileNo]; + QConfFile *confFile = confFiles[confFileNo].data(); bool readOnly = confFile->addedKeys.isEmpty() && confFile->removedKeys.isEmpty(); bool ok; @@ -2759,11 +2762,13 @@ QSettings::QSettings(const QString &fileName, Format format) QSettings::~QSettings() { Q_D(QSettings); - if (d->pendingChanges) - d->flush(); -#ifdef QT_NO_QOBJECT - delete d; -#endif + if (d->pendingChanges) { + QT_TRY { + d->flush(); + } QT_CATCH(...) { + ; // ok. then don't flush but at least don't throw in the destructor + } + } } /*! @@ -3566,8 +3571,7 @@ void QSettings::setPath_helper(Scope scope, const QString &organization, const Q QSettingsPrivate *oldPriv = d; QSettingsPrivate *newPriv = QSettingsPrivate::create(oldPriv->format, scope, organization, application); static_cast(*newPriv) = static_cast(*oldPriv); // copy the QObject stuff over (hack) - delete oldPriv; - d_ptr = newPriv; + d_ptr.reset(newPriv); } /*! \fn bool QSettings::writeEntry(const QString &key, bool value) diff --git a/src/corelib/io/qsettings.h b/src/corelib/io/qsettings.h index cbb24ba..41bce89 100644 --- a/src/corelib/io/qsettings.h +++ b/src/corelib/io/qsettings.h @@ -78,7 +78,7 @@ class Q_CORE_EXPORT QSettings #ifndef QT_NO_QOBJECT Q_OBJECT #else - QSettingsPrivate *d_ptr; + QScopedPointer d_ptr; #endif Q_DECLARE_PRIVATE(QSettings) diff --git a/src/corelib/io/qsettings_p.h b/src/corelib/io/qsettings_p.h index dd72fd9..1bdbf2c 100644 --- a/src/corelib/io/qsettings_p.h +++ b/src/corelib/io/qsettings_p.h @@ -300,7 +300,7 @@ private: void ensureAllSectionsParsed(QConfFile *confFile) const; void ensureSectionParsed(QConfFile *confFile, const QSettingsKey &key) const; - QConfFile *confFiles[NumConfFiles]; + QScopedSharedPointer confFiles[NumConfFiles]; QSettings::ReadFunc readFunc; QSettings::WriteFunc writeFunc; QString extension; diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index 1167671..9382fae 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -1112,9 +1112,6 @@ QTextStream::~QTextStream() #endif if (!d->writeBuffer.isEmpty()) d->flushWriteBuffer(); - - delete d; - d_ptr = 0; } /*! diff --git a/src/corelib/io/qtextstream.h b/src/corelib/io/qtextstream.h index 6302d34..cfacec6 100644 --- a/src/corelib/io/qtextstream.h +++ b/src/corelib/io/qtextstream.h @@ -46,6 +46,7 @@ #include #include #include +#include #ifndef QT_NO_TEXTCODEC # ifdef QT3_SUPPORT @@ -256,7 +257,7 @@ private: Q_DISABLE_COPY(QTextStream) - QTextStreamPrivate *d_ptr; + QScopedPointer d_ptr; }; Q_DECLARE_OPERATORS_FOR_FLAGS(QTextStream::NumberFlags) diff --git a/src/corelib/kernel/qcore_symbian_p.cpp b/src/corelib/kernel/qcore_symbian_p.cpp index 4f18490..101ed44 100644 --- a/src/corelib/kernel/qcore_symbian_p.cpp +++ b/src/corelib/kernel/qcore_symbian_p.cpp @@ -39,9 +39,11 @@ ** ****************************************************************************/ +#include #include #include #include "qcore_symbian_p.h" +#include QT_BEGIN_NAMESPACE @@ -51,18 +53,17 @@ QT_BEGIN_NAMESPACE must be deleted by the caller. */ -Q_CORE_EXPORT HBufC* qt_QString2HBufCNewL(const QString& aString) +Q_CORE_EXPORT HBufC* qt_QString2HBufC(const QString& aString) { HBufC *buffer; #ifdef QT_NO_UNICODE TPtrC8 ptr(reinterpret_cast(aString.toLocal8Bit().constData())); - buffer = HBufC8::NewL(ptr.Length()); - buffer->Des().Copy(ptr); #else - TPtrC16 ptr(reinterpret_cast(aString.utf16())); - buffer = HBufC16::NewL(ptr.Length()); - buffer->Des().Copy(ptr); + TPtrC16 ptr(qt_QString2TPtrC(aString)); #endif + buffer = HBufC::New(ptr.Length()); + Q_CHECK_PTR(buffer); + buffer->Des().Copy(ptr); return buffer; } @@ -82,7 +83,8 @@ QHBufC::QHBufC() QHBufC::QHBufC(const QHBufC &src) { - m_hBufC = src.m_hBufC->AllocL(); + m_hBufC = src.m_hBufC->Alloc(); + Q_CHECK_PTR(m_hBufC); } /*! @@ -97,7 +99,7 @@ QHBufC::QHBufC(HBufC *src) QHBufC::QHBufC(const QString &src) { - m_hBufC = qt_QString2HBufCNewL(src); + m_hBufC = qt_QString2HBufC(src); } QHBufC::~QHBufC() @@ -172,4 +174,5 @@ Q_CORE_EXPORT TLibraryFunction qt_resolveS60PluginFunc(int ordinal) return qt_s60_plugin_resolver()->resolve(ordinal); } + QT_END_NAMESPACE diff --git a/src/corelib/kernel/qcore_symbian_p.h b/src/corelib/kernel/qcore_symbian_p.h index 3b974c3..bd8f304 100644 --- a/src/corelib/kernel/qcore_symbian_p.h +++ b/src/corelib/kernel/qcore_symbian_p.h @@ -63,7 +63,7 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -Q_CORE_EXPORT HBufC* qt_QString2HBufCNewL(const QString& aString); +Q_CORE_EXPORT HBufC* qt_QString2HBufC(const QString& aString); Q_CORE_EXPORT QString qt_TDesC2QStringL(const TDesC& aDescriptor); inline QString qt_TDes2QStringL(const TDes& aDescriptor) { return qt_TDesC2QStringL(aDescriptor); } @@ -91,7 +91,7 @@ static inline TRect qt_QRect2TRect(const QRect& qr) // Returned TPtrC is valid as long as the given parameter is valid and unmodified static inline TPtrC qt_QString2TPtrC( const QString& string ) { - return reinterpret_cast(string.utf16()); + return TPtrC16(static_cast(string.utf16()), string.length()); } class Q_CORE_EXPORT QHBufC diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index d99164b..5c3fd76 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -63,8 +63,10 @@ #include #ifdef Q_OS_SYMBIAN +# include # include # include "qeventdispatcher_symbian_p.h" +# include "private/qcore_symbian_p.h" #elif defined(Q_OS_UNIX) # if !defined(QT_NO_GLIB) # include "qeventdispatcher_glib_p.h" @@ -88,6 +90,21 @@ QT_BEGIN_NAMESPACE +class QLockedMutexUnlocker +{ +public: + inline explicit QLockedMutexUnlocker(QMutex *m) + : mtx(m) + { } + inline ~QLockedMutexUnlocker() { unlock(); } + inline void unlock() { if (mtx) mtx->unlock(); mtx = 0; } + +private: + Q_DISABLE_COPY(QLockedMutexUnlocker) + + QMutex *mtx; +}; + #if defined(Q_WS_WIN) || defined(Q_WS_MAC) extern QString qAppFileName(); #endif @@ -159,7 +176,14 @@ void qRemovePostRoutine(QtCleanUpFunction p) void Q_CORE_EXPORT qt_call_post_routines() { - QVFuncList *list = postRList(); + QVFuncList *list = 0; + QT_TRY { + list = postRList(); + } QT_CATCH(const std::bad_alloc &) { + // ignore - if we can't allocate a post routine list, + // there's a high probability that there's no post + // routine to be executed :) + } if (!list) return; while (!list->isEmpty()) @@ -248,24 +272,26 @@ QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv) QCoreApplicationPrivate::~QCoreApplicationPrivate() { + if (threadData) { #ifndef QT_NO_THREAD - void *data = &threadData->tls; - QThreadStorageData::finish((void **)data); + void *data = &threadData->tls; + QThreadStorageData::finish((void **)data); #endif - // need to clear the state of the mainData, just in case a new QCoreApplication comes along. - QMutexLocker locker(&threadData->postEventList.mutex); - for (int i = 0; i < threadData->postEventList.size(); ++i) { - const QPostEvent &pe = threadData->postEventList.at(i); - if (pe.event) { - --pe.receiver->d_func()->postedEvents; - pe.event->posted = false; - delete pe.event; + // need to clear the state of the mainData, just in case a new QCoreApplication comes along. + QMutexLocker locker(&threadData->postEventList.mutex); + for (int i = 0; i < threadData->postEventList.size(); ++i) { + const QPostEvent &pe = threadData->postEventList.at(i); + if (pe.event) { + --pe.receiver->d_func()->postedEvents; + pe.event->posted = false; + delete pe.event; + } } + threadData->postEventList.clear(); + threadData->postEventList.recursion = 0; + threadData->quitNow = false; } - threadData->postEventList.clear(); - threadData->postEventList.recursion = 0; - threadData->quitNow = false; } void QCoreApplicationPrivate::createEventDispatcher() @@ -544,7 +570,14 @@ QCoreApplication::~QCoreApplication() #if !defined(QT_NO_THREAD) #if !defined(QT_NO_CONCURRENT) // Synchronize and stop the global thread pool threads. - QThreadPool::globalInstance()->waitForDone(); + QThreadPool *globalThreadPool = 0; + QT_TRY { + globalThreadPool = QThreadPool::globalInstance(); + } QT_CATCH (...) { + // swallow the exception, since destructors shouldn't throw + } + if (globalThreadPool) + globalThreadPool->waitForDone(); #endif QThread::cleanup(); #endif @@ -626,26 +659,13 @@ bool QCoreApplication::notifyInternal(QObject *receiver, QEvent *event) d->inEventHandler = true; #endif -#if defined(Q_OS_SYMBIAN) -// __UHEAP_MARK; - TInt error; - bool returnValue = false; - TRAP(error, returnValue = notify(receiver, event)); - if (error != KErrNone) { - qWarning(QString("Symbian OS error: %1").arg(error).toAscii().constData()); - } -// __UHEAP_MARKEND; -#elif defined(QT_NO_EXCEPTIONS) - bool returnValue = notify(receiver, event); -#else bool returnValue; - try { + QT_TRY { returnValue = notify(receiver, event); - } catch(...) { + } QT_CATCH (...) { --threadData->loopLevel; - throw; + QT_RETHROW; } -#endif #ifdef QT_JAMBI_BUILD // Restore the previous state if the object was not deleted.. @@ -1066,15 +1086,14 @@ void QCoreApplication::postEvent(QObject *receiver, QEvent *event, int priority) data->postEventList.mutex.lock(); } + QLockedMutexUnlocker locker(&data->postEventList.mutex); + // if this is one of the compressible events, do compression if (receiver->d_func()->postedEvents && self && self->compressEvent(event, receiver, &data->postEventList)) { - data->postEventList.mutex.unlock(); return; } - event->posted = true; - ++receiver->d_func()->postedEvents; if (event->type() == QEvent::DeferredDelete && data == QThreadData::current()) { // remember the current running eventloop for DeferredDelete // events posted in the receiver's thread @@ -1095,8 +1114,10 @@ void QCoreApplication::postEvent(QObject *receiver, QEvent *event, int priority) QPostEventList::iterator at = qUpperBound(begin, end, priority); data->postEventList.insert(at, QPostEvent(receiver, event, priority)); } + event->posted = true; + ++receiver->d_func()->postedEvents; data->canWait = false; - data->postEventList.mutex.unlock(); + locker.unlock(); if (data->eventDispatcher) data->eventDispatcher->wakeUp(); diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h index 65733ac..095d501 100644 --- a/src/corelib/kernel/qcoreapplication.h +++ b/src/corelib/kernel/qcoreapplication.h @@ -195,6 +195,8 @@ private: void init(); static QCoreApplication *self; + + Q_DISABLE_COPY(QCoreApplication) friend class QEventDispatcherUNIXPrivate; friend class QApplication; diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp index c5d91c2..423fbaa 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian.cpp +++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp @@ -193,7 +193,7 @@ void QWakeUpActiveObject::RunL() { iStatus = KRequestPending; SetActive(); - m_dispatcher->wakeUpWasCalled(); + QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(m_dispatcher->wakeUpWasCalled()); } QTimerActiveObject::QTimerActiveObject(QEventDispatcherSymbian *dispatcher, SymbianTimerInfo *timerInfo) @@ -222,9 +222,15 @@ void QTimerActiveObject::DoCancel() void QTimerActiveObject::RunL() { - if (!okToRun()) - return; + int error; + QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(error, Run()); + if (error < 0) { + CActiveScheduler::Current()->Error(error); // stop and report here, as this timer will be deleted on scope exit + } +} +void QTimerActiveObject::Run() +{ if (m_timerInfo->interval > 0) { // Start a new timer immediately so that we don't lose time. iStatus = KRequestPending; @@ -240,7 +246,7 @@ void QTimerActiveObject::RunL() SymbianTimerInfoPtr timerInfoPtr(m_timerInfo); m_timerInfo->dispatcher->timerFired(m_timerInfo->timerId); - + iStatus = KRequestPending; SetActive(); TRequestStatus *status = &iStatus; @@ -304,7 +310,7 @@ void QCompleteDeferredAOs::RunL() iStatus = KRequestPending; SetActive(); - m_dispatcher->reactivateDeferredActiveObjects(); + QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(m_dispatcher->reactivateDeferredActiveObjects()); } QSelectThread::QSelectThread() @@ -577,7 +583,7 @@ void QSocketActiveObject::RunL() if (!okToRun()) return; - m_dispatcher->socketFired(this); + QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(m_dispatcher->socketFired(this)); } void QSocketActiveObject::deleteLater() @@ -633,101 +639,108 @@ void QEventDispatcherSymbian::closingDown() bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags flags ) { - Q_D(QAbstractEventDispatcher); + bool handledAnyEvent = false; + QT_TRY { + Q_D(QAbstractEventDispatcher); + // It is safe if this counter overflows. The main importance is that each // iteration count is different from the last. m_iterationCount++; - RThread &thread = d->threadData->symbian_thread_handle; - - bool block; - if (flags & QEventLoop::WaitForMoreEvents) { - block = true; - emit aboutToBlock(); - } else { - block = false; - } - - bool handledAnyEvent = false; - - bool oldNoSocketEventsValue = m_noSocketEvents; - if (flags & QEventLoop::ExcludeSocketNotifiers) { - m_noSocketEvents = true; - } else { - m_noSocketEvents = false; - handledAnyEvent = sendDeferredSocketEvents(); - } - - bool handledSymbianEvent = false; - m_interrupt = false; - - /* - * This QTime variable is used to measure the time it takes to finish - * the event loop. If we take too long in the loop, other processes - * may be starved and killed. After the first event has completed, we - * take the current time, and if the remaining events take longer than - * a preset time, we temporarily lower the priority to force a context - * switch. For applications that do not take unecessarily long in the - * event loop, the priority will not be altered. - */ - QTime time; - enum { - FirstRun, - SubsequentRun, - TimeStarted - } timeState = FirstRun; - - TProcessPriority priority; - - while (1) { - if (block) { - // This is where Qt will spend most of its time. - CActiveScheduler::Current()->WaitForAnyRequest(); + RThread &thread = d->threadData->symbian_thread_handle; + + bool block; + if (flags & QEventLoop::WaitForMoreEvents) { + block = true; + emit aboutToBlock(); } else { - if (thread.RequestCount() == 0) { - break; - } - // This one should return without delay. - CActiveScheduler::Current()->WaitForAnyRequest(); - } - - if (timeState == SubsequentRun) { - time.start(); - timeState = TimeStarted; - } - - TInt error; - handledSymbianEvent = CActiveScheduler::RunIfReady(error, CActive::EPriorityIdle); - if (error) { - qWarning("CActiveScheduler::RunIfReady() returned error: %i\n", error); - CActiveScheduler::Current()->Error(error); + block = false; } - if (!handledSymbianEvent) { - qFatal("QEventDispatcherSymbian::processEvents(): Caught Symbian stray signal"); - } - handledAnyEvent = true; - if (m_interrupt) { - break; + + bool oldNoSocketEventsValue = m_noSocketEvents; + if (flags & QEventLoop::ExcludeSocketNotifiers) { + m_noSocketEvents = true; + } else { + m_noSocketEvents = false; + handledAnyEvent = sendDeferredSocketEvents(); } - block = false; + + bool handledSymbianEvent = false; + m_interrupt = false; + + /* + * This QTime variable is used to measure the time it takes to finish + * the event loop. If we take too long in the loop, other processes + * may be starved and killed. After the first event has completed, we + * take the current time, and if the remaining events take longer than + * a preset time, we temporarily lower the priority to force a context + * switch. For applications that do not take unecessarily long in the + * event loop, the priority will not be altered. + */ + QTime time; + enum { + FirstRun, + SubsequentRun, + TimeStarted + } timeState = FirstRun; + + TProcessPriority priority; + + while (1) { + if (block) { + // This is where Qt will spend most of its time. + CActiveScheduler::Current()->WaitForAnyRequest(); + } else { + if (thread.RequestCount() == 0) { + break; + } + // This one should return without delay. + CActiveScheduler::Current()->WaitForAnyRequest(); + } + + if (timeState == SubsequentRun) { + time.start(); + timeState = TimeStarted; + } + + TInt error; + handledSymbianEvent = CActiveScheduler::RunIfReady(error, CActive::EPriorityIdle); + if (error) { + qWarning("CActiveScheduler::RunIfReady() returned error: %i\n", error); + CActiveScheduler::Current()->Error(error); + } + + if (!handledSymbianEvent) { + qFatal("QEventDispatcherSymbian::processEvents(): Caught Symbian stray signal"); + } + handledAnyEvent = true; + if (m_interrupt) { + break; + } + block = false; if (timeState == TimeStarted && time.elapsed() > 100) { - priority = m_processHandle.Priority(); - m_processHandle.SetPriority(EPriorityLow); - time.start(); - // Slight chance of race condition in the next lines, but nothing fatal - // will happen, just wrong priority. - if (m_processHandle.Priority() == EPriorityLow) { - m_processHandle.SetPriority(priority); + priority = m_processHandle.Priority(); + m_processHandle.SetPriority(EPriorityLow); + time.start(); + // Slight chance of race condition in the next lines, but nothing fatal + // will happen, just wrong priority. + if (m_processHandle.Priority() == EPriorityLow) { + m_processHandle.SetPriority(priority); + } } - } - if (timeState == FirstRun) - timeState = SubsequentRun; - }; - - emit awake(); - - m_noSocketEvents = oldNoSocketEventsValue; + if (timeState == FirstRun) + timeState = SubsequentRun; + }; + + emit awake(); + + m_noSocketEvents = oldNoSocketEventsValue; + } QT_CATCH (const std::exception& ex) { +#ifndef QT_NO_EXCEPTIONS + CActiveScheduler::Current()->Error(qt_translateExceptionToSymbianError(ex)); +#endif + } return handledAnyEvent; } diff --git a/src/corelib/kernel/qeventdispatcher_symbian_p.h b/src/corelib/kernel/qeventdispatcher_symbian_p.h index 64ea282..3593055 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian_p.h +++ b/src/corelib/kernel/qeventdispatcher_symbian_p.h @@ -136,6 +136,9 @@ public: protected: void DoCancel(); void RunL(); + +private: + void Run(); private: SymbianTimerInfo *m_timerInfo; diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp index f7293d4..ea8299c 100644 --- a/src/corelib/kernel/qeventdispatcher_unix.cpp +++ b/src/corelib/kernel/qeventdispatcher_unix.cpp @@ -184,7 +184,7 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags, continue; for (int i = 0; i < list.size(); ++i) { - QSockNot *sn = list.at(i); + QSockNot *sn = list[i]; FD_ZERO(&fdset); FD_SET(sn->fd, &fdset); @@ -241,7 +241,7 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags, for (int i=0; i<3; i++) { QSockNotType::List &list = sn_vec[i].list; for (int j = 0; j < list.size(); ++j) { - QSockNot *sn = list.at(j); + QSockNot *sn = list[j]; if (FD_ISSET(sn->fd, &sn_vec[i].select_fds)) q->setSocketNotifierPending(sn->obj); } @@ -599,7 +599,10 @@ QEventDispatcherUNIX::QEventDispatcherUNIX(QEventDispatcherUNIXPrivate &dd, QObj { } QEventDispatcherUNIX::~QEventDispatcherUNIX() -{ } +{ + Q_D(QEventDispatcherUNIX); + d->threadData->eventDispatcher = 0; +} int QEventDispatcherUNIX::select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, timeval *timeout) @@ -706,8 +709,8 @@ QSockNotType::QSockNotType() QSockNotType::~QSockNotType() { - while (!list.isEmpty()) - delete list.takeFirst(); + for (int i = 0; i < list.size(); ++i) + delete list[i]; } /***************************************************************************** @@ -743,7 +746,7 @@ void QEventDispatcherUNIX::registerSocketNotifier(QSocketNotifier *notifier) int i; for (i = 0; i < list.size(); ++i) { - QSockNot *p = list.at(i); + QSockNot *p = list[i]; if (p->fd < sockfd) break; if (p->fd == sockfd) { @@ -781,7 +784,7 @@ void QEventDispatcherUNIX::unregisterSocketNotifier(QSocketNotifier *notifier) QSockNot *sn = 0; int i; for (i = 0; i < list.size(); ++i) { - sn = list.at(i); + sn = list[i]; if(sn->obj == notifier && sn->fd == sockfd) break; } @@ -799,7 +802,7 @@ void QEventDispatcherUNIX::unregisterSocketNotifier(QSocketNotifier *notifier) for (int i=0; i<3; i++) { if (!d->sn_vec[i].list.isEmpty()) d->sn_highest = qMax(d->sn_highest, // list is fd-sorted - d->sn_vec[i].list.first()->fd); + d->sn_vec[i].list[0]->fd); } } } @@ -823,7 +826,7 @@ void QEventDispatcherUNIX::setSocketNotifierPending(QSocketNotifier *notifier) QSockNot *sn = 0; int i; for (i = 0; i < list.size(); ++i) { - sn = list.at(i); + sn = list[i]; if(sn->obj == notifier && sn->fd == sockfd) break; } diff --git a/src/corelib/kernel/qeventdispatcher_unix_p.h b/src/corelib/kernel/qeventdispatcher_unix_p.h index 41329cf..816add5 100644 --- a/src/corelib/kernel/qeventdispatcher_unix_p.h +++ b/src/corelib/kernel/qeventdispatcher_unix_p.h @@ -57,6 +57,7 @@ #include "QtCore/qlist.h" #include "private/qabstracteventdispatcher_p.h" #include "private/qpodlist_p.h" +#include "QtCore/qvarlengtharray.h" #include #include diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 860180e..ac505e1 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -392,7 +392,9 @@ void QMetaObject::removeGuard(QObject **ptr) if (!*ptr) return; GuardHash *hash = guardHash(); - if (!hash) + /* check that the hash is empty - otherwise we might detach + the shared_null hash, which will alloc, which is not nice */ + if (!hash || hash->isEmpty()) return; QMutexLocker locker(guardHashLock()); GuardHash::iterator it = hash->find(*ptr); @@ -434,9 +436,19 @@ void QMetaObject::changeGuard(QObject **ptr, QObject *o) */ void QObjectPrivate::clearGuards(QObject *object) { - GuardHash *hash = guardHash(); - if (hash) { - QMutexLocker locker(guardHashLock()); + GuardHash *hash = 0; + QMutex *mutex = 0; + QT_TRY { + hash = guardHash(); + mutex = guardHashLock(); + } QT_CATCH(const std::bad_alloc &) { + // do nothing in case of OOM - code below is safe + } + + /* check that the hash is empty - otherwise we might detach + the shared_null hash, which will alloc, which is not nice */ + if (hash && !hash->isEmpty()) { + QMutexLocker locker(mutex); GuardHash::iterator it = hash->find(object); const GuardHash::iterator end = hash->end(); while (it.key() == object && it != end) { @@ -754,7 +766,14 @@ QObject::~QObject() QObjectPrivate::clearGuards(this); } - emit destroyed(this); + QT_TRY { + emit destroyed(this); + } QT_CATCH(...) { + // all the signal/slots connections are still in place - if we don't + // quit now, we will crash pretty soon. + qWarning("Detected an unexpected exception in ~QObject while emitting destroyed()."); + QT_RETHROW; + } { QMutexLocker locker(&d->threadData->mutex); @@ -853,9 +872,6 @@ QObject::~QObject() objectName().isNull() ? "unnamed" : qPrintable(objectName())); } #endif - - delete d; - d_ptr = 0; } @@ -1098,11 +1114,11 @@ bool QObject::event(QEvent *e) #if defined(QT_NO_EXCEPTIONS) mce->placeMetaCall(this); #else - try { + QT_TRY { mce->placeMetaCall(this); - } catch (...) { + } QT_CATCH(...) { QObjectPrivate::resetCurrentSender(this, ¤tSender, previousSender); - throw; + QT_RETHROW; } #endif QObjectPrivate::resetCurrentSender(this, ¤tSender, previousSender); @@ -3102,9 +3118,9 @@ void QMetaObject::activate(QObject *sender, int from_signal_index, int to_signal #if defined(QT_NO_EXCEPTIONS) receiver->qt_metacall(QMetaObject::InvokeMetaMethod, method, argv ? argv : empty_argv); #else - try { + QT_TRY { receiver->qt_metacall(QMetaObject::InvokeMetaMethod, method, argv ? argv : empty_argv); - } catch (...) { + } QT_CATCH(...) { locker.relock(); QObjectPrivate::resetCurrentSender(receiver, ¤tSender, previousSender); @@ -3113,7 +3129,7 @@ void QMetaObject::activate(QObject *sender, int from_signal_index, int to_signal Q_ASSERT(connectionLists->inUse >= 0); if (connectionLists->orphaned && !connectionLists->inUse) delete connectionLists; - throw; + QT_RETHROW; } #endif diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index dbec0a6..8d5c4e3 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -51,6 +51,7 @@ #ifdef QT_INCLUDE_COMPAT #include #endif +#include QT_BEGIN_HEADER @@ -286,7 +287,7 @@ protected: QObject(QObjectPrivate &dd, QObject *parent = 0); protected: - QObjectData *d_ptr; + QScopedPointer d_ptr; static const QMetaObject staticQtMetaObject; diff --git a/src/corelib/kernel/qsharedmemory_symbian.cpp b/src/corelib/kernel/qsharedmemory_symbian.cpp index b3b50e3..d05f9f3 100644 --- a/src/corelib/kernel/qsharedmemory_symbian.cpp +++ b/src/corelib/kernel/qsharedmemory_symbian.cpp @@ -116,11 +116,9 @@ bool QSharedMemoryPrivate::create(int size) return false; } - HBufC* buffer = qt_QString2HBufCNewL(safeKey); + TPtrC ptr(qt_QString2TPtrC(safeKey)); - TInt err = chunk.CreateGlobal(*buffer, size, size); - - delete buffer; + TInt err = chunk.CreateGlobal(ptr, size, size); setErrorString(function, err); @@ -147,15 +145,11 @@ bool QSharedMemoryPrivate::attach(QSharedMemory::AccessMode mode) return false; } - HBufC* buffer = qt_QString2HBufCNewL(safeKey); + TPtrC ptr(qt_QString2TPtrC(safeKey)); TInt err = KErrNoMemory; - if (buffer) { - err = chunk.OpenGlobal(*buffer, false); - } - - delete buffer; + err = chunk.OpenGlobal(ptr, false); if (err != KErrNone) { setErrorString(function, err); diff --git a/src/corelib/kernel/qsystemsemaphore.cpp b/src/corelib/kernel/qsystemsemaphore.cpp index 7e09a6e..fb9385a 100644 --- a/src/corelib/kernel/qsystemsemaphore.cpp +++ b/src/corelib/kernel/qsystemsemaphore.cpp @@ -170,8 +170,8 @@ QT_BEGIN_NAMESPACE \sa acquire(), key() */ QSystemSemaphore::QSystemSemaphore(const QString &key, int initialValue, AccessMode mode) + : d(new QSystemSemaphorePrivate) { - d = new QSystemSemaphorePrivate; setKey(key, initialValue, mode); } @@ -193,7 +193,6 @@ QSystemSemaphore::QSystemSemaphore(const QString &key, int initialValue, AccessM QSystemSemaphore::~QSystemSemaphore() { d->cleanHandle(); - delete d; } /*! diff --git a/src/corelib/kernel/qsystemsemaphore.h b/src/corelib/kernel/qsystemsemaphore.h index 5a02072..3cafebf 100644 --- a/src/corelib/kernel/qsystemsemaphore.h +++ b/src/corelib/kernel/qsystemsemaphore.h @@ -43,6 +43,7 @@ #define QSYSTEMSEMAPHORE_H #include +#include QT_BEGIN_HEADER @@ -89,7 +90,7 @@ public: private: Q_DISABLE_COPY(QSystemSemaphore) - QSystemSemaphorePrivate *d; + QScopedPointer d; }; #endif // QT_NO_SYSTEMSEMAPHORE diff --git a/src/corelib/kernel/qsystemsemaphore_symbian.cpp b/src/corelib/kernel/qsystemsemaphore_symbian.cpp index cd5c3ff..8179046 100644 --- a/src/corelib/kernel/qsystemsemaphore_symbian.cpp +++ b/src/corelib/kernel/qsystemsemaphore_symbian.cpp @@ -90,13 +90,12 @@ int QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode) if (key.isEmpty()) return 0; QString safeName = makeKeyFileName(); - HBufC* name = qt_QString2HBufCNewL(safeName); + TPtrC name(qt_QString2TPtrC(safeName)); int err; - err = semaphore.OpenGlobal(*name,EOwnerProcess); + err = semaphore.OpenGlobal(name,EOwnerProcess); if (err == KErrNotFound){ - err = semaphore.CreateGlobal(*name,initialValue, EOwnerProcess); + err = semaphore.CreateGlobal(name,initialValue, EOwnerProcess); } - delete name; if (err){ setErrorString(QLatin1String("QSystemSemaphore::handle"),err); return 0; diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index 420dd1d..0ca0169 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -611,10 +611,10 @@ bool QLibraryPrivate::isPlugin(QSettings *settings) .arg(fileName); QStringList reg; #ifndef QT_NO_SETTINGS - bool madeSettings = false; + QScopedPointer madeSettings; if (!settings) { settings = new QSettings(QSettings::UserScope, QLatin1String("Trolltech")); - madeSettings = true; + madeSettings.reset(settings); } reg = settings->value(regkey).toStringList(); #endif @@ -708,8 +708,7 @@ bool QLibraryPrivate::isPlugin(QSettings *settings) #endif } #ifndef QT_NO_SETTINGS - if (madeSettings) - delete settings; + madeSettings.reset(); #endif if (!success) { diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp index cb44a25..f1bdc64 100644 --- a/src/corelib/thread/qthread.cpp +++ b/src/corelib/thread/qthread.cpp @@ -163,9 +163,9 @@ QAdoptedThread::~QAdoptedThread() QThread *QAdoptedThread::createThreadForAdoption() { - QThread *t = new QAdoptedThread(0); - t->moveToThread(t); - return t; + QScopedPointer t(new QAdoptedThread(0)); + t->moveToThread(t.data()); + return t.take(); } void QAdoptedThread::run() @@ -483,10 +483,10 @@ uint QThread::stackSize() const int QThread::exec() { Q_D(QThread); - d->mutex.lock(); + QMutexLocker locker(&d->mutex); d->data->quitNow = false; QEventLoop eventLoop; - d->mutex.unlock(); + locker.unlock(); int returnCode = eventLoop.exec(); return returnCode; } @@ -734,8 +734,9 @@ QThreadData* QThreadData::current() { static QThreadData *data = 0; // reinterpret_cast(pthread_getspecific(current_thread_data_key)); if (!data) { - data = new QThreadData; - data->thread = new QAdoptedThread(data); + QScopedPointer newdata(new QThreadData); + newdata->thread = new QAdoptedThread(newdata.data()); + data = newdata.take(); data->deref(); } return data; diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index 567c936..d2a824a 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -124,7 +124,14 @@ QThreadData *QThreadData::current() } else { data = new QThreadData; pthread_setspecific(current_thread_data_key, data); - data->thread = new QAdoptedThread(data); + QT_TRY { + data->thread = new QAdoptedThread(data); + } QT_CATCH(...) { + pthread_setspecific(current_thread_data_key, 0); + data->deref(); + data = 0; + QT_RETHROW; + } data->deref(); } if (!QCoreApplicationPrivate::theMainThread) diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp index 7094e3d..76e551e 100644 --- a/src/corelib/thread/qthread_win.cpp +++ b/src/corelib/thread/qthread_win.cpp @@ -112,7 +112,14 @@ QThreadData *QThreadData::current() // This needs to be called prior to new AdoptedThread() to // avoid recursion. TlsSetValue(qt_current_thread_data_tls_index, threadData); - threadData->thread = new QAdoptedThread(threadData); + QT_TRY { + threadData->thread = new QAdoptedThread(threadData); + } QT_CATCH(...) { + TlsSetValue(qt_current_thread_data_tls_index, 0); + threadData->deref(); + threadData = 0; + QT_RETHROW; + } threadData->deref(); } diff --git a/src/corelib/thread/qthreadstorage.cpp b/src/corelib/thread/qthreadstorage.cpp index 35c55c1..4657009 100644 --- a/src/corelib/thread/qthreadstorage.cpp +++ b/src/corelib/thread/qthreadstorage.cpp @@ -101,12 +101,14 @@ void **QThreadStorageData::get() const qWarning("QThreadStorage::get: QThreadStorage can only be used with threads started with QThread"); return 0; } - QMap::iterator it = data->tls.find(id); + QMap::const_iterator it = data->tls.constFind(id); DEBUG_MSG("QThreadStorageData: Returning storage %d, data %p, for thread %p", id, it != data->tls.end() ? it.value() : 0, data->thread); - return it != data->tls.end() && it.value() != 0 ? &it.value() : 0; + // const_cast below is a bit evil - but we have to make sure not to detach here + // otherwise we'll go bonkers in oom situations + return it != data->tls.constEnd() && it.value() != 0 ? const_cast(&it.value()) : 0; } void **QThreadStorageData::set(void *p) @@ -129,9 +131,9 @@ void **QThreadStorageData::set(void *p) void *q = it.value(); it.value() = 0; - mutex()->lock(); + QMutexLocker locker(mutex()); void (*destructor)(void *) = destructors()->value(id); - mutex()->unlock(); + locker.unlock(); destructor(q); } @@ -167,9 +169,9 @@ void QThreadStorageData::finish(void **p) continue; } - mutex()->lock(); + QMutexLocker locker(mutex()); void (*destructor)(void *) = destructors()->value(id); - mutex()->unlock(); + locker.unlock(); if (!destructor) { if (QThread::currentThread()) diff --git a/src/corelib/tools/qbitarray.cpp b/src/corelib/tools/qbitarray.cpp index a947ab5..7168a9a 100644 --- a/src/corelib/tools/qbitarray.cpp +++ b/src/corelib/tools/qbitarray.cpp @@ -209,6 +209,8 @@ void QBitArray::resize(int size) uchar* c = reinterpret_cast(d.data()); if (size > (s << 3)) memset(c + s, 0, d.size() - s); + else if ( size % 8) + *(c+1+size/8) &= (1 << (size%8)) - 1; *c = d.size()*8 - size; } } diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index 6aa35f3..ae6561f 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -1233,14 +1233,11 @@ QByteArray::QByteArray(const char *str) } else { int len = qstrlen(str); d = static_cast(qMalloc(sizeof(Data)+len)); - if (!d) { - d = &shared_null; - } else { - d->ref = 0;; - d->alloc = d->size = len; - d->data = d->array; - memcpy(d->array, str, len+1); // include null terminator - } + Q_CHECK_PTR(d); + d->ref = 0;; + d->alloc = d->size = len; + d->data = d->array; + memcpy(d->array, str, len+1); // include null terminator } d->ref.ref(); } @@ -1264,15 +1261,12 @@ QByteArray::QByteArray(const char *data, int size) d = &shared_empty; } else { d = static_cast(qMalloc(sizeof(Data) + size)); - if (!d) { - d = &shared_null; - } else { - d->ref = 0; - d->alloc = d->size = size; - d->data = d->array; - memcpy(d->array, data, size); - d->array[size] = '\0'; - } + Q_CHECK_PTR(d); + d->ref = 0; + d->alloc = d->size = size; + d->data = d->array; + memcpy(d->array, data, size); + d->array[size] = '\0'; } d->ref.ref(); } @@ -1290,15 +1284,12 @@ QByteArray::QByteArray(int size, char ch) d = &shared_null; } else { d = static_cast(qMalloc(sizeof(Data)+size)); - if (!d) { - d = &shared_null; - } else { - d->ref = 0; - d->alloc = d->size = size; - d->data = d->array; - d->array[size] = '\0'; - memset(d->array, ch, size); - } + Q_CHECK_PTR(d); + d->ref = 0; + d->alloc = d->size = size; + d->data = d->array; + d->array[size] = '\0'; + memset(d->array, ch, size); } d->ref.ref(); } @@ -1334,8 +1325,7 @@ void QByteArray::resize(int size) // QByteArray a(sz); // Data *x = static_cast(qMalloc(sizeof(Data)+size)); - if (!x) - return; + Q_CHECK_PTR(x); x->ref = 1; x->alloc = x->size = size; x->data = x->array; @@ -1377,8 +1367,7 @@ void QByteArray::realloc(int alloc) { if (d->ref != 1 || d->data != d->array) { Data *x = static_cast(qMalloc(sizeof(Data) + alloc)); - if (!x) - return; + Q_CHECK_PTR(x); x->size = qMin(alloc, d->size); ::memcpy(x->array, d->data, x->size); x->array[x->size] = '\0'; @@ -1390,8 +1379,7 @@ void QByteArray::realloc(int alloc) d = x; } else { Data *x = static_cast(qRealloc(d, sizeof(Data) + alloc)); - if (!x) - return; + Q_CHECK_PTR(x); x->alloc = alloc; x->data = x->array; d = x; @@ -1812,11 +1800,13 @@ QByteArray &QByteArray::replace(const char *before, int bsize, const char *after const char *b = before; if (after >= d->data && after < d->data + d->size) { char *copy = (char *)malloc(asize); + Q_CHECK_PTR(copy); memcpy(copy, after, asize); a = copy; } if (before >= d->data && before < d->data + d->size) { char *copy = (char *)malloc(bsize); + Q_CHECK_PTR(copy); memcpy(copy, before, bsize); b = copy; } @@ -3738,6 +3728,7 @@ QByteArray QByteArray::number(double n, char f, int prec) QByteArray QByteArray::fromRawData(const char *data, int size) { Data *x = static_cast(qMalloc(sizeof(Data))); + Q_CHECK_PTR(x); if (data) { x->data = const_cast(data); } else { diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 781514c..b43891c 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -2200,8 +2200,8 @@ int QTime::elapsed() const \sa isValid() */ QDateTime::QDateTime() + : d(new QDateTimePrivate) { - d = new QDateTimePrivate; } @@ -2211,8 +2211,8 @@ QDateTime::QDateTime() */ QDateTime::QDateTime(const QDate &date) + : d(new QDateTimePrivate) { - d = new QDateTimePrivate; d->date = date; d->time = QTime(0, 0, 0); } @@ -2225,8 +2225,8 @@ QDateTime::QDateTime(const QDate &date) */ QDateTime::QDateTime(const QDate &date, const QTime &time, Qt::TimeSpec spec) + : d(new QDateTimePrivate) { - d = new QDateTimePrivate; d->date = date; d->time = date.isValid() && !time.isValid() ? QTime(0, 0, 0) : time; d->spec = (spec == Qt::UTC) ? QDateTimePrivate::UTC : QDateTimePrivate::LocalUnknown; @@ -2237,8 +2237,8 @@ QDateTime::QDateTime(const QDate &date, const QTime &time, Qt::TimeSpec spec) */ QDateTime::QDateTime(const QDateTime &other) + : d(other.d.data()) { - d = other.d; d->ref.ref(); } @@ -2247,8 +2247,6 @@ QDateTime::QDateTime(const QDateTime &other) */ QDateTime::~QDateTime() { - if (!d->ref.deref()) - delete d; } /*! @@ -2258,7 +2256,7 @@ QDateTime::~QDateTime() QDateTime &QDateTime::operator=(const QDateTime &other) { - qAtomicAssign(d, other.d); + d.assign(other.d.data()); return *this; } @@ -3298,7 +3296,7 @@ QDateTime QDateTime::fromString(const QString &string, const QString &format) */ void QDateTime::detach() { - qAtomicDetach(d); + d.detach(); } /***************************************************************************** diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h index 3278297..cf4246d 100644 --- a/src/corelib/tools/qdatetime.h +++ b/src/corelib/tools/qdatetime.h @@ -44,6 +44,7 @@ #include #include +#include QT_BEGIN_HEADER @@ -284,7 +285,7 @@ public: private: friend class QDateTimePrivate; void detach(); - QDateTimePrivate *d; + QScopedSharedPointer d; #ifndef QT_NO_DATASTREAM friend Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QDateTime &); diff --git a/src/corelib/tools/qharfbuzz.cpp b/src/corelib/tools/qharfbuzz.cpp index 1940209..923eda4 100644 --- a/src/corelib/tools/qharfbuzz.cpp +++ b/src/corelib/tools/qharfbuzz.cpp @@ -126,6 +126,7 @@ char *HB_TextCodec_ConvertFromUnicode(void *codec, const HB_UChar16 *unicode, hb QByteArray data = reinterpret_cast(codec)->fromUnicode((const QChar *)unicode, length); // ### suboptimal char *output = (char *)malloc(data.length() + 1); + Q_CHECK_PTR(output); memcpy(output, data.constData(), data.length() + 1); if (outputLength) *outputLength = data.length(); diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp index 2313e0e..a703621 100644 --- a/src/corelib/tools/qhash.cpp +++ b/src/corelib/tools/qhash.cpp @@ -171,7 +171,9 @@ QHashData QHashData::shared_null = { void *QHashData::allocateNode() { - return qMalloc(nodeSize); + void *ptr = qMalloc(nodeSize); + Q_CHECK_PTR(ptr); + return ptr; } void QHashData::freeNode(void *node) @@ -181,6 +183,13 @@ void QHashData::freeNode(void *node) QHashData *QHashData::detach_helper(void (*node_duplicate)(Node *, void *), int nodeSize) { + return detach_helper( node_duplicate, 0, nodeSize ); +} + +QHashData *QHashData::detach_helper(void (*node_duplicate)(Node *, void *), + void (*node_delete)(Node *), + int nodeSize) +{ union { QHashData *d; Node *e; @@ -197,18 +206,43 @@ QHashData *QHashData::detach_helper(void (*node_duplicate)(Node *, void *), int d->sharable = true; if (numBuckets) { - d->buckets = new Node *[numBuckets]; + QT_TRY { + d->buckets = new Node *[numBuckets]; + } QT_CATCH(...) { + // restore a consistent state for d + d->numBuckets = 0; + // roll back + d->free_helper(node_delete); + QT_RETHROW; + } + Node *this_e = reinterpret_cast(this); for (int i = 0; i < numBuckets; ++i) { Node **nextNode = &d->buckets[i]; Node *oldNode = buckets[i]; while (oldNode != this_e) { - Node *dup = static_cast(allocateNode()); - node_duplicate(oldNode, dup); - dup->h = oldNode->h; - *nextNode = dup; - nextNode = &dup->next; - oldNode = oldNode->next; + QT_TRY { + Node *dup = static_cast(allocateNode()); + + QT_TRY { + node_duplicate(oldNode, dup); + } QT_CATCH(...) { + freeNode( dup ); + QT_RETHROW; + } + + dup->h = oldNode->h; + *nextNode = dup; + nextNode = &dup->next; + oldNode = oldNode->next; + } QT_CATCH(...) { + // restore a consistent state for d + *nextNode = e; + d->numBuckets = i+1; + // roll back + d->free_helper(node_delete); + QT_RETHROW; + } } *nextNode = e; } @@ -216,6 +250,26 @@ QHashData *QHashData::detach_helper(void (*node_duplicate)(Node *, void *), int return d; } +void QHashData::free_helper(void (*node_delete)(Node *)) +{ + if (node_delete) { + Node *this_e = reinterpret_cast(this); + Node **bucket = reinterpret_cast(this->buckets); + + int n = numBuckets; + while (n--) { + Node *cur = *bucket++; + while (cur != this_e) { + Node *next = cur->next; + node_delete(cur); + cur = next; + } + } + } + delete [] buckets; + delete this; +} + QHashData::Node *QHashData::nextNode(Node *node) { union { @@ -298,9 +352,10 @@ void QHashData::rehash(int hint) Node **oldBuckets = buckets; int oldNumBuckets = numBuckets; + int nb = primeForNumBits(hint); + buckets = new Node *[nb]; numBits = hint; - numBuckets = primeForNumBits(hint); - buckets = new Node *[numBuckets]; + numBuckets = nb; for (int i = 0; i < numBuckets; ++i) buckets[i] = e; @@ -327,8 +382,7 @@ void QHashData::rehash(int hint) void QHashData::destroyAndFree() { - delete [] buckets; - delete this; + free_helper(0); } #ifdef QT_QHASH_DEBUG diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index 41b4794..b3f82e9 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -129,12 +129,15 @@ struct Q_CORE_EXPORT QHashData void *allocateNode(); void freeNode(void *node); - QHashData *detach_helper(void (*node_duplicate)(Node *, void *), int nodeSize); + QHashData *detach_helper(void (*node_duplicate)(Node *, void *), int nodeSize); // ### Qt5 remove me + QHashData *detach_helper(void (*node_duplicate)(Node *, void *), void (*node_delete)(Node *), + int nodeSize); void mightGrow(); bool willGrow(); void hasShrunk(); void rehash(int hint); - void destroyAndFree(); + void free_helper(void (*node_delete)(Node *)); + void destroyAndFree(); // ### Qt5 remove me Node *firstNode(); #ifdef QT_QHASH_DEBUG void dump(); @@ -476,21 +479,30 @@ private: Node **findNode(const Key &key, uint *hp = 0) const; Node *createNode(uint h, const Key &key, const T &value, Node **nextNode); void deleteNode(Node *node); + static void deleteNode(QHashData::Node *node); static void duplicateNode(QHashData::Node *originalNode, void *newNode); }; + template Q_INLINE_TEMPLATE void QHash::deleteNode(Node *node) { + deleteNode(reinterpret_cast(node)); +} + + +template +Q_INLINE_TEMPLATE void QHash::deleteNode(QHashData::Node *node) +{ #ifdef Q_CC_BOR - node->~QHashNode(); + concrete(node)->~QHashNode(); #elif defined(QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION) - node->~QHashNode(); + concrete(node)->~QHashNode(); #else - node->~Node(); + concrete(node)->~Node(); #endif - d->freeNode(node); + qFree(node); } template @@ -538,18 +550,7 @@ Q_INLINE_TEMPLATE QHash &QHash::unite(const QHash &other template Q_OUTOFLINE_TEMPLATE void QHash::freeData(QHashData *x) { - Node *e_for_x = reinterpret_cast(x); - Node **bucket = reinterpret_cast(x->buckets); - int n = x->numBuckets; - while (n--) { - Node *cur = *bucket++; - while (cur != e_for_x) { - Node *next = cur->next; - deleteNode(cur); - cur = next; - } - } - x->destroyAndFree(); + x->free_helper(deleteNode); } template @@ -561,7 +562,7 @@ Q_INLINE_TEMPLATE void QHash::clear() template Q_OUTOFLINE_TEMPLATE void QHash::detach_helper() { - QHashData *x = d->detach_helper(duplicateNode, + QHashData *x = d->detach_helper(duplicateNode, deleteNode, QTypeInfo::isDummy ? sizeof(DummyNode) : sizeof(Node)); if (!d->ref.deref()) freeData(d); diff --git a/src/corelib/tools/qlinkedlist.h b/src/corelib/tools/qlinkedlist.h index 6a85386..79311bc 100644 --- a/src/corelib/tools/qlinkedlist.h +++ b/src/corelib/tools/qlinkedlist.h @@ -265,15 +265,22 @@ void QLinkedList::detach_helper() x.d->ref = 1; x.d->size = d->size; x.d->sharable = true; - Node *i = e->n, *j = x.e; - while (i != e) { - j->n = new Node(i->t); - j->n->p = j; - i = i->n; - j = j->n; + Node *original = e->n; + Node *copy = x.e; + while (original != e) { + QT_TRY { + copy->n = new Node(original->t); + copy->n->p = copy; + original = original->n; + copy = copy->n; + } QT_CATCH(...) { + copy->n = x.e; + free(x.d); + QT_RETHROW; + } } - j->n = x.e; - x.e->p = j; + copy->n = x.e; + x.e->p = copy; if (!d->ref.deref()) free(d); d = x.d; @@ -474,14 +481,21 @@ QLinkedList &QLinkedList::operator+=(const QLinkedList &l) detach(); int n = l.d->size; d->size += n; - Node *o = l.e->n; + Node *original = l.e->n; while (n--) { - Node *i = new Node(o->t); - o = o->n; - i->n = e; - i->p = e->p; - i->p->n = i; - e->p = i; + QT_TRY { + Node *copy = new Node(original->t); + original = original->n; + copy->n = e; + copy->p = e->p; + copy->p->n = copy; + e->p = copy; + } QT_CATCH(...) { + // restore the original list + while (n++size) + removeLast(); + QT_RETHROW; + } } return *this; } diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 3c21ec1..89e082b 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -117,6 +117,7 @@ public: inline int size() const { return p.size(); } inline void detach() { if (d->ref != 1) detach_helper(); } + inline void detachShared() { if (d->ref != 1 && d != &QListData::shared_null) detach_helper(); } inline bool isDetached() const { return d->ref == 1; } inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; } @@ -352,12 +353,27 @@ Q_INLINE_TEMPLATE void QList::node_destruct(Node *n) template Q_INLINE_TEMPLATE void QList::node_copy(Node *from, Node *to, Node *src) { - if (QTypeInfo::isLarge || QTypeInfo::isStatic) - while(from != to) - (from++)->v = new T(*reinterpret_cast((src++)->v)); - else if (QTypeInfo::isComplex) - while(from != to) - new (from++) T(*reinterpret_cast(src++)); + Node *current = from; + if (QTypeInfo::isLarge || QTypeInfo::isStatic) { + QT_TRY { + while(current != to) + (current++)->v = new T(*reinterpret_cast((src++)->v)); + } QT_CATCH(...) { + while (current != from) + delete reinterpret_cast(current--); + QT_RETHROW; + } + } + else if (QTypeInfo::isComplex) { + QT_TRY { + while(current != to) + new (current++) T(*reinterpret_cast(src++)); + } QT_CATCH(...) { + while (current != from) + (reinterpret_cast(current--))->~T(); + QT_RETHROW; + } + } } template @@ -384,8 +400,16 @@ Q_INLINE_TEMPLATE QList &QList::operator=(const QList &l) } template inline typename QList::iterator QList::insert(iterator before, const T &t) -{ Node *n = reinterpret_cast(p.insert(before.i-reinterpret_cast(p.begin()))); - node_construct(n,t); return n; } +{ + Node *n = reinterpret_cast(p.insert(before.i - reinterpret_cast(p.begin()))); + QT_TRY { + node_construct(n, t); + } QT_CATCH(...) { + p.remove(before.i - reinterpret_cast(p.begin())); + QT_RETHROW; + } + return n; +} template inline typename QList::iterator QList::erase(iterator it) { node_destruct(it.i); @@ -423,10 +447,22 @@ Q_OUTOFLINE_TEMPLATE void QList::append(const T &t) { detach(); if (QTypeInfo::isLarge || QTypeInfo::isStatic) { - node_construct(reinterpret_cast(p.append()), t); + Node *n = reinterpret_cast(p.append()); + QT_TRY { + node_construct(n, t); + } QT_CATCH(...) { + --d->end; + QT_RETHROW; + } } else { const T cpy(t); - node_construct(reinterpret_cast(p.append()), cpy); + Node *n = reinterpret_cast(p.append()); + QT_TRY { + node_construct(n, cpy); + } QT_CATCH(...) { + --d->end; + QT_RETHROW; + } } } @@ -435,10 +471,22 @@ inline void QList::prepend(const T &t) { detach(); if (QTypeInfo::isLarge || QTypeInfo::isStatic) { - node_construct(reinterpret_cast(p.prepend()), t); + Node *n = reinterpret_cast(p.prepend()); + QT_TRY { + node_construct(n, t); + } QT_CATCH(...) { + ++d->begin; + QT_RETHROW; + } } else { const T cpy(t); - node_construct(reinterpret_cast(p.prepend()), cpy); + Node *n = reinterpret_cast(p.prepend()); + QT_TRY { + node_construct(n, cpy); + } QT_CATCH(...) { + ++d->begin; + QT_RETHROW; + } } } @@ -447,10 +495,22 @@ inline void QList::insert(int i, const T &t) { detach(); if (QTypeInfo::isLarge || QTypeInfo::isStatic) { - node_construct(reinterpret_cast(p.insert(i)), t); + Node *n = reinterpret_cast(p.insert(i)); + QT_TRY { + node_construct(n, t); + } QT_CATCH(...) { + p.remove(i); + QT_RETHROW; + } } else { const T cpy(t); - node_construct(reinterpret_cast(p.insert(i)), cpy); + Node *n = reinterpret_cast(p.insert(i)); + QT_TRY { + node_construct(n, cpy); + } QT_CATCH(...) { + p.remove(i); + QT_RETHROW; + } } } @@ -522,7 +582,14 @@ Q_OUTOFLINE_TEMPLATE void QList::detach_helper() { Node *n = reinterpret_cast(p.begin()); QListData::Data *x = p.detach2(); - node_copy(reinterpret_cast(p.begin()), reinterpret_cast(p.end()), n); + QT_TRY { + node_copy(reinterpret_cast(p.begin()), reinterpret_cast(p.end()), n); + } QT_CATCH(...) { + qFree(d); + d = x; + QT_RETHROW; + } + if (!x->ref.deref()) free(x); } @@ -572,7 +639,7 @@ Q_OUTOFLINE_TEMPLATE void QList::clear() template Q_OUTOFLINE_TEMPLATE int QList::removeAll(const T &_t) { - detach(); + detachShared(); const T t = _t; int removedCount=0, i=0; Node *n; @@ -590,7 +657,7 @@ Q_OUTOFLINE_TEMPLATE int QList::removeAll(const T &_t) template Q_OUTOFLINE_TEMPLATE bool QList::removeOne(const T &_t) { - detach(); + detachShared(); int index = indexOf(_t); if (index != -1) { removeAt(index); diff --git a/src/corelib/tools/qlistdata.cpp b/src/corelib/tools/qlistdata.cpp index 34a5d80..efdde64 100644 --- a/src/corelib/tools/qlistdata.cpp +++ b/src/corelib/tools/qlistdata.cpp @@ -39,6 +39,7 @@ ** ****************************************************************************/ +#include #include "qlist.h" #include "qtools_p.h" #include @@ -71,8 +72,7 @@ static int grow(int size) QListData::Data *QListData::detach() { Data *x = static_cast(qMalloc(DataHeaderSize + d->alloc * sizeof(void *))); - if (!x) - qFatal("QList: Out of memory"); + Q_CHECK_PTR(x); ::memcpy(x, d, DataHeaderSize + d->alloc * sizeof(void *)); x->alloc = d->alloc; @@ -91,10 +91,10 @@ QListData::Data *QListData::detach() QListData::Data *QListData::detach2() { Data *x = d; - d = static_cast(qMalloc(DataHeaderSize + x->alloc * sizeof(void *))); - if (!d) - qFatal("QList: Out of memory"); + Data* t = static_cast(qMalloc(DataHeaderSize + x->alloc * sizeof(void *))); + Q_CHECK_PTR(t); + d = t; ::memcpy(d, x, DataHeaderSize + x->alloc * sizeof(void *)); d->alloc = x->alloc; d->ref = 1; @@ -109,8 +109,7 @@ void QListData::realloc(int alloc) { Q_ASSERT(d->ref == 1); Data *x = static_cast(qRealloc(d, DataHeaderSize + alloc * sizeof(void *))); - if (!x) - qFatal("QList: Out of memory"); + Q_CHECK_PTR(x); d = x; d->alloc = alloc; @@ -514,6 +513,15 @@ void **QListData::erase(void **xi) \internal */ +/*! \fn void QList::detachShared() + + \internal + + like detach(), but does nothing if we're shared_null. + This prevents needless mallocs, and makes QList more exception safe + in case of cleanup work done in destructors on empty lists. +*/ + /*! \fn bool QList::isDetached() const \internal diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 4d042ae..4317933 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -5124,6 +5124,7 @@ static Bigint *Balloc(int k) x = 1 << k; rv = static_cast(MALLOC(sizeof(Bigint) + (x-1)*sizeof(Long))); + Q_CHECK_PTR(rv); rv->k = k; rv->maxwds = x; rv->sign = rv->wds = 0; @@ -6788,6 +6789,7 @@ static char *_qdtoa( NEEDS_VOLATILE double d, int mode, int ndigits, int *decpt, i = 1; } *resultp = static_cast(malloc(i + 1)); + Q_CHECK_PTR(resultp); s = s0 = *resultp; if (ilim >= 0 && ilim <= Quick_max && try_quick) { @@ -7209,6 +7211,7 @@ Q_CORE_EXPORT char *qdtoa( double d, int mode, int ndigits, int *decpt, int *sig n = i + 1; } *resultp = static_cast(malloc(n + 1)); + Q_CHECK_PTR(resultp); qstrncpy(*resultp, res, n + 1); return *resultp; } diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp index 07df28d..ceaf370 100644 --- a/src/corelib/tools/qmap.cpp +++ b/src/corelib/tools/qmap.cpp @@ -59,6 +59,7 @@ QMapData QMapData::shared_null = { QMapData *QMapData::createData() { QMapData *d = new QMapData; + Q_CHECK_PTR(d); Node *e = reinterpret_cast(d); e->backward = e; e->forward[0] = e; @@ -84,6 +85,15 @@ void QMapData::continueFreeData(int offset) delete this; } +/*! + Creates a new node inside the data structure. + + \a update is an array with pointers to the node after which the new node + should be inserted. Because of the strange skip list data structure there + could be several pointers to this node on different levels. + \a offset is an amount of bytes that needs to reserved just before the + QMapData::Node structure. +*/ QMapData::Node *QMapData::node_create(Node *update[], int offset) { int level = 0; @@ -94,10 +104,6 @@ QMapData::Node *QMapData::node_create(Node *update[], int offset) mask <<= Sparseness; } - ++randomBits; - if (level == 3 && !insertInOrder) - randomBits = qrand(); - if (level > topLevel) { Node *e = reinterpret_cast(this); level = ++topLevel; @@ -105,7 +111,13 @@ QMapData::Node *QMapData::node_create(Node *update[], int offset) update[level] = e; } + ++randomBits; + if (level == 3 && !insertInOrder) + randomBits = qrand(); + void *concreteNode = qMalloc(offset + sizeof(Node) + level * sizeof(Node *)); + Q_CHECK_PTR(concreteNode); + Node *abstractNode = reinterpret_cast(reinterpret_cast(concreteNode) + offset); abstractNode->backward = update[0]; @@ -116,6 +128,7 @@ QMapData::Node *QMapData::node_create(Node *update[], int offset) update[i]->forward[i] = abstractNode; update[i] = abstractNode; } + // update[level+1]=reinterpret_cast(this); ++size; return abstractNode; } @@ -146,7 +159,7 @@ uint QMapData::adjust_ptr(Node *node) void QMapData::dump() { - qDebug("Map data (ref = %d, size = %d, randomBits = %#.8x)", ref.atomic, size, randomBits); + qDebug("Map data (ref = %d, size = %d, randomBits = %#.8x)", int(ref), size, randomBits); QString preOutput; QVector output(topLevel + 1); @@ -158,12 +171,12 @@ void QMapData::dump() Node *update[LastLevel + 1]; for (int i = 0; i <= topLevel; ++i) { - str.sprintf("%d: [%.8x] -", i, adjust_ptr(forward[i])); + str.sprintf("%d: [%.8x] -", i, adjust_ptr(reinterpret_cast(forward[i]))); output[i] += str; - update[i] = forward[i]; + update[i] = reinterpret_cast(forward[i]); } - Node *node = forward[0]; + Node *node = reinterpret_cast(forward[0]); while (node != e) { int level = 0; while (level < topLevel && update[level + 1] == node) @@ -178,13 +191,13 @@ void QMapData::dump() update[i] = node->forward[i]; } for (int j = level + 1; j <= topLevel; ++j) - output[j] += "---------------"; + output[j] += QString("---------------"); node = node->forward[0]; } - qDebug(preOutput.ascii()); + qDebug("%s", preOutput.ascii()); for (int i = 0; i <= topLevel; ++i) - qDebug(output[i].ascii()); + qDebug("%s", output[i].ascii()); } #endif diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h index 0215a78..bd9ba74 100644 --- a/src/corelib/tools/qmap.h +++ b/src/corelib/tools/qmap.h @@ -416,9 +416,29 @@ Q_INLINE_TEMPLATE typename QMapData::Node * QMap::node_create(QMapData *adt, QMapData::Node *aupdate[], const Key &akey, const T &avalue) { QMapData::Node *abstractNode = adt->node_create(aupdate, payload()); - Node *concreteNode = concrete(abstractNode); - new (&concreteNode->key) Key(akey); - new (&concreteNode->value) T(avalue); + QT_TRY { + Node *concreteNode = concrete(abstractNode); + new (&concreteNode->key) Key(akey); + QT_TRY { + new (&concreteNode->value) T(avalue); + } QT_CATCH(...) { + concreteNode->key.~Key(); + QT_RETHROW; + } + } QT_CATCH(...) { + adt->node_delete(aupdate, payload(), abstractNode); + QT_RETHROW; + } + + // clean up the update array for further insertions + /* + for (int i = 0; i <= d->topLevel; ++i) { + if ( aupdate[i]==reinterpret_cast(adt) || aupdate[i]->forward[i] != abstractNode) + break; + aupdate[i] = abstractNode; + } +*/ + return abstractNode; } @@ -704,8 +724,13 @@ Q_OUTOFLINE_TEMPLATE void QMap::detach_helper() QMapData::Node *cur = e->forward[0]; update[0] = x.e; while (cur != e) { - Node *concreteNode = concrete(cur); - node_create(x.d, update, concreteNode->key, concreteNode->value); + QT_TRY { + Node *concreteNode = concrete(cur); + node_create(x.d, update, concreteNode->key, concreteNode->value); + } QT_CATCH(...) { + freeData(x.d); + QT_RETHROW; + } cur = cur->forward[0]; } x.d->insertInOrder = false; diff --git a/src/corelib/tools/qpodlist_p.h b/src/corelib/tools/qpodlist_p.h index 9708f8d..9e6d19b 100644 --- a/src/corelib/tools/qpodlist_p.h +++ b/src/corelib/tools/qpodlist_p.h @@ -53,9 +53,7 @@ // We mean it. // -#include -#include -#include +#include QT_BEGIN_HEADER @@ -63,87 +61,29 @@ QT_BEGIN_NAMESPACE QT_MODULE(Core) -template -class QPodList +template +class QPodList : public QVarLengthArray { + using QVarLengthArray::s; + using QVarLengthArray::a; + using QVarLengthArray::ptr; + using QVarLengthArray::realloc; public: - inline explicit QPodList(int size = 0); + inline explicit QPodList(int size = 0) + : QVarLengthArray(size) + {} - inline QPodList(const QPodList &other) - : a(Prealloc), s(0), ptr(reinterpret_cast(array)) + inline void insert(int idx, const T &t) { - append(other.constData(), other.size()); - } - - inline ~QPodList() { - if (ptr != reinterpret_cast(array)) - qFree(ptr); - } - inline QPodList &operator=(const QPodList &other) - { - if (this != &other) { - clear(); - append(other.constData(), other.size()); - } - return *this; - } - - inline int size() const { return s; } - inline int count() const { return s; } - inline bool isEmpty() const { return (s == 0); } - inline void resize(int size); - inline void clear() { resize(0); } - - inline int capacity() const { return a; } - inline void reserve(int size); - - inline T &operator[](int idx) { - Q_ASSERT(idx >= 0 && idx < s); - return ptr[idx]; - } - inline const T &operator[](int idx) const { - Q_ASSERT(idx >= 0 && idx < s); - return ptr[idx]; - } - - inline const T &at(int idx) const { - Q_ASSERT(idx >= 0 && idx < s); - return ptr[idx]; - } - - inline const T &first() const { - return at(0); - } - - inline T& append() { - const int idx = s++; - if (s == a) - realloc(s, s<<1); - return ptr[idx]; - } - inline void append(const T &t) { - append() = t; - } - - inline T& insert(int idx) { - Q_ASSERT(idx >= 0 && idx <= s); const int sz = s++; if (s == a) - realloc(s, s<<1); + realloc(s, s << 1); ::memmove(ptr + idx + 1, ptr + idx, (sz - idx) * sizeof(T)); - return ptr[idx]; - } - inline void insert(int idx, const T &t) { - insert(idx) = t; + ptr[idx] = t; } - inline void removeAt(int idx) { - Q_ASSERT(idx >= 0 && idx < s); - ::memmove(ptr + idx, ptr + idx + 1, (s - idx - 1) * sizeof(T)); - --s; - } - - inline void removeAll(const T &t) { + inline void removeAll(const T &t) + { int i = 0; for (int j = 0; j < s; ++j) { if (ptr[j] != t) @@ -152,110 +92,22 @@ public: s = i; } - inline int indexOf(const T &t, int from = 0) const { - if (from < 0) - from = qMax(from + s, 0); - if (from < s) { - const T *n = ptr + from - 1; - const T *e = ptr + s; - while (++n != e) - if (*n == t) - return n - ptr; - } - return -1; - } - - inline bool contains(const T &t) const { - return indexOf(t) >= 0; + inline void removeAt(int idx) + { + Q_ASSERT(idx >= 0 && idx < s); + ::memmove(ptr + idx, ptr + idx + 1, (s - idx - 1) * sizeof(T)); + --s; } - inline T takeFirst() { + inline T takeFirst() + { Q_ASSERT(s > 0); T tmp = ptr[0]; removeAt(0); return tmp; } - - inline T *data() { return ptr; } - inline const T *data() const { return ptr; } - inline const T * constData() const { return ptr; } - -private: - void append(const T *buf, int size); - void realloc(int size, int alloc); - - int a; - int s; - T *ptr; - union { - // ### Qt 5: Use 'Prealloc * sizeof(T)' as array size - char array[sizeof(qint64) * (((Prealloc * sizeof(T)) / sizeof(qint64)) + 1)]; - qint64 q_for_alignment_1; - double q_for_alignment_2; - }; }; -template -Q_INLINE_TEMPLATE QPodList::QPodList(int asize) - : s(asize) { - if (s > Prealloc) { - ptr = reinterpret_cast(qMalloc(s * sizeof(T))); - a = s; - } else { - ptr = reinterpret_cast(array); - a = Prealloc; - } -} - -template -Q_INLINE_TEMPLATE void QPodList::resize(int asize) -{ realloc(asize, qMax(asize, a)); } - -template -Q_INLINE_TEMPLATE void QPodList::reserve(int asize) -{ if (asize > a) realloc(s, asize); } - -template -Q_OUTOFLINE_TEMPLATE void QPodList::append(const T *abuf, int asize) -{ - Q_ASSERT(abuf); - if (asize <= 0) - return; - - const int idx = s; - const int news = s + asize; - if (news >= a) - realloc(news, news<<1); - else - s = news; - - qMemCopy(&ptr[idx], abuf, asize * sizeof(T)); -} - -template -Q_OUTOFLINE_TEMPLATE void QPodList::realloc(int asize, int aalloc) -{ - Q_ASSERT(aalloc >= asize); - T *oldPtr = ptr; - int osize = s; - s = asize; - - if (aalloc != a) { - ptr = reinterpret_cast(qMalloc(aalloc * sizeof(T))); - if (ptr) { - a = aalloc; - qMemCopy(ptr, oldPtr, osize * sizeof(T)); - } else { - ptr = oldPtr; - s = 0; - asize = 0; - } - } - - if (oldPtr != reinterpret_cast(array) && oldPtr != ptr) - qFree(oldPtr); -} - QT_END_NAMESPACE QT_END_HEADER diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp index e1c3921..f357956 100644 --- a/src/corelib/tools/qregexp.cpp +++ b/src/corelib/tools/qregexp.cpp @@ -1297,14 +1297,20 @@ void QRegExpMatchState::prepareForMatch(QRegExpEngine *eng) int ns = eng->s.size(); // number of states int ncap = eng->ncap; #ifndef QT_NO_REGEXP_OPTIM - slideTabSize = qMax(eng->minl + 1, 16); + int newSlideTabSize = qMax(eng->minl + 1, 16); #else - slideTabSize = 0; + int newSlideTabSize = 0; #endif int numCaptures = eng->numCaptures(); - capturedSize = 2 + 2 * numCaptures; - bigArray = (int *)realloc(bigArray, ((3 + 4 * ncap) * ns + 4 * ncap + slideTabSize + capturedSize)*sizeof(int)); + int newCapturedSize = 2 + 2 * numCaptures; + bigArray = (int *)realloc(bigArray, ((3 + 4 * ncap) * ns + 4 * ncap + newSlideTabSize + newCapturedSize)*sizeof(int)); + Q_CHECK_PTR(bigArray); + // set all internal variables only _after_ bigArray is realloc'ed + // to prevent a broken regexp in oom case + + slideTabSize = newSlideTabSize; + capturedSize = newCapturedSize; inNextStack = bigArray; memset(inNextStack, -1, ns * sizeof(int)); curStack = inNextStack + ns; @@ -3281,10 +3287,15 @@ static void derefEngine(QRegExpEngine *eng, const QRegExpEngineKey &key) #if !defined(QT_NO_REGEXP_OPTIM) if (globalEngineCache()) { QMutexLocker locker(mutex()); - globalEngineCache()->insert(key, eng, 4 + key.pattern.length() / 4); - } - else + QT_TRY { + globalEngineCache()->insert(key, eng, 4 + key.pattern.length() / 4); + } QT_CATCH(const std::bad_alloc &) { + // in case of an exception (e.g. oom), just delete the engine + delete eng; + } + } else { delete eng; + } #else Q_UNUSED(key); delete eng; diff --git a/src/corelib/tools/qringbuffer_p.h b/src/corelib/tools/qringbuffer_p.h index 3a0901d..ac33353 100644 --- a/src/corelib/tools/qringbuffer_p.h +++ b/src/corelib/tools/qringbuffer_p.h @@ -199,9 +199,8 @@ public: inline void clear() { if(!buffers.isEmpty()) { - QByteArray tmp = buffers[0]; - buffers.clear(); - buffers << tmp; + // remove all but the first + buffers.erase(buffers.begin() + 1, buffers.end()); if (buffers.at(0).size() != basicBlockSize) buffers[0].resize(basicBlockSize); } diff --git a/src/corelib/tools/qscopedpointer.cpp b/src/corelib/tools/qscopedpointer.cpp new file mode 100644 index 0000000..8150a18 --- /dev/null +++ b/src/corelib/tools/qscopedpointer.cpp @@ -0,0 +1,132 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the $MODULE$ of the Qt Toolkit. +** +** $TROLLTECH_DUAL_LICENSE$ +** +****************************************************************************/ + +/*! + \class QScopedPointer + \brief The QScopedPointer class stores a pointer to a dynamically allocated object, and deletes it upon destruction. + \since 4.6 + \reentrant + \ingroup misc + + Managing heap allocated objects manually is hard and error prone, with the + common result that code leaks memory and is hard to maintain. + QScopedPointer is a small utility class that heavily simplifies this by + assigning stack-based memory ownership to heap allocations, more generally + called resource acquisition is initialization(RAII). + + QScopedPointer guarantees that the object pointed to will get deleted when + the current scope dissapears, and it also has no way of releasing + ownership, hence clearly communicating the lifetime and ownership of the + object. These guarantees are convenient when reading the code. + + Consider this function which does heap allocations, and have various exit points: + + \snippet doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp 0 + + It's encumbered by the manual delete calls. With QScopedPointer, the code + can be simplified to: + + \snippet doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp 1 + + The code the compiler generates for QScopedPointer is the same as when + writing it manually. Code that makes use of \a delete are candidates for + QScopedPointer usage(and if not, possibly another type of smart pointer + such as QSharedPointer). QScopedPointer intentionally has no copy + constructor or assignment operator, such that ownership and lifetime is + clearly communicated. + + The const qualification on a regular C++ pointer can also be expressed with + a QScopedPointer: + + \snippet doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp 2 + + \note QScopedPointer does not work with arrays. + + \sa QSharedPointer +*/ + +/*! + \fn QScopedPointer::QScopedPointer(T *p = 0) + + Constructs this QScopedPointer instance and sets its pointer to \a p. +*/ + +/*! + \fn QScopedPointer::~QScopedPointer() + + Destroys this QScopedPointer object. Delete the object its pointer points + to. +*/ + +/*! + \fn T *QScopedPointer::data() const + + Returns the value of the pointer referenced by this object. QScopedPointer + still owns the object pointed to. +*/ + +/*! + \fn T &QScopedPointer::operator*() const + + Provides access to the scoped pointer's object. + + If the contained pointer is \c null, behavior is undefined. + \sa isNull() +*/ + +/*! + \fn T *QScopedPointer::operator->() const + + Provides access to the scoped pointer's object. + + If the contained pointer is \c null, behavior is undefined. + + \sa isNull() +*/ + +/*! + \fn QScopedPointer::operator bool() const + + Returns \c true if this object is not \c null. This function is suitable + for use in \tt if-constructs, like: + + \snippet doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp 3 + + \sa isNull() +*/ + +/*! + \fn bool QScopedPointer::isNull() const + + Returns \c true if this object is holding a pointer that is \c null. +*/ + +/*! + \fn void QScopedPointer::reset(T *other = 0) + + Deletes the existing object its pointing to if any, and sets its pointer to + \a other. QScopedPointer now owns \a other and will delete it in its + destructor. + + If \a other is equal to the value returned by data(), behavior is + undefined. +*/ + +/*! + \fn T *QScopedPointer::take() + + Returns the value of the pointer referenced by this object. The pointer of this + QScopedPointer object will be reset to \c null. +*/ + +QT_END_NAMESPACE + +#endif diff --git a/src/corelib/tools/qscopedpointer.h b/src/corelib/tools/qscopedpointer.h new file mode 100644 index 0000000..fc8f9e2 --- /dev/null +++ b/src/corelib/tools/qscopedpointer.h @@ -0,0 +1,199 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QSCOPEDPOINTER_H +#define QSCOPEDPOINTER_H + +#include + +QT_BEGIN_HEADER +QT_BEGIN_NAMESPACE +QT_MODULE(Core) + +template +class QScopedPointer +{ +public: + explicit inline QScopedPointer(T *p = 0) : d(p) + { + } + + inline ~QScopedPointer() + { + delete d; + } + + inline T &operator*() const + { + return *d; + } + + inline T *operator->() const + { + return d; + } + + inline bool operator==(const QScopedPointer &other) const + { + return d == other.d; + } + + inline bool operator!=(const QScopedPointer &other) const + { + return d != other.d; + } + + inline operator bool() const + { + return d; + } + + inline T *data() const + { + return d; + } + + inline bool isNull() const + { + return !d; + } + + inline void reset(T *other = 0) + { + T *oldD = d; + d = other; + delete oldD; + } + + inline T *take() + { + T *oldD = d; + d = 0; + return oldD; + } + +protected: + T *d; + +private: + Q_DISABLE_COPY(QScopedPointer) +}; + +/* internal class - allows special handling for resetting and cleaning the pointer */ +template +class QScopedCustomPointer : public QScopedPointer +{ +public: + inline QScopedCustomPointer(T *p = 0) + : QScopedPointer(p) + { + } + + inline ~QScopedCustomPointer() + { + T *oldD = this->d; + this->d = 0; + CustomHandler::cleanup(oldD); + } + + inline void reset(T *other = 0) + { + CustomHandler::reset(this->d, other); + } + + inline T *&data_ptr() + { + return this->d; + } +}; + +/* Internal helper class - a handler for QShared* classes, to be used in QScopedCustomPointer */ +template +class QScopedSharedPointerHandler +{ +public: + static inline void cleanup(T *d) + { + if (d && !d->ref.deref()) + delete d; + } + + static inline void reset(T *&d, T *other) + { + T *oldD = d; + d = other; + cleanup(oldD); + } +}; + +/* Internal. This should really have been a typedef, but you can't have a templated typedef :) + This class is basically a scoped pointer pointing to a ref-counted object + */ +template +class QScopedSharedPointer : public QScopedCustomPointer > +{ +public: + inline QScopedSharedPointer(T *p = 0) + : QScopedCustomPointer >(p) + { + } + + inline void detach() + { + qAtomicDetach(this->d); + } + + inline void assign(T *other) + { + if (this->d == other) + return; + if (other) + other->ref.ref(); + T *oldD = this->d; + this->d = other; + QScopedSharedPointerHandler::cleanup(oldD); + } +}; + +QT_END_NAMESPACE +QT_END_HEADER + +#endif // QSCOPEDPOINTER_H diff --git a/src/corelib/tools/qshareddata.cpp b/src/corelib/tools/qshareddata.cpp index 2b879ea..03bc964 100644 --- a/src/corelib/tools/qshareddata.cpp +++ b/src/corelib/tools/qshareddata.cpp @@ -231,7 +231,7 @@ QT_BEGIN_NAMESPACE In the member function documentation, \e{d pointer} always refers to the internal pointer to the shared data object. - \sa QSharedData, QExplicitlySharedDataPointer + \sa QSharedData, QExplicitlySharedDataPointer, QScopedPointer, QSharedPointer */ /*! \fn T& QSharedDataPointer::operator*() diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp index c3a989e..dee06f0 100644 --- a/src/corelib/tools/qsharedpointer.cpp +++ b/src/corelib/tools/qsharedpointer.cpp @@ -102,13 +102,18 @@ except that it only detaches if QExplicitlySharedDataPointer::detach() is explicitly called. + QScopedPointer simply holds a pointer to a heap allocated object and + deletes it in its destructor. This class is useful when an object needs to + be heap allocated and deleted, but no more. QScopedPointer is lightweight, + it makes no use of additional structure or reference counting. + Finally, QPointer holds a pointer to a QObject-derived object, but it does so weakly. QPointer is similar, in that behaviour, to QWeakPointer: it does not allow you to prevent the object from being destroyed. All you can do is query whether it has been destroyed or not. - \sa QSharedDataPointer, QWeakPointer + \sa QSharedDataPointer, QWeakPointer, QScopedPointer */ /*! @@ -130,7 +135,7 @@ must first create a QSharedPointer object and verify if the pointer is null or not. - \sa QSharedPointer + \sa QSharedPointer, QScopedPointer */ /*! diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index c3649e3..e61a568 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -846,6 +846,7 @@ QString::QString(const QChar *unicode, int size) d->ref.ref(); } else { d = (Data*) qMalloc(sizeof(Data)+size*sizeof(QChar)); + Q_CHECK_PTR(d); d->ref = 1; d->alloc = d->size = size; d->clean = d->asciiCache = d->simpletext = d->righttoleft = d->capacity = 0; @@ -869,6 +870,7 @@ QString::QString(int size, QChar ch) d->ref.ref(); } else { d = (Data*) qMalloc(sizeof(Data)+size*sizeof(QChar)); + Q_CHECK_PTR(d); d->ref = 1; d->alloc = d->size = size; d->clean = d->asciiCache = d->simpletext = d->righttoleft = d->capacity = 0; @@ -894,7 +896,9 @@ QString::QString(int size, QChar ch) */ QString::QString(QChar ch) { - d = (Data *)qMalloc(sizeof(Data) + sizeof(QChar)); + void *buf = qMalloc(sizeof(Data) + sizeof(QChar)); + Q_CHECK_PTR(buf); + d = reinterpret_cast(buf); d->ref = 1; d->alloc = d->size = 1; d->clean = d->asciiCache = d->simpletext = d->righttoleft = d->capacity = 0; @@ -1064,8 +1068,7 @@ void QString::realloc(int alloc) { if (d->ref != 1 || d->data != d->array) { Data *x = static_cast(qMalloc(sizeof(Data) + alloc * sizeof(QChar))); - if (!x) - return; + Q_CHECK_PTR(x); x->size = qMin(alloc, d->size); ::memcpy(x->array, d->data, x->size * sizeof(QChar)); x->array[x->size] = 0; @@ -1088,8 +1091,7 @@ void QString::realloc(int alloc) } #endif Data *x = static_cast(qRealloc(d, sizeof(Data) + alloc * sizeof(QChar))); - if (!x) - return; + Q_CHECK_PTR(x); x->alloc = alloc; x->data = x->array; d = x; @@ -1246,6 +1248,7 @@ QString& QString::insert(int i, const QChar *unicode, int size) if (s >= d->data && s < d->data + d->alloc) { // Part of me - take a copy ushort *tmp = static_cast(qMalloc(size * sizeof(QChar))); + Q_CHECK_PTR(tmp); memcpy(tmp, s, size * sizeof(QChar)); insert(i, reinterpret_cast(tmp), size); qFree(tmp); @@ -1600,51 +1603,69 @@ QString &QString::replace(const QString &before, const QString &after, Qt::CaseS */ void QString::replace_helper(uint *indices, int nIndices, int blen, const QChar *after, int alen) { - if (blen == alen) { - detach(); - for (int i = 0; i < nIndices; ++i) - memcpy(d->data + indices[i], after, alen * sizeof(QChar)); - } else if (alen < blen) { + // copy *after in case it lies inside our own d->data area + // (which we could possibly invalidate via a realloc or corrupt via memcpy operations.) + QChar *afterBuffer = const_cast(after); + if (after >= reinterpret_cast(d->data) && after < reinterpret_cast(d->data) + d->size) { + afterBuffer = static_cast(qMalloc(alen*sizeof(QChar))); + Q_CHECK_PTR(afterBuffer); + ::memcpy(afterBuffer, after, alen*sizeof(QChar)); + } + + QT_TRY { detach(); - uint to = indices[0]; - if (alen) - memcpy(d->data+to, after, alen*sizeof(QChar)); - to += alen; - uint movestart = indices[0] + blen; - for (int i = 1; i < nIndices; ++i) { - int msize = indices[i] - movestart; - if (msize > 0) { - memmove(d->data + to, d->data + movestart, msize * sizeof(QChar)); - to += msize; + if (blen == alen) { + // replace in place + for (int i = 0; i < nIndices; ++i) + memcpy(d->data + indices[i], afterBuffer, alen * sizeof(QChar)); + } else if (alen < blen) { + // replace from front + uint to = indices[0]; + if (alen) + memcpy(d->data+to, after, alen*sizeof(QChar)); + to += alen; + uint movestart = indices[0] + blen; + for (int i = 1; i < nIndices; ++i) { + int msize = indices[i] - movestart; + if (msize > 0) { + memmove(d->data + to, d->data + movestart, msize * sizeof(QChar)); + to += msize; + } + if (alen) { + memcpy(d->data + to, afterBuffer, alen*sizeof(QChar)); + to += alen; + } + movestart = indices[i] + blen; } - if (alen) { - memcpy(d->data + to, after, alen*sizeof(QChar)); - to += alen; + int msize = d->size - movestart; + if (msize > 0) + memmove(d->data + to, d->data + movestart, msize * sizeof(QChar)); + resize(d->size - nIndices*(blen-alen)); + } else { + // replace from back + int adjust = nIndices*(alen-blen); + int newLen = d->size + adjust; + int moveend = d->size; + resize(newLen); + + while (nIndices) { + --nIndices; + int movestart = indices[nIndices] + blen; + int insertstart = indices[nIndices] + nIndices*(alen-blen); + int moveto = insertstart + alen; + memmove(d->data + moveto, d->data + movestart, + (moveend - movestart)*sizeof(QChar)); + memcpy(d->data + insertstart, afterBuffer, alen*sizeof(QChar)); + moveend = movestart-blen; } - movestart = indices[i] + blen; - } - int msize = d->size - movestart; - if (msize > 0) - memmove(d->data + to, d->data + movestart, msize * sizeof(QChar)); - resize(d->size - nIndices*(blen-alen)); - } else { - // we have a table of replacement positions, use them for fast replacing - int adjust = nIndices*(alen-blen); - int newLen = d->size + adjust; - int moveend = d->size; - resize(newLen); - - while (nIndices) { - --nIndices; - int movestart = indices[nIndices] + blen; - int insertstart = indices[nIndices] + nIndices*(alen-blen); - int moveto = insertstart + alen; - memmove(d->data + moveto, d->data + movestart, - (moveend - movestart)*sizeof(QChar)); - memcpy(d->data + insertstart, after, alen*sizeof(QChar)); - moveend = movestart-blen; } + } QT_CATCH(const std::bad_alloc &) { + if (afterBuffer != after) + qFree(afterBuffer); + QT_RETHROW; } + if (afterBuffer != after) + qFree(afterBuffer); } /*! @@ -1672,21 +1693,7 @@ QString &QString::replace(const QChar *before, int blen, if (alen == 0 && blen == 0) return *this; - // protect against before or after being part of this - const QChar *a = after; - const QChar *b = before; - if (after >= (const QChar *)d->data && after < (const QChar *)d->data + d->size) { - QChar *copy = (QChar *)malloc(alen*sizeof(QChar)); - memcpy(copy, after, alen*sizeof(QChar)); - a = copy; - } - if (before >= (const QChar *)d->data && before < (const QChar *)d->data + d->size) { - QChar *copy = (QChar *)malloc(blen*sizeof(QChar)); - memcpy(copy, before, blen*sizeof(QChar)); - b = copy; - } - - QStringMatcher matcher(b, blen, cs); + QStringMatcher matcher(before, blen, cs); int index = 0; while (1) { @@ -1705,7 +1712,7 @@ QString &QString::replace(const QChar *before, int blen, if (!pos) break; - replace_helper(indices, pos, blen, a, alen); + replace_helper(indices, pos, blen, after, alen); if (index == -1) break; @@ -1713,11 +1720,6 @@ QString &QString::replace(const QChar *before, int blen, index += pos*(alen-blen); } - if (a != after) - ::free((QChar *)a); - if (b != before) - ::free((QChar *)b); - return *this; } @@ -3450,6 +3452,7 @@ QString::Data *QString::fromLatin1_helper(const char *str, int size) if (size < 0) size = qstrlen(str); d = static_cast(qMalloc(sizeof(Data) + size * sizeof(QChar))); + Q_CHECK_PTR(d); d->ref = 1; d->alloc = d->size = size; d->clean = d->asciiCache = d->simpletext = d->righttoleft = d->capacity = 0; @@ -3457,7 +3460,7 @@ QString::Data *QString::fromLatin1_helper(const char *str, int size) ushort *i = d->data; d->array[size] = '\0'; while (size--) - *i++ = (uchar)*str++; + *i++ = (uchar)*str++; } return d; } @@ -6867,6 +6870,7 @@ void QString::updateProperties() const QString QString::fromRawData(const QChar *unicode, int size) { Data *x = static_cast(qMalloc(sizeof(Data))); + Q_CHECK_PTR(x); if (unicode) { x->data = (ushort *)unicode; } else { diff --git a/src/corelib/tools/qtextboundaryfinder.cpp b/src/corelib/tools/qtextboundaryfinder.cpp index 8a8e95b..5ca6a11 100644 --- a/src/corelib/tools/qtextboundaryfinder.cpp +++ b/src/corelib/tools/qtextboundaryfinder.cpp @@ -176,6 +176,7 @@ QTextBoundaryFinder::QTextBoundaryFinder(const QTextBoundaryFinder &other) , freePrivate(true) { d = (QTextBoundaryFinderPrivate *) malloc(length*sizeof(HB_CharAttributes)); + Q_CHECK_PTR(d); memcpy(d, other.d, length*sizeof(HB_CharAttributes)); } @@ -193,8 +194,11 @@ QTextBoundaryFinder &QTextBoundaryFinder::operator=(const QTextBoundaryFinder &o length = other.length; pos = other.pos; freePrivate = true; - - d = (QTextBoundaryFinderPrivate *) realloc(d, length*sizeof(HB_CharAttributes)); + + QTextBoundaryFinderPrivate *newD = (QTextBoundaryFinderPrivate *) + realloc(d, length*sizeof(HB_CharAttributes)); + Q_CHECK_PTR(newD); + d = newD; memcpy(d, other.d, length*sizeof(HB_CharAttributes)); return *this; @@ -221,6 +225,7 @@ QTextBoundaryFinder::QTextBoundaryFinder(BoundaryType type, const QString &strin , freePrivate(true) { d = (QTextBoundaryFinderPrivate *) malloc(length*sizeof(HB_CharAttributes)); + Q_CHECK_PTR(d); init(t, chars, length, d->attributes); } @@ -248,6 +253,7 @@ QTextBoundaryFinder::QTextBoundaryFinder(BoundaryType type, const QChar *chars, freePrivate = false; } else { d = (QTextBoundaryFinderPrivate *) malloc(length*sizeof(HB_CharAttributes)); + Q_CHECK_PTR(d); freePrivate = true; } init(t, chars, length, d->attributes); diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h index e2f60ed..b41240e 100644 --- a/src/corelib/tools/qvarlengtharray.h +++ b/src/corelib/tools/qvarlengtharray.h @@ -52,6 +52,9 @@ QT_BEGIN_NAMESPACE QT_MODULE(Core) +template +class QPodList; + // Prealloc = 256 by default, specified in qcontainerfwd.h template class QVarLengthArray @@ -122,6 +125,7 @@ public: inline const T * constData() const { return ptr; } private: + friend class QPodList; void realloc(int size, int alloc); int a; @@ -140,6 +144,7 @@ Q_INLINE_TEMPLATE QVarLengthArray::QVarLengthArray(int asize) : s(asize) { if (s > Prealloc) { ptr = reinterpret_cast(qMalloc(s * sizeof(T))); + Q_CHECK_PTR(ptr); a = s; } else { ptr = reinterpret_cast(array); @@ -161,25 +166,24 @@ Q_INLINE_TEMPLATE void QVarLengthArray::reserve(int asize) { if (asize > a) realloc(s, asize); } template -Q_OUTOFLINE_TEMPLATE void QVarLengthArray::append(const T *abuf, int asize) +Q_OUTOFLINE_TEMPLATE void QVarLengthArray::append(const T *abuf, int increment) { Q_ASSERT(abuf); - if (asize <= 0) + if (increment <= 0) return; - const int idx = s; - const int news = s + asize; - if (news >= a) - realloc(s, qMax(s<<1, news)); - s = news; + const int asize = s + increment; + + if (asize >= a) + realloc(s, qMax(s*2, asize)); if (QTypeInfo::isComplex) { - T *i = ptr + idx; - T *j = i + asize; - while (i < j) - new (i++) T(*abuf++); + // call constructor for new objects (which can throw) + while (s < asize) + new (ptr+(s++)) T(*abuf++); } else { - qMemCopy(&ptr[idx], abuf, asize * sizeof(T)); + qMemCopy(&ptr[s], abuf, increment * sizeof(T)); + s = asize; } } @@ -189,46 +193,58 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray::realloc(int asize, int a Q_ASSERT(aalloc >= asize); T *oldPtr = ptr; int osize = s; - s = asize; + // s = asize; if (aalloc != a) { ptr = reinterpret_cast(qMalloc(aalloc * sizeof(T))); + Q_CHECK_PTR(ptr); if (ptr) { + s = 0; a = aalloc; if (QTypeInfo::isStatic) { - T *i = ptr + osize; - T *j = oldPtr + osize; - while (i != ptr) { - new (--i) T(*--j); - j->~T(); + QT_TRY { + while (s < asize) { + new (ptr+s) T(*(oldPtr+s)); + (oldPtr+s)->~T(); + s++; + } + } QT_CATCH(...) { + // clean up all the old objects and then free the old ptr + int sClean = s; + while (sClean < osize) + (oldPtr+(sClean++))->~T(); + if (oldPtr != reinterpret_cast(array) && oldPtr != ptr) + qFree(oldPtr); + QT_RETHROW; } } else { - qMemCopy(ptr, oldPtr, osize * sizeof(T)); + qMemCopy(ptr, oldPtr, qMin(asize, osize) * sizeof(T)); + s = asize; } } else { ptr = oldPtr; - s = 0; - asize = 0; + return; } } if (QTypeInfo::isComplex) { - if (asize < osize) { - T *i = oldPtr + osize; - T *j = oldPtr + asize; - while (i-- != j) - i->~T(); - } else { - T *i = ptr + asize; - T *j = ptr + osize; - while (i != j) - new (--i) T; - } + while (osize > asize) + (oldPtr+(--osize))->~T(); + if( oldPtr == ptr ) + s = osize; } if (oldPtr != reinterpret_cast(array) && oldPtr != ptr) qFree(oldPtr); + + if (QTypeInfo::isComplex) { + // call default constructor for new objects (which can throw) + while (s < asize) + new (ptr+(s++)) T; + } else { + s = asize; + } } QT_END_NAMESPACE diff --git a/src/corelib/tools/qvector.cpp b/src/corelib/tools/qvector.cpp index 6b26b2e..04e9ace 100644 --- a/src/corelib/tools/qvector.cpp +++ b/src/corelib/tools/qvector.cpp @@ -50,6 +50,7 @@ QVectorData QVectorData::shared_null = { Q_BASIC_ATOMIC_INITIALIZER(1), 0, 0, tr QVectorData *QVectorData::malloc(int sizeofTypedData, int size, int sizeofT, QVectorData *init) { QVectorData* p = (QVectorData *)qMalloc(sizeofTypedData + (size - 1) * sizeofT); + Q_CHECK_PTR(p); ::memcpy(p, init, sizeofTypedData + (qMin(size, init->alloc) - 1) * sizeofT); return p; } diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 1f047b8..610b8e7 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -77,6 +77,7 @@ struct Q_CORE_EXPORT QVectorData static QVectorData shared_null; // ### Qt 5: rename to 'allocate()'. The current name causes problems for // some debugges when the QVector is member of a class within an unnamed namespace. + // ### Qt 5: can be removed completely. (Ralf) static QVectorData *malloc(int sizeofTypedData, int size, int sizeofT, QVectorData *init); static int grow(int sizeofTypedData, int size, int sizeofT, bool excessive); }; @@ -379,7 +380,9 @@ QVector &QVector::operator=(const QVector &v) template inline QVectorData *QVector::malloc(int aalloc) { - return static_cast(qMalloc(sizeOfTypedData() + (aalloc - 1) * sizeof(T))); + QVectorData *data = static_cast(qMalloc(sizeOfTypedData() + (aalloc - 1) * sizeof(T))); + Q_CHECK_PTR(data); + return data; } template @@ -428,74 +431,79 @@ void QVector::free(Data *x) template void QVector::realloc(int asize, int aalloc) { - T *j, *i, *b; + T *pOld; + T *pNew; union { QVectorData *p; Data *d; } x; x.d = d; - if (QTypeInfo::isComplex && aalloc == d->alloc && d->ref == 1) { - // pure resize - i = d->array + d->size; - j = d->array + asize; - if (i > j) { - while (i-- != j) - i->~T(); - } else { - while (j-- != i) - new (j) T; + if (QTypeInfo::isComplex && asize < d->size && d->ref == 1 ) { + // call the destructor on all objects that need to be + // destroyed when shrinking + pOld = d->array + d->size; + pNew = d->array + asize; + while (asize < d->size) { + (--pOld)->~T(); + d->size--; } - d->size = asize; - return; } if (aalloc != d->alloc || d->ref != 1) { // (re)allocate memory if (QTypeInfo::isStatic) { x.p = malloc(aalloc); + Q_CHECK_PTR(x.p); + x.d->size = 0; } else if (d->ref != 1) { - x.p = QVectorData::malloc(sizeOfTypedData(), aalloc, sizeof(T), p); - } else { + x.p = malloc(aalloc); + Q_CHECK_PTR(x.p); if (QTypeInfo::isComplex) { - // call the destructor on all objects that need to be - // destroyed when shrinking - if (asize < d->size) { - j = d->array + asize; - i = d->array + d->size; - while (i-- != j) - i->~T(); - i = d->array + asize; - } + x.d->size = 0; + } else { + ::memcpy(x.p, p, sizeOfTypedData() + (qMin(aalloc, p->alloc) - 1) * sizeof(T)); + x.d->size = d->size; + } + } else { + QT_TRY { + QVectorData *mem = static_cast(qRealloc(p, sizeOfTypedData() + (aalloc - 1) * sizeof(T))); + Q_CHECK_PTR(mem); + x.p = p = mem; + x.d->size = d->size; + } QT_CATCH (const std::bad_alloc &) { + if (aalloc > d->alloc) // ignore the error in case we are just shrinking. + QT_RETHROW; } - x.p = p = static_cast(qRealloc(p, sizeOfTypedData() + (aalloc - 1) * sizeof(T))); } x.d->ref = 1; + x.d->alloc = aalloc; x.d->sharable = true; x.d->capacity = d->capacity; - } + if (QTypeInfo::isComplex) { - if (asize < d->size) { - j = d->array + asize; - i = x.d->array + asize; - } else { - // construct all new objects when growing - i = x.d->array + asize; - j = x.d->array + d->size; - while (i != j) - new (--i) T; - j = d->array + d->size; - } - if (i != j) { + QT_TRY { + pOld = d->array + x.d->size; + pNew = x.d->array + x.d->size; // copy objects from the old array into the new array - b = x.d->array; - while (i != b) - new (--i) T(*--j); + while (x.d->size < qMin(asize, d->size)) { + new (pNew++) T(*pOld++); + x.d->size++; + } + // construct all new objects when growing + while (x.d->size < asize) { + new (pNew++) T; + x.d->size++; + } + } QT_CATCH (...) { + free(x.d); + QT_RETHROW; } - } else if (asize > d->size) { + + } else if (asize > x.d->size) { // initialize newly allocated memory to 0 - qMemSet(x.d->array + d->size, 0, (asize - d->size) * sizeof(T)); + qMemSet(x.d->array + x.d->size, 0, (asize - x.d->size) * sizeof(T)); } x.d->size = asize; - x.d->alloc = aalloc; + if (d != x.d) { if (!d->ref.deref()) free(d); diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri index c2381ce..8d27100 100644 --- a/src/corelib/tools/tools.pri +++ b/src/corelib/tools/tools.pri @@ -36,7 +36,8 @@ HEADERS += \ tools/qtimeline.h \ tools/qunicodetables_p.h \ tools/qvarlengtharray.h \ - tools/qvector.h + tools/qvector.h \ + tools/qscopedpointer.h SOURCES += \ diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp index ff1a01f..6fe6ebf 100644 --- a/src/corelib/xml/qxmlstream.cpp +++ b/src/corelib/xml/qxmlstream.cpp @@ -429,7 +429,6 @@ QXmlStreamReader::~QXmlStreamReader() Q_D(QXmlStreamReader); if (d->deleteDevice) delete d->device; - delete d; } /*! \fn bool QXmlStreamReader::hasError() const @@ -819,7 +818,9 @@ inline void QXmlStreamReaderPrivate::reallocateStack() { stack_size <<= 1; sym_stack = reinterpret_cast (qRealloc(sym_stack, stack_size * sizeof(Value))); + Q_CHECK_PTR(sym_stack); state_stack = reinterpret_cast (qRealloc(state_stack, stack_size * sizeof(int))); + Q_CHECK_PTR(sym_stack); } @@ -3131,8 +3132,6 @@ QXmlStreamWriter::QXmlStreamWriter(QString *string) */ QXmlStreamWriter::~QXmlStreamWriter() { - Q_D(QXmlStreamWriter); - delete d; } diff --git a/src/corelib/xml/qxmlstream.h b/src/corelib/xml/qxmlstream.h index 2ba7972..6903d56 100644 --- a/src/corelib/xml/qxmlstream.h +++ b/src/corelib/xml/qxmlstream.h @@ -48,6 +48,7 @@ #include #include +#include QT_BEGIN_HEADER @@ -392,7 +393,7 @@ public: private: Q_DISABLE_COPY(QXmlStreamReader) Q_DECLARE_PRIVATE(QXmlStreamReader) - QXmlStreamReaderPrivate *d_ptr; + QScopedPointer d_ptr; }; #endif // QT_NO_XMLSTREAMREADER @@ -465,7 +466,7 @@ public: private: Q_DISABLE_COPY(QXmlStreamWriter) Q_DECLARE_PRIVATE(QXmlStreamWriter) - QXmlStreamWriterPrivate *d_ptr; + QScopedPointer d_ptr; }; #endif // QT_NO_XMLSTREAMWRITER diff --git a/src/dbus/qdbusabstractadaptor.cpp b/src/dbus/qdbusabstractadaptor.cpp index 883aabf..350f1aa 100644 --- a/src/dbus/qdbusabstractadaptor.cpp +++ b/src/dbus/qdbusabstractadaptor.cpp @@ -264,7 +264,7 @@ void QDBusAdaptorConnector::polish() void QDBusAdaptorConnector::relaySlot(void **argv) { - QObjectPrivate *d = static_cast(d_ptr); + QObjectPrivate *d = static_cast(d_ptr.data()); relay(d->currentSender->sender, d->currentSender->signal, argv); } diff --git a/src/dbus/qdbuscontext.h b/src/dbus/qdbuscontext.h index 3d043cf..6ece5b6 100644 --- a/src/dbus/qdbuscontext.h +++ b/src/dbus/qdbuscontext.h @@ -74,7 +74,7 @@ public: private: QDBusContextPrivate *d_ptr; - Q_DECLARE_PRIVATE(QDBusContext) + friend class QDBusContextPrivate; }; QT_END_NAMESPACE diff --git a/src/gui/dialogs/dialogs.pri b/src/gui/dialogs/dialogs.pri index 92347a7..b9fad41 100644 --- a/src/gui/dialogs/dialogs.pri +++ b/src/gui/dialogs/dialogs.pri @@ -7,6 +7,7 @@ HEADERS += \ dialogs/qabstractpagesetupdialog_p.h \ dialogs/qcolordialog.h \ dialogs/qcolordialog_p.h \ + dialogs/qfscompleter_p.h \ dialogs/qdialog.h \ dialogs/qdialog_p.h \ dialogs/qerrormessage.h \ diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp index ef562f4..cecbb87 100644 --- a/src/gui/dialogs/qdialog.cpp +++ b/src/gui/dialogs/qdialog.cpp @@ -296,9 +296,13 @@ QDialog::QDialog(QDialogPrivate &dd, QWidget *parent, Qt::WindowFlags f) QDialog::~QDialog() { - // Need to hide() here, as our (to-be) overridden hide() - // will not be called in ~QWidget. - hide(); + QT_TRY { + // Need to hide() here, as our (to-be) overridden hide() + // will not be called in ~QWidget. + hide(); + } QT_CATCH(...) { + // we're in the destructor - just swallow the exception + } } /*! diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index aab79d0..60d3034 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -356,7 +356,6 @@ QFileDialog::~QFileDialog() settings.beginGroup(QLatin1String("Qt")); settings.setValue(QLatin1String("filedialog"), saveState()); #endif - delete d->qFileDialogUi; d->deleteNativeDialog_sys(); } @@ -488,6 +487,10 @@ void QFileDialog::changeEvent(QEvent *e) QDialog::changeEvent(e); } +QFileDialogPrivate::~QFileDialogPrivate() +{ +} + void QFileDialogPrivate::retranslateWindowTitle() { Q_Q(QFileDialog); @@ -2121,7 +2124,7 @@ void QFileDialogPrivate::createWidgets() q, SLOT(_q_rowsInserted(const QModelIndex &))); model->setReadOnly(false); - qFileDialogUi = new Ui_QFileDialog(); + qFileDialogUi.reset(new Ui_QFileDialog()); qFileDialogUi->setupUi(q); QList initialBookmarks; @@ -2147,7 +2150,7 @@ void QFileDialogPrivate::createWidgets() qFileDialogUi->fileNameLabel->setBuddy(qFileDialogUi->fileNameEdit); #endif #ifndef QT_NO_COMPLETER - completer = new QFSCompletor(model, q); + completer = new QFSCompleter(model, q); qFileDialogUi->fileNameEdit->setCompleter(completer); QObject::connect(qFileDialogUi->fileNameEdit, SIGNAL(textChanged(QString)), q, SLOT(_q_autoCompleteFileName(QString))); @@ -2205,9 +2208,9 @@ void QFileDialogPrivate::createWidgets() treeHeader->addAction(showHeader); } - QItemSelectionModel *selModel = qFileDialogUi->treeView->selectionModel(); + QScopedPointer selModel(qFileDialogUi->treeView->selectionModel()); qFileDialogUi->treeView->setSelectionModel(qFileDialogUi->listView->selectionModel()); - delete selModel; + QObject::connect(qFileDialogUi->treeView, SIGNAL(activated(QModelIndex)), q, SLOT(_q_enterDirectory(QModelIndex))); QObject::connect(qFileDialogUi->treeView, SIGNAL(customContextMenuRequested(QPoint)), @@ -2289,9 +2292,9 @@ void QFileDialog::setProxyModel(QAbstractProxyModel *proxyModel) connect(d->model, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SLOT(_q_rowsInserted(const QModelIndex &))); } - QItemSelectionModel *selModel = d->qFileDialogUi->treeView->selectionModel(); + QScopedPointer selModel(d->qFileDialogUi->treeView->selectionModel()); d->qFileDialogUi->treeView->setSelectionModel(d->qFileDialogUi->listView->selectionModel()); - delete selModel; + d->setRootIndex(idx); // reconnect selection @@ -3172,7 +3175,7 @@ void QFileDialogLineEdit::keyPressEvent(QKeyEvent *e) #ifndef QT_NO_COMPLETER -QString QFSCompletor::pathFromIndex(const QModelIndex &index) const +QString QFSCompleter::pathFromIndex(const QModelIndex &index) const { const QFileSystemModel *dirModel; if (proxyModel) @@ -3187,7 +3190,7 @@ QString QFSCompletor::pathFromIndex(const QModelIndex &index) const return index.data(QFileSystemModel::FilePathRole).toString(); } -QStringList QFSCompletor::splitPath(const QString &path) const +QStringList QFSCompleter::splitPath(const QString &path) const { if (path.isEmpty()) return QStringList(completionPrefix()); diff --git a/src/gui/dialogs/qfiledialog_p.h b/src/gui/dialogs/qfiledialog_p.h index de7e332..99f61f0 100644 --- a/src/gui/dialogs/qfiledialog_p.h +++ b/src/gui/dialogs/qfiledialog_p.h @@ -76,6 +76,7 @@ #include #include #include "qsidebar_p.h" +#include "qfscompleter_p.h" #if defined (Q_OS_UNIX) #include @@ -91,25 +92,6 @@ class QCompleter; class QHBoxLayout; class Ui_QFileDialog; -#ifndef QT_NO_COMPLETER -/*! - QCompleter that can deal with QFileSystemModel - */ -class QFSCompletor : public QCompleter { -public: - QFSCompletor(QFileSystemModel *model, QObject *parent = 0) : QCompleter(model, parent), proxyModel(0), sourceModel(model) - { -#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) - setCaseSensitivity(Qt::CaseInsensitive); -#endif - } - QString pathFromIndex(const QModelIndex &index) const; - QStringList splitPath(const QString& path) const; - - QAbstractProxyModel *proxyModel; - QFileSystemModel *sourceModel; -}; -#endif // QT_NO_COMPLETER struct QFileDialogArgs { @@ -275,7 +257,7 @@ public: // data QStringList watching; QFileSystemModel *model; - QFSCompletor *completer; + QFSCompleter *completer; QFileDialog::FileMode fileMode; QFileDialog::AcceptMode acceptMode; @@ -357,7 +339,7 @@ public: void mac_nativeDialogModalHelp(); #endif - Ui_QFileDialog *qFileDialogUi; + QScopedPointer qFileDialogUi; QString acceptLabel; @@ -366,6 +348,11 @@ public: QByteArray signalToDisconnectOnClose; QFileDialog::Options opts; + + ~QFileDialogPrivate(); + +private: + Q_DISABLE_COPY(QFileDialogPrivate) }; class QFileDialogLineEdit : public QLineEdit diff --git a/src/gui/dialogs/qfileinfogatherer.cpp b/src/gui/dialogs/qfileinfogatherer.cpp index a2abe54..119164d 100644 --- a/src/gui/dialogs/qfileinfogatherer.cpp +++ b/src/gui/dialogs/qfileinfogatherer.cpp @@ -83,10 +83,10 @@ QFileInfoGatherer::QFileInfoGatherer(QObject *parent) */ QFileInfoGatherer::~QFileInfoGatherer() { - mutex.lock(); + QMutexLocker locker(&mutex); abort = true; condition.wakeOne(); - mutex.unlock(); + locker.unlock(); wait(); } @@ -94,9 +94,8 @@ void QFileInfoGatherer::setResolveSymlinks(bool enable) { Q_UNUSED(enable); #ifdef Q_OS_WIN - mutex.lock(); + QMutexLocker locker(&mutex); m_resolveSymlinks = enable; - mutex.unlock(); #endif } @@ -107,9 +106,8 @@ bool QFileInfoGatherer::resolveSymlinks() const void QFileInfoGatherer::setIconProvider(QFileIconProvider *provider) { - mutex.lock(); + QMutexLocker locker(&mutex); m_iconProvider = provider; - mutex.unlock(); } QFileIconProvider *QFileInfoGatherer::iconProvider() const @@ -124,12 +122,11 @@ QFileIconProvider *QFileInfoGatherer::iconProvider() const */ void QFileInfoGatherer::fetchExtendedInformation(const QString &path, const QStringList &files) { - mutex.lock(); + QMutexLocker locker(&mutex); // See if we already have this dir/file in our que int loc = this->path.lastIndexOf(path); while (loc > 0) { if (this->files.at(loc) == files) { - mutex.unlock(); return; } loc = this->path.lastIndexOf(path, loc - 1); @@ -137,7 +134,6 @@ void QFileInfoGatherer::fetchExtendedInformation(const QString &path, const QStr this->path.push(path); this->files.push(files); condition.wakeAll(); - mutex.unlock(); } /*! @@ -160,10 +156,9 @@ void QFileInfoGatherer::updateFile(const QString &filePath) void QFileInfoGatherer::clear() { #ifndef QT_NO_FILESYSTEMWATCHER - mutex.lock(); + QMutexLocker locker(&mutex); watcher->removePaths(watcher->files()); watcher->removePaths(watcher->directories()); - mutex.unlock(); #endif } @@ -175,9 +170,8 @@ void QFileInfoGatherer::clear() void QFileInfoGatherer::removePath(const QString &path) { #ifndef QT_NO_FILESYSTEMWATCHER - mutex.lock(); + QMutexLocker locker(&mutex); watcher->removePath(path); - mutex.unlock(); #endif } @@ -198,9 +192,8 @@ void QFileInfoGatherer::run() { forever { bool updateFiles = false; - mutex.lock(); + QMutexLocker locker(&mutex); if (abort) { - mutex.unlock(); return; } if (this->path.isEmpty()) @@ -214,8 +207,9 @@ void QFileInfoGatherer::run() this->files.pop_front(); updateFiles = true; } - mutex.unlock(); - if (updateFiles) getFileInfos(path, list); + locker.unlock(); + if (updateFiles) + getFileInfos(path, list); } } diff --git a/src/gui/dialogs/qfscompleter_p.h b/src/gui/dialogs/qfscompleter_p.h new file mode 100644 index 0000000..37d9c74 --- /dev/null +++ b/src/gui/dialogs/qfscompleter_p.h @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCOMPLETOR_P_H +#define QCOMPLETOR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qcompleter.h" +#include + +#ifndef QT_NO_COMPLETER +/*! + QCompleter that can deal with QFileSystemModel + */ +class QFSCompleter : public QCompleter { +public: + QFSCompleter(QFileSystemModel *model, QObject *parent = 0) + : QCompleter(model, parent), proxyModel(0), sourceModel(model) + { +#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) + setCaseSensitivity(Qt::CaseInsensitive); +#endif + } + QString pathFromIndex(const QModelIndex &index) const; + QStringList splitPath(const QString& path) const; + + QAbstractProxyModel *proxyModel; + QFileSystemModel *sourceModel; +}; +#endif // QT_NO_COMPLETER + +#endif // QCOMPLETOR_P_H + diff --git a/src/gui/dialogs/qpagesetupdialog_win.cpp b/src/gui/dialogs/qpagesetupdialog_win.cpp index 4bb571c..bdce8ab 100644 --- a/src/gui/dialogs/qpagesetupdialog_win.cpp +++ b/src/gui/dialogs/qpagesetupdialog_win.cpp @@ -71,7 +71,7 @@ int QPageSetupDialog::exec() return Rejected; QWin32PrintEngine *engine = static_cast(d->printer->paintEngine()); - QWin32PrintEnginePrivate *ep = static_cast(engine->d_ptr); + QWin32PrintEnginePrivate *ep = static_cast(engine->d_ptr.data()); PAGESETUPDLG psd; memset(&psd, 0, sizeof(PAGESETUPDLG)); diff --git a/src/gui/dialogs/qprintdialog_unix.cpp b/src/gui/dialogs/qprintdialog_unix.cpp index 87a4e65..17d0047 100644 --- a/src/gui/dialogs/qprintdialog_unix.cpp +++ b/src/gui/dialogs/qprintdialog_unix.cpp @@ -44,7 +44,6 @@ #ifndef QT_NO_PRINTDIALOG #include "private/qabstractprintdialog_p.h" -#include "qfiledialog_p.h" #include #include "qprintdialog.h" #include "qfiledialog.h" @@ -55,6 +54,7 @@ #include +#include "qfscompleter_p.h" #include "ui_qprintpropertieswidget.h" #include "ui_qprintsettingsoutput.h" #include "ui_qprintwidget.h" @@ -696,7 +696,7 @@ QUnixPrintWidgetPrivate::QUnixPrintWidgetPrivate(QUnixPrintWidget *p) QFileSystemModel *fsm = new QFileSystemModel(widget.filename); fsm->setRootPath(QDir::homePath()); #if !defined(QT_NO_COMPLETER) && !defined(QT_NO_FILEDIALOG) - widget.filename->setCompleter(new QFSCompletor(fsm, widget.filename)); + widget.filename->setCompleter(new QFSCompleter(fsm, widget.filename)); #endif #endif _q_printerChanged(currentPrinterIndex); diff --git a/src/gui/dialogs/qprintpreviewdialog.cpp b/src/gui/dialogs/qprintpreviewdialog.cpp index c00bd14..61949d8 100644 --- a/src/gui/dialogs/qprintpreviewdialog.cpp +++ b/src/gui/dialogs/qprintpreviewdialog.cpp @@ -42,6 +42,7 @@ #include "qprintpreviewdialog.h" #include "qprintpreviewwidget.h" #include +#include "private/qdialog_p.h" #include #include @@ -128,12 +129,12 @@ private: }; } // anonymous namespace -class QPrintPreviewDialogPrivate +class QPrintPreviewDialogPrivate : public QDialogPrivate { Q_DECLARE_PUBLIC(QPrintPreviewDialog) public: - QPrintPreviewDialogPrivate(QPrintPreviewDialog *q) - : q_ptr(q), printDialog(0), ownPrinter(false), + QPrintPreviewDialogPrivate() + : printDialog(0), ownPrinter(false), initialized(false) {} // private slots @@ -158,7 +159,6 @@ public: void updatePageNumLabel(); void updateZoomFactor(); - QPrintPreviewDialog *q_ptr; QPrintDialog *printDialog; QPrintPreviewWidget *preview; QPrinter *printer; @@ -680,7 +680,7 @@ void QPrintPreviewDialogPrivate::_q_zoomFactorChanged() \sa QWidget::setWindowFlags() */ QPrintPreviewDialog::QPrintPreviewDialog(QPrinter* printer, QWidget *parent, Qt::WindowFlags flags) - : QDialog(parent, flags), d_ptr(new QPrintPreviewDialogPrivate(this)) + : QDialog(*new QPrintPreviewDialogPrivate, parent, flags) { Q_D(QPrintPreviewDialog); d->init(printer); @@ -694,7 +694,7 @@ QPrintPreviewDialog::QPrintPreviewDialog(QPrinter* printer, QWidget *parent, Qt: system default printer. */ QPrintPreviewDialog::QPrintPreviewDialog(QWidget *parent, Qt::WindowFlags f) - : QDialog(parent, f), d_ptr(new QPrintPreviewDialogPrivate(this)) + : QDialog(*new QPrintPreviewDialogPrivate, parent, f) { Q_D(QPrintPreviewDialog); d->init(); @@ -709,7 +709,6 @@ QPrintPreviewDialog::~QPrintPreviewDialog() if (d->ownPrinter) delete d->printer; delete d->printDialog; - delete d_ptr; } /*! diff --git a/src/gui/dialogs/qprintpreviewdialog.h b/src/gui/dialogs/qprintpreviewdialog.h index c3a4d57..49262db 100644 --- a/src/gui/dialogs/qprintpreviewdialog.h +++ b/src/gui/dialogs/qprintpreviewdialog.h @@ -94,7 +94,7 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_previewChanged()) Q_PRIVATE_SLOT(d_func(), void _q_zoomFactorChanged()) - QPrintPreviewDialogPrivate *d_ptr; + void *dummy; // ### Qt 5 - remove me }; diff --git a/src/gui/embedded/qsoundqss_qws.cpp b/src/gui/embedded/qsoundqss_qws.cpp index 283bbd3..ed988ca 100644 --- a/src/gui/embedded/qsoundqss_qws.cpp +++ b/src/gui/embedded/qsoundqss_qws.cpp @@ -1036,24 +1036,28 @@ void QWSSoundServerPrivate::stopFile(int wid, int sid) void QWSSoundServerPrivate::stopAll(int wid) { QWSSoundServerProvider *bucket; - QList::Iterator it = active.begin(); - while (it != active.end()) { - bucket = *it; - if (bucket->groupId() == wid) { - it = active.erase(it); - delete bucket; - } else { - ++it; + if (!active.isEmpty()) { + QList::Iterator it = active.begin(); + while (it != active.end()) { + bucket = *it; + if (bucket->groupId() == wid) { + it = active.erase(it); + delete bucket; + } else { + ++it; + } } } - it = inactive.begin(); - while (it != inactive.end()) { - bucket = *it; - if (bucket->groupId() == wid) { - it = inactive.erase(it); - delete bucket; - } else { - ++it; + if (!inactive.isEmpty()) { + QList::Iterator it = inactive.begin(); + while (it != inactive.end()) { + bucket = *it; + if (bucket->groupId() == wid) { + it = inactive.erase(it); + delete bucket; + } else { + ++it; + } } } } diff --git a/src/gui/embedded/qwindowsystem_qws.cpp b/src/gui/embedded/qwindowsystem_qws.cpp index fdcd193..e3d56ad 100644 --- a/src/gui/embedded/qwindowsystem_qws.cpp +++ b/src/gui/embedded/qwindowsystem_qws.cpp @@ -1304,7 +1304,13 @@ QWSServer::QWSServer(int flags, QObject *parent) : QObject(*new QWSServerPrivate, parent) { Q_D(QWSServer); - d->initServer(flags); + QT_TRY { + d->initServer(flags); + } QT_CATCH(...) { + qwsServer = 0; + qwsServerPrivate = 0; + QT_RETHROW; + } } #ifdef QT3_SUPPORT @@ -1750,21 +1756,23 @@ void QWSServerPrivate::cleanupFonts(bool force) #if defined(QWS_DEBUG_FONTCLEANUP) qDebug() << "cleanupFonts()"; #endif - QMap::Iterator it = fontReferenceCount.begin(); - while (it != fontReferenceCount.end()) { - if (it.value() && !force) { - ++it; - continue; - } + if (!fontReferenceCount.isEmpty()) { + QMap::Iterator it = fontReferenceCount.begin(); + while (it != fontReferenceCount.end()) { + if (it.value() && !force) { + ++it; + continue; + } - const QByteArray &fontName = it.key(); + const QByteArray &fontName = it.key(); #if defined(QWS_DEBUG_FONTCLEANUP) - qDebug() << "removing unused font file" << fontName; + qDebug() << "removing unused font file" << fontName; #endif - QFile::remove(QFile::decodeName(fontName)); - sendFontRemovedEvent(fontName); + QFile::remove(QFile::decodeName(fontName)); + sendFontRemovedEvent(fontName); - it = fontReferenceCount.erase(it); + it = fontReferenceCount.erase(it); + } } if (crashedClientIds.isEmpty()) @@ -3966,7 +3974,8 @@ void QWSServerPrivate::openDisplay() void QWSServerPrivate::closeDisplay() { - qt_screen->shutdownDevice(); + if (qt_screen) + qt_screen->shutdownDevice(); } /*! @@ -4065,9 +4074,14 @@ void QWSServer::startup(int flags) void QWSServer::closedown() { - unlink(qws_qtePipeFilename().toLatin1().constData()); - delete qwsServer; + QScopedPointer server(qwsServer); qwsServer = 0; + QT_TRY { + unlink(qws_qtePipeFilename().toLatin1().constData()); + } QT_CATCH(const std::bad_alloc &) { + // ### TODO - what to do when we run out of memory + // when calling toLatin1? + } } void QWSServerPrivate::emergency_cleanup() diff --git a/src/gui/embedded/qwscursor_qws.cpp b/src/gui/embedded/qwscursor_qws.cpp index 3a5bd2c..b25e9b1 100644 --- a/src/gui/embedded/qwscursor_qws.cpp +++ b/src/gui/embedded/qwscursor_qws.cpp @@ -531,7 +531,7 @@ void QWSCursor::set(const uchar *data, const uchar *mask, cursor = QImage(width,height, QImage::Format_Indexed8); - if (!width || !height || !data || !mask) + if (!width || !height || !data || !mask || cursor.isNull()) return; cursor.setNumColors(3); diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index ed1891c..596326b 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -875,8 +875,6 @@ QGraphicsItem::~QGraphicsItem() if (d_ptr->scene) d_ptr->scene->d_func()->_q_removeItemLater(this); - delete d_ptr; - qt_dataStore()->data.remove(this); } @@ -2732,7 +2730,7 @@ QTransform QGraphicsItem::itemTransform(const QGraphicsItem *other, bool *ok) co QTransform x; const QGraphicsItem *p = child; do { - const QGraphicsItemPrivate *pd = p->d_ptr; + const QGraphicsItemPrivate *pd = p->d_ptr.data(); if (pd->hasTransform) x *= p->transform(); if (!pd->pos.isNull()) @@ -3070,7 +3068,7 @@ QRectF QGraphicsItem::sceneBoundingRect() const const QGraphicsItem *parentItem = this; const QGraphicsItemPrivate *itemd; do { - itemd = parentItem->d_ptr; + itemd = parentItem->d_ptr.data(); if (itemd->hasTransform) break; offset += itemd->pos; diff --git a/src/gui/graphicsview/qgraphicsitem.h b/src/gui/graphicsview/qgraphicsitem.h index b98882d..25678a6 100644 --- a/src/gui/graphicsview/qgraphicsitem.h +++ b/src/gui/graphicsview/qgraphicsitem.h @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -380,7 +381,7 @@ protected: protected: QGraphicsItem(QGraphicsItemPrivate &dd, QGraphicsItem *parent, QGraphicsScene *scene); - QGraphicsItemPrivate *d_ptr; + QScopedPointer d_ptr; void addToIndex(); void removeFromIndex(); diff --git a/src/gui/graphicsview/qgraphicslayoutitem.cpp b/src/gui/graphicsview/qgraphicslayoutitem.cpp index b46e05e..c291763 100644 --- a/src/gui/graphicsview/qgraphicslayoutitem.cpp +++ b/src/gui/graphicsview/qgraphicslayoutitem.cpp @@ -307,7 +307,6 @@ QGraphicsLayoutItem::~QGraphicsLayoutItem() } } } - delete d_ptr; } /*! diff --git a/src/gui/graphicsview/qgraphicslayoutitem.h b/src/gui/graphicsview/qgraphicslayoutitem.h index 31f5d90..d667c4f 100644 --- a/src/gui/graphicsview/qgraphicslayoutitem.h +++ b/src/gui/graphicsview/qgraphicslayoutitem.h @@ -42,6 +42,7 @@ #ifndef QGRAPHICSLAYOUTITEM_H #define QGRAPHICSLAYOUTITEM_H +#include #include #include @@ -112,7 +113,7 @@ protected: QGraphicsLayoutItem(QGraphicsLayoutItemPrivate &dd); virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const = 0; - QGraphicsLayoutItemPrivate *d_ptr; + QScopedPointer d_ptr; private: QSizeF *effectiveSizeHints(const QSizeF &constraint) const; diff --git a/src/gui/graphicsview/qgraphicsproxywidget.h b/src/gui/graphicsview/qgraphicsproxywidget.h index b2c3c8f..f006319 100644 --- a/src/gui/graphicsview/qgraphicsproxywidget.h +++ b/src/gui/graphicsview/qgraphicsproxywidget.h @@ -127,7 +127,7 @@ protected Q_SLOTS: private: Q_DISABLE_COPY(QGraphicsProxyWidget) - Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr, QGraphicsProxyWidget) + Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QGraphicsProxyWidget) Q_PRIVATE_SLOT(d_func(), void _q_removeWidgetSlot()) friend class QWidget; diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index b89e352..5114351 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -1824,8 +1824,8 @@ void QGraphicsScenePrivate::invalidateSortCache() inline bool qt_closestLeaf(const QGraphicsItem *item1, const QGraphicsItem *item2) { // Return true if sibling item1 is on top of item2. - const QGraphicsItemPrivate *d1 = item1->d_ptr; - const QGraphicsItemPrivate *d2 = item2->d_ptr; + const QGraphicsItemPrivate *d1 = item1->d_ptr.data(); + const QGraphicsItemPrivate *d2 = item2->d_ptr.data(); bool f1 = d1->flags & QGraphicsItem::ItemStacksBehindParent; bool f2 = d2->flags & QGraphicsItem::ItemStacksBehindParent; if (f1 != f2) return f2; @@ -1852,8 +1852,8 @@ inline bool qt_closestItemFirst(const QGraphicsItem *item1, const QGraphicsItem bool QGraphicsScenePrivate::closestItemFirst_withoutCache(const QGraphicsItem *item1, const QGraphicsItem *item2) { // Siblings? Just check their z-values. - const QGraphicsItemPrivate *d1 = item1->d_ptr; - const QGraphicsItemPrivate *d2 = item2->d_ptr; + const QGraphicsItemPrivate *d1 = item1->d_ptr.data(); + const QGraphicsItemPrivate *d2 = item2->d_ptr.data(); if (d1->parent == d2->parent) return qt_closestLeaf(item1, item2); @@ -4687,7 +4687,7 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte const QStyleOptionGraphicsItem *option, QWidget *widget, bool painterStateProtection) { - QGraphicsItemPrivate *itemd = item->d_ptr; + QGraphicsItemPrivate *itemd = item->d_ptr.data(); QGraphicsItem::CacheMode cacheMode = QGraphicsItem::CacheMode(itemd->cacheMode); // Render directly, using no cache. diff --git a/src/gui/graphicsview/qgraphicssceneevent.cpp b/src/gui/graphicsview/qgraphicssceneevent.cpp index 0ffd2b1..ad57aac 100644 --- a/src/gui/graphicsview/qgraphicssceneevent.cpp +++ b/src/gui/graphicsview/qgraphicssceneevent.cpp @@ -313,7 +313,6 @@ QGraphicsSceneEvent::QGraphicsSceneEvent(QGraphicsSceneEventPrivate &dd, Type ty */ QGraphicsSceneEvent::~QGraphicsSceneEvent() { - delete d_ptr; } /*! diff --git a/src/gui/graphicsview/qgraphicssceneevent.h b/src/gui/graphicsview/qgraphicssceneevent.h index be50e96..4ebe3df 100644 --- a/src/gui/graphicsview/qgraphicssceneevent.h +++ b/src/gui/graphicsview/qgraphicssceneevent.h @@ -44,6 +44,7 @@ #include #include +#include QT_BEGIN_HEADER @@ -70,7 +71,7 @@ public: protected: QGraphicsSceneEvent(QGraphicsSceneEventPrivate &dd, Type type = None); - QGraphicsSceneEventPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QGraphicsSceneEvent) }; diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 8137f8e..96e9a96 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -753,7 +753,7 @@ QRect QGraphicsViewPrivate::mapToViewRect(const QGraphicsItem *item, const QRect const QGraphicsItem *parentItem = item; const QGraphicsItemPrivate *itemd; do { - itemd = parentItem->d_ptr; + itemd = parentItem->d_ptr.data(); if (itemd->hasTransform) break; offset += itemd->pos; diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp index 7781258..aa2b9bf 100644 --- a/src/gui/graphicsview/qgraphicswidget.cpp +++ b/src/gui/graphicsview/qgraphicswidget.cpp @@ -366,7 +366,7 @@ void QGraphicsWidget::resize(const QSizeF &size) void QGraphicsWidget::setGeometry(const QRectF &rect) { QGraphicsWidgetPrivate *wd = QGraphicsWidget::d_func(); - QGraphicsLayoutItemPrivate *d = QGraphicsLayoutItem::d_ptr; + QGraphicsLayoutItemPrivate *d = QGraphicsLayoutItem::d_ptr.data(); QRectF newGeom; QPointF oldPos = d->geom.topLeft(); if (!wd->inSetPos) { diff --git a/src/gui/graphicsview/qgraphicswidget.h b/src/gui/graphicsview/qgraphicswidget.h index 34f1c5f..49de542 100644 --- a/src/gui/graphicsview/qgraphicswidget.h +++ b/src/gui/graphicsview/qgraphicswidget.h @@ -225,7 +225,7 @@ protected: private: Q_DISABLE_COPY(QGraphicsWidget) - Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr, QGraphicsWidget) + Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QGraphicsWidget) friend class QGraphicsScene; friend class QGraphicsScenePrivate; friend class QGraphicsView; diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 70d4e2c..34ad99c 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -185,6 +185,13 @@ static int depthForFormat(QImage::Format format) return depth; } +/*! \fn QImageData * QImageData::create(const QSize &size, QImage::Format format, int numColors) + + \internal + + Creates a new image data. + Returns 0 if invalid parameters are give or anything else failed. +*/ QImageData * QImageData::create(const QSize &size, QImage::Format format, int numColors) { if (!size.isValid() || numColors < 0 || format == QImage::Format_Invalid) @@ -223,7 +230,7 @@ QImageData * QImageData::create(const QSize &size, QImage::Format format, int nu || INT_MAX/sizeof(uchar *) < uint(height)) return 0; - QImageData *d = new QImageData; + QScopedPointer d(new QImageData); d->colortable.resize(numColors); if (depth == 1) { d->colortable[0] = QColor(Qt::black).rgba(); @@ -246,12 +253,11 @@ QImageData * QImageData::create(const QSize &size, QImage::Format format, int nu d->data = (uchar *)malloc(d->nbytes); if (!d->data) { - delete d; return 0; } d->ref.ref(); - return d; + return d.take(); } @@ -1621,6 +1627,7 @@ int QImage::numColors() const /*! Returns a pointer to the scanline pointer table. This is the beginning of the data block for the image. + Returns 0 in case of an error. Use the bits() or scanLine() function instead. */ @@ -1636,6 +1643,8 @@ uchar **QImage::jumpTable() if (!d->jumptable) { d->jumptable = (uchar **)malloc(d->height*sizeof(uchar *)); + if (!d->jumptable) + return 0; uchar *data = d->data; int height = d->height; uchar **p = d->jumptable; @@ -1656,6 +1665,8 @@ const uchar * const *QImage::jumpTable() const return 0; if (!d->jumptable) { d->jumptable = (uchar **)malloc(d->height*sizeof(uchar *)); + if (!d->jumptable) + return 0; uchar *data = d->data; int height = d->height; uchar **p = d->jumptable; diff --git a/src/gui/image/qimageiohandler.cpp b/src/gui/image/qimageiohandler.cpp index a47c69e..f432f87 100644 --- a/src/gui/image/qimageiohandler.cpp +++ b/src/gui/image/qimageiohandler.cpp @@ -272,7 +272,6 @@ QImageIOHandler::QImageIOHandler(QImageIOHandlerPrivate &dd) */ QImageIOHandler::~QImageIOHandler() { - delete d_ptr; } /*! diff --git a/src/gui/image/qimageiohandler.h b/src/gui/image/qimageiohandler.h index 3b654f3..34de715 100644 --- a/src/gui/image/qimageiohandler.h +++ b/src/gui/image/qimageiohandler.h @@ -44,6 +44,7 @@ #include #include +#include QT_BEGIN_HEADER @@ -109,7 +110,7 @@ public: protected: QImageIOHandler(QImageIOHandlerPrivate &dd); - QImageIOHandlerPrivate *d_ptr; + QScopedPointer d_ptr; private: Q_DISABLE_COPY(QImageIOHandler) }; diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp index 92023e0..8528173 100644 --- a/src/gui/image/qpicture.cpp +++ b/src/gui/image/qpicture.cpp @@ -132,7 +132,6 @@ QPicture::QPicture(int formatVersion) { Q_D(QPicture); d_ptr->q_ptr = this; - d->paintEngine = 0; if (formatVersion == 0) qWarning("QPicture: invalid format version 0"); @@ -155,7 +154,7 @@ QPicture::QPicture(int formatVersion) */ QPicture::QPicture(const QPicture &pic) - : QPaintDevice(), d_ptr(pic.d_ptr) + : QPaintDevice(), d_ptr(pic.d_ptr.data()) { d_func()->ref.ref(); } @@ -173,10 +172,6 @@ QPicture::QPicture(QPicturePrivate &dptr) */ QPicture::~QPicture() { - if (!d_func()->ref.deref()) { - delete d_func()->paintEngine; - delete d_func(); - } } /*! @@ -1030,9 +1025,7 @@ void QPicture::detach_helper() x->formatMinor = d->formatMinor; x->brect = d->brect; x->override_rect = d->override_rect; - if (!d->ref.deref()) - delete d; - d_ptr = x; + d_ptr.reset(x); } /*! @@ -1041,7 +1034,7 @@ void QPicture::detach_helper() */ QPicture& QPicture::operator=(const QPicture &p) { - qAtomicAssign(d_ptr, p.d_ptr); + d_ptr.assign(p.d_ptr.data()); return *this; } @@ -1135,8 +1128,8 @@ bool QPicturePrivate::checkFormat() QPaintEngine *QPicture::paintEngine() const { if (!d_func()->paintEngine) - const_cast(this)->d_func()->paintEngine = new QPicturePaintEngine; - return d_func()->paintEngine; + const_cast(this)->d_func()->paintEngine.reset(new QPicturePaintEngine); + return d_func()->paintEngine.data(); } /***************************************************************************** diff --git a/src/gui/image/qpicture.h b/src/gui/image/qpicture.h index fe86e8d..7de1f79 100644 --- a/src/gui/image/qpicture.h +++ b/src/gui/image/qpicture.h @@ -106,7 +106,7 @@ private: bool exec(QPainter *p, QDataStream &ds, int i); void detach_helper(); - QPicturePrivate *d_ptr; + QScopedSharedPointer d_ptr; friend class QPicturePaintEngine; friend class Q3Picture; friend class QAlphaPaintEngine; @@ -114,7 +114,7 @@ private: public: typedef QPicturePrivate* DataPtr; - inline DataPtr &data_ptr() { return d_ptr; } + inline DataPtr &data_ptr() { return d_ptr.data_ptr(); } }; Q_DECLARE_SHARED(QPicture) diff --git a/src/gui/image/qpicture_p.h b/src/gui/image/qpicture_p.h index a3fd34f..e0c3117 100644 --- a/src/gui/image/qpicture_p.h +++ b/src/gui/image/qpicture_p.h @@ -156,7 +156,7 @@ public: int formatMinor; QRect brect; QRect override_rect; - QPaintEngine *paintEngine; + QScopedPointer paintEngine; bool in_memory_only; QList image_list; QList pixmap_list; diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp index 3ea50ff..132e26e 100644 --- a/src/gui/image/qpixmap_s60.cpp +++ b/src/gui/image/qpixmap_s60.cpp @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include #include #include diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp index c9973d0..4f71e09 100644 --- a/src/gui/image/qpixmapcache.cpp +++ b/src/gui/image/qpixmapcache.cpp @@ -323,7 +323,12 @@ void QPixmapCache::remove(const QString &key) void QPixmapCache::clear() { - pm_cache()->clear(); + QT_TRY { + pm_cache()->clear(); + } QT_CATCH(const std::bad_alloc &) { + // if we ran out of memory during pm_cache(), it's no leak, + // so just ignore it. + } } QT_END_NAMESPACE diff --git a/src/gui/itemviews/qabstractitemview_p.h b/src/gui/itemviews/qabstractitemview_p.h index 16bd1ab..c4bf4db 100644 --- a/src/gui/itemviews/qabstractitemview_p.h +++ b/src/gui/itemviews/qabstractitemview_p.h @@ -304,7 +304,7 @@ public: */ inline bool isPersistent(const QModelIndex &index) const { - return static_cast(model->d_ptr)->persistent.indexes.contains(index); + return static_cast(model->d_ptr.data())->persistent.indexes.contains(index); } QModelIndexList selectedDraggableIndexes() const; diff --git a/src/gui/itemviews/qfileiconprovider.cpp b/src/gui/itemviews/qfileiconprovider.cpp index ac62551..af4d42a 100644 --- a/src/gui/itemviews/qfileiconprovider.cpp +++ b/src/gui/itemviews/qfileiconprovider.cpp @@ -180,7 +180,6 @@ QFileIconProvider::QFileIconProvider() QFileIconProvider::~QFileIconProvider() { - delete d_ptr; } /*! diff --git a/src/gui/itemviews/qfileiconprovider.h b/src/gui/itemviews/qfileiconprovider.h index 7928552..a6152ea 100644 --- a/src/gui/itemviews/qfileiconprovider.h +++ b/src/gui/itemviews/qfileiconprovider.h @@ -42,8 +42,9 @@ #ifndef QFILEICONPROVIDER_H #define QFILEICONPROVIDER_H -#include #include +#include +#include QT_BEGIN_HEADER @@ -67,7 +68,7 @@ public: private: Q_DECLARE_PRIVATE(QFileIconProvider) - QFileIconProviderPrivate *d_ptr; + QScopedPointer d_ptr; Q_DISABLE_COPY(QFileIconProvider) }; diff --git a/src/gui/itemviews/qstandarditemmodel.cpp b/src/gui/itemviews/qstandarditemmodel.cpp index 61e410d..4ec00bb 100644 --- a/src/gui/itemviews/qstandarditemmodel.cpp +++ b/src/gui/itemviews/qstandarditemmodel.cpp @@ -778,8 +778,6 @@ QStandardItem &QStandardItem::operator=(const QStandardItem &other) */ QStandardItem::~QStandardItem() { - Q_D(QStandardItem); - delete d; } /*! diff --git a/src/gui/itemviews/qstandarditemmodel.h b/src/gui/itemviews/qstandarditemmodel.h index f24f0ab..66d7576 100644 --- a/src/gui/itemviews/qstandarditemmodel.h +++ b/src/gui/itemviews/qstandarditemmodel.h @@ -240,7 +240,7 @@ protected: QStandardItem(const QStandardItem &other); QStandardItem(QStandardItemPrivate &dd); QStandardItem &operator=(const QStandardItem &other); - QStandardItemPrivate *d_ptr; + QScopedPointer d_ptr; void emitDataChanged(); diff --git a/src/gui/itemviews/qtreewidget.cpp b/src/gui/itemviews/qtreewidget.cpp index 6103225..0f2a27c 100644 --- a/src/gui/itemviews/qtreewidget.cpp +++ b/src/gui/itemviews/qtreewidget.cpp @@ -853,7 +853,7 @@ void QTreeModel::sortItems(QList *items, int column, Qt::SortO items->replace(r, item); for (int c = 0; c < colCount; ++c) { QModelIndex from = createIndex(oldRow, c, item); - if (static_cast(d_ptr)->persistent.indexes.contains(from)) { + if (static_cast(d_ptr.data())->persistent.indexes.contains(from)) { QModelIndex to = createIndex(r, c, item); fromList << from; toList << to; diff --git a/src/gui/itemviews/qtreewidgetitemiterator.cpp b/src/gui/itemviews/qtreewidgetitemiterator.cpp index 3e30e03..7e167b9 100644 --- a/src/gui/itemviews/qtreewidgetitemiterator.cpp +++ b/src/gui/itemviews/qtreewidgetitemiterator.cpp @@ -97,7 +97,7 @@ QTreeWidgetItemIterator::QTreeWidgetItemIterator(QTreeWidget *widget, IteratorFl Q_ASSERT(widget); QTreeModel *model = qobject_cast(widget->model()); Q_ASSERT(model); - d_ptr = new QTreeWidgetItemIteratorPrivate(this, model); + d_ptr.reset(new QTreeWidgetItemIteratorPrivate(this, model)); model->iterators.append(this); if (!model->rootItem->children.isEmpty()) current = model->rootItem->children.first(); if (current && !matchesFlags(current)) @@ -150,7 +150,6 @@ QTreeWidgetItemIterator::QTreeWidgetItemIterator(QTreeWidgetItem *item, Iterator QTreeWidgetItemIterator::~QTreeWidgetItemIterator() { d_func()->m_model->iterators.removeAll(this); - delete d_ptr; } /*! diff --git a/src/gui/itemviews/qtreewidgetitemiterator.h b/src/gui/itemviews/qtreewidgetitemiterator.h index 8a76c69..535339d 100644 --- a/src/gui/itemviews/qtreewidgetitemiterator.h +++ b/src/gui/itemviews/qtreewidgetitemiterator.h @@ -43,6 +43,7 @@ #define QTREEWIDGETITEMITERATOR_H #include +#include QT_BEGIN_HEADER @@ -105,7 +106,7 @@ public: private: bool matchesFlags(const QTreeWidgetItem *item) const; - QTreeWidgetItemIteratorPrivate *d_ptr; + QScopedPointer d_ptr; QTreeWidgetItem *current; IteratorFlags flags; Q_DECLARE_PRIVATE(QTreeWidgetItemIterator) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index eaaeb4b..aa6d21e 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -1006,7 +1006,8 @@ QApplication::~QApplication() if (QWidgetPrivate::mapper) { QWidgetMapper * myMapper = QWidgetPrivate::mapper; QWidgetPrivate::mapper = 0; - for (QWidgetMapper::Iterator it = myMapper->begin(); it != myMapper->end(); ++it) { + for (QWidgetMapper::ConstIterator it = myMapper->constBegin(); + it != myMapper->constEnd(); ++it) { register QWidget *w = *it; if (!w->parent()) // window w->destroy(true, true); @@ -1018,7 +1019,7 @@ QApplication::~QApplication() if (QWidgetPrivate::uncreatedWidgets) { QWidgetSet *mySet = QWidgetPrivate::uncreatedWidgets; QWidgetPrivate::uncreatedWidgets = 0; - for (QWidgetSet::Iterator it = mySet->begin(); it != mySet->end(); ++it) { + for (QWidgetSet::ConstIterator it = mySet->constBegin(); it != mySet->constEnd(); ++it) { register QWidget *w = *it; if (!w->parent()) // window w->destroy(true, true); @@ -4993,8 +4994,7 @@ void QApplication::setInputContext(QInputContext *inputContext) qWarning("QApplication::setInputContext: called with 0 input context"); return; } - if (d->inputContext) - delete d->inputContext; + delete d->inputContext; d->inputContext = inputContext; } diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index a6fc602..35a532a 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -100,6 +100,7 @@ extern QSysInfo::MacVersion qt_macver; #if defined(Q_WS_QWS) class QWSManager; class QDirectPainter; +struct QWSServerCleaner { ~QWSServerCleaner(); }; #endif #ifndef QT_NO_TABLET @@ -382,6 +383,7 @@ public: #ifdef Q_WS_QWS QPointer last_manager; + QWSServerCleaner qwsServerCleaner; # ifndef QT_NO_DIRECTPAINTER QMap *directPainters; # endif diff --git a/src/gui/kernel/qapplication_qws.cpp b/src/gui/kernel/qapplication_qws.cpp index 018440f..aeebde4 100644 --- a/src/gui/kernel/qapplication_qws.cpp +++ b/src/gui/kernel/qapplication_qws.cpp @@ -159,6 +159,8 @@ bool qws_overrideCursor = false; #ifndef QT_NO_QWS_MANAGER #include "qdecorationfactory_qws.h" +extern Q_GUI_EXPORT QWSServer *qwsServer; + QT_BEGIN_NAMESPACE QT_USE_NAMESPACE @@ -485,8 +487,13 @@ QList *qt_get_server_queue() void qt_server_enqueue(const QWSCommand *command) { QWSCommand *copy = QWSCommand::factory(command->type); - copy->copyFrom(command); - outgoing.append(copy); + QT_TRY { + copy->copyFrom(command); + outgoing.append(copy); + } QT_CATCH(...) { + delete copy; + QT_RETHROW; + } } QWSDisplay::Data::Data(QObject* parent, bool singleProcess) @@ -2295,7 +2302,7 @@ void qt_init(QApplicationPrivate *priv, int type) qws_decoration = QApplication::qwsSetDecoration(decoration); #endif // QT_NO_QWS_MANAGER #ifndef QT_NO_QWS_INPUTMETHODS - qApp->setInputContext(new QWSInputContext); + qApp->setInputContext(new QWSInputContext(qApp)); #endif } @@ -3542,10 +3549,10 @@ bool QETWidget::translateKeyEvent(const QWSKeyEvent *event, bool grab) /* grab i #if defined QT3_SUPPORT && !defined(QT_NO_SHORTCUT) if (type == QEvent::KeyPress && !grab - && static_cast(qApp->d_ptr)->use_compat()) { + && static_cast(qApp->d_ptr.data())->use_compat()) { // send accel events if the keyboard is not grabbed QKeyEvent a(type, code, state, text, autor, int(text.length())); - if (static_cast(qApp->d_ptr)->qt_tryAccelEvent(this, &a)) + if (static_cast(qApp->d_ptr.data())->qt_tryAccelEvent(this, &a)) return true; } #else @@ -3745,4 +3752,14 @@ void QApplication::setArgs(int c, char **v) d->argv = v; } +/* \internal + This is used to clean up the qws server + in case the QApplication constructor threw an exception + */ +QWSServerCleaner::~QWSServerCleaner() +{ + if (qwsServer && qws_single_process) + QWSServer::closedown(); +} + QT_END_NAMESPACE diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 2f7bdcf..976d9f6 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -441,6 +441,13 @@ void QSymbianControl::sendMouseEvent(QWidget *widget, QMouseEvent *mEvent) TKeyResponse QSymbianControl::OfferKeyEventL(const TKeyEvent& keyEvent, TEventCode type) { + TKeyResponse r = EKeyWasNotConsumed; + QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(r = OfferKeyEvent(keyEvent, type)); + return r; +} + +TKeyResponse QSymbianControl::OfferKeyEvent(const TKeyEvent& keyEvent, TEventCode type) +{ switch (type) { //case EEventKeyDown: // <-- Intentionally left out. See below. case EEventKeyUp: diff --git a/src/gui/kernel/qcursor_qws.cpp b/src/gui/kernel/qcursor_qws.cpp index 097b982..99800a8 100644 --- a/src/gui/kernel/qcursor_qws.cpp +++ b/src/gui/kernel/qcursor_qws.cpp @@ -66,7 +66,11 @@ QCursorData::~QCursorData() { delete bm; delete bmm; - QPaintDevice::qwsDisplay()->destroyCursor(id); + QT_TRY { + QPaintDevice::qwsDisplay()->destroyCursor(id); + } QT_CATCH(const std::bad_alloc &) { + // do nothing. + } } diff --git a/src/gui/kernel/qeventdispatcher_s60.cpp b/src/gui/kernel/qeventdispatcher_s60.cpp index 6ac2863..fcf572e 100644 --- a/src/gui/kernel/qeventdispatcher_s60.cpp +++ b/src/gui/kernel/qeventdispatcher_s60.cpp @@ -62,18 +62,22 @@ bool QEventDispatcherS60::processEvents ( QEventLoop::ProcessEventsFlags flags ) { bool ret = false; - bool oldNoInputEventsValue = m_noInputEvents; - if (flags & QEventLoop::ExcludeUserInputEvents) { - m_noInputEvents = true; - } else { - m_noInputEvents = false; - ret = sendDeferredInputEvents() || ret; + QT_TRY { + bool oldNoInputEventsValue = m_noInputEvents; + if (flags & QEventLoop::ExcludeUserInputEvents) { + m_noInputEvents = true; + } else { + m_noInputEvents = false; + ret = sendDeferredInputEvents() || ret; + } + + ret = QEventDispatcherSymbian::processEvents(flags) || ret; + + m_noInputEvents = oldNoInputEventsValue; + } QT_CATCH (const std::exception& ex) { + CActiveScheduler::Current()->Error(qt_translateExceptionToSymbianError(ex)); } - ret = QEventDispatcherSymbian::processEvents(flags) || ret; - - m_noInputEvents = oldNoInputEventsValue; - return ret; } diff --git a/src/gui/kernel/qshortcutmap.cpp b/src/gui/kernel/qshortcutmap.cpp index 86894b4..7a19252 100644 --- a/src/gui/kernel/qshortcutmap.cpp +++ b/src/gui/kernel/qshortcutmap.cpp @@ -148,9 +148,8 @@ public: QShortcutMap constructor. */ QShortcutMap::QShortcutMap() + : d_ptr(new QShortcutMapPrivate(this)) { - d_ptr = new QShortcutMapPrivate(this); - Q_ASSERT(d_ptr != 0); resetState(); } @@ -159,8 +158,6 @@ QShortcutMap::QShortcutMap() */ QShortcutMap::~QShortcutMap() { - delete d_ptr; - d_ptr = 0; } /*! \internal diff --git a/src/gui/kernel/qshortcutmap_p.h b/src/gui/kernel/qshortcutmap_p.h index 3fe9546..28ee1f0 100644 --- a/src/gui/kernel/qshortcutmap_p.h +++ b/src/gui/kernel/qshortcutmap_p.h @@ -55,6 +55,7 @@ #include "QtGui/qkeysequence.h" #include "QtCore/qvector.h" +#include "QtCore/qscopedpointer.h" QT_BEGIN_NAMESPACE @@ -104,7 +105,7 @@ private: #ifndef QT_NO_ACTION bool correctContext(Qt::ShortcutContext context,QAction *a, QWidget *active_window) const; #endif - QShortcutMapPrivate *d_ptr; + QScopedPointer d_ptr; QKeySequence::SequenceMatch find(QKeyEvent *e); QKeySequence::SequenceMatch matches(const QKeySequence &seq1, const QKeySequence &seq2) const; diff --git a/src/gui/kernel/qsound_s60.cpp b/src/gui/kernel/qsound_s60.cpp index 7eb6463..00fc2fe 100644 --- a/src/gui/kernel/qsound_s60.cpp +++ b/src/gui/kernel/qsound_s60.cpp @@ -146,10 +146,11 @@ QAuServer* qt_new_audio_server() QAuBucketS60::QAuBucketS60( QAuServerS60 *server, QSound *sound ) : m_sound( sound ), m_server( server ), m_prepared(false), m_playCalled(false) { + QString filepath = QFileInfo( m_sound->fileName() ).absoluteFilePath(); + filepath = QDir::toNativeSeparators(filepath); + TPtrC filepathPtr(qt_QString2TPtrC(filepath)); TRAPD(err, m_playUtility = CMdaAudioPlayerUtility::NewL(*this); - QString filepath = QFileInfo( m_sound->fileName() ).absoluteFilePath(); - filepath = QDir::toNativeSeparators(filepath); - m_playUtility->OpenFileL(qt_QString2TPtrC(filepath))); + m_playUtility->OpenFileL(filepathPtr)); if(err){ m_server->playCompleted(this, err); } diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index d2fa5da..2d47a14 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -147,6 +147,7 @@ protected: void FocusChanged(TDrawNow aDrawNow); private: + TKeyResponse OfferKeyEvent(const TKeyEvent& aKeyEvent,TEventCode aType); TKeyResponse sendKeyEvent(QWidget *widget, QKeyEvent *keyEvent); void sendMouseEvent(QWidget *widget, QMouseEvent *mEvent); void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation ); diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index b376f20..09299dc 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -172,7 +172,8 @@ extern bool qt_sendSpontaneousEvent(QObject*, QEvent*); // qapplication.cpp extern QDesktopWidget *qt_desktopWidget; // qapplication.cpp QWidgetPrivate::QWidgetPrivate(int version) : - QObjectPrivate(version), extra(0), focus_child(0) + QObjectPrivate(version), extra(0), + focus_next(0), focus_prev(0), focus_child(0) ,layout(0), widgetItem(0) ,leftmargin(0), topmargin(0), rightmargin(0), bottommargin(0) ,leftLayoutItemMargin(0), topLayoutItemMargin(0), rightLayoutItemMargin(0) @@ -927,6 +928,23 @@ QRegion qt_dirtyRegion(QWidget *widget) \endlist */ +struct QWidgetExceptionCleaner +{ + /* this cleans up when the constructor throws an exception */ + static inline void cleanup(QWidget *that, QWidgetPrivate *d) + { +#ifndef QT_NO_EXCEPTIONS + QWidgetPrivate::uncreatedWidgets->remove(that); + if (d->focus_next != that) { + if (d->focus_next) + d->focus_next->d_func()->focus_prev = d->focus_prev; + if (d->focus_prev) + d->focus_prev->d_func()->focus_next = d->focus_next; + } +#endif + } +}; + /*! Constructs a widget which is a child of \a parent, with widget flags set to \a f. @@ -956,7 +974,12 @@ QRegion qt_dirtyRegion(QWidget *widget) QWidget::QWidget(QWidget *parent, Qt::WindowFlags f) : QObject(*new QWidgetPrivate, 0), QPaintDevice() { - d_func()->init(parent, f); + QT_TRY { + d_func()->init(parent, f); + } QT_CATCH(...) { + QWidgetExceptionCleaner::cleanup(this, d_func()); + QT_RETHROW; + } } #ifdef QT3_SUPPORT @@ -967,8 +990,13 @@ QWidget::QWidget(QWidget *parent, Qt::WindowFlags f) QWidget::QWidget(QWidget *parent, const char *name, Qt::WindowFlags f) : QObject(*new QWidgetPrivate, 0), QPaintDevice() { - d_func()->init(parent , f); - setObjectName(QString::fromAscii(name)); + QT_TRY { + d_func()->init(parent , f); + setObjectName(QString::fromAscii(name)); + } QT_CATCH(...) { + QWidgetExceptionCleaner::cleanup(this, d_func()); + QT_RETHROW; + } } #endif @@ -977,7 +1005,13 @@ QWidget::QWidget(QWidget *parent, const char *name, Qt::WindowFlags f) QWidget::QWidget(QWidgetPrivate &dd, QWidget* parent, Qt::WindowFlags f) : QObject(dd, 0), QPaintDevice() { - d_func()->init(parent, f); + Q_D(QWidget); + QT_TRY { + d->init(parent, f); + } QT_CATCH(...) { + QWidgetExceptionCleaner::cleanup(this, d_func()); + QT_RETHROW; + } } /*! @@ -5068,7 +5102,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP #ifndef QT_NO_SCROLLAREA QAbstractScrollArea *scrollArea = qobject_cast(q->parent()); if (scrollArea && scrollArea->viewport() == q) { - QObjectData *scrollPrivate = static_cast(scrollArea)->d_ptr; + QObjectData *scrollPrivate = static_cast(scrollArea)->d_ptr.data(); QAbstractScrollAreaPrivate *priv = static_cast(scrollPrivate); scrollAreaOffset = priv->contentsOffset(); p.translate(-scrollAreaOffset); diff --git a/src/gui/kernel/qwidget.h b/src/gui/kernel/qwidget.h index 0dd470d..1b67ba7 100644 --- a/src/gui/kernel/qwidget.h +++ b/src/gui/kernel/qwidget.h @@ -728,6 +728,7 @@ private: friend class QGraphicsProxyWidget; friend class QGraphicsProxyWidgetPrivate; friend class QStyleSheetStyle; + friend class QWidgetExceptionCleaner; #ifdef Q_WS_MAC friend class QCoreGraphicsPaintEnginePrivate; diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index b2256cd..e2197c6 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -1215,7 +1215,7 @@ OSStatus QWidgetPrivate::qt_widget_event(EventHandlerCallRef er, EventRef event, QAbstractScrollArea *scrollArea = qobject_cast(widget->parent()); QPoint scrollAreaOffset; if (scrollArea && scrollArea->viewport() == widget) { - QAbstractScrollAreaPrivate *priv = static_cast(static_cast(scrollArea)->d_ptr); + QAbstractScrollAreaPrivate *priv = static_cast(static_cast(scrollArea)->d_ptr.data()); scrollAreaOffset = priv->contentsOffset(); p.translate(-scrollAreaOffset); } diff --git a/src/gui/kernel/qwidget_qws.cpp b/src/gui/kernel/qwidget_qws.cpp index 1445f57..0073d3f 100644 --- a/src/gui/kernel/qwidget_qws.cpp +++ b/src/gui/kernel/qwidget_qws.cpp @@ -652,7 +652,8 @@ void QWidgetPrivate::hide_sys() q->releaseMouse(); // requestWindowRegion(QRegion()); - extra->topextra->backingStore->releaseBuffer(); + if (extra->topextra->backingStore) + extra->topextra->backingStore->releaseBuffer(); QWidget::qwsDisplay()->requestFocus(data.winid,false); diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp index 854d0aa..c22791a 100644 --- a/src/gui/painting/qbrush.cpp +++ b/src/gui/painting/qbrush.cpp @@ -221,7 +221,7 @@ bool qHasPixmapTexture(const QBrush& brush) { if (brush.style() != Qt::TexturePattern) return false; - QTexturedBrushData *tx_data = static_cast(brush.d); + QTexturedBrushData *tx_data = static_cast(brush.d.data()); return tx_data->m_has_pixmap_texture; } @@ -230,6 +230,37 @@ struct QGradientBrushData : public QBrushData QGradient gradient; }; +struct QBrushDataPointerHandler +{ + static inline void deleteData(QBrushData *d) + { + switch (d->style) { + case Qt::TexturePattern: + delete static_cast(d); + break; + case Qt::LinearGradientPattern: + case Qt::RadialGradientPattern: + case Qt::ConicalGradientPattern: + delete static_cast(d); + break; + default: + delete d; + } + } + + static inline void cleanup(QBrushData *d) + { + if (d && !d->ref.deref()) { + deleteData(d); + } + } + + static inline void reset(QBrushData *&d, QBrushData *other) + { + cleanup(d); + d = other; + } +}; /*! \class QBrush @@ -364,20 +395,20 @@ void QBrush::init(const QColor &color, Qt::BrushStyle style) { switch(style) { case Qt::NoBrush: - d = nullBrushInstance(); + d.data_ptr() = nullBrushInstance(); d->ref.ref(); if (d->color != color) setColor(color); return; case Qt::TexturePattern: - d = new QTexturedBrushData; + d.data_ptr() = new QTexturedBrushData; break; case Qt::LinearGradientPattern: case Qt::RadialGradientPattern: case Qt::ConicalGradientPattern: - d = new QGradientBrushData; + d.data_ptr() = new QGradientBrushData; break; default: - d = new QBrushData; + d.data_ptr() = new QBrushData; break; } d->ref = 1; @@ -391,8 +422,8 @@ void QBrush::init(const QColor &color, Qt::BrushStyle style) */ QBrush::QBrush() + : d(nullBrushInstance()) { - d = nullBrushInstance(); Q_ASSERT(d); d->ref.ref(); } @@ -435,7 +466,7 @@ QBrush::QBrush(Qt::BrushStyle style) if (qbrush_check_type(style)) init(Qt::black, style); else { - d = nullBrushInstance(); + d.data_ptr() = nullBrushInstance(); d->ref.ref(); } } @@ -451,7 +482,7 @@ QBrush::QBrush(const QColor &color, Qt::BrushStyle style) if (qbrush_check_type(style)) init(color, style); else { - d = nullBrushInstance(); + d.data_ptr() = nullBrushInstance(); d->ref.ref(); } } @@ -468,7 +499,7 @@ QBrush::QBrush(Qt::GlobalColor color, Qt::BrushStyle style) if (qbrush_check_type(style)) init(color, style); else { - d = nullBrushInstance(); + d.data_ptr() = nullBrushInstance(); d->ref.ref(); } } @@ -510,8 +541,8 @@ QBrush::QBrush(Qt::GlobalColor color, const QPixmap &pixmap) */ QBrush::QBrush(const QBrush &other) + : d(other.d.data()) { - d = other.d; d->ref.ref(); } @@ -535,7 +566,7 @@ QBrush::QBrush(const QGradient &gradient) }; init(QColor(), enum_table[gradient.type()]); - QGradientBrushData *grad = static_cast(d); + QGradientBrushData *grad = static_cast(d.data()); grad->gradient = gradient; } @@ -545,24 +576,11 @@ QBrush::QBrush(const QGradient &gradient) QBrush::~QBrush() { - if (!d->ref.deref()) - cleanUp(d); } void QBrush::cleanUp(QBrushData *x) { - switch (x->style) { - case Qt::TexturePattern: - delete static_cast(x); - break; - case Qt::LinearGradientPattern: - case Qt::RadialGradientPattern: - case Qt::ConicalGradientPattern: - delete static_cast(x); - break; - default: - delete x; - } + QBrushDataPointerHandler::deleteData(x); } @@ -571,38 +589,36 @@ void QBrush::detach(Qt::BrushStyle newStyle) if (newStyle == d->style && d->ref == 1) return; - QBrushData *x; + QScopedPointer x; switch(newStyle) { case Qt::TexturePattern: { QTexturedBrushData *tbd = new QTexturedBrushData; if (d->style == Qt::TexturePattern) { - QTexturedBrushData *data = static_cast(d); + QTexturedBrushData *data = static_cast(d.data()); if (data->m_has_pixmap_texture) tbd->setPixmap(data->pixmap()); else tbd->setImage(data->image()); } - x = tbd; + x.reset(tbd); break; } case Qt::LinearGradientPattern: case Qt::RadialGradientPattern: case Qt::ConicalGradientPattern: - x = new QGradientBrushData; - static_cast(x)->gradient = - static_cast(d)->gradient; + x.reset(new QGradientBrushData); + static_cast(x.data())->gradient = + static_cast(d.data())->gradient; break; default: - x = new QBrushData; + x.reset(new QBrushData); break; } x->ref = 1; x->style = newStyle; x->color = d->color; x->transform = d->transform; - if (!d->ref.deref()) - cleanUp(d); - d = x; + d.reset(x.take()); } @@ -615,10 +631,11 @@ void QBrush::detach(Qt::BrushStyle newStyle) QBrush &QBrush::operator=(const QBrush &b) { + if (this == &b) + return *this; + b.d->ref.ref(); - if (!d->ref.deref()) - cleanUp(d); - d = b.d; + d.reset(b.d.data()); return *this; } @@ -713,7 +730,7 @@ QPixmap *QBrush::pixmap() const { if (d->style != Qt::TexturePattern) return 0; - QTexturedBrushData *data = static_cast(d); + QTexturedBrushData *data = static_cast(d.data()); QPixmap &pixmap = data->pixmap(); return pixmap.isNull() ? 0 : &pixmap; } @@ -730,7 +747,7 @@ QPixmap *QBrush::pixmap() const QPixmap QBrush::texture() const { return d->style == Qt::TexturePattern - ? ((QTexturedBrushData*) d)->pixmap() + ? (static_cast(d.data()))->pixmap() : QPixmap(); } @@ -748,7 +765,7 @@ void QBrush::setTexture(const QPixmap &pixmap) { if (!pixmap.isNull()) { detach(Qt::TexturePattern); - QTexturedBrushData *data = static_cast(d); + QTexturedBrushData *data = static_cast(d.data()); data->setPixmap(pixmap); } else { detach(Qt::NoBrush); @@ -771,7 +788,7 @@ void QBrush::setTexture(const QPixmap &pixmap) QImage QBrush::textureImage() const { return d->style == Qt::TexturePattern - ? ((QTexturedBrushData *) d)->image() + ? (static_cast(d.data()))->image() : QImage(); } @@ -796,7 +813,7 @@ void QBrush::setTextureImage(const QImage &image) { if (!image.isNull()) { detach(Qt::TexturePattern); - QTexturedBrushData *data = static_cast(d); + QTexturedBrushData *data = static_cast(d.data()); data->setImage(image); } else { detach(Qt::NoBrush); @@ -812,7 +829,7 @@ const QGradient *QBrush::gradient() const if (d->style == Qt::LinearGradientPattern || d->style == Qt::RadialGradientPattern || d->style == Qt::ConicalGradientPattern) { - return &static_cast(d)->gradient; + return &static_cast(d.data())->gradient; } return 0; } @@ -923,16 +940,16 @@ bool QBrush::operator==(const QBrush &b) const if (b.d->style == d->style && b.d->color == d->color) { switch (d->style) { case Qt::TexturePattern: { - QPixmap &us = ((QTexturedBrushData *) d)->pixmap(); - QPixmap &them = ((QTexturedBrushData *) b.d)->pixmap(); + QPixmap &us = (static_cast(d.data()))->pixmap(); + QPixmap &them = (static_cast(b.d.data()))->pixmap(); return ((us.isNull() && them.isNull()) || us.cacheKey() == them.cacheKey()); } case Qt::LinearGradientPattern: case Qt::RadialGradientPattern: case Qt::ConicalGradientPattern: { - QGradientBrushData *d1 = static_cast(d); - QGradientBrushData *d2 = static_cast(b.d); + QGradientBrushData *d1 = static_cast(d.data()); + QGradientBrushData *d2 = static_cast(b.d.data()); return d1->gradient == d2->gradient; } default: diff --git a/src/gui/painting/qbrush.h b/src/gui/painting/qbrush.h index d6d0da3..b3aa04d 100644 --- a/src/gui/painting/qbrush.h +++ b/src/gui/painting/qbrush.h @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -61,6 +62,7 @@ struct QBrushData; class QPixmap; class QGradient; class QVariant; +struct QBrushDataPointerHandler; class Q_GUI_EXPORT QBrush { @@ -126,13 +128,13 @@ private: friend bool qHasPixmapTexture(const QBrush& brush); void detach(Qt::BrushStyle newStyle); void init(const QColor &color, Qt::BrushStyle bs); - QBrushData *d; + QScopedCustomPointer d; void cleanUp(QBrushData *x); public: inline bool isDetached() const; typedef QBrushData * DataPtr; - inline DataPtr &data_ptr() { return d; } + inline DataPtr &data_ptr() { return d.data_ptr(); } }; inline void QBrush::setColor(Qt::GlobalColor acolor) diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index ed4dd57..0b5e5bb 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -7426,8 +7426,8 @@ void qt_build_pow_tables() { } #else for (int i=0; i<256; ++i) { - qt_pow_rgb_gamma[i] = uchar(qRound(pow(i / 255.0, smoothing) * 255)); - qt_pow_rgb_invgamma[i] = uchar(qRound(pow(i / 255.0, 1 / smoothing) * 255)); + qt_pow_rgb_gamma[i] = uchar(qRound(pow(i / qreal(255), smoothing) * 255)); + qt_pow_rgb_invgamma[i] = uchar(qRound(pow(i / qreal(255), 1 / smoothing) * 255)); } #endif diff --git a/src/gui/painting/qpaintengine.cpp b/src/gui/painting/qpaintengine.cpp index 7de1ec4..c5be802 100644 --- a/src/gui/painting/qpaintengine.cpp +++ b/src/gui/painting/qpaintengine.cpp @@ -713,7 +713,6 @@ QPaintEngine::QPaintEngine(QPaintEnginePrivate &dptr, PaintEngineFeatures caps) */ QPaintEngine::~QPaintEngine() { - delete d_ptr; } /*! diff --git a/src/gui/painting/qpaintengine.h b/src/gui/painting/qpaintengine.h index 520f71f..6f56adb 100644 --- a/src/gui/painting/qpaintengine.h +++ b/src/gui/painting/qpaintengine.h @@ -44,6 +44,7 @@ #include #include +#include #include QT_BEGIN_HEADER @@ -239,7 +240,7 @@ protected: uint selfDestruct : 1; uint extended : 1; - QPaintEnginePrivate *d_ptr; + QScopedPointer d_ptr; private: void setAutoDestruct(bool autoDestr) { selfDestruct = autoDestr; } diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 95b4100..ada3ebf 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -349,6 +349,7 @@ void QRasterPaintEngine::init() #else (unsigned char *) malloc(d->rasterPoolSize); #endif + Q_CHECK_PTR(d->rasterPoolBase); // The antialiasing raster. d->grayRaster = new QT_FT_Raster; @@ -3904,7 +3905,7 @@ static void qt_merge_clip(const QClipData *c1, const QClipData *c2, QClipData *r // find required length int max = qMax(c1_spans[c1_count - 1].x + c1_spans[c1_count - 1].len, - c2_spans[c2_count - 1].x + c2_spans[c2_count - 1].len); + c2_spans[c2_count - 1].x + c2_spans[c2_count - 1].len); buffer.resize(max); memset(buffer.data(), 0, buffer.size() * sizeof(short)); @@ -3958,7 +3959,7 @@ void QRasterPaintEnginePrivate::initializeRasterizer(QSpanData *data) const QClipData *c = clip(); if (c) { const QRect r(QPoint(c->xmin, c->ymin), - QPoint(c->xmax, c->ymax)); + QPoint(c->xmax, c->ymax)); clipRect = clipRect.intersected(r); blend = data->blend; } else { @@ -4066,6 +4067,7 @@ void QRasterPaintEnginePrivate::rasterize(QT_FT_Outline *outline, #else (unsigned char *) malloc(rasterPoolSize); #endif + Q_CHECK_PTR(rasterPoolBase); // note: we just freed the old rasterPoolBase. I hope it's not fatal. qt_ft_grays_raster.raster_done(*grayRaster); qt_ft_grays_raster.raster_new(0, grayRaster); @@ -4301,93 +4303,107 @@ void QClipData::initialize() return; m_clipLines = (ClipLine *)calloc(sizeof(ClipLine), clipSpanHeight); - m_spans = (QSpan *)malloc(clipSpanHeight*sizeof(QSpan)); - - if (hasRectClip) { - int y = 0; - while (y < ymin) { - m_clipLines[y].spans = 0; - m_clipLines[y].count = 0; - ++y; - } + Q_CHECK_PTR(m_clipLines); + QT_TRY { + m_spans = (QSpan *)malloc(clipSpanHeight*sizeof(QSpan)); + Q_CHECK_PTR(m_spans); + + QT_TRY { + if (hasRectClip) { + int y = 0; + while (y < ymin) { + m_clipLines[y].spans = 0; + m_clipLines[y].count = 0; + ++y; + } - const int len = clipRect.width(); - count = 0; - while (y < ymax) { - QSpan *span = m_spans + count; - span->x = xmin; - span->len = len; - span->y = y; - span->coverage = 255; - ++count; - - m_clipLines[y].spans = span; - m_clipLines[y].count = 1; - ++y; - } + const int len = clipRect.width(); + count = 0; + while (y < ymax) { + QSpan *span = m_spans + count; + span->x = xmin; + span->len = len; + span->y = y; + span->coverage = 255; + ++count; - while (y < clipSpanHeight) { - m_clipLines[y].spans = 0; - m_clipLines[y].count = 0; - ++y; - } - } else if (hasRegionClip) { + m_clipLines[y].spans = span; + m_clipLines[y].count = 1; + ++y; + } - const QVector rects = clipRegion.rects(); - const int numRects = rects.size(); + while (y < clipSpanHeight) { + m_clipLines[y].spans = 0; + m_clipLines[y].count = 0; + ++y; + } + } else if (hasRegionClip) { + + const QVector rects = clipRegion.rects(); + const int numRects = rects.size(); + + { // resize + const int maxSpans = (ymax - ymin) * numRects; + if (maxSpans > allocated) { + QSpan *newSpans = (QSpan *)realloc(m_spans, maxSpans * sizeof(QSpan)); + Q_CHECK_PTR(newSpans); + m_spans = newSpans; + allocated = maxSpans; + } + } - { // resize - const int maxSpans = (ymax - ymin) * numRects; - if (maxSpans > allocated) { - m_spans = (QSpan *)realloc(m_spans, maxSpans * sizeof(QSpan)); - allocated = maxSpans; - } - } + int y = 0; + int firstInBand = 0; + while (firstInBand < numRects) { + const int currMinY = rects.at(firstInBand).y(); + const int currMaxY = currMinY + rects.at(firstInBand).height(); - int y = 0; - int firstInBand = 0; - while (firstInBand < numRects) { - const int currMinY = rects.at(firstInBand).y(); - const int currMaxY = currMinY + rects.at(firstInBand).height(); + while (y < currMinY) { + m_clipLines[y].spans = 0; + m_clipLines[y].count = 0; + ++y; + } - while (y < currMinY) { - m_clipLines[y].spans = 0; - m_clipLines[y].count = 0; - ++y; - } + int lastInBand = firstInBand; + while (lastInBand + 1 < numRects && rects.at(lastInBand+1).top() == y) + ++lastInBand; - int lastInBand = firstInBand; - while (lastInBand + 1 < numRects && rects.at(lastInBand+1).top() == y) - ++lastInBand; + while (y < currMaxY) { - while (y < currMaxY) { + m_clipLines[y].spans = m_spans + count; + m_clipLines[y].count = lastInBand - firstInBand + 1; - m_clipLines[y].spans = m_spans + count; - m_clipLines[y].count = lastInBand - firstInBand + 1; + for (int r = firstInBand; r <= lastInBand; ++r) { + const QRect &currRect = rects.at(r); + QSpan *span = m_spans + count; + span->x = currRect.x(); + span->len = currRect.width(); + span->y = y; + span->coverage = 255; + ++count; + } + ++y; + } - for (int r = firstInBand; r <= lastInBand; ++r) { - const QRect &currRect = rects.at(r); - QSpan *span = m_spans + count; - span->x = currRect.x(); - span->len = currRect.width(); - span->y = y; - span->coverage = 255; - ++count; + firstInBand = lastInBand + 1; } - ++y; - } - firstInBand = lastInBand + 1; - } + Q_ASSERT(count <= allocated); - Q_ASSERT(count <= allocated); + while (y < clipSpanHeight) { + m_clipLines[y].spans = 0; + m_clipLines[y].count = 0; + ++y; + } - while (y < clipSpanHeight) { - m_clipLines[y].spans = 0; - m_clipLines[y].count = 0; - ++y; + } + } QT_CATCH(...) { + free(m_spans); + QT_RETHROW; } - + } QT_CATCH(...) { + free(m_clipLines); + QT_RETHROW; } } @@ -4764,8 +4780,10 @@ static void qt_span_clip(int count, const QSpan *spans, void *userData) &newspans, newClip->allocated - newClip->count); newClip->count = newspans - newClip->m_spans; if (spans < end) { + QSpan *newSpan = (QSpan *)realloc(newClip->m_spans, newClip->allocated*2*sizeof(QSpan)); + Q_CHECK_PTR(newSpan); + newClip->m_spans = newSpan; newClip->allocated *= 2; - newClip->m_spans = (QSpan *)realloc(newClip->m_spans, newClip->allocated*sizeof(QSpan)); } } } diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index cc48d24..0caf13b 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -83,6 +83,21 @@ static const qreal aliasedCoordinateDelta = 0.5 - 0.015625; bool qt_show_painter_debug_output = true; #endif +class QPainterPrivateCleaner +{ +public: + static inline void cleanup(QPainterPrivate *d) + { + delete d; + } + + static inline void reset(QPainterPrivate *&d, QPainterPrivate *other) + { + delete d; + d = other; + } +}; + extern QPixmap qt_pixmapForBrush(int style, bool invert); void qt_format_text(const QFont &font, @@ -259,14 +274,17 @@ bool QPainterPrivate::attachPainterPrivate(QPainter *q, QPaintDevice *pdev) // in 99% of all cases). E.g: A renders B which renders C which renders D. sp->d_ptr->d_ptrs_size = 4; sp->d_ptr->d_ptrs = (QPainterPrivate **)malloc(4 * sizeof(QPainterPrivate *)); + Q_CHECK_PTR(sp->d_ptr->d_ptrs); } else if (sp->d_ptr->refcount - 1 == sp->d_ptr->d_ptrs_size) { // However, to support corner cases we grow the array dynamically if needed. sp->d_ptr->d_ptrs_size <<= 1; const int newSize = sp->d_ptr->d_ptrs_size * sizeof(QPainterPrivate *); - sp->d_ptr->d_ptrs = (QPainterPrivate **)realloc(sp->d_ptr->d_ptrs, newSize); + QPainterPrivate ** newPointers = (QPainterPrivate **)realloc(sp->d_ptr->d_ptrs, newSize); + Q_CHECK_PTR(newPointers); + sp->d_ptr->d_ptrs = newPointers; } - sp->d_ptr->d_ptrs[++sp->d_ptr->refcount - 2] = q->d_ptr; - q->d_ptr = sp->d_ptr; + sp->d_ptr->d_ptrs[++sp->d_ptr->refcount - 2] = q->d_ptr.data(); + q->d_ptr.data_ptr() = sp->d_ptr.data(); Q_ASSERT(q->d_ptr->state); @@ -315,7 +333,7 @@ void QPainterPrivate::detachPainterPrivate(QPainter *q) d_ptrs[refcount - 1] = 0; q->restore(); - q->d_ptr = original; + q->d_ptr.data_ptr() = original; if (emulationEngine) { extended = emulationEngine->real_engine; @@ -1374,8 +1392,8 @@ void QPainterPrivate::updateState(QPainterState *newState) */ QPainter::QPainter() + : d_ptr(new QPainterPrivate(this)) { - d_ptr = new QPainterPrivate(this); } /*! @@ -1407,7 +1425,7 @@ QPainter::QPainter(QPaintDevice *pd) { Q_ASSERT(pd != 0); if (!QPainterPrivate::attachPainterPrivate(this, pd)) { - d_ptr = new QPainterPrivate(this); + d_ptr.reset(new QPainterPrivate(this)); begin(pd); } Q_ASSERT(d_ptr); @@ -1419,11 +1437,14 @@ QPainter::QPainter(QPaintDevice *pd) QPainter::~QPainter() { d_ptr->inDestructor = true; - if (isActive()) - end(); - else if (d_ptr->refcount > 1) - d_ptr->detachPainterPrivate(this); - + QT_TRY { + if (isActive()) + end(); + else if (d_ptr->refcount > 1) + d_ptr->detachPainterPrivate(this); + } QT_CATCH(...) { + // don't throw anything in the destructor. + } if (d_ptr) { // Make sure we haven't messed things up. Q_ASSERT(d_ptr->inDestructor); @@ -1431,7 +1452,6 @@ QPainter::~QPainter() Q_ASSERT(d_ptr->refcount == 1); if (d_ptr->d_ptrs) free(d_ptr->d_ptrs); - delete d_ptr; } } @@ -7417,8 +7437,21 @@ QPaintDevice *QPainter::redirected(const QPaintDevice *device, QPoint *offset) void qt_painter_removePaintDevice(QPaintDevice *dev) { - QMutexLocker locker(globalRedirectionsMutex()); - if(QPaintDeviceRedirectionList *redirections = globalRedirections()) { + QMutex *mutex = 0; + QT_TRY { + mutex = globalRedirectionsMutex(); + } QT_CATCH(...) { + // ignore the missing mutex, since we could be called from + // a destructor, and destructors shall not throw + } + QMutexLocker locker(mutex); + QPaintDeviceRedirectionList *redirections = 0; + QT_TRY { + redirections = globalRedirections(); + } QT_CATCH(...) { + // do nothing - code below is safe with redirections being 0. + } + if (redirections) { for (int i = 0; i < redirections->size(); ) { if(redirections->at(i) == dev || redirections->at(i).replacement == dev) redirections->removeAt(i); diff --git a/src/gui/painting/qpainter.h b/src/gui/painting/qpainter.h index f3df7a3..d8c6980 100644 --- a/src/gui/painting/qpainter.h +++ b/src/gui/painting/qpainter.h @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -78,6 +79,8 @@ class QTextItem; class QMatrix; class QTransform; +class QPainterPrivateCleaner; + class Q_GUI_EXPORT QPainter { Q_DECLARE_PRIVATE(QPainter) @@ -497,7 +500,7 @@ private: Q_DISABLE_COPY(QPainter) friend class Q3Painter; - QPainterPrivate *d_ptr; + QScopedCustomPointer d_ptr; friend class QFontEngine; friend class QFontEngineBox; diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index 1b2c4e3..12dbc62 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -506,10 +506,10 @@ QPainterPath::QPainterPath() \sa operator=() */ QPainterPath::QPainterPath(const QPainterPath &other) - : d_ptr(other.d_ptr) + : d_ptr(other.d_ptr.data()) { - if (d_func()) - d_func()->ref.ref(); + if (d_ptr) + d_ptr->ref.ref(); } /*! @@ -530,9 +530,7 @@ QPainterPath::QPainterPath(const QPointF &startPoint) void QPainterPath::detach_helper() { QPainterPathPrivate *data = new QPainterPathData(*d_func()); - if (d_ptr && !d_ptr->ref.deref()) - delete d_ptr; - d_ptr = data; + d_ptr.reset(data); } /*! @@ -544,9 +542,7 @@ void QPainterPath::ensureData_helper() data->elements.reserve(16); QPainterPath::Element e = { 0, 0, QPainterPath::MoveToElement }; data->elements << e; - if (d_ptr && !d_ptr->ref.deref()) - delete d_ptr; - d_ptr = data; + d_ptr.reset(data); Q_ASSERT(d_ptr != 0); } @@ -563,9 +559,7 @@ QPainterPath &QPainterPath::operator=(const QPainterPath &other) QPainterPathPrivate *data = other.d_func(); if (data) data->ref.ref(); - if (d_ptr && !d_ptr->ref.deref()) - delete d_ptr; - d_ptr = data; + d_ptr.reset(data); } return *this; } @@ -575,8 +569,6 @@ QPainterPath &QPainterPath::operator=(const QPainterPath &other) */ QPainterPath::~QPainterPath() { - if (d_func() && !d_func()->ref.deref()) - delete d_func(); } /*! @@ -2408,7 +2400,6 @@ QPainterPathStroker::QPainterPathStroker() */ QPainterPathStroker::~QPainterPathStroker() { - delete d_ptr; } diff --git a/src/gui/painting/qpainterpath.h b/src/gui/painting/qpainterpath.h index 6cd2af8..0513593 100644 --- a/src/gui/painting/qpainterpath.h +++ b/src/gui/painting/qpainterpath.h @@ -47,6 +47,7 @@ #include #include #include +#include QT_BEGIN_HEADER @@ -195,7 +196,7 @@ public: QPainterPath &operator-=(const QPainterPath &other); private: - QPainterPathPrivate *d_ptr; + QScopedSharedPointer d_ptr; inline void ensureData() { if (!d_ptr) ensureData_helper(); } void ensureData_helper(); @@ -205,7 +206,7 @@ private: void computeBoundingRect() const; void computeControlPointRect() const; - QPainterPathData *d_func() const { return reinterpret_cast(d_ptr); } + QPainterPathData *d_func() const { return reinterpret_cast(d_ptr.data()); } friend class QPainterPathData; friend class QPainterPathStroker; @@ -229,6 +230,8 @@ public: friend class QPainterPathStrokerPrivate; friend class QMatrix; friend class QTransform; + friend class QScopedSharedPointer; + friend class QScopedSharedPointerHandler; #ifndef QT_NO_DATASTREAM friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QPainterPath &); friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPainterPath &); @@ -279,7 +282,7 @@ public: private: friend class QX11PaintEngine; - QPainterPathStrokerPrivate *d_ptr; + QScopedPointer d_ptr; }; inline void QPainterPath::moveTo(qreal x, qreal y) diff --git a/src/gui/painting/qprinter.cpp b/src/gui/painting/qprinter.cpp index ed72077..ba6baa6 100644 --- a/src/gui/painting/qprinter.cpp +++ b/src/gui/painting/qprinter.cpp @@ -712,7 +712,6 @@ QPrinter::~QPrinter() #ifndef QT_NO_PRINTPREVIEWWIDGET delete d->previewEngine; #endif - delete d; } /*! diff --git a/src/gui/painting/qprinter.h b/src/gui/painting/qprinter.h index 949c8f9..24e867b 100644 --- a/src/gui/painting/qprinter.h +++ b/src/gui/painting/qprinter.h @@ -42,8 +42,9 @@ #ifndef QPRINTER_H #define QPRINTER_H -#include #include +#include +#include QT_BEGIN_HEADER @@ -288,7 +289,7 @@ private: Q_DISABLE_COPY(QPrinter) - QPrinterPrivate *d_ptr; + QScopedPointer d_ptr; friend class QPrintDialogPrivate; friend class QAbstractPrintDialog; diff --git a/src/gui/painting/qprinterinfo.h b/src/gui/painting/qprinterinfo.h index b826306..d188d73 100644 --- a/src/gui/painting/qprinterinfo.h +++ b/src/gui/painting/qprinterinfo.h @@ -53,6 +53,7 @@ QT_MODULE(Gui) #ifndef QT_NO_PRINTER class QPrinterInfoPrivate; +class QPrinterInfoPrivateCleanup; class Q_GUI_EXPORT QPrinterInfo { Q_DECLARE_PRIVATE(QPrinterInfo) @@ -76,7 +77,7 @@ public: private: QPrinterInfo(const QString& name); - QPrinterInfoPrivate* d_ptr; + QScopedCustomPointer d_ptr; }; #endif // QT_NO_PRINTER diff --git a/src/gui/painting/qprinterinfo_mac.cpp b/src/gui/painting/qprinterinfo_mac.cpp index ecd4b5b..ae689f4 100644 --- a/src/gui/painting/qprinterinfo_mac.cpp +++ b/src/gui/painting/qprinterinfo_mac.cpp @@ -65,6 +65,22 @@ private: static QPrinterInfoPrivate nullQPrinterInfoPrivate; +class QPrinterInfoPrivateCleanup +{ +public: + static inline void cleanup(QPrinterInfoPrivate *d) + { + if (d != &nullQPrinterInfoPrivate) + delete d; + } + + static inline void reset(QPrinterInfoPrivate *&d, QPrinterInfoPrivate *other) + { + cleanup(d); + d = other; + } +}; + extern QPrinter::PaperSize qSizeFTopaperSize(const QSizeF& size); ///////////////////////////////////////////////////////////////////////////// @@ -106,8 +122,8 @@ QPrinterInfo QPrinterInfo::defaultPrinter(){ ///////////////////////////////////////////////////////////////////////////// QPrinterInfo::QPrinterInfo(const QPrinter& prn) + : d_ptr(&nullQPrinterInfoPrivate) { - d_ptr = &nullQPrinterInfoPrivate; QList list = availablePrinters(); for (int c = 0; c < list.size(); ++c) { if (prn.printerName() == list[c].printerName()) { @@ -115,39 +131,33 @@ QPrinterInfo::QPrinterInfo(const QPrinter& prn) return; } } - - *this = QPrinterInfo(); } QPrinterInfo::~QPrinterInfo() { - if (d_ptr != &nullQPrinterInfoPrivate) - delete d_ptr; } QPrinterInfo::QPrinterInfo() + : d_ptr(&nullQPrinterInfoPrivate) { - d_ptr = &nullQPrinterInfoPrivate; } QPrinterInfo::QPrinterInfo(const QString& name) + : d_ptr(new QPrinterInfoPrivate(name)) { - d_ptr = new QPrinterInfoPrivate(name); d_ptr->q_ptr = this; } QPrinterInfo::QPrinterInfo(const QPrinterInfo& src) + : d_ptr(&nullQPrinterInfoPrivate) { - d_ptr = &nullQPrinterInfoPrivate; *this = src; } QPrinterInfo& QPrinterInfo::operator=(const QPrinterInfo& src) { Q_ASSERT(d_ptr); - if (d_ptr != &nullQPrinterInfoPrivate) - delete d_ptr; - d_ptr = new QPrinterInfoPrivate(*src.d_ptr); + d_ptr.reset(new QPrinterInfoPrivate(*src.d_ptr)); d_ptr->q_ptr = this; return *this; } diff --git a/src/gui/painting/qprinterinfo_unix.cpp b/src/gui/painting/qprinterinfo_unix.cpp index 0f33ea7..55e3226 100644 --- a/src/gui/painting/qprinterinfo_unix.cpp +++ b/src/gui/painting/qprinterinfo_unix.cpp @@ -82,6 +82,22 @@ private: static QPrinterInfoPrivate nullQPrinterInfoPrivate; +class QPrinterInfoPrivateCleanup +{ +public: + static inline void cleanup(QPrinterInfoPrivate *d) + { + if (d != &nullQPrinterInfoPrivate) + delete d; + } + + static inline void reset(QPrinterInfoPrivate *&d, QPrinterInfoPrivate *other) + { + cleanup(d); + d = other; + } +}; + ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// @@ -867,19 +883,19 @@ QPrinterInfo QPrinterInfo::defaultPrinter() } QPrinterInfo::QPrinterInfo() + : d_ptr(&nullQPrinterInfoPrivate) { - d_ptr = &nullQPrinterInfoPrivate; } QPrinterInfo::QPrinterInfo(const QPrinterInfo& src) + : d_ptr(&nullQPrinterInfoPrivate) { - d_ptr = &nullQPrinterInfoPrivate; *this = src; } QPrinterInfo::QPrinterInfo(const QPrinter& printer) + : d_ptr(new QPrinterInfoPrivate(printer.printerName())) { - d_ptr = new QPrinterInfoPrivate(printer.printerName()); Q_D(QPrinterInfo); d->q_ptr = this; @@ -929,28 +945,23 @@ QPrinterInfo::QPrinterInfo(const QPrinter& printer) #endif // Printer not found. - delete d; - d_ptr = &nullQPrinterInfoPrivate; + d_ptr.reset(&nullQPrinterInfoPrivate); } QPrinterInfo::QPrinterInfo(const QString& name) + : d_ptr(new QPrinterInfoPrivate(name)) { - d_ptr = new QPrinterInfoPrivate(name); d_ptr->q_ptr = this; } QPrinterInfo::~QPrinterInfo() { - if (d_ptr != &nullQPrinterInfoPrivate) - delete d_ptr; } QPrinterInfo& QPrinterInfo::operator=(const QPrinterInfo& src) { Q_ASSERT(d_ptr); - if (d_ptr != &nullQPrinterInfoPrivate) - delete d_ptr; - d_ptr = new QPrinterInfoPrivate(*src.d_ptr); + d_ptr.reset(new QPrinterInfoPrivate(*src.d_ptr)); d_ptr->q_ptr = this; return *this; } diff --git a/src/gui/painting/qprinterinfo_win.cpp b/src/gui/painting/qprinterinfo_win.cpp index 7cd3cf3..7607391 100644 --- a/src/gui/painting/qprinterinfo_win.cpp +++ b/src/gui/painting/qprinterinfo_win.cpp @@ -69,6 +69,22 @@ private: static QPrinterInfoPrivate nullQPrinterInfoPrivate; +class QPrinterInfoPrivateCleanup +{ +public: + static inline void cleanup(QPrinterInfoPrivate *d) + { + if (d != &nullQPrinterInfoPrivate) + delete d; + } + + static inline void reset(QPrinterInfoPrivate *&d, QPrinterInfoPrivate *other) + { + cleanup(d); + d = other; + } +}; + ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// @@ -155,25 +171,25 @@ QPrinterInfo QPrinterInfo::defaultPrinter() ///////////////////////////////////////////////////////////////////////////// QPrinterInfo::QPrinterInfo() + : d_ptr(&nullQPrinterInfoPrivate) { - d_ptr = &nullQPrinterInfoPrivate; } QPrinterInfo::QPrinterInfo(const QString& name) + : d_ptr(new QPrinterInfoPrivate(name)) { - d_ptr = new QPrinterInfoPrivate(name); d_ptr->q_ptr = this; } QPrinterInfo::QPrinterInfo(const QPrinterInfo& src) + : d_ptr(&nullQPrinterInfoPrivate) { - d_ptr = &nullQPrinterInfoPrivate; *this = src; } QPrinterInfo::QPrinterInfo(const QPrinter& prn) + : d_ptr(&nullQPrinterInfoPrivate) { - d_ptr = &nullQPrinterInfoPrivate; QList list = availablePrinters(); for (int c = 0; c < list.size(); ++c) { if (prn.printerName() == list[c].printerName()) { @@ -187,16 +203,12 @@ QPrinterInfo::QPrinterInfo(const QPrinter& prn) QPrinterInfo::~QPrinterInfo() { - if (d_ptr != &nullQPrinterInfoPrivate) - delete d_ptr; } QPrinterInfo& QPrinterInfo::operator=(const QPrinterInfo& src) { Q_ASSERT(d_ptr); - if (d_ptr != &nullQPrinterInfoPrivate) - delete d_ptr; - d_ptr = new QPrinterInfoPrivate(*src.d_ptr); + d_ptr.reset(new QPrinterInfoPrivate(*src.d_ptr)); d_ptr->q_ptr = this; return *this; } diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp index 583885c..3c06bb4 100644 --- a/src/gui/painting/qrasterizer.cpp +++ b/src/gui/painting/qrasterizer.cpp @@ -436,8 +436,11 @@ void QScanConverter::end() inline void QScanConverter::allocate(int size) { if (m_alloc < size) { - m_alloc = qMax(size, 2 * m_alloc); - m_intersections = (Intersection *)realloc(m_intersections, m_alloc * sizeof(Intersection)); + int newAlloc = qMax(size, 2 * m_alloc); + Intersection *newIntersections = (Intersection *)realloc(m_intersections, newAlloc * sizeof(Intersection)); + Q_CHECK_PTR(newIntersections); + m_alloc = newAlloc; + m_intersections = newIntersections; } } diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp index c88af7c..65964de 100644 --- a/src/gui/painting/qregion.cpp +++ b/src/gui/painting/qregion.cpp @@ -3167,6 +3167,7 @@ static void InsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline, { tmpSLLBlock = (ScanLineListBlock *)malloc(sizeof(ScanLineListBlock)); + Q_CHECK_PTR(tmpSLLBlock); (*SLLBlock)->next = tmpSLLBlock; tmpSLLBlock->next = (ScanLineListBlock *)NULL; *SLLBlock = tmpSLLBlock; @@ -3553,6 +3554,8 @@ static void PtsToRegion(register int numFullPtBlocks, register int iCurPtBlock, * Scan converts a polygon by returning a run-length * encoding of the resultant bitmap -- the run-length * encoding is in the form of an array of rectangles. + * + * Can return 0 in case of errors. */ static QRegionPrivate *PolygonRegion(const QPoint *Pts, int Count, int rule) //Point *Pts; /* the pts */ @@ -3624,75 +3627,28 @@ static QRegionPrivate *PolygonRegion(const QPoint *Pts, int Count, int rule) } - if (rule == EvenOddRule) { - /* - * for each scanline - */ - for (y = ET.ymin; y < ET.ymax; ++y) { - - /* - * Add a new edge to the active edge table when we - * get to the next edge. - */ - if (pSLL && y == pSLL->scanline) { - loadAET(&AET, pSLL->edgelist); - pSLL = pSLL->next; - } - pPrevAET = &AET; - pAET = AET.next; - + QT_TRY { + if (rule == EvenOddRule) { /* - * for each active edge + * for each scanline */ - while (pAET) { - pts->setX(pAET->bres.minor_axis); - pts->setY(y); - ++pts; - ++iPts; + for (y = ET.ymin; y < ET.ymax; ++y) { /* - * send out the buffer + * Add a new edge to the active edge table when we + * get to the next edge. */ - if (iPts == NUMPTSTOBUFFER) { - tmpPtBlock = (POINTBLOCK *)malloc(sizeof(POINTBLOCK)); - tmpPtBlock->pts = reinterpret_cast(tmpPtBlock->data); - curPtBlock->next = tmpPtBlock; - curPtBlock = tmpPtBlock; - pts = curPtBlock->pts; - ++numFullPtBlocks; - iPts = 0; + if (pSLL && y == pSLL->scanline) { + loadAET(&AET, pSLL->edgelist); + pSLL = pSLL->next; } - EVALUATEEDGEEVENODD(pAET, pPrevAET, y) - } - InsertionSort(&AET); - } - } else { - /* - * for each scanline - */ - for (y = ET.ymin; y < ET.ymax; ++y) { - /* - * Add a new edge to the active edge table when we - * get to the next edge. - */ - if (pSLL && y == pSLL->scanline) { - loadAET(&AET, pSLL->edgelist); - computeWAET(&AET); - pSLL = pSLL->next; - } - pPrevAET = &AET; - pAET = AET.next; - pWETE = pAET; + pPrevAET = &AET; + pAET = AET.next; - /* - * for each active edge - */ - while (pAET) { /* - * add to the buffer only those edges that - * are in the Winding active edge table. + * for each active edge */ - if (pWETE == pAET) { + while (pAET) { pts->setX(pAET->bres.minor_axis); pts->setY(y); ++pts; @@ -3702,7 +3658,8 @@ static QRegionPrivate *PolygonRegion(const QPoint *Pts, int Count, int rule) * send out the buffer */ if (iPts == NUMPTSTOBUFFER) { - tmpPtBlock = static_cast(malloc(sizeof(POINTBLOCK))); + tmpPtBlock = (POINTBLOCK *)malloc(sizeof(POINTBLOCK)); + Q_CHECK_PTR(tmpPtBlock); tmpPtBlock->pts = reinterpret_cast(tmpPtBlock->data); curPtBlock->next = tmpPtBlock; curPtBlock = tmpPtBlock; @@ -3710,21 +3667,81 @@ static QRegionPrivate *PolygonRegion(const QPoint *Pts, int Count, int rule) ++numFullPtBlocks; iPts = 0; } - pWETE = pWETE->nextWETE; + EVALUATEEDGEEVENODD(pAET, pPrevAET, y) } - EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET) + InsertionSort(&AET); } - + } else { /* - * recompute the winding active edge table if - * we just resorted or have exited an edge. + * for each scanline */ - if (InsertionSort(&AET) || fixWAET) { - computeWAET(&AET); - fixWAET = false; + for (y = ET.ymin; y < ET.ymax; ++y) { + /* + * Add a new edge to the active edge table when we + * get to the next edge. + */ + if (pSLL && y == pSLL->scanline) { + loadAET(&AET, pSLL->edgelist); + computeWAET(&AET); + pSLL = pSLL->next; + } + pPrevAET = &AET; + pAET = AET.next; + pWETE = pAET; + + /* + * for each active edge + */ + while (pAET) { + /* + * add to the buffer only those edges that + * are in the Winding active edge table. + */ + if (pWETE == pAET) { + pts->setX(pAET->bres.minor_axis); + pts->setY(y); + ++pts; + ++iPts; + + /* + * send out the buffer + */ + if (iPts == NUMPTSTOBUFFER) { + tmpPtBlock = static_cast(malloc(sizeof(POINTBLOCK))); + tmpPtBlock->pts = reinterpret_cast(tmpPtBlock->data); + curPtBlock->next = tmpPtBlock; + curPtBlock = tmpPtBlock; + pts = curPtBlock->pts; + ++numFullPtBlocks; + iPts = 0; + } + pWETE = pWETE->nextWETE; + } + EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET) + } + + /* + * recompute the winding active edge table if + * we just resorted or have exited an edge. + */ + if (InsertionSort(&AET) || fixWAET) { + computeWAET(&AET); + fixWAET = false; + } } } + } QT_CATCH(...) { + FreeStorage(SLLBlock.next); + PtsToRegion(numFullPtBlocks, iPts, &FirstPtBlock, region); + for (curPtBlock = FirstPtBlock.next; --numFullPtBlocks >= 0;) { + tmpPtBlock = curPtBlock->next; + free(curPtBlock); + curPtBlock = tmpPtBlock; + } + free(pETEs); + return 0; // this function returns 0 in case of an error } + FreeStorage(SLLBlock.next); PtsToRegion(numFullPtBlocks, iPts, &FirstPtBlock, region); for (curPtBlock = FirstPtBlock.next; --numFullPtBlocks >= 0;) { @@ -3923,11 +3940,10 @@ QRegion &QRegion::operator=(const QRegion &r) /*! \internal */ - QRegion QRegion::copy() const { QRegion r; - QRegionData *x = new QRegionData; + QScopedPointer x(new QRegionData); x->ref = 1; #if defined(Q_WS_X11) x->rgn = 0; @@ -3941,7 +3957,7 @@ QRegion QRegion::copy() const x->qt_rgn = new QRegionPrivate; if (!r.d->ref.deref()) cleanUp(r.d); - r.d = x; + r.d = x.take(); return r; } diff --git a/src/gui/painting/qwindowsurface_raster.cpp b/src/gui/painting/qwindowsurface_raster.cpp index 0a6a04e..97178a6 100644 --- a/src/gui/painting/qwindowsurface_raster.cpp +++ b/src/gui/painting/qwindowsurface_raster.cpp @@ -115,8 +115,6 @@ QRasterWindowSurface::~QRasterWindowSurface() #endif if (d_ptr->image) delete d_ptr->image; - - delete d_ptr; } diff --git a/src/gui/painting/qwindowsurface_raster_p.h b/src/gui/painting/qwindowsurface_raster_p.h index 2a3535f..c10bec3 100644 --- a/src/gui/painting/qwindowsurface_raster_p.h +++ b/src/gui/painting/qwindowsurface_raster_p.h @@ -112,7 +112,7 @@ public: private: void prepareBuffer(QImage::Format format, QWidget *widget); Q_DECLARE_PRIVATE(QRasterWindowSurface) - QRasterWindowSurfacePrivate *d_ptr; + QScopedPointer d_ptr; }; QT_END_NAMESPACE diff --git a/src/gui/styles/qs60style.h b/src/gui/styles/qs60style.h index 21cdd1c..d8e9a40 100644 --- a/src/gui/styles/qs60style.h +++ b/src/gui/styles/qs60style.h @@ -90,12 +90,12 @@ public: #endif // !Q_WS_S60 #ifdef Q_WS_S60 -public slots: +public Q_SLOTS: void handleDynamicLayoutVariantSwitch(); void handleSkinChange(); #endif // Q_WS_S60 -protected slots: +protected Q_SLOTS: QIcon standardIconImplementation( StandardPixmap standardIcon, const QStyleOption * option = 0, const QWidget * widget = 0 ) const; diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index dd50d12..e324db6 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -314,7 +314,7 @@ QFontPrivate *QFontPrivate::smallCapsFontPrivate() const font.setPointSizeF(pointSize * .7); else font.setPixelSize((font.pixelSize() * 7 + 5) / 10); - scFont = font.d; + scFont = font.d.data(); if (scFont != this) scFont->ref.ref(); return scFont; @@ -721,12 +721,11 @@ QFont::QFont(const QFont &font, QPaintDevice *pd) const int screen = 0; #endif if (font.d->dpi != dpi || font.d->screen != screen ) { - d = new QFontPrivate(*font.d); + d.reset(new QFontPrivate(*font.d)); d->dpi = dpi; d->screen = screen; } else { - d = font.d; - d->ref.ref(); + d.assign(font.d.data()); } #ifdef Q_WS_WIN if (pd->devType() == QInternal::Printer && pd->getDC()) @@ -740,8 +739,7 @@ QFont::QFont(const QFont &font, QPaintDevice *pd) QFont::QFont(QFontPrivate *data) : resolve_mask(QFont::AllPropertiesResolved) { - d = data; - d->ref.ref(); + d.assign(data); } /*! \internal @@ -753,13 +751,13 @@ void QFont::detach() if (d->engineData) d->engineData->ref.deref(); d->engineData = 0; - if (d->scFont && d->scFont != d) + if (d->scFont && d->scFont != d.data()) d->scFont->ref.deref(); d->scFont = 0; return; } - qAtomicDetach(d); + d.detach(); } /*! @@ -768,9 +766,9 @@ void QFont::detach() \sa QApplication::setFont(), QApplication::font() */ QFont::QFont() - :d(QApplication::font().d), resolve_mask(0) + :resolve_mask(0) { - d->ref.ref(); + d.assign(QApplication::font().d.data()); } /*! @@ -790,8 +788,8 @@ QFont::QFont() setStyleHint() QApplication::font() */ QFont::QFont(const QString &family, int pointSize, int weight, bool italic) - :d(new QFontPrivate) { + d.reset(new QFontPrivate()); resolve_mask = QFont::FamilyResolved; if (pointSize <= 0) { @@ -822,8 +820,7 @@ QFont::QFont(const QString &family, int pointSize, int weight, bool italic) */ QFont::QFont(const QFont &font) { - d = font.d; - d->ref.ref(); + d.assign(font.d.data()); resolve_mask = font.resolve_mask; } @@ -832,8 +829,6 @@ QFont::QFont(const QFont &font) */ QFont::~QFont() { - if (!d->ref.deref()) - delete d; } /*! @@ -841,7 +836,7 @@ QFont::~QFont() */ QFont &QFont::operator=(const QFont &font) { - qAtomicAssign(d, font.d); + d.assign(font.d.data()); resolve_mask = font.resolve_mask; return *this; } @@ -1724,7 +1719,7 @@ QFont QFont::resolve(const QFont &other) const QFont font(*this); font.detach(); - font.d->resolve(resolve_mask, other.d); + font.d->resolve(resolve_mask, other.d.data()); return font; } @@ -2177,11 +2172,11 @@ QDataStream &operator<<(QDataStream &s, const QFont &font) s << (quint8) font.d->request.styleStrategy; s << (quint8) 0 << (quint8) font.d->request.weight - << get_font_bits(s.version(), font.d); + << get_font_bits(s.version(), font.d.data()); if (s.version() >= QDataStream::Qt_4_3) s << (quint16)font.d->request.stretch; if (s.version() >= QDataStream::Qt_4_4) - s << get_extended_font_bits(font.d); + s << get_extended_font_bits(font.d.data()); if (s.version() >= QDataStream::Qt_4_5) { s << font.d->letterSpacing.value(); s << font.d->wordSpacing.value(); @@ -2200,10 +2195,8 @@ QDataStream &operator<<(QDataStream &s, const QFont &font) */ QDataStream &operator>>(QDataStream &s, QFont &font) { - if (!font.d->ref.deref()) - delete font.d; - - font.d = new QFontPrivate; + font.d.assign(0); + font.d.reset(new QFontPrivate); font.resolve_mask = QFont::AllPropertiesResolved; quint8 styleHint, styleStrategy = QFont::PreferDefault, charSet, weight, bits; @@ -2244,7 +2237,7 @@ QDataStream &operator>>(QDataStream &s, QFont &font) font.d->request.styleStrategy = styleStrategy; font.d->request.weight = weight; - set_font_bits(s.version(), bits, font.d); + set_font_bits(s.version(), bits, font.d.data()); if (s.version() >= QDataStream::Qt_4_3) { quint16 stretch; @@ -2255,7 +2248,7 @@ QDataStream &operator>>(QDataStream &s, QFont &font) if (s.version() >= QDataStream::Qt_4_4) { quint8 extendedBits; s >> extendedBits; - set_extended_font_bits(extendedBits, font.d); + set_extended_font_bits(extendedBits, font.d.data()); } if (s.version() >= QDataStream::Qt_4_5) { int value; @@ -2337,7 +2330,7 @@ QDataStream &operator>>(QDataStream &s, QFont &font) that is not screen-compatible. */ QFontInfo::QFontInfo(const QFont &font) - : d(font.d) + : d(font.d.data()) { d->ref.ref(); } /*! @@ -2610,7 +2603,14 @@ QFontCache *QFontCache::instance() void QFontCache::cleanup() { - theFontCache()->setLocalData(0); + QThreadStorage *cache = 0; + QT_TRY { + cache = theFontCache(); + } QT_CATCH (const std::bad_alloc &) { + // no cache - just ignore + } + if (cache && cache->hasLocalData()) + cache->setLocalData(0); } #endif // QT_NO_THREAD @@ -2623,8 +2623,8 @@ QFontCache::QFontCache() QFontCache::~QFontCache() { { - EngineDataCache::Iterator it = engineDataCache.begin(), - end = engineDataCache.end(); + EngineDataCache::ConstIterator it = engineDataCache.constBegin(), + end = engineDataCache.constEnd(); while (it != end) { if (it.value()->ref == 0) delete it.value(); @@ -2634,8 +2634,8 @@ QFontCache::~QFontCache() ++it; } } - EngineCache::Iterator it = engineCache.begin(), - end = engineCache.end(); + EngineCache::ConstIterator it = engineCache.constBegin(), + end = engineCache.constEnd(); while (it != end) { if (--it.value().data->cache_count == 0) { if (it.value().data->ref == 0) { diff --git a/src/gui/text/qfont.h b/src/gui/text/qfont.h index eec83b5..a513b7a 100644 --- a/src/gui/text/qfont.h +++ b/src/gui/text/qfont.h @@ -44,6 +44,7 @@ #include #include +#include #if defined(Q_WS_X11) || defined(Q_WS_QWS) typedef struct FT_FaceRec_* FT_Face; @@ -312,7 +313,7 @@ private: friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QFont &); #endif - QFontPrivate *d; + QScopedSharedPointer d; uint resolve_mask; }; diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 9426fef..416017d 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -167,10 +167,13 @@ QtFontEncoding *QtFontSize::encodingID(int id, uint xpoint, uint xres, if (!add) return 0; - if (!(count % 4)) - encodings = (QtFontEncoding *) + if (!(count % 4)) { + QtFontEncoding *newEncodings = (QtFontEncoding *) realloc(encodings, (((count+4) >> 2) << 2) * sizeof(QtFontEncoding)); + Q_CHECK_PTR(newEncodings); + encodings = newEncodings; + } encodings[count].encoding = id; encodings[count].xpoint = xpoint; encodings[count].xres = xres; @@ -274,10 +277,13 @@ QtFontSize *QtFontStyle::pixelSize(unsigned short size, bool add) if (!add) return 0; - if (!(count % 8)) - pixelSizes = (QtFontSize *) + if (!(count % 8)) { + QtFontSize *newPixelSizes = (QtFontSize *) realloc(pixelSizes, (((count+8) >> 3) << 3) * sizeof(QtFontSize)); + Q_CHECK_PTR(newPixelSizes); + pixelSizes = newPixelSizes; + } pixelSizes[count].pixelSize = size; #ifdef Q_WS_X11 pixelSizes[count].count = 0; @@ -328,12 +334,16 @@ QtFontStyle *QtFontFoundry::style(const QtFontStyle::Key &key, bool create) return 0; // qDebug("adding key (weight=%d, style=%d, oblique=%d stretch=%d) at %d", key.weight, key.style, key.oblique, key.stretch, pos); - if (!(count % 8)) - styles = (QtFontStyle **) + if (!(count % 8)) { + QtFontStyle **newStyles = (QtFontStyle **) realloc(styles, (((count+8) >> 3) << 3) * sizeof(QtFontStyle *)); + Q_CHECK_PTR(newStyles); + styles = newStyles; + } + QtFontStyle *style = new QtFontStyle(key); memmove(styles + pos + 1, styles + pos, (count-pos)*sizeof(QtFontStyle *)); - styles[pos] = new QtFontStyle(key); + styles[pos] = style; count++; return styles[pos]; } @@ -438,10 +448,13 @@ QtFontFoundry *QtFontFamily::foundry(const QString &f, bool create) if (!create) return 0; - if (!(count % 8)) - foundries = (QtFontFoundry **) + if (!(count % 8)) { + QtFontFoundry **newFoundries = (QtFontFoundry **) realloc(foundries, (((count+8) >> 3) << 3) * sizeof(QtFontFoundry *)); + Q_CHECK_PTR(newFoundries); + foundries = newFoundries; + } foundries[count] = new QtFontFoundry(f); return foundries[count++]; @@ -684,13 +697,17 @@ QtFontFamily *QFontDatabasePrivate::family(const QString &f, bool create) pos++; // qDebug("adding family %s at %d total=%d", f.latin1(), pos, count); - if (!(count % 8)) - families = (QtFontFamily **) + if (!(count % 8)) { + QtFontFamily **newFamilies = (QtFontFamily **) realloc(families, (((count+8) >> 3) << 3) * sizeof(QtFontFamily *)); + Q_CHECK_PTR(newFamilies); + families = newFamilies; + } + QtFontFamily *family = new QtFontFamily(f); memmove(families + pos + 1, families + pos, (count-pos)*sizeof(QtFontFamily *)); - families[pos] = new QtFontFamily(f); + families[pos] = family; count++; return families[pos]; } diff --git a/src/gui/text/qfontdatabase_qws.cpp b/src/gui/text/qfontdatabase_qws.cpp index 33b0728..978ff8e 100644 --- a/src/gui/text/qfontdatabase_qws.cpp +++ b/src/gui/text/qfontdatabase_qws.cpp @@ -566,8 +566,8 @@ QFontEngine *loadSingleEngine(int script, const QFontPrivate *fp, QFontEngineQPF *fe = new QFontEngineQPF(request, res.data(), res.size()); if (fe->isValid()) return fe; - qDebug() << "fontengine is not valid! " << size->fileName; delete fe; + qDebug() << "fontengine is not valid! " << size->fileName; } else { qDebug() << "Resource not valid" << size->fileName; } @@ -577,8 +577,8 @@ QFontEngine *loadSingleEngine(int script, const QFontPrivate *fp, QFontEngineQPF *fe = new QFontEngineQPF(request, f); if (fe->isValid()) return fe; - qDebug() << "fontengine is not valid!"; delete fe; // will close f + qDebug() << "fontengine is not valid!"; } #endif } else @@ -592,70 +592,67 @@ QFontEngine *loadSingleEngine(int script, const QFontPrivate *fp, static bool dontShareFonts = !qgetenv("QWS_NO_SHARE_FONTS").isEmpty(); bool shareFonts = !dontShareFonts; - QFontEngine *engine = 0; + QScopedPointer engine; #ifndef QT_NO_LIBRARY QFontEngineFactoryInterface *factory = qobject_cast(loader()->instance(foundry->name)); - if (factory) { - QFontEngineInfo info; - info.setFamily(request.family); - info.setPixelSize(request.pixelSize); - info.setStyle(QFont::Style(request.style)); - info.setWeight(request.weight); - // #### antialiased - - QAbstractFontEngine *customEngine = factory->create(info); - if (customEngine) { - engine = new QProxyFontEngine(customEngine, def); - - if (shareFonts) { - QVariant hint = customEngine->fontProperty(QAbstractFontEngine::CacheGlyphsHint); - if (hint.isValid()) - shareFonts = hint.toBool(); - else - shareFonts = (pixelSize < 64); - } + if (factory) { + QFontEngineInfo info; + info.setFamily(request.family); + info.setPixelSize(request.pixelSize); + info.setStyle(QFont::Style(request.style)); + info.setWeight(request.weight); + // #### antialiased + + QAbstractFontEngine *customEngine = factory->create(info); + if (customEngine) { + engine.reset(new QProxyFontEngine(customEngine, def)); + + if (shareFonts) { + QVariant hint = customEngine->fontProperty(QAbstractFontEngine::CacheGlyphsHint); + if (hint.isValid()) + shareFonts = hint.toBool(); + else + shareFonts = (pixelSize < 64); } + } } #endif // QT_NO_LIBRARY - if (!engine && !file.isEmpty() && QFile::exists(file) || privateDb()->isApplicationFont(file)) { + if ((engine.isNull() && !file.isEmpty() && QFile::exists(file)) || privateDb()->isApplicationFont(file)) { QFontEngine::FaceId faceId; faceId.filename = file.toLocal8Bit(); faceId.index = size->fileIndex; #ifndef QT_NO_FREETYPE - QFontEngineFT *fte = new QFontEngineFT(def); + QScopedPointer fte(new QFontEngineFT(def)); if (fte->init(faceId, style->antialiased, style->antialiased ? QFontEngineFT::Format_A8 : QFontEngineFT::Format_Mono)) { #ifdef QT_NO_QWS_QPF2 - return fte; + return fte.take(); #else - engine = fte; // try to distinguish between bdf and ttf fonts we can pre-render // and don't try to share outline fonts shareFonts = shareFonts && !fte->defaultGlyphs()->outline_drawing && !fte->getSfntTable(MAKE_TAG('h', 'e', 'a', 'd')).isEmpty(); + engine.reset(fte.take()); #endif - } else { - delete fte; } #endif // QT_NO_FREETYPE } - if (engine) { + if (!engine.isNull()) { #if !defined(QT_NO_QWS_QPF2) && !defined(QT_FONTS_ARE_RESOURCES) if (shareFonts) { - QFontEngineQPF *fe = new QFontEngineQPF(def, -1, engine); - engine = 0; + QScopedPointer fe(new QFontEngineQPF(def, -1, engine.data())); + engine.take(); if (fe->isValid()) - return fe; + return fe.take(); qWarning("Initializing QFontEngineQPF failed for %s", qPrintable(file)); - engine = fe->takeRenderingEngine(); - delete fe; + engine.reset(fe->takeRenderingEngine()); } #endif - return engine; + return engine.take(); } } else { @@ -682,20 +679,22 @@ QFontEngine *loadEngine(int script, const QFontPrivate *fp, QtFontFamily *family, QtFontFoundry *foundry, QtFontStyle *style, QtFontSize *size) { - QFontEngine *fe = loadSingleEngine(script, fp, request, family, foundry, - style, size); - if (fe + QScopedPointer engine(loadSingleEngine(script, fp, request, family, foundry, + style, size)); + if (!engine.isNull() && script == QUnicodeTables::Common - && !(request.styleStrategy & QFont::NoFontMerging) && !fe->symbol) { + && !(request.styleStrategy & QFont::NoFontMerging) && !engine->symbol) { QStringList fallbacks = privateDb()->fallbackFamilies; if (family && !family->fallbackFamilies.isEmpty()) fallbacks = family->fallbackFamilies; - fe = new QFontEngineMultiQWS(fe, script, fallbacks); + QFontEngine *fe = new QFontEngineMultiQWS(engine.data(), script, fallbacks); + engine.take(); + engine.reset(fe); } - return fe; + return engine.take(); } static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt) diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index c2c23ee..2f96984 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -191,18 +191,20 @@ QFontEngine::QFontEngine() QFontEngine::~QFontEngine() { - for (GlyphPointerHash::iterator it = m_glyphPointerHash.begin(), end = m_glyphPointerHash.end(); - it != end; ++it) { - for (QList::iterator it2 = it.value().begin(), end2 = it.value().end(); - it2 != end2; ++it2) - delete *it2; + for (GlyphPointerHash::const_iterator it = m_glyphPointerHash.constBegin(), + end = m_glyphPointerHash.constEnd(); it != end; ++it) { + for (QList::const_iterator it2 = it.value().constBegin(), + end2 = it.value().constEnd(); it2 != end2; ++it2) { + delete *it2; + } } m_glyphPointerHash.clear(); - for (GlyphIntHash::iterator it = m_glyphIntHash.begin(), end = m_glyphIntHash.end(); - it != end; ++it) { - for (QList::iterator it2 = it.value().begin(), end2 = it.value().end(); - it2 != end2; ++it2) - delete *it2; + for (GlyphIntHash::const_iterator it = m_glyphIntHash.constBegin(), + end = m_glyphIntHash.constEnd(); it != end; ++it) { + for (QList::const_iterator it2 = it.value().constBegin(), + end2 = it.value().constEnd(); it2 != end2; ++it2) { + delete *it2; + } } m_glyphIntHash.clear(); qHBFreeFace(hbFace); diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 6f5ee1f..f1dac96 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -193,6 +193,9 @@ HB_Error QFreetypeFace::getPointInOutline(HB_Glyph glyph, int flags, hb_uint32 p /* * One font file can contain more than one font (bold/italic for example) * find the right one and return it. + * + * Returns the freetype face or 0 in case of an empty file or any other problems + * (like not being able to open the file) */ QFreetypeFace *QFreetypeFace::getFace(const QFontEngine::FaceId &face_id) { @@ -205,7 +208,7 @@ QFreetypeFace *QFreetypeFace::getFace(const QFontEngine::FaceId &face_id) QFreetypeFace *freetype = freetypeData->faces.value(face_id, 0); if (!freetype) { - freetype = new QFreetypeFace; + QScopedPointer newFreetype(new QFreetypeFace); FT_Face face; QFile file(QString::fromUtf8(face_id.filename)); if (face_id.filename.startsWith(":qmemoryfonts/")) { @@ -214,84 +217,82 @@ QFreetypeFace *QFreetypeFace::getFace(const QFontEngine::FaceId &face_id) QByteArray idx = face_id.filename; idx.remove(0, 14); // remove ':qmemoryfonts/' bool ok = false; - freetype->fontData = qt_fontdata_from_index(idx.toInt(&ok)); + newFreetype->fontData = qt_fontdata_from_index(idx.toInt(&ok)); if (!ok) - freetype->fontData = QByteArray(); + newFreetype->fontData = QByteArray(); } else if (!(file.fileEngine()->fileFlags(QAbstractFileEngine::FlagsMask) & QAbstractFileEngine::LocalDiskFlag)) { if (!file.open(QIODevice::ReadOnly)) { - delete freetype; return 0; } - freetype->fontData = file.readAll(); + newFreetype->fontData = file.readAll(); } - if (!freetype->fontData.isEmpty()) { - if (FT_New_Memory_Face(freetypeData->library, (const FT_Byte *)freetype->fontData.constData(), freetype->fontData.size(), face_id.index, &face)) { - delete freetype; + if (!newFreetype->fontData.isEmpty()) { + if (FT_New_Memory_Face(freetypeData->library, (const FT_Byte *)newFreetype->fontData.constData(), newFreetype->fontData.size(), face_id.index, &face)) { return 0; } } else if (FT_New_Face(freetypeData->library, face_id.filename, face_id.index, &face)) { - delete freetype; return 0; } - freetype->face = face; - - freetype->hbFace = qHBNewFace(face, hb_getSFntTable); - freetype->ref = 0; - freetype->xsize = 0; - freetype->ysize = 0; - freetype->matrix.xx = 0x10000; - freetype->matrix.yy = 0x10000; - freetype->matrix.xy = 0; - freetype->matrix.yx = 0; - freetype->unicode_map = 0; - freetype->symbol_map = 0; + newFreetype->face = face; + + newFreetype->hbFace = qHBNewFace(face, hb_getSFntTable); + newFreetype->ref = 0; + newFreetype->xsize = 0; + newFreetype->ysize = 0; + newFreetype->matrix.xx = 0x10000; + newFreetype->matrix.yy = 0x10000; + newFreetype->matrix.xy = 0; + newFreetype->matrix.yx = 0; + newFreetype->unicode_map = 0; + newFreetype->symbol_map = 0; #ifndef QT_NO_FONTCONFIG - freetype->charset = 0; + newFreetype->charset = 0; #endif - memset(freetype->cmapCache, 0, sizeof(freetype->cmapCache)); + memset(newFreetype->cmapCache, 0, sizeof(newFreetype->cmapCache)); - for (int i = 0; i < freetype->face->num_charmaps; ++i) { - FT_CharMap cm = freetype->face->charmaps[i]; + for (int i = 0; i < newFreetype->face->num_charmaps; ++i) { + FT_CharMap cm = newFreetype->face->charmaps[i]; switch(cm->encoding) { case FT_ENCODING_UNICODE: - freetype->unicode_map = cm; + newFreetype->unicode_map = cm; break; case FT_ENCODING_APPLE_ROMAN: case FT_ENCODING_ADOBE_LATIN_1: - if (!freetype->unicode_map || freetype->unicode_map->encoding != FT_ENCODING_UNICODE) - freetype->unicode_map = cm; + if (!newFreetype->unicode_map || newFreetype->unicode_map->encoding != FT_ENCODING_UNICODE) + newFreetype->unicode_map = cm; break; case FT_ENCODING_ADOBE_CUSTOM: case FT_ENCODING_MS_SYMBOL: - if (!freetype->symbol_map) - freetype->symbol_map = cm; + if (!newFreetype->symbol_map) + newFreetype->symbol_map = cm; break; default: break; } } - if (!FT_IS_SCALABLE(freetype->face) && freetype->face->num_fixed_sizes == 1) - FT_Set_Char_Size (face, X_SIZE(freetype->face, 0), Y_SIZE(freetype->face, 0), 0, 0); + if (!FT_IS_SCALABLE(newFreetype->face) && newFreetype->face->num_fixed_sizes == 1) + FT_Set_Char_Size (face, X_SIZE(newFreetype->face, 0), Y_SIZE(newFreetype->face, 0), 0, 0); # if 0 FcChar8 *name; FcPatternGetString(pattern, FC_FAMILY, 0, &name); qDebug("%s: using maps: default: %x unicode: %x, symbol: %x", name, - freetype->face->charmap ? freetype->face->charmap->encoding : 0, - freetype->unicode_map ? freetype->unicode_map->encoding : 0, - freetype->symbol_map ? freetype->symbol_map->encoding : 0); + newFreetype->face->charmap ? newFreetype->face->charmap->encoding : 0, + newFreetype->unicode_map ? newFreetype->unicode_map->encoding : 0, + newFreetype->symbol_map ? newFreetype->symbol_map->encoding : 0); for (int i = 0; i < 256; i += 8) qDebug(" %x: %d %d %d %d %d %d %d %d", i, - FcCharSetHasChar(freetype->charset, i), FcCharSetHasChar(freetype->charset, i), - FcCharSetHasChar(freetype->charset, i), FcCharSetHasChar(freetype->charset, i), - FcCharSetHasChar(freetype->charset, i), FcCharSetHasChar(freetype->charset, i), - FcCharSetHasChar(freetype->charset, i), FcCharSetHasChar(freetype->charset, i)); + FcCharSetHasChar(newFreetype->charset, i), FcCharSetHasChar(newFreetype->charset, i), + FcCharSetHasChar(newFreetype->charset, i), FcCharSetHasChar(newFreetype->charset, i), + FcCharSetHasChar(newFreetype->charset, i), FcCharSetHasChar(newFreetype->charset, i), + FcCharSetHasChar(newFreetype->charset, i), FcCharSetHasChar(newFreetype->charset, i)); #endif - FT_Set_Charmap(freetype->face, freetype->unicode_map); - freetypeData->faces.insert(face_id, freetype); + FT_Set_Charmap(newFreetype->face, newFreetype->unicode_map); + freetypeData->faces.insert(face_id, newFreetype.data()); + freetype = newFreetype.take(); } freetype->ref.ref(); return freetype; @@ -608,6 +609,7 @@ QFontEngineFT::QFontEngineFT(const QFontDef &fd) kerning_pairs_loaded = false; transform = false; antialias = true; + freetype = 0; default_load_flags = 0; default_hint_style = HintNone; subpixelType = Subpixel_None; diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h index 649d78b..b67895b 100644 --- a/src/gui/text/qfontengine_ft_p.h +++ b/src/gui/text/qfontengine_ft_p.h @@ -119,6 +119,7 @@ struct QFreetypeFace static void addBitmapToPath(FT_GlyphSlot slot, const QFixedPoint &point, QPainterPath *path, bool = false); private: + friend class QScopedPointer; QFreetypeFace() : _lock(QMutex::Recursive) {} ~QFreetypeFace() {} QAtomicInt ref; diff --git a/src/gui/text/qfontengine_qpf.cpp b/src/gui/text/qfontengine_qpf.cpp index e9fcac4..435a102 100644 --- a/src/gui/text/qfontengine_qpf.cpp +++ b/src/gui/text/qfontengine_qpf.cpp @@ -325,21 +325,21 @@ QFontEngineQPF::QFontEngineQPF(const QFontDef &def, int fileDescriptor, QFontEng fileName.replace(QLatin1Char(' '), QLatin1Char('_')); fileName.prepend(qws_fontCacheDir()); - const QByteArray encodedName = QFile::encodeName(fileName); - if (::access(encodedName, F_OK) == 0) { + encodedFileName = QFile::encodeName(fileName); + if (::access(encodedFileName, F_OK) == 0) { #if defined(DEBUG_FONTENGINE) qDebug() << "found existing qpf:" << fileName; #endif - if (::access(encodedName, W_OK | R_OK) == 0) - fd = ::open(encodedName, O_RDWR); - else if (::access(encodedName, R_OK) == 0) - fd = ::open(encodedName, O_RDONLY); + if (::access(encodedFileName, W_OK | R_OK) == 0) + fd = ::open(encodedFileName, O_RDWR); + else if (::access(encodedFileName, R_OK) == 0) + fd = ::open(encodedFileName, O_RDONLY); } else { #if defined(DEBUG_FONTENGINE) qDebug() << "creating qpf on the fly:" << fileName; #endif if (::access(QFile::encodeName(qws_fontCacheDir()), W_OK) == 0) { - fd = ::open(encodedName, O_RDWR | O_EXCL | O_CREAT, 0644); + fd = ::open(encodedFileName, O_RDWR | O_EXCL | O_CREAT, 0644); QBuffer buffer; buffer.open(QIODevice::ReadWrite); @@ -474,15 +474,21 @@ QFontEngineQPF::QFontEngineQPF(const QFontDef &def, int fileDescriptor, QFontEng #endif #if defined(Q_WS_QWS) if (isValid() && renderingFontEngine) - qt_fbdpy->sendFontCommand(QWSFontCommand::StartedUsingFont, QFile::encodeName(fileName)); + qt_fbdpy->sendFontCommand(QWSFontCommand::StartedUsingFont, encodedFileName); #endif } QFontEngineQPF::~QFontEngineQPF() { #if defined(Q_WS_QWS) - if (isValid() && renderingFontEngine) - qt_fbdpy->sendFontCommand(QWSFontCommand::StoppedUsingFont, QFile::encodeName(fileName)); + if (isValid() && renderingFontEngine) { + QT_TRY { + qt_fbdpy->sendFontCommand(QWSFontCommand::StoppedUsingFont, encodedFileName); + } QT_CATCH(...) { + qDebug("QFontEngineQPF::~QFontEngineQPF: Out of memory"); + // ignore. + } + } #endif delete renderingFontEngine; if (fontData) @@ -1128,6 +1134,11 @@ void QPFGenerator::writeTaggedQFixed(QFontEngineQPF::HeaderTag tag, QFixed value #endif // QT_NO_QWS_QPF2 +/* + Creates a new multi qws engine. + + This function takes ownership of the QFontEngine, increasing it's refcount. +*/ QFontEngineMultiQWS::QFontEngineMultiQWS(QFontEngine *fe, int _script, const QStringList &fallbacks) : QFontEngineMulti(fallbacks.size() + 1), fallbackFamilies(fallbacks), script(_script) diff --git a/src/gui/text/qfontengine_qpf_p.h b/src/gui/text/qfontengine_qpf_p.h index a9b87ff..629f5c6 100644 --- a/src/gui/text/qfontengine_qpf_p.h +++ b/src/gui/text/qfontengine_qpf_p.h @@ -243,6 +243,7 @@ private: quint32 glyphDataOffset; quint32 glyphDataSize; QString fileName; + QByteArray encodedFileName; bool readOnly; QFreetypeFace *freetype; diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp index 87da628..991fed7 100644 --- a/src/gui/text/qfontmetrics.cpp +++ b/src/gui/text/qfontmetrics.cpp @@ -164,7 +164,7 @@ extern int qt_defaultDpi(); metrics that are compatible with a certain paint device. */ QFontMetrics::QFontMetrics(const QFont &font) - : d(font.d) + : d(font.d.data()) { d->ref.ref(); } @@ -196,7 +196,7 @@ QFontMetrics::QFontMetrics(const QFont &font, QPaintDevice *paintdevice) d->dpi = dpi; d->screen = screen; } else { - d = font.d; + d = font.d.data(); d->ref.ref(); } @@ -1006,7 +1006,7 @@ QFontMetricsF &QFontMetricsF::operator=(const QFontMetrics &other) metrics that are compatible with a certain paint device. */ QFontMetricsF::QFontMetricsF(const QFont &font) - : d(font.d) + : d(font.d.data()) { d->ref.ref(); } @@ -1038,7 +1038,7 @@ QFontMetricsF::QFontMetricsF(const QFont &font, QPaintDevice *paintdevice) d->dpi = dpi; d->screen = screen; } else { - d = font.d; + d = font.d.data(); d->ref.ref(); } diff --git a/src/gui/text/qfragmentmap_p.h b/src/gui/text/qfragmentmap_p.h index 737a717..0f0e0ff 100644 --- a/src/gui/text/qfragmentmap_p.h +++ b/src/gui/text/qfragmentmap_p.h @@ -214,6 +214,7 @@ private: template QFragmentMapData::QFragmentMapData() + : fragments(0) { init(); } @@ -222,6 +223,7 @@ template void QFragmentMapData::init() { fragments = (Fragment *)malloc(64*fragmentSize); + Q_CHECK_PTR(fragments); head->tag = (((quint32)'p') << 24) | (((quint32)'m') << 16) | (((quint32)'a') << 8) | 'p'; //TAG('p', 'm', 'a', 'p'); head->root = 0; head->freelist = 1; @@ -247,7 +249,9 @@ uint QFragmentMapData::createFragment() // need to create some free space uint needed = qAllocMore((freePos+1)*fragmentSize, 0); Q_ASSERT(needed/fragmentSize > head->allocated); - fragments = (Fragment *)realloc(fragments, needed); + Fragment *newFragments = (Fragment *)realloc(fragments, needed); + Q_CHECK_PTR(newFragments); + fragments = newFragments; head->allocated = needed/fragmentSize; F(freePos).right = 0; } @@ -787,6 +791,8 @@ public: QFragmentMap() {} ~QFragmentMap() { + if (!data.fragments) + return; // in case of out-of-memory, we won't have fragments for (Iterator it = begin(); !it.atEnd(); ++it) it.value()->free(); } diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index d41d414..0c55ce5 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -2069,10 +2069,12 @@ void QTextEngine::LayoutData::reallocate(int totalGlyphs) int newAllocated = space_charAttributes + space_glyphs + space_logClusters; Q_ASSERT(newAllocated >= allocated); - void **old_mem = memory; - memory = (void **)::realloc(memory_on_stack ? 0 : old_mem, newAllocated*sizeof(void *)); - if (memory_on_stack && memory) - memcpy(memory, old_mem, allocated*sizeof(void *)); + void **newMem = memory; + newMem = (void **)::realloc(memory_on_stack ? 0 : memory, newAllocated*sizeof(void *)); + Q_CHECK_PTR(newMem); + if (memory_on_stack && newMem) + memcpy(newMem, memory, allocated*sizeof(void *)); + memory = newMem; memory_on_stack = false; void **m = memory; diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index fa624ef..6c67a68 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -367,7 +367,7 @@ QTextLayout::QTextLayout(const QString& text, const QFont &font, QPaintDevice *p QFont f(font); if (paintdevice) f = QFont(font, paintdevice); - d = new QTextEngine((text.isNull() ? (const QString&)QString::fromLatin1("") : text), f.d); + d = new QTextEngine((text.isNull() ? (const QString&)QString::fromLatin1("") : text), f.d.data()); } /*! diff --git a/src/gui/text/qtextoption.cpp b/src/gui/text/qtextoption.cpp index e1b9844..0f24d9b 100644 --- a/src/gui/text/qtextoption.cpp +++ b/src/gui/text/qtextoption.cpp @@ -117,7 +117,13 @@ QTextOption &QTextOption::operator=(const QTextOption &o) { if (this == &o) return *this; - delete d; d = 0; + + QTextOptionPrivate* dNew = 0; + if (o.d) + dNew = new QTextOptionPrivate(*o.d); + delete d; + d = dNew; + align = o.align; wordWrap = o.wordWrap; design = o.design; @@ -125,8 +131,6 @@ QTextOption &QTextOption::operator=(const QTextOption &o) unused = o.unused; f = o.f; tab = o.tab; - if (o.d) - d = new QTextOptionPrivate(*o.d); return *this; } diff --git a/src/gui/text/qtexttable.cpp b/src/gui/text/qtexttable.cpp index 48708c9..edba2c4 100644 --- a/src/gui/text/qtexttable.cpp +++ b/src/gui/text/qtexttable.cpp @@ -432,6 +432,13 @@ void QTextTablePrivate::fragmentRemoved(const QChar &type, uint fragment) QTextFramePrivate::fragmentRemoved(type, fragment); } +/*! + /fn void QTextTablePrivate::update() const + + This function is usually called when the table is "dirty". + It seems to update all kind of table information. + +*/ void QTextTablePrivate::update() const { Q_Q(const QTextTable); @@ -439,7 +446,9 @@ void QTextTablePrivate::update() const nRows = (cells.size() + nCols-1)/nCols; // qDebug(">>>> QTextTablePrivate::update, nRows=%d, nCols=%d", nRows, nCols); - grid = (int *)realloc(grid, nRows*nCols*sizeof(int)); + int* newGrid = (int *)realloc(grid, nRows*nCols*sizeof(int)); + Q_CHECK_PTR(newGrid); + grid = newGrid; memset(grid, 0, nRows*nCols*sizeof(int)); QTextDocumentPrivate *p = pieceTable; @@ -463,7 +472,9 @@ void QTextTablePrivate::update() const cellIndices[i] = cell; if (r + rowspan > nRows) { - grid = (int *)realloc(grid, sizeof(int)*(r + rowspan)*nCols); + newGrid = (int *)realloc(grid, sizeof(int)*(r + rowspan)*nCols); + Q_CHECK_PTR(newGrid); + grid = newGrid; memset(grid + (nRows*nCols), 0, sizeof(int)*(r+rowspan-nRows)*nCols); nRows = r + rowspan; } diff --git a/src/gui/text/qzip.cpp b/src/gui/text/qzip.cpp index c6c2e69..04f081e 100644 --- a/src/gui/text/qzip.cpp +++ b/src/gui/text/qzip.cpp @@ -695,7 +695,7 @@ void QZipWriterPrivate::addEntry(EntryType type, const QString &fileName, const */ QZipReader::QZipReader(const QString &archive, QIODevice::OpenMode mode) { - QFile *f = new QFile(archive); + QScopedPointer f(new QFile(archive)); f->open(mode); QZipReader::Status status; if (f->error() == QFile::NoError) @@ -711,7 +711,8 @@ QZipReader::QZipReader(const QString &archive, QIODevice::OpenMode mode) status = FileError; } - d = new QZipReaderPrivate(f, /*ownDevice=*/true); + d = new QZipReaderPrivate(f.data(), /*ownDevice=*/true); + f.take(); d->status = status; } @@ -969,7 +970,7 @@ void QZipReader::close() */ QZipWriter::QZipWriter(const QString &fileName, QIODevice::OpenMode mode) { - QFile *f = new QFile(fileName); + QScopedPointer f(new QFile(fileName)); f->open(mode); QZipWriter::Status status; if (f->error() == QFile::NoError) @@ -985,7 +986,8 @@ QZipWriter::QZipWriter(const QString &fileName, QIODevice::OpenMode mode) status = QZipWriter::FileError; } - d = new QZipWriterPrivate(f, /*ownDevice=*/true); + d = new QZipWriterPrivate(f.data(), /*ownDevice=*/true); + f.take(); d->status = status; } diff --git a/src/gui/widgets/qabstractscrollarea.cpp b/src/gui/widgets/qabstractscrollarea.cpp index 9886969..1ff56e8 100644 --- a/src/gui/widgets/qabstractscrollarea.cpp +++ b/src/gui/widgets/qabstractscrollarea.cpp @@ -281,8 +281,8 @@ void QAbstractScrollAreaPrivate::init() scrollBarContainers[Qt::Vertical]->setVisible(false); QObject::connect(vbar, SIGNAL(valueChanged(int)), q, SLOT(_q_vslide(int))); QObject::connect(vbar, SIGNAL(rangeChanged(int,int)), q, SLOT(_q_showOrHideScrollBars()), Qt::QueuedConnection); - viewportFilter = new QAbstractScrollAreaFilter(this); - viewport->installEventFilter(viewportFilter); + viewportFilter.reset(new QAbstractScrollAreaFilter(this)); + viewport->installEventFilter(viewportFilter.data()); viewport->setFocusProxy(q); q->setFocusPolicy(Qt::WheelFocus); q->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); @@ -471,7 +471,12 @@ QAbstractScrollArea::QAbstractScrollArea(QAbstractScrollAreaPrivate &dd, QWidget :QFrame(dd, parent) { Q_D(QAbstractScrollArea); - d->init(); + QT_TRY { + d->init(); + } QT_CATCH(...) { + d->viewportFilter.reset(); + QT_RETHROW; + } } /*! @@ -483,7 +488,12 @@ QAbstractScrollArea::QAbstractScrollArea(QWidget *parent) :QFrame(*new QAbstractScrollAreaPrivate, parent) { Q_D(QAbstractScrollArea); - d->init(); + QT_TRY { + d->init(); + } QT_CATCH(...) { + d->viewportFilter.reset(); + QT_RETHROW; + } } @@ -493,7 +503,8 @@ QAbstractScrollArea::QAbstractScrollArea(QWidget *parent) QAbstractScrollArea::~QAbstractScrollArea() { Q_D(QAbstractScrollArea); - delete d->viewportFilter; + // reset it here, otherwise we'll have a dangling pointer in ~QWidget + d->viewportFilter.reset(); } @@ -517,7 +528,7 @@ void QAbstractScrollArea::setViewport(QWidget *widget) d->viewport = widget; d->viewport->setParent(this); d->viewport->setFocusProxy(this); - d->viewport->installEventFilter(d->viewportFilter); + d->viewport->installEventFilter(d->viewportFilter.data()); d->layoutChildren(); if (isVisible()) d->viewport->show(); diff --git a/src/gui/widgets/qabstractscrollarea_p.h b/src/gui/widgets/qabstractscrollarea_p.h index e4c47e9..999bdfc 100644 --- a/src/gui/widgets/qabstractscrollarea_p.h +++ b/src/gui/widgets/qabstractscrollarea_p.h @@ -98,7 +98,7 @@ public: inline bool viewportEvent(QEvent *event) { return q_func()->viewportEvent(event); } - QObject *viewportFilter; + QScopedPointer viewportFilter; }; class QAbstractScrollAreaFilter : public QObject diff --git a/src/gui/widgets/qmacnativewidget_mac.h b/src/gui/widgets/qmacnativewidget_mac.h index 4db65e0..d36d74f 100644 --- a/src/gui/widgets/qmacnativewidget_mac.h +++ b/src/gui/widgets/qmacnativewidget_mac.h @@ -64,7 +64,7 @@ protected: bool event(QEvent *ev); private: - Q_DECLARE_PRIVATE_D(QWidget::d_ptr, QMacNativeWidget) + Q_DECLARE_PRIVATE(QMacNativeWidget) }; QT_END_NAMESPACE diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index 48c2cf6..0e5261c 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -149,14 +149,14 @@ static void qt_symbian_insert_action(QSymbianMenuAction* action, QListaction->text()); - HBufC* menuItemText = qt_QString2HBufCNewL(text); + TPtrC menuItemText(qt_QString2TPtrC(text)); if (action->action->menu()) { SymbianMenuItem* menuItem = new SymbianMenuItem(); menuItem->menuItemData.iCascadeId = action->command; menuItem->menuItemData.iCommandId = action->command; menuItem->menuItemData.iFlags = 0; - menuItem->menuItemData.iText = *menuItemText; + menuItem->menuItemData.iText = menuItemText; menuItem->action = action->action; if (action->action->menu()->actions().size() == 0 || !action->action->isEnabled() ) menuItem->menuItemData.iFlags |= EEikMenuItemDimmed; @@ -177,7 +177,7 @@ static void qt_symbian_insert_action(QSymbianMenuAction* action, QListmenuItemData.iCascadeId = 0; menuItem->menuItemData.iCommandId = action->command; menuItem->menuItemData.iFlags = 0; - menuItem->menuItemData.iText = *menuItemText; + menuItem->menuItemData.iText = menuItemText; menuItem->action = action->action; if (!action->action->isEnabled()){ menuItem->menuItemData.iFlags += EEikMenuItemDimmed; @@ -191,7 +191,6 @@ static void qt_symbian_insert_action(QSymbianMenuAction* action, QListappend(menuItem); } - delete menuItemText; } } diff --git a/src/gui/widgets/qmenudata.h b/src/gui/widgets/qmenudata.h index 24d960a..d570f20 100644 --- a/src/gui/widgets/qmenudata.h +++ b/src/gui/widgets/qmenudata.h @@ -67,6 +67,8 @@ private: friend class QMenuBar; void setId(int); void setSignalValue(int); + + Q_DISABLE_COPY(QMenuItem); }; QT_END_NAMESPACE diff --git a/src/gui/widgets/qprintpreviewwidget.cpp b/src/gui/widgets/qprintpreviewwidget.cpp index 16334b8..80c1271 100644 --- a/src/gui/widgets/qprintpreviewwidget.cpp +++ b/src/gui/widgets/qprintpreviewwidget.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include "qprintpreviewwidget.h" +#include "private/qwidget_p.h" #include #include @@ -170,12 +171,12 @@ protected: } // anonymous namespace -class QPrintPreviewWidgetPrivate +class QPrintPreviewWidgetPrivate : public QWidgetPrivate { Q_DECLARE_PUBLIC(QPrintPreviewWidget) public: - QPrintPreviewWidgetPrivate(QPrintPreviewWidget *q) - : q_ptr(q), scene(0), curPage(1), + QPrintPreviewWidgetPrivate() + : scene(0), curPage(1), viewMode(QPrintPreviewWidget::SinglePageView), zoomMode(QPrintPreviewWidget::FitInView), zoomFactor(1), initialized(false), fitting(true) @@ -194,7 +195,6 @@ public: void setZoomFactor(qreal zoomFactor); int calcCurrentPage(); - QPrintPreviewWidget *q_ptr; GraphicsView *graphicsView; QGraphicsScene *scene; @@ -518,7 +518,7 @@ void QPrintPreviewWidgetPrivate::setZoomFactor(qreal _zoomFactor) \sa QWidget::setWindowFlags() */ QPrintPreviewWidget::QPrintPreviewWidget(QPrinter *printer, QWidget *parent, Qt::WindowFlags flags) - : QWidget(parent, flags), d_ptr(new QPrintPreviewWidgetPrivate(this)) + : QWidget(*new QPrintPreviewWidgetPrivate, parent, flags) { Q_D(QPrintPreviewWidget); d->printer = printer; @@ -534,7 +534,7 @@ QPrintPreviewWidget::QPrintPreviewWidget(QPrinter *printer, QWidget *parent, Qt: preview. */ QPrintPreviewWidget::QPrintPreviewWidget(QWidget *parent, Qt::WindowFlags flags) - : QWidget(parent, flags), d_ptr(new QPrintPreviewWidgetPrivate(this)) + : QWidget(*new QPrintPreviewWidgetPrivate, parent, flags) { Q_D(QPrintPreviewWidget); d->printer = new QPrinter; @@ -551,7 +551,6 @@ QPrintPreviewWidget::~QPrintPreviewWidget() Q_D(QPrintPreviewWidget); if (d->ownPrinter) delete d->printer; - delete d_ptr; } /*! diff --git a/src/gui/widgets/qprintpreviewwidget.h b/src/gui/widgets/qprintpreviewwidget.h index 27110a4..9f7ea6e 100644 --- a/src/gui/widgets/qprintpreviewwidget.h +++ b/src/gui/widgets/qprintpreviewwidget.h @@ -111,7 +111,7 @@ Q_SIGNALS: void previewChanged(); private: - QPrintPreviewWidgetPrivate *d_ptr; + void *dummy; // ### remove in Qt 5.0 Q_PRIVATE_SLOT(d_func(), void _q_fit()) Q_PRIVATE_SLOT(d_func(), void _q_updateCurrentPage()) }; diff --git a/src/network/access/qftp.cpp b/src/network/access/qftp.cpp index 569d2fd..c54c420 100644 --- a/src/network/access/qftp.cpp +++ b/src/network/access/qftp.cpp @@ -314,8 +314,10 @@ void QFtpDTP::connectToHost(const QString & host, quint16 port) { bytesFromSocket.clear(); - if (socket) + if (socket) { delete socket; + socket = 0; + } socket = new QTcpSocket(this); socket->setObjectName(QLatin1String("QFtpDTP Passive state socket")); connect(socket, SIGNAL(connected()), SLOT(socketConnected())); @@ -1658,11 +1660,12 @@ QFtp::QFtp(QObject *parent, const char *name) */ int QFtp::connectToHost(const QString &host, quint16 port) { - d_func()->pi.transferConnectionExtended = true; QStringList cmds; cmds << host; cmds << QString::number((uint)port); - return d_func()->addCommand(new QFtpCommand(ConnectToHost, cmds)); + int id = d_func()->addCommand(new QFtpCommand(ConnectToHost, cmds)); + d_func()->pi.transferConnectionExtended = true; + return id; } /*! @@ -1721,9 +1724,10 @@ int QFtp::close() */ int QFtp::setTransferMode(TransferMode mode) { + int id = d_func()->addCommand(new QFtpCommand(SetTransferMode, QStringList())); d_func()->pi.transferConnectionExtended = true; d_func()->transferMode = mode; - return d_func()->addCommand(new QFtpCommand(SetTransferMode, QStringList())); + return id; } /*! diff --git a/src/network/access/qhttp.cpp b/src/network/access/qhttp.cpp index 30befb3..332c67b 100644 --- a/src/network/access/qhttp.cpp +++ b/src/network/access/qhttp.cpp @@ -624,7 +624,6 @@ QHttpHeader::QHttpHeader(QHttpHeaderPrivate &dd, const QHttpHeader &header) */ QHttpHeader::~QHttpHeader() { - delete d_ptr; } /*! diff --git a/src/network/access/qhttp.h b/src/network/access/qhttp.h index 771176a..d575644 100644 --- a/src/network/access/qhttp.h +++ b/src/network/access/qhttp.h @@ -46,6 +46,7 @@ #include #include #include +#include QT_BEGIN_HEADER @@ -108,7 +109,7 @@ protected: QHttpHeader(QHttpHeaderPrivate &dd, const QString &str = QString()); QHttpHeader(QHttpHeaderPrivate &dd, const QHttpHeader &header); - QHttpHeaderPrivate *d_ptr; + QScopedPointer d_ptr; private: Q_DECLARE_PRIVATE(QHttpHeader) diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index ae518df..cec9c87 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -77,8 +77,10 @@ QHttpNetworkConnectionPrivate::QHttpNetworkConnectionPrivate(const QString &host QHttpNetworkConnectionPrivate::~QHttpNetworkConnectionPrivate() { for (int i = 0; i < channelCount; ++i) { - channels[i].socket->close(); - delete channels[i].socket; + if (channels[i].socket) { + channels[i].socket->close(); + delete channels[i].socket; + } } } diff --git a/src/network/access/qhttpnetworkconnection_p.h b/src/network/access/qhttpnetworkconnection_p.h index 09bd459..0f80bd9 100644 --- a/src/network/access/qhttpnetworkconnection_p.h +++ b/src/network/access/qhttpnetworkconnection_p.h @@ -244,8 +244,8 @@ public: #ifndef QT_NO_OPENSSL bool ignoreSSLErrors; #endif - Channel() :state(IdleState), reply(0), written(0), bytesTotal(0), resendCurrent(false), reconnectAttempts(2), - authMehtod(QAuthenticatorPrivate::None), proxyAuthMehtod(QAuthenticatorPrivate::None) + Channel() : socket(0), state(IdleState), reply(0), written(0), bytesTotal(0), resendCurrent(false), + reconnectAttempts(2), authMehtod(QAuthenticatorPrivate::None), proxyAuthMehtod(QAuthenticatorPrivate::None) #ifndef QT_NO_OPENSSL , ignoreSSLErrors(false) #endif diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp index f214699..4874d9d 100644 --- a/src/network/access/qnetworkaccesshttpbackend.cpp +++ b/src/network/access/qnetworkaccesshttpbackend.cpp @@ -605,6 +605,7 @@ void QNetworkAccessHttpBackend::open() QNetworkAccessCache *cache = QNetworkAccessManagerPrivate::getCache(this); if ((http = static_cast(cache->requestEntryNow(cacheKey))) == 0) { // no entry in cache; create an object + //### thiago: can we try/catch/ignore this???? http = new QNetworkAccessHttpBackendCache(url.host(), url.port(), encrypt); #ifndef QT_NO_NETWORKPROXY @@ -732,10 +733,15 @@ void QNetworkAccessHttpBackend::replyFinished() // store the SSL configuration now // once we call finished(), we won't have access to httpReply anymore QSslConfiguration sslConfig = httpReply->sslConfiguration(); - if (pendingSslConfiguration) + if (pendingSslConfiguration) { *pendingSslConfiguration = sslConfig; - else if (!sslConfig.isNull()) - pendingSslConfiguration = new QSslConfiguration(sslConfig); + } else if (!sslConfig.isNull()) { + QT_TRY { + pendingSslConfiguration = new QSslConfiguration(sslConfig); + } QT_CATCH(...) { + qWarning("QNetworkAccess: could not allocate a QSslConfiguration object for a SSL connection."); + } + } #endif finished(); diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index bcbeef1..38e8af9 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -748,8 +748,8 @@ void QNetworkAccessManagerPrivate::createCookieJar() const if (!cookieJarCreated) { // keep the ugly hack in here QNetworkAccessManagerPrivate *that = const_cast(this); - that->cookieJarCreated = true; that->cookieJar = new QNetworkCookieJar(that->q_func()); + that->cookieJarCreated = true; } } diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp index 44a8298..daa2335 100644 --- a/src/network/access/qnetworkdiskcache.cpp +++ b/src/network/access/qnetworkdiskcache.cpp @@ -43,6 +43,7 @@ #include "qnetworkdiskcache.h" #include "qnetworkdiskcache_p.h" +#include "QtCore/qscopedpointer.h" #include #include @@ -180,8 +181,7 @@ QIODevice *QNetworkDiskCache::prepare(const QNetworkCacheMetaData &metaData) break; } } - - QCacheItem *cacheItem = new QCacheItem; + QScopedPointer cacheItem(new QCacheItem); cacheItem->metaData = metaData; QIODevice *device = 0; @@ -190,16 +190,20 @@ QIODevice *QNetworkDiskCache::prepare(const QNetworkCacheMetaData &metaData) device = &(cacheItem->data); } else { QString templateName = d->tmpCacheFileName(); - cacheItem->file = new QTemporaryFile(templateName, &cacheItem->data); - if (!cacheItem->file->open()) { + QT_TRY { + cacheItem->file = new QTemporaryFile(templateName, &cacheItem->data); + } QT_CATCH(...) { + cacheItem->file = 0; + } + if (!cacheItem->file || !cacheItem->file->open()) { qWarning() << "QNetworkDiskCache::prepare() unable to open temporary file"; - delete cacheItem; + cacheItem.reset(); return 0; } cacheItem->writeHeader(cacheItem->file); device = cacheItem->file; } - d->inserting[device] = cacheItem; + d->inserting[device] = cacheItem.take(); return device; } @@ -358,31 +362,28 @@ QIODevice *QNetworkDiskCache::data(const QUrl &url) qDebug() << "QNetworkDiskCache::data()" << url; #endif Q_D(QNetworkDiskCache); - QBuffer *buffer = 0; + QScopedPointer buffer; if (!url.isValid()) - return buffer; + return 0; if (d->lastItem.metaData.url() == url && d->lastItem.data.isOpen()) { - buffer = new QBuffer; + buffer.reset(new QBuffer); buffer->setData(d->lastItem.data.data()); } else { - QFile *file = new QFile(d->cacheFileName(url)); - if (!file->open(QFile::ReadOnly | QIODevice::Unbuffered)) { - delete file; + QScopedPointer file(new QFile(d->cacheFileName(url))); + if (!file->open(QFile::ReadOnly | QIODevice::Unbuffered)) return 0; - } - if (!d->lastItem.read(file, true)) { + + if (!d->lastItem.read(file.data(), true)) { file->close(); remove(url); - delete file; return 0; } if (d->lastItem.data.isOpen()) { // compressed - buffer = new QBuffer; + buffer.reset(new QBuffer); buffer->setData(d->lastItem.data.data()); - delete file; } else { - buffer = new QBuffer; + buffer.reset(new QBuffer); // ### verify that QFile uses the fd size and not the file name qint64 size = file->size() - file->pos(); const uchar *p = 0; @@ -390,16 +391,15 @@ QIODevice *QNetworkDiskCache::data(const QUrl &url) p = file->map(file->pos(), size); #endif if (p) { - file->setParent(buffer); buffer->setData((const char *)p, size); + file.take()->setParent(buffer.data()); } else { buffer->setData(file->readAll()); - delete file; } } } buffer->open(QBuffer::ReadOnly); - return buffer; + return buffer.take(); } /*! diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp index 4f9ea52..2ff561a 100644 --- a/src/network/access/qnetworkrequest.cpp +++ b/src/network/access/qnetworkrequest.cpp @@ -216,10 +216,9 @@ public: url = other.url; #ifndef QT_NO_OPENSSL + sslConfiguration = 0; if (other.sslConfiguration) sslConfiguration = new QSslConfiguration(*other.sslConfiguration); - else - sslConfiguration = 0; #endif } diff --git a/src/network/kernel/qhostaddress.cpp b/src/network/kernel/qhostaddress.cpp index b225c17..a3634ce 100644 --- a/src/network/kernel/qhostaddress.cpp +++ b/src/network/kernel/qhostaddress.cpp @@ -523,7 +523,7 @@ QHostAddress::QHostAddress(const struct sockaddr *sockaddr) Constructs a copy of the given \a address. */ QHostAddress::QHostAddress(const QHostAddress &address) - : d(new QHostAddressPrivate(*address.d)) + : d(new QHostAddressPrivate(*address.d.data())) { } @@ -559,7 +559,6 @@ QHostAddress::QHostAddress(SpecialAddress address) */ QHostAddress::~QHostAddress() { - delete d; } /*! @@ -568,7 +567,7 @@ QHostAddress::~QHostAddress() */ QHostAddress &QHostAddress::operator=(const QHostAddress &address) { - *d = *address.d; + *d.data() = *address.d.data(); return *this; } diff --git a/src/network/kernel/qhostaddress.h b/src/network/kernel/qhostaddress.h index 02a6f97..857b4af 100644 --- a/src/network/kernel/qhostaddress.h +++ b/src/network/kernel/qhostaddress.h @@ -44,6 +44,7 @@ #include #include +#include #include struct sockaddr; @@ -130,7 +131,7 @@ public: static QPair parseSubnet(const QString &subnet); protected: - QHostAddressPrivate *d; + QScopedPointer d; }; inline bool operator ==(QHostAddress::SpecialAddress address1, const QHostAddress &address2) diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index ca4124d..1858e02 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -42,6 +42,7 @@ #include "qhostinfo.h" #include "qhostinfo_p.h" +#include "QtCore/qscopedpointer.h" #include #include #include @@ -165,24 +166,24 @@ int QHostInfo::lookupHost(const QString &name, QObject *receiver, // Support for IDNA QString lookup = QString::fromLatin1(QUrl::toAce(name)); - QHostInfoResult *result = new QHostInfoResult; - result->autoDelete = false; - QObject::connect(result, SIGNAL(resultsReady(QHostInfo)), + QScopedPointer result(new QHostInfoResult); + result.data()->autoDelete = false; + QObject::connect(result.data(), SIGNAL(resultsReady(QHostInfo)), receiver, member); - int id = result->lookupId = theIdCounter.fetchAndAddRelaxed(1); + int id = result.data()->lookupId = theIdCounter.fetchAndAddRelaxed(1); if (lookup.isEmpty()) { QHostInfo info(id); info.setError(QHostInfo::HostNotFound); info.setErrorString(QObject::tr("No host name given")); - QMetaObject::invokeMethod(result, "emitResultsReady", Qt::QueuedConnection, + QMetaObject::invokeMethod(result.data(), "emitResultsReady", Qt::QueuedConnection, Q_ARG(QHostInfo, info)); - result->autoDelete = true; + result.take()->autoDelete = true; return id; } QHostInfoAgent *agent = theAgent(); - agent->addHostName(lookup, result); + agent->addHostName(lookup, result.take()); #if !defined QT_NO_THREAD if (!agent->isRunning()) @@ -327,7 +328,7 @@ QHostInfo::QHostInfo(int id) Constructs a copy of \a other. */ QHostInfo::QHostInfo(const QHostInfo &other) - : d(new QHostInfoPrivate(*other.d)) + : d(new QHostInfoPrivate(*other.d.data())) { } @@ -337,7 +338,7 @@ QHostInfo::QHostInfo(const QHostInfo &other) */ QHostInfo &QHostInfo::operator=(const QHostInfo &other) { - *d = *other.d; + *d.data() = *other.d.data(); return *this; } @@ -346,7 +347,6 @@ QHostInfo &QHostInfo::operator=(const QHostInfo &other) */ QHostInfo::~QHostInfo() { - delete d; } /*! diff --git a/src/network/kernel/qhostinfo.h b/src/network/kernel/qhostinfo.h index 084ec89..c68b111 100644 --- a/src/network/kernel/qhostinfo.h +++ b/src/network/kernel/qhostinfo.h @@ -43,6 +43,7 @@ #define QHOSTINFO_H #include +#include #include QT_BEGIN_HEADER @@ -91,7 +92,7 @@ public: static QString localDomainName(); private: - QHostInfoPrivate *d; + QScopedPointer d; }; QT_END_NAMESPACE diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp index 3271deb..f5d7166 100644 --- a/src/network/kernel/qhostinfo_unix.cpp +++ b/src/network/kernel/qhostinfo_unix.cpp @@ -320,6 +320,8 @@ QString QHostInfo::localDomainName() if (local_res_ninit) { // using thread-safe version res_state_ptr state = res_state_ptr(qMalloc(sizeof(*state))); + if (!state) + qBadAlloc(); memset(state, 0, sizeof(*state)); local_res_ninit(state); QString domainName = QUrl::fromAce(state->defdname); diff --git a/src/network/kernel/qnetworkinterface.cpp b/src/network/kernel/qnetworkinterface.cpp index ff3624e..f8fff88 100644 --- a/src/network/kernel/qnetworkinterface.cpp +++ b/src/network/kernel/qnetworkinterface.cpp @@ -170,7 +170,7 @@ QNetworkAddressEntry::QNetworkAddressEntry() object \a other. */ QNetworkAddressEntry::QNetworkAddressEntry(const QNetworkAddressEntry &other) - : d(new QNetworkAddressEntryPrivate(*other.d)) + : d(new QNetworkAddressEntryPrivate(*other.d.data())) { } @@ -179,7 +179,7 @@ QNetworkAddressEntry::QNetworkAddressEntry(const QNetworkAddressEntry &other) */ QNetworkAddressEntry &QNetworkAddressEntry::operator=(const QNetworkAddressEntry &other) { - *d = *other.d; + *d.data() = *other.d.data(); return *this; } @@ -188,7 +188,6 @@ QNetworkAddressEntry &QNetworkAddressEntry::operator=(const QNetworkAddressEntry */ QNetworkAddressEntry::~QNetworkAddressEntry() { - delete d; } /*! diff --git a/src/network/kernel/qnetworkinterface.h b/src/network/kernel/qnetworkinterface.h index 09fbd0f..dd16550 100644 --- a/src/network/kernel/qnetworkinterface.h +++ b/src/network/kernel/qnetworkinterface.h @@ -43,6 +43,7 @@ #define QNETWORKINTERFACE_H #include +#include #include #ifndef QT_NO_NETWORKINTERFACE @@ -79,7 +80,7 @@ public: void setBroadcast(const QHostAddress &newBroadcast); private: - QNetworkAddressEntryPrivate *d; + QScopedPointer d; }; class QNetworkInterfacePrivate; diff --git a/src/network/kernel/qnetworkinterface_win.cpp b/src/network/kernel/qnetworkinterface_win.cpp index de97629..c783c33 100644 --- a/src/network/kernel/qnetworkinterface_win.cpp +++ b/src/network/kernel/qnetworkinterface_win.cpp @@ -115,6 +115,8 @@ static QHash ipv4Netmasks() if (retval == ERROR_BUFFER_OVERFLOW) { // need more memory pAdapter = (IP_ADAPTER_INFO *)qMalloc(bufSize); + if (!pAdapter) + return ipv4netmasks; // try again if (ptrGetAdaptersInfo(pAdapter, &bufSize) != ERROR_SUCCESS) { qFree(pAdapter); @@ -156,7 +158,8 @@ static QList interfaceListingWinXP() if (retval == ERROR_BUFFER_OVERFLOW) { // need more memory pAdapter = (IP_ADAPTER_ADDRESSES *)qMalloc(bufSize); - + if (!pAdapter) + return interfaces; // try again if (ptrGetAdaptersAddresses(AF_UNSPEC, flags, NULL, pAdapter, &bufSize) != ERROR_SUCCESS) { qFree(pAdapter); @@ -236,7 +239,8 @@ static QList interfaceListingWin2k() if (retval == ERROR_BUFFER_OVERFLOW) { // need more memory pAdapter = (IP_ADAPTER_INFO *)qMalloc(bufSize); - + if (!pAdapter) + return interfaces; // try again if (ptrGetAdaptersInfo(pAdapter, &bufSize) != ERROR_SUCCESS) { qFree(pAdapter); @@ -306,7 +310,8 @@ QString QHostInfo::localDomainName() pinfo = &info; if (ptrGetNetworkParams(pinfo, &bufSize) == ERROR_BUFFER_OVERFLOW) { pinfo = (FIXED_INFO *)qMalloc(bufSize); - + if (!pinfo) + return QString(); // try again if (ptrGetNetworkParams(pinfo, &bufSize) != ERROR_SUCCESS) { qFree(pinfo); diff --git a/src/network/socket/qlocalsocket_unix.cpp b/src/network/socket/qlocalsocket_unix.cpp index 9e3cbde..03723cf 100644 --- a/src/network/socket/qlocalsocket_unix.cpp +++ b/src/network/socket/qlocalsocket_unix.cpp @@ -305,7 +305,7 @@ void QLocalSocketPrivate::_q_connectToSocket() case EAGAIN: // Try again later, all of the sockets listening are full if (!delayConnect) { - delayConnect = new QSocketNotifier(connectingSocket, QSocketNotifier::Write); + delayConnect = new QSocketNotifier(connectingSocket, QSocketNotifier::Write, q); q->connect(delayConnect, SIGNAL(activated(int)), q, SLOT(_q_connectToSocket())); } if (!connectTimer) { diff --git a/src/network/socket/qsocks5socketengine.cpp b/src/network/socket/qsocks5socketengine.cpp index b6b0e89..98666c2 100644 --- a/src/network/socket/qsocks5socketengine.cpp +++ b/src/network/socket/qsocks5socketengine.cpp @@ -1834,9 +1834,9 @@ QSocks5SocketEngineHandler::createSocketEngine(QAbstractSocket::SocketType socke QSOCKS5_DEBUG << "not proxying"; return 0; } - QSocks5SocketEngine *engine = new QSocks5SocketEngine(parent); + QScopedPointer engine(new QSocks5SocketEngine(parent)); engine->setProxy(proxy); - return engine; + return engine.take(); } QAbstractSocketEngine *QSocks5SocketEngineHandler::createSocketEngine(int socketDescriptor, QObject *parent) diff --git a/src/network/socket/qtcpserver.cpp b/src/network/socket/qtcpserver.cpp index c1fedc3..1978ee2 100644 --- a/src/network/socket/qtcpserver.cpp +++ b/src/network/socket/qtcpserver.cpp @@ -354,7 +354,12 @@ void QTcpServer::close() if (d->socketEngine) { d->socketEngine->close(); - d->socketEngine->deleteLater(); + QT_TRY { + d->socketEngine->deleteLater(); + } QT_CATCH(const std::bad_alloc &) { + // in out of memory situations, the socketEngine + // will be deleted in ~QTcpServer (it's a child-object of this) + } d->socketEngine = 0; } diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp index 7b554dc..c4aa43e 100644 --- a/src/network/ssl/qsslcertificate.cpp +++ b/src/network/ssl/qsslcertificate.cpp @@ -155,7 +155,7 @@ QSslCertificate::QSslCertificate(const QByteArray &data, QSsl::EncodingFormat fo /*! Constructs an identical copy of \a other. */ -QSslCertificate::QSslCertificate(const QSslCertificate &other) : d(other.d) +QSslCertificate::QSslCertificate(const QSslCertificate &other) : d(other.d.data()) { d->ref.ref(); } @@ -165,8 +165,6 @@ QSslCertificate::QSslCertificate(const QSslCertificate &other) : d(other.d) */ QSslCertificate::~QSslCertificate() { - if (!d->ref.deref()) - delete d; } /*! @@ -175,7 +173,7 @@ QSslCertificate::~QSslCertificate() */ QSslCertificate &QSslCertificate::operator=(const QSslCertificate &other) { - qAtomicAssign(d, other.d); + d.assign(other.d.data()); return *this; } @@ -241,12 +239,7 @@ void QSslCertificate::clear() { if (isNull()) return; - if (d->ref == 1) - delete d; - else - d->ref.deref(); - - d = new QSslCertificatePrivate; + d.reset(new QSslCertificatePrivate); } /*! diff --git a/src/network/ssl/qsslcertificate.h b/src/network/ssl/qsslcertificate.h index d4597cd..19152fb 100644 --- a/src/network/ssl/qsslcertificate.h +++ b/src/network/ssl/qsslcertificate.h @@ -118,7 +118,7 @@ public: Qt::HANDLE handle() const; private: - QSslCertificatePrivate *d; + QScopedSharedPointer d; friend class QSslCertificatePrivate; friend class QSslSocketBackendPrivate; }; diff --git a/src/network/ssl/qsslcipher.cpp b/src/network/ssl/qsslcipher.cpp index 7fec2df..a72879d 100644 --- a/src/network/ssl/qsslcipher.cpp +++ b/src/network/ssl/qsslcipher.cpp @@ -103,7 +103,7 @@ QSslCipher::QSslCipher(const QString &name, QSsl::SslProtocol protocol) QSslCipher::QSslCipher(const QSslCipher &other) : d(new QSslCipherPrivate) { - *d = *other.d; + *d.data() = *other.d.data(); } /*! @@ -111,7 +111,6 @@ QSslCipher::QSslCipher(const QSslCipher &other) */ QSslCipher::~QSslCipher() { - delete d; } /*! @@ -120,7 +119,7 @@ QSslCipher::~QSslCipher() */ QSslCipher &QSslCipher::operator=(const QSslCipher &other) { - *d = *other.d; + *d.data() = *other.d.data(); return *this; } diff --git a/src/network/ssl/qsslcipher.h b/src/network/ssl/qsslcipher.h index 404dc3d..d9ac7a9 100644 --- a/src/network/ssl/qsslcipher.h +++ b/src/network/ssl/qsslcipher.h @@ -44,6 +44,7 @@ #define QSSLCIPHER_H #include +#include #include QT_BEGIN_HEADER @@ -78,7 +79,7 @@ public: QSsl::SslProtocol protocol() const; private: - QSslCipherPrivate *d; + QScopedPointer d; friend class QSslSocketBackendPrivate; }; diff --git a/src/network/ssl/qsslerror.cpp b/src/network/ssl/qsslerror.cpp index 3096fee..280c659 100644 --- a/src/network/ssl/qsslerror.cpp +++ b/src/network/ssl/qsslerror.cpp @@ -140,7 +140,7 @@ QSslError::QSslError(SslError error, const QSslCertificate &certificate) QSslError::QSslError(const QSslError &other) : d(new QSslErrorPrivate) { - *d = *other.d; + *d.data() = *other.d.data(); } /*! @@ -148,7 +148,6 @@ QSslError::QSslError(const QSslError &other) */ QSslError::~QSslError() { - delete d; } /*! @@ -158,7 +157,7 @@ QSslError::~QSslError() */ QSslError &QSslError::operator=(const QSslError &other) { - *d = *other.d; + *d.data() = *other.d.data(); return *this; } diff --git a/src/network/ssl/qsslerror.h b/src/network/ssl/qsslerror.h index 50cc142..8b8ebff 100644 --- a/src/network/ssl/qsslerror.h +++ b/src/network/ssl/qsslerror.h @@ -105,7 +105,7 @@ public: QSslCertificate certificate() const; private: - QSslErrorPrivate *d; + QScopedPointer d; }; #ifndef QT_NO_DEBUG_STREAM diff --git a/src/network/ssl/qsslkey.cpp b/src/network/ssl/qsslkey.cpp index 8d550c0..d076112 100644 --- a/src/network/ssl/qsslkey.cpp +++ b/src/network/ssl/qsslkey.cpp @@ -269,7 +269,7 @@ QSslKey::QSslKey(QIODevice *device, QSsl::KeyAlgorithm algorithm, QSsl::Encoding /*! Constructs an identical copy of \a other. */ -QSslKey::QSslKey(const QSslKey &other) : d(other.d) +QSslKey::QSslKey(const QSslKey &other) : d(other.d.data()) { d->ref.ref(); } @@ -279,8 +279,6 @@ QSslKey::QSslKey(const QSslKey &other) : d(other.d) */ QSslKey::~QSslKey() { - if (!d->ref.deref()) - delete d; } /*! @@ -291,7 +289,7 @@ QSslKey::~QSslKey() */ QSslKey &QSslKey::operator=(const QSslKey &other) { - qAtomicAssign(d, other.d); + d.assign(other.d.data()); return *this; } @@ -312,10 +310,13 @@ bool QSslKey::isNull() const */ void QSslKey::clear() { - if (!d->ref.deref()) { - delete d; - d = new QSslKeyPrivate; - } + d.reset(new QSslKeyPrivate); + + //### old code: is this really correct??? + //if (!d->ref.deref()) { + // delete d; + // d = new QSslKeyPrivate; + //} } /*! diff --git a/src/network/ssl/qsslkey.h b/src/network/ssl/qsslkey.h index 45d03f7..d5d60a6 100644 --- a/src/network/ssl/qsslkey.h +++ b/src/network/ssl/qsslkey.h @@ -45,6 +45,7 @@ #include #include +#include #include QT_BEGIN_HEADER @@ -92,7 +93,7 @@ public: inline bool operator!=(const QSslKey &key) const { return !operator==(key); } private: - QSslKeyPrivate *d; + QScopedSharedPointer d; friend class QSslCertificate; }; diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index ca5c732..cd7a7f0 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1484,8 +1484,8 @@ Q_OPENGL_EXPORT QGLShareRegister* qgl_share_reg() */ QGLContext::QGLContext(const QGLFormat &format, QPaintDevice *device) + : d_ptr(new QGLContextPrivate(this)) { - d_ptr = new QGLContextPrivate(this); Q_D(QGLContext); d->init(device, format); } @@ -1507,8 +1507,8 @@ QGLContext::QGLContext(const QGLFormat &format, QPaintDevice *device) \sa format(), isValid() */ QGLContext::QGLContext(const QGLFormat &format) + : d_ptr(new QGLContextPrivate(this)) { - d_ptr = new QGLContextPrivate(this); Q_D(QGLContext); d->init(0, format); } @@ -1539,7 +1539,6 @@ QGLContext::~QGLContext() QGLSignalProxy::instance()->emitAboutToDestroyContext(this); reset(); - delete d; } void QGLContextPrivate::cleanup() diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index 01b1d6f..b7b2f36 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -45,6 +45,7 @@ #include #include #include +#include QT_BEGIN_HEADER @@ -348,7 +349,7 @@ protected: static QGLContext* currentCtx; private: - QGLContextPrivate* d_ptr; + QScopedPointer d_ptr; friend class QGLPixelBuffer; friend class QGLPixelBufferPrivate; diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index c362b7e..6e908e2 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -448,7 +448,6 @@ QGLFramebufferObject::~QGLFramebufferObject() glDeleteRenderbuffersEXT(1, &d->depth_stencil_buffer); glDeleteFramebuffersEXT(1, &d->fbo); } - delete d_ptr; } /*! diff --git a/src/opengl/qglframebufferobject.h b/src/opengl/qglframebufferobject.h index a9e1b2f..fea8920 100644 --- a/src/opengl/qglframebufferobject.h +++ b/src/opengl/qglframebufferobject.h @@ -116,7 +116,7 @@ protected: private: Q_DISABLE_COPY(QGLFramebufferObject) - QGLFramebufferObjectPrivate *d_ptr; + QScopedPointer d_ptr; friend class QGLDrawable; }; diff --git a/src/opengl/qglpaintdevice_qws.cpp b/src/opengl/qglpaintdevice_qws.cpp index 18905ab..60a1238 100644 --- a/src/opengl/qglpaintdevice_qws.cpp +++ b/src/opengl/qglpaintdevice_qws.cpp @@ -68,8 +68,6 @@ QWSGLPaintDevice::QWSGLPaintDevice(QWidget *widget) : QWSGLPaintDevice::~QWSGLPaintDevice() { - Q_D(QWSGLPaintDevice); - delete d; } QPaintEngine* QWSGLPaintDevice::paintEngine() const diff --git a/src/opengl/qglpaintdevice_qws_p.h b/src/opengl/qglpaintdevice_qws_p.h index 369de7f..a471b1b 100644 --- a/src/opengl/qglpaintdevice_qws_p.h +++ b/src/opengl/qglpaintdevice_qws_p.h @@ -53,6 +53,7 @@ // We mean it. // +#include #include QT_BEGIN_NAMESPACE @@ -76,7 +77,7 @@ public: private: friend class QWSGLWindowSurface; - QWSGLPaintDevicePrivate *d_ptr; + QScopedPointer d_ptr; }; diff --git a/src/opengl/qglpixelbuffer.cpp b/src/opengl/qglpixelbuffer.cpp index 5f74f26..8ff2e1d 100644 --- a/src/opengl/qglpixelbuffer.cpp +++ b/src/opengl/qglpixelbuffer.cpp @@ -186,7 +186,6 @@ QGLPixelBuffer::~QGLPixelBuffer() delete d->qctx; if (current && current != d->qctx) current->makeCurrent(); - delete d_ptr; } /*! \fn bool QGLPixelBuffer::makeCurrent() diff --git a/src/opengl/qglpixelbuffer.h b/src/opengl/qglpixelbuffer.h index 0131570..8264c22 100644 --- a/src/opengl/qglpixelbuffer.h +++ b/src/opengl/qglpixelbuffer.h @@ -107,7 +107,7 @@ protected: private: Q_DISABLE_COPY(QGLPixelBuffer) - QGLPixelBufferPrivate *d_ptr; + QScopedPointer d_ptr; friend class QGLDrawable; friend class QGLWindowSurface; }; diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index 5a212f5..c9fbc7e 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -5625,7 +5625,7 @@ void QOpenGLPaintEngine::fill(const QVectorPath &path, const QBrush &brush) QPainter *p = painter(); QBrush oldBrush = p->brush(); p->setBrush(brush); - qt_draw_helper(p->d_ptr, painterPathFromVectorPath(path), QPainterPrivate::FillDraw); + qt_draw_helper(p->d_ptr.data(), painterPathFromVectorPath(path), QPainterPrivate::FillDraw); p->setBrush(oldBrush); return; } diff --git a/src/phonon/phonon.pro b/src/phonon/phonon.pro index b38adb8..221304d 100644 --- a/src/phonon/phonon.pro +++ b/src/phonon/phonon.pro @@ -119,8 +119,7 @@ symbian: { # would bring in link dependencies, and we don't need that for # numeric_limits, hence we here merely ensure we bring in the necessary # header. - INCLUDEPATH *= $${EPOCROOT}epoc32/include/stdapis/stlport \ - $$OS_LAYER_STDCPP_SYSTEMINCLUDE + INCLUDEPATH *= $$OS_LAYER_STDCPP_SYSTEMINCLUDE # Without this setting, code using numeric_limits will fail # for winscw, although armv5 works fine no matter what. diff --git a/src/plugins/imageformats/mng/qmnghandler.cpp b/src/plugins/imageformats/mng/qmnghandler.cpp index 19cc16d..7fabcd9 100644 --- a/src/plugins/imageformats/mng/qmnghandler.cpp +++ b/src/plugins/imageformats/mng/qmnghandler.cpp @@ -375,8 +375,6 @@ QMngHandler::QMngHandler() QMngHandler::~QMngHandler() { - Q_D(QMngHandler); - delete d; } /*! \reimp */ diff --git a/src/plugins/imageformats/mng/qmnghandler.h b/src/plugins/imageformats/mng/qmnghandler.h index 909be2d..ce2ec6f 100644 --- a/src/plugins/imageformats/mng/qmnghandler.h +++ b/src/plugins/imageformats/mng/qmnghandler.h @@ -42,6 +42,7 @@ #ifndef QMNGHANDLER_H #define QMNGHANDLER_H +#include #include QT_BEGIN_NAMESPACE @@ -74,7 +75,7 @@ class QMngHandler : public QImageIOHandler private: Q_DECLARE_PRIVATE(QMngHandler) - QMngHandlerPrivate *d_ptr; + QScopedPointer d_ptr; }; QT_END_NAMESPACE diff --git a/src/plugins/s60/src/qlocale_3_2.cpp b/src/plugins/s60/src/qlocale_3_2.cpp index ab3040b..7a3a7e5 100644 --- a/src/plugins/s60/src/qlocale_3_2.cpp +++ b/src/plugins/s60/src/qlocale_3_2.cpp @@ -39,6 +39,7 @@ ** ****************************************************************************/ +#include #include #include diff --git a/src/qt3support/itemviews/q3table.cpp b/src/qt3support/itemviews/q3table.cpp index 658b0ad..458f5a5 100644 --- a/src/qt3support/itemviews/q3table.cpp +++ b/src/qt3support/itemviews/q3table.cpp @@ -166,6 +166,7 @@ private: QTimer *stretchTimer, *widgetStretchTimer; Q3TableHeaderPrivate *d; + Q_DISABLE_COPY(Q3TableHeader) }; #ifdef _WS_QWS_ diff --git a/src/qt3support/other/q3accel.cpp b/src/qt3support/other/q3accel.cpp index a570a70..2358092 100644 --- a/src/qt3support/other/q3accel.cpp +++ b/src/qt3support/other/q3accel.cpp @@ -206,7 +206,7 @@ bool Q_COMPAT_EXPORT qt_tryComposeUnicode(QWidget* w, QKeyEvent* e){ void Q3AccelManager::setFuncPtr() { if (qApp->d_func()->qt_compat_used) return; - QApplicationPrivate *data = static_cast(qApp->d_ptr); + QApplicationPrivate *data = static_cast(qApp->d_ptr.data()); data->qt_tryAccelEvent = qt_tryAccelEvent; data->qt_tryComposeUnicode = qt_tryComposeUnicode; data->qt_dispatchAccelEvent = qt_dispatchAccelEvent; diff --git a/src/qt3support/painting/q3painter.h b/src/qt3support/painting/q3painter.h index 6fd17cb..c301ee7 100644 --- a/src/qt3support/painting/q3painter.h +++ b/src/qt3support/painting/q3painter.h @@ -82,6 +82,8 @@ public: private: QRect adjustedRectangle(const QRect &r); + + Q_DISABLE_COPY(Q3Painter) }; void inline Q3Painter::drawRect(const QRect &r) diff --git a/src/s60main/qts60main.cpp b/src/s60main/qts60main.cpp index 965c02b..d7daf4a 100644 --- a/src/s60main/qts60main.cpp +++ b/src/s60main/qts60main.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ // INCLUDE FILES +#include #include #include "qts60mainapplication.h" diff --git a/src/s60main/qts60main_mcrt0.cpp b/src/s60main/qts60main_mcrt0.cpp index b7bf1a3..49a47bd 100644 --- a/src/s60main/qts60main_mcrt0.cpp +++ b/src/s60main/qts60main_mcrt0.cpp @@ -79,7 +79,15 @@ GLDEF_C TInt QtMainWrapper() CleanupArrayDelete::PushL(argv); CleanupArrayDelete::PushL(envp); //Call user(application)'s main - int ret = CALLMAIN(argc,argv,envp); + int ret = 0; + try + { + ret = CALLMAIN(argc, argv, envp); + } + catch (...) + { + User::Leave(KErrGeneral); + } CleanupStack::PopAndDestroy(2,argv); return ret; } diff --git a/src/s60main/qts60mainapplication.cpp b/src/s60main/qts60mainapplication.cpp index 680243f..2fada3d 100644 --- a/src/s60main/qts60mainapplication.cpp +++ b/src/s60main/qts60mainapplication.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ // INCLUDE FILES +#include #include "qts60maindocument.h" #include "qts60mainapplication.h" #include diff --git a/src/s60main/qts60mainappui.cpp b/src/s60main/qts60mainappui.cpp index 47312af..50f7572 100644 --- a/src/s60main/qts60mainappui.cpp +++ b/src/s60main/qts60mainappui.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ // INCLUDE FILES +#include #include #include #include @@ -123,7 +124,9 @@ void CQtS60MainAppUi::HandleWsEventL(const TWsEvent& aEvent, CCoeControl *contro { int result = 0; if (qApp) - result = qApp->s60ProcessEvent(const_cast(&aEvent)); + QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE( + result = qApp->s60ProcessEvent(const_cast(&aEvent)) + ); if (result <= 0) CAknAppUi::HandleWsEventL(aEvent, control); @@ -162,7 +165,8 @@ TInt CQtS60MainAppUi::OpenCMainStaticCallBack( TAny* aObject ) // void CQtS60MainAppUi::OpenCMainCallBack() { - TInt ret = QtMainWrapper(); + TInt ret; + TRAPD(err, ret = QtMainWrapper()); Exit(); } diff --git a/src/s60main/qts60maindocument.cpp b/src/s60main/qts60maindocument.cpp index b4a2e66..eb7ea42 100644 --- a/src/s60main/qts60maindocument.cpp +++ b/src/s60main/qts60maindocument.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ // INCLUDE FILES +#include #include "qts60mainappui.h" #include "qts60maindocument.h" diff --git a/src/script/qscriptable.cpp b/src/script/qscriptable.cpp index a6401d6..56291d8 100644 --- a/src/script/qscriptable.cpp +++ b/src/script/qscriptable.cpp @@ -118,8 +118,6 @@ QScriptable::QScriptable() */ QScriptable::~QScriptable() { - delete d_ptr; - d_ptr = 0; } /*! diff --git a/src/script/qscriptable.h b/src/script/qscriptable.h index f990db2..d09b945 100644 --- a/src/script/qscriptable.h +++ b/src/script/qscriptable.h @@ -46,6 +46,8 @@ #ifndef QT_NO_SCRIPT +#include + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -73,7 +75,7 @@ public: QScriptValue argument(int index) const; private: - QScriptablePrivate *d_ptr; + QScopedPointer d_ptr; Q_DISABLE_COPY(QScriptable) Q_DECLARE_PRIVATE(QScriptable) diff --git a/src/script/qscriptclass.cpp b/src/script/qscriptclass.cpp index 14b8add..535a530 100644 --- a/src/script/qscriptclass.cpp +++ b/src/script/qscriptclass.cpp @@ -457,8 +457,6 @@ QScriptClass::QScriptClass(QScriptEngine *engine, QScriptClassPrivate &dd) */ QScriptClass::~QScriptClass() { - delete d_ptr; - d_ptr = 0; } /*! diff --git a/src/script/qscriptclass.h b/src/script/qscriptclass.h index 9c06ea2..77e9b08 100644 --- a/src/script/qscriptclass.h +++ b/src/script/qscriptclass.h @@ -47,6 +47,7 @@ #ifndef QT_NO_SCRIPT #include +#include #include QT_BEGIN_HEADER @@ -103,7 +104,7 @@ public: protected: QScriptClass(QScriptEngine *engine, QScriptClassPrivate &dd); - QScriptClassPrivate *d_ptr; + QScopedPointer d_ptr; private: Q_DECLARE_PRIVATE(QScriptClass) diff --git a/src/script/qscriptclasspropertyiterator.cpp b/src/script/qscriptclasspropertyiterator.cpp index 96f34d5..f328e14 100644 --- a/src/script/qscriptclasspropertyiterator.cpp +++ b/src/script/qscriptclasspropertyiterator.cpp @@ -111,8 +111,6 @@ QScriptClassPropertyIterator::QScriptClassPropertyIterator(const QScriptValue &o */ QScriptClassPropertyIterator::~QScriptClassPropertyIterator() { - delete d_ptr; - d_ptr = 0; } /*! diff --git a/src/script/qscriptclasspropertyiterator.h b/src/script/qscriptclasspropertyiterator.h index 2041a65..05d49d8 100644 --- a/src/script/qscriptclasspropertyiterator.h +++ b/src/script/qscriptclasspropertyiterator.h @@ -46,6 +46,7 @@ #ifndef QT_NO_SCRIPT +#include #include QT_BEGIN_HEADER @@ -80,7 +81,7 @@ public: protected: QScriptClassPropertyIterator(const QScriptValue &object, QScriptClassPropertyIteratorPrivate &dd); - QScriptClassPropertyIteratorPrivate *d_ptr; + QScopedPointer d_ptr; private: Q_DECLARE_PRIVATE(QScriptClassPropertyIterator) diff --git a/src/script/qscriptcontext.cpp b/src/script/qscriptcontext.cpp index 020601b..0b72342 100644 --- a/src/script/qscriptcontext.cpp +++ b/src/script/qscriptcontext.cpp @@ -219,8 +219,6 @@ QScriptContext::QScriptContext(): */ QScriptContext::~QScriptContext() { - delete d_ptr; - d_ptr = 0; } /*! diff --git a/src/script/qscriptcontext.h b/src/script/qscriptcontext.h index 1e1f987..25a2198 100644 --- a/src/script/qscriptcontext.h +++ b/src/script/qscriptcontext.h @@ -46,6 +46,7 @@ #ifndef QT_NO_SCRIPT +#include #include QT_BEGIN_HEADER @@ -111,7 +112,7 @@ public: private: QScriptContext(); - QScriptContextPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QScriptContext) Q_DISABLE_COPY(QScriptContext) diff --git a/src/script/qscriptcontextinfo.cpp b/src/script/qscriptcontextinfo.cpp index 260d19f..0fa5c62 100644 --- a/src/script/qscriptcontextinfo.cpp +++ b/src/script/qscriptcontextinfo.cpp @@ -204,13 +204,12 @@ QScriptContextInfoPrivate::~QScriptContextInfoPrivate() previously created QScriptContextInfo. */ QScriptContextInfo::QScriptContextInfo(const QScriptContext *context) + : d_ptr(0) { if (context) { - d_ptr = new QScriptContextInfoPrivate(context); + d_ptr.data_ptr() = new QScriptContextInfoPrivate(context); d_ptr->q_ptr = this; d_ptr->ref.ref(); - } else { - d_ptr = 0; } } @@ -218,7 +217,7 @@ QScriptContextInfo::QScriptContextInfo(const QScriptContext *context) Constructs a new QScriptContextInfo from the \a other info. */ QScriptContextInfo::QScriptContextInfo(const QScriptContextInfo &other) - : d_ptr(other.d_ptr) + : d_ptr(other.d_ptr.data()) { if (d_ptr) d_ptr->ref.ref(); @@ -239,10 +238,6 @@ QScriptContextInfo::QScriptContextInfo() */ QScriptContextInfo::~QScriptContextInfo() { - if (d_ptr && !d_ptr->ref.deref()) { - delete d_ptr; - d_ptr = 0; - } } /*! @@ -251,15 +246,7 @@ QScriptContextInfo::~QScriptContextInfo() */ QScriptContextInfo &QScriptContextInfo::operator=(const QScriptContextInfo &other) { - if (d_ptr == other.d_ptr) - return *this; - if (d_ptr && !d_ptr->ref.deref()) { - delete d_ptr; - d_ptr = 0; - } - d_ptr = other.d_ptr; - if (d_ptr) - d_ptr->ref.ref(); + d_ptr.assign(other.d_ptr.data()); return *this; } @@ -510,7 +497,7 @@ QDataStream &operator<<(QDataStream &out, const QScriptContextInfo &info) Q_SCRIPT_EXPORT QDataStream &operator>>(QDataStream &in, QScriptContextInfo &info) { if (!info.d_ptr) { - info.d_ptr = new QScriptContextInfoPrivate(); + info.d_ptr.data_ptr() = new QScriptContextInfoPrivate(); info.d_ptr->ref.ref(); } diff --git a/src/script/qscriptcontextinfo.h b/src/script/qscriptcontextinfo.h index a683733..20b6607 100644 --- a/src/script/qscriptcontextinfo.h +++ b/src/script/qscriptcontextinfo.h @@ -48,6 +48,7 @@ #include #include +#include QT_BEGIN_HEADER @@ -104,7 +105,7 @@ public: bool operator!=(const QScriptContextInfo &other) const; private: - QScriptContextInfoPrivate *d_ptr; + QScopedSharedPointer d_ptr; Q_DECLARE_PRIVATE(QScriptContextInfo) }; diff --git a/src/script/qscriptengine.cpp b/src/script/qscriptengine.cpp index d8908ed..2a36104 100644 --- a/src/script/qscriptengine.cpp +++ b/src/script/qscriptengine.cpp @@ -330,10 +330,6 @@ QScriptEngine::~QScriptEngine() Q_D(QScriptEngine); d->m_frameRepository.release(currentContext()); d->objectAllocator.destruct(); -#ifdef QT_NO_QOBJECT - delete d_ptr; - d_ptr = 0; -#endif } /*! @@ -1777,7 +1773,7 @@ QScriptValue QScriptEngine::objectById(qint64 id) const Constructs a new QScriptSyntaxCheckResult from the \a other result. */ QScriptSyntaxCheckResult::QScriptSyntaxCheckResult(const QScriptSyntaxCheckResult &other) - : d_ptr(other.d_ptr) + : d_ptr(other.d_ptr.data()) { if (d_ptr) d_ptr->ref.ref(); @@ -1806,10 +1802,6 @@ QScriptSyntaxCheckResult::QScriptSyntaxCheckResult() */ QScriptSyntaxCheckResult::~QScriptSyntaxCheckResult() { - if (d_ptr && !d_ptr->ref.deref()) { - delete d_ptr; - d_ptr = 0; - } } /*! @@ -1863,15 +1855,7 @@ QString QScriptSyntaxCheckResult::errorMessage() const */ QScriptSyntaxCheckResult &QScriptSyntaxCheckResult::operator=(const QScriptSyntaxCheckResult &other) { - if (d_ptr == other.d_ptr) - return *this; - if (d_ptr && !d_ptr->ref.deref()) { - delete d_ptr; - d_ptr = 0; - } - d_ptr = other.d_ptr; - if (d_ptr) - d_ptr->ref.ref(); + d_ptr.assign(other.d_ptr.data()); return *this; } diff --git a/src/script/qscriptengine.h b/src/script/qscriptengine.h index afd551b..c55caac 100644 --- a/src/script/qscriptengine.h +++ b/src/script/qscriptengine.h @@ -47,6 +47,7 @@ #ifndef QT_NO_SCRIPT #include +#include #ifndef QT_NO_QOBJECT #include @@ -114,7 +115,7 @@ public: private: QScriptSyntaxCheckResult(); QScriptSyntaxCheckResult(QScriptSyntaxCheckResultPrivate *d); - QScriptSyntaxCheckResultPrivate *d_ptr; + QScopedSharedPointer d_ptr; Q_DECLARE_PRIVATE(QScriptSyntaxCheckResult) friend class QScriptEnginePrivate; @@ -282,7 +283,7 @@ private: protected: #ifdef QT_NO_QOBJECT - QScriptEnginePrivate *d_ptr; + QScopedPointer d_ptr; QScriptEngine(QScriptEnginePrivate &dd); #else diff --git a/src/script/qscriptengineagent.cpp b/src/script/qscriptengineagent.cpp index bda94ae..c3eaf96 100644 --- a/src/script/qscriptengineagent.cpp +++ b/src/script/qscriptengineagent.cpp @@ -173,8 +173,6 @@ QScriptEngineAgent::QScriptEngineAgent(QScriptEngineAgentPrivate &dd, QScriptEng */ QScriptEngineAgent::~QScriptEngineAgent() { - delete d_ptr; - d_ptr = 0; } /*! diff --git a/src/script/qscriptengineagent.h b/src/script/qscriptengineagent.h index 3334bc0..461d756 100644 --- a/src/script/qscriptengineagent.h +++ b/src/script/qscriptengineagent.h @@ -47,6 +47,7 @@ #ifndef QT_NO_SCRIPT #include +#include QT_BEGIN_HEADER @@ -96,7 +97,7 @@ public: protected: QScriptEngineAgent(QScriptEngineAgentPrivate &dd, QScriptEngine *engine); - QScriptEngineAgentPrivate *d_ptr; + QScopedPointer d_ptr; private: Q_DECLARE_PRIVATE(QScriptEngineAgent) diff --git a/src/script/qscriptstring.cpp b/src/script/qscriptstring.cpp index 69b0796..e7591e1 100644 --- a/src/script/qscriptstring.cpp +++ b/src/script/qscriptstring.cpp @@ -54,6 +54,29 @@ QT_BEGIN_NAMESPACE +/*! \internal */ +struct QScriptStringPrivatePointerHandler +{ + static inline void cleanup(QScriptStringPrivate *d) + { + if (!d || d->ref.deref()) + return; + + if (d->nameId) { + d->engine->uninternString(d); + } else { + // the engine has already been deleted + delete d; + } + } + + static inline void reset(QScriptStringPrivate *&d, QScriptStringPrivate *other) + { + cleanup(d); + d = other; + } +}; + /*! \since 4.4 \class QScriptString @@ -108,8 +131,8 @@ QScriptStringPrivate *QScriptStringPrivate::get(const QScriptString &q) void QScriptStringPrivate::init(QScriptString &q, QScriptStringPrivate *d) { Q_ASSERT(q.d_ptr == 0); - q.d_ptr = d; - q.d_ptr->ref.ref(); + q.d_ptr.data_ptr() = d; + d->ref.ref(); } /*! @@ -124,7 +147,7 @@ QScriptString::QScriptString() Constructs a new QScriptString that is a copy of \a other. */ QScriptString::QScriptString(const QScriptString &other) - : d_ptr(other.d_ptr) + : d_ptr(other.d_ptr.data()) { if (d_ptr) d_ptr->ref.ref(); @@ -135,15 +158,6 @@ QScriptString::QScriptString(const QScriptString &other) */ QScriptString::~QScriptString() { - if (d_ptr && !d_ptr->ref.deref()) { - if (isValid()) { - d_ptr->engine->uninternString(d_ptr); - } else { - // the engine has already been deleted - delete d_ptr; - } - d_ptr = 0; - } } /*! @@ -153,15 +167,7 @@ QScriptString &QScriptString::operator=(const QScriptString &other) { if (d_ptr == other.d_ptr) return *this; - if (d_ptr && !d_ptr->ref.deref()) { - if (isValid()) { - d_ptr->engine->uninternString(d_ptr); - } else { - // the engine has already been deleted - delete d_ptr; - } - } - d_ptr = other.d_ptr; + d_ptr.reset(other.d_ptr.data()); if (d_ptr) d_ptr->ref.ref(); return *this; diff --git a/src/script/qscriptstring.h b/src/script/qscriptstring.h index d2fecd8..f68be0c 100644 --- a/src/script/qscriptstring.h +++ b/src/script/qscriptstring.h @@ -46,6 +46,8 @@ #ifndef QT_NO_SCRIPT +#include + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -54,6 +56,7 @@ QT_MODULE(Script) class QScriptEngine; class QScriptStringPrivate; +struct QScriptStringPrivatePointerHandler; class Q_SCRIPT_EXPORT QScriptString { @@ -73,7 +76,7 @@ public: operator QString() const; private: - QScriptStringPrivate *d_ptr; + QScopedCustomPointer d_ptr; Q_DECLARE_PRIVATE(QScriptString) }; diff --git a/src/script/qscriptvalue.cpp b/src/script/qscriptvalue.cpp index a253985..4282248 100644 --- a/src/script/qscriptvalue.cpp +++ b/src/script/qscriptvalue.cpp @@ -57,6 +57,28 @@ QT_BEGIN_NAMESPACE +/*! \internal + */ +struct QScriptValuePrivatePointerHandler +{ + static inline void cleanup(QScriptValuePrivate *d) + { + if (!d || d->ref.deref()) + return; + if (d->engine) { + QScriptEnginePrivate::get(d->engine)->unregisterValue(d); + } else { + delete d; + } + } + + static inline void reset(QScriptValuePrivate *&d, QScriptValuePrivate *other) + { + cleanup(d); + d = other; + } +}; + /*! \since 4.3 \class QScriptValue @@ -194,14 +216,6 @@ QScriptValue::QScriptValue() */ QScriptValue::~QScriptValue() { - if (d_ptr && !d_ptr->ref.deref()) { - if (engine()) { - QScriptEnginePrivate::get(engine())->unregisterValue(d_ptr); - } else { - delete d_ptr; - } - d_ptr = 0; - } } /*! @@ -212,7 +226,7 @@ QScriptValue::~QScriptValue() the new script value (i.e., the object itself is not copied). */ QScriptValue::QScriptValue(const QScriptValue &other) - : d_ptr(other.d_ptr) + : d_ptr(other.d_ptr.data()) { if (d_ptr) d_ptr->ref.ref(); @@ -225,13 +239,12 @@ QScriptValue::QScriptValue(const QScriptValue &other) registers it with the script \a engine. */ QScriptValue::QScriptValue(QScriptEngine *engine, QScriptValue::SpecialValue value) + : d_ptr(0) { if (engine) { QScriptEnginePrivate *eng_p = QScriptEnginePrivate::get(engine); - d_ptr = eng_p->registerValue(QScriptValueImpl(value)); + d_ptr.data_ptr() = eng_p->registerValue(QScriptValueImpl(value)); d_ptr->ref.ref(); - } else { - d_ptr = 0; } } @@ -244,13 +257,12 @@ QScriptValue::QScriptValue(QScriptEngine *engine, QScriptValue::SpecialValue val registers it with the script \a engine. */ QScriptValue::QScriptValue(QScriptEngine *engine, bool val) + : d_ptr(0) { if (engine) { QScriptEnginePrivate *eng_p = QScriptEnginePrivate::get(engine); - d_ptr = eng_p->registerValue(QScriptValueImpl(val)); + d_ptr.data_ptr() = eng_p->registerValue(QScriptValueImpl(val)); d_ptr->ref.ref(); - } else { - d_ptr = 0; } } @@ -262,13 +274,12 @@ QScriptValue::QScriptValue(QScriptEngine *engine, bool val) registers it with the script \a engine. */ QScriptValue::QScriptValue(QScriptEngine *engine, int val) + : d_ptr(0) { if (engine) { QScriptEnginePrivate *eng_p = QScriptEnginePrivate::get(engine); - d_ptr = eng_p->registerValue(QScriptValueImpl(val)); + d_ptr.data_ptr() = eng_p->registerValue(QScriptValueImpl(val)); d_ptr->ref.ref(); - } else { - d_ptr = 0; } } @@ -280,13 +291,12 @@ QScriptValue::QScriptValue(QScriptEngine *engine, int val) registers it with the script \a engine. */ QScriptValue::QScriptValue(QScriptEngine *engine, uint val) + : d_ptr(0) { if (engine) { QScriptEnginePrivate *eng_p = QScriptEnginePrivate::get(engine); - d_ptr = eng_p->registerValue(QScriptValueImpl(val)); + d_ptr.data_ptr() = eng_p->registerValue(QScriptValueImpl(val)); d_ptr->ref.ref(); - } else { - d_ptr = 0; } } @@ -298,13 +308,12 @@ QScriptValue::QScriptValue(QScriptEngine *engine, uint val) registers it with the script \a engine. */ QScriptValue::QScriptValue(QScriptEngine *engine, qsreal val) + : d_ptr(0) { if (engine) { QScriptEnginePrivate *eng_p = QScriptEnginePrivate::get(engine); - d_ptr = eng_p->registerValue(QScriptValueImpl(val)); + d_ptr.data_ptr() = eng_p->registerValue(QScriptValueImpl(val)); d_ptr->ref.ref(); - } else { - d_ptr = 0; } } @@ -316,15 +325,14 @@ QScriptValue::QScriptValue(QScriptEngine *engine, qsreal val) registers it with the script \a engine. */ QScriptValue::QScriptValue(QScriptEngine *engine, const QString &val) + : d_ptr(0) { if (engine) { QScriptValueImpl v; QScriptEnginePrivate *eng_p = QScriptEnginePrivate::get(engine); eng_p->newString(&v, val); - d_ptr = eng_p->registerValue(v); + d_ptr.data_ptr() = eng_p->registerValue(v); d_ptr->ref.ref(); - } else { - d_ptr = 0; } } @@ -338,15 +346,14 @@ QScriptValue::QScriptValue(QScriptEngine *engine, const QString &val) #ifndef QT_NO_CAST_FROM_ASCII QScriptValue::QScriptValue(QScriptEngine *engine, const char *val) + : d_ptr(0) { if (engine) { QScriptValueImpl v; QScriptEnginePrivate *eng_p = QScriptEnginePrivate::get(engine); eng_p->newString(&v, QString::fromAscii(val)); - d_ptr = eng_p->registerValue(v); + d_ptr.data_ptr() = eng_p->registerValue(v); d_ptr->ref.ref(); - } else { - d_ptr = 0; } } #endif @@ -464,14 +471,7 @@ QScriptValue &QScriptValue::operator=(const QScriptValue &other) { if (d_ptr == other.d_ptr) return *this; - if (d_ptr && !d_ptr->ref.deref()) { - if (engine()) { - QScriptEnginePrivate::get(engine())->unregisterValue(d_ptr); - } else { - delete d_ptr; - } - } - d_ptr = other.d_ptr; + d_ptr.reset(other.d_ptr.data()); if (d_ptr) d_ptr->ref.ref(); return *this; diff --git a/src/script/qscriptvalue.h b/src/script/qscriptvalue.h index 306da53..76b1186 100644 --- a/src/script/qscriptvalue.h +++ b/src/script/qscriptvalue.h @@ -47,6 +47,7 @@ #ifndef QT_NO_SCRIPT #include +#include QT_BEGIN_HEADER @@ -71,6 +72,7 @@ typedef QList QScriptValueList; typedef double qsreal; class QScriptValuePrivate; +struct QScriptValuePrivatePointerHandler; class Q_SCRIPT_EXPORT QScriptValue { public: @@ -216,12 +218,12 @@ public: private: // force compile error, prevent QScriptValue(bool) to be called - inline QScriptValue(void *) { Q_ASSERT(false); } + inline QScriptValue(void *); // force compile error, prevent QScriptValue(QScriptEngine*, bool) to be called - inline QScriptValue(QScriptEngine *, void *) { Q_ASSERT(false); } + inline QScriptValue(QScriptEngine *, void *); private: - QScriptValuePrivate *d_ptr; + QScopedCustomPointer d_ptr; Q_DECLARE_PRIVATE(QScriptValue) }; diff --git a/src/script/qscriptvalue_p.h b/src/script/qscriptvalue_p.h index 8463ed2..6528464 100644 --- a/src/script/qscriptvalue_p.h +++ b/src/script/qscriptvalue_p.h @@ -91,7 +91,7 @@ inline QScriptValueImpl QScriptValuePrivate::valueOf(const QScriptValue &value) inline void QScriptValuePrivate::init(QScriptValue &value, QScriptValuePrivate *p) { - value.d_ptr = p; + value.d_ptr.data_ptr() = p; value.d_ptr->ref.ref(); } diff --git a/src/script/qscriptvalueiterator.cpp b/src/script/qscriptvalueiterator.cpp index 1a60632..2cf5575 100644 --- a/src/script/qscriptvalueiterator.cpp +++ b/src/script/qscriptvalueiterator.cpp @@ -115,12 +115,11 @@ QScriptValueIteratorPrivate::~QScriptValueIteratorPrivate() first property). */ QScriptValueIterator::QScriptValueIterator(const QScriptValue &object) + : d_ptr(0) { QScriptValueImpl val = QScriptValuePrivate::valueOf(object); - if (!val.isObject()) { - d_ptr = 0; - } else { - d_ptr = new QScriptValueIteratorPrivate(); + if (val.isObject()) { + d_ptr.reset(new QScriptValueIteratorPrivate()); d_ptr->it = new QScriptValueIteratorImpl(val); } } @@ -130,10 +129,6 @@ QScriptValueIterator::QScriptValueIterator(const QScriptValue &object) */ QScriptValueIterator::~QScriptValueIterator() { - if (d_ptr) { - delete d_ptr; - d_ptr = 0; - } } /*! @@ -311,13 +306,10 @@ void QScriptValueIterator::remove() */ QScriptValueIterator& QScriptValueIterator::operator=(QScriptValue &object) { - if (d_ptr) { - delete d_ptr; - d_ptr = 0; - } + d_ptr.reset(); QScriptValueImpl val = QScriptValuePrivate::valueOf(object); if (val.isObject()) { - d_ptr = new QScriptValueIteratorPrivate(); + d_ptr.reset(new QScriptValueIteratorPrivate()); d_ptr->it = new QScriptValueIteratorImpl(val); } return *this; diff --git a/src/script/qscriptvalueiterator.h b/src/script/qscriptvalueiterator.h index 91561e8..082158d 100644 --- a/src/script/qscriptvalueiterator.h +++ b/src/script/qscriptvalueiterator.h @@ -46,6 +46,8 @@ #ifndef QT_NO_SCRIPT +#include + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -84,7 +86,7 @@ public: QScriptValueIterator& operator=(QScriptValue &value); private: - QScriptValueIteratorPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QScriptValueIterator) Q_DISABLE_COPY(QScriptValueIterator) diff --git a/src/scripttools/debugging/qscriptbreakpointdata.cpp b/src/scripttools/debugging/qscriptbreakpointdata.cpp index 9762ca4..50e597e 100644 --- a/src/scripttools/debugging/qscriptbreakpointdata.cpp +++ b/src/scripttools/debugging/qscriptbreakpointdata.cpp @@ -136,7 +136,6 @@ QScriptBreakpointData::QScriptBreakpointData(const QScriptBreakpointData &other) */ QScriptBreakpointData::~QScriptBreakpointData() { - delete d_ptr; } /*! @@ -355,7 +354,7 @@ bool QScriptBreakpointData::operator!=(const QScriptBreakpointData &other) const */ QDataStream &operator<<(QDataStream &out, const QScriptBreakpointData &data) { - const QScriptBreakpointDataPrivate *d = data.d_ptr; + const QScriptBreakpointDataPrivate *d = data.d_ptr.data(); out << d->scriptId; out << d->fileName; out << d->lineNumber; @@ -377,7 +376,7 @@ QDataStream &operator<<(QDataStream &out, const QScriptBreakpointData &data) */ QDataStream &operator>>(QDataStream &in, QScriptBreakpointData &data) { - QScriptBreakpointDataPrivate *d = data.d_ptr; + QScriptBreakpointDataPrivate *d = data.d_ptr.data(); in >> d->scriptId; in >> d->fileName; in >> d->lineNumber; diff --git a/src/scripttools/debugging/qscriptbreakpointdata_p.h b/src/scripttools/debugging/qscriptbreakpointdata_p.h index c1ff033..6cfceed 100644 --- a/src/scripttools/debugging/qscriptbreakpointdata_p.h +++ b/src/scripttools/debugging/qscriptbreakpointdata_p.h @@ -54,7 +54,7 @@ // #include - +#include #include QT_BEGIN_NAMESPACE @@ -114,7 +114,7 @@ public: bool operator!=(const QScriptBreakpointData &other) const; private: - QScriptBreakpointDataPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QScriptBreakpointData) }; diff --git a/src/scripttools/debugging/qscriptdebuggerbackend.cpp b/src/scripttools/debugging/qscriptdebuggerbackend.cpp index 3c29130..46d8497 100644 --- a/src/scripttools/debugging/qscriptdebuggerbackend.cpp +++ b/src/scripttools/debugging/qscriptdebuggerbackend.cpp @@ -385,7 +385,6 @@ QScriptDebuggerBackend::QScriptDebuggerBackend() QScriptDebuggerBackend::~QScriptDebuggerBackend() { detach(); - delete d_ptr; } /*! diff --git a/src/scripttools/debugging/qscriptdebuggerbackend_p.h b/src/scripttools/debugging/qscriptdebuggerbackend_p.h index 6d593a6..d9ec307 100644 --- a/src/scripttools/debugging/qscriptdebuggerbackend_p.h +++ b/src/scripttools/debugging/qscriptdebuggerbackend_p.h @@ -144,7 +144,7 @@ protected: protected: QScriptDebuggerBackend(QScriptDebuggerBackendPrivate &dd); - QScriptDebuggerBackendPrivate *d_ptr; + QScopedPointer d_ptr; private: Q_DECLARE_PRIVATE(QScriptDebuggerBackend) diff --git a/src/scripttools/debugging/qscriptdebuggercommand.cpp b/src/scripttools/debugging/qscriptdebuggercommand.cpp index c40bfc4..98bb3b3 100644 --- a/src/scripttools/debugging/qscriptdebuggercommand.cpp +++ b/src/scripttools/debugging/qscriptdebuggercommand.cpp @@ -118,7 +118,6 @@ QScriptDebuggerCommand::QScriptDebuggerCommand(const QScriptDebuggerCommand &oth */ QScriptDebuggerCommand::~QScriptDebuggerCommand() { - delete d_ptr; } /*! @@ -646,7 +645,7 @@ QScriptDebuggerCommand QScriptDebuggerCommand::clearExceptionsCommand() */ QDataStream &operator<<(QDataStream &out, const QScriptDebuggerCommand &command) { - const QScriptDebuggerCommandPrivate *d = command.d_ptr; + const QScriptDebuggerCommandPrivate *d = command.d_ptr.data(); out << (quint32)d->type; out << (qint32)d->attributes.size(); QHash::const_iterator it; @@ -666,7 +665,7 @@ QDataStream &operator<<(QDataStream &out, const QScriptDebuggerCommand &command) */ QDataStream &operator>>(QDataStream &in, QScriptDebuggerCommand &command) { - QScriptDebuggerCommandPrivate *d = command.d_ptr; + QScriptDebuggerCommandPrivate *d = command.d_ptr.data(); quint32 type; in >> type; diff --git a/src/scripttools/debugging/qscriptdebuggercommand_p.h b/src/scripttools/debugging/qscriptdebuggercommand_p.h index 260e3ec..363738f 100644 --- a/src/scripttools/debugging/qscriptdebuggercommand_p.h +++ b/src/scripttools/debugging/qscriptdebuggercommand_p.h @@ -54,7 +54,7 @@ // #include - +#include #include #include @@ -250,7 +250,7 @@ public: static QScriptDebuggerCommand clearExceptionsCommand(); private: - QScriptDebuggerCommandPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QScriptDebuggerCommand) }; diff --git a/src/scripttools/debugging/qscriptdebuggercommandexecutor.cpp b/src/scripttools/debugging/qscriptdebuggercommandexecutor.cpp index 1be8c5f..e75ff99 100644 --- a/src/scripttools/debugging/qscriptdebuggercommandexecutor.cpp +++ b/src/scripttools/debugging/qscriptdebuggercommandexecutor.cpp @@ -98,7 +98,6 @@ QScriptDebuggerCommandExecutor::QScriptDebuggerCommandExecutor() QScriptDebuggerCommandExecutor::~QScriptDebuggerCommandExecutor() { - delete d_ptr; } /*! diff --git a/src/scripttools/debugging/qscriptdebuggercommandexecutor_p.h b/src/scripttools/debugging/qscriptdebuggercommandexecutor_p.h index 8fff5e5..da7de76 100644 --- a/src/scripttools/debugging/qscriptdebuggercommandexecutor_p.h +++ b/src/scripttools/debugging/qscriptdebuggercommandexecutor_p.h @@ -54,6 +54,7 @@ // #include +#include QT_BEGIN_NAMESPACE @@ -74,7 +75,7 @@ public: protected: QScriptDebuggerCommandExecutor(QScriptDebuggerCommandExecutorPrivate &dd); - QScriptDebuggerCommandExecutorPrivate *d_ptr; + QScopedPointer d_ptr; private: Q_DECLARE_PRIVATE(QScriptDebuggerCommandExecutor) diff --git a/src/scripttools/debugging/qscriptdebuggerconsole.cpp b/src/scripttools/debugging/qscriptdebuggerconsole.cpp index 70bb8b1..09a32db 100644 --- a/src/scripttools/debugging/qscriptdebuggerconsole.cpp +++ b/src/scripttools/debugging/qscriptdebuggerconsole.cpp @@ -199,7 +199,6 @@ QScriptDebuggerConsole::QScriptDebuggerConsole() QScriptDebuggerConsole::~QScriptDebuggerConsole() { - delete d_ptr; } void QScriptDebuggerConsole::loadScriptedCommands(const QString &scriptsPath, diff --git a/src/scripttools/debugging/qscriptdebuggerconsole_p.h b/src/scripttools/debugging/qscriptdebuggerconsole_p.h index b5ebf44..a8c4163 100644 --- a/src/scripttools/debugging/qscriptdebuggerconsole_p.h +++ b/src/scripttools/debugging/qscriptdebuggerconsole_p.h @@ -54,6 +54,7 @@ // #include +#include #include "qscriptdebuggerconsolehistorianinterface_p.h" @@ -109,7 +110,7 @@ public: void bumpSessionId(); private: - QScriptDebuggerConsolePrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QScriptDebuggerConsole) Q_DISABLE_COPY(QScriptDebuggerConsole) diff --git a/src/scripttools/debugging/qscriptdebuggerconsolecommand.cpp b/src/scripttools/debugging/qscriptdebuggerconsolecommand.cpp index 6cbf58c..8e4bc06 100644 --- a/src/scripttools/debugging/qscriptdebuggerconsolecommand.cpp +++ b/src/scripttools/debugging/qscriptdebuggerconsolecommand.cpp @@ -72,7 +72,6 @@ QScriptDebuggerConsoleCommand::QScriptDebuggerConsoleCommand() QScriptDebuggerConsoleCommand::~QScriptDebuggerConsoleCommand() { - delete d_ptr; } QScriptDebuggerConsoleCommand::QScriptDebuggerConsoleCommand(QScriptDebuggerConsoleCommandPrivate &dd) diff --git a/src/scripttools/debugging/qscriptdebuggerconsolecommand_p.h b/src/scripttools/debugging/qscriptdebuggerconsolecommand_p.h index fbf285f..2ce3315 100644 --- a/src/scripttools/debugging/qscriptdebuggerconsolecommand_p.h +++ b/src/scripttools/debugging/qscriptdebuggerconsolecommand_p.h @@ -54,7 +54,7 @@ // #include - +#include #include QT_BEGIN_NAMESPACE @@ -91,7 +91,7 @@ public: protected: QScriptDebuggerConsoleCommand(QScriptDebuggerConsoleCommandPrivate &dd); - QScriptDebuggerConsoleCommandPrivate *d_ptr; + QScopedPointer d_ptr; private: Q_DECLARE_PRIVATE(QScriptDebuggerConsoleCommand) diff --git a/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata.cpp b/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata.cpp index 9cfac97..1d43dd0 100644 --- a/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata.cpp +++ b/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata.cpp @@ -90,7 +90,7 @@ QScriptDebuggerConsoleCommandGroupData::QScriptDebuggerConsoleCommandGroupData( QScriptDebuggerConsoleCommandGroupData::QScriptDebuggerConsoleCommandGroupData( const QScriptDebuggerConsoleCommandGroupData &other) - : d_ptr(other.d_ptr) + : d_ptr(other.d_ptr.data()) { if (d_ptr) d_ptr->ref.ref(); @@ -98,22 +98,12 @@ QScriptDebuggerConsoleCommandGroupData::QScriptDebuggerConsoleCommandGroupData( QScriptDebuggerConsoleCommandGroupData::~QScriptDebuggerConsoleCommandGroupData() { - if (d_ptr && !d_ptr->ref.deref()) { - delete d_ptr; - d_ptr = 0; - } } QScriptDebuggerConsoleCommandGroupData &QScriptDebuggerConsoleCommandGroupData::operator=( const QScriptDebuggerConsoleCommandGroupData &other) { - if (d_ptr == other.d_ptr) - return *this; - if (d_ptr && !d_ptr->ref.deref()) - delete d_ptr; - d_ptr = other.d_ptr; - if (d_ptr) - d_ptr->ref.ref(); + d_ptr.assign(other.d_ptr.data()); return *this; } diff --git a/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata_p.h b/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata_p.h index c32277f..9b0e281 100644 --- a/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata_p.h +++ b/src/scripttools/debugging/qscriptdebuggerconsolecommandgroupdata_p.h @@ -54,7 +54,7 @@ // #include - +#include #include QT_BEGIN_NAMESPACE @@ -82,7 +82,7 @@ public: const QScriptDebuggerConsoleCommandGroupData &other); private: - QScriptDebuggerConsoleCommandGroupDataPrivate *d_ptr; + QScopedSharedPointer d_ptr; private: Q_DECLARE_PRIVATE(QScriptDebuggerConsoleCommandGroupData) diff --git a/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager.cpp b/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager.cpp index ef9687e..f22efc5 100644 --- a/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager.cpp +++ b/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager.cpp @@ -105,7 +105,6 @@ QScriptDebuggerConsoleCommandManager::QScriptDebuggerConsoleCommandManager() QScriptDebuggerConsoleCommandManager::~QScriptDebuggerConsoleCommandManager() { - delete d_ptr; } /*! diff --git a/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager_p.h b/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager_p.h index b5c9842..cebb999 100644 --- a/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager_p.h +++ b/src/scripttools/debugging/qscriptdebuggerconsolecommandmanager_p.h @@ -54,7 +54,7 @@ // #include - +#include #include #include @@ -86,7 +86,7 @@ public: QStringList completions(const QString &prefix) const; private: - QScriptDebuggerConsoleCommandManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QScriptDebuggerConsoleCommandManager) }; diff --git a/src/scripttools/debugging/qscriptdebuggerevent.cpp b/src/scripttools/debugging/qscriptdebuggerevent.cpp index 9d971a9..418e8fa 100644 --- a/src/scripttools/debugging/qscriptdebuggerevent.cpp +++ b/src/scripttools/debugging/qscriptdebuggerevent.cpp @@ -97,7 +97,6 @@ QScriptDebuggerEvent::QScriptDebuggerEvent(const QScriptDebuggerEvent &other) QScriptDebuggerEvent::~QScriptDebuggerEvent() { - delete d_ptr; } QScriptDebuggerEvent &QScriptDebuggerEvent::operator=(const QScriptDebuggerEvent &other) @@ -276,7 +275,7 @@ bool QScriptDebuggerEvent::operator!=(const QScriptDebuggerEvent &other) const */ QDataStream &operator<<(QDataStream &out, const QScriptDebuggerEvent &event) { - const QScriptDebuggerEventPrivate *d = event.d_ptr; + const QScriptDebuggerEventPrivate *d = event.d_ptr.data(); out << (quint32)d->type; out << (qint32)d->attributes.size(); QHash::const_iterator it; @@ -296,7 +295,7 @@ QDataStream &operator<<(QDataStream &out, const QScriptDebuggerEvent &event) */ QDataStream &operator>>(QDataStream &in, QScriptDebuggerEvent &event) { - QScriptDebuggerEventPrivate *d = event.d_ptr; + QScriptDebuggerEventPrivate *d = event.d_ptr.data(); quint32 type; in >> type; diff --git a/src/scripttools/debugging/qscriptdebuggerevent_p.h b/src/scripttools/debugging/qscriptdebuggerevent_p.h index d9c073c..0cfde4f 100644 --- a/src/scripttools/debugging/qscriptdebuggerevent_p.h +++ b/src/scripttools/debugging/qscriptdebuggerevent_p.h @@ -57,6 +57,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE @@ -137,7 +138,7 @@ public: bool operator!=(const QScriptDebuggerEvent &other) const; private: - QScriptDebuggerEventPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QScriptDebuggerEvent) }; diff --git a/src/scripttools/debugging/qscriptdebuggerfrontend.cpp b/src/scripttools/debugging/qscriptdebuggerfrontend.cpp index ced20b1..4d0a8b4 100644 --- a/src/scripttools/debugging/qscriptdebuggerfrontend.cpp +++ b/src/scripttools/debugging/qscriptdebuggerfrontend.cpp @@ -143,7 +143,6 @@ QScriptDebuggerFrontend::QScriptDebuggerFrontend() QScriptDebuggerFrontend::~QScriptDebuggerFrontend() { - delete d_ptr; } QScriptDebuggerFrontend::QScriptDebuggerFrontend(QScriptDebuggerFrontendPrivate &dd) diff --git a/src/scripttools/debugging/qscriptdebuggerfrontend_p.h b/src/scripttools/debugging/qscriptdebuggerfrontend_p.h index a763463..bed0f85 100644 --- a/src/scripttools/debugging/qscriptdebuggerfrontend_p.h +++ b/src/scripttools/debugging/qscriptdebuggerfrontend_p.h @@ -54,7 +54,7 @@ // #include - +#include #include #include "qscriptdebuggercommandschedulerinterface_p.h" @@ -90,7 +90,7 @@ protected: protected: QScriptDebuggerFrontend(QScriptDebuggerFrontendPrivate &dd); - QScriptDebuggerFrontendPrivate *d_ptr; + QScopedPointer d_ptr; private: Q_DECLARE_PRIVATE(QScriptDebuggerFrontend) diff --git a/src/scripttools/debugging/qscriptdebuggerjob.cpp b/src/scripttools/debugging/qscriptdebuggerjob.cpp index 109c805..20d17bb 100644 --- a/src/scripttools/debugging/qscriptdebuggerjob.cpp +++ b/src/scripttools/debugging/qscriptdebuggerjob.cpp @@ -85,7 +85,6 @@ QScriptDebuggerJob::QScriptDebuggerJob(QScriptDebuggerJobPrivate &dd) QScriptDebuggerJob::~QScriptDebuggerJob() { - delete d_ptr; } void QScriptDebuggerJob::finish() diff --git a/src/scripttools/debugging/qscriptdebuggerjob_p.h b/src/scripttools/debugging/qscriptdebuggerjob_p.h index e84d6d5..2f7305f 100644 --- a/src/scripttools/debugging/qscriptdebuggerjob_p.h +++ b/src/scripttools/debugging/qscriptdebuggerjob_p.h @@ -54,6 +54,7 @@ // #include +#include QT_BEGIN_NAMESPACE @@ -76,7 +77,7 @@ public: protected: QScriptDebuggerJob(QScriptDebuggerJobPrivate &dd); - QScriptDebuggerJobPrivate *d_ptr; + QScopedPointer d_ptr; private: Q_DECLARE_PRIVATE(QScriptDebuggerJob) diff --git a/src/scripttools/debugging/qscriptdebuggerresponse.cpp b/src/scripttools/debugging/qscriptdebuggerresponse.cpp index 82bfff2..bf24846 100644 --- a/src/scripttools/debugging/qscriptdebuggerresponse.cpp +++ b/src/scripttools/debugging/qscriptdebuggerresponse.cpp @@ -101,7 +101,6 @@ QScriptDebuggerResponse::QScriptDebuggerResponse(const QScriptDebuggerResponse & QScriptDebuggerResponse::~QScriptDebuggerResponse() { - delete d_ptr; } QScriptDebuggerResponse &QScriptDebuggerResponse::operator=(const QScriptDebuggerResponse &other) @@ -320,7 +319,7 @@ bool QScriptDebuggerResponse::operator!=(const QScriptDebuggerResponse &other) c */ QDataStream &operator<<(QDataStream &out, const QScriptDebuggerResponse &response) { - const QScriptDebuggerResponsePrivate *d = response.d_ptr; + const QScriptDebuggerResponsePrivate *d = response.d_ptr.data(); out << (quint32)d->error; out << d->result; out << d->async; @@ -336,7 +335,7 @@ QDataStream &operator<<(QDataStream &out, const QScriptDebuggerResponse &respons */ QDataStream &operator>>(QDataStream &in, QScriptDebuggerResponse &response) { - QScriptDebuggerResponsePrivate *d = response.d_ptr; + QScriptDebuggerResponsePrivate *d = response.d_ptr.data(); quint32 error; in >> error; diff --git a/src/scripttools/debugging/qscriptdebuggerresponse_p.h b/src/scripttools/debugging/qscriptdebuggerresponse_p.h index dd65ffd..4fa1731 100644 --- a/src/scripttools/debugging/qscriptdebuggerresponse_p.h +++ b/src/scripttools/debugging/qscriptdebuggerresponse_p.h @@ -54,7 +54,7 @@ // #include - +#include #include #include @@ -127,7 +127,7 @@ public: bool operator!=(const QScriptDebuggerResponse &other) const; private: - QScriptDebuggerResponsePrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QScriptDebuggerResponse) }; diff --git a/src/scripttools/debugging/qscriptdebuggervalue.cpp b/src/scripttools/debugging/qscriptdebuggervalue.cpp index bb41ee8..b92cbd2 100644 --- a/src/scripttools/debugging/qscriptdebuggervalue.cpp +++ b/src/scripttools/debugging/qscriptdebuggervalue.cpp @@ -94,7 +94,7 @@ QScriptDebuggerValue::QScriptDebuggerValue(const QScriptValue &value) : d_ptr(0) { if (value.isValid()) { - d_ptr = new QScriptDebuggerValuePrivate; + d_ptr.reset(new QScriptDebuggerValuePrivate); if (value.isUndefined()) d_ptr->type = UndefinedValue; else if (value.isNull()) @@ -157,7 +157,7 @@ QScriptDebuggerValue::QScriptDebuggerValue(ValueType type) } QScriptDebuggerValue::QScriptDebuggerValue(const QScriptDebuggerValue &other) - : d_ptr(other.d_ptr) + : d_ptr(other.d_ptr.data()) { if (d_ptr) d_ptr->ref.ref(); @@ -165,21 +165,11 @@ QScriptDebuggerValue::QScriptDebuggerValue(const QScriptDebuggerValue &other) QScriptDebuggerValue::~QScriptDebuggerValue() { - if (d_ptr && !d_ptr->ref.deref()) { - delete d_ptr; - d_ptr = 0; - } } QScriptDebuggerValue &QScriptDebuggerValue::operator=(const QScriptDebuggerValue &other) { - if (d_ptr == other.d_ptr) - return *this; - if (d_ptr && !d_ptr->ref.deref()) - delete d_ptr; - d_ptr = other.d_ptr; - if (d_ptr) - d_ptr->ref.ref(); + d_ptr.assign(other.d_ptr.data()); return *this; } diff --git a/src/scripttools/debugging/qscriptdebuggervalue_p.h b/src/scripttools/debugging/qscriptdebuggervalue_p.h index 0142de0..c082bf3 100644 --- a/src/scripttools/debugging/qscriptdebuggervalue_p.h +++ b/src/scripttools/debugging/qscriptdebuggervalue_p.h @@ -54,7 +54,7 @@ // #include - +#include #include QT_BEGIN_NAMESPACE @@ -103,7 +103,7 @@ public: bool operator!=(const QScriptDebuggerValue &other) const; private: - QScriptDebuggerValuePrivate *d_ptr; + QScopedSharedPointer d_ptr; Q_DECLARE_PRIVATE(QScriptDebuggerValue) }; diff --git a/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp b/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp index 723e304..63f820b 100644 --- a/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp +++ b/src/scripttools/debugging/qscriptdebuggervalueproperty.cpp @@ -105,7 +105,7 @@ QScriptDebuggerValueProperty::QScriptDebuggerValueProperty(const QString &name, Constructs a QScriptDebuggerValueProperty that is a copy of the \a other property. */ QScriptDebuggerValueProperty::QScriptDebuggerValueProperty(const QScriptDebuggerValueProperty &other) - : d_ptr(other.d_ptr) + : d_ptr(other.d_ptr.data()) { if (d_ptr) d_ptr->ref.ref(); @@ -116,10 +116,6 @@ QScriptDebuggerValueProperty::QScriptDebuggerValueProperty(const QScriptDebugger */ QScriptDebuggerValueProperty::~QScriptDebuggerValueProperty() { - if (d_ptr && !d_ptr->ref.deref()) { - delete d_ptr; - d_ptr = 0; - } } /*! @@ -127,13 +123,7 @@ QScriptDebuggerValueProperty::~QScriptDebuggerValueProperty() */ QScriptDebuggerValueProperty &QScriptDebuggerValueProperty::operator=(const QScriptDebuggerValueProperty &other) { - if (d_ptr == other.d_ptr) - return *this; - if (d_ptr && !d_ptr->ref.deref()) - delete d_ptr; - d_ptr = other.d_ptr; - if (d_ptr) - d_ptr->ref.ref(); + d_ptr.assign(other.d_ptr.data()); return *this; } diff --git a/src/scripttools/debugging/qscriptdebuggervalueproperty_p.h b/src/scripttools/debugging/qscriptdebuggervalueproperty_p.h index f67bafd..be27ebd 100644 --- a/src/scripttools/debugging/qscriptdebuggervalueproperty_p.h +++ b/src/scripttools/debugging/qscriptdebuggervalueproperty_p.h @@ -55,6 +55,7 @@ #include #include +#include #include QT_BEGIN_NAMESPACE @@ -85,7 +86,7 @@ public: bool isValid() const; private: - QScriptDebuggerValuePropertyPrivate *d_ptr; + QScopedSharedPointer d_ptr; Q_DECLARE_PRIVATE(QScriptDebuggerValueProperty) }; diff --git a/src/scripttools/debugging/qscriptscriptdata.cpp b/src/scripttools/debugging/qscriptscriptdata.cpp index 068748f..a4f8cd7 100644 --- a/src/scripttools/debugging/qscriptscriptdata.cpp +++ b/src/scripttools/debugging/qscriptscriptdata.cpp @@ -98,7 +98,7 @@ QScriptScriptData::QScriptScriptData(const QString &contents, const QString &fil } QScriptScriptData::QScriptScriptData(const QScriptScriptData &other) - : d_ptr(other.d_ptr) + : d_ptr(other.d_ptr.data()) { if (d_ptr) d_ptr->ref.ref(); @@ -106,21 +106,11 @@ QScriptScriptData::QScriptScriptData(const QScriptScriptData &other) QScriptScriptData::~QScriptScriptData() { - if (d_ptr && !d_ptr->ref.deref()) { - delete d_ptr; - d_ptr = 0; - } } QScriptScriptData &QScriptScriptData::operator=(const QScriptScriptData &other) { - if (d_ptr == other.d_ptr) - return *this; - if (d_ptr && !d_ptr->ref.deref()) - delete d_ptr; - d_ptr = other.d_ptr; - if (d_ptr) - d_ptr->ref.ref(); + d_ptr.assign(other.d_ptr.data()); return *this; } @@ -191,7 +181,7 @@ bool QScriptScriptData::operator!=(const QScriptScriptData &other) const QDataStream &operator<<(QDataStream &out, const QScriptScriptData &data) { - const QScriptScriptDataPrivate *d = data.d_ptr; + const QScriptScriptDataPrivate *d = data.d_ptr.data(); if (d) { out << d->contents; out << d->fileName; @@ -207,10 +197,10 @@ QDataStream &operator<<(QDataStream &out, const QScriptScriptData &data) QDataStream &operator>>(QDataStream &in, QScriptScriptData &data) { if (!data.d_ptr) { - data.d_ptr = new QScriptScriptDataPrivate(); + data.d_ptr.reset(new QScriptScriptDataPrivate()); data.d_ptr->ref.ref(); } - QScriptScriptDataPrivate *d = data.d_ptr; + QScriptScriptDataPrivate *d = data.d_ptr.data(); in >> d->contents; in >> d->fileName; qint32 ln; diff --git a/src/scripttools/debugging/qscriptscriptdata_p.h b/src/scripttools/debugging/qscriptscriptdata_p.h index 50cad32..e871c2c 100644 --- a/src/scripttools/debugging/qscriptscriptdata_p.h +++ b/src/scripttools/debugging/qscriptscriptdata_p.h @@ -54,7 +54,7 @@ // #include - +#include #include #include @@ -91,7 +91,7 @@ public: bool operator!=(const QScriptScriptData &other) const; private: - QScriptScriptDataPrivate *d_ptr; + QScopedSharedPointer d_ptr; Q_DECLARE_PRIVATE(QScriptScriptData) }; diff --git a/src/scripttools/debugging/qscriptstdmessagehandler.cpp b/src/scripttools/debugging/qscriptstdmessagehandler.cpp index 4e0f12c..6742554 100644 --- a/src/scripttools/debugging/qscriptstdmessagehandler.cpp +++ b/src/scripttools/debugging/qscriptstdmessagehandler.cpp @@ -66,7 +66,6 @@ QScriptStdMessageHandler::QScriptStdMessageHandler() QScriptStdMessageHandler::~QScriptStdMessageHandler() { - delete d_ptr; } void QScriptStdMessageHandler::message(QtMsgType type, const QString &text, diff --git a/src/scripttools/debugging/qscriptstdmessagehandler_p.h b/src/scripttools/debugging/qscriptstdmessagehandler_p.h index 8b75f6a..06d680b 100644 --- a/src/scripttools/debugging/qscriptstdmessagehandler_p.h +++ b/src/scripttools/debugging/qscriptstdmessagehandler_p.h @@ -53,6 +53,8 @@ // We mean it. // +#include + #include "qscriptmessagehandlerinterface_p.h" QT_BEGIN_NAMESPACE @@ -71,7 +73,7 @@ public: const QVariant &data = QVariant()); private: - QScriptStdMessageHandlerPrivate *d_ptr; + QScopedPointer d_ptr; private: Q_DECLARE_PRIVATE(QScriptStdMessageHandler) diff --git a/src/scripttools/debugging/qscriptvalueproperty.cpp b/src/scripttools/debugging/qscriptvalueproperty.cpp index 245edc3..75cfdd7 100644 --- a/src/scripttools/debugging/qscriptvalueproperty.cpp +++ b/src/scripttools/debugging/qscriptvalueproperty.cpp @@ -95,7 +95,7 @@ QScriptValueProperty::QScriptValueProperty(const QString &name, Constructs a QScriptValueProperty that is a copy of the \a other property. */ QScriptValueProperty::QScriptValueProperty(const QScriptValueProperty &other) - : d_ptr(other.d_ptr) + : d_ptr(other.d_ptr.data()) { if (d_ptr) d_ptr->ref.ref(); @@ -106,10 +106,6 @@ QScriptValueProperty::QScriptValueProperty(const QScriptValueProperty &other) */ QScriptValueProperty::~QScriptValueProperty() { - if (d_ptr && !d_ptr->ref.deref()) { - delete d_ptr; - d_ptr = 0; - } } /*! @@ -117,13 +113,7 @@ QScriptValueProperty::~QScriptValueProperty() */ QScriptValueProperty &QScriptValueProperty::operator=(const QScriptValueProperty &other) { - if (d_ptr == other.d_ptr) - return *this; - if (d_ptr && !d_ptr->ref.deref()) - delete d_ptr; - d_ptr = other.d_ptr; - if (d_ptr) - d_ptr->ref.ref(); + d_ptr.assign(other.d_ptr.data()); return *this; } diff --git a/src/scripttools/debugging/qscriptvalueproperty_p.h b/src/scripttools/debugging/qscriptvalueproperty_p.h index 938ab83..ca6980f 100644 --- a/src/scripttools/debugging/qscriptvalueproperty_p.h +++ b/src/scripttools/debugging/qscriptvalueproperty_p.h @@ -55,6 +55,7 @@ #include #include +#include #include QT_BEGIN_NAMESPACE @@ -81,7 +82,7 @@ public: bool isValid() const; private: - QScriptValuePropertyPrivate *d_ptr; + QScopedSharedPointer d_ptr; Q_DECLARE_PRIVATE(QScriptValueProperty) }; diff --git a/src/svg/qgraphicssvgitem.h b/src/svg/qgraphicssvgitem.h index c6ab0f7..940ce9b 100644 --- a/src/svg/qgraphicssvgitem.h +++ b/src/svg/qgraphicssvgitem.h @@ -41,8 +41,8 @@ #ifndef QGRAPHICSSVGITEM_H #define QGRAPHICSSVGITEM_H -#include #include +#include #ifndef QT_NO_GRAPHICSSVGITEM @@ -89,9 +89,9 @@ private: // Q_DECLARE_PRIVATE_WITH_BASE(QGraphicsSvgItem, QObject) inline QGraphicsSvgItemPrivate *d_func() - { return reinterpret_cast(QObject::d_ptr); } + { return reinterpret_cast(QObject::d_ptr.data()); } inline const QGraphicsSvgItemPrivate *d_func() const - { return reinterpret_cast(QObject::d_ptr); } + { return reinterpret_cast(QObject::d_ptr.data()); } friend class QGraphicsSvgItemPrivate; Q_PRIVATE_SLOT(d_func(), void _q_repaintItem()) diff --git a/src/svg/qsvggenerator.cpp b/src/svg/qsvggenerator.cpp index fd4c875..5052ec7 100644 --- a/src/svg/qsvggenerator.cpp +++ b/src/svg/qsvggenerator.cpp @@ -567,7 +567,6 @@ QSvgGenerator::~QSvgGenerator() if (d->owns_iodevice) delete d->engine->outputDevice(); delete d->engine; - delete d_ptr; } /*! diff --git a/src/svg/qsvggenerator.h b/src/svg/qsvggenerator.h index 723a220..1d24324 100644 --- a/src/svg/qsvggenerator.h +++ b/src/svg/qsvggenerator.h @@ -49,6 +49,7 @@ #include #include #include +#include QT_BEGIN_HEADER @@ -100,7 +101,7 @@ protected: int metric(QPaintDevice::PaintDeviceMetric metric) const; private: - QSvgGeneratorPrivate *d_ptr; + QScopedPointer d_ptr; }; QT_END_NAMESPACE diff --git a/src/testlib/3rdparty/cycle_p.h b/src/testlib/3rdparty/cycle_p.h index 547fdc1..a292423 100644 --- a/src/testlib/3rdparty/cycle_p.h +++ b/src/testlib/3rdparty/cycle_p.h @@ -190,6 +190,7 @@ INLINE_ELAPSED(__inline__) #endif /* Visual C++ -- thanks to Morten Nissov for his help with this */ +#if defined(_MSC_VER) #if _MSC_VER >= 1200 && (_M_IX86 >= 500 || (defined(_WIN32_WCE) && defined(_X86_))) && !defined(HAVE_TICK_COUNTER) #include typedef LARGE_INTEGER CycleCounterTicks; @@ -215,6 +216,7 @@ static __inline double elapsed(CycleCounterTicks t1, CycleCounterTicks t0) #define HAVE_TICK_COUNTER #define TIME_MIN 5000.0 /* unreliable pentium IV cycle counter */ #endif +#endif #if _MSC_VER >= 1400 && defined(_WIN32_WCE) && !defined(HAVE_TICK_COUNTER) #include diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index b676012..38e63cf 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -1437,7 +1437,7 @@ int QTest::qExec(QObject *testObject, int argc, char **argv) } #endif - #ifndef QT_NO_EXCEPTIONS +#ifndef QT_NO_EXCEPTIONS } catch (...) { QTestResult::addFailure("Caught unhandled exception", __FILE__, __LINE__); if (QTestResult::currentTestFunction()) { @@ -1451,13 +1451,13 @@ int QTest::qExec(QObject *testObject, int argc, char **argv) IOPMAssertionRelease(powerID); } #endif - #ifdef Q_OS_WIN +//# ifdef Q_OS_WIN // rethrow exception to make debugging easier throw; - #endif - return -1; +//# endif + return 1; } - #endif +# endif currentTestObject = 0; #ifdef QT_MAC_USE_COCOA diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp index 550abc9..5e2c74b 100644 --- a/src/xml/dom/qdom.cpp +++ b/src/xml/dom/qdom.cpp @@ -512,8 +512,8 @@ public: bool setContent(QXmlInputSource *source, QXmlReader *reader, QString *errorMsg, int *errorLine, int *errorColumn); // Attributes - QDomDocumentTypePrivate* doctype() { return type; }; - QDomImplementationPrivate* implementation() { return impl; }; + QDomDocumentTypePrivate* doctype() { return type.data(); }; + QDomImplementationPrivate* implementation() { return impl.data(); }; QDomElementPrivate* documentElement(); // Factories @@ -537,8 +537,8 @@ public: void clear(); // Variables - QDomImplementationPrivate* impl; - QDomDocumentTypePrivate* type; + QScopedSharedPointer impl; + QScopedSharedPointer type; void saveDocument(QTextStream& stream, const int indent, QDomNode::EncodingPolicy encUsed) const; @@ -3060,7 +3060,7 @@ QDomNamedNodeMapPrivate::~QDomNamedNodeMapPrivate() QDomNamedNodeMapPrivate* QDomNamedNodeMapPrivate::clone(QDomNodePrivate* p) { - QDomNamedNodeMapPrivate* m = new QDomNamedNodeMapPrivate(p); + QScopedPointer m(new QDomNamedNodeMapPrivate(p)); m->readonly = readonly; m->appendToParent = appendToParent; @@ -3073,7 +3073,7 @@ QDomNamedNodeMapPrivate* QDomNamedNodeMapPrivate::clone(QDomNodePrivate* p) // we are no longer interested in ownership m->ref.deref(); - return m; + return m.take(); } void QDomNamedNodeMapPrivate::clearMap() @@ -3499,13 +3499,18 @@ QDomDocumentTypePrivate::~QDomDocumentTypePrivate() void QDomDocumentTypePrivate::init() { entities = new QDomNamedNodeMapPrivate(this); - notations = new QDomNamedNodeMapPrivate(this); - publicId.clear(); - systemId.clear(); - internalSubset.clear(); - - entities->setAppendToParent(true); - notations->setAppendToParent(true); + QT_TRY { + notations = new QDomNamedNodeMapPrivate(this); + publicId.clear(); + systemId.clear(); + internalSubset.clear(); + + entities->setAppendToParent(true); + notations->setAppendToParent(true); + } QT_CATCH(...) { + delete entities; + QT_RETHROW; + } } QDomNodePrivate* QDomDocumentTypePrivate::cloneNode(bool deep) @@ -6148,8 +6153,8 @@ QDomDocumentPrivate::QDomDocumentPrivate() : QDomNodePrivate(0), nodeListTime(1) { - impl = new QDomImplementationPrivate; - type = new QDomDocumentTypePrivate(this, this); + impl.reset(new QDomImplementationPrivate); + type.reset(new QDomDocumentTypePrivate(this, this)); name = QLatin1String("#document"); } @@ -6158,8 +6163,8 @@ QDomDocumentPrivate::QDomDocumentPrivate(const QString& aname) : QDomNodePrivate(0), nodeListTime(1) { - impl = new QDomImplementationPrivate; - type = new QDomDocumentTypePrivate(this, this); + impl.reset(new QDomImplementationPrivate); + type.reset(new QDomDocumentTypePrivate(this, this)); type->name = aname; name = QLatin1String("#document"); @@ -6169,12 +6174,11 @@ QDomDocumentPrivate::QDomDocumentPrivate(QDomDocumentTypePrivate* dt) : QDomNodePrivate(0), nodeListTime(1) { - impl = new QDomImplementationPrivate; + impl.reset(new QDomImplementationPrivate); if (dt != 0) { - type = dt; - type->ref.ref(); + type.assign(dt); } else { - type = new QDomDocumentTypePrivate(this, this); + type.reset(new QDomDocumentTypePrivate(this, this)); } name = QLatin1String("#document"); @@ -6184,31 +6188,19 @@ QDomDocumentPrivate::QDomDocumentPrivate(QDomDocumentPrivate* n, bool deep) : QDomNodePrivate(n, deep), nodeListTime(1) { - impl = n->impl->clone(); - // Reference count is down to 0, so we set it to 1 here. - impl->ref.ref(); - type = (QDomDocumentTypePrivate*)n->type->cloneNode(); + impl.assign(n->impl->clone()); + type.assign((QDomDocumentTypePrivate*)n->type->cloneNode()); type->setParent(this); - // Reference count is down to 0, so we set it to 1 here. - type->ref.ref(); } QDomDocumentPrivate::~QDomDocumentPrivate() { - if (!impl->ref.deref()) - delete impl; - if (!type->ref.deref()) - delete type; } void QDomDocumentPrivate::clear() { - if (!impl->ref.deref()) - delete impl; - if (!type->ref.deref()) - delete type; - impl = 0; - type = 0; + impl.assign(0); + type.assign(0); QDomNodePrivate::clear(); } @@ -6229,8 +6221,8 @@ bool QDomDocumentPrivate::setContent(QXmlInputSource *source, bool namespaceProc bool QDomDocumentPrivate::setContent(QXmlInputSource *source, QXmlReader *reader, QString *errorMsg, int *errorLine, int *errorColumn) { clear(); - impl = new QDomImplementationPrivate; - type = new QDomDocumentTypePrivate(this, this); + impl.reset(new QDomImplementationPrivate); + type.reset(new QDomDocumentTypePrivate(this, this)); bool namespaceProcessing = reader->feature(QLatin1String("http://xml.org/sax/features/namespaces")) && !reader->feature(QLatin1String("http://xml.org/sax/features/namespace-prefixes")); @@ -7448,20 +7440,22 @@ bool QDomHandler::characters(const QString& ch) if (node == doc) return false; - QDomNodePrivate *n; + QScopedPointer n; if (cdata) { - n = doc->createCDATASection(ch); + n.reset(doc->createCDATASection(ch)); } else if (!entityName.isEmpty()) { - QDomEntityPrivate* e = new QDomEntityPrivate(doc, 0, entityName, - QString(), QString(), QString()); + QScopedPointer e(new QDomEntityPrivate(doc, 0, entityName, + QString(), QString(), QString())); e->value = ch; - doc->doctype()->appendChild(e); - n = doc->createEntityReference(entityName); + doc->doctype()->appendChild(e.data()); + e.take(); + n.reset(doc->createEntityReference(entityName)); } else { - n = doc->createTextNode(ch); + n.reset(doc->createTextNode(ch)); } n->setLocation(locator->lineNumber(), locator->columnNumber()); - node->appendChild(n); + node->appendChild(n.data()); + n.take(); return true; } diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp index ba68636..1655642 100644 --- a/src/xml/sax/qxml.cpp +++ b/src/xml/sax/qxml.cpp @@ -262,10 +262,11 @@ class QXmlDefaultHandlerPrivate class QXmlSimpleReaderPrivate { +public: + ~QXmlSimpleReaderPrivate(); private: // functions - QXmlSimpleReaderPrivate(); - ~QXmlSimpleReaderPrivate(); + QXmlSimpleReaderPrivate(QXmlSimpleReader *reader); void initIncrementalParsing(); // used to determine if elements are correctly nested @@ -350,7 +351,7 @@ private: bool contentCharDataRead; // helper classes - QXmlLocator *locator; + QScopedPointer locator; QXmlNamespaceSupport namespaceSupport; // error string @@ -545,8 +546,8 @@ private: QXmlParseException::QXmlParseException(const QString& name, int c, int l, const QString& p, const QString& s) + : d(new QXmlParseExceptionPrivate) { - d = new QXmlParseExceptionPrivate; d->msg = name; d->column = c; d->line = l; @@ -559,7 +560,6 @@ QXmlParseException::QXmlParseException(const QString& name, int c, int l, */ QXmlParseException::~QXmlParseException() { - delete d; } /*! @@ -928,8 +928,9 @@ void QXmlNamespaceSupport::popContext() */ void QXmlNamespaceSupport::reset() { + QXmlNamespaceSupportPrivate *newD = new QXmlNamespaceSupportPrivate; delete d; - d = new QXmlNamespaceSupportPrivate; + d = newD; } @@ -1260,18 +1261,23 @@ void QXmlInputSource::init() { d = new QXmlInputSourcePrivate; - d->inputDevice = 0; - d->inputStream = 0; + QT_TRY { + d->inputDevice = 0; + d->inputStream = 0; - setData(QString()); + setData(QString()); #ifndef QT_NO_TEXTCODEC - d->encMapper = 0; + d->encMapper = 0; #endif - d->nextReturnedEndOfData = true; // first call to next() will call fetchData() + d->nextReturnedEndOfData = true; // first call to next() will call fetchData() - d->encodingDeclBytes.clear(); - d->encodingDeclChars.clear(); - d->lookingForEncodingDecl = true; + d->encodingDeclBytes.clear(); + d->encodingDeclChars.clear(); + d->lookingForEncodingDecl = true; + } QT_CATCH(...) { + delete(d); + QT_RETHROW; + } } /*! @@ -2715,9 +2721,24 @@ inline void QXmlSimpleReaderPrivate::refClear() refValueLen = 0; refArrayPos = 0; } -QXmlSimpleReaderPrivate::QXmlSimpleReaderPrivate() +QXmlSimpleReaderPrivate::QXmlSimpleReaderPrivate(QXmlSimpleReader *reader) { + q_ptr = reader; parseStack = 0; + + locator.reset(new QXmlSimpleReaderLocator(reader)); + entityRes = 0; + dtdHnd = 0; + contentHnd = 0; + errorHnd = 0; + lexicalHnd = 0; + declHnd = 0; + + // default feature settings + useNamespaces = true; + useNamespacePrefixes = false; + reportWhitespaceCharData = true; + reportEntities = false; } QXmlSimpleReaderPrivate::~QXmlSimpleReaderPrivate() @@ -2727,8 +2748,10 @@ QXmlSimpleReaderPrivate::~QXmlSimpleReaderPrivate() void QXmlSimpleReaderPrivate::initIncrementalParsing() { - delete parseStack; - parseStack = new QStack; + if( parseStack ) + parseStack->clear(); + else + parseStack = new QStack; } /********************************************* @@ -3101,25 +3124,8 @@ static NameChar determineNameChar(QChar ch) */ QXmlSimpleReader::QXmlSimpleReader() + : d_ptr(new QXmlSimpleReaderPrivate(this)) { - d_ptr = new QXmlSimpleReaderPrivate(); - Q_D(QXmlSimpleReader); - d->q_ptr = this; - - d->locator = new QXmlSimpleReaderLocator(this); - - d->entityRes = 0; - d->dtdHnd = 0; - d->contentHnd = 0; - d->errorHnd = 0; - d->lexicalHnd = 0; - d->declHnd = 0; - - // default feature settings - d->useNamespaces = true; - d->useNamespacePrefixes = false; - d->reportWhitespaceCharData = true; - d->reportEntities = false; } /*! @@ -3127,9 +3133,6 @@ QXmlSimpleReader::QXmlSimpleReader() */ QXmlSimpleReader::~QXmlSimpleReader() { - Q_D(QXmlSimpleReader); - delete d->locator; - delete d; } /*! @@ -3412,7 +3415,7 @@ bool QXmlSimpleReader::parse(const QXmlInputSource *input, bool incremental) // call the handler if (d->contentHnd) { - d->contentHnd->setDocumentLocator(d->locator); + d->contentHnd->setDocumentLocator(d->locator.data()); if (!d->contentHnd->startDocument()) { d->reportParseError(d->contentHnd->errorString()); d->tags.clear(); diff --git a/src/xml/sax/qxml.h b/src/xml/sax/qxml.h index e0165d3..8e3eb25 100644 --- a/src/xml/sax/qxml.h +++ b/src/xml/sax/qxml.h @@ -47,6 +47,7 @@ #include #include #include +#include QT_BEGIN_HEADER @@ -202,7 +203,7 @@ public: QString message() const; private: - QXmlParseExceptionPrivate *d; + QScopedPointer d; }; @@ -271,7 +272,7 @@ public: private: Q_DISABLE_COPY(QXmlSimpleReader) Q_DECLARE_PRIVATE(QXmlSimpleReader) - QXmlSimpleReaderPrivate* d_ptr; + QScopedPointer d_ptr; friend class QXmlSimpleReaderLocator; }; diff --git a/src/xmlpatterns/api/qabstractxmlnodemodel.cpp b/src/xmlpatterns/api/qabstractxmlnodemodel.cpp index 0caa8c4..12ce6a7 100644 --- a/src/xmlpatterns/api/qabstractxmlnodemodel.cpp +++ b/src/xmlpatterns/api/qabstractxmlnodemodel.cpp @@ -302,7 +302,6 @@ QAbstractXmlNodeModel::QAbstractXmlNodeModel(QAbstractXmlNodeModelPrivate *d) : */ QAbstractXmlNodeModel::~QAbstractXmlNodeModel() { - delete d_ptr; } /*! diff --git a/src/xmlpatterns/api/qabstractxmlnodemodel.h b/src/xmlpatterns/api/qabstractxmlnodemodel.h index 6c9574c..9b5b3dd 100644 --- a/src/xmlpatterns/api/qabstractxmlnodemodel.h +++ b/src/xmlpatterns/api/qabstractxmlnodemodel.h @@ -44,6 +44,7 @@ #include #include +#include QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -339,7 +340,7 @@ protected: return QXmlNodeModelIndex::create(data, this, additionalData); } - QAbstractXmlNodeModelPrivate *d_ptr; + QScopedPointer d_ptr; private: friend class QPatternist::ItemMappingIterator >; friend class QPatternist::SequenceMappingIterator; diff --git a/src/xmlpatterns/api/qabstractxmlreceiver.cpp b/src/xmlpatterns/api/qabstractxmlreceiver.cpp index ddd01e4..4253ce0 100644 --- a/src/xmlpatterns/api/qabstractxmlreceiver.cpp +++ b/src/xmlpatterns/api/qabstractxmlreceiver.cpp @@ -224,7 +224,6 @@ QAbstractXmlReceiver::QAbstractXmlReceiver() : d_ptr(0) */ QAbstractXmlReceiver::~QAbstractXmlReceiver() { - delete d_ptr; } /*! diff --git a/src/xmlpatterns/api/qabstractxmlreceiver.h b/src/xmlpatterns/api/qabstractxmlreceiver.h index 355576a..270b9da 100644 --- a/src/xmlpatterns/api/qabstractxmlreceiver.h +++ b/src/xmlpatterns/api/qabstractxmlreceiver.h @@ -43,6 +43,7 @@ #define QABSTRACTXMLRECEIVER_H #include +#include #include QT_BEGIN_HEADER @@ -90,7 +91,7 @@ public: protected: QAbstractXmlReceiver(QAbstractXmlReceiverPrivate *d); - QAbstractXmlReceiverPrivate *d_ptr; + QScopedPointer d_ptr; void sendAsNode(const QPatternist::Item &outputItem); private: diff --git a/src/xmlpatterns/api/qxmlresultitems.cpp b/src/xmlpatterns/api/qxmlresultitems.cpp index a2253c9..652d931 100644 --- a/src/xmlpatterns/api/qxmlresultitems.cpp +++ b/src/xmlpatterns/api/qxmlresultitems.cpp @@ -85,7 +85,6 @@ QXmlResultItems::QXmlResultItems() : d_ptr(new QXmlResultItemsPrivate()) */ QXmlResultItems::~QXmlResultItems() { - delete d_ptr; } /*! diff --git a/src/xmlpatterns/api/qxmlresultitems.h b/src/xmlpatterns/api/qxmlresultitems.h index aeb7d2c..5484616 100644 --- a/src/xmlpatterns/api/qxmlresultitems.h +++ b/src/xmlpatterns/api/qxmlresultitems.h @@ -43,6 +43,7 @@ #define QXMLRESULTITEMS #include +#include QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -66,7 +67,7 @@ public: private: friend class QXmlQuery; Q_DECLARE_PRIVATE(QXmlResultItems) - QXmlResultItemsPrivate *d_ptr; + QScopedPointer d_ptr; Q_DISABLE_COPY(QXmlResultItems) }; diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 0092d49..178351b 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -231,6 +231,7 @@ SUBDIRS += _networkselftest \ qprogressbar \ qprogressdialog \ qpushbutton \ + qscopedpointer \ qqueue \ qradiobutton \ qreadlocker \ diff --git a/tests/auto/collections/tst_collections.cpp b/tests/auto/collections/tst_collections.cpp index c05d8da..cbd72dc 100644 --- a/tests/auto/collections/tst_collections.cpp +++ b/tests/auto/collections/tst_collections.cpp @@ -1364,6 +1364,9 @@ void tst_Collections::byteArray() ba1 = "FooFoo"; ba1.replace(char('F'), ba1); QCOMPARE(ba1, QByteArray("FooFooooFooFoooo")); + ba1 = "FooFoo"; + ba1.replace(char('o'), ba1); + QCOMPARE(ba1, QByteArray("FFooFooFooFooFFooFooFooFoo")); ba1.replace(ba1, "xxx"); QCOMPARE(ba1, QByteArray("xxx")); @@ -2354,6 +2357,9 @@ void tst_Collections::qstring() str1 = "FooFoo"; str1.replace(char('F'), str1); QCOMPARE(str1, QString("FooFooooFooFoooo")); + str1 = "FooFoo"; + str1.replace(char('o'), str1); + QCOMPARE(str1, QString("FFooFooFooFooFFooFooFooFoo")); str1 = "Foo"; str1.replace("Foo", str1); diff --git a/tests/auto/exceptionsafety/tst_exceptionsafety.cpp b/tests/auto/exceptionsafety/tst_exceptionsafety.cpp index 9c4f78d..8ed2913 100644 --- a/tests/auto/exceptionsafety/tst_exceptionsafety.cpp +++ b/tests/auto/exceptionsafety/tst_exceptionsafety.cpp @@ -52,9 +52,16 @@ class tst_ExceptionSafety: public QObject Q_OBJECT private slots: void exceptionInSlot(); + void exceptionVector(); + void exceptionHash(); + void exceptionMap(); + void exceptionList(); + void exceptionLinkedList(); + void exceptionEventLoop(); + void exceptionSignalSlot(); }; -class Emitter: public QObject +class Emitter : public QObject { Q_OBJECT public: @@ -63,13 +70,111 @@ signals: void testSignal(); }; -class ExceptionThrower: public QObject +class ExceptionThrower : public QObject { Q_OBJECT public slots: void thrower() { throw 5; } }; +class Receiver : public QObject +{ + Q_OBJECT +public: + Receiver() + : received(0) {} + int received; + +public slots: + void receiver() { ++received; } +}; + +enum ThrowType { ThrowNot = 0, ThrowAtCreate = 1, ThrowAtCopy = 2, ThrowLater = 3, ThrowAtComparison = 4 }; + +ThrowType throwType = ThrowNot; // global flag to indicate when an exception should be throw. Will be reset when the exception has been generated. + +int objCounter = 0; + +/*! Class that does not throw any exceptions. Used as baseclass for all the other ones. + */ +template +class FlexibleThrower +{ + public: + FlexibleThrower() : _value(-1) { + if( throwType == ThrowAtCreate ) { + throwType = ThrowNot; + throw ThrowAtCreate; + } + objCounter++; + } + + FlexibleThrower( short value ) : _value(value) { + if( throwType == ThrowAtCreate ) { + throwType = ThrowNot; + throw ThrowAtCreate; + } + objCounter++; + } + + FlexibleThrower(FlexibleThrower const& other ) { + // qDebug("cc"); + + if( throwType == ThrowAtCopy ) { + throwType = ThrowNot; + throw ThrowAtCopy; + + } else if( throwType == ThrowLater ) { + throwType = ThrowAtCopy; + } + + objCounter++; + _value = other.value(); + } + + ~FlexibleThrower() { objCounter--; } + + bool operator==(const FlexibleThrower &t) const + { + // qDebug("vv == %d %d", value(), t.value()); + if( throwType == ThrowAtComparison ) { + throwType = ThrowNot; + throw ThrowAtComparison; + } + return value()==t.value(); + } + + bool operator<(const FlexibleThrower &t) const + { + // qDebug("vv < %d %d", value(), t.value()); + if( throwType == ThrowAtComparison ) { + throwType = ThrowNot; + throw ThrowAtComparison; + } + return value()& t) +{ + // qDebug("ha"); + if( throwType == ThrowAtComparison ) { + throwType = ThrowNot; + throw ThrowAtComparison; + } + return (uint)t.value(); +} + +typedef FlexibleThrower<2> FlexibleThrowerSmall; +typedef QMap MyMap; +typedef QHash MyHash; + // connect a signal to a slot that throws an exception // run this through valgrind to make sure it doesn't corrupt void tst_ExceptionSafety::exceptionInSlot() @@ -86,6 +191,525 @@ void tst_ExceptionSafety::exceptionInSlot() } } +void tst_ExceptionSafety::exceptionList() { + + { + QList list; + QList list2; + QList list3; + + for( int i = 0; i<10; i++ ) + list.append( FlexibleThrowerSmall(i) ); + + try { + throwType = ThrowAtCopy; + list.append( FlexibleThrowerSmall(10)); + } catch (...) { + } + QCOMPARE( list.size(), 10 ); + + try { + throwType = ThrowAtCopy; + list.prepend( FlexibleThrowerSmall(10)); + } catch (...) { + } + QCOMPARE( list.at(0).value(), 0 ); + QCOMPARE( list.size(), 10 ); + + try { + throwType = ThrowAtCopy; + list.insert( 8, FlexibleThrowerSmall(10)); + } catch (...) { + } + QCOMPARE( list.at(7).value(), 7 ); + QCOMPARE( list.at(8).value(), 8 ); + QCOMPARE( list.size(), 10 ); + + try { + throwType = ThrowAtCopy; + FlexibleThrowerSmall t = list.takeAt( 6 ); + } catch (...) { + } + QCOMPARE( list.at(6).value(), 6 ); + QCOMPARE( list.at(7).value(), 7 ); + QCOMPARE( list.size(), 10 ); + + try { + throwType = ThrowAtCopy; + list3 = list; + } catch (...) { + } + QCOMPARE( list.at(0).value(), 0 ); + QCOMPARE( list.at(7).value(), 7 ); + QCOMPARE( list.size(), 10 ); + QCOMPARE( list3.at(0).value(), 0 ); + QCOMPARE( list3.at(7).value(), 7 ); + QCOMPARE( list3.size(), 10 ); + + try { + throwType = ThrowAtCopy; + list3.append( FlexibleThrowerSmall(11) ); + } catch (...) { + } + QCOMPARE( list.at(0).value(), 0 ); + QCOMPARE( list.at(7).value(), 7 ); + QCOMPARE( list.size(), 10 ); + QCOMPARE( list3.at(0).value(), 0 ); + QCOMPARE( list3.at(7).value(), 7 ); + QCOMPARE( list3.size(), 10 ); + + try { + list2.clear(); + list2.append( FlexibleThrowerSmall(11)); + throwType = ThrowAtCopy; + list3 = list+list2; + } catch (...) { + } + QCOMPARE( list.at(0).value(), 0 ); + QCOMPARE( list.at(7).value(), 7 ); + QCOMPARE( list.size(), 10 ); + + // check that copy on write works atomar + list2.clear(); + list2.append( FlexibleThrowerSmall(11)); + list3 = list+list2; + try { + throwType = ThrowAtCreate; + list3[7]=FlexibleThrowerSmall(12); + } catch (...) { + } + QCOMPARE( list.at(7).value(), 7 ); + QCOMPARE( list.size(), 10 ); + QCOMPARE( list3.at(7).value(), 7 ); + QCOMPARE( list3.size(), 11 ); + + } + QCOMPARE(objCounter, 0 ); // check that every object has been freed +} + +void tst_ExceptionSafety::exceptionLinkedList() { + + { + QLinkedList list; + QLinkedList list2; + QLinkedList list3; + + for( int i = 0; i<10; i++ ) + list.append( FlexibleThrowerSmall(i) ); + + try { + throwType = ThrowAtCopy; + list.append( FlexibleThrowerSmall(10)); + } catch (...) { + } + QCOMPARE( list.size(), 10 ); + + try { + throwType = ThrowAtCopy; + list.prepend( FlexibleThrowerSmall(10)); + } catch (...) { + } + QCOMPARE( list.first().value(), 0 ); + QCOMPARE( list.size(), 10 ); + + try { + throwType = ThrowAtCopy; + list3 = list; + list3.append( FlexibleThrowerSmall(11) ); + } catch (...) { + } + QCOMPARE( list.first().value(), 0 ); + QCOMPARE( list.size(), 10 ); + QCOMPARE( list3.size(), 10 ); + } + QCOMPARE(objCounter, 0 ); // check that every object has been freed +} + +void tst_ExceptionSafety::exceptionVector() { + + { + QVector vector; + QVector vector2; + QVector vector3; + + for (int i = 0; i<10; i++) + vector.append( FlexibleThrowerSmall(i) ); + + try { + throwType = ThrowAtCopy; + vector.append( FlexibleThrowerSmall(10)); + } catch (...) { + } + QCOMPARE( vector.size(), 10 ); + + try { + throwType = ThrowAtCopy; + vector.prepend( FlexibleThrowerSmall(10)); + } catch (...) { + } + QCOMPARE( vector.at(0).value(), 0 ); + QCOMPARE( vector.size(), 10 ); + + try { + throwType = ThrowAtCopy; + vector.insert( 8, FlexibleThrowerSmall(10)); + } catch (...) { + } + QCOMPARE( vector.at(7).value(), 7 ); + QCOMPARE( vector.at(8).value(), 8 ); + QCOMPARE( vector.size(), 10 ); + + try { + throwType = ThrowAtCopy; + vector3 = vector; + } catch (...) { + } + QCOMPARE( vector.at(0).value(), 0 ); + QCOMPARE( vector.at(7).value(), 7 ); + QCOMPARE( vector.size(), 10 ); + QCOMPARE( vector3.at(0).value(), 0 ); + QCOMPARE( vector3.at(7).value(), 7 ); + QCOMPARE( vector3.size(), 10 ); + + try { + throwType = ThrowAtCopy; + vector3.append( FlexibleThrowerSmall(11) ); + } catch (...) { + } + QCOMPARE( vector.at(0).value(), 0 ); + QCOMPARE( vector.at(7).value(), 7 ); + QCOMPARE( vector.size(), 10 ); + QCOMPARE( vector3.at(0).value(), 0 ); + QCOMPARE( vector3.at(7).value(), 7 ); + + try { + vector2.clear(); + vector2.append( FlexibleThrowerSmall(11)); + throwType = ThrowAtCopy; + vector3 = vector+vector2; + } catch (...) { + } + QCOMPARE( vector.at(0).value(), 0 ); + QCOMPARE( vector.at(7).value(), 7 ); + QCOMPARE( vector.size(), 10 ); + + // check that copy on write works atomar + vector2.clear(); + vector2.append( FlexibleThrowerSmall(11)); + vector3 = vector+vector2; + try { + throwType = ThrowAtCreate; + vector3[7]=FlexibleThrowerSmall(12); + } catch (...) { + } + QCOMPARE( vector.at(7).value(), 7 ); + QCOMPARE( vector.size(), 10 ); + QCOMPARE( vector3.at(7).value(), 7 ); + QCOMPARE( vector3.size(), 11 ); + + try { + throwType = ThrowAtCreate; + vector.resize(15); + } catch (...) { + } + QCOMPARE( vector.at(7).value(), 7 ); + QCOMPARE( vector.size(), 10 ); + + try { + throwType = ThrowAtCreate; + vector.resize(15); + } catch (...) { + } + QCOMPARE( vector.at(7).value(), 7 ); + QCOMPARE( vector.size(), 10 ); + + try { + throwType = ThrowLater; + vector.fill(FlexibleThrowerSmall(1), 15); + } catch (...) { + } + QCOMPARE( vector.at(0).value(), 0 ); + QCOMPARE( vector.size(), 10 ); + + + } + QCOMPARE(objCounter, 0 ); // check that every object has been freed +} + + +void tst_ExceptionSafety::exceptionMap() { + + { + MyMap map; + MyMap map2; + MyMap map3; + + throwType = ThrowNot; + for (int i = 0; i<10; i++) + map[ FlexibleThrowerSmall(i) ] = FlexibleThrowerSmall(i); + + return; // further test are deactivated until Map is fixed. + + for( int i = ThrowAtCopy; i<=ThrowAtComparison; i++ ) { + try { + throwType = (ThrowType)i; + map[ FlexibleThrowerSmall(10) ] = FlexibleThrowerSmall(10); + } catch(...) { + } + QCOMPARE( map.size(), 10 ); + QCOMPARE( map[ FlexibleThrowerSmall(1) ], FlexibleThrowerSmall(1) ); + } + + map2 = map; + try { + throwType = ThrowLater; + map2[ FlexibleThrowerSmall(10) ] = FlexibleThrowerSmall(10); + } catch(...) { + } + /* qDebug("%d %d", map.size(), map2.size() ); + for( int i=0; i(ThrowEventId)) + { + } +}; + +class NoThrowEvent : public QEvent +{ +public: + NoThrowEvent() + : QEvent(static_cast(NoThrowEventId)) + {} +}; + +class TestObject : public QObject +{ +public: + TestObject() + : throwEventCount(0), noThrowEventCount(0) {} + + int throwEventCount; + int noThrowEventCount; + +protected: + bool event(QEvent *event) + { + if (int(event->type()) == ThrowEventId) { + throw ++throwEventCount; + } else if (int(event->type()) == NoThrowEventId) { + ++noThrowEventCount; + } + return QObject::event(event); + } +}; + +void tst_ExceptionSafety::exceptionEventLoop() +{ + // send an event that throws + TestObject obj; + ThrowEvent throwEvent; + try { + qApp->sendEvent(&obj, &throwEvent); + } catch (int code) { + QCOMPARE(code, 1); + } + QCOMPARE(obj.throwEventCount, 1); + + // post an event that throws + qApp->postEvent(&obj, new ThrowEvent); + + try { + qApp->processEvents(); + } catch (int code) { + QCOMPARE(code, 2); + } + QCOMPARE(obj.throwEventCount, 2); + + // post a normal event, then a throwing event, then a normal event + // run this in valgrind to ensure that it doesn't leak. + + qApp->postEvent(&obj, new NoThrowEvent); + qApp->postEvent(&obj, new ThrowEvent); + qApp->postEvent(&obj, new NoThrowEvent); + + try { + qApp->processEvents(); + } catch (int code) { + QCOMPARE(code, 3); + } + // here, we should have received on non-throwing event and one throwing one + QCOMPARE(obj.throwEventCount, 3); + QCOMPARE(obj.noThrowEventCount, 1); + + // spin the event loop again + qApp->processEvents(); + + // now, we should have received the second non-throwing event + QCOMPARE(obj.noThrowEventCount, 2); +} + +void tst_ExceptionSafety::exceptionSignalSlot() +{ + Emitter e; + ExceptionThrower thrower; + Receiver r1; + Receiver r2; + + // connect a signal to a normal object, a thrower and a normal object again + connect(&e, SIGNAL(testSignal()), &r1, SLOT(receiver())); + connect(&e, SIGNAL(testSignal()), &thrower, SLOT(thrower())); + connect(&e, SIGNAL(testSignal()), &r2, SLOT(receiver())); + + int code = 0; + try { + e.emitTestSignal(); + } catch (int c) { + code = c; + } + + // 5 is the magic number that's thrown by thrower + QCOMPARE(code, 5); + + // assumption: slots are called in the connection order + QCOMPARE(r1.received, 1); + QCOMPARE(r2.received, 0); +} + QTEST_MAIN(tst_ExceptionSafety) #include "tst_exceptionsafety.moc" #endif // QT_NO_EXCEPTIONS diff --git a/tests/auto/network-settings.h b/tests/auto/network-settings.h index 22d8886..0924c57 100644 --- a/tests/auto/network-settings.h +++ b/tests/auto/network-settings.h @@ -59,27 +59,28 @@ // network tests. WINPCAP connectivity uses Symbian OS IP stack, // correspondingly as HW does. When using WINPCAP disable this define //#define SYMBIAN_WINSOCK_CONNECTIVITY -#endif - class QtNetworkSettingsRecord { - public: - QtNetworkSettingsRecord() { } +class QtNetworkSettingsRecord { +public: + QtNetworkSettingsRecord() { } + + QtNetworkSettingsRecord(const QString& recName, const QString& recVal) + : strRecordName(recName), strRecordValue(recVal) { } - QtNetworkSettingsRecord(const QString& recName, const QString& recVal) - : strRecordName(recName), strRecordValue(recVal) { } + QtNetworkSettingsRecord(const QtNetworkSettingsRecord & other) + : strRecordName(other.strRecordName), strRecordValue(other.strRecordValue) { } - QtNetworkSettingsRecord(const QtNetworkSettingsRecord & other) - : strRecordName(other.strRecordName), strRecordValue(other.strRecordValue) { } + ~QtNetworkSettingsRecord() { } - ~QtNetworkSettingsRecord() { } + const QString& recordName() const { return strRecordName; } + const QString& recordValue() const { return strRecordValue; } - const QString& recordName() const { return strRecordName; } - const QString& recordValue() const { return strRecordValue; } +private: + QString strRecordName; + QString strRecordValue; +}; - private: - QString strRecordName; - QString strRecordValue; - }; +#endif class QtNetworkSettings { @@ -171,6 +172,7 @@ public: static QByteArray expectedReplySSL() { +#ifdef Q_OS_SYMBIAN loadTestSettings(); if(QtNetworkSettings::entries.contains("imap.expectedreplyssl")) { @@ -180,12 +182,12 @@ public: imapExpectedReplySsl.append('\r').append('\n'); } return imapExpectedReplySsl.data(); - } else { - QByteArray expected( "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID AUTH=PLAIN SASL-IR] " ); - expected = expected.append(QtNetworkSettings::serverLocalName().toAscii()); - expected = expected.append(" Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n"); - return expected; } +#endif + QByteArray expected( "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID AUTH=PLAIN SASL-IR] " ); + expected = expected.append(QtNetworkSettings::serverLocalName().toAscii()); + expected = expected.append(" Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n"); + return expected; } static QByteArray expectedReplyFtp() diff --git a/tests/auto/qbitarray/tst_qbitarray.cpp b/tests/auto/qbitarray/tst_qbitarray.cpp index 12fbdc3..244183e 100644 --- a/tests/auto/qbitarray/tst_qbitarray.cpp +++ b/tests/auto/qbitarray/tst_qbitarray.cpp @@ -108,6 +108,8 @@ private slots: void invertOnNull() const; void operator_noteq_data(); void operator_noteq(); + + void resize(); }; Q_DECLARE_METATYPE(QBitArray) @@ -628,5 +630,30 @@ void tst_QBitArray::operator_noteq() QCOMPARE(b, res); } +void tst_QBitArray::resize() +{ + // -- check that a resize handles the bits correctly + QBitArray a = QStringToQBitArray(QString("11")); + a.resize(10); + QVERIFY(a.size() == 10); + QCOMPARE( a, QStringToQBitArray(QString("1100000000")) ); + + a.setBit(9); + a.resize(9); + // now the bit in a should have been gone: + QCOMPARE( a, QStringToQBitArray(QString("110000000")) ); + + // grow the array back and check the new bit + a.resize(10); + QCOMPARE( a, QStringToQBitArray(QString("1100000000")) ); + + // other test with and + a.resize(9); + QBitArray b = QStringToQBitArray(QString("1111111111")); + b &= a; + QCOMPARE( b, QStringToQBitArray(QString("1100000000")) ); + +} + QTEST_APPLESS_MAIN(tst_QBitArray) #include "tst_qbitarray.moc" diff --git a/tests/auto/qeventloop/tst_qeventloop.cpp b/tests/auto/qeventloop/tst_qeventloop.cpp index a4017b8..ed95402 100644 --- a/tests/auto/qeventloop/tst_qeventloop.cpp +++ b/tests/auto/qeventloop/tst_qeventloop.cpp @@ -243,8 +243,10 @@ public slots: // Let all the events occur twice so we know they reactivated after // each occurrence. if (++timerCount >= 2) { +#ifdef Q_OS_SYMBIAN // This will hopefully run last, so stop the active scheduler. CActiveScheduler::Stop(); +#endif } } void zeroTimerSlot() diff --git a/tests/auto/qfiledialog/tst_qfiledialog.cpp b/tests/auto/qfiledialog/tst_qfiledialog.cpp index b4fd0c5..5f0776f 100644 --- a/tests/auto/qfiledialog/tst_qfiledialog.cpp +++ b/tests/auto/qfiledialog/tst_qfiledialog.cpp @@ -465,10 +465,11 @@ void tst_QFiledialog::completer() if (!tmp.exists(tempPath)) QVERIFY(tmp.mkdir("QFileDialogTestDir")); QList files; + QT_TRY { for (int i = 0; i < 10; ++i) { - QTemporaryFile *file = new QTemporaryFile(tempPath + "/rXXXXXX"); + QScopedPointer file(new QTemporaryFile(tempPath + "/rXXXXXX")); file->open(); - files.append(file); + files.append(file.take()); } // ### flesh this out more @@ -559,6 +560,10 @@ void tst_QFiledialog::completer() // ### FIXME: This will fail on Symbian on some tests and some environments until the file engine and QFileSystemModel // are fixed to properly capitalize paths, so that some folders are not duplicated in QFileSystemModel. QTRY_COMPARE(cModel->rowCount(), expected); + } QT_CATCH(...) { + qDeleteAll(files); + QT_RETHROW; + } qDeleteAll(files); } diff --git a/tests/auto/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/qfontdatabase/tst_qfontdatabase.cpp index a006462..cb5790d 100644 --- a/tests/auto/qfontdatabase/tst_qfontdatabase.cpp +++ b/tests/auto/qfontdatabase/tst_qfontdatabase.cpp @@ -242,7 +242,7 @@ void tst_QFontDatabase::addAppFont() QVERIFY(QFontDatabase::removeApplicationFont(id)); QCOMPARE(fontDbChangedSpy.count(), 2); - QVERIFY(db.families() == oldFamilies);¨ + QVERIFY(db.families() == oldFamilies); #endif } diff --git a/tests/auto/qglobal/tst_qglobal.cpp b/tests/auto/qglobal/tst_qglobal.cpp index 88fbcd2..b4d42e4 100644 --- a/tests/auto/qglobal/tst_qglobal.cpp +++ b/tests/auto/qglobal/tst_qglobal.cpp @@ -50,6 +50,7 @@ private slots: void qInternalCallbacks(); void for_each(); void qassert(); + void qtry(); }; void tst_QGlobal::qIsNull() @@ -190,5 +191,66 @@ void tst_QGlobal::qassert() QVERIFY(passed); } +void tst_QGlobal::qtry() +{ + int i = 0; + QT_TRY { + i = 1; + QT_THROW(42); + i = 2; + } QT_CATCH(int) { + QCOMPARE(i, 1); + i = 7; + } +#ifdef QT_NO_EXCEPTIONS + QCOMPARE(i, 2); +#else + QCOMPARE(i, 7); +#endif + + // check propper if/else scoping + i = 0; + if (true) + QT_TRY { + i = 2; + QT_THROW(42); + i = 4; + } QT_CATCH(int) { + QCOMPARE(i, 2); + i = 4; + } + else + QCOMPARE(i, 0); + QCOMPARE(i, 4); + + i = 0; + if (false) + QT_TRY { + i = 2; + QT_THROW(42); + i = 4; + } QT_CATCH(int) { + QCOMPARE(i, 2); + i = 2; + } + else + i = 8; + QCOMPARE(i, 8); + + i = 0; + if (false) + i = 42; + else + QT_TRY { + i = 2; + QT_THROW(42); + i = 4; + } QT_CATCH(int) { + QCOMPARE(i, 2); + i = 4; + } + QCOMPARE(i, 4); +} + QTEST_MAIN(tst_QGlobal) #include "tst_qglobal.moc" diff --git a/tests/auto/qitemdelegate/tst_qitemdelegate.cpp b/tests/auto/qitemdelegate/tst_qitemdelegate.cpp index 615ac01..955760a 100644 --- a/tests/auto/qitemdelegate/tst_qitemdelegate.cpp +++ b/tests/auto/qitemdelegate/tst_qitemdelegate.cpp @@ -1115,13 +1115,16 @@ void tst_QItemDelegate::enterKey() QList lineEditors = qFindChildren(view.viewport(), QString::fromLatin1("TheEditor")); QCOMPARE(lineEditors.count(), 1); - QWidget *editor = lineEditors.at(0); + QPointer editor = lineEditors.at(0); QCOMPARE(editor->hasFocus(), true); QTest::keyClick(editor, Qt::Key(key)); QApplication::processEvents(); - QCOMPARE(editor->hasFocus(), expectedFocus); + if (widget == 2 || widget == 3) { + QVERIFY(!editor.isNull()); + QCOMPARE(editor->hasFocus(), expectedFocus); + } } diff --git a/tests/auto/qscopedpointer/.gitignore b/tests/auto/qscopedpointer/.gitignore new file mode 100644 index 0000000..9f2324c --- /dev/null +++ b/tests/auto/qscopedpointer/.gitignore @@ -0,0 +1 @@ +tst_qscopedpointer diff --git a/tests/auto/qscopedpointer/qscopedpointer.pro b/tests/auto/qscopedpointer/qscopedpointer.pro new file mode 100644 index 0000000..13d8425 --- /dev/null +++ b/tests/auto/qscopedpointer/qscopedpointer.pro @@ -0,0 +1,3 @@ +load(qttest_p4) +SOURCES += tst_qscopedpointer.cpp +QT -= gui diff --git a/tests/auto/qscopedpointer/tst_qscopedpointer.cpp b/tests/auto/qscopedpointer/tst_qscopedpointer.cpp new file mode 100644 index 0000000..0e005c3 --- /dev/null +++ b/tests/auto/qscopedpointer/tst_qscopedpointer.cpp @@ -0,0 +1,282 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +****************************************************************************/ + +#include +#include + +/*! + \class tst_QScopedPointer + \internal + \since 4.6 + \brief Tests class QScopedPointer. + + */ +class tst_QScopedPointer : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void defaultConstructor() const; + void dataOnDefaultConstructed() const; + void useSubClassInConstructor() const; + void dataOnValue() const; + void dataSignature() const; + void reset() const; + void dereferenceOperator() const; + void dereferenceOperatorSignature() const; + void pointerOperator() const; + void pointerOperatorSignature() const; + void negationOperator() const; + void negationOperatorSignature() const; + void operatorBool() const; + void operatorBoolSignature() const; + void isNull() const; + void isNullSignature() const; + void objectSize() const; + // TODO instansiate on const object +}; + +void tst_QScopedPointer::defaultConstructor() const +{ + /* Check that the members, one, is correctly initialized. */ + QScopedPointer p; + QCOMPARE(p.data(), static_cast(0)); +} + +void tst_QScopedPointer::dataOnDefaultConstructed() const +{ + QScopedPointer p; + + QCOMPARE(p.data(), static_cast(0)); +} + +class MyClass +{ +}; + +class MySubClass : public MyClass +{ +}; + +void tst_QScopedPointer::useSubClassInConstructor() const +{ + /* Use a syntax which users typically would do. */ + QScopedPointer p(new MyClass()); +} + +void tst_QScopedPointer::dataOnValue() const +{ + int *const rawPointer = new int(5); + QScopedPointer p(rawPointer); + + QCOMPARE(p.data(), rawPointer); +} + +void tst_QScopedPointer::dataSignature() const +{ + const QScopedPointer p; + /* data() should be const. */ + p.data(); +} + +void tst_QScopedPointer::reset() const +{ + /* Call reset() on a default constructed value. */ + { + QScopedPointer p; + p.reset(); + QCOMPARE(p.data(), static_cast(0)); + } + + /* Call reset() on an active value. */ + { + QScopedPointer p(new int(3)); + p.reset(); + QCOMPARE(p.data(), static_cast(0)); + } + + /* Call reset() with a value, on an active value. */ + { + QScopedPointer p(new int(3)); + + int *const value = new int(9); + p.reset(value); + QCOMPARE(*p.data(), 9); + } + + /* Call reset() with a value, on default constructed value. */ + { + QScopedPointer p; + + int *const value = new int(9); + p.reset(value); + QCOMPARE(*p.data(), 9); + } +} + +class AbstractClass +{ +public: + virtual ~AbstractClass() + { + } + + virtual int member() const = 0; +}; + +class SubClass : public AbstractClass +{ +public: + virtual int member() const + { + return 5; + } +}; + +void tst_QScopedPointer::dereferenceOperator() const +{ + /* Dereference a basic value. */ + { + QScopedPointer p(new int(5)); + + const int value2 = *p; + QCOMPARE(value2, 5); + } + + /* Dereference a pointer to an abstract class. This verifies + * that the operator returns a reference, when compiling + * with MSVC 2005. */ + { + QScopedPointer p(new SubClass()); + + QCOMPARE((*p).member(), 5); + } +} + +void tst_QScopedPointer::dereferenceOperatorSignature() const +{ + /* The operator should be const. */ + { + const QScopedPointer p(new int(5)); + *p; + } + + /* A reference should be returned, not a value. */ + { + const QScopedPointer p(new int(5)); + Q_UNUSED(static_cast(*p)); + } + + /* Instantiated on a const object, the returned object is a const reference. */ + { + const QScopedPointer p(new int(5)); + Q_UNUSED(static_cast(*p)); + } +} + +class AnyForm +{ +public: + int value; +}; + +void tst_QScopedPointer::pointerOperator() const +{ + QScopedPointer p(new AnyForm()); + p->value = 5; + + QCOMPARE(p->value, 5); +} + +void tst_QScopedPointer::pointerOperatorSignature() const +{ + /* The operator should be const. */ + const QScopedPointer p(new AnyForm); + p->value = 5; + + QVERIFY(p->value); +} + +void tst_QScopedPointer::negationOperator() const +{ + /* Invoke on default constructed value. */ + { + QScopedPointer p; + QVERIFY(!p); + } + + /* Invoke on a value. */ + { + QScopedPointer p(new int(2)); + QCOMPARE(!p, false); + } +} + +void tst_QScopedPointer::negationOperatorSignature() const +{ + /* The signature should be const. */ + const QScopedPointer p; + !p; + + /* The return value should be bool. */ + static_cast(!p); +} + +void tst_QScopedPointer::operatorBool() const +{ + /* Invoke on default constructed value. */ + { + QScopedPointer p; + QCOMPARE(bool(p), false); + } + + /* Invoke on active value. */ + { + QScopedPointer p(new int(3)); + QVERIFY(p); + } +} + +void tst_QScopedPointer::operatorBoolSignature() const +{ + /* The signature should be const and return bool. */ + const QScopedPointer p; + + static_cast(p); +} + +void tst_QScopedPointer::isNull() const +{ + /* Invoke on default constructed value. */ + { + QScopedPointer p; + QVERIFY(p.isNull()); + } + + /* Invoke on a set value. */ + { + QScopedPointer p(new int(69)); + QVERIFY(!p.isNull()); + } +} + +void tst_QScopedPointer::isNullSignature() const +{ + const QScopedPointer p(new int(69)); + + /* The signature should be const and return bool. */ + static_cast(p.isNull()); +} + +void tst_QScopedPointer::objectSize() const +{ + /* The size of QScopedPointer should be the same as one pointer. */ + QCOMPARE(sizeof(QScopedPointer), sizeof(void *)); +} + +QTEST_MAIN(tst_QScopedPointer) +#include "tst_qscopedpointer.moc" diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp index f2ea2d9..cf16abb 100644 --- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp @@ -81,10 +81,8 @@ #ifndef TEST_QNETWORK_PROXY //#define TEST_QNETWORK_PROXY #endif -#if defined(TEST_QNETWORK_PROXY) || defined (Q_CC_RVCT) // RVCT compiles also unused inline methods # include -#endif #ifdef Q_OS_LINUX #include @@ -1185,7 +1183,7 @@ void tst_QTcpSocket::readLine() char buffer[1024]; int expectedReplySize = QtNetworkSettings::expectedReplyIMAP().size(); - ASSERT(expectedReplySize >= 3); + Q_ASSERT(expectedReplySize >= 3); QCOMPARE(socket->readLine(buffer, sizeof(buffer)), qint64(expectedReplySize)); QCOMPARE((int) buffer[expectedReplySize-2], (int) '\r'); diff --git a/tests/auto/qudpsocket/tst_qudpsocket.cpp b/tests/auto/qudpsocket/tst_qudpsocket.cpp index 621acbb..e9bf51b 100644 --- a/tests/auto/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/qudpsocket/tst_qudpsocket.cpp @@ -853,4 +853,4 @@ void tst_QUdpSocket::zeroLengthDatagram() } QTEST_MAIN(tst_QUdpSocket) -#include "test/tmp/tst_qudpsocket.moc" +#include "tst_qudpsocket.moc" diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 81ddf4a..945a0f0 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1407,8 +1407,8 @@ void Configure::applySpecSpecifics() dictionary[ "OPENGL" ] = "no"; dictionary[ "OPENSSL" ] = "yes"; dictionary[ "STL" ] = "yes"; - dictionary[ "EXCEPTIONS" ] = "no"; - dictionary[ "RTTI" ] = "no"; + dictionary[ "EXCEPTIONS" ] = "yes"; + dictionary[ "RTTI" ] = "yes"; dictionary[ "ARCHITECTURE" ] = "symbian"; dictionary[ "3DNOW" ] = "no"; dictionary[ "SSE" ] = "no"; diff --git a/tools/designer/src/components/formeditor/brushmanagerproxy.cpp b/tools/designer/src/components/formeditor/brushmanagerproxy.cpp index b1c056e..86880f3 100644 --- a/tools/designer/src/components/formeditor/brushmanagerproxy.cpp +++ b/tools/designer/src/components/formeditor/brushmanagerproxy.cpp @@ -146,14 +146,12 @@ QString BrushManagerProxyPrivate::uniqueBrushFileName(const QString &brushName) BrushManagerProxy::BrushManagerProxy(QDesignerFormEditorInterface *core, QObject *parent) - : QObject(parent) + : QObject(parent), d_ptr(new BrushManagerProxyPrivate(this, core)) { - d_ptr = new BrushManagerProxyPrivate(this, core); } BrushManagerProxy::~BrushManagerProxy() { - delete d_ptr; } void BrushManagerProxy::setBrushManager(QtBrushManager *manager) diff --git a/tools/designer/src/components/formeditor/brushmanagerproxy.h b/tools/designer/src/components/formeditor/brushmanagerproxy.h index cbe50ae..43bcf29 100644 --- a/tools/designer/src/components/formeditor/brushmanagerproxy.h +++ b/tools/designer/src/components/formeditor/brushmanagerproxy.h @@ -63,7 +63,7 @@ public: void setBrushManager(QtBrushManager *manager); private: - BrushManagerProxyPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(BrushManagerProxy) Q_DISABLE_COPY(BrushManagerProxy) Q_PRIVATE_SLOT(d_func(), void brushAdded(const QString &, const QBrush &)) diff --git a/tools/designer/src/components/formeditor/qtbrushmanager.cpp b/tools/designer/src/components/formeditor/qtbrushmanager.cpp index c28c6b9..3ac9851 100644 --- a/tools/designer/src/components/formeditor/qtbrushmanager.cpp +++ b/tools/designer/src/components/formeditor/qtbrushmanager.cpp @@ -57,16 +57,13 @@ public: }; QtBrushManager::QtBrushManager(QObject *parent) - : QDesignerBrushManagerInterface(parent) + : QDesignerBrushManagerInterface(parent), d_ptr(new QtBrushManagerPrivate) { - d_ptr = new QtBrushManagerPrivate; d_ptr->q_ptr = this; - } QtBrushManager::~QtBrushManager() { - delete d_ptr; } QBrush QtBrushManager::brush(const QString &name) const diff --git a/tools/designer/src/components/formeditor/qtbrushmanager.h b/tools/designer/src/components/formeditor/qtbrushmanager.h index f8f1b8a..0855175 100644 --- a/tools/designer/src/components/formeditor/qtbrushmanager.h +++ b/tools/designer/src/components/formeditor/qtbrushmanager.h @@ -77,7 +77,7 @@ signals: void currentBrushChanged(const QString &name, const QBrush &brush); private: - QtBrushManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtBrushManager) Q_DISABLE_COPY(QtBrushManager) }; diff --git a/tools/designer/src/lib/shared/iconselector.cpp b/tools/designer/src/lib/shared/iconselector.cpp index 02a3dee..302a077 100644 --- a/tools/designer/src/lib/shared/iconselector.cpp +++ b/tools/designer/src/lib/shared/iconselector.cpp @@ -157,7 +157,6 @@ LanguageResourceDialog::LanguageResourceDialog(QDesignerResourceBrowserInterface LanguageResourceDialog::~LanguageResourceDialog() { - delete d_ptr; } void LanguageResourceDialog::setCurrentPath(const QString &filePath) @@ -427,9 +426,8 @@ void IconSelectorPrivate::slotResetAllActivated() // ------------- IconSelector IconSelector::IconSelector(QWidget *parent) : - QWidget(parent) + QWidget(parent), d_ptr(new IconSelectorPrivate()) { - d_ptr = new IconSelectorPrivate(); d_ptr->q_ptr = this; d_ptr->m_stateComboBox = new QComboBox(this); @@ -500,7 +498,6 @@ IconSelector::IconSelector(QWidget *parent) : IconSelector::~IconSelector() { - delete d_ptr; } void IconSelector::setIcon(const PropertySheetIconValue &icon) diff --git a/tools/designer/src/lib/shared/iconselector_p.h b/tools/designer/src/lib/shared/iconselector_p.h index 6b70cd2..de4c54f 100644 --- a/tools/designer/src/lib/shared/iconselector_p.h +++ b/tools/designer/src/lib/shared/iconselector_p.h @@ -87,7 +87,7 @@ public: QString currentPath() const; private: - class LanguageResourceDialogPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(LanguageResourceDialog) Q_DISABLE_COPY(LanguageResourceDialog) Q_PRIVATE_SLOT(d_func(), void slotAccepted()) @@ -120,7 +120,7 @@ public: signals: void iconChanged(const PropertySheetIconValue &icon); private: - class IconSelectorPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(IconSelector) Q_DISABLE_COPY(IconSelector) diff --git a/tools/designer/src/lib/shared/qtresourceeditordialog.cpp b/tools/designer/src/lib/shared/qtresourceeditordialog.cpp index adddf72..bd6be95 100644 --- a/tools/designer/src/lib/shared/qtresourceeditordialog.cpp +++ b/tools/designer/src/lib/shared/qtresourceeditordialog.cpp @@ -1949,9 +1949,8 @@ bool QtResourceEditorDialogPrivate::saveQrcFile(const QtQrcFileData &qrcFileData } QtResourceEditorDialog::QtResourceEditorDialog(QDesignerFormEditorInterface *core, QDesignerDialogGuiInterface *dlgGui, QWidget *parent) - : QDialog(parent) + : QDialog(parent), d_ptr(new QtResourceEditorDialogPrivate()) { - d_ptr = new QtResourceEditorDialogPrivate(); d_ptr->q_ptr = this; d_ptr->m_ui.setupUi(this); d_ptr->m_qrcManager = new QtQrcManager(this); @@ -2085,8 +2084,6 @@ QtResourceEditorDialog::~QtResourceEditorDialog() settings->setValue(QLatin1String(SplitterPosition), d_ptr->m_ui.splitter->saveState()); settings->setValue(QLatin1String(Geometry), geometry()); settings->endGroup(); - - delete d_ptr; } QtResourceModel *QtResourceEditorDialog::model() const diff --git a/tools/designer/src/lib/shared/qtresourceeditordialog_p.h b/tools/designer/src/lib/shared/qtresourceeditordialog_p.h index f2531d9..aa768e9 100644 --- a/tools/designer/src/lib/shared/qtresourceeditordialog_p.h +++ b/tools/designer/src/lib/shared/qtresourceeditordialog_p.h @@ -53,6 +53,7 @@ #ifndef QTRESOURCEEDITOR_H #define QTRESOURCEEDITOR_H +#include #include QT_BEGIN_NAMESPACE @@ -83,7 +84,7 @@ private: QtResourceEditorDialog(QDesignerFormEditorInterface *core, QDesignerDialogGuiInterface *dlgGui, QWidget *parent = 0); ~QtResourceEditorDialog(); - class QtResourceEditorDialogPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtResourceEditorDialog) Q_DISABLE_COPY(QtResourceEditorDialog) diff --git a/tools/designer/src/lib/shared/qtresourcemodel.cpp b/tools/designer/src/lib/shared/qtresourcemodel.cpp index e6152be..89615c8 100644 --- a/tools/designer/src/lib/shared/qtresourcemodel.cpp +++ b/tools/designer/src/lib/shared/qtresourcemodel.cpp @@ -141,7 +141,6 @@ QtResourceSet::QtResourceSet(QtResourceModel *model) : QtResourceSet::~QtResourceSet() { - delete d_ptr; } QStringList QtResourceSet::activeQrcPaths() const @@ -489,7 +488,6 @@ QtResourceModel::~QtResourceModel() while (it.hasNext()) removeResourceSet(it.next()); blockSignals(false); - delete d_ptr; } QStringList QtResourceModel::loadedQrcFiles() const diff --git a/tools/designer/src/lib/shared/qtresourcemodel_p.h b/tools/designer/src/lib/shared/qtresourcemodel_p.h index 726db29..61d6763 100644 --- a/tools/designer/src/lib/shared/qtresourcemodel_p.h +++ b/tools/designer/src/lib/shared/qtresourcemodel_p.h @@ -56,6 +56,7 @@ #include "shared_global_p.h" #include #include +#include QT_BEGIN_NAMESPACE @@ -87,7 +88,7 @@ private: ~QtResourceSet(); friend class QtResourceModel; - class QtResourceSetPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtResourceSet) Q_DISABLE_COPY(QtResourceSet) }; @@ -132,7 +133,7 @@ signals: private: friend class QtResourceSet; - class QtResourceModelPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtResourceModel) Q_DISABLE_COPY(QtResourceModel) diff --git a/tools/designer/src/lib/shared/qtresourceview.cpp b/tools/designer/src/lib/shared/qtresourceview.cpp index d956491..22439a2 100644 --- a/tools/designer/src/lib/shared/qtresourceview.cpp +++ b/tools/designer/src/lib/shared/qtresourceview.cpp @@ -499,8 +499,6 @@ QtResourceView::~QtResourceView() { if (!d_ptr->m_settingsKey.isEmpty()) d_ptr->saveSettings(); - - delete d_ptr; } bool QtResourceView::event(QEvent *event) @@ -737,8 +735,6 @@ QtResourceViewDialog::~QtResourceViewDialog() settings->setValue(QLatin1String(Geometry), geometry()); settings->endGroup(); - - delete d_ptr; } QString QtResourceViewDialog::selectedResource() const diff --git a/tools/designer/src/lib/shared/qtresourceview_p.h b/tools/designer/src/lib/shared/qtresourceview_p.h index 33162c5..1d3a1b0 100644 --- a/tools/designer/src/lib/shared/qtresourceview_p.h +++ b/tools/designer/src/lib/shared/qtresourceview_p.h @@ -102,7 +102,7 @@ protected: private: - class QtResourceViewPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtResourceView) Q_DISABLE_COPY(QtResourceView) Q_PRIVATE_SLOT(d_func(), void slotResourceSetActivated(QtResourceSet *)) @@ -129,7 +129,7 @@ public: void setResourceEditingEnabled(bool enable); private: - class QtResourceViewDialogPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtResourceViewDialog) Q_DISABLE_COPY(QtResourceViewDialog) Q_PRIVATE_SLOT(d_func(), void slotResourceSelected(const QString &)) diff --git a/tools/designer/src/uitools/quiloader.cpp b/tools/designer/src/uitools/quiloader.cpp index 2a66095..9e904d4 100644 --- a/tools/designer/src/uitools/quiloader.cpp +++ b/tools/designer/src/uitools/quiloader.cpp @@ -648,7 +648,6 @@ QUiLoader::QUiLoader(QObject *parent) */ QUiLoader::~QUiLoader() { - delete d_ptr; } /*! diff --git a/tools/designer/src/uitools/quiloader.h b/tools/designer/src/uitools/quiloader.h index 6543ba8..90403bf 100644 --- a/tools/designer/src/uitools/quiloader.h +++ b/tools/designer/src/uitools/quiloader.h @@ -43,6 +43,7 @@ #define QUILOADER_H #include +#include QT_BEGIN_HEADER @@ -90,7 +91,7 @@ public: bool isTranslationEnabled() const; private: - QUiLoaderPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QUiLoader) Q_DISABLE_COPY(QUiLoader) }; diff --git a/tools/shared/qtgradienteditor/qtcolorbutton.cpp b/tools/shared/qtgradienteditor/qtcolorbutton.cpp index 6926f60..49581bd 100644 --- a/tools/shared/qtgradienteditor/qtcolorbutton.cpp +++ b/tools/shared/qtgradienteditor/qtcolorbutton.cpp @@ -121,9 +121,8 @@ QPixmap QtColorButtonPrivate::generatePixmap() const /////////////// QtColorButton::QtColorButton(QWidget *parent) - : QToolButton(parent) + : QToolButton(parent), d_ptr(new QtColorButtonPrivate) { - d_ptr = new QtColorButtonPrivate; d_ptr->q_ptr = this; d_ptr->m_dragging = false; d_ptr->m_backgroundCheckered = true; @@ -136,7 +135,6 @@ QtColorButton::QtColorButton(QWidget *parent) QtColorButton::~QtColorButton() { - delete d_ptr; } void QtColorButton::setColor(const QColor &color) diff --git a/tools/shared/qtgradienteditor/qtcolorbutton.h b/tools/shared/qtgradienteditor/qtcolorbutton.h index fb91452..9e4f357 100644 --- a/tools/shared/qtgradienteditor/qtcolorbutton.h +++ b/tools/shared/qtgradienteditor/qtcolorbutton.h @@ -75,7 +75,7 @@ protected: void dropEvent(QDropEvent *event); #endif private: - class QtColorButtonPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtColorButton) Q_DISABLE_COPY(QtColorButton) Q_PRIVATE_SLOT(d_func(), void slotEditColor()) diff --git a/tools/shared/qtgradienteditor/qtcolorline.cpp b/tools/shared/qtgradienteditor/qtcolorline.cpp index 337726c..b0b0ee0 100644 --- a/tools/shared/qtgradienteditor/qtcolorline.cpp +++ b/tools/shared/qtgradienteditor/qtcolorline.cpp @@ -999,9 +999,8 @@ void QtColorLinePrivate::mouseDoubleClickEvent(QMouseEvent *event) //////////////////////////////////////////////////// QtColorLine::QtColorLine(QWidget *parent) - : QWidget(parent) + : QWidget(parent), d_ptr(new QtColorLinePrivate) { - d_ptr = new QtColorLinePrivate; d_ptr->q_ptr = this; setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); @@ -1009,7 +1008,6 @@ QtColorLine::QtColorLine(QWidget *parent) QtColorLine::~QtColorLine() { - delete d_ptr; } QSize QtColorLine::minimumSizeHint() const diff --git a/tools/shared/qtgradienteditor/qtcolorline.h b/tools/shared/qtgradienteditor/qtcolorline.h index d5535b1..16169d1 100644 --- a/tools/shared/qtgradienteditor/qtcolorline.h +++ b/tools/shared/qtgradienteditor/qtcolorline.h @@ -114,7 +114,7 @@ protected: private: - class QtColorLinePrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtColorLine) Q_DISABLE_COPY(QtColorLine) }; diff --git a/tools/shared/qtgradienteditor/qtgradientdialog.cpp b/tools/shared/qtgradienteditor/qtgradientdialog.cpp index 032cb16..001709c 100644 --- a/tools/shared/qtgradienteditor/qtgradientdialog.cpp +++ b/tools/shared/qtgradienteditor/qtgradientdialog.cpp @@ -200,10 +200,9 @@ void QtGradientDialogPrivate::slotAboutToShowDetails(bool details, int extension */ QtGradientDialog::QtGradientDialog(QWidget *parent) - : QDialog(parent) + : QDialog(parent), d_ptr(new QtGradientDialogPrivate()) { // setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); - d_ptr = new QtGradientDialogPrivate(); d_ptr->q_ptr = this; d_ptr->m_ui.setupUi(this); QPushButton *button = d_ptr->m_ui.buttonBox->button(QDialogButtonBox::Ok); @@ -222,7 +221,6 @@ QtGradientDialog::QtGradientDialog(QWidget *parent) QtGradientDialog::~QtGradientDialog() { - delete d_ptr; } /*! diff --git a/tools/shared/qtgradienteditor/qtgradientdialog.h b/tools/shared/qtgradienteditor/qtgradientdialog.h index d3bafc9..819ad21 100644 --- a/tools/shared/qtgradienteditor/qtgradientdialog.h +++ b/tools/shared/qtgradienteditor/qtgradientdialog.h @@ -76,7 +76,7 @@ public: static QGradient getGradient(bool *ok, QWidget *parent = 0, const QString &caption = QString()); private: - class QtGradientDialogPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtGradientDialog) Q_DISABLE_COPY(QtGradientDialog) Q_PRIVATE_SLOT(d_func(), void slotAboutToShowDetails(bool details, int extensionWidthHint)) diff --git a/tools/shared/qtgradienteditor/qtgradienteditor.cpp b/tools/shared/qtgradienteditor/qtgradienteditor.cpp index 9eca9d8..0a7eee0 100644 --- a/tools/shared/qtgradienteditor/qtgradienteditor.cpp +++ b/tools/shared/qtgradienteditor/qtgradienteditor.cpp @@ -727,9 +727,8 @@ void QtGradientEditorPrivate::setAngleConical(qreal angle) } QtGradientEditor::QtGradientEditor(QWidget *parent) - : QWidget(parent) + : QWidget(parent), d_ptr(new QtGradientEditorPrivate()) { - d_ptr = new QtGradientEditorPrivate(); d_ptr->q_ptr = this; d_ptr->m_type = QGradient::RadialGradient; d_ptr->m_ui.setupUi(this); @@ -835,7 +834,6 @@ QtGradientEditor::~QtGradientEditor() { if (d_ptr->m_hiddenWidget) delete d_ptr->m_hiddenWidget; - delete d_ptr; } void QtGradientEditor::setGradient(const QGradient &grad) diff --git a/tools/shared/qtgradienteditor/qtgradienteditor.h b/tools/shared/qtgradienteditor/qtgradienteditor.h index 9974065..7dc75195 100644 --- a/tools/shared/qtgradienteditor/qtgradienteditor.h +++ b/tools/shared/qtgradienteditor/qtgradienteditor.h @@ -78,7 +78,7 @@ signals: void aboutToShowDetails(bool details, int extenstionWidthHint); private: - class QtGradientEditorPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtGradientEditor) Q_DISABLE_COPY(QtGradientEditor) Q_PRIVATE_SLOT(d_func(), void slotGradientStopsChanged(const QGradientStops &stops)) diff --git a/tools/shared/qtgradienteditor/qtgradientstopscontroller.cpp b/tools/shared/qtgradienteditor/qtgradientstopscontroller.cpp index cbc53db..0e9521c 100644 --- a/tools/shared/qtgradienteditor/qtgradientstopscontroller.cpp +++ b/tools/shared/qtgradienteditor/qtgradientstopscontroller.cpp @@ -594,9 +594,8 @@ void QtGradientStopsControllerPrivate::slotZoomChanged(double zoom) } QtGradientStopsController::QtGradientStopsController(QObject *parent) - : QObject(parent) + : QObject(parent), d_ptr(new QtGradientStopsControllerPrivate()) { - d_ptr = new QtGradientStopsControllerPrivate(); d_ptr->q_ptr = this; d_ptr->m_spec = QColor::Hsv; @@ -675,7 +674,6 @@ void QtGradientStopsController::setUi(Ui::QtGradientEditor *ui) QtGradientStopsController::~QtGradientStopsController() { - delete d_ptr; } void QtGradientStopsController::setGradientStops(const QGradientStops &stops) diff --git a/tools/shared/qtgradienteditor/qtgradientstopscontroller.h b/tools/shared/qtgradienteditor/qtgradientstopscontroller.h index 9f16fb0..37f2e01 100644 --- a/tools/shared/qtgradienteditor/qtgradientstopscontroller.h +++ b/tools/shared/qtgradienteditor/qtgradientstopscontroller.h @@ -70,7 +70,7 @@ signals: void gradientStopsChanged(const QGradientStops &stops); private: - class QtGradientStopsControllerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtGradientStopsController) Q_DISABLE_COPY(QtGradientStopsController) Q_PRIVATE_SLOT(d_func(), void slotHsvClicked()) diff --git a/tools/shared/qtgradienteditor/qtgradientstopsmodel.cpp b/tools/shared/qtgradienteditor/qtgradientstopsmodel.cpp index a632c0f..6260870 100644 --- a/tools/shared/qtgradienteditor/qtgradientstopsmodel.cpp +++ b/tools/shared/qtgradienteditor/qtgradientstopsmodel.cpp @@ -78,8 +78,8 @@ void QtGradientStop::setPosition(qreal position) } QtGradientStop::QtGradientStop(QtGradientStopsModel *model) + : d_ptr(new QtGradientStopPrivate()) { - d_ptr = new QtGradientStopPrivate(); d_ptr->m_position = 0; d_ptr->m_color = Qt::white; d_ptr->m_model = model; @@ -87,7 +87,6 @@ QtGradientStop::QtGradientStop(QtGradientStopsModel *model) QtGradientStop::~QtGradientStop() { - delete d_ptr; } class QtGradientStopsModelPrivate @@ -104,9 +103,8 @@ public: QtGradientStopsModel::QtGradientStopsModel(QObject *parent) - : QObject(parent) + : QObject(parent), d_ptr(new QtGradientStopsModelPrivate) { - d_ptr = new QtGradientStopsModelPrivate; d_ptr->q_ptr = this; d_ptr->m_current = 0; } @@ -114,7 +112,6 @@ QtGradientStopsModel::QtGradientStopsModel(QObject *parent) QtGradientStopsModel::~QtGradientStopsModel() { clear(); - delete d_ptr; } QtGradientStopsModel::PositionStopMap QtGradientStopsModel::stops() const diff --git a/tools/shared/qtgradienteditor/qtgradientstopsmodel.h b/tools/shared/qtgradienteditor/qtgradientstopsmodel.h index d4e6b3c..2c04c8f 100644 --- a/tools/shared/qtgradienteditor/qtgradientstopsmodel.h +++ b/tools/shared/qtgradienteditor/qtgradientstopsmodel.h @@ -64,7 +64,7 @@ private: friend class QtGradientStopsModel; QtGradientStop(QtGradientStopsModel *model = 0); ~QtGradientStop(); - class QtGradientStopPrivate *d_ptr; + QScopedPointer d_ptr; }; class QtGradientStopsModel : public QObject @@ -111,7 +111,7 @@ signals: void currentStopChanged(QtGradientStop *stop); private: - class QtGradientStopsModelPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtGradientStopsModel) Q_DISABLE_COPY(QtGradientStopsModel) }; diff --git a/tools/shared/qtgradienteditor/qtgradientstopswidget.cpp b/tools/shared/qtgradienteditor/qtgradientstopswidget.cpp index adaf57d..570bd6f 100644 --- a/tools/shared/qtgradienteditor/qtgradientstopswidget.cpp +++ b/tools/shared/qtgradienteditor/qtgradientstopswidget.cpp @@ -360,9 +360,8 @@ void QtGradientStopsWidgetPrivate::slotResetZoom() } QtGradientStopsWidget::QtGradientStopsWidget(QWidget *parent) - : QAbstractScrollArea(parent) + : QAbstractScrollArea(parent), d_ptr(new QtGradientStopsWidgetPrivate) { - d_ptr = new QtGradientStopsWidgetPrivate; d_ptr->q_ptr = this; d_ptr->m_backgroundCheckered = true; d_ptr->m_model = 0; @@ -391,7 +390,6 @@ QtGradientStopsWidget::QtGradientStopsWidget(QWidget *parent) QtGradientStopsWidget::~QtGradientStopsWidget() { - delete d_ptr; } QSize QtGradientStopsWidget::sizeHint() const diff --git a/tools/shared/qtgradienteditor/qtgradientstopswidget.h b/tools/shared/qtgradienteditor/qtgradientstopswidget.h index aafea8b..79d6576 100644 --- a/tools/shared/qtgradienteditor/qtgradientstopswidget.h +++ b/tools/shared/qtgradienteditor/qtgradientstopswidget.h @@ -91,7 +91,7 @@ protected: #endif private: - QtGradientStopsWidgetPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtGradientStopsWidget) Q_DISABLE_COPY(QtGradientStopsWidget) Q_PRIVATE_SLOT(d_func(), void slotStopAdded(QtGradientStop *stop)) diff --git a/tools/shared/qtgradienteditor/qtgradientwidget.cpp b/tools/shared/qtgradienteditor/qtgradientwidget.cpp index 3f6b48d..4b70cc2 100644 --- a/tools/shared/qtgradienteditor/qtgradientwidget.cpp +++ b/tools/shared/qtgradienteditor/qtgradientwidget.cpp @@ -232,9 +232,8 @@ void QtGradientWidgetPrivate::setupDrag(QtGradientStop *stop, int x) //////////////////////////// QtGradientWidget::QtGradientWidget(QWidget *parent) - : QWidget(parent) + : QWidget(parent), d_ptr(new QtGradientWidgetPrivate) { - d_ptr = new QtGradientWidgetPrivate; d_ptr->q_ptr = this; d_ptr->m_backgroundCheckered = true; d_ptr->m_handleSize = 20.0; @@ -253,7 +252,6 @@ QtGradientWidget::QtGradientWidget(QWidget *parent) QtGradientWidget::~QtGradientWidget() { - delete d_ptr; } QSize QtGradientWidget::sizeHint() const diff --git a/tools/shared/qtgradienteditor/qtgradientwidget.h b/tools/shared/qtgradienteditor/qtgradientwidget.h index 4dc740b..d994534 100644 --- a/tools/shared/qtgradienteditor/qtgradientwidget.h +++ b/tools/shared/qtgradienteditor/qtgradientwidget.h @@ -110,7 +110,7 @@ protected: void mouseDoubleClickEvent(QMouseEvent *e); private: - class QtGradientWidgetPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtGradientWidget) Q_DISABLE_COPY(QtGradientWidget) }; diff --git a/tools/shared/qtpropertybrowser/qtbuttonpropertybrowser.cpp b/tools/shared/qtpropertybrowser/qtbuttonpropertybrowser.cpp index 09394e7..3ccc423 100644 --- a/tools/shared/qtpropertybrowser/qtbuttonpropertybrowser.cpp +++ b/tools/shared/qtpropertybrowser/qtbuttonpropertybrowser.cpp @@ -547,9 +547,8 @@ void QtButtonPropertyBrowserPrivate::updateItem(WidgetItem *item) Creates a property browser with the given \a parent. */ QtButtonPropertyBrowser::QtButtonPropertyBrowser(QWidget *parent) - : QtAbstractPropertyBrowser(parent) + : QtAbstractPropertyBrowser(parent), d_ptr(new QtButtonPropertyBrowserPrivate) { - d_ptr = new QtButtonPropertyBrowserPrivate; d_ptr->q_ptr = this; d_ptr->init(this); @@ -570,7 +569,6 @@ QtButtonPropertyBrowser::~QtButtonPropertyBrowser() const QMap::ConstIterator icend = d_ptr->m_itemToIndex.constEnd(); for (QMap::ConstIterator it = d_ptr->m_itemToIndex.constBegin(); it != icend; ++it) delete it.key(); - delete d_ptr; } /*! diff --git a/tools/shared/qtpropertybrowser/qtbuttonpropertybrowser.h b/tools/shared/qtpropertybrowser/qtbuttonpropertybrowser.h index 0238f5c..bac9d95 100644 --- a/tools/shared/qtpropertybrowser/qtbuttonpropertybrowser.h +++ b/tools/shared/qtpropertybrowser/qtbuttonpropertybrowser.h @@ -71,7 +71,7 @@ protected: private: - QtButtonPropertyBrowserPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtButtonPropertyBrowser) Q_DISABLE_COPY(QtButtonPropertyBrowser) Q_PRIVATE_SLOT(d_func(), void slotUpdate()) diff --git a/tools/shared/qtpropertybrowser/qteditorfactory.cpp b/tools/shared/qtpropertybrowser/qteditorfactory.cpp index a2e3917..01d955a 100644 --- a/tools/shared/qtpropertybrowser/qteditorfactory.cpp +++ b/tools/shared/qtpropertybrowser/qteditorfactory.cpp @@ -227,9 +227,8 @@ void QtSpinBoxFactoryPrivate::slotSetValue(int value) Creates a factory with the given \a parent. */ QtSpinBoxFactory::QtSpinBoxFactory(QObject *parent) - : QtAbstractEditorFactory(parent) + : QtAbstractEditorFactory(parent), d_ptr(new QtSpinBoxFactoryPrivate()) { - d_ptr = new QtSpinBoxFactoryPrivate(); d_ptr->q_ptr = this; } @@ -240,7 +239,6 @@ QtSpinBoxFactory::QtSpinBoxFactory(QObject *parent) QtSpinBoxFactory::~QtSpinBoxFactory() { qDeleteAll(d_ptr->m_editorToProperty.keys()); - delete d_ptr; } /*! @@ -383,9 +381,8 @@ void QtSliderFactoryPrivate::slotSetValue(int value) Creates a factory with the given \a parent. */ QtSliderFactory::QtSliderFactory(QObject *parent) - : QtAbstractEditorFactory(parent) + : QtAbstractEditorFactory(parent), d_ptr(new QtSliderFactoryPrivate()) { - d_ptr = new QtSliderFactoryPrivate(); d_ptr->q_ptr = this; } @@ -396,7 +393,6 @@ QtSliderFactory::QtSliderFactory(QObject *parent) QtSliderFactory::~QtSliderFactory() { qDeleteAll(d_ptr->m_editorToProperty.keys()); - delete d_ptr; } /*! @@ -539,9 +535,8 @@ void QtScrollBarFactoryPrivate::slotSetValue(int value) Creates a factory with the given \a parent. */ QtScrollBarFactory::QtScrollBarFactory(QObject *parent) - : QtAbstractEditorFactory(parent) + : QtAbstractEditorFactory(parent), d_ptr(new QtScrollBarFactoryPrivate()) { - d_ptr = new QtScrollBarFactoryPrivate(); d_ptr->q_ptr = this; } @@ -552,7 +547,6 @@ QtScrollBarFactory::QtScrollBarFactory(QObject *parent) QtScrollBarFactory::~QtScrollBarFactory() { qDeleteAll(d_ptr->m_editorToProperty.keys()); - delete d_ptr; } /*! @@ -661,9 +655,8 @@ void QtCheckBoxFactoryPrivate::slotSetValue(bool value) Creates a factory with the given \a parent. */ QtCheckBoxFactory::QtCheckBoxFactory(QObject *parent) - : QtAbstractEditorFactory(parent) + : QtAbstractEditorFactory(parent), d_ptr(new QtCheckBoxFactoryPrivate()) { - d_ptr = new QtCheckBoxFactoryPrivate(); d_ptr->q_ptr = this; } @@ -674,7 +667,6 @@ QtCheckBoxFactory::QtCheckBoxFactory(QObject *parent) QtCheckBoxFactory::~QtCheckBoxFactory() { qDeleteAll(d_ptr->m_editorToProperty.keys()); - delete d_ptr; } /*! @@ -836,9 +828,8 @@ void QtDoubleSpinBoxFactoryPrivate::slotSetValue(double value) Creates a factory with the given \a parent. */ QtDoubleSpinBoxFactory::QtDoubleSpinBoxFactory(QObject *parent) - : QtAbstractEditorFactory(parent) + : QtAbstractEditorFactory(parent), d_ptr(new QtDoubleSpinBoxFactoryPrivate()) { - d_ptr = new QtDoubleSpinBoxFactoryPrivate(); d_ptr->q_ptr = this; } @@ -849,7 +840,6 @@ QtDoubleSpinBoxFactory::QtDoubleSpinBoxFactory(QObject *parent) QtDoubleSpinBoxFactory::~QtDoubleSpinBoxFactory() { qDeleteAll(d_ptr->m_editorToProperty.keys()); - delete d_ptr; } /*! @@ -991,9 +981,8 @@ void QtLineEditFactoryPrivate::slotSetValue(const QString &value) Creates a factory with the given \a parent. */ QtLineEditFactory::QtLineEditFactory(QObject *parent) - : QtAbstractEditorFactory(parent) + : QtAbstractEditorFactory(parent), d_ptr(new QtLineEditFactoryPrivate()) { - d_ptr = new QtLineEditFactoryPrivate(); d_ptr->q_ptr = this; } @@ -1004,7 +993,6 @@ QtLineEditFactory::QtLineEditFactory(QObject *parent) QtLineEditFactory::~QtLineEditFactory() { qDeleteAll(d_ptr->m_editorToProperty.keys()); - delete d_ptr; } /*! @@ -1134,9 +1122,8 @@ void QtDateEditFactoryPrivate::slotSetValue(const QDate &value) Creates a factory with the given \a parent. */ QtDateEditFactory::QtDateEditFactory(QObject *parent) - : QtAbstractEditorFactory(parent) + : QtAbstractEditorFactory(parent), d_ptr(new QtDateEditFactoryPrivate()) { - d_ptr = new QtDateEditFactoryPrivate(); d_ptr->q_ptr = this; } @@ -1147,7 +1134,6 @@ QtDateEditFactory::QtDateEditFactory(QObject *parent) QtDateEditFactory::~QtDateEditFactory() { qDeleteAll(d_ptr->m_editorToProperty.keys()); - delete d_ptr; } /*! @@ -1252,9 +1238,8 @@ void QtTimeEditFactoryPrivate::slotSetValue(const QTime &value) Creates a factory with the given \a parent. */ QtTimeEditFactory::QtTimeEditFactory(QObject *parent) - : QtAbstractEditorFactory(parent) + : QtAbstractEditorFactory(parent), d_ptr(new QtTimeEditFactoryPrivate()) { - d_ptr = new QtTimeEditFactoryPrivate(); d_ptr->q_ptr = this; } @@ -1265,7 +1250,6 @@ QtTimeEditFactory::QtTimeEditFactory(QObject *parent) QtTimeEditFactory::~QtTimeEditFactory() { qDeleteAll(d_ptr->m_editorToProperty.keys()); - delete d_ptr; } /*! @@ -1367,9 +1351,8 @@ void QtDateTimeEditFactoryPrivate::slotSetValue(const QDateTime &value) Creates a factory with the given \a parent. */ QtDateTimeEditFactory::QtDateTimeEditFactory(QObject *parent) - : QtAbstractEditorFactory(parent) + : QtAbstractEditorFactory(parent), d_ptr(new QtDateTimeEditFactoryPrivate()) { - d_ptr = new QtDateTimeEditFactoryPrivate(); d_ptr->q_ptr = this; } @@ -1380,7 +1363,6 @@ QtDateTimeEditFactory::QtDateTimeEditFactory(QObject *parent) QtDateTimeEditFactory::~QtDateTimeEditFactory() { qDeleteAll(d_ptr->m_editorToProperty.keys()); - delete d_ptr; } /*! @@ -1481,9 +1463,8 @@ void QtKeySequenceEditorFactoryPrivate::slotSetValue(const QKeySequence &value) Creates a factory with the given \a parent. */ QtKeySequenceEditorFactory::QtKeySequenceEditorFactory(QObject *parent) - : QtAbstractEditorFactory(parent) + : QtAbstractEditorFactory(parent), d_ptr(new QtKeySequenceEditorFactoryPrivate()) { - d_ptr = new QtKeySequenceEditorFactoryPrivate(); d_ptr->q_ptr = this; } @@ -1494,7 +1475,6 @@ QtKeySequenceEditorFactory::QtKeySequenceEditorFactory(QObject *parent) QtKeySequenceEditorFactory::~QtKeySequenceEditorFactory() { qDeleteAll(d_ptr->m_editorToProperty.keys()); - delete d_ptr; } /*! @@ -1765,9 +1745,8 @@ void QtCharEditorFactoryPrivate::slotSetValue(const QChar &value) Creates a factory with the given \a parent. */ QtCharEditorFactory::QtCharEditorFactory(QObject *parent) - : QtAbstractEditorFactory(parent) + : QtAbstractEditorFactory(parent), d_ptr(new QtCharEditorFactoryPrivate()) { - d_ptr = new QtCharEditorFactoryPrivate(); d_ptr->q_ptr = this; } @@ -1778,7 +1757,6 @@ QtCharEditorFactory::QtCharEditorFactory(QObject *parent) QtCharEditorFactory::~QtCharEditorFactory() { qDeleteAll(d_ptr->m_editorToProperty.keys()); - delete d_ptr; } /*! @@ -1929,9 +1907,8 @@ void QtEnumEditorFactoryPrivate::slotSetValue(int value) Creates a factory with the given \a parent. */ QtEnumEditorFactory::QtEnumEditorFactory(QObject *parent) - : QtAbstractEditorFactory(parent) + : QtAbstractEditorFactory(parent), d_ptr(new QtEnumEditorFactoryPrivate()) { - d_ptr = new QtEnumEditorFactoryPrivate(); d_ptr->q_ptr = this; } @@ -1942,7 +1919,6 @@ QtEnumEditorFactory::QtEnumEditorFactory(QObject *parent) QtEnumEditorFactory::~QtEnumEditorFactory() { qDeleteAll(d_ptr->m_editorToProperty.keys()); - delete d_ptr; } /*! @@ -2094,9 +2070,8 @@ void QtCursorEditorFactoryPrivate::slotEditorDestroyed(QObject *object) Creates a factory with the given \a parent. */ QtCursorEditorFactory::QtCursorEditorFactory(QObject *parent) - : QtAbstractEditorFactory(parent) + : QtAbstractEditorFactory(parent), d_ptr(new QtCursorEditorFactoryPrivate()) { - d_ptr = new QtCursorEditorFactoryPrivate(); d_ptr->q_ptr = this; d_ptr->m_enumEditorFactory = new QtEnumEditorFactory(this); @@ -2111,7 +2086,6 @@ QtCursorEditorFactory::QtCursorEditorFactory(QObject *parent) */ QtCursorEditorFactory::~QtCursorEditorFactory() { - delete d_ptr; } /*! @@ -2328,7 +2302,6 @@ QtColorEditorFactory::QtColorEditorFactory(QObject *parent) : QtColorEditorFactory::~QtColorEditorFactory() { qDeleteAll(d_ptr->m_editorToProperty.keys()); - delete d_ptr; } /*! @@ -2542,7 +2515,6 @@ QtFontEditorFactory::QtFontEditorFactory(QObject *parent) : QtFontEditorFactory::~QtFontEditorFactory() { qDeleteAll(d_ptr->m_editorToProperty.keys()); - delete d_ptr; } /*! diff --git a/tools/shared/qtpropertybrowser/qteditorfactory.h b/tools/shared/qtpropertybrowser/qteditorfactory.h index d86f9f6..f5a1605 100644 --- a/tools/shared/qtpropertybrowser/qteditorfactory.h +++ b/tools/shared/qtpropertybrowser/qteditorfactory.h @@ -60,7 +60,7 @@ protected: QWidget *parent); void disconnectPropertyManager(QtIntPropertyManager *manager); private: - QtSpinBoxFactoryPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtSpinBoxFactory) Q_DISABLE_COPY(QtSpinBoxFactory) Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, int)) @@ -84,7 +84,7 @@ protected: QWidget *parent); void disconnectPropertyManager(QtIntPropertyManager *manager); private: - QtSliderFactoryPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtSliderFactory) Q_DISABLE_COPY(QtSliderFactory) Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, int)) @@ -108,7 +108,7 @@ protected: QWidget *parent); void disconnectPropertyManager(QtIntPropertyManager *manager); private: - QtScrollBarFactoryPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtScrollBarFactory) Q_DISABLE_COPY(QtScrollBarFactory) Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, int)) @@ -132,7 +132,7 @@ protected: QWidget *parent); void disconnectPropertyManager(QtBoolPropertyManager *manager); private: - QtCheckBoxFactoryPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtCheckBoxFactory) Q_DISABLE_COPY(QtCheckBoxFactory) Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, bool)) @@ -154,7 +154,7 @@ protected: QWidget *parent); void disconnectPropertyManager(QtDoublePropertyManager *manager); private: - QtDoubleSpinBoxFactoryPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtDoubleSpinBoxFactory) Q_DISABLE_COPY(QtDoubleSpinBoxFactory) Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, double)) @@ -179,7 +179,7 @@ protected: QWidget *parent); void disconnectPropertyManager(QtStringPropertyManager *manager); private: - QtLineEditFactoryPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtLineEditFactory) Q_DISABLE_COPY(QtLineEditFactory) Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QString &)) @@ -202,7 +202,7 @@ protected: QWidget *parent); void disconnectPropertyManager(QtDatePropertyManager *manager); private: - QtDateEditFactoryPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtDateEditFactory) Q_DISABLE_COPY(QtDateEditFactory) Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QDate &)) @@ -226,7 +226,7 @@ protected: QWidget *parent); void disconnectPropertyManager(QtTimePropertyManager *manager); private: - QtTimeEditFactoryPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtTimeEditFactory) Q_DISABLE_COPY(QtTimeEditFactory) Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QTime &)) @@ -248,7 +248,7 @@ protected: QWidget *parent); void disconnectPropertyManager(QtDateTimePropertyManager *manager); private: - QtDateTimeEditFactoryPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtDateTimeEditFactory) Q_DISABLE_COPY(QtDateTimeEditFactory) Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QDateTime &)) @@ -270,7 +270,7 @@ protected: QWidget *parent); void disconnectPropertyManager(QtKeySequencePropertyManager *manager); private: - QtKeySequenceEditorFactoryPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtKeySequenceEditorFactory) Q_DISABLE_COPY(QtKeySequenceEditorFactory) Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QKeySequence &)) @@ -292,7 +292,7 @@ protected: QWidget *parent); void disconnectPropertyManager(QtCharPropertyManager *manager); private: - QtCharEditorFactoryPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtCharEditorFactory) Q_DISABLE_COPY(QtCharEditorFactory) Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QChar &)) @@ -314,7 +314,7 @@ protected: QWidget *parent); void disconnectPropertyManager(QtEnumPropertyManager *manager); private: - QtEnumEditorFactoryPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtEnumEditorFactory) Q_DISABLE_COPY(QtEnumEditorFactory) Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, int)) @@ -340,7 +340,7 @@ protected: QWidget *parent); void disconnectPropertyManager(QtCursorPropertyManager *manager); private: - QtCursorEditorFactoryPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtCursorEditorFactory) Q_DISABLE_COPY(QtCursorEditorFactory) Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QCursor &)) @@ -362,7 +362,7 @@ protected: QWidget *parent); void disconnectPropertyManager(QtColorPropertyManager *manager); private: - QtColorEditorFactoryPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtColorEditorFactory) Q_DISABLE_COPY(QtColorEditorFactory) Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QColor &)) @@ -384,7 +384,7 @@ protected: QWidget *parent); void disconnectPropertyManager(QtFontPropertyManager *manager); private: - QtFontEditorFactoryPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtFontEditorFactory) Q_DISABLE_COPY(QtFontEditorFactory) Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QFont &)) diff --git a/tools/shared/qtpropertybrowser/qtgroupboxpropertybrowser.cpp b/tools/shared/qtpropertybrowser/qtgroupboxpropertybrowser.cpp index 9ac9744..4b44f97 100644 --- a/tools/shared/qtpropertybrowser/qtgroupboxpropertybrowser.cpp +++ b/tools/shared/qtpropertybrowser/qtgroupboxpropertybrowser.cpp @@ -476,9 +476,8 @@ void QtGroupBoxPropertyBrowserPrivate::updateItem(WidgetItem *item) Creates a property browser with the given \a parent. */ QtGroupBoxPropertyBrowser::QtGroupBoxPropertyBrowser(QWidget *parent) - : QtAbstractPropertyBrowser(parent) + : QtAbstractPropertyBrowser(parent), d_ptr(new QtGroupBoxPropertyBrowserPrivate) { - d_ptr = new QtGroupBoxPropertyBrowserPrivate; d_ptr->q_ptr = this; d_ptr->init(this); @@ -499,7 +498,6 @@ QtGroupBoxPropertyBrowser::~QtGroupBoxPropertyBrowser() const QMap::ConstIterator icend = d_ptr->m_itemToIndex.constEnd(); for (QMap::ConstIterator it = d_ptr->m_itemToIndex.constBegin(); it != icend; ++it) delete it.key(); - delete d_ptr; } /*! diff --git a/tools/shared/qtpropertybrowser/qtgroupboxpropertybrowser.h b/tools/shared/qtpropertybrowser/qtgroupboxpropertybrowser.h index 6d1b2b1..6f48b8f 100644 --- a/tools/shared/qtpropertybrowser/qtgroupboxpropertybrowser.h +++ b/tools/shared/qtpropertybrowser/qtgroupboxpropertybrowser.h @@ -63,7 +63,7 @@ protected: private: - QtGroupBoxPropertyBrowserPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtGroupBoxPropertyBrowser) Q_DISABLE_COPY(QtGroupBoxPropertyBrowser) Q_PRIVATE_SLOT(d_func(), void slotUpdate()) diff --git a/tools/shared/qtpropertybrowser/qtpropertybrowser.cpp b/tools/shared/qtpropertybrowser/qtpropertybrowser.cpp index cca082d..0f4b197 100644 --- a/tools/shared/qtpropertybrowser/qtpropertybrowser.cpp +++ b/tools/shared/qtpropertybrowser/qtpropertybrowser.cpp @@ -142,8 +142,8 @@ public: \sa QtAbstractPropertyManager::addProperty() */ QtProperty::QtProperty(QtAbstractPropertyManager *manager) + : d_ptr(new QtPropertyPrivate(manager)) { - d_ptr = new QtPropertyPrivate(manager); d_ptr->q_ptr = this; } @@ -177,7 +177,6 @@ QtProperty::~QtProperty() QtProperty *property = itParent.next(); property->d_ptr->m_subItems.removeAll(this); } - delete d_ptr; } /*! @@ -638,9 +637,8 @@ void QtAbstractPropertyManagerPrivate::propertyInserted(QtProperty *property, Creates an abstract property manager with the given \a parent. */ QtAbstractPropertyManager::QtAbstractPropertyManager(QObject *parent) - : QObject(parent) + : QObject(parent), d_ptr(new QtAbstractPropertyManagerPrivate) { - d_ptr = new QtAbstractPropertyManagerPrivate; d_ptr->q_ptr = this; } @@ -652,7 +650,6 @@ QtAbstractPropertyManager::QtAbstractPropertyManager(QObject *parent) QtAbstractPropertyManager::~QtAbstractPropertyManager() { clear(); - delete d_ptr; } /*! @@ -1167,14 +1164,13 @@ QtAbstractPropertyBrowser *QtBrowserItem::browser() const } QtBrowserItem::QtBrowserItem(QtAbstractPropertyBrowser *browser, QtProperty *property, QtBrowserItem *parent) + : d_ptr(new QtBrowserItemPrivate(browser, property, parent)) { - d_ptr = new QtBrowserItemPrivate(browser, property, parent); d_ptr->q_ptr = this; } QtBrowserItem::~QtBrowserItem() { - delete d_ptr; } @@ -1646,9 +1642,8 @@ void QtAbstractPropertyBrowserPrivate::slotPropertyDataChanged(QtProperty *prope Creates an abstract property browser with the given \a parent. */ QtAbstractPropertyBrowser::QtAbstractPropertyBrowser(QWidget *parent) - : QWidget(parent) + : QWidget(parent), d_ptr(new QtAbstractPropertyBrowserPrivate) { - d_ptr = new QtAbstractPropertyBrowserPrivate; d_ptr->q_ptr = this; } @@ -1671,7 +1666,6 @@ QtAbstractPropertyBrowser::~QtAbstractPropertyBrowser() QListIterator itItem(indexes); while (itItem.hasNext()) d_ptr->clearIndex(itItem.next()); - delete d_ptr; } /*! diff --git a/tools/shared/qtpropertybrowser/qtpropertybrowser.h b/tools/shared/qtpropertybrowser/qtpropertybrowser.h index 20ffb81..5a878bb 100644 --- a/tools/shared/qtpropertybrowser/qtpropertybrowser.h +++ b/tools/shared/qtpropertybrowser/qtpropertybrowser.h @@ -85,7 +85,7 @@ protected: void propertyChanged(); private: friend class QtAbstractPropertyManager; - QtPropertyPrivate *d_ptr; + QScopedPointer d_ptr; }; class QtAbstractPropertyManagerPrivate; @@ -118,7 +118,7 @@ protected: virtual QtProperty *createProperty(); private: friend class QtProperty; - QtAbstractPropertyManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtAbstractPropertyManager) Q_DISABLE_COPY(QtAbstractPropertyManager) }; @@ -235,7 +235,7 @@ public: private: explicit QtBrowserItem(QtAbstractPropertyBrowser *browser, QtProperty *property, QtBrowserItem *parent); ~QtBrowserItem(); - QtBrowserItemPrivate *d_ptr; + QScopedPointer d_ptr; friend class QtAbstractPropertyBrowserPrivate; }; @@ -292,7 +292,7 @@ private: bool addFactory(QtAbstractPropertyManager *abstractManager, QtAbstractEditorFactoryBase *abstractFactory); - QtAbstractPropertyBrowserPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtAbstractPropertyBrowser) Q_DISABLE_COPY(QtAbstractPropertyBrowser) Q_PRIVATE_SLOT(d_func(), void slotPropertyInserted(QtProperty *, diff --git a/tools/shared/qtpropertybrowser/qtpropertymanager.cpp b/tools/shared/qtpropertybrowser/qtpropertymanager.cpp index 47b8c9b..df74b6e 100644 --- a/tools/shared/qtpropertybrowser/qtpropertymanager.cpp +++ b/tools/shared/qtpropertybrowser/qtpropertymanager.cpp @@ -677,9 +677,8 @@ public: Creates a manager with the given \a parent. */ QtIntPropertyManager::QtIntPropertyManager(QObject *parent) - : QtAbstractPropertyManager(parent) + : QtAbstractPropertyManager(parent), d_ptr(new QtIntPropertyManagerPrivate) { - d_ptr = new QtIntPropertyManagerPrivate; d_ptr->q_ptr = this; } @@ -689,7 +688,6 @@ QtIntPropertyManager::QtIntPropertyManager(QObject *parent) QtIntPropertyManager::~QtIntPropertyManager() { clear(); - delete d_ptr; } /*! @@ -762,7 +760,7 @@ QString QtIntPropertyManager::valueText(const QtProperty *property) const void QtIntPropertyManager::setValue(QtProperty *property, int val) { void (QtIntPropertyManagerPrivate::*setSubPropertyValue)(QtProperty *, int) = 0; - setValueInRange(this, d_ptr, + setValueInRange(this, d_ptr.data(), &QtIntPropertyManager::propertyChanged, &QtIntPropertyManager::valueChanged, property, val, setSubPropertyValue); @@ -779,7 +777,7 @@ void QtIntPropertyManager::setValue(QtProperty *property, int val) */ void QtIntPropertyManager::setMinimum(QtProperty *property, int minVal) { - setMinimumValue(this, d_ptr, + setMinimumValue(this, d_ptr.data(), &QtIntPropertyManager::propertyChanged, &QtIntPropertyManager::valueChanged, &QtIntPropertyManager::rangeChanged, @@ -797,7 +795,7 @@ void QtIntPropertyManager::setMinimum(QtProperty *property, int minVal) */ void QtIntPropertyManager::setMaximum(QtProperty *property, int maxVal) { - setMaximumValue(this, d_ptr, + setMaximumValue(this, d_ptr.data(), &QtIntPropertyManager::propertyChanged, &QtIntPropertyManager::valueChanged, &QtIntPropertyManager::rangeChanged, @@ -821,7 +819,7 @@ void QtIntPropertyManager::setMaximum(QtProperty *property, int maxVal) void QtIntPropertyManager::setRange(QtProperty *property, int minVal, int maxVal) { void (QtIntPropertyManagerPrivate::*setSubPropertyRange)(QtProperty *, int, int, int) = 0; - setBorderValues(this, d_ptr, + setBorderValues(this, d_ptr.data(), &QtIntPropertyManager::propertyChanged, &QtIntPropertyManager::valueChanged, &QtIntPropertyManager::rangeChanged, @@ -968,9 +966,8 @@ public: Creates a manager with the given \a parent. */ QtDoublePropertyManager::QtDoublePropertyManager(QObject *parent) - : QtAbstractPropertyManager(parent) + : QtAbstractPropertyManager(parent), d_ptr(new QtDoublePropertyManagerPrivate) { - d_ptr = new QtDoublePropertyManagerPrivate; d_ptr->q_ptr = this; } @@ -980,7 +977,6 @@ QtDoublePropertyManager::QtDoublePropertyManager(QObject *parent) QtDoublePropertyManager::~QtDoublePropertyManager() { clear(); - delete d_ptr; } /*! @@ -1063,7 +1059,7 @@ QString QtDoublePropertyManager::valueText(const QtProperty *property) const void QtDoublePropertyManager::setValue(QtProperty *property, double val) { void (QtDoublePropertyManagerPrivate::*setSubPropertyValue)(QtProperty *, double) = 0; - setValueInRange(this, d_ptr, + setValueInRange(this, d_ptr.data(), &QtDoublePropertyManager::propertyChanged, &QtDoublePropertyManager::valueChanged, property, val, setSubPropertyValue); @@ -1140,7 +1136,7 @@ void QtDoublePropertyManager::setDecimals(QtProperty *property, int prec) */ void QtDoublePropertyManager::setMinimum(QtProperty *property, double minVal) { - setMinimumValue(this, d_ptr, + setMinimumValue(this, d_ptr.data(), &QtDoublePropertyManager::propertyChanged, &QtDoublePropertyManager::valueChanged, &QtDoublePropertyManager::rangeChanged, @@ -1158,7 +1154,7 @@ void QtDoublePropertyManager::setMinimum(QtProperty *property, double minVal) */ void QtDoublePropertyManager::setMaximum(QtProperty *property, double maxVal) { - setMaximumValue(this, d_ptr, + setMaximumValue(this, d_ptr.data(), &QtDoublePropertyManager::propertyChanged, &QtDoublePropertyManager::valueChanged, &QtDoublePropertyManager::rangeChanged, @@ -1182,7 +1178,7 @@ void QtDoublePropertyManager::setMaximum(QtProperty *property, double maxVal) void QtDoublePropertyManager::setRange(QtProperty *property, double minVal, double maxVal) { void (QtDoublePropertyManagerPrivate::*setSubPropertyRange)(QtProperty *, double, double, double) = 0; - setBorderValues(this, d_ptr, + setBorderValues(this, d_ptr.data(), &QtDoublePropertyManager::propertyChanged, &QtDoublePropertyManager::valueChanged, &QtDoublePropertyManager::rangeChanged, @@ -1273,9 +1269,8 @@ public: Creates a manager with the given \a parent. */ QtStringPropertyManager::QtStringPropertyManager(QObject *parent) - : QtAbstractPropertyManager(parent) + : QtAbstractPropertyManager(parent), d_ptr(new QtStringPropertyManagerPrivate) { - d_ptr = new QtStringPropertyManagerPrivate; d_ptr->q_ptr = this; } @@ -1285,7 +1280,6 @@ QtStringPropertyManager::QtStringPropertyManager(QObject *parent) QtStringPropertyManager::~QtStringPropertyManager() { clear(); - delete d_ptr; } /*! @@ -1437,9 +1431,8 @@ public: Creates a manager with the given \a parent. */ QtBoolPropertyManager::QtBoolPropertyManager(QObject *parent) - : QtAbstractPropertyManager(parent) + : QtAbstractPropertyManager(parent), d_ptr(new QtBoolPropertyManagerPrivate) { - d_ptr = new QtBoolPropertyManagerPrivate; d_ptr->q_ptr = this; } @@ -1449,7 +1442,6 @@ QtBoolPropertyManager::QtBoolPropertyManager(QObject *parent) QtBoolPropertyManager::~QtBoolPropertyManager() { clear(); - delete d_ptr; } /*! @@ -1630,9 +1622,8 @@ public: Creates a manager with the given \a parent. */ QtDatePropertyManager::QtDatePropertyManager(QObject *parent) - : QtAbstractPropertyManager(parent) + : QtAbstractPropertyManager(parent), d_ptr(new QtDatePropertyManagerPrivate) { - d_ptr = new QtDatePropertyManagerPrivate; d_ptr->q_ptr = this; QLocale loc; @@ -1645,7 +1636,6 @@ QtDatePropertyManager::QtDatePropertyManager(QObject *parent) QtDatePropertyManager::~QtDatePropertyManager() { clear(); - delete d_ptr; } /*! @@ -1706,7 +1696,7 @@ QString QtDatePropertyManager::valueText(const QtProperty *property) const void QtDatePropertyManager::setValue(QtProperty *property, const QDate &val) { void (QtDatePropertyManagerPrivate::*setSubPropertyValue)(QtProperty *, const QDate &) = 0; - setValueInRange(this, d_ptr, + setValueInRange(this, d_ptr.data(), &QtDatePropertyManager::propertyChanged, &QtDatePropertyManager::valueChanged, property, val, setSubPropertyValue); @@ -1723,7 +1713,7 @@ void QtDatePropertyManager::setValue(QtProperty *property, const QDate &val) */ void QtDatePropertyManager::setMinimum(QtProperty *property, const QDate &minVal) { - setMinimumValue(this, d_ptr, + setMinimumValue(this, d_ptr.data(), &QtDatePropertyManager::propertyChanged, &QtDatePropertyManager::valueChanged, &QtDatePropertyManager::rangeChanged, @@ -1741,7 +1731,7 @@ void QtDatePropertyManager::setMinimum(QtProperty *property, const QDate &minVal */ void QtDatePropertyManager::setMaximum(QtProperty *property, const QDate &maxVal) { - setMaximumValue(this, d_ptr, + setMaximumValue(this, d_ptr.data(), &QtDatePropertyManager::propertyChanged, &QtDatePropertyManager::valueChanged, &QtDatePropertyManager::rangeChanged, @@ -1766,7 +1756,7 @@ void QtDatePropertyManager::setRange(QtProperty *property, const QDate &minVal, { void (QtDatePropertyManagerPrivate::*setSubPropertyRange)(QtProperty *, const QDate &, const QDate &, const QDate &) = 0; - setBorderValues(this, d_ptr, + setBorderValues(this, d_ptr.data(), &QtDatePropertyManager::propertyChanged, &QtDatePropertyManager::valueChanged, &QtDatePropertyManager::rangeChanged, @@ -1835,9 +1825,8 @@ public: Creates a manager with the given \a parent. */ QtTimePropertyManager::QtTimePropertyManager(QObject *parent) - : QtAbstractPropertyManager(parent) + : QtAbstractPropertyManager(parent), d_ptr(new QtTimePropertyManagerPrivate) { - d_ptr = new QtTimePropertyManagerPrivate; d_ptr->q_ptr = this; QLocale loc; @@ -1850,7 +1839,6 @@ QtTimePropertyManager::QtTimePropertyManager(QObject *parent) QtTimePropertyManager::~QtTimePropertyManager() { clear(); - delete d_ptr; } /*! @@ -1950,9 +1938,8 @@ public: Creates a manager with the given \a parent. */ QtDateTimePropertyManager::QtDateTimePropertyManager(QObject *parent) - : QtAbstractPropertyManager(parent) + : QtAbstractPropertyManager(parent), d_ptr(new QtDateTimePropertyManagerPrivate) { - d_ptr = new QtDateTimePropertyManagerPrivate; d_ptr->q_ptr = this; QLocale loc; @@ -1967,7 +1954,6 @@ QtDateTimePropertyManager::QtDateTimePropertyManager(QObject *parent) QtDateTimePropertyManager::~QtDateTimePropertyManager() { clear(); - delete d_ptr; } /*! @@ -2068,9 +2054,8 @@ public: Creates a manager with the given \a parent. */ QtKeySequencePropertyManager::QtKeySequencePropertyManager(QObject *parent) - : QtAbstractPropertyManager(parent) + : QtAbstractPropertyManager(parent), d_ptr(new QtKeySequencePropertyManagerPrivate) { - d_ptr = new QtKeySequencePropertyManagerPrivate; d_ptr->q_ptr = this; } @@ -2080,7 +2065,6 @@ QtKeySequencePropertyManager::QtKeySequencePropertyManager(QObject *parent) QtKeySequencePropertyManager::~QtKeySequencePropertyManager() { clear(); - delete d_ptr; } /*! @@ -2179,9 +2163,8 @@ public: Creates a manager with the given \a parent. */ QtCharPropertyManager::QtCharPropertyManager(QObject *parent) - : QtAbstractPropertyManager(parent) + : QtAbstractPropertyManager(parent), d_ptr(new QtCharPropertyManagerPrivate) { - d_ptr = new QtCharPropertyManagerPrivate; d_ptr->q_ptr = this; } @@ -2191,7 +2174,6 @@ QtCharPropertyManager::QtCharPropertyManager(QObject *parent) QtCharPropertyManager::~QtCharPropertyManager() { clear(); - delete d_ptr; } /*! @@ -2347,9 +2329,8 @@ void QtLocalePropertyManagerPrivate::slotPropertyDestroyed(QtProperty *property) Creates a manager with the given \a parent. */ QtLocalePropertyManager::QtLocalePropertyManager(QObject *parent) - : QtAbstractPropertyManager(parent) + : QtAbstractPropertyManager(parent), d_ptr(new QtLocalePropertyManagerPrivate) { - d_ptr = new QtLocalePropertyManagerPrivate; d_ptr->q_ptr = this; d_ptr->m_enumPropertyManager = new QtEnumPropertyManager(this); @@ -2366,7 +2347,6 @@ QtLocalePropertyManager::QtLocalePropertyManager(QObject *parent) QtLocalePropertyManager::~QtLocalePropertyManager() { clear(); - delete d_ptr; } /*! @@ -2586,9 +2566,8 @@ void QtPointPropertyManagerPrivate::slotPropertyDestroyed(QtProperty *property) Creates a manager with the given \a parent. */ QtPointPropertyManager::QtPointPropertyManager(QObject *parent) - : QtAbstractPropertyManager(parent) + : QtAbstractPropertyManager(parent), d_ptr(new QtPointPropertyManagerPrivate) { - d_ptr = new QtPointPropertyManagerPrivate; d_ptr->q_ptr = this; d_ptr->m_intPropertyManager = new QtIntPropertyManager(this); @@ -2604,7 +2583,6 @@ QtPointPropertyManager::QtPointPropertyManager(QObject *parent) QtPointPropertyManager::~QtPointPropertyManager() { clear(); - delete d_ptr; } /*! @@ -2818,9 +2796,8 @@ void QtPointFPropertyManagerPrivate::slotPropertyDestroyed(QtProperty *property) Creates a manager with the given \a parent. */ QtPointFPropertyManager::QtPointFPropertyManager(QObject *parent) - : QtAbstractPropertyManager(parent) + : QtAbstractPropertyManager(parent), d_ptr(new QtPointFPropertyManagerPrivate) { - d_ptr = new QtPointFPropertyManagerPrivate; d_ptr->q_ptr = this; d_ptr->m_doublePropertyManager = new QtDoublePropertyManager(this); @@ -2836,7 +2813,6 @@ QtPointFPropertyManager::QtPointFPropertyManager(QObject *parent) QtPointFPropertyManager::~QtPointFPropertyManager() { clear(); - delete d_ptr; } /*! @@ -3131,9 +3107,8 @@ void QtSizePropertyManagerPrivate::setRange(QtProperty *property, Creates a manager with the given \a parent. */ QtSizePropertyManager::QtSizePropertyManager(QObject *parent) - : QtAbstractPropertyManager(parent) + : QtAbstractPropertyManager(parent), d_ptr(new QtSizePropertyManagerPrivate) { - d_ptr = new QtSizePropertyManagerPrivate; d_ptr->q_ptr = this; d_ptr->m_intPropertyManager = new QtIntPropertyManager(this); @@ -3149,7 +3124,6 @@ QtSizePropertyManager::QtSizePropertyManager(QObject *parent) QtSizePropertyManager::~QtSizePropertyManager() { clear(); - delete d_ptr; } /*! @@ -3226,7 +3200,7 @@ QString QtSizePropertyManager::valueText(const QtProperty *property) const */ void QtSizePropertyManager::setValue(QtProperty *property, const QSize &val) { - setValueInRange(this, d_ptr, + setValueInRange(this, d_ptr.data(), &QtSizePropertyManager::propertyChanged, &QtSizePropertyManager::valueChanged, property, val, &QtSizePropertyManagerPrivate::setValue); @@ -3243,7 +3217,7 @@ void QtSizePropertyManager::setValue(QtProperty *property, const QSize &val) */ void QtSizePropertyManager::setMinimum(QtProperty *property, const QSize &minVal) { - setBorderValue(this, d_ptr, + setBorderValue(this, d_ptr.data(), &QtSizePropertyManager::propertyChanged, &QtSizePropertyManager::valueChanged, &QtSizePropertyManager::rangeChanged, @@ -3264,7 +3238,7 @@ void QtSizePropertyManager::setMinimum(QtProperty *property, const QSize &minVal */ void QtSizePropertyManager::setMaximum(QtProperty *property, const QSize &maxVal) { - setBorderValue(this, d_ptr, + setBorderValue(this, d_ptr.data(), &QtSizePropertyManager::propertyChanged, &QtSizePropertyManager::valueChanged, &QtSizePropertyManager::rangeChanged, @@ -3290,7 +3264,7 @@ void QtSizePropertyManager::setMaximum(QtProperty *property, const QSize &maxVal */ void QtSizePropertyManager::setRange(QtProperty *property, const QSize &minVal, const QSize &maxVal) { - setBorderValues(this, d_ptr, + setBorderValues(this, d_ptr.data(), &QtSizePropertyManager::propertyChanged, &QtSizePropertyManager::valueChanged, &QtSizePropertyManager::rangeChanged, @@ -3487,9 +3461,8 @@ void QtSizeFPropertyManagerPrivate::setRange(QtProperty *property, Creates a manager with the given \a parent. */ QtSizeFPropertyManager::QtSizeFPropertyManager(QObject *parent) - : QtAbstractPropertyManager(parent) + : QtAbstractPropertyManager(parent), d_ptr(new QtSizeFPropertyManagerPrivate) { - d_ptr = new QtSizeFPropertyManagerPrivate; d_ptr->q_ptr = this; d_ptr->m_doublePropertyManager = new QtDoublePropertyManager(this); @@ -3505,7 +3478,6 @@ QtSizeFPropertyManager::QtSizeFPropertyManager(QObject *parent) QtSizeFPropertyManager::~QtSizeFPropertyManager() { clear(); - delete d_ptr; } /*! @@ -3593,7 +3565,7 @@ QString QtSizeFPropertyManager::valueText(const QtProperty *property) const */ void QtSizeFPropertyManager::setValue(QtProperty *property, const QSizeF &val) { - setValueInRange(this, d_ptr, + setValueInRange(this, d_ptr.data(), &QtSizeFPropertyManager::propertyChanged, &QtSizeFPropertyManager::valueChanged, property, val, &QtSizeFPropertyManagerPrivate::setValue); @@ -3644,7 +3616,7 @@ void QtSizeFPropertyManager::setDecimals(QtProperty *property, int prec) */ void QtSizeFPropertyManager::setMinimum(QtProperty *property, const QSizeF &minVal) { - setBorderValue(this, d_ptr, + setBorderValue(this, d_ptr.data(), &QtSizeFPropertyManager::propertyChanged, &QtSizeFPropertyManager::valueChanged, &QtSizeFPropertyManager::rangeChanged, @@ -3665,7 +3637,7 @@ void QtSizeFPropertyManager::setMinimum(QtProperty *property, const QSizeF &minV */ void QtSizeFPropertyManager::setMaximum(QtProperty *property, const QSizeF &maxVal) { - setBorderValue(this, d_ptr, + setBorderValue(this, d_ptr.data(), &QtSizeFPropertyManager::propertyChanged, &QtSizeFPropertyManager::valueChanged, &QtSizeFPropertyManager::rangeChanged, @@ -3691,7 +3663,7 @@ void QtSizeFPropertyManager::setMaximum(QtProperty *property, const QSizeF &maxV */ void QtSizeFPropertyManager::setRange(QtProperty *property, const QSizeF &minVal, const QSizeF &maxVal) { - setBorderValues(this, d_ptr, + setBorderValues(this, d_ptr.data(), &QtSizeFPropertyManager::propertyChanged, &QtSizeFPropertyManager::valueChanged, &QtSizeFPropertyManager::rangeChanged, @@ -3903,9 +3875,8 @@ void QtRectPropertyManagerPrivate::setConstraint(QtProperty *property, Creates a manager with the given \a parent. */ QtRectPropertyManager::QtRectPropertyManager(QObject *parent) - : QtAbstractPropertyManager(parent) + : QtAbstractPropertyManager(parent), d_ptr(new QtRectPropertyManagerPrivate) { - d_ptr = new QtRectPropertyManagerPrivate; d_ptr->q_ptr = this; d_ptr->m_intPropertyManager = new QtIntPropertyManager(this); @@ -3921,7 +3892,6 @@ QtRectPropertyManager::QtRectPropertyManager(QObject *parent) QtRectPropertyManager::~QtRectPropertyManager() { clear(); - delete d_ptr; } /*! @@ -4325,9 +4295,8 @@ void QtRectFPropertyManagerPrivate::setConstraint(QtProperty *property, Creates a manager with the given \a parent. */ QtRectFPropertyManager::QtRectFPropertyManager(QObject *parent) - : QtAbstractPropertyManager(parent) + : QtAbstractPropertyManager(parent), d_ptr(new QtRectFPropertyManagerPrivate) { - d_ptr = new QtRectFPropertyManagerPrivate; d_ptr->q_ptr = this; d_ptr->m_doublePropertyManager = new QtDoublePropertyManager(this); @@ -4343,7 +4312,6 @@ QtRectFPropertyManager::QtRectFPropertyManager(QObject *parent) QtRectFPropertyManager::~QtRectFPropertyManager() { clear(); - delete d_ptr; } /*! @@ -4710,9 +4678,8 @@ public: Creates a manager with the given \a parent. */ QtEnumPropertyManager::QtEnumPropertyManager(QObject *parent) - : QtAbstractPropertyManager(parent) + : QtAbstractPropertyManager(parent), d_ptr(new QtEnumPropertyManagerPrivate) { - d_ptr = new QtEnumPropertyManagerPrivate; d_ptr->q_ptr = this; } @@ -4722,7 +4689,6 @@ QtEnumPropertyManager::QtEnumPropertyManager(QObject *parent) QtEnumPropertyManager::~QtEnumPropertyManager() { clear(); - delete d_ptr; } /*! @@ -5022,9 +4988,8 @@ void QtFlagPropertyManagerPrivate::slotPropertyDestroyed(QtProperty *property) Creates a manager with the given \a parent. */ QtFlagPropertyManager::QtFlagPropertyManager(QObject *parent) - : QtAbstractPropertyManager(parent) + : QtAbstractPropertyManager(parent), d_ptr(new QtFlagPropertyManagerPrivate) { - d_ptr = new QtFlagPropertyManagerPrivate; d_ptr->q_ptr = this; d_ptr->m_boolPropertyManager = new QtBoolPropertyManager(this); @@ -5040,7 +5005,6 @@ QtFlagPropertyManager::QtFlagPropertyManager(QObject *parent) QtFlagPropertyManager::~QtFlagPropertyManager() { clear(); - delete d_ptr; } /*! @@ -5350,9 +5314,8 @@ void QtSizePolicyPropertyManagerPrivate::slotPropertyDestroyed(QtProperty *prope Creates a manager with the given \a parent. */ QtSizePolicyPropertyManager::QtSizePolicyPropertyManager(QObject *parent) - : QtAbstractPropertyManager(parent) + : QtAbstractPropertyManager(parent), d_ptr(new QtSizePolicyPropertyManagerPrivate) { - d_ptr = new QtSizePolicyPropertyManagerPrivate; d_ptr->q_ptr = this; d_ptr->m_intPropertyManager = new QtIntPropertyManager(this); @@ -5374,7 +5337,6 @@ QtSizePolicyPropertyManager::QtSizePolicyPropertyManager(QObject *parent) QtSizePolicyPropertyManager::~QtSizePolicyPropertyManager() { clear(); - delete d_ptr; } /*! @@ -5762,9 +5724,8 @@ void QtFontPropertyManagerPrivate::slotFontDatabaseDelayedChange() Creates a manager with the given \a parent. */ QtFontPropertyManager::QtFontPropertyManager(QObject *parent) - : QtAbstractPropertyManager(parent) + : QtAbstractPropertyManager(parent), d_ptr(new QtFontPropertyManagerPrivate) { - d_ptr = new QtFontPropertyManagerPrivate; d_ptr->q_ptr = this; QObject::connect(qApp, SIGNAL(fontDatabaseChanged()), this, SLOT(slotFontDatabaseChanged())); @@ -5792,7 +5753,6 @@ QtFontPropertyManager::QtFontPropertyManager(QObject *parent) QtFontPropertyManager::~QtFontPropertyManager() { clear(); - delete d_ptr; } /*! @@ -6140,9 +6100,8 @@ void QtColorPropertyManagerPrivate::slotPropertyDestroyed(QtProperty *property) Creates a manager with the given \a parent. */ QtColorPropertyManager::QtColorPropertyManager(QObject *parent) - : QtAbstractPropertyManager(parent) + : QtAbstractPropertyManager(parent), d_ptr(new QtColorPropertyManagerPrivate) { - d_ptr = new QtColorPropertyManagerPrivate; d_ptr->q_ptr = this; d_ptr->m_intPropertyManager = new QtIntPropertyManager(this); @@ -6159,7 +6118,6 @@ QtColorPropertyManager::QtColorPropertyManager(QObject *parent) QtColorPropertyManager::~QtColorPropertyManager() { clear(); - delete d_ptr; } /*! @@ -6364,9 +6322,8 @@ public: Creates a manager with the given \a parent. */ QtCursorPropertyManager::QtCursorPropertyManager(QObject *parent) - : QtAbstractPropertyManager(parent) + : QtAbstractPropertyManager(parent), d_ptr(new QtCursorPropertyManagerPrivate) { - d_ptr = new QtCursorPropertyManagerPrivate; d_ptr->q_ptr = this; } @@ -6376,7 +6333,6 @@ QtCursorPropertyManager::QtCursorPropertyManager(QObject *parent) QtCursorPropertyManager::~QtCursorPropertyManager() { clear(); - delete d_ptr; } /*! diff --git a/tools/shared/qtpropertybrowser/qtpropertymanager.h b/tools/shared/qtpropertybrowser/qtpropertymanager.h index 2fb69bf..46ff485 100644 --- a/tools/shared/qtpropertybrowser/qtpropertymanager.h +++ b/tools/shared/qtpropertybrowser/qtpropertymanager.h @@ -94,7 +94,7 @@ protected: virtual void initializeProperty(QtProperty *property); virtual void uninitializeProperty(QtProperty *property); private: - QtIntPropertyManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtIntPropertyManager) Q_DISABLE_COPY(QtIntPropertyManager) }; @@ -120,7 +120,7 @@ protected: virtual void initializeProperty(QtProperty *property); virtual void uninitializeProperty(QtProperty *property); private: - QtBoolPropertyManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtBoolPropertyManager) Q_DISABLE_COPY(QtBoolPropertyManager) }; @@ -157,7 +157,7 @@ protected: virtual void initializeProperty(QtProperty *property); virtual void uninitializeProperty(QtProperty *property); private: - QtDoublePropertyManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtDoublePropertyManager) Q_DISABLE_COPY(QtDoublePropertyManager) }; @@ -185,7 +185,7 @@ protected: virtual void initializeProperty(QtProperty *property); virtual void uninitializeProperty(QtProperty *property); private: - QtStringPropertyManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtStringPropertyManager) Q_DISABLE_COPY(QtStringPropertyManager) }; @@ -216,7 +216,7 @@ protected: virtual void initializeProperty(QtProperty *property); virtual void uninitializeProperty(QtProperty *property); private: - QtDatePropertyManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtDatePropertyManager) Q_DISABLE_COPY(QtDatePropertyManager) }; @@ -241,7 +241,7 @@ protected: virtual void initializeProperty(QtProperty *property); virtual void uninitializeProperty(QtProperty *property); private: - QtTimePropertyManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtTimePropertyManager) Q_DISABLE_COPY(QtTimePropertyManager) }; @@ -266,7 +266,7 @@ protected: virtual void initializeProperty(QtProperty *property); virtual void uninitializeProperty(QtProperty *property); private: - QtDateTimePropertyManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtDateTimePropertyManager) Q_DISABLE_COPY(QtDateTimePropertyManager) }; @@ -291,7 +291,7 @@ protected: virtual void initializeProperty(QtProperty *property); virtual void uninitializeProperty(QtProperty *property); private: - QtKeySequencePropertyManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtKeySequencePropertyManager) Q_DISABLE_COPY(QtKeySequencePropertyManager) }; @@ -316,7 +316,7 @@ protected: virtual void initializeProperty(QtProperty *property); virtual void uninitializeProperty(QtProperty *property); private: - QtCharPropertyManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtCharPropertyManager) Q_DISABLE_COPY(QtCharPropertyManager) }; @@ -344,7 +344,7 @@ protected: virtual void initializeProperty(QtProperty *property); virtual void uninitializeProperty(QtProperty *property); private: - QtLocalePropertyManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtLocalePropertyManager) Q_DISABLE_COPY(QtLocalePropertyManager) Q_PRIVATE_SLOT(d_func(), void slotEnumChanged(QtProperty *, int)) @@ -373,7 +373,7 @@ protected: virtual void initializeProperty(QtProperty *property); virtual void uninitializeProperty(QtProperty *property); private: - QtPointPropertyManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtPointPropertyManager) Q_DISABLE_COPY(QtPointPropertyManager) Q_PRIVATE_SLOT(d_func(), void slotIntChanged(QtProperty *, int)) @@ -405,7 +405,7 @@ protected: virtual void initializeProperty(QtProperty *property); virtual void uninitializeProperty(QtProperty *property); private: - QtPointFPropertyManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtPointFPropertyManager) Q_DISABLE_COPY(QtPointFPropertyManager) Q_PRIVATE_SLOT(d_func(), void slotDoubleChanged(QtProperty *, double)) @@ -440,7 +440,7 @@ protected: virtual void initializeProperty(QtProperty *property); virtual void uninitializeProperty(QtProperty *property); private: - QtSizePropertyManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtSizePropertyManager) Q_DISABLE_COPY(QtSizePropertyManager) Q_PRIVATE_SLOT(d_func(), void slotIntChanged(QtProperty *, int)) @@ -478,7 +478,7 @@ protected: virtual void initializeProperty(QtProperty *property); virtual void uninitializeProperty(QtProperty *property); private: - QtSizeFPropertyManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtSizeFPropertyManager) Q_DISABLE_COPY(QtSizeFPropertyManager) Q_PRIVATE_SLOT(d_func(), void slotDoubleChanged(QtProperty *, double)) @@ -510,7 +510,7 @@ protected: virtual void initializeProperty(QtProperty *property); virtual void uninitializeProperty(QtProperty *property); private: - QtRectPropertyManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtRectPropertyManager) Q_DISABLE_COPY(QtRectPropertyManager) Q_PRIVATE_SLOT(d_func(), void slotIntChanged(QtProperty *, int)) @@ -545,7 +545,7 @@ protected: virtual void initializeProperty(QtProperty *property); virtual void uninitializeProperty(QtProperty *property); private: - QtRectFPropertyManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtRectFPropertyManager) Q_DISABLE_COPY(QtRectFPropertyManager) Q_PRIVATE_SLOT(d_func(), void slotDoubleChanged(QtProperty *, double)) @@ -579,7 +579,7 @@ protected: virtual void initializeProperty(QtProperty *property); virtual void uninitializeProperty(QtProperty *property); private: - QtEnumPropertyManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtEnumPropertyManager) Q_DISABLE_COPY(QtEnumPropertyManager) }; @@ -609,7 +609,7 @@ protected: virtual void initializeProperty(QtProperty *property); virtual void uninitializeProperty(QtProperty *property); private: - QtFlagPropertyManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtFlagPropertyManager) Q_DISABLE_COPY(QtFlagPropertyManager) Q_PRIVATE_SLOT(d_func(), void slotBoolChanged(QtProperty *, bool)) @@ -639,7 +639,7 @@ protected: virtual void initializeProperty(QtProperty *property); virtual void uninitializeProperty(QtProperty *property); private: - QtSizePolicyPropertyManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtSizePolicyPropertyManager) Q_DISABLE_COPY(QtSizePolicyPropertyManager) Q_PRIVATE_SLOT(d_func(), void slotIntChanged(QtProperty *, int)) @@ -672,7 +672,7 @@ protected: virtual void initializeProperty(QtProperty *property); virtual void uninitializeProperty(QtProperty *property); private: - QtFontPropertyManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtFontPropertyManager) Q_DISABLE_COPY(QtFontPropertyManager) Q_PRIVATE_SLOT(d_func(), void slotIntChanged(QtProperty *, int)) @@ -706,7 +706,7 @@ protected: virtual void initializeProperty(QtProperty *property); virtual void uninitializeProperty(QtProperty *property); private: - QtColorPropertyManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtColorPropertyManager) Q_DISABLE_COPY(QtColorPropertyManager) Q_PRIVATE_SLOT(d_func(), void slotIntChanged(QtProperty *, int)) @@ -736,7 +736,7 @@ protected: virtual void initializeProperty(QtProperty *property); virtual void uninitializeProperty(QtProperty *property); private: - QtCursorPropertyManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtCursorPropertyManager) Q_DISABLE_COPY(QtCursorPropertyManager) }; diff --git a/tools/shared/qtpropertybrowser/qttreepropertybrowser.cpp b/tools/shared/qtpropertybrowser/qttreepropertybrowser.cpp index 1ad3f6b..77af2d4 100644 --- a/tools/shared/qtpropertybrowser/qttreepropertybrowser.cpp +++ b/tools/shared/qtpropertybrowser/qttreepropertybrowser.cpp @@ -726,9 +726,8 @@ void QtTreePropertyBrowserPrivate::editItem(QtBrowserItem *browserItem) Creates a property browser with the given \a parent. */ QtTreePropertyBrowser::QtTreePropertyBrowser(QWidget *parent) - : QtAbstractPropertyBrowser(parent) + : QtAbstractPropertyBrowser(parent), d_ptr(new QtTreePropertyBrowserPrivate) { - d_ptr = new QtTreePropertyBrowserPrivate; d_ptr->q_ptr = this; d_ptr->init(this); @@ -747,7 +746,6 @@ QtTreePropertyBrowser::QtTreePropertyBrowser(QWidget *parent) */ QtTreePropertyBrowser::~QtTreePropertyBrowser() { - delete d_ptr; } /*! diff --git a/tools/shared/qtpropertybrowser/qttreepropertybrowser.h b/tools/shared/qtpropertybrowser/qttreepropertybrowser.h index 813e050..8f21588 100644 --- a/tools/shared/qtpropertybrowser/qttreepropertybrowser.h +++ b/tools/shared/qtpropertybrowser/qttreepropertybrowser.h @@ -118,7 +118,7 @@ protected: private: - QtTreePropertyBrowserPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtTreePropertyBrowser) Q_DISABLE_COPY(QtTreePropertyBrowser) diff --git a/tools/shared/qtpropertybrowser/qtvariantproperty.cpp b/tools/shared/qtpropertybrowser/qtvariantproperty.cpp index f712ba6..8931419 100644 --- a/tools/shared/qtpropertybrowser/qtvariantproperty.cpp +++ b/tools/shared/qtpropertybrowser/qtvariantproperty.cpp @@ -188,9 +188,8 @@ public: \sa QtVariantPropertyManager */ QtVariantProperty::QtVariantProperty(QtVariantPropertyManager *manager) - : QtProperty(manager), d_ptr(new QtVariantPropertyPrivate(manager)) + : QtProperty(manager), d_ptr(new QtVariantPropertyPrivate(manager)) { - } /*! @@ -200,7 +199,6 @@ QtVariantProperty::QtVariantProperty(QtVariantPropertyManager *manager) */ QtVariantProperty::~QtVariantProperty() { - delete d_ptr; } /*! @@ -912,9 +910,8 @@ void QtVariantPropertyManagerPrivate::slotFlagNamesChanged(QtProperty *property, Creates a manager with the given \a parent. */ QtVariantPropertyManager::QtVariantPropertyManager(QObject *parent) - : QtAbstractPropertyManager(parent) + : QtAbstractPropertyManager(parent), d_ptr(new QtVariantPropertyManagerPrivate) { - d_ptr = new QtVariantPropertyManagerPrivate; d_ptr->q_ptr = this; d_ptr->m_creatingProperty = false; @@ -1234,7 +1231,6 @@ QtVariantPropertyManager::QtVariantPropertyManager(QObject *parent) QtVariantPropertyManager::~QtVariantPropertyManager() { clear(); - delete d_ptr; } /*! @@ -1929,9 +1925,8 @@ public: Creates a factory with the given \a parent. */ QtVariantEditorFactory::QtVariantEditorFactory(QObject *parent) - : QtAbstractEditorFactory(parent) + : QtAbstractEditorFactory(parent), d_ptr(new QtVariantEditorFactoryPrivate()) { - d_ptr = new QtVariantEditorFactoryPrivate(); d_ptr->q_ptr = this; d_ptr->m_spinBoxFactory = new QtSpinBoxFactory(this); @@ -1993,7 +1988,6 @@ QtVariantEditorFactory::QtVariantEditorFactory(QObject *parent) */ QtVariantEditorFactory::~QtVariantEditorFactory() { - delete d_ptr; } /*! diff --git a/tools/shared/qtpropertybrowser/qtvariantproperty.h b/tools/shared/qtpropertybrowser/qtvariantproperty.h index 9253809..2576f30 100644 --- a/tools/shared/qtpropertybrowser/qtvariantproperty.h +++ b/tools/shared/qtpropertybrowser/qtvariantproperty.h @@ -67,7 +67,7 @@ protected: QtVariantProperty(QtVariantPropertyManager *manager); private: friend class QtVariantPropertyManager; - class QtVariantPropertyPrivate *d_ptr; + QScopedPointer d_ptr; }; class QtVariantPropertyManager : public QtAbstractPropertyManager @@ -111,7 +111,7 @@ protected: virtual void uninitializeProperty(QtProperty *property); virtual QtProperty *createProperty(); private: - class QtVariantPropertyManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_PRIVATE_SLOT(d_func(), void slotValueChanged(QtProperty *, int)) Q_PRIVATE_SLOT(d_func(), void slotRangeChanged(QtProperty *, int, int)) Q_PRIVATE_SLOT(d_func(), void slotSingleStepChanged(QtProperty *, int)) @@ -165,7 +165,7 @@ protected: QWidget *parent); void disconnectPropertyManager(QtVariantPropertyManager *manager); private: - class QtVariantEditorFactoryPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtVariantEditorFactory) Q_DISABLE_COPY(QtVariantEditorFactory) }; diff --git a/tools/shared/qttoolbardialog/qttoolbardialog.cpp b/tools/shared/qttoolbardialog/qttoolbardialog.cpp index f15c4bc..5ace584 100644 --- a/tools/shared/qttoolbardialog/qttoolbardialog.cpp +++ b/tools/shared/qttoolbardialog/qttoolbardialog.cpp @@ -119,7 +119,7 @@ signals: void toolBarChanged(QToolBar *toolBar, const QList &actions); private: - QtFullToolBarManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtFullToolBarManager) Q_DISABLE_COPY(QtFullToolBarManager) }; @@ -443,15 +443,13 @@ QToolBar *QtFullToolBarManagerPrivate::toolBarByName(const QString &toolBarName) ////////////////////////////// QtFullToolBarManager::QtFullToolBarManager(QObject *parent) - : QObject(parent) + : QObject(parent), d_ptr(new QtFullToolBarManagerPrivate) { - d_ptr = new QtFullToolBarManagerPrivate; d_ptr->q_ptr = this; } QtFullToolBarManager::~QtFullToolBarManager() { - delete d_ptr; } void QtFullToolBarManager::setMainWindow(QMainWindow *mainWindow) @@ -831,9 +829,8 @@ public: Creates a toolbar manager with the given \a parent. */ QtToolBarManager::QtToolBarManager(QObject *parent) - : QObject(parent) + : QObject(parent), d_ptr(new QtToolBarManagerPrivate) { - d_ptr = new QtToolBarManagerPrivate; d_ptr->q_ptr = this; d_ptr->manager = new QtFullToolBarManager(this); @@ -844,7 +841,6 @@ QtToolBarManager::QtToolBarManager(QObject *parent) */ QtToolBarManager::~QtToolBarManager() { - delete d_ptr; } /*! @@ -1781,9 +1777,8 @@ void QtToolBarListWidget::dropEvent(QDropEvent *event) window \a flags. */ QtToolBarDialog::QtToolBarDialog(QWidget *parent, Qt::WindowFlags flags) - : QDialog(parent, flags) + : QDialog(parent, flags), d_ptr(new QtToolBarDialogPrivate) { - d_ptr = new QtToolBarDialogPrivate; d_ptr->q_ptr = this; d_ptr->ui.setupUi(this); d_ptr->separatorText = tr("< S E P A R A T O R >"); @@ -1834,7 +1829,6 @@ QtToolBarDialog::QtToolBarDialog(QWidget *parent, Qt::WindowFlags flags) QtToolBarDialog::~QtToolBarDialog() { d_ptr->clearOld(); - delete d_ptr; } /*! diff --git a/tools/shared/qttoolbardialog/qttoolbardialog.h b/tools/shared/qttoolbardialog/qttoolbardialog.h index 879b437..a0734d2 100644 --- a/tools/shared/qttoolbardialog/qttoolbardialog.h +++ b/tools/shared/qttoolbardialog/qttoolbardialog.h @@ -88,7 +88,7 @@ public: private: friend class QtToolBarDialog; - QtToolBarManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtToolBarManager) Q_DISABLE_COPY(QtToolBarManager) }; @@ -112,7 +112,7 @@ protected: private: - QtToolBarDialogPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtToolBarDialog) Q_DISABLE_COPY(QtToolBarDialog) -- cgit v0.12 From 5d66ca1218360d910294e817a339b728deb17479 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Wed, 10 Jun 2009 13:54:05 +0200 Subject: Added softkeys example --- examples/widgets/widgets.pro | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/widgets/widgets.pro b/examples/widgets/widgets.pro index 018cc0c..399a3ac 100644 --- a/examples/widgets/widgets.pro +++ b/examples/widgets/widgets.pro @@ -29,7 +29,8 @@ symbian: SUBDIRS = \ lineedits \ shapedclock \ tetrix \ - wiggly + wiggly \ + softkeys contains(styles, motif): SUBDIRS += styles -- cgit v0.12 From c7ddb3e5801118fb23a42272c16c660ba3bdb570 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Wed, 10 Jun 2009 13:58:26 +0200 Subject: Added proper UID --- examples/widgets/softkeys/softkeys.pro | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/examples/widgets/softkeys/softkeys.pro b/examples/widgets/softkeys/softkeys.pro index 4cb8672..9a0feea 100644 --- a/examples/widgets/softkeys/softkeys.pro +++ b/examples/widgets/softkeys/softkeys.pro @@ -1,4 +1,14 @@ HEADERS = softkeys.h SOURCES += \ main.cpp \ - softkeys.cpp \ No newline at end of file + softkeys.cpp + +# install +target.path = $$[QT_INSTALL_EXAMPLES]/widgets/softkeys +sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS softkeys.pro +sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/softkeys +INSTALLS += target sources + +include($$QT_SOURCE_TREE/examples/examplebase.pri) + +symbian:TARGET.UID3 = 0xA000CF6B -- cgit v0.12 From 1fddb14c4d0ee82ac66c89061e8a20932f961883 Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Wed, 10 Jun 2009 13:53:19 +0200 Subject: Fix "post linker error" with GCCE. Reviewed-by: Miikka Heikkinen --- tests/auto/qtablewidget/qtablewidget.pro | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/auto/qtablewidget/qtablewidget.pro b/tests/auto/qtablewidget/qtablewidget.pro index bcc82bd..d66d0ac 100644 --- a/tests/auto/qtablewidget/qtablewidget.pro +++ b/tests/auto/qtablewidget/qtablewidget.pro @@ -1,5 +1,16 @@ load(qttest_p4) SOURCES += tst_qtablewidget.cpp +# This prevents the GCCE compile failure: "elf2e32: Error 1063: Fatal Error in +# PostLinker." The paged statement is documented in the S60 docs. +symbian { + MMP_RULES -= PAGED + + custom_paged_rule = "$${LITERAL_HASH}ifndef GCCE"\ + "PAGED" \ + "$${LITERAL_HASH}endif" + MMP_RULES += custom_paged_rule +} + symbian:MMP_RULES += "OPTION GCCE -mlong-calls" -- cgit v0.12 From 03b28bf56b2edd76ca55ec6e3702db7bca69e757 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 10 Jun 2009 15:25:23 +0300 Subject: Fixed qlocalsocket autotest deployment --- tests/auto/qlocalsocket/test/test.pro | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/auto/qlocalsocket/test/test.pro b/tests/auto/qlocalsocket/test/test.pro index b3f0a69..e399a29 100644 --- a/tests/auto/qlocalsocket/test/test.pro +++ b/tests/auto/qlocalsocket/test/test.pro @@ -27,13 +27,21 @@ CONFIG(debug_and_release) { DESTDIR = .. } -wince* | symbian* { +wince* { additionalFiles.sources = ../lackey/lackey.exe additionalFiles.path = lackey +} + +symbian { + additionalFiles.sources = lackey.exe + additionalFiles.path = \sys\bin + DEFINES += SYMBIAN_SRCDIR_UID=$$lower($$replace(TARGET.UID3,"0x","")) +} + +wince*|symbian { scriptFiles.sources = ../lackey/scripts/*.js scriptFiles.path = lackey/scripts DEPLOYMENT = additionalFiles scriptFiles QT += script # for easy deployment of QtScript - DEFINES += SYMBIAN_SRCDIR_UID=$$lower($$replace(TARGET.UID3,"0x","")) -} +} -- cgit v0.12 From c24d4cb9eca0b06f411bc99be3d232ff1ee27516 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Wed, 10 Jun 2009 14:39:47 +0200 Subject: Changed to use proper conversion from qstring to hbuf --- src/gui/kernel/qwidget_s60.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index eb3180f..bc69d6d 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -95,7 +95,7 @@ void QWidgetPrivate::setSoftKeys_sys(const QList &softkeys) const QAction* softKeyAction = softkeys.at(index); if (softKeyAction->softKeyRole() != QAction::ContextMenuSoftKey) { - HBufC* text = qt_QString2HBufCNewL(softKeyAction->text()); + HBufC* text = qt_QString2HBufC(softKeyAction->text()); CleanupStack::PushL(text); if (softKeyAction->softKeyRole() == QAction::MenuSoftKey) { nativeContainer->SetCommandL(placeInScreen, EAknSoftkeyOptions, *text); -- cgit v0.12 From 959ff46310b8a27c82ef6b0c1d122b817270f8d9 Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 10 Jun 2009 13:28:40 +0200 Subject: Revert "Fix to qapplication::setActiveWindow autotest case in Symbian." This reverts commit ba105741867dd96a9d58dcfcb78afef60e611bd6. --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 1dfb012..24abb58 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -43,7 +43,6 @@ #include "qcoefepinputcontext_p.h" #include -#include #include #include @@ -90,12 +89,9 @@ QCoeFepInputContext::~QCoeFepInputContext() // This is to make sure that the FEP manager "forgets" about us, // otherwise we may get callbacks even after we're destroyed. // The call is asynchronous though, so we must spin the event loop - // to make sure it gets detected. However we will not spin eventloop - // in case that app is closing, since eventDispatcher is already deleted. + // to make sure it gets detected. CCoeEnv::Static()->InputCapabilitiesChanged(); - if(!QApplicationPrivate::is_app_closing) { - QApplication::processEvents(); - } + QApplication::processEvents(); if (m_fepState) delete m_fepState; -- cgit v0.12 From 8ce6f4b96623d03031c65f396b6789520f114edc Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 10 Jun 2009 15:04:51 +0200 Subject: Fixed FEP crash during application exit. We use a synchronous call rather than an asynchronous one, so we don't risk the pointer being dereferenced after destruction is finished. --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 24abb58..b183e1b 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -88,10 +88,9 @@ QCoeFepInputContext::~QCoeFepInputContext() // This is to make sure that the FEP manager "forgets" about us, // otherwise we may get callbacks even after we're destroyed. - // The call is asynchronous though, so we must spin the event loop - // to make sure it gets detected. - CCoeEnv::Static()->InputCapabilitiesChanged(); - QApplication::processEvents(); + // The call below is essentially equivalent to InputCapabilitiesChanged(), + // but is synchronous, rather than asynchronous. + CCoeEnv::Static()->SyncNotifyFocusObserversOfChangeInFocus(); if (m_fepState) delete m_fepState; -- cgit v0.12 From a293cab198f51ca8920c3da1b671f51b26a9cb4a Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Wed, 10 Jun 2009 14:36:58 +0200 Subject: Build fix for GCCE. I believe all auto tests for GCCE were previously failing because of this. Reviewed-by: Brad --- src/corelib/tools/qlist.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 89e082b..7540035 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -117,7 +117,14 @@ public: inline int size() const { return p.size(); } inline void detach() { if (d->ref != 1) detach_helper(); } - inline void detachShared() { if (d->ref != 1 && d != &QListData::shared_null) detach_helper(); } + + inline void detachShared() + { + // The "this->" qualification is needed for GCCE. + if (d->ref != 1 && this->d != &QListData::shared_null) + detach_helper(); + } + inline bool isDetached() const { return d->ref == 1; } inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; } -- cgit v0.12 From 07c2b197b294043893ff792c851f5833736e41e3 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Wed, 10 Jun 2009 15:32:13 +0200 Subject: doc: document the Symbian exception helpers --- src/corelib/global/qglobal.cpp | 97 ++++++++++++++++++++++++++++++++++++++++-- src/corelib/global/qglobal.h | 3 +- 2 files changed, 95 insertions(+), 5 deletions(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 484c618..32c9139 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -3214,14 +3214,85 @@ bool QInternal::callFunction(InternalFunction func, void **args) #include -const char* QSymbianLeaveException::what() const throw() +/*! \macro QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(function) + \relates QSymbianLeaveException + + TRAP leaves from Symbian \a function and throws an appropriate + standard C++ exception instead. + This must be used when calling Symbian OS leaving functions + from inside Qt or standard C++ code, so that the code can respond + correctly to the exception. + + \warning This macro is only available on Symbian. + + \sa QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(), QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE() +*/ + +/*! \macro QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(error, function) + \relates QSymbianLeaveException + \ingroup qts60 + + Catch standard C++ exceptions from a \a function and convert them to a Symbian OS + \a error code, or \c KErrNone if there is no exception. + This must be used inside Qt or standard C++ code when using exception throwing + code (practically anything) and returning an error code to Symbian OS. + + \warning This macro is only available on Symbian. + + \sa QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(), QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION() +*/ + +/*! \macro QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(function) + \relates QSymbianLeaveException + \ingroup qts60 + + Catch standard C++ exceptions from \a function and convert them to Symbian OS + leaves. This must be used inside Qt or standard C++ code when using exception + throwing code (practically anything) and returning to Symbian OS from a leaving function. + For example inside a Symbian active object's \c RunL function implemented with Qt code. + + \warning This macro is only available on Symbian. + + \sa QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(), QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR() +*/ + +/*! \class QSymbianLeaveException + \ingroup qts60 + \brief Exception class representing a Symbian leave code. + + \warning This class is only available on Symbian. +*/ + +/*! \fn QSymbianLeaveException::QSymbianLeaveException(int error) + + Constructs a QSymbianLeaveException object that stores the given + Symbian \a error code. +*/ + +/*! \fn const char *QSymbianLeaveException::what() const + + Returns a C-style character string describing the general + cause of the current error. + + The string is not localized. +*/ +const char *QSymbianLeaveException::what() const throw() { - static const char str[] = "Symbian leave exception %d"; - static char msg[sizeof(str)+12]; - sprintf(msg, str, error); + static char msg[36]; + snprintf(msg, sizeof(msg), "Symbian leave exception %d", error); return msg; } +/*! \relates QSymbianLeaveException + \ingroup qts60 + + Throws a QSymbianLeaveException if the \a error parameter is a symbian error code. + This is the exception throwing equivalent of Symbian's User::LeaveIfError. + + \warning This function is only available on Symbian. + + \sa qt_translateExceptionToSymbianErrorL(), qt_translateExceptionToSymbianError() +*/ void qt_translateSymbianErrorToException(int error) { if (error >= KErrNone) @@ -3234,11 +3305,29 @@ void qt_translateSymbianErrorToException(int error) } } +/*! \relates QSymbianLeaveException + \ingroup qts60 + + Convert a caught standard C++ exception \a aThrow to a Symbian leave + + \warning This function is only available on Symbian. + + \sa qt_translateSymbianErrorToException(), qt_translateExceptionToSymbianError() +*/ void qt_translateExceptionToSymbianErrorL(const std::exception& aThrow) { User::Leave(qt_translateExceptionToSymbianError(aThrow)); } +/*! \relates QSymbianLeaveException + \ingroup qts60 + + Convert a caught standard C++ exception \a aThrow to a Symbian error code + + \warning This function is only available on Symbian. + + \sa qt_translateSymbianErrorToException(), qt_translateExceptionToSymbianErrorL() +*/ int qt_translateExceptionToSymbianError(const std::exception& aThrow) { const std::type_info& atype = typeid(aThrow); diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 030840e..3d441e3 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -2468,10 +2468,11 @@ QT_LICENSED_MODULE(DBus) #if defined(Q_OS_SYMBIAN) #include + class QSymbianLeaveException : public std::exception { public: - QSymbianLeaveException(int err) : error(err){ } + inline QSymbianLeaveException(int err) : error(err) {} const char* what() const throw(); public: int error; -- cgit v0.12 From 03a86003bc5bd05f0cbfe1c2274f517a175d1ffe Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Wed, 10 Jun 2009 15:38:32 +0200 Subject: add some preliminary exception safety documentation --- doc/src/exceptionsafety.qdoc | 144 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 doc/src/exceptionsafety.qdoc diff --git a/doc/src/exceptionsafety.qdoc b/doc/src/exceptionsafety.qdoc new file mode 100644 index 0000000..4e3e89e --- /dev/null +++ b/doc/src/exceptionsafety.qdoc @@ -0,0 +1,144 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \page exceptionsafety.html + \title Exception Safety + \ingroup architecture + \brief A guide to exception safety in Qt. + + \bold {Preliminary warning}: Exception safety is not feature complete! + Common cases should work, but classes might still leak or even crash. + + Qt itself will not throw exceptions. Instead, error codes are used. + In addition, some classes have user visible error messages, for example + \l QIODevice::errorString() or \l QSqlQuery::lastError(). + This has historical and practical reasons - turning on exceptions + can increase the library size by over 20%. + + The following sections describe Qt's behavior if exception support is + enabled at compile time. + + \tableofcontents + + \section1 Exception safe modules + + \section2 Containers + + Qt's \l{container classes} are generally exception neutral. They pass any + exception that happens within their contained type \c T to the user + while keeping their internal state valid. + + Example: + + \code + QList list; + ... + try { + list.append("hello"); + } catch (...) { + } + // list is safe to use - the exception did not affect it. + \endcode + + Exceptions to that rule are containers for types that can throw during assignment + or copy constructions. For those types, functions that modify the container as well as + returning a value, are unsafe to use: + + \code + MyType s = list.takeAt(2); + \endcode + + If an exception occurs during the assignment of \c s, the value at index 2 is already + removed from the container, but hasn't been assigned to \c s yet. It is lost + without chance of recovery. + + The correct way to write it: + + \code + MyType s = list.at(2); + list.removeAt(2); + \endcode + + If the assignment throws, the container still contains the value, no data loss occured. + + Note that implicitly shared Qt classes will not throw in their assignment + operators or copy constructors, so the limitation above does not apply. + + \section1 Out of memory handling + + Most desktop operating systems overcommit memory. This means that \c malloc() + or \c{operator new} return a valid pointer, even though there is not enough + memory available at allocation time. On such systems, no exception of type + \c std::bad_alloc is thrown. + + On all other operating systems, Qt will throw an exception of type std::bad_alloc + if any allocation fails. Allocations can fail if the system runs out of memory or + doesn't have enough continuous memory to allocate the requested size. + + Exceptions to that rule are documented. As an example, \l QImage::create() + returns false if not enough memory exists instead of throwing an exception. + + \section1 Recovering from exceptions + + Currently, the only supported use case for recovering from exceptions thrown + within Qt (for example due to out of memory) is to exit the event loop and do + some cleanup before exiting the application. + + Typical use case: + + \code + QApplication app(argc, argv); + ... + try { + app.exec(); + } catch (const std::bad_alloc &) { + // clean up here, e.g. save the session + // and close all config files. + + return 0; // exit the application + } + \endcode + + After an exception is thrown, the connection to the windowing server + might already be closed. It is not safe to call a GUI related function + after catching an exception. +*/ -- cgit v0.12 From fa57db3b5c1662430802f8a963b7dff2c83c300b Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Wed, 10 Jun 2009 16:11:31 +0200 Subject: add Symbian platform notes --- doc/src/platform-notes.qdoc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/src/platform-notes.qdoc b/doc/src/platform-notes.qdoc index c8046c4..63b721a 100644 --- a/doc/src/platform-notes.qdoc +++ b/doc/src/platform-notes.qdoc @@ -512,6 +512,19 @@ */ /*! + \page platform-notes-symbian.html + \title Platform Notes - Symbian + \contentspage Platform Notes + + This page contains information about the Symbian platforms Qt is currently known + to run on. More information about the combinations of platforms and compilers + supported by Qt can be found on the \l{Supported Platforms} page. + + For information about mixing exceptions with symbian leaves, + see \l QSymbianLeaveException. +*/ + +/*! \page platform-notes-embedded-linux.html \title Platform Notes - Embedded Linux \contentspage Platform Notes -- cgit v0.12 From 0f1486d6f36d25a08a7b75dfd5fdfa36c2ad98d2 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Wed, 10 Jun 2009 16:14:51 +0200 Subject: doc: fix typo --- src/corelib/tools/qscopedpointer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qscopedpointer.cpp b/src/corelib/tools/qscopedpointer.cpp index 8150a18..f34aec8 100644 --- a/src/corelib/tools/qscopedpointer.cpp +++ b/src/corelib/tools/qscopedpointer.cpp @@ -112,7 +112,7 @@ /*! \fn void QScopedPointer::reset(T *other = 0) - Deletes the existing object its pointing to if any, and sets its pointer to + Deletes the existing object it is pointing to if any, and sets its pointer to \a other. QScopedPointer now owns \a other and will delete it in its destructor. -- cgit v0.12 From 57c434c3fdf53e99b88646496e154708b3c141f5 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Wed, 10 Jun 2009 16:29:47 +0200 Subject: doc: added code examples --- src/corelib/global/qglobal.cpp | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 32c9139..e493831 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -3225,6 +3225,18 @@ bool QInternal::callFunction(InternalFunction func, void **args) \warning This macro is only available on Symbian. + Example: + + \code + // A Symbian leaving function is being called within a Qt function. + // Any leave must be converted to an exception + CAknTitlePane* titlePane = S60->titlePane(); + if (titlePane) { + TPtrC captionPtr(qt_QString2TPtrC(caption)); + QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(titlePane->SetTextL(captionPtr)); + } + \endcode + \sa QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(), QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE() */ @@ -3239,6 +3251,23 @@ bool QInternal::callFunction(InternalFunction func, void **args) \warning This macro is only available on Symbian. + Example: + + \code + // An exception might be thrown in this Symbian TInt error returning function. + // It is caught and translated to an error code + TInt QServerApp::Connect(const QString &serverName) + { + TPtrC name; + TInt err; + QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, name.Set(qt_QString2TPtrC(serverName))); + if (err != KErrNone) + return err; + return iServer.Connect(name); + } + \endcode +} + \sa QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(), QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION() */ @@ -3253,6 +3282,19 @@ bool QInternal::callFunction(InternalFunction func, void **args) \warning This macro is only available on Symbian. + Example: + + \code + // This active object signals Qt code + // Exceptions from the Qt code must be converted to Symbian OS leaves for the active scheduler + void QWakeUpActiveObject::RunL() + { + iStatus = KRequestPending; + SetActive(); + QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(m_dispatcher->wakeUpWasCalled()); + } + \endcode + \sa QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(), QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR() */ -- cgit v0.12 From 5fcc4febed6f88790d80f7869b647629f7e294af Mon Sep 17 00:00:00 2001 From: Robert Griebl Date: Wed, 10 Jun 2009 16:32:39 +0200 Subject: Shrink the emergency qWarning buffer to 256 bytes. Reviewed-by: Harald Fernengel --- src/corelib/global/qglobal.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 32c9139..c1f1f24 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -2207,10 +2207,10 @@ void qt_message_output(QtMsgType msgType, const char *buf) */ static void qEmergencyOut(QtMsgType msgType, const char *msg, va_list ap) { - char emergency_buf[1024] = { '\0' }; - emergency_buf[1023] = '\0'; + char emergency_buf[256] = { '\0' }; + emergency_buf[255] = '\0'; if (msg) - qvsnprintf(emergency_buf, 1023, msg, ap); + qvsnprintf(emergency_buf, 255, msg, ap); qt_message_output(msgType, emergency_buf); } #endif -- cgit v0.12 From d5f6ac0e25ddf84c908965eb5de68fe84cf897f3 Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 10 Jun 2009 17:08:46 +0200 Subject: Changed the openssl include path to use platform_paths.prf. RevBy: Miikka Heikkinen --- src/network/ssl/ssl.pri | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/network/ssl/ssl.pri b/src/network/ssl/ssl.pri index 5427370..dd7b917 100644 --- a/src/network/ssl/ssl.pri +++ b/src/network/ssl/ssl.pri @@ -3,11 +3,7 @@ contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) { symbian { - TRY_INCLUDEPATHS = $${EPOCROOT}epoc32/include $${EPOCROOT}epoc32/include/stdapis $${EPOCROOT}epoc32/include/stdapis/sys $$OS_LAYER_LIBC_SYSTEMINCLUDE - for(p, TRY_INCLUDEPATHS) { - pp = $$join(p, "", "", "/openssl") - exists($$pp):INCLUDEPATH *= $$pp - } + exists($${EPOCROOT}$$OS_LAYER_SSL_SYSTEMINCLUDE):INCLUDEPATH *= $$OS_LAYER_SSL_SYSTEMINCLUDE } else { include($$QT_SOURCE_TREE/config.tests/unix/openssl/openssl.pri) } -- cgit v0.12 From b487ec78791b08d9a6568f4b0ab7c0479b5124a2 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 11 Jun 2009 13:15:41 +0200 Subject: Doc: Moved the definition of QSymbianLeaveException and fixed the brief description. Reviewed-by: Trust Me --- src/corelib/global/qglobal.cpp | 2 +- src/corelib/global/qglobal.h | 90 ++++++++++++++++++++++-------------------- 2 files changed, 48 insertions(+), 44 deletions(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 32c9139..a828e84 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -3258,7 +3258,7 @@ bool QInternal::callFunction(InternalFunction func, void **args) /*! \class QSymbianLeaveException \ingroup qts60 - \brief Exception class representing a Symbian leave code. + \brief The QSymbianLeaveException class represents a block of Symbian leave code. \warning This class is only available on Symbian. */ diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 3d441e3..450fd86 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -2310,6 +2310,50 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathTranslations(); QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf(); #endif +#if defined(Q_OS_SYMBIAN) + +#include + +class QSymbianLeaveException : public std::exception +{ +public: + inline QSymbianLeaveException(int err) : error(err) {} + const char* what() const throw(); +public: + int error; +}; + +Q_CORE_EXPORT void qt_translateSymbianErrorToException(int error); +Q_CORE_EXPORT void qt_translateExceptionToSymbianErrorL(const std::exception& ex); +Q_CORE_EXPORT int qt_translateExceptionToSymbianError(const std::exception& ex); + +#define QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(f) \ + { \ + TInt error; \ + TRAP(error, f); \ + if (error) \ + qt_translateSymbianErrorToException(error); \ + } + +#define QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, f) \ + { \ + err = KErrNone; \ + try { \ + f; \ + } catch (const std::exception &ex) { \ + err = qt_translateExceptionToSymbianError(ex); \ + } \ + } + +#define QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(f) \ + { \ + TInt err; \ + QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, f) \ + User::LeaveIfError(err); \ + } +#endif + + /* This gives us the possibility to check which modules the user can use. These are purely compile time checks and will generate no code. @@ -2383,6 +2427,9 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf(); #define QT_LICENSED_MODULE(x) \ enum QtValidLicenseFor##x##Module { Licensed##x = true }; +/* qdoc is really unhappy with the following block of preprocessor checks, + making it difficult to document classes properly after this point. */ + #if (QT_EDITION & QT_MODULE_CORE) QT_LICENSED_MODULE(Core) #endif @@ -2465,49 +2512,6 @@ QT_LICENSED_MODULE(DBus) # define QT_NO_CONCURRENT_FILTER #endif -#if defined(Q_OS_SYMBIAN) - -#include - -class QSymbianLeaveException : public std::exception -{ -public: - inline QSymbianLeaveException(int err) : error(err) {} - const char* what() const throw(); -public: - int error; -}; - -Q_CORE_EXPORT void qt_translateSymbianErrorToException(int error); -Q_CORE_EXPORT void qt_translateExceptionToSymbianErrorL(const std::exception& ex); -Q_CORE_EXPORT int qt_translateExceptionToSymbianError(const std::exception& ex); - -#define QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(f) \ - { \ - TInt error; \ - TRAP(error, f); \ - if (error) \ - qt_translateSymbianErrorToException(error); \ - } - -#define QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, f) \ - { \ - err = KErrNone; \ - try { \ - f; \ - } catch (const std::exception &ex) { \ - err = qt_translateExceptionToSymbianError(ex); \ - } \ - } - -#define QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(f) \ - { \ - TInt err; \ - QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, f) \ - User::LeaveIfError(err); \ - } -#endif - QT_END_NAMESPACE QT_END_HEADER -- cgit v0.12 From 92c979126ea9d0217ceddb05b7909c12f47dc504 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Thu, 11 Jun 2009 13:09:54 +0200 Subject: Newer version of GCC only recognized __func__ (as a static function). Reviewed-by: aportale --- src/gui/styles/qs60style_simulated.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index 7667f92..ff70e0a 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -61,13 +61,20 @@ QT_BEGIN_NAMESPACE static const quint32 blobVersion = 1; static const int pictureSize = 256; +#if defined(Q_CC_GNU) +#if __GNUC__ >= 2 +#define __FUNCTION__ __func__ +#endif +#endif + + bool saveThemeToBlob(const QString &themeBlob, const QHash &partPictures, const QHash, QColor> &colors) { QFile blob(themeBlob); if (!blob.open(QIODevice::WriteOnly)) { - qWarning() << __FUNCTION__": Could not create blob: " << themeBlob; + qWarning() << __FUNCTION__ << ": Could not create blob: " << themeBlob; return false; } @@ -106,7 +113,7 @@ bool loadThemeFromBlob(const QString &themeBlob, { QFile blob(themeBlob); if (!blob.open(QIODevice::ReadOnly)) { - qWarning() << __FUNCTION__": Could not read blob: " << themeBlob; + qWarning() << __FUNCTION__ << ": Could not read blob: " << themeBlob; return false; } QDataStream blobIn(&blob); @@ -115,7 +122,7 @@ bool loadThemeFromBlob(const QString &themeBlob, blobIn >> version; if (version != blobVersion) { - qWarning() << __FUNCTION__": Invalid blob version: " << version << " ...expected: " << blobVersion; + qWarning() << __FUNCTION__ << ": Invalid blob version: " << version << " ...expected: " << blobVersion; return false; } @@ -148,7 +155,7 @@ bool loadThemeFromBlob(const QString &themeBlob, } if (dataIn.status() != QDataStream::Ok) { - qWarning() << __FUNCTION__": Invalid data blob: " << themeBlob; + qWarning() << __FUNCTION__ << ": Invalid data blob: " << themeBlob; return false; } return true; -- cgit v0.12 From f2d29cf7cdc456e6507064a4f2d9bf33929da471 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Thu, 11 Jun 2009 13:10:39 +0200 Subject: Fix includes, append the .h suffix to the file names. Reviewed-by: Alessandro Portale --- src/gui/styles/qs60style.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 6ee63e6..8f7a61b 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -44,8 +44,8 @@ #include "qapplication.h" #include "qpainter.h" #include "qstyleoption.h" -#include "qresizeevent" -#include "qpixmapcache" +#include "qresizeevent.h" +#include "qpixmapcache.h" #include "qcalendarwidget.h" #include "qdial.h" -- cgit v0.12 From 0eff433bb3406943802e4fff30d4a892cd74a422 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Thu, 11 Jun 2009 13:34:07 +0200 Subject: Fix compile, include qdesktopwidget.h. Reviewed-by: Alessandro Portale --- src/gui/styles/qs60style_simulated.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index ff70e0a..362e29c 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -53,6 +53,7 @@ #include "qmetaobject.h" #include "qdebug.h" #include "qbuffer.h" +#include "qdesktopwidget.h" #if !defined(QT_NO_STYLE_S60) || defined(QT_PLUGIN) -- cgit v0.12 From 434563a6cd857c26d120c08a51742622d675cca0 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Thu, 11 Jun 2009 13:41:56 +0200 Subject: Correcting my previous patch, there is only qevent.h. Reviewed-by: Alessandro Portale --- src/gui/styles/qs60style.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 8f7a61b..0d003a6 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -44,7 +44,7 @@ #include "qapplication.h" #include "qpainter.h" #include "qstyleoption.h" -#include "qresizeevent.h" +#include "qevent.h" #include "qpixmapcache.h" #include "qcalendarwidget.h" -- cgit v0.12 From 82180781420acde96be0e464011ee187a2448541 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Thu, 11 Jun 2009 13:47:52 +0200 Subject: Fix include, it should be pulled from private directory. Reviewed-by: Markku Luukkainen --- src/gui/itemviews/qabstractitemview.cpp | 2 +- src/gui/widgets/qactiontokeyeventmapper.cpp | 2 +- src/gui/widgets/qcombobox.cpp | 2 +- src/gui/widgets/qmenu.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index af84ea6..2576724 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -61,7 +61,7 @@ #ifndef QT_NO_ACCESSIBILITY #include #endif -#include +#include QT_BEGIN_NAMESPACE diff --git a/src/gui/widgets/qactiontokeyeventmapper.cpp b/src/gui/widgets/qactiontokeyeventmapper.cpp index 5cce415..280b1c6 100644 --- a/src/gui/widgets/qactiontokeyeventmapper.cpp +++ b/src/gui/widgets/qactiontokeyeventmapper.cpp @@ -41,7 +41,7 @@ #include "qapplication.h" #include "qevent.h" -#include "QActionToKeyEventMapper_p.h" +#include "qactiontokeyeventmapper_p.h" QT_BEGIN_NAMESPACE diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp index 2da5cd0..a6a5e08 100644 --- a/src/gui/widgets/qcombobox.cpp +++ b/src/gui/widgets/qcombobox.cpp @@ -63,7 +63,7 @@ #include #include #include -#include +#include #ifdef Q_WS_X11 #include #endif diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index 3486574..6d4dcf2 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -60,7 +60,7 @@ #ifndef QT_NO_WHATSTHIS # include #endif -#include +#include #include "qmenu_p.h" #include "qmenubar_p.h" -- cgit v0.12 From e99b5b716400bd64b06d0a45e1979a39d35c3329 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Thu, 11 Jun 2009 13:48:58 +0200 Subject: Added documentation for softkeys --- src/gui/kernel/qwidget.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 103577e..13f031e 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -885,6 +885,34 @@ void QWidget::setAutoFillBackground(bool enabled) \endlist \sa QEvent, QPainter, QGridLayout, QBoxLayout + + \section1 SoftKeys + \since 4.6 + \preliminary + Softkeys are visualization and platform independent way of setting actions + to widgets. Some platforms might omit the visualization part and map + hardware keys directly to actions. Softkeys are needed by users + who want to take full advantage of hardware keys and toolbars + in underlying platform. + + There are three major use cases supported. First one is a mobile device + with keypad navigation and no touch ui. Second use case is a mobile + device with touch ui. Third use case is desktop. For now the softkey API is + only implemented for Series60. + + The most common use case for mobile platforms is to map a menu to + left softkey. Another very common use case is to have buttons from dialog + such as ok/cancel mapped to softkeys which then can be mapped to hardware + keys. + + Softkeys API allows user to set any amount of softkeys. Focused widget + will automatically handle setting the softkeys. Though one should + be aware that there might be restrictions to amount of softkeys that can + be used by the device. + + \o Series60: For series60 menu button is automatically mapped to left + soft key if there is QMainWindow with QMenuBar in widgets parent hierarchy. + */ QWidgetMapper *QWidgetPrivate::mapper = 0; // widget with wid @@ -11555,6 +11583,9 @@ void QWidget::clearMask() } /*! + \preliminary + \since 4.6 + Returns the (possibly empty) list of this widget's softkeys. Returned list cannot be changed. Softkeys should be added and removed via method called setSoftKeys @@ -11573,6 +11604,9 @@ const QList& QWidget::softKeys() const } /*! + \preliminary + \since 4.6 + Sets the softkey \a softkey to this widget's list of softkeys, Setting 0 as softkey will clear all the existing softkeys set to the widget -- cgit v0.12 From 1f996801bf27c422ab4b8f82507d11e031d941d2 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Thu, 11 Jun 2009 14:07:10 +0200 Subject: Polished the documentation of softkey API --- src/gui/kernel/qwidget.cpp | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 13f031e..94c7599 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -889,26 +889,19 @@ void QWidget::setAutoFillBackground(bool enabled) \section1 SoftKeys \since 4.6 \preliminary - Softkeys are visualization and platform independent way of setting actions - to widgets. Some platforms might omit the visualization part and map - hardware keys directly to actions. Softkeys are needed by users - who want to take full advantage of hardware keys and toolbars - in underlying platform. + Softkeys API is a platform independent way of mapping actions to (hardware)keys + and toolbars provided by the underlying platform. + There are three major use cases supported. First one is a mobile device with keypad navigation and no touch ui. Second use case is a mobile device with touch ui. Third use case is desktop. For now the softkey API is only implemented for Series60. - - The most common use case for mobile platforms is to map a menu to - left softkey. Another very common use case is to have buttons from dialog - such as ok/cancel mapped to softkeys which then can be mapped to hardware - keys. - Softkeys API allows user to set any amount of softkeys. Focused widget - will automatically handle setting the softkeys. Though one should - be aware that there might be restrictions to amount of softkeys that can - be used by the device. + QActions are set to widget(s) via softkey API. Actions in focused widget are + mapped to native toolbar or hardware keys. Even though the API allows to set + any amount of widgets there might be physical restrictions to amount of + softkeys that can be used by the device and this shou \o Series60: For series60 menu button is automatically mapped to left soft key if there is QMainWindow with QMenuBar in widgets parent hierarchy. -- cgit v0.12 From d29dbdf82202942a59d12446d99751dc51050b93 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Thu, 11 Jun 2009 14:15:34 +0200 Subject: Even more polish to softkey API --- src/gui/kernel/qwidget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 94c7599..a83a79f 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -901,10 +901,13 @@ void QWidget::setAutoFillBackground(bool enabled) QActions are set to widget(s) via softkey API. Actions in focused widget are mapped to native toolbar or hardware keys. Even though the API allows to set any amount of widgets there might be physical restrictions to amount of - softkeys that can be used by the device and this shou + softkeys that can be used by the device. \o Series60: For series60 menu button is automatically mapped to left soft key if there is QMainWindow with QMenuBar in widgets parent hierarchy. + + \sa softKeys() + \sa setSoftKey() */ -- cgit v0.12 From a44f0d21c607738fa95e3c2354e3fbbd7bc18441 Mon Sep 17 00:00:00 2001 From: mread Date: Thu, 11 Jun 2009 13:57:15 +0100 Subject: new symbian exception safety documentation --- doc/src/symbian-exceptionsafety.qdoc | 184 +++++++++++++++++++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 doc/src/symbian-exceptionsafety.qdoc diff --git a/doc/src/symbian-exceptionsafety.qdoc b/doc/src/symbian-exceptionsafety.qdoc new file mode 100644 index 0000000..212f707 --- /dev/null +++ b/doc/src/symbian-exceptionsafety.qdoc @@ -0,0 +1,184 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \page symbianexceptionsafety.html + \title Exception Safety with Symbian + \ingroup qts60 + \brief A guide to integrating exception safety in Qt with Symbian. + + The following sections describe how Qt code can interoperate with Symbian's + exception safety system. + + \tableofcontents + + \section1 What the problem is + + Qt and Symbian have different exception systems. Qt works with standard C++ + exceptions, whereas Symbian has its TRAP/Leave/CleanupStack system. So, what would + happen if + you mix the two systems? It could go wrong in a number of ways. + + Cleanup ordering would be different between the two. When Symbian code + leaves, the cleanup stack is cleaned up before anything else happens. After + that, the objects on the call stack would be cleaned up as with a normal + exception. So if there are any dependencies between stack based and cleanup stack + owned objects, there could be problems due to this ordering. + + Symbian's \c XLeaveException, which is used when Symbian implements leaves as + exceptions, is not derived from \c std::exception, so would not be caught in + Qt catch statements designed to catch \c std::exception. + + Qt's and standard C++'s \c std::exception derived exceptions result in program + termination if they fall back to a Symbian TRAP. + + These problems can be solved with barrier macros and helper functions that + will translate between the two exception systems. Use them, in Qt code, + whenever calling into or being called from Symbian code. + + \section1 Qt calls to Symbian + + When calling Symbian leaving functions from Qt code, we want to translate + Symbian leaves to standard C++ exceptions. The following help is provided: + + \list + \o \l qt_translateSymbianErrorToException(int error) takes a Symbian + error code and throws an appropriate exception to represent it. + This will do nothing if the error code is not in fact an error. The + function is equivalent to Symbian's \c User::LeaveIfError. + \o \l QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(f) takes a Symbian leaving + code fragment f and runs it under a trap harness converting any resulting + error into an exception. + \o \c TRAP and \c TRAPD from the Symbian libraries can be used to convert + leaves to error codes. + \endlist + + \code + HBufC* buf=0; + // this will throw a std::bad_alloc because we've asked for too much memory + QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(buf = HBufC::NewL(100000000)); + + _LIT(KStr,"abc"); + TInt pos = KStr().Locate('c'); + // pos is a good value, >= 0, so no exception is thrown + qt_translateSymbianErrorToException(pos); + + pos = KStr().Locate('d'); + // pos == KErrNotFound, so this throws an exception + qt_translateSymbianErrorToException(pos); + \endcode + + \section1 Qt called from Symbian + + When Qt code is called from Symbian, we want to translate standard C++ + exceptions to Symbian leaves or error codes. The following help is + provided: + + \list + \o \l qt_translateExceptionToSymbianError(const std::exception& ex) - + this takes a standard exception and gives an appropriate Symbian + error code. If no mapping is known for the exception type, + \c KErrGeneral is returned. + \o \l qt_translateExceptionToSymbianErrorL(const std::exception& ex) - + this takes a standard exception and generates an appropriate Symbian + leave. + \o \l QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, f) - this macro + takes the standard C++ code fragment \c f, catches any std::exceptions + thrown from it, and sets err to the corresponding Symbian error code. + err is set to \c KErrNone otherwise. + \o \l QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(f) - this macro takes the + standard C++ code fragment \c f, catches any std::exceptions thrown from + it, and throws a corresponding Symbian leave. + \endlist + + \code + TInt DoTickL() // called from an active object RunL, ie Symbian leaves expected + { + // without the translation to Symbian Leave, we get a USER:0 panic + QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE({ + int* x = new int[100000000]; // compiled as Qt code, will throw std::bad_alloc + delete [] x; + }); + return 0; + } + \endcode + + \section1 Common sense things + + Try to minimise the interleaving of Symbian and Qt code, every switch + requires a barrier. Grouping the code styles in different blocks will + minimise the problems. For instance, examine the following code. + + \code + 1. TRAPD(err, m_playUtility = CMdaAudioPlayerUtility::NewL(*this); + 2. QString filepath = QFileInfo( m_sound->fileName() ).absoluteFilePath(); + 3. filepath = QDir::toNativeSeparators(filepath); + 4. m_playUtility->OpenFileL(qt_QString2TPtrC(filepath))); + \endcode + + Line 1 starts a Symbian leave handling block, which is good because it + also uses a Symbian leave generating function. + + Line 2 creates a \l QString, uses \l QFileInfo and various member functions. + These could all throw exceptions, which is not good inside a \c TRAP block. + + Line 3 is unclear as to whether it might throw an exception, but since + it's dealing with strings it probably does, again bad. + + Line 4 is tricky, it calls a leaving function which is ok within a \c TRAP, + but it also uses \l qt_QString2TPtrC. You might think this is safe, but + there is a potential realloc call in there, so this can cause an unwelcome + exception. + + We could rewrite this with nested exception translations, but it's much + easier to refactor it. + + \code + QString filepath = QFileInfo( m_sound->fileName() ).absoluteFilePath(); + filepath = QDir::toNativeSeparators(filepath); + TPtrC filepathPtr(qt_QString2TPtrC(filepath)); + TRAPD(err, m_playUtility = CMdaAudioPlayerUtility::NewL(*this); + m_playUtility->OpenFileL(filepathPtr)); + \endcode + + Now the exception generating functions are separated from the leaving + functions. +*/ -- cgit v0.12 From a986d3f4948a782a8df71849464161bc4eff0766 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Thu, 11 Jun 2009 16:28:41 +0200 Subject: Updated example to tell which softkey was pressed --- examples/widgets/softkeys/softkeys.cpp | 24 ++++++++++++++++-------- examples/widgets/softkeys/softkeys.h | 3 +++ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/examples/widgets/softkeys/softkeys.cpp b/examples/widgets/softkeys/softkeys.cpp index edf38b9..b29be2b 100644 --- a/examples/widgets/softkeys/softkeys.cpp +++ b/examples/widgets/softkeys/softkeys.cpp @@ -3,6 +3,15 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { + central = new QWidget(this); + setCentralWidget(central); + infoLabel = new QLabel(tr("Funky stuff in menu!")); + + layout = new QVBoxLayout; + layout->addWidget(infoLabel); + central->setLayout(layout); + central->setFocusPolicy(Qt::TabFocus); + fileMenu = menuBar()->addMenu(tr("&File")); openDialogAct = new QAction(tr("&Open Dialog"), this); addSoftKeysAct = new QAction(tr("&Add Softkeys"), this); @@ -13,12 +22,6 @@ MainWindow::MainWindow(QWidget *parent) connect(openDialogAct, SIGNAL(triggered()), this, SLOT(openDialog())); connect(addSoftKeysAct, SIGNAL(triggered()), this, SLOT(addSoftKeys())); connect(clearSoftKeysAct, SIGNAL(triggered()), this, SLOT(clearSoftKeys())); - QWidget *central = new QWidget(this); - central->setLayout(new QVBoxLayout); -// central->setFocus(); - setCentralWidget(central); - QPushButton button1; -// QAction* menuAction = } MainWindow::~MainWindow() @@ -43,19 +46,24 @@ void MainWindow::addSoftKeys() QList softkeys; softkeys.append(ok); softkeys.append(cancel); - setSoftKeys(softkeys); + central->setSoftKeys(softkeys); + central->setFocus(); } void MainWindow::clearSoftKeys() { - setSoftKey(0); + central->setSoftKey(0); } void MainWindow::okPressed() { + infoLabel->setText(tr("OK pressed")); + central->setSoftKey(0); } void MainWindow::cancelPressed() { + infoLabel->setText(tr("Cancel pressed")); + central->setSoftKey(0); } diff --git a/examples/widgets/softkeys/softkeys.h b/examples/widgets/softkeys/softkeys.h index 2bc74ba..11db419 100644 --- a/examples/widgets/softkeys/softkeys.h +++ b/examples/widgets/softkeys/softkeys.h @@ -59,6 +59,9 @@ public: MainWindow(QWidget *parent = 0); ~MainWindow(); private: + QVBoxLayout *layout; + QWidget *central; + QLabel *infoLabel; QMenu* fileMenu; QAction* openDialogAct; QAction* addSoftKeysAct; -- cgit v0.12 From a28afcd379faa0c7af2bec23aef8d4023623e616 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Thu, 11 Jun 2009 18:23:13 +0200 Subject: Initialize softKeyRole in the constructor. Reviewed-by: Alessandro Portale --- src/gui/kernel/qaction.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qaction.cpp b/src/gui/kernel/qaction.cpp index 8263cbc..b1db8d6 100644 --- a/src/gui/kernel/qaction.cpp +++ b/src/gui/kernel/qaction.cpp @@ -81,7 +81,8 @@ static QString qt_strippedText(QString s) QActionPrivate::QActionPrivate() : group(0), enabled(1), forceDisabled(0), visible(1), forceInvisible(0), checkable(0), checked(0), separator(0), fontSet(false), - menuRole(QAction::TextHeuristicRole), iconVisibleInMenu(-1) + menuRole(QAction::TextHeuristicRole), softKeyRole(QAction::OptionsSoftKey), + iconVisibleInMenu(-1) { #ifdef QT3_SUPPORT static int qt_static_action_id = -1; -- cgit v0.12 From 8a0aa903bcb32a51304557e0e724478aca140233 Mon Sep 17 00:00:00 2001 From: Espen Riskedal Date: Thu, 11 Jun 2009 18:46:16 +0200 Subject: add correct license headers --- examples/widgets/softkeys/main.cpp | 36 ++++++++++++++++++++++--- examples/widgets/softkeys/softkeys.cpp | 41 +++++++++++++++++++++++++++++ src/corelib/tools/qscopedpointer.cpp | 34 ++++++++++++++++++++++-- src/gui/widgets/qactiontokeyeventmapper_p.h | 13 ++++++++- 4 files changed, 118 insertions(+), 6 deletions(-) diff --git a/examples/widgets/softkeys/main.cpp b/examples/widgets/softkeys/main.cpp index a355f93..a544b28 100644 --- a/examples/widgets/softkeys/main.cpp +++ b/examples/widgets/softkeys/main.cpp @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the examples of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/examples/widgets/softkeys/softkeys.cpp b/examples/widgets/softkeys/softkeys.cpp index b29be2b..87d11c9 100644 --- a/examples/widgets/softkeys/softkeys.cpp +++ b/examples/widgets/softkeys/softkeys.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + #include "softkeys.h" MainWindow::MainWindow(QWidget *parent) diff --git a/src/corelib/tools/qscopedpointer.cpp b/src/corelib/tools/qscopedpointer.cpp index f34aec8..0239575 100644 --- a/src/corelib/tools/qscopedpointer.cpp +++ b/src/corelib/tools/qscopedpointer.cpp @@ -3,9 +3,39 @@ ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/src/gui/widgets/qactiontokeyeventmapper_p.h b/src/gui/widgets/qactiontokeyeventmapper_p.h index da336e8..c54e612 100644 --- a/src/gui/widgets/qactiontokeyeventmapper_p.h +++ b/src/gui/widgets/qactiontokeyeventmapper_p.h @@ -42,6 +42,17 @@ #ifndef QACTIONTOKEYEVENTMAPPER_P_H #define QACTIONTOKEYEVENTMAPPER_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include #include "QtGui/qaction.h" QT_BEGIN_HEADER @@ -67,4 +78,4 @@ QT_END_NAMESPACE QT_END_HEADER -#endif //QACTIONTOKEYEVENTMAPPER_H +#endif //QACTIONTOKEYEVENTMAPPER_P_H -- cgit v0.12 From 213b58ec4401170813801a26708c87032196a5d9 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Thu, 11 Jun 2009 18:49:23 +0200 Subject: Using QPixmap as paint device. Makes more sense in this case. At least on X11 and MacOS. Reviewed-by: Ariya Hidayat --- src/gui/styles/qs60style_simulated.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index 362e29c..684f232 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -274,7 +274,7 @@ QPixmap QS60StylePrivate::frame(SkinFrameElements frame, const QSize &size, const QRect leftRect = rightRect.translated(cornerWidth - rectWidth, 0); const QRect centerRect = drawOnlyCenter ? rect : rect.adjusted(cornerWidth, cornerWidth, -cornerWidth, -cornerWidth); - QImage result(size, QImage::Format_ARGB32); + QPixmap result(size); result.fill(Qt::transparent); QPainter painter(&result); @@ -303,7 +303,7 @@ QPixmap QS60StylePrivate::frame(SkinFrameElements frame, const QSize &size, drawPart(center, &painter, centerRect, flags); #endif - return QPixmap::fromImage(result); + return result; } void QS60StylePrivate::setStyleProperty_specific(const char *name, const QVariant &value) -- cgit v0.12 From 17f4de60fb4e13e470ae2101460174b41e828e1f Mon Sep 17 00:00:00 2001 From: Espen Riskedal Date: Thu, 11 Jun 2009 19:44:44 +0200 Subject: start on changes file for Tower release --- dist/changes-4.5.2-tower | 101 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 dist/changes-4.5.2-tower diff --git a/dist/changes-4.5.2-tower b/dist/changes-4.5.2-tower new file mode 100644 index 0000000..1a039ba --- /dev/null +++ b/dist/changes-4.5.2-tower @@ -0,0 +1,101 @@ +Qt 4.5.2-tower +--------------- + +The Qt for S60 "Tower" release is the fifth pre-release from the Qt for +S60 porting project. "Tower" is based on the Qt 4.5 codebase. + +Up to and including SHA: not yet started :D + +Lists just S60 fixes, for general 4.5.0 changes go to: + + http://www.qtsoftware.com/developer/changes/changes-4.5.0 + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Task Tracker: + + http://qtsoftware.com/developer/task-tracker + +Each of these identifiers can be entered in the task tracker to obtain +more information about a particular change. Sometimes the task is internal +and cannot be viewed by the public, a lot of them are non-public for Qt for +S60 at the moment. + +**************************************************************************** +* New features * +**************************************************************************** + +New modules +----------- + +- QtSql + * todo +- QtWebkit + * todo +- Phonon + * todo + + +New classes +------------ + +- todo + * todo + +Ported classes +-------------- + +- todo + * todo + +Features +-------- + +- todo + * todo + +Optimizations +------------- + +- todo + * todo + +**************************************************************************** +* Build issues * +**************************************************************************** + +- todo + +**************************************************************************** +* Changes to existing classes * +**************************************************************************** + +- todo + * todo + +**************************************************************************** +* Examples and demos * +**************************************************************************** + +- todo + * todo + +**************************************************************************** +* Tools * +**************************************************************************** + +- todo + * todo + +**************************************************************************** +* Plugins * +**************************************************************************** + +- todo + * todo + +**************************************************************************** +* Important Behavior Changes * +**************************************************************************** + +- todo + * todo -- cgit v0.12 From 09e3e740adfc08723275c8c7d9860d37fc61d8dd Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Wed, 3 Jun 2009 11:48:02 +1000 Subject: Fixed recursive QMAKE_EXTRA_TARGETS not being generated correctly for SUBDIRS projects when using abld. Acked-by: Miikka Heikkinen --- qmake/generators/makefile.cpp | 101 +++++++++++++++++------------- qmake/generators/makefile.h | 3 + qmake/generators/symbian/symmake_abld.cpp | 12 +++- 3 files changed, 70 insertions(+), 46 deletions(-) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 82703c5..5f38bc7 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2234,8 +2234,8 @@ MakefileGenerator::writeHeader(QTextStream &t) t << endl; } -void -MakefileGenerator::writeSubDirs(QTextStream &t) +QList +MakefileGenerator::findSubDirsSubTargets() const { QList targets; { @@ -2332,6 +2332,13 @@ MakefileGenerator::writeSubDirs(QTextStream &t) } } } + return targets; +} + +void +MakefileGenerator::writeSubDirs(QTextStream &t) +{ + QList targets = findSubDirsSubTargets(); t << "first: make_default" << endl; int flags = SubTargetInstalls; if(project->isActiveConfig("ordered")) @@ -2348,39 +2355,43 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QListtarget; + t << endl << endl; + } writeExtraVariables(t); - t << "SUBTARGETS = "; // subtargets are sub-directory - for(int target = 0; target < targets.size(); ++target) - t << " \\\n\t\t" << targets.at(target)->target; - t << endl << endl; QStringList targetSuffixes; const QString abs_source_path = project->first("QMAKE_ABSOLUTE_SOURCE_PATH"); - targetSuffixes << "make_default" << "make_first" << "all" << "clean" << "distclean" - << QString((flags & SubTargetInstalls) ? "install_subtargets" : "install") - << QString((flags & SubTargetInstalls) ? "uninstall_subtargets" : "uninstall"); + if (!(flags & SubTargetSkipDefaultTargets)) { + targetSuffixes << "make_default" << "make_first" << "all" << "clean" << "distclean" + << QString((flags & SubTargetInstalls) ? "install_subtargets" : "install") + << QString((flags & SubTargetInstalls) ? "uninstall_subtargets" : "uninstall"); + } // generate target rules for(int target = 0; target < targets.size(); ++target) { @@ -2500,23 +2511,25 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QListvalues("QMAKE_INTERNAL_QMAKE_DEPS").indexOf("qmake_all") == -1) - project->values("QMAKE_INTERNAL_QMAKE_DEPS").append("qmake_all"); + if (!(flags & SubTargetSkipDefaultTargets)) { + if(project->values("QMAKE_INTERNAL_QMAKE_DEPS").indexOf("qmake_all") == -1) + project->values("QMAKE_INTERNAL_QMAKE_DEPS").append("qmake_all"); - writeMakeQmake(t); + writeMakeQmake(t); - t << "qmake_all:"; - if(!targets.isEmpty()) { - for(QList::Iterator it = targets.begin(); it != targets.end(); ++it) { - if(!(*it)->profile.isEmpty()) - t << " " << (*it)->target << "-" << "qmake_all"; + t << "qmake_all:"; + if(!targets.isEmpty()) { + for(QList::Iterator it = targets.begin(); it != targets.end(); ++it) { + if(!(*it)->profile.isEmpty()) + t << " " << (*it)->target << "-" << "qmake_all"; + } } + if(project->isEmpty("QMAKE_NOFORCE")) + t << " FORCE"; + if(project->isActiveConfig("no_empty_targets")) + t << "\n\t" << "@cd ."; + t << endl << endl; } - if(project->isEmpty("QMAKE_NOFORCE")) - t << " FORCE"; - if(project->isActiveConfig("no_empty_targets")) - t << "\n\t" << "@cd ."; - t << endl << endl; for(int s = 0; s < targetSuffixes.size(); ++s) { QString suffix = targetSuffixes.at(s); diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h index 9896c1d..a6eec52 100644 --- a/qmake/generators/makefile.h +++ b/qmake/generators/makefile.h @@ -121,9 +121,12 @@ protected: enum SubTargetFlags { SubTargetInstalls=0x01, SubTargetOrdered=0x02, + SubTargetSkipDefaultVariables=0x04, + SubTargetSkipDefaultTargets=0x08, SubTargetsNoFlags=0x00 }; + QList findSubDirsSubTargets() const; void writeSubTargets(QTextStream &t, QList subtargets, int flags); //extra compiler interface diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp index 32d08f6..8501224 100644 --- a/qmake/generators/symbian/symmake_abld.cpp +++ b/qmake/generators/symbian/symmake_abld.cpp @@ -184,6 +184,10 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool t << "#" << endl; t << "# ==============================================================================" << "\n" << endl; t << endl; + QString ofile = Option::fixPathToTargetOS(Option::output.fileName()); + if(ofile.lastIndexOf(Option::dir_sep) != -1) + ofile = ofile.right(ofile.length() - ofile.lastIndexOf(Option::dir_sep) -1); + t << "MAKEFILE = " << ofile << endl; t << "QMAKE = " << Option::fixPathToTargetOS(var("QMAKE_QMAKE")) << endl; t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl; @@ -273,8 +277,6 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool } - writeExtraTargets(t); - // pre_targetdeps target depends on: // - all targets specified in PRE_TARGETDEPS // - the GENERATED_SOURCES sources (so that they get generated) @@ -285,6 +287,7 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool // so supporting generating sources is the best we can do. This is enough for mocs. if (!isSubdirs) { + writeExtraTargets(t); writeExtraCompilerTargets(t); t << CREATE_TEMPS_TARGET ":" << endl; @@ -345,6 +348,11 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool } t << endl; } + else { + QList subtargets = findSubDirsSubTargets(); + writeSubTargets(t, subtargets, SubTargetSkipDefaultVariables|SubTargetSkipDefaultTargets); + qDeleteAll(subtargets); + } writeDeploymentTargets(t); -- cgit v0.12 From 9598176349d070966fa84eeb8c77b23d0c9644af Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Tue, 9 Jun 2009 09:32:50 +1000 Subject: Fixed recursive QMAKE_EXTRA_TARGETS not being generated correctly for SUBDIRS projects when using sbsv2. Acked-by: Miikka Heikkinen --- qmake/generators/symbian/symmake_sbsv2.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp index 33431d2..7b739c7 100644 --- a/qmake/generators/symbian/symmake_sbsv2.cpp +++ b/qmake/generators/symbian/symmake_sbsv2.cpp @@ -124,6 +124,10 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo t << "#" << endl; t << "# ==============================================================================" << "\n" << endl; t << endl; + QString ofile = Option::fixPathToTargetOS(Option::output.fileName()); + if(ofile.lastIndexOf(Option::dir_sep) != -1) + ofile = ofile.right(ofile.length() - ofile.lastIndexOf(Option::dir_sep) -1); + t << "MAKEFILE = " << ofile << endl; t << "QMAKE = " << Option::fixPathToTargetOS(var("QMAKE_QMAKE")) << endl; t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl; @@ -206,11 +210,15 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo // Add all extra targets including extra compiler targest also to wrapper makefile, // even though many of them may have already been added to bld.inf as FLMs. // This is to enable use of targets like 'mocables', which call targets generated by extra compilers. - t << extraTargetsCache; - if (!isSubdirs) { + t << extraTargetsCache; t << extraCompilersCache; } + else { + QList subtargets = findSubDirsSubTargets(); + writeSubTargets(t, subtargets, SubTargetSkipDefaultVariables|SubTargetSkipDefaultTargets); + qDeleteAll(subtargets); + } t << "dodistclean:" << endl; foreach(QString item, project->values("SUBDIRS")) { -- cgit v0.12 From f0044749d5e9905e2f7af9c0aa54e4d77cab13af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 12 Jun 2009 09:12:07 +0300 Subject: S60Style: Remove key accelerators --- src/gui/styles/qs60style.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 0d003a6..4ba5351 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2314,6 +2314,8 @@ int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w case SH_BlinkCursorWhenTextSelected: retValue = true; break; + case SH_UnderlineShortcut: + retValue = 0; default: break; } -- cgit v0.12 From e0690577327097ec3d9be99205bfcf01f8404d23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 12 Jun 2009 10:36:42 +0300 Subject: S60Style: Drivelist combobox in AddressBook example causes crash due to null pointer use in S60Style. --- src/gui/styles/qs60style.cpp | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 4ba5351..83f1698 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -574,7 +574,7 @@ void QS60StylePrivate::drawRow(QS60StyleEnums::SkinParts start, if (startRect.topRight().y() > endRect.bottomLeft().y()) { const int overlap = (startRect.topRight().y() - endRect.bottomLeft().y())>>1; startRect.setHeight(startRect.height()-overlap); - endRect.adjust(0,overlap,0,0); + endRect.adjust(0,overlap,0,0); } } @@ -1129,7 +1129,7 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom copy.state |= State_Raised; copy.state &= ~State_Sunken; } - pe = (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus) ? + pe = (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus) ? PE_IndicatorSpinPlus : PE_IndicatorSpinUp; @@ -1156,7 +1156,7 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom copy.state |= State_Raised; copy.state &= ~State_Sunken; } - pe = (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus) ? + pe = (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus) ? PE_IndicatorSpinMinus : PE_IndicatorSpinDown; @@ -1586,12 +1586,12 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, QPixmap tabIcon = optionTab.icon.pixmap(iconSize, (optionTab.state & State_Enabled) ? QIcon::Normal : QIcon::Disabled); if (tab->text.isEmpty()) - painter->drawPixmap(tr.center().x() - (tabIcon.height() >>1), - tr.center().y() - (tabIcon.height() >>1), + painter->drawPixmap(tr.center().x() - (tabIcon.height() >>1), + tr.center().y() - (tabIcon.height() >>1), tabIcon); else - painter->drawPixmap(tr.left() + tabOverlap, - tr.center().y() - (tabIcon.height() >>1), + painter->drawPixmap(tr.left() + tabOverlap, + tr.center().y() - (tabIcon.height() >>1), tabIcon); tr.setLeft(tr.left() + iconSize.width() + 4); } @@ -1822,7 +1822,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, } } QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_TableHeaderItem, painter, mtyRect, adjFlags); - + QRegion clipRegion = painter->clipRegion(); painter->setClipRect(option->rect); drawControl(CE_HeaderSection, header, painter, widget); @@ -2038,8 +2038,18 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti #endif //QT_NO_SPINBOX case PE_FrameFocusRect: // Calendar widget and combox both do not use styled itemDelegate - if (!(widget && qobject_cast(widget->parent())) || - qobject_cast(widget)) { + if ( widget && ( +#ifndef QT_NO_CALENDARWIDGET + (qobject_cast(widget->parent())) +#else + false +#endif //QT_NO_CALENDARWIDGET +#ifndef QT_NO_COMBOBOX + || (qobject_cast(widget)) +#else + || false +#endif //QT_NO_COMBOBOX + )) { // no focus selection for touch if (option->state & State_HasFocus && !QS60StylePrivate::isTouchSupported()) { painter->save(); @@ -2292,9 +2302,9 @@ int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w retValue = true; break; case SH_ProgressDialog_TextLabelAlignment: - retValue = (QApplication::layoutDirection() == Qt::LeftToRight) ? + retValue = (QApplication::layoutDirection() == Qt::LeftToRight) ? Qt::AlignLeft : - Qt::AlignRight; + Qt::AlignRight; break; case SH_Menu_SubMenuPopupDelay: retValue = 300; @@ -2408,7 +2418,7 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple const int y = frameThickness + spinbox->rect.y(); const int x = spinbox->rect.x() + spinbox->rect.width() - frameThickness - 2*buttonSize.width(); - + switch (scontrol) { case SC_SpinBoxUp: if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons) @@ -2643,7 +2653,7 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con // a) highlight border does not cross the rect // b) in s60 list checkbox is smaller than normal checkbox //todo; magic three - ret.setRect(opt->rect.left()+3, opt->rect.top() + heightOffset, + ret.setRect(opt->rect.left()+3, opt->rect.top() + heightOffset, indicatorWidth-3, indicatorHeight-3); } else { ret.setRect(opt->rect.right() - indicatorWidth - spacing, opt->rect.top() + heightOffset, @@ -2782,8 +2792,8 @@ QIcon QS60Style::standardIconImplementation(StandardPixmap standardIcon, QS60StyleEnums::SkinParts part; QS60StylePrivate::SkinElementFlags adjustedFlags; if (option) - adjustedFlags = (option->state & State_Enabled) ? - QS60StylePrivate::SF_StateEnabled : + adjustedFlags = (option->state & State_Enabled) ? + QS60StylePrivate::SF_StateEnabled : QS60StylePrivate::SF_StateDisabled; switch(standardIcon) { -- cgit v0.12 From 915e8a40866d0e86bcaaf3d72d26897bebf00a41 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Fri, 12 Jun 2009 11:03:55 +0300 Subject: Fixes FEP crash when changing the focused Qt widget to NULL. --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index b183e1b..7d79422 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -329,6 +329,8 @@ void QCoeFepInputContext::updateHints() m_lastImHints = hints; applyHints(hints); } + } else { + CCoeEnv::Static()->InputCapabilitiesChanged(); } } -- cgit v0.12 From bccd5442f24ce18e08ec5a5e78ccc6566f4e0463 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 12 Jun 2009 11:27:50 +0300 Subject: More robust handling for stdapis paths --- mkspecs/common/symbian/symbian.conf | 3 --- mkspecs/features/symbian/platform_paths.prf | 41 +++++++++++++++++++---------- mkspecs/features/symbian/stl.prf | 3 +-- src/network/ssl/ssl.pri | 6 +---- 4 files changed, 29 insertions(+), 24 deletions(-) diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf index 6ae4c4a..663a1df 100644 --- a/mkspecs/common/symbian/symbian.conf +++ b/mkspecs/common/symbian/symbian.conf @@ -115,10 +115,7 @@ INCLUDEPATH = \ $$[QT_INSTALL_PREFIX]/mkspecs/common/symbian/stl-off \ $$[QT_INSTALL_PREFIX]/mkspecs/common/symbian \ $${EPOCROOT}epoc32/include \ - $${EPOCROOT}epoc32/include/stdapis \ - $${EPOCROOT}epoc32/include/stdapis/sys \ $$OS_LAYER_LIBC_SYSTEMINCLUDE \ - $${OS_LAYER_LIBC_SYSTEMINCLUDE}/sys \ $$INCLUDEPATH # Supports S60 3.0, 3.1, 3.2 and 5.0 by default diff --git a/mkspecs/features/symbian/platform_paths.prf b/mkspecs/features/symbian/platform_paths.prf index c9972cc..419982d 100644 --- a/mkspecs/features/symbian/platform_paths.prf +++ b/mkspecs/features/symbian/platform_paths.prf @@ -205,16 +205,17 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { # part of stdapis. Append to INCLUDEPATH in pro-file. # --------------------------------------- - OS_LAYER_LIBC_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis) + OS_LAYER_LIBC_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis) \ + $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/sys) OS_LAYER_GLIB_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0) \ $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0/glib) \ $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0/gObject) - OS_LAYER_SSL_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/openssl) - exists($$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5)) { + # stlportv5 is preferred over stlport as it has the throwing version of operator new + exists($${EPOCROOT}$$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5)) { OS_LAYER_STDCPP_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5) } else { OS_LAYER_STDCPP_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlport) @@ -408,28 +409,40 @@ exists($${EPOCROOT}epoc32/include/platform_paths.prf) { # part of stdapis. Append to INCLUDEPATH in pro-file. # --------------------------------------- - OS_LAYER_LIBC_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis) + OS_LAYER_LIBC_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis) \ + $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/sys) \ + /epoc32/include/stdapis \ + /epoc32/include/stdapis/sys OS_LAYER_GLIB_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0) \ $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0/glib) \ - $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0/gObject) + $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/glib-2.0/gObject) \ + /epoc32/include/stdapis/glib-2.0 \ + /epoc32/include/stdapis/glib-2.0/glib \ + /epoc32/include/stdapis/glib-2.0/gObject - - OS_LAYER_SSL_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/openssl) + OS_LAYER_SSL_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/openssl) \ + /epoc32/include/stdapis/openssl # stlportv5 is preferred over stlport as it has the throwing version of operator new - exists($$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5)) { - OS_LAYER_STDCPP_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5) + exists($${EPOCROOT}$$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5))|exists($${EPOCROOT}epoc32/include/stdapis/stlportv5) { + OS_LAYER_STDCPP_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5) \ + /epoc32/include/stdapis/stlportv5 } else { - OS_LAYER_STDCPP_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlport) + OS_LAYER_STDCPP_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlport) \ + /epoc32/include/stdapis/stlport } - - OS_LAYER_BOOST_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/boost) + + OS_LAYER_BOOST_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/boost) \ + /epoc32/include/stdapis/boost OS_LAYER_DBUS_SYSTEMINCLUDE = $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/dbus-1.0) \ - $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/dbus-1.0/dbus) + $$OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/dbus-1.0/dbus) \ + /epoc32/include/stdapis/dbus-1.0 \ + /epoc32/include/stdapis/dbus-1.0/dbus - OS_LAYER_LIBUTILITY_SYSTEMINCLUDE = $$OS_LAYER_PLATFORM_EXPORT_PATH(stdapis/utility) + OS_LAYER_LIBUTILITY_SYSTEMINCLUDE = $$OS_LAYER_PLATFORM_EXPORT_PATH(stdapis/utility) \ + /epoc32/include/stdapis/utility # --------------------------------------- # Definitions to export IBY files to different folders where they will be taken diff --git a/mkspecs/features/symbian/stl.prf b/mkspecs/features/symbian/stl.prf index f01cc18..9eb6b86 100644 --- a/mkspecs/features/symbian/stl.prf +++ b/mkspecs/features/symbian/stl.prf @@ -9,8 +9,7 @@ DEFINES *= $$STLLIB_USAGE_DEFINES # Legacy support requires some hardcoded stdapis paths. # Note: Also the new header is used from STL when it is enabled -INCLUDEPATH += $$OS_LAYER_STDCPP_SYSTEMINCLUDE \ - $${EPOCROOT}epoc32/include/stdapis/stlport +INCLUDEPATH += $$OS_LAYER_STDCPP_SYSTEMINCLUDE # Remove mkspecs/common/symbian/stl-off from beginning of includepath # in order to use new and delete operators from STL diff --git a/src/network/ssl/ssl.pri b/src/network/ssl/ssl.pri index 5427370..6021d5d 100644 --- a/src/network/ssl/ssl.pri +++ b/src/network/ssl/ssl.pri @@ -3,11 +3,7 @@ contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) { symbian { - TRY_INCLUDEPATHS = $${EPOCROOT}epoc32/include $${EPOCROOT}epoc32/include/stdapis $${EPOCROOT}epoc32/include/stdapis/sys $$OS_LAYER_LIBC_SYSTEMINCLUDE - for(p, TRY_INCLUDEPATHS) { - pp = $$join(p, "", "", "/openssl") - exists($$pp):INCLUDEPATH *= $$pp - } + INCLUDEPATH *= $$OS_LAYER_SSL_SYSTEMINCLUDE } else { include($$QT_SOURCE_TREE/config.tests/unix/openssl/openssl.pri) } -- cgit v0.12 From 97b5a40c5228aff51f7ce63c243bedcf1fc82452 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Fri, 12 Jun 2009 12:52:58 +0300 Subject: Fixed layout when orientation changed via AknAppUi::SetOrientationL. Task: 252798 --- src/gui/kernel/qapplication_s60.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index b33fe19..1347c06 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1088,6 +1088,9 @@ void QApplication::symbianResourceChange(int type) switch (type) { case KEikDynamicLayoutVariantSwitch: { + if (S60) + S60->updateScreenSize(); + #ifndef QT_NO_STYLE_S60 QS60Style *s60Style = 0; -- cgit v0.12 From 2a7d22330226c0a1ef6bb5c35f07241a05429913 Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Fri, 12 Jun 2009 14:09:37 +0200 Subject: bug fix for doubleclick event for symbian --- src/gui/kernel/qapplication_s60.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 1347c06..4c008fb 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -392,7 +392,7 @@ void QSymbianControl::HandlePointerEventL(const TPointerEvent& pEvent) alienWidget = S60->mousePressTarget; if (alienWidget != S60->lastPointerEventTarget) - if (type == QEvent::MouseButtonPress || QEvent::MouseButtonDblClick || type == QEvent::MouseMove) + if (type == QEvent::MouseButtonPress || type == QEvent::MouseButtonDblClick || type == QEvent::MouseMove) { //moved to another widget, create enter and leave events if (S60->lastPointerEventTarget) -- cgit v0.12 From 32bd7c09327f0234ac5415d029d76aa3bab1feaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 12 Jun 2009 17:38:20 +0300 Subject: S60Style: Itemview active icons are rendered as disabled and vice versa. --- src/gui/styles/qs60style.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 83f1698..c6118d6 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -1387,7 +1387,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ListHighlight, painter, option->rect, flags); // draw the icon - const QIcon::Mode mode = !(voptAdj.state & QStyle::State_Enabled) ? QIcon::Normal : QIcon::Disabled; + const QIcon::Mode mode = (voptAdj.state & QStyle::State_Enabled) ? QIcon::Normal : QIcon::Disabled; const QIcon::State state = voptAdj.state & QStyle::State_Open ? QIcon::On : QIcon::Off; voptAdj.icon.paint(painter, iconRect, voptAdj.decorationAlignment, mode, state); -- cgit v0.12 From ff0e9d7f950d757ccbe1bb5267cd514348dadf35 Mon Sep 17 00:00:00 2001 From: mread Date: Fri, 12 Jun 2009 16:17:21 +0100 Subject: extra autotests for exceptions --- .../qmainexceptions/tst_qmainexceptions.cpp | 205 +++++++++++++++++++++ 1 file changed, 205 insertions(+) diff --git a/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp b/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp index 103dd62..db80496 100644 --- a/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp +++ b/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp @@ -40,21 +40,38 @@ ****************************************************************************/ #include +#include #ifdef Q_OS_SYMBIAN +typedef void TLeavingFunc(); + class tst_qmainexceptions : public QObject { Q_OBJECT public: tst_qmainexceptions(){}; ~tst_qmainexceptions(){}; + + void TestSchedulerCatchesError(TLeavingFunc* f, int error); + void TestSymbianRoundTrip(int leave, int trap); + + bool event(QEvent *event); + public slots: void initTestCase(); private slots: void trap(); void cleanupstack(); void leave(); + void testTranslateBadAlloc(); + void testTranslateBigAlloc(); + void testRoundTrip(); + void testTrap(); + void testPropagation(); + void testDtor1(); + void testDtor2(); + void testNestedExceptions(); }; class CDummy : public CBase @@ -100,6 +117,194 @@ void tst_qmainexceptions::leave() __UHEAP_MARKEND; } +class CTestActive : public CActive + { +public: + CTestActive(TLeavingFunc* aFunc) : CActive(EPriorityStandard), iFunc(aFunc) + { + CActiveScheduler::Add(this); + } + ~CTestActive() + { + Cancel(); + } + void DoCancel() + {} + void Test() + { + // complete this AO in a nested scheduler, to make it synchronous + TRequestStatus* s = &iStatus; + SetActive(); + User::RequestComplete(s, KErrNone); + CActiveScheduler::Start(); + } + void RunL() + { + (*iFunc)(); + CActiveScheduler::Stop(); // will only get here if iFunc does not leave + } + TInt RunError(TInt aError) + { + error = aError; + CActiveScheduler::Stop(); // will only get here if iFunc leaves + return KErrNone; + } +public: + TLeavingFunc* iFunc; + int error; + }; + +void tst_qmainexceptions::TestSchedulerCatchesError(TLeavingFunc* f, int error) + { + CTestActive *act = new(ELeave) CTestActive(f); + act->Test(); + QCOMPARE(act->error, error); + delete act; + } + +void ThrowBadAlloc() +{ + throw std::bad_alloc(); +} + +void TranslateThrowBadAllocL() +{ + QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(ThrowBadAlloc()); +} + +void tst_qmainexceptions::testTranslateBadAlloc() +{ + // bad_alloc should give KErrNoMemory in an AO + TestSchedulerCatchesError(&TranslateThrowBadAllocL, KErrNoMemory); +} + +void BigAlloc() +{ + int *x = new int[100000000]; + delete [] x; +} + +void TranslateBigAllocL() +{ + QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(BigAlloc()); +} + +void tst_qmainexceptions::testTranslateBigAlloc() +{ + // this test will fail if new does not throw on failure, otherwise should give KErrNoMemory in AO + TestSchedulerCatchesError(&TranslateBigAllocL, KErrNoMemory); +} + +void tst_qmainexceptions::TestSymbianRoundTrip(int leave, int trap) +{ + // check that leave converted to exception, converted to error gives expected error code + int trapped; + QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR( + trapped, + QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION( + User::LeaveIfError(leave))); + QCOMPARE(trap, trapped); +} + +void tst_qmainexceptions::testRoundTrip() +{ + for (int e=-50; e<0; e++) + TestSymbianRoundTrip(e, e); + TestSymbianRoundTrip(KErrNone, KErrNone); + // positive error codes are not errors + TestSymbianRoundTrip(1, KErrNone); + TestSymbianRoundTrip(1000000000, KErrNone); +} + +void tst_qmainexceptions::testTrap() +{ + // testing qt_translateExceptionToSymbianErrorL + TRAPD(err, qt_translateExceptionToSymbianErrorL(std::bad_alloc())); + QCOMPARE(err, KErrNoMemory); +} + +bool tst_qmainexceptions::event(QEvent *aEvent) + { + if (aEvent->type() == QEvent::User+1) + throw std::bad_alloc(); + else if (aEvent->type() == QEvent::User+2) + { + QEvent event(QEvent::Type(QEvent::User+1)); + QApplication::sendEvent(this, &event); + } + return QObject::event(aEvent); + } + +void tst_qmainexceptions::testPropagation() +{ + // test exception thrown from event is propagated back to sender + QEvent event(QEvent::Type(QEvent::User+1)); + bool caught = false; + try { QApplication::sendEvent(this, &event); } + catch (const std::bad_alloc&) { caught = true; } + QCOMPARE(caught, true); + + // testing nested events propagate back to top level sender + caught = false; + QEvent event2(QEvent::Type(QEvent::User+2)); + try { QApplication::sendEvent(this, &event2); } + catch (const std::bad_alloc&) { caught = true; } + QCOMPARE(caught, true); +} + +void tst_qmainexceptions::testDtor1() +{ + // destructors work on exception + int i = 0; + struct SAutoInc { + SAutoInc(int& aI) : i(aI) { ++i; } + ~SAutoInc() { --i; } + int &i; + } ai(i); + QCOMPARE(i, 1); + try { + SAutoInc ai2(i); + QCOMPARE(i, 2); + throw std::bad_alloc(); + QFAIL("should not get here"); + } catch (const std::bad_alloc&) { + QCOMPARE(i, 1); + } + QCOMPARE(i, 1); +} + +void tst_qmainexceptions::testDtor2() +{ + // memory is cleaned up correctly on exception + // this crashes with winscw compiler build < 481 + __UHEAP_MARK; + try { + QString str("abc"); + str += "def"; + throw std::bad_alloc(); + QFAIL("should not get here"); + } catch (const std::bad_alloc&) { } + __UHEAP_MARKEND; +} + +void tst_qmainexceptions::testNestedExceptions() +{ + // throwing exceptions while handling exceptions + struct Oops { + Oops* next; + Oops(int level) : next(level > 0 ? new Oops(level-1) : 0) {} + ~Oops() { + try { throw std::bad_alloc(); } + catch (const std::exception&) {delete next;} + } + }; + try { + Oops oops(5); + throw std::bad_alloc(); + } + catch (const std::exception&) {} +} + QTEST_MAIN(tst_qmainexceptions) #include "tst_qmainexceptions.moc" -- cgit v0.12 From 1a97bc5091f8b302940b7cc8eb1dbb55c3411d64 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 12 Jun 2009 21:05:17 +0200 Subject: Crash fix for task #255989 Hold a QPointer to the widget with the context menu. After the menu pops up, the focussed widget looses focus and may be deleted (like it happens in this case with the item editor). Testing for isNull() instead of crashing. It would be great to not even add the "Action" entry to the system menu but in that moment we don't know that the current focuswidget will soon disappear. That's still a Todo. --- src/gui/widgets/qmenu_symbian.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index c7b117e..8983a50 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -74,7 +74,7 @@ struct SymbianMenuItem static QList symbianMenus; static QList nativeMenuBars; static uint qt_symbian_menu_static_cmd_id = QT_FIRST_MENU_ITEM; -static QWidget* widgetWithContextMenu=0; +static QPointer widgetWithContextMenu; static QList contextMenuActionList; static QAction contextAction(0); static int contexMenuCommand=0; @@ -254,7 +254,7 @@ Q_GUI_EXPORT void qt_symbian_show_submenu( CEikMenuPane* menuPane, int id) void QMenuBarPrivate::symbianCommands(int command) { - if (command == contexMenuCommand) { + if (command == contexMenuCommand && !widgetWithContextMenu.isNull()) { QContextMenuEvent* event = new QContextMenuEvent(QContextMenuEvent::Keyboard, QPoint(0,0)); QCoreApplication::postEvent(widgetWithContextMenu, event); } -- cgit v0.12 From 9b34c6dffcb19664e336d4b51092e042e861f475 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 12 Jun 2009 21:14:05 +0200 Subject: Translate "Actions" text --- src/gui/widgets/qmenu_symbian.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index 8983a50..69ce981 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -303,7 +303,7 @@ QMenuBarPrivate::QSymbianMenuBarPrivate::~QSymbianMenuBarPrivate() deleteAll( &symbianMenus ); symbianMenus.clear(); d = 0; - rebuild(); + rebuild(); } QMenuPrivate::QSymbianMenuPrivate::QSymbianMenuPrivate() @@ -393,7 +393,7 @@ void QMenuBarPrivate::QSymbianMenuBarPrivate::insertNativeMenuItems(const QList< symbianActionTopLevel->parent = 0; symbianActionTopLevel->command = qt_symbian_menu_static_cmd_id++; qt_symbian_insert_action(symbianActionTopLevel, &symbianMenus); - } + } } @@ -409,11 +409,10 @@ void QMenuBarPrivate::QSymbianMenuBarPrivate::rebuild() contextMenuActionList.clear(); if (widgetWithContextMenu) { contexMenuCommand = qt_symbian_menu_static_cmd_id; - contextAction.setText(QString("Actions")); + contextAction.setText(QMenuBar::tr("Actions")); contextMenuActionList.append(&contextAction); insertNativeMenuItems(contextMenuActionList); } - } QT_END_NAMESPACE -- cgit v0.12 From a612366300aef70d2574b3f738afebdb106f1214 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Mon, 15 Jun 2009 10:28:31 +0300 Subject: Added error handling to qdesktopservices example when openUrl fails. Now qdesktopservices example will show message box if openUrl call fails i.e. returns false. --- demos/embedded/desktopservices/contenttab.cpp | 12 +++++++++++- demos/embedded/desktopservices/contenttab.h | 2 +- demos/embedded/desktopservices/linktab.cpp | 9 +++++++++ demos/embedded/desktopservices/linktab.h | 1 + 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/demos/embedded/desktopservices/contenttab.cpp b/demos/embedded/desktopservices/contenttab.cpp index 450a080..bdc5e03 100644 --- a/demos/embedded/desktopservices/contenttab.cpp +++ b/demos/embedded/desktopservices/contenttab.cpp @@ -41,6 +41,7 @@ // EXTERNAL INCLUDES #include +#include #include #include #include @@ -135,10 +136,19 @@ void ContentTab::keyPressEvent(QKeyEvent *event) } } +void ContentTab::handleErrorInOpen(QListWidgetItem *item) +{ + Q_UNUSED(item); + QMessageBox::warning( this, tr("Operation Failed"), tr("Unkown error!"), QMessageBox::Close); +} + // NEW SLOTS void ContentTab::openItem(QListWidgetItem *item) { - QDesktopServices::openUrl(itemUrl(item)); + bool ret = QDesktopServices::openUrl(itemUrl(item)); + if(!ret) + handleErrorInOpen(item); } + // End of File diff --git a/demos/embedded/desktopservices/contenttab.h b/demos/embedded/desktopservices/contenttab.h index a5a402e..8d37209 100644 --- a/demos/embedded/desktopservices/contenttab.h +++ b/demos/embedded/desktopservices/contenttab.h @@ -83,7 +83,7 @@ protected: // New Methods virtual void populateListWidget(); virtual QString itemName(const QFileInfo &item); virtual QUrl itemUrl(QListWidgetItem *item); - + virtual void handleErrorInOpen(QListWidgetItem *item); protected: void keyPressEvent(QKeyEvent *event); diff --git a/demos/embedded/desktopservices/linktab.cpp b/demos/embedded/desktopservices/linktab.cpp index b4ab308..58d1cc6 100644 --- a/demos/embedded/desktopservices/linktab.cpp +++ b/demos/embedded/desktopservices/linktab.cpp @@ -41,6 +41,7 @@ // EXTERNAL INCLUDES #include +#include #include // INTERNAL INCLUDES @@ -75,5 +76,13 @@ QUrl LinkTab::itemUrl(QListWidgetItem *item) return QUrl(); } } +void LinkTab::handleErrorInOpen(QListWidgetItem *item) +{ + if(m_MailToItem == item) { + QMessageBox::warning( this, tr("Operation Failed"), tr("Please check that you have\ne-mail accunt defined"), QMessageBox::Close); + } else { + ContentTab::handleErrorInOpen(item); + } +} // End of file diff --git a/demos/embedded/desktopservices/linktab.h b/demos/embedded/desktopservices/linktab.h index 2ce1094..a9c9868 100644 --- a/demos/embedded/desktopservices/linktab.h +++ b/demos/embedded/desktopservices/linktab.h @@ -71,6 +71,7 @@ public: // Constructors & Destructors protected: // Derived Methods virtual void populateListWidget(); virtual QUrl itemUrl(QListWidgetItem *item); + virtual void handleErrorInOpen(QListWidgetItem *item); private: // Used variables QListWidgetItem *m_WebItem; -- cgit v0.12 From cdb6cf0cd190b9d7373a4a295ef3ef65eedc6b53 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Mon, 15 Jun 2009 10:30:46 +0300 Subject: Added placeholder to create e-mail account in qdesktopservices. Currently e-mail sending with qdesktopservices::openUrl works in Symbian only if e-mail account already exists. The CSendUI API which is similar to RSendAs API we currently use, would provide that e-mail account creation service for us automatically but it requires so extensive capabilities that we cannot use it. --- src/gui/util/qdesktopservices_s60.cpp | 75 ++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 31 deletions(-) diff --git a/src/gui/util/qdesktopservices_s60.cpp b/src/gui/util/qdesktopservices_s60.cpp index d53c046..3588ec9 100644 --- a/src/gui/util/qdesktopservices_s60.cpp +++ b/src/gui/util/qdesktopservices_s60.cpp @@ -89,38 +89,51 @@ static void handleMailtoSchemeL(const QUrl &url) User::LeaveIfError(sendAs.Connect()); CleanupClosePushL(sendAs); - RSendAsMessage sendAsMessage; - sendAsMessage.CreateL(sendAs, KUidMsgTypeSMTP); - CleanupClosePushL(sendAsMessage); - - - // Subject - sendAsMessage.SetSubjectL(qt_QString2TPtrC(subject)); - - // Body - sendAsMessage.SetBodyTextL(qt_QString2TPtrC(body)); - - // To - foreach(QString item, recipients) - sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientTo ); - - foreach(QString item, tos) - sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientTo ); - - // Cc - foreach(QString item, ccs) - sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientCc ); - - // Bcc - foreach(QString item, bccs) - sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientBcc ); - - // send the message - sendAsMessage.LaunchEditorAndCloseL(); - - // sendAsMessage (already closed) - CleanupStack::Pop(); + CSendAsAccounts* accounts = CSendAsAccounts::NewL(); + CleanupStack::PushL(accounts); + sendAs.AvailableAccountsL(KUidMsgTypeSMTP, *accounts); + TInt count = accounts->Count(); + CleanupStack::PopAndDestroy(accounts); + + if(!count) { + // TODO: we should try to create account if count == 0 + // CSendUi would provide account creation service for us, but it requires ridicilous + // capabilities: LocalServices NetworkServices ReadDeviceData ReadUserData WriteDeviceData WriteUserData + User::Leave(KErrNotSupported); + } else { + RSendAsMessage sendAsMessage; + sendAsMessage.CreateL(sendAs, KUidMsgTypeSMTP); + CleanupClosePushL(sendAsMessage); + + + // Subject + sendAsMessage.SetSubjectL(qt_QString2TPtrC(subject)); + + // Body + sendAsMessage.SetBodyTextL(qt_QString2TPtrC(body)); + + // To + foreach(QString item, recipients) + sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientTo ); + + foreach(QString item, tos) + sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientTo ); + + // Cc + foreach(QString item, ccs) + sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientCc ); + + // Bcc + foreach(QString item, bccs) + sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientBcc ); + + // send the message + sendAsMessage.LaunchEditorAndCloseL(); + + // sendAsMessage (already closed) + CleanupStack::Pop(); + } // sendAs CleanupStack::PopAndDestroy(); } -- cgit v0.12 From 56942fc52e637e6b721ddd8e11b84e1855c6b84d Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Mon, 15 Jun 2009 09:40:27 +0200 Subject: Better text to label --- examples/widgets/softkeys/softkeys.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/widgets/softkeys/softkeys.cpp b/examples/widgets/softkeys/softkeys.cpp index 87d11c9..083d05c 100644 --- a/examples/widgets/softkeys/softkeys.cpp +++ b/examples/widgets/softkeys/softkeys.cpp @@ -46,7 +46,7 @@ MainWindow::MainWindow(QWidget *parent) { central = new QWidget(this); setCentralWidget(central); - infoLabel = new QLabel(tr("Funky stuff in menu!")); + infoLabel = new QLabel(tr("Open menu to start!")); layout = new QVBoxLayout; layout->addWidget(infoLabel); -- cgit v0.12 From 47ec0f00869019fd7ea08577b9906209dd4bdf55 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Mon, 15 Jun 2009 10:22:09 +0200 Subject: export QSymbianLeaveException --- src/corelib/global/qglobal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 450fd86..10dee86 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -2314,7 +2314,7 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf(); #include -class QSymbianLeaveException : public std::exception +class Q_CORE_EXPORT QSymbianLeaveException : public std::exception { public: inline QSymbianLeaveException(int err) : error(err) {} -- cgit v0.12 From b36117b3ca028da664075b2d249f2e106e54a8f4 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 15 Jun 2009 12:44:10 +0300 Subject: Added my changes to Tower changes document. --- dist/changes-4.5.2-tower | 70 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 59 insertions(+), 11 deletions(-) diff --git a/dist/changes-4.5.2-tower b/dist/changes-4.5.2-tower index 1a039ba..4e12ea2 100644 --- a/dist/changes-4.5.2-tower +++ b/dist/changes-4.5.2-tower @@ -56,46 +56,94 @@ Features Optimizations ------------- -- todo - * todo +- qdrawhelper + * Optimized drawing operations for RVCT builds, particulary for ARMV6. **************************************************************************** * Build issues * **************************************************************************** -- todo +- QTest + * Fixed testlib export macros for RVCT builds. **************************************************************************** * Changes to existing classes * **************************************************************************** -- todo - * todo +- QPluginLoader + * QPluginLoader will look for plugin stubs from the same folder on other + drives if it can't find them from the indicated drive. + +- QEventDispatcher + * Lowered the timeout for reprioritizing the process to 100ms **************************************************************************** * Examples and demos * **************************************************************************** -- todo - * todo +- Deform, Pathstroke, and Wiggly + * Removed Symbian specific animation timer fixes since more generic + fix was made to event dispatcher. + +- SecureSocketClient + * Fixed build issue caused by lack of cursor. + +- Fluidlauncher + * Removed ugly workaround to make emulator deployment work correctly, + since the issue has been fixed in qmake. + * Updated screenshots to S60 style + **************************************************************************** * Tools * **************************************************************************** -- todo - * todo +- qmake + * Support for generating Symbian "test" targets: CONFIG += symbian_test. + * Support for Symbian Build System, version 2 (aka Raptor) via + symbian-sbsv2 mkspec. + * PAGED keyword is added to all MMP files by default, except in S60 3.1 + builds. + * Read-only flag is no longer preserved when deploying files into + emulator environment. + * Changed the timestamp to ISO format in all files generated + by qmake for symbian-* mkspecs. + * Qt's VERSION variable will now generate VERSION keyword in mmp files. + * Made Open C include paths handling bit more robust. + +- configure + * -cetest is no longer a supported switch for configure. + +- Release package creation + * Removed the obsolete script to create release package. + +- Createpackage script + * Now creates packages with .sis suffix. + +- Patch_capabilities script + * Will now patch also vendor id. **************************************************************************** * Plugins * **************************************************************************** -- todo - * todo +- S60 version specific plugins + * Isolated S60 version dependent functionality to S60 version specific + plugins (qts60plugin_x_y.dll) to make it possible for single build to + run on any supported device, even if with reduced functionality on + some. + **************************************************************************** * Important Behavior Changes * **************************************************************************** +- Qt libs + * Qt libs are now built with "All -Tcb" capabilities always. It is now + always necessary to run patch_capabilities.pl script if self-signing + of Qt libs is desired. + * QtCore and QtSql made UNPAGED as workaround for an obscure crash + when they are paged. + - todo * todo -- cgit v0.12 From 2621111ad1424c621e48fc2b3f5774a5bbfa9f3f Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Mon, 15 Jun 2009 13:02:31 +0200 Subject: doc: remove qdoc warnings --- doc/src/platform-notes.qdoc | 2 +- doc/src/symbian-exceptionsafety.qdoc | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/src/platform-notes.qdoc b/doc/src/platform-notes.qdoc index 63b721a..53db855 100644 --- a/doc/src/platform-notes.qdoc +++ b/doc/src/platform-notes.qdoc @@ -521,7 +521,7 @@ supported by Qt can be found on the \l{Supported Platforms} page. For information about mixing exceptions with symbian leaves, - see \l QSymbianLeaveException. + see \l{Exception Safety with Symbian} */ /*! diff --git a/doc/src/symbian-exceptionsafety.qdoc b/doc/src/symbian-exceptionsafety.qdoc index 212f707..ea9e9b8 100644 --- a/doc/src/symbian-exceptionsafety.qdoc +++ b/doc/src/symbian-exceptionsafety.qdoc @@ -80,11 +80,11 @@ Symbian leaves to standard C++ exceptions. The following help is provided: \list - \o \l qt_translateSymbianErrorToException(int error) takes a Symbian + \o \l qt_translateSymbianErrorToException() takes a Symbian error code and throws an appropriate exception to represent it. This will do nothing if the error code is not in fact an error. The function is equivalent to Symbian's \c User::LeaveIfError. - \o \l QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(f) takes a Symbian leaving + \o \l QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION() takes a Symbian leaving code fragment f and runs it under a trap harness converting any resulting error into an exception. \o \c TRAP and \c TRAPD from the Symbian libraries can be used to convert @@ -113,18 +113,18 @@ provided: \list - \o \l qt_translateExceptionToSymbianError(const std::exception& ex) - + \o \l qt_translateExceptionToSymbianError() - this takes a standard exception and gives an appropriate Symbian error code. If no mapping is known for the exception type, \c KErrGeneral is returned. - \o \l qt_translateExceptionToSymbianErrorL(const std::exception& ex) - + \o \l qt_translateExceptionToSymbianErrorL() - this takes a standard exception and generates an appropriate Symbian leave. - \o \l QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(err, f) - this macro + \o \l QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR() - this macro takes the standard C++ code fragment \c f, catches any std::exceptions thrown from it, and sets err to the corresponding Symbian error code. err is set to \c KErrNone otherwise. - \o \l QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(f) - this macro takes the + \o \l QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE() - this macro takes the standard C++ code fragment \c f, catches any std::exceptions thrown from it, and throws a corresponding Symbian leave. \endlist -- cgit v0.12 From a6942e6ac4a734a4251573b9c10ed8470099fc6a Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Mon, 15 Jun 2009 13:02:40 +0200 Subject: move QSymbianLeaveException to the *.cpp file don't need to include stl's header in qglobal.h also updated documentation --- src/corelib/global/qglobal.cpp | 48 +++++++++++++++--------------------------- src/corelib/global/qglobal.h | 12 ++--------- 2 files changed, 19 insertions(+), 41 deletions(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 6590ea6..e53fd2d 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -3215,7 +3215,8 @@ bool QInternal::callFunction(InternalFunction func, void **args) #include /*! \macro QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(function) - \relates QSymbianLeaveException + \relates + \ingroup qts60 TRAP leaves from Symbian \a function and throws an appropriate standard C++ exception instead. @@ -3241,7 +3242,7 @@ bool QInternal::callFunction(InternalFunction func, void **args) */ /*! \macro QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR(error, function) - \relates QSymbianLeaveException + \relates \ingroup qts60 Catch standard C++ exceptions from a \a function and convert them to a Symbian OS @@ -3272,7 +3273,7 @@ bool QInternal::callFunction(InternalFunction func, void **args) */ /*! \macro QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_LEAVE(function) - \relates QSymbianLeaveException + \relates \ingroup qts60 Catch standard C++ exceptions from \a function and convert them to Symbian OS @@ -3298,37 +3299,22 @@ bool QInternal::callFunction(InternalFunction func, void **args) \sa QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION(), QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR() */ -/*! \class QSymbianLeaveException - \ingroup qts60 - \brief The QSymbianLeaveException class represents a block of Symbian leave code. - - \warning This class is only available on Symbian. -*/ - -/*! \fn QSymbianLeaveException::QSymbianLeaveException(int error) +#include - Constructs a QSymbianLeaveException object that stores the given - Symbian \a error code. -*/ - -/*! \fn const char *QSymbianLeaveException::what() const - - Returns a C-style character string describing the general - cause of the current error. - - The string is not localized. -*/ -const char *QSymbianLeaveException::what() const throw() +class QSymbianLeaveException : public std::exception { - static char msg[36]; - snprintf(msg, sizeof(msg), "Symbian leave exception %d", error); - return msg; -} +public: + inline QSymbianLeaveException(int err) : error(err) {} + inline const char* what() const throw() { return "Symbian leave exception"; } + +public: + int error; +}; -/*! \relates QSymbianLeaveException +/*! \relates \ingroup qts60 - Throws a QSymbianLeaveException if the \a error parameter is a symbian error code. + Throws an exception if the \a error parameter is a symbian error code. This is the exception throwing equivalent of Symbian's User::LeaveIfError. \warning This function is only available on Symbian. @@ -3347,7 +3333,7 @@ void qt_translateSymbianErrorToException(int error) } } -/*! \relates QSymbianLeaveException +/*! \relates \ingroup qts60 Convert a caught standard C++ exception \a aThrow to a Symbian leave @@ -3361,7 +3347,7 @@ void qt_translateExceptionToSymbianErrorL(const std::exception& aThrow) User::Leave(qt_translateExceptionToSymbianError(aThrow)); } -/*! \relates QSymbianLeaveException +/*! \relates \ingroup qts60 Convert a caught standard C++ exception \a aThrow to a Symbian error code diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 10dee86..825b7e8 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -2312,16 +2312,8 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf(); #if defined(Q_OS_SYMBIAN) -#include - -class Q_CORE_EXPORT QSymbianLeaveException : public std::exception -{ -public: - inline QSymbianLeaveException(int err) : error(err) {} - const char* what() const throw(); -public: - int error; -}; +// forward declare std::exception +namespace std { class exception; } Q_CORE_EXPORT void qt_translateSymbianErrorToException(int error); Q_CORE_EXPORT void qt_translateExceptionToSymbianErrorL(const std::exception& ex); -- cgit v0.12 From 7887079cbb5e543728d205b8358163c25d31fbfa Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Mon, 15 Jun 2009 14:28:12 +0300 Subject: Updated changes-4.5.2-tower. --- dist/changes-4.5.2-tower | 119 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 115 insertions(+), 4 deletions(-) diff --git a/dist/changes-4.5.2-tower b/dist/changes-4.5.2-tower index 4e12ea2..0e1215e 100644 --- a/dist/changes-4.5.2-tower +++ b/dist/changes-4.5.2-tower @@ -28,7 +28,8 @@ New modules ----------- - QtSql - * todo + * Implemented QtSql module with sqlite3 backend. For now backend is + provided only in binary format. - QtWebkit * todo - Phonon @@ -44,12 +45,19 @@ New classes Ported classes -------------- -- todo - * todo +- QSound + * Implemented CMdaAudioPlayerUtility based Symbian backend for QSound. +- QLocalSocket and QLocalServer + * Added support for QLocalSocket and QLocalServer on Symbian Features -------- +- QApplication + * Implemented QApplication::beep() for Symbian +- QSslSocket + * Added support for -openssl option i.e. runtime resolving of OpenSSL + symbols - todo * todo @@ -58,6 +66,33 @@ Optimizations - qdrawhelper * Optimized drawing operations for RVCT builds, particulary for ARMV6. + +- qwidget_s60.cpp + * Avoid unnecessary calls to FocusChanged in Symbian + +**************************************************************************** +* Code clean-up * +**************************************************************************** + +- Cleanup qeventdispatcher_unix.cpp + * 247268: All qeventdispatcher_unix.cpp changes were reverted since, + this file is not anymore used in Symbian OS branch. +- Cleanup QtNetwork workarounds implemented earlier due to Open C bugs. + * 247287: Removed getaddrinfo workaround + * 247288: Removed waitForConnected workaround + * 247289: Removed qt_socket_accept workaround + * 247290: Removed qt_socket_connect workaround + * 247290: Removed E32IONREAD workaround + * 247293: Removed nativeHasPendingDatagrams workaround + * 247295: Removed QNativeSocketEnginePrivate::nativeRead EPIPE + workaround +- Other code clean-ups + * 247278: Removed unnecessary includes from qbackingstore.cpp. + * Fixed Q_OS_SYMBIAN ifdef usage in qfiledialog_p.h + * 247272: Removed qtestnetworkservers.h dependency, used + network-settings.h + * Revert "Work around compiler bug on Nokia Metrowerks compiler." + **************************************************************************** * Build issues * @@ -70,6 +105,9 @@ Optimizations * Changes to existing classes * **************************************************************************** +- QDesktopServices + * Fixed forwardslash/backslash usage as an path separator + - QPluginLoader * QPluginLoader will look for plugin stubs from the same folder on other drives if it can't find them from the indicated drive. @@ -77,20 +115,85 @@ Optimizations - QEventDispatcher * Lowered the timeout for reprioritizing the process to 100ms +- QNetworkInterface + * Fixed R-handle leak in Symbian version of qnetworkinterface_unix.cpp + * Introduced a new qnetworkinterface_symbian.cpp, because there wasn't + really anything common to UNIX equivalent + +- QHostInfo + * Added support for host lookups with multiple ipv4 addresses. + +- QUdpSocket + * Updated BindFlag documentation to reflect behaviour on Symbian OS + +- QLocale + * Removed workaround for missing tzname symbol, fixes QLocal timeZone + implementation for Symbian. + +- QTemporaryFile + * Fixed temporary file rename in Symbian OS. + +- QThread + * Fix for thread termination in Symbian OS. + +- QIoDevice + * Fixed compilation error when QIODEVICE_DEBUG is defined. + +- QS60Style + * Added subElementRect implementation for SE_ItemViewItemCheckIndicator. + +- QDesktopServices + * Switched QDesktopServices mail-to URL handling to RSendAs in Symbian, + due to the fact that CSendUi requires extensive capabilities to work + correctly. Currently e-mail sending with qdesktopservices::openUrl + works in Symbian only if e-mail account already exists. + +- QCoeFepInputContext (non-public) + * Fixes FEP crash when changing the focused Qt widget to NULL. + +- QApplication + * 252798: Fixed layout when orientation changed via + AknAppUi::SetOrientationL. + +- QUdpSocket + * Wrote hack for QUdpSocket::writeDatagram return value in Symbian OS. + +- QNativeSocketEnginePrivate (non-public) + * Changed select to listen also expectfds in Symbain OS for given + sockets (Workaround to Open C bug). + * Fix to Open C bug: Socket connect failure is indicated exception set. + +- QEventDispatcherSymbian (non-public) + * Fixed ASSERT panic in Symbian event dispatcher + * 246600: Fix problem in eventdispatcher destructor / AO canceling + * Fixed active scheduler removal when calling QThread::terminate + * Fix to Open C bug: select sometimes returns -1 and errno is + ECONNREFUSED + **************************************************************************** * Examples and demos * **************************************************************************** - +- Drilldown + * Added to demonstrate QtSql usage in Symbian OS + - Deform, Pathstroke, and Wiggly * Removed Symbian specific animation timer fixes since more generic fix was made to event dispatcher. +- Ftp + * Enabled default iap setting for FTP example + +- DesktopServices + * Implemented content filters for desktopservices example. + * Added error handling to qdesktopservices example when openUrl fails. + - SecureSocketClient * Fixed build issue caused by lack of cursor. - Fluidlauncher * Removed ugly workaround to make emulator deployment work correctly, since the issue has been fixed in qmake. + * Included drilldown to demonstrate QtSql usage * Updated screenshots to S60 style @@ -113,6 +216,8 @@ Optimizations - configure * -cetest is no longer a supported switch for configure. + * -stl option is enabled by default for Symbian OS + * -openssl option is enabled by default for Symbian OS. - Release package creation * Removed the obsolete script to create release package. @@ -122,6 +227,12 @@ Optimizations - Patch_capabilities script * Will now patch also vendor id. + +**************************************************************************** +* Documnetation * +**************************************************************************** +- qmake-manual + * 250370: Added documentation for ICON keyword **************************************************************************** * Plugins * -- cgit v0.12 From 8dd4a3bcfb8d6ec011119459f91737f7e48e885a Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Mon, 15 Jun 2009 13:41:05 +0200 Subject: doc: document operator== and != --- src/corelib/tools/qscopedpointer.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/corelib/tools/qscopedpointer.cpp b/src/corelib/tools/qscopedpointer.cpp index 0239575..6a1ffb6 100644 --- a/src/corelib/tools/qscopedpointer.cpp +++ b/src/corelib/tools/qscopedpointer.cpp @@ -134,6 +134,21 @@ */ /*! + \fn bool QScopedPointer::operator==(const QScopedPointer &other) const + + Equality operator. Returns true if the scoped pointer \a other + is pointing to the same object as this pointer, otherwise returns false. +*/ + + +/*! + \fn bool QScopedPointer::operator!=(const QScopedPointer *other) const + + Inequality operator. Returns true if the scoped pointer \a other + is not pointing to the same object as this pointer, otherwise returns false. +*/ + +/*! \fn bool QScopedPointer::isNull() const Returns \c true if this object is holding a pointer that is \c null. -- cgit v0.12 From 06dad6387cd198852448085b470e3a9c7343f6af Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Mon, 15 Jun 2009 13:49:29 +0200 Subject: doc: introduce qts60 group to silence qdoc warnings --- doc/src/topics.qdoc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/src/topics.qdoc b/doc/src/topics.qdoc index 6ef3a89..09a86bd 100644 --- a/doc/src/topics.qdoc +++ b/doc/src/topics.qdoc @@ -300,3 +300,14 @@ including ARM, Intel x86, MIPS and SH-4. \endlist \endtable */ + +/*! +\group qts60 +\title Qt for S60 +\ingroup topics +\brief Documents related to Qt for S60 + +\list + \o \l {Exception Safety with Symbian} +\endlist +*/ -- cgit v0.12 From 217d263ee1feb5a0c2b19d634093f4c7975ac7c9 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Mon, 15 Jun 2009 14:17:17 +0200 Subject: Fixes leak introduced by QScopedPointer QPainterPath is kinda evil with a somewhat public private class and a really private cast, so we need to up-cast the d pointer when deleting. RevBy: aportale --- src/gui/painting/qpainterpath.cpp | 18 ++++++++++++++++++ src/gui/painting/qpainterpath.h | 6 +++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index 12dbc62..635218e 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -73,6 +73,24 @@ QT_BEGIN_NAMESPACE +struct QPainterPathPrivateHandler +{ + static inline void cleanup(QPainterPathPrivate *d) + { + // note - we must up-cast to QPainterPathData since QPainterPathPrivate + // has a non-virtual destructor! + if (d && !d->ref.deref()) + delete static_cast(d); + } + + static inline void reset(QPainterPathPrivate *&d, QPainterPathPrivate *other) + { + QPainterPathPrivate *oldD = d; + d = other; + cleanup(oldD); + } +}; + // This value is used to determine the length of control point vectors // when approximating arc segments as curves. The factor is multiplied // with the radius of the circle. diff --git a/src/gui/painting/qpainterpath.h b/src/gui/painting/qpainterpath.h index 0513593..e12194e 100644 --- a/src/gui/painting/qpainterpath.h +++ b/src/gui/painting/qpainterpath.h @@ -57,6 +57,7 @@ QT_MODULE(Gui) class QFont; class QPainterPathPrivate; +struct QPainterPathPrivateHandler; class QPainterPathData; class QPainterPathStrokerPrivate; class QPolygonF; @@ -196,7 +197,7 @@ public: QPainterPath &operator-=(const QPainterPath &other); private: - QScopedSharedPointer d_ptr; + QScopedCustomPointer d_ptr; inline void ensureData() { if (!d_ptr) ensureData_helper(); } void ensureData_helper(); @@ -230,8 +231,7 @@ public: friend class QPainterPathStrokerPrivate; friend class QMatrix; friend class QTransform; - friend class QScopedSharedPointer; - friend class QScopedSharedPointerHandler; + friend struct QPainterPathPrivateHandler; #ifndef QT_NO_DATASTREAM friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QPainterPath &); friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPainterPath &); -- cgit v0.12 From 17975c71e2578b1eab92d93085f0737251666fc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Mon, 15 Jun 2009 15:18:40 +0300 Subject: S60Style: changes for style to Tower release. --- dist/changes-4.5.2-tower | 125 ++++++++++++++++++++++++++++------------------- 1 file changed, 74 insertions(+), 51 deletions(-) diff --git a/dist/changes-4.5.2-tower b/dist/changes-4.5.2-tower index 0e1215e..19e8d3c 100644 --- a/dist/changes-4.5.2-tower +++ b/dist/changes-4.5.2-tower @@ -28,7 +28,7 @@ New modules ----------- - QtSql - * Implemented QtSql module with sqlite3 backend. For now backend is + * Implemented QtSql module with sqlite3 backend. For now backend is provided only in binary format. - QtWebkit * todo @@ -56,7 +56,7 @@ Features * Implemented QApplication::beep() for Symbian - QSslSocket - * Added support for -openssl option i.e. runtime resolving of OpenSSL + * Added support for -openssl option i.e. runtime resolving of OpenSSL symbols - todo * todo @@ -66,7 +66,7 @@ Optimizations - qdrawhelper * Optimized drawing operations for RVCT builds, particulary for ARMV6. - + - qwidget_s60.cpp * Avoid unnecessary calls to FocusChanged in Symbian @@ -75,24 +75,25 @@ Optimizations **************************************************************************** - Cleanup qeventdispatcher_unix.cpp - * 247268: All qeventdispatcher_unix.cpp changes were reverted since, + * 247268: All qeventdispatcher_unix.cpp changes were reverted since, this file is not anymore used in Symbian OS branch. - Cleanup QtNetwork workarounds implemented earlier due to Open C bugs. - * 247287: Removed getaddrinfo workaround + * 247287: Removed getaddrinfo workaround * 247288: Removed waitForConnected workaround * 247289: Removed qt_socket_accept workaround * 247290: Removed qt_socket_connect workaround * 247290: Removed E32IONREAD workaround * 247293: Removed nativeHasPendingDatagrams workaround - * 247295: Removed QNativeSocketEnginePrivate::nativeRead EPIPE + * 247295: Removed QNativeSocketEnginePrivate::nativeRead EPIPE workaround - Other code clean-ups - * 247278: Removed unnecessary includes from qbackingstore.cpp. + * 247278: Removed unnecessary includes from qbackingstore.cpp. * Fixed Q_OS_SYMBIAN ifdef usage in qfiledialog_p.h - * 247272: Removed qtestnetworkservers.h dependency, used + * 247272: Removed qtestnetworkservers.h dependency, used network-settings.h * Revert "Work around compiler bug on Nokia Metrowerks compiler." - + * Remove UI highlights being inverted colors based on highlight text colors. + **************************************************************************** * Build issues * @@ -108,66 +109,88 @@ Optimizations - QDesktopServices * Fixed forwardslash/backslash usage as an path separator -- QPluginLoader +- QPluginLoader * QPluginLoader will look for plugin stubs from the same folder on other drives if it can't find them from the indicated drive. - + - QEventDispatcher * Lowered the timeout for reprioritizing the process to 100ms - QNetworkInterface * Fixed R-handle leak in Symbian version of qnetworkinterface_unix.cpp - * Introduced a new qnetworkinterface_symbian.cpp, because there wasn't + * Introduced a new qnetworkinterface_symbian.cpp, because there wasn't really anything common to UNIX equivalent - + - QHostInfo * Added support for host lookups with multiple ipv4 addresses. - + - QUdpSocket - * Updated BindFlag documentation to reflect behaviour on Symbian OS - + * Updated BindFlag documentation to reflect behaviour on Symbian OS + - QLocale * Removed workaround for missing tzname symbol, fixes QLocal timeZone implementation for Symbian. - + - QTemporaryFile - * Fixed temporary file rename in Symbian OS. - + * Fixed temporary file rename in Symbian OS. + - QThread * Fix for thread termination in Symbian OS. - -- QIoDevice + +- QIoDevice * Fixed compilation error when QIODEVICE_DEBUG is defined. - + - QS60Style * Added subElementRect implementation for SE_ItemViewItemCheckIndicator. - + * Added support for E90 layouts. + * Added support for QScrollArea, QTextEditor, QGroupBox, QTreeView, QToolBar and QDial styling. + * Better support for theme and layout changes. + * Better support for themed palettes and themed text colors. + * Better support for multiselection in item views. + * Better theming for QTable and QPanel. + * Better support of highlight graphics and texts for QLists, QTreeViews, QCalendarWidgets and QComboBoxes. + * Support polishing fonts. Fonts are no longer changed within the drawing code. + * Draw spinbox arrowbuttons side-by-side, instead one on top of the other. + * Harmonize widget drawing so that widgets are of similar height. + * Support check states for QLists and QPushButtons. + * Support flat QPushButtons. + * Support busy indicator. + * Support QScrollBar pressed state. + * Support QPushButton disabled theme graphics. + * Separate theme background for QDialogs. + * Clarify QToolButton pressed state. + * Removed linedrawing of panels and groupboxes. + * Fix palette-polution for a style that is activated from an application after S60Style has been in use. + * Fix for frame masks with color depth other than EGrey2. + * Fix for squeezed QTabBars. + * Fix memory leak when color skinning graphics. + - QDesktopServices * Switched QDesktopServices mail-to URL handling to RSendAs in Symbian, - due to the fact that CSendUi requires extensive capabilities to work - correctly. Currently e-mail sending with qdesktopservices::openUrl + due to the fact that CSendUi requires extensive capabilities to work + correctly. Currently e-mail sending with qdesktopservices::openUrl works in Symbian only if e-mail account already exists. - + - QCoeFepInputContext (non-public) * Fixes FEP crash when changing the focused Qt widget to NULL. - + - QApplication - * 252798: Fixed layout when orientation changed via - AknAppUi::SetOrientationL. - + * 252798: Fixed layout when orientation changed via + AknAppUi::SetOrientationL. + - QUdpSocket - * Wrote hack for QUdpSocket::writeDatagram return value in Symbian OS. - + * Wrote hack for QUdpSocket::writeDatagram return value in Symbian OS. + - QNativeSocketEnginePrivate (non-public) - * Changed select to listen also expectfds in Symbain OS for given + * Changed select to listen also expectfds in Symbain OS for given sockets (Workaround to Open C bug). * Fix to Open C bug: Socket connect failure is indicated exception set. - + - QEventDispatcherSymbian (non-public) * Fixed ASSERT panic in Symbian event dispatcher * 246600: Fix problem in eventdispatcher destructor / AO canceling * Fixed active scheduler removal when calling QThread::terminate - * Fix to Open C bug: select sometimes returns -1 and errno is + * Fix to Open C bug: select sometimes returns -1 and errno is ECONNREFUSED **************************************************************************** @@ -175,14 +198,14 @@ Optimizations **************************************************************************** - Drilldown * Added to demonstrate QtSql usage in Symbian OS - + - Deform, Pathstroke, and Wiggly * Removed Symbian specific animation timer fixes since more generic fix was made to event dispatcher. -- Ftp +- Ftp * Enabled default iap setting for FTP example - + - DesktopServices * Implemented content filters for desktopservices example. * Added error handling to qdesktopservices example when openUrl fails. @@ -191,10 +214,10 @@ Optimizations * Fixed build issue caused by lack of cursor. - Fluidlauncher - * Removed ugly workaround to make emulator deployment work correctly, + * Removed ugly workaround to make emulator deployment work correctly, since the issue has been fixed in qmake. * Included drilldown to demonstrate QtSql usage - * Updated screenshots to S60 style + * Updated screenshots to S60 style **************************************************************************** @@ -203,36 +226,36 @@ Optimizations - qmake * Support for generating Symbian "test" targets: CONFIG += symbian_test. - * Support for Symbian Build System, version 2 (aka Raptor) via + * Support for Symbian Build System, version 2 (aka Raptor) via symbian-sbsv2 mkspec. * PAGED keyword is added to all MMP files by default, except in S60 3.1 builds. - * Read-only flag is no longer preserved when deploying files into + * Read-only flag is no longer preserved when deploying files into emulator environment. * Changed the timestamp to ISO format in all files generated by qmake for symbian-* mkspecs. * Qt's VERSION variable will now generate VERSION keyword in mmp files. * Made Open C include paths handling bit more robust. - + - configure * -cetest is no longer a supported switch for configure. * -stl option is enabled by default for Symbian OS * -openssl option is enabled by default for Symbian OS. - + - Release package creation * Removed the obsolete script to create release package. - Createpackage script * Now creates packages with .sis suffix. - -- Patch_capabilities script + +- Patch_capabilities script * Will now patch also vendor id. - + **************************************************************************** * Documnetation * **************************************************************************** - qmake-manual - * 250370: Added documentation for ICON keyword + * 250370: Added documentation for ICON keyword **************************************************************************** * Plugins * @@ -241,8 +264,8 @@ Optimizations - S60 version specific plugins * Isolated S60 version dependent functionality to S60 version specific plugins (qts60plugin_x_y.dll) to make it possible for single build to - run on any supported device, even if with reduced functionality on - some. + run on any supported device, even if with reduced functionality on + some. **************************************************************************** @@ -251,7 +274,7 @@ Optimizations - Qt libs * Qt libs are now built with "All -Tcb" capabilities always. It is now - always necessary to run patch_capabilities.pl script if self-signing + always necessary to run patch_capabilities.pl script if self-signing of Qt libs is desired. * QtCore and QtSql made UNPAGED as workaround for an obscure crash when they are paged. -- cgit v0.12 From f67100b49b492f09522d6d351d32a6ab9ddea098 Mon Sep 17 00:00:00 2001 From: mread Date: Mon, 15 Jun 2009 13:32:47 +0100 Subject: removed mention of qt_QString2TPtrC from qdoc --- doc/src/symbian-exceptionsafety.qdoc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/src/symbian-exceptionsafety.qdoc b/doc/src/symbian-exceptionsafety.qdoc index ea9e9b8..e42ecd1 100644 --- a/doc/src/symbian-exceptionsafety.qdoc +++ b/doc/src/symbian-exceptionsafety.qdoc @@ -164,9 +164,8 @@ it's dealing with strings it probably does, again bad. Line 4 is tricky, it calls a leaving function which is ok within a \c TRAP, - but it also uses \l qt_QString2TPtrC. You might think this is safe, but - there is a potential realloc call in there, so this can cause an unwelcome - exception. + but it also uses a helper function to convert string types. In this case + the helper function may cause an unwelcome exception. We could rewrite this with nested exception translations, but it's much easier to refactor it. -- cgit v0.12 From 2b630bd12b9e944707d8e52c1135e88750323ed0 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Mon, 15 Jun 2009 14:41:16 +0200 Subject: Updated softkey example to be more complete --- examples/widgets/softkeys/softkeys.cpp | 83 +++++++++++++++++++++++++--------- examples/widgets/softkeys/softkeys.h | 13 ++++-- 2 files changed, 70 insertions(+), 26 deletions(-) diff --git a/examples/widgets/softkeys/softkeys.cpp b/examples/widgets/softkeys/softkeys.cpp index 083d05c..9672aee 100644 --- a/examples/widgets/softkeys/softkeys.cpp +++ b/examples/widgets/softkeys/softkeys.cpp @@ -42,33 +42,73 @@ #include "softkeys.h" MainWindow::MainWindow(QWidget *parent) - : QMainWindow(parent) + : QMainWindow(parent) { central = new QWidget(this); + central->setContextMenuPolicy(Qt::NoContextMenu); // explicitly forbid usage of context menu so actions item is not shown menu setCentralWidget(central); - infoLabel = new QLabel(tr("Open menu to start!")); + + // Create text editor and set softkeys to it + textEditor= new QTextEdit(tr("Choose items from menu or navigate around with tab+selection to see what softkeys can do"), this); + QAction* fill = new QAction(tr("Fill"), this); + fill->setSoftKeyRole(QAction::OkSoftKey); + QAction* clear = new QAction(tr("Clear"), this); + clear->setSoftKeyRole(QAction::CancelSoftKey); + + QList textEditorSoftKeys; + textEditorSoftKeys.append(fill); + textEditorSoftKeys.append(clear); + textEditor->setSoftKeys(textEditorSoftKeys); + + infoLabel = new QLabel(tr(""), this); + infoLabel->setContextMenuPolicy(Qt::NoContextMenu); + + pushButton = new QPushButton(tr("Open File Dialog"), this); + pushButton->setContextMenuPolicy(Qt::NoContextMenu); + + QComboBox* comboBox = new QComboBox(this); + comboBox->setContextMenuPolicy(Qt::NoContextMenu); + comboBox->insertItems(0, QStringList() + << QApplication::translate("MainWindow", "Selection1", 0, QApplication::UnicodeUTF8) + << QApplication::translate("MainWindow", "Selection2", 0, QApplication::UnicodeUTF8) + << QApplication::translate("MainWindow", "Selection3", 0, QApplication::UnicodeUTF8) + ); layout = new QVBoxLayout; + layout->addWidget(textEditor); layout->addWidget(infoLabel); + layout->addWidget(pushButton); + layout->addWidget(comboBox); central->setLayout(layout); - central->setFocusPolicy(Qt::TabFocus); - + fileMenu = menuBar()->addMenu(tr("&File")); - openDialogAct = new QAction(tr("&Open Dialog"), this); addSoftKeysAct = new QAction(tr("&Add Softkeys"), this); - clearSoftKeysAct = new QAction(tr("&Clear Softkeys"), this); - fileMenu->addAction(openDialogAct); fileMenu->addAction(addSoftKeysAct); - fileMenu->addAction(clearSoftKeysAct); - connect(openDialogAct, SIGNAL(triggered()), this, SLOT(openDialog())); - connect(addSoftKeysAct, SIGNAL(triggered()), this, SLOT(addSoftKeys())); - connect(clearSoftKeysAct, SIGNAL(triggered()), this, SLOT(clearSoftKeys())); + exit = new QAction(tr("&Exit"), this); + fileMenu->addAction(exit); + + connect(fill, SIGNAL(triggered()), this, SLOT(fillTextEditor())); + connect(clear, SIGNAL(triggered()), this, SLOT(clearTextEditor())); + connect(pushButton, SIGNAL(clicked()), this, SLOT(openDialog())); + connect(addSoftKeysAct, SIGNAL(triggered()), this, SLOT(addSoftKeys())); + connect(exit, SIGNAL(triggered()), this, SLOT(exitApplication())); + pushButton->setFocus(); } MainWindow::~MainWindow() { } +void MainWindow::fillTextEditor() +{ + textEditor->setText(tr("The fill softkey was pressed and here is some text to fill the editor")); +} + +void MainWindow::clearTextEditor() +{ + textEditor->setText(tr("")); +} + void MainWindow::openDialog() { QFileDialog::getOpenFileName(this); @@ -78,33 +118,34 @@ void MainWindow::addSoftKeys() { ok = new QAction(tr("Ok"), this); ok->setSoftKeyRole(QAction::OkSoftKey); - connect(ok, SIGNAL(triggered()), this, SLOT(okPressed())); - + connect(ok, SIGNAL(triggered()), this, SLOT(okPressed())); + cancel = new QAction(tr("Cancel"), this); cancel->setSoftKeyRole(QAction::OkSoftKey); - connect(cancel, SIGNAL(triggered()), this, SLOT(cancelPressed())); + connect(cancel, SIGNAL(triggered()), this, SLOT(cancelPressed())); QList softkeys; softkeys.append(ok); softkeys.append(cancel); - central->setSoftKeys(softkeys); - central->setFocus(); - + pushButton->setSoftKeys(softkeys); } -void MainWindow::clearSoftKeys() +void MainWindow::exitApplication() { - central->setSoftKey(0); + qApp->exit(); } void MainWindow::okPressed() { infoLabel->setText(tr("OK pressed")); - central->setSoftKey(0); + pushButton->setSoftKey(0); } void MainWindow::cancelPressed() { infoLabel->setText(tr("Cancel pressed")); - central->setSoftKey(0); + pushButton->setSoftKey(0); } + + + diff --git a/examples/widgets/softkeys/softkeys.h b/examples/widgets/softkeys/softkeys.h index 11db419..bd75473 100644 --- a/examples/widgets/softkeys/softkeys.h +++ b/examples/widgets/softkeys/softkeys.h @@ -48,24 +48,27 @@ class MainWindow : public QMainWindow { Q_OBJECT public: - + private slots: + void fillTextEditor(); + void clearTextEditor(); void openDialog(); void addSoftKeys(); - void clearSoftKeys(); + void exitApplication(); void okPressed(); void cancelPressed(); public: - MainWindow(QWidget *parent = 0); + MainWindow(QWidget *parent = 0); ~MainWindow(); private: QVBoxLayout *layout; QWidget *central; + QTextEdit* textEditor; QLabel *infoLabel; + QPushButton* pushButton; QMenu* fileMenu; - QAction* openDialogAct; QAction* addSoftKeysAct; - QAction* clearSoftKeysAct; + QAction* exit; QAction* ok; QAction* cancel; }; -- cgit v0.12 From 81a74bb1ad1ee6c925c24efd4e0171df749aeb55 Mon Sep 17 00:00:00 2001 From: mread Date: Mon, 15 Jun 2009 13:53:49 +0100 Subject: fixed code formatting to Qt style --- .../qmainexceptions/tst_qmainexceptions.cpp | 83 ++++++++++++---------- 1 file changed, 44 insertions(+), 39 deletions(-) diff --git a/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp b/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp index db80496..adad544 100644 --- a/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp +++ b/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp @@ -52,12 +52,12 @@ class tst_qmainexceptions : public QObject public: tst_qmainexceptions(){}; ~tst_qmainexceptions(){}; - + void TestSchedulerCatchesError(TLeavingFunc* f, int error); void TestSymbianRoundTrip(int leave, int trap); - + bool event(QEvent *event); - + public slots: void initTestCase(); private slots: @@ -101,6 +101,7 @@ void tst_qmainexceptions::cleanupstack() CleanupStack::PopAndDestroy(dummy1); __UHEAP_MARKEND; } + void tst_qmainexceptions::leave() { __UHEAP_MARK; @@ -109,58 +110,57 @@ void tst_qmainexceptions::leave() CDummy* csDummy = new (ELeave) CDummy; CleanupStack::PushL(csDummy); __UHEAP_FAILNEXT(1); - dummy1 = new (ELeave) CDummy; + dummy1 = new (ELeave) CDummy; //CleanupStack::PopAndDestroy(csDummy); not executed as previous line throws }); QCOMPARE(err,KErrNoMemory); - QVERIFY(!((int)dummy1)); + QVERIFY(!((int)dummy1)); __UHEAP_MARKEND; } class CTestActive : public CActive - { +{ public: - CTestActive(TLeavingFunc* aFunc) : CActive(EPriorityStandard), iFunc(aFunc) - { + CTestActive(TLeavingFunc* aFunc) : CActive(EPriorityStandard), iFunc(aFunc) + { CActiveScheduler::Add(this); - } + } ~CTestActive() - { + { Cancel(); - } - void DoCancel() - {} + } + void DoCancel() {} void Test() - { + { // complete this AO in a nested scheduler, to make it synchronous TRequestStatus* s = &iStatus; SetActive(); User::RequestComplete(s, KErrNone); CActiveScheduler::Start(); - } + } void RunL() - { + { (*iFunc)(); CActiveScheduler::Stop(); // will only get here if iFunc does not leave - } + } TInt RunError(TInt aError) - { + { error = aError; CActiveScheduler::Stop(); // will only get here if iFunc leaves return KErrNone; - } + } public: TLeavingFunc* iFunc; int error; - }; +}; void tst_qmainexceptions::TestSchedulerCatchesError(TLeavingFunc* f, int error) - { +{ CTestActive *act = new(ELeave) CTestActive(f); act->Test(); QCOMPARE(act->error, error); delete act; - } +} void ThrowBadAlloc() { @@ -200,9 +200,9 @@ void tst_qmainexceptions::TestSymbianRoundTrip(int leave, int trap) // check that leave converted to exception, converted to error gives expected error code int trapped; QT_TRANSLATE_EXCEPTION_TO_SYMBIAN_ERROR( - trapped, - QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION( - User::LeaveIfError(leave))); + trapped, + QT_TRANSLATE_SYMBIAN_LEAVE_TO_EXCEPTION( + User::LeaveIfError(leave))); QCOMPARE(trap, trapped); } @@ -224,31 +224,36 @@ void tst_qmainexceptions::testTrap() } bool tst_qmainexceptions::event(QEvent *aEvent) - { +{ if (aEvent->type() == QEvent::User+1) throw std::bad_alloc(); - else if (aEvent->type() == QEvent::User+2) - { + else if (aEvent->type() == QEvent::User+2) { QEvent event(QEvent::Type(QEvent::User+1)); QApplication::sendEvent(this, &event); - } - return QObject::event(aEvent); } + return QObject::event(aEvent); +} void tst_qmainexceptions::testPropagation() { // test exception thrown from event is propagated back to sender QEvent event(QEvent::Type(QEvent::User+1)); bool caught = false; - try { QApplication::sendEvent(this, &event); } - catch (const std::bad_alloc&) { caught = true; } + try { + QApplication::sendEvent(this, &event); + } catch (const std::bad_alloc&) { + caught = true; + } QCOMPARE(caught, true); // testing nested events propagate back to top level sender caught = false; QEvent event2(QEvent::Type(QEvent::User+2)); - try { QApplication::sendEvent(this, &event2); } - catch (const std::bad_alloc&) { caught = true; } + try { + QApplication::sendEvent(this, &event2); + } catch (const std::bad_alloc&) { + caught = true; + } QCOMPARE(caught, true); } @@ -290,13 +295,13 @@ void tst_qmainexceptions::testDtor2() void tst_qmainexceptions::testNestedExceptions() { // throwing exceptions while handling exceptions - struct Oops { + struct Oops { Oops* next; Oops(int level) : next(level > 0 ? new Oops(level-1) : 0) {} - ~Oops() { - try { throw std::bad_alloc(); } - catch (const std::exception&) {delete next;} - } + ~Oops() { + try { throw std::bad_alloc(); } + catch (const std::exception&) {delete next;} + } }; try { Oops oops(5); -- cgit v0.12 From ea271d2e8e418a489d123971e0418b57050402a9 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Mon, 15 Jun 2009 14:58:47 +0200 Subject: Added ExitSoftKey role --- src/gui/kernel/qaction.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qaction.h b/src/gui/kernel/qaction.h index 8791a5c..dfa4933 100644 --- a/src/gui/kernel/qaction.h +++ b/src/gui/kernel/qaction.h @@ -94,7 +94,7 @@ public: enum SoftKeyRole { OptionsSoftKey, SelectSoftKey, BackSoftKey, NextSoftKey, PreviousSoftKey, OkSoftKey, CancelSoftKey, EditSoftKey, ViewSoftKey, BackSpaceSoftKey, EndEditSoftKey, RevertEditSoftKey, DeselectSoftKey, FinishSoftKey, - MenuSoftKey, ContextMenuSoftKey, Key1SoftKey, Key2SoftKey, + MenuSoftKey, ContextMenuSoftKey, ExitSoftKey, Key1SoftKey, Key2SoftKey, Key3SoftKey, Key4SoftKey, CustomSoftKey }; explicit QAction(QObject* parent); QAction(const QString &text, QObject* parent); -- cgit v0.12 From 94e684e1503230e950c56c234e4683fc78ab5356 Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Mon, 15 Jun 2009 15:02:49 +0200 Subject: updated changes-4.5.2-tower. --- dist/changes-4.5.2-tower | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dist/changes-4.5.2-tower b/dist/changes-4.5.2-tower index 19e8d3c..ea9e34a 100644 --- a/dist/changes-4.5.2-tower +++ b/dist/changes-4.5.2-tower @@ -31,7 +31,7 @@ New modules * Implemented QtSql module with sqlite3 backend. For now backend is provided only in binary format. - QtWebkit - * todo + * Experimental webkit build for s60. Can be enabled by passing -webkit to configure. - Phonon * todo @@ -101,6 +101,8 @@ Optimizations - QTest * Fixed testlib export macros for RVCT builds. +- namespaces + * Now builds when -qtnamespace option is defined **************************************************************************** * Changes to existing classes * @@ -177,6 +179,7 @@ Optimizations - QApplication * 252798: Fixed layout when orientation changed via AknAppUi::SetOrientationL. + * Generating MouseEvents has gone through several changes - QUdpSocket * Wrote hack for QUdpSocket::writeDatagram return value in Symbian OS. @@ -241,6 +244,7 @@ Optimizations * -cetest is no longer a supported switch for configure. * -stl option is enabled by default for Symbian OS * -openssl option is enabled by default for Symbian OS. + * -fpu option enables vfpu type selection for ARM targets. - Release package creation * Removed the obsolete script to create release package. -- cgit v0.12 From 3230496d13fd36a732b7a32914cac66dda7f4461 Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Mon, 15 Jun 2009 15:20:33 +0200 Subject: Include Phonon changes. --- dist/changes-4.5.2-tower | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dist/changes-4.5.2-tower b/dist/changes-4.5.2-tower index ea9e34a..41dc8c8 100644 --- a/dist/changes-4.5.2-tower +++ b/dist/changes-4.5.2-tower @@ -33,8 +33,11 @@ New modules - QtWebkit * Experimental webkit build for s60. Can be enabled by passing -webkit to configure. - Phonon - * todo - + * The Phonon library is now part of Qt, but it comes without a backend. + This means that applications can build and run against the Phonon + library, but there is currently no S60 backend plugin providing actual + multimedia playback. Possible alternatives such as Helix and MMF are + being investigated. New classes ------------ -- cgit v0.12 From ebbb3f553bf9f882bfb732391d46494ea02d5569 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Mon, 15 Jun 2009 15:24:53 +0200 Subject: Remove compiler warning on Qt/Windows The QFileDialogPrivate constructor must be non-inline. RevBy: aportale --- src/gui/dialogs/qfiledialog.cpp | 28 ++++++++++++++++++++++++++++ src/gui/dialogs/qfiledialog_p.h | 26 +------------------------- 2 files changed, 29 insertions(+), 25 deletions(-) diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index 60d3034..9768162 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -487,6 +487,34 @@ void QFileDialog::changeEvent(QEvent *e) QDialog::changeEvent(e); } +QFileDialogPrivate::QFileDialogPrivate() + : +#ifndef QT_NO_PROXYMODEL + proxyModel(0), +#endif + model(0), + fileMode(QFileDialog::AnyFile), + acceptMode(QFileDialog::AcceptOpen), + currentHistoryLocation(-1), + renameAction(0), + deleteAction(0), + showHiddenAction(0), + useDefaultCaption(true), + defaultFileTypes(true), + fileNameLabelExplicitlySat(false), + nativeDialogInUse(false), +#ifdef Q_WS_MAC + mDelegate(0), +#ifndef QT_MAC_USE_COCOA + mDialog(0), + mDialogStarted(false), + mDialogClosed(true), +#endif +#endif + qFileDialogUi(0) +{ +} + QFileDialogPrivate::~QFileDialogPrivate() { } diff --git a/src/gui/dialogs/qfiledialog_p.h b/src/gui/dialogs/qfiledialog_p.h index 99f61f0..3195583 100644 --- a/src/gui/dialogs/qfiledialog_p.h +++ b/src/gui/dialogs/qfiledialog_p.h @@ -113,31 +113,7 @@ class Q_AUTOTEST_EXPORT QFileDialogPrivate : public QDialogPrivate Q_DECLARE_PUBLIC(QFileDialog) public: - QFileDialogPrivate() : -#ifndef QT_NO_PROXYMODEL - proxyModel(0), -#endif - model(0), - fileMode(QFileDialog::AnyFile), - acceptMode(QFileDialog::AcceptOpen), - currentHistoryLocation(-1), - renameAction(0), - deleteAction(0), - showHiddenAction(0), - useDefaultCaption(true), - defaultFileTypes(true), - fileNameLabelExplicitlySat(false), - nativeDialogInUse(false), -#ifdef Q_WS_MAC - mDelegate(0), -#ifndef QT_MAC_USE_COCOA - mDialog(0), - mDialogStarted(false), - mDialogClosed(true), -#endif -#endif - qFileDialogUi(0) - {} + QFileDialogPrivate(); void createToolButtons(); void createMenuActions(); -- cgit v0.12 From 08ae7ee1fb930e7d4b4039e2294cba69f9380964 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Mon, 15 Jun 2009 15:27:24 +0200 Subject: remove compiler warning on MSVC --- src/gui/kernel/qwidget.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qwidget.h b/src/gui/kernel/qwidget.h index 680bbaa..1edd466 100644 --- a/src/gui/kernel/qwidget.h +++ b/src/gui/kernel/qwidget.h @@ -731,7 +731,7 @@ private: friend class QGraphicsProxyWidget; friend class QGraphicsProxyWidgetPrivate; friend class QStyleSheetStyle; - friend class QWidgetExceptionCleaner; + friend struct QWidgetExceptionCleaner; #ifdef Q_WS_MAC friend class QCoreGraphicsPaintEnginePrivate; -- cgit v0.12