From d99d8953d2c45ca3ad05fea35ac71407237ab59d Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 22 Nov 2010 16:51:41 +0100 Subject: Doc: Fixed broken link by referring to the errors() method instead. Task-number: QTBUG-15506 --- src/declarative/util/qdeclarativeview.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp index 0e31a20..c22f200 100644 --- a/src/declarative/util/qdeclarativeview.cpp +++ b/src/declarative/util/qdeclarativeview.cpp @@ -192,7 +192,7 @@ void QDeclarativeViewPrivate::itemGeometryChanged(QDeclarativeItem *resizeItem, /*! \class QDeclarativeView - \since 4.7 + \since 4.7 \brief The QDeclarativeView class provides a widget for displaying a Qt Declarative user interface. QDeclarativeItem objects can be placed on a standard QGraphicsScene and @@ -360,13 +360,14 @@ QDeclarativeContext* QDeclarativeView::rootContext() const } /*! - \enum QDeclarativeView::Status + \enum QDeclarativeView::Status Specifies the loading status of the QDeclarativeView. \value Null This QDeclarativeView has no source set. \value Ready This QDeclarativeView has loaded and created the QML component. \value Loading This QDeclarativeView is loading network data. - \value Error An error has occurred. Call errorDescription() to retrieve a description. + \value Error One or more errors has occurred. Call errors() to retrieve a list + of errors. */ /*! \enum QDeclarativeView::ResizeMode -- cgit v0.12 From be99e778d361068e81936773def14c731553991f Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 22 Nov 2010 19:42:25 +0100 Subject: Doc: Removed incorrect statement about the C locale. Task-number: QTBUG-15488 --- src/corelib/tools/qlocale.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index d152682..be1dc08 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -1576,8 +1576,6 @@ QDataStream &operator>>(QDataStream &ds, QLocale &l) defaults to the default locale (see setDefault()). \endlist - 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. -- cgit v0.12 From 3dc88a6229afc72125fa5565eb565a6fbc92620f Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 23 Nov 2010 15:21:20 +0100 Subject: Doc: Added general statements about reentrancy and thread safety. Task-number: QTBUG-14273 --- doc/src/frameworks-technologies/threads.qdoc | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/doc/src/frameworks-technologies/threads.qdoc b/doc/src/frameworks-technologies/threads.qdoc index 3ef617c..3e0204f 100644 --- a/doc/src/frameworks-technologies/threads.qdoc +++ b/doc/src/frameworks-technologies/threads.qdoc @@ -213,10 +213,10 @@ /*! \page threads-reentrancy.html \title Reentrancy and Thread-Safety - + \keyword reentrant \keyword thread-safe - + \previouspage Synchronizing Threads \contentspage Thread Support in Qt \nextpage Threads and QObjects @@ -243,6 +243,15 @@ from multiple threads, even if all the threads use the \e{same} instance of the class. + \note Qt classes are only documented as \e{thread-safe} if they + are intended to be used by multiple threads. If a function is not + marked as thread-safe or reentrant, it should not be used from + different threads. If a class is not marked as thread-safe or + reentrant then a specific instance of that class should not be + accessed from different threads. + + \section1 Reentrancy + C++ classes are often reentrant, simply because they only access their own member data. Any thread can call a member function on an instance of a reentrant class, as long as no other thread can call @@ -268,6 +277,8 @@ end up overwriting each other, and the variable is incremented only once! + \section1 Thread-Safety + Clearly, the access must be serialized: Thread A must perform steps 1, 2, 3 without interruption (atomically) before thread B can perform the same steps; or vice versa. An easy way to make @@ -284,6 +295,8 @@ declared with the \c mutable qualifier because we need to lock and unlock the mutex in \c value(), which is a const function. + \section1 Notes on Qt Classes + Many Qt classes are \e{reentrant}, but they are not made \e{thread-safe}, because making them thread-safe would incur the extra overhead of repeatedly locking and unlocking a QMutex. For @@ -297,9 +310,6 @@ the thread-related classes (e.g. QMutex) and fundamental functions (e.g. QCoreApplication::postEvent()). - \note Qt Classes are only documented as \e{thread-safe} if they - are intended to be used by multiple threads. - \note Terminology in the multithreading domain isn't entirely standardized. POSIX uses definitions of reentrant and thread-safe that are somewhat different for its C APIs. When using other -- cgit v0.12 From 57d1545e4afc97517f1472e626c27b8009e904cc Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 24 Nov 2010 13:48:14 +0100 Subject: Doc: Added documentation about Tab and Backtab key handling. Task-number: QTBUG-15569 --- src/declarative/graphicsitems/qdeclarativeitem.cpp | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index e0df751..93572a0 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -484,10 +484,18 @@ void QDeclarativeItemKeyFilter::componentComplete() \qmlproperty Item KeyNavigation::down These properties hold the item to assign focus to - when Key_Left, Key_Right, Key_Up or Key_Down are + when the left, right, up or down cursor keys are pressed. */ +/*! + \qmlproperty Item KeyNavigation::tab + \qmlproperty Item KeyNavigation::backtab + + These properties hold the item to assign focus to + when the Tab key or Shift+Tab key combination (Backtab) are pressed. +*/ + QDeclarativeKeyNavigationAttached::QDeclarativeKeyNavigationAttached(QObject *parent) : QObject(*(new QDeclarativeKeyNavigationAttachedPrivate), parent), QDeclarativeItemKeyFilter(qobject_cast(parent)) @@ -941,6 +949,20 @@ void QDeclarativeKeyNavigationAttached::keyReleased(QKeyEvent *event, bool post) */ /*! + \qmlsignal Keys::onTabPressed(KeyEvent event) + + This handler is called when the Tab key has been pressed. The \a event + parameter provides information about the event. +*/ + +/*! + \qmlsignal Keys::onBacktabPressed(KeyEvent event) + + This handler is called when the Shift+Tab key combination (Backtab) has + been pressed. The \a event parameter provides information about the event. +*/ + +/*! \qmlsignal Keys::onAsteriskPressed(KeyEvent event) This handler is called when the Asterisk '*' has been pressed. The \a event -- cgit v0.12 From a0be2bb3f5a7f71f1e77ca7b8907e49b8e16bef3 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 25 Nov 2010 13:50:27 +0100 Subject: Doc: Fixed a snippet to show QML comments. Task-number: QTBUG-15584 --- doc/src/snippets/declarative/comments.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/src/snippets/declarative/comments.qml b/doc/src/snippets/declarative/comments.qml index a8e47ad..97659a5 100644 --- a/doc/src/snippets/declarative/comments.qml +++ b/doc/src/snippets/declarative/comments.qml @@ -38,7 +38,6 @@ ** ****************************************************************************/ -//![0] import QtQuick 1.0 //![0] -- cgit v0.12 From dcce5c796e5cd5cb090f1c395e483269bab01566 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 25 Nov 2010 13:56:29 +0100 Subject: Doc: Fixed whitespace. --- .../qmlvisual/webview/flickable/flickweb.qml | 70 +++++++++++----------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/tests/auto/declarative/qmlvisual/webview/flickable/flickweb.qml b/tests/auto/declarative/qmlvisual/webview/flickable/flickweb.qml index 6063226..af09389 100644 --- a/tests/auto/declarative/qmlvisual/webview/flickable/flickweb.qml +++ b/tests/auto/declarative/qmlvisual/webview/flickable/flickweb.qml @@ -1,35 +1,35 @@ -import QtQuick 1.0 -import QtWebKit 1.0 - -Flickable { - id: flickable - width: 320 - height: 200 - contentWidth: Math.max(flickable.width,webView.width) - contentHeight: Math.max(flickable.height,webView.height) - pressDelay: 100 - - WebView { - id: webView - transformOrigin: Item.TopLeft - smooth: false // We don't want smooth scaling, since we only scale during (fast) transitions - url: "test.html" - preferredWidth: flickable.width - preferredHeight: flickable.height - contentsScale: 1 - onContentsSizeChanged: { - // zoom out - contentsScale = Math.min(1,flickable.width / contentsSize.width) - } - } - - Rectangle { - id: button - width: 50; height: 50; color: "red" - MouseArea { - anchors.fill: parent - onPressed: button.color = "blue" - onReleased: button.color = "green" - } - } -} +import QtQuick 1.0 +import QtWebKit 1.0 + +Flickable { + id: flickable + width: 320 + height: 200 + contentWidth: Math.max(flickable.width,webView.width) + contentHeight: Math.max(flickable.height,webView.height) + pressDelay: 100 + + WebView { + id: webView + transformOrigin: Item.TopLeft + smooth: false // We don't want smooth scaling, since we only scale during (fast) transitions + url: "test.html" + preferredWidth: flickable.width + preferredHeight: flickable.height + contentsScale: 1 + onContentsSizeChanged: { + // zoom out + contentsScale = Math.min(1,flickable.width / contentsSize.width) + } + } + + Rectangle { + id: button + width: 50; height: 50; color: "red" + MouseArea { + anchors.fill: parent + onPressed: button.color = "blue" + onReleased: button.color = "green" + } + } +} -- cgit v0.12 From 3fe96820ea6830cb76793602f9f51fb961e70976 Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Fri, 26 Nov 2010 08:41:37 +0100 Subject: Doc: Removed two warnings from QDirIterator docs Task-number: QTBUG-15492 --- src/corelib/io/qdiriterator.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/corelib/io/qdiriterator.cpp b/src/corelib/io/qdiriterator.cpp index fd4b9c1..dbb333f 100644 --- a/src/corelib/io/qdiriterator.cpp +++ b/src/corelib/io/qdiriterator.cpp @@ -389,9 +389,6 @@ QDirIterator::QDirIterator(const QDir &dir, IteratorFlags flags) \note To list symlinks that point to non existing files, QDir::System must be passed to the flags. - \warning This constructor expects \a flags to be left at its default value. Use - the constructors that do not take the \a filters argument instead. - \sa hasNext(), next(), IteratorFlags */ QDirIterator::QDirIterator(const QString &path, QDir::Filters filters, IteratorFlags flags) @@ -429,9 +426,6 @@ QDirIterator::QDirIterator(const QString &path, IteratorFlags flags) \note To list symlinks that point to non existing files, QDir::System must be passed to the flags. - \warning This constructor expects \c flags to be left at its default value. Use the - constructors that do not take the \a filters argument instead. - \sa hasNext(), next(), IteratorFlags */ QDirIterator::QDirIterator(const QString &path, const QStringList &nameFilters, -- cgit v0.12 From 5f70c3d9004765f8f86e3472cf59cfa7677f9163 Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Fri, 26 Nov 2010 09:29:26 +0100 Subject: Doc:Fix paths in styleplugin/echoplugin .pro files Task-number: QTBUG-14169 --- examples/tools/echoplugin/echowindow/echowindow.pro | 4 ++-- examples/tools/styleplugin/plugin/plugin.pro | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/tools/echoplugin/echowindow/echowindow.pro b/examples/tools/echoplugin/echowindow/echowindow.pro index bdf8c41..d56961c 100644 --- a/examples/tools/echoplugin/echowindow/echowindow.pro +++ b/examples/tools/echoplugin/echowindow/echowindow.pro @@ -5,8 +5,8 @@ SOURCES = echowindow.cpp \ TARGET = echoplugin win32 { - debug:DESTDIR = ../debug/ - release:DESTDIR = ../release/ + CONFIG(debug, release|debug):DESTDIR = ../debug/ + CONFIG(release, release|debug):DESTDIR = ../release/ } else { DESTDIR = ../ } diff --git a/examples/tools/styleplugin/plugin/plugin.pro b/examples/tools/styleplugin/plugin/plugin.pro index 7cb0c97..54e266c 100644 --- a/examples/tools/styleplugin/plugin/plugin.pro +++ b/examples/tools/styleplugin/plugin/plugin.pro @@ -8,8 +8,8 @@ SOURCES = simplestyle.cpp \ TARGET = simplestyleplugin #! [0] win32 { - debug:DESTDIR = ../debug/styles/ - release:DESTDIR = ../release/styles/ + CONFIG(debug, release|debug):DESTDIR = ../debug/styles/ + CONFIG(release, release|debug):DESTDIR = ../release/styles/ } else { DESTDIR = ../styles/ } -- cgit v0.12 From 16c3df54960b776f35f59288b888e829e7e81002 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 30 Nov 2010 12:09:48 +0100 Subject: Fixed incorrect angle values in the RotationAnimation description. Task-number: QTBUG-15696 --- src/declarative/util/qdeclarativeanimation.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index f2e6217..dd7e5fd 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -1324,7 +1324,7 @@ void QDeclarativeVector3dAnimation::setTo(QVector3D t) /*! \qmlclass RotationAnimation QDeclarativeRotationAnimation - \ingroup qml-animation-transition + \ingroup qml-animation-transition \since 4.7 \inherits PropertyAnimation \brief The RotationAnimation element animates changes in rotation values. @@ -1333,8 +1333,8 @@ void QDeclarativeVector3dAnimation::setTo(QVector3D t) over the direction of rotation during an animation. By default, it rotates in the direction - of the numerical change; a rotation from 0 to 240 will rotate 220 degrees - clockwise, while a rotation from 240 to 0 will rotate 220 degrees + of the numerical change; a rotation from 0 to 240 will rotate 240 degrees + clockwise, while a rotation from 240 to 0 will rotate 240 degrees counterclockwise. The \l direction property can be set to specify the direction in which the rotation should occur. @@ -1342,7 +1342,7 @@ void QDeclarativeVector3dAnimation::setTo(QVector3D t) between states via the shortest path: \snippet doc/src/snippets/declarative/rotationanimation.qml 0 - + Notice the RotationAnimation did not need to set a \l target value. As a convenience, when used in a transition, RotationAnimation will rotate all properties named "rotation" or "angle". You can override this by providing -- cgit v0.12 From 19b1ab1f2f4df72621b1bef43a4a24286ae12657 Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Mon, 6 Dec 2010 16:07:06 +0100 Subject: Fixed a bug by changing the id name to lower case. --- doc/src/getting-started/gettingstartedqml.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/getting-started/gettingstartedqml.qdoc b/doc/src/getting-started/gettingstartedqml.qdoc index b767587..e3977bb 100644 --- a/doc/src/getting-started/gettingstartedqml.qdoc +++ b/doc/src/getting-started/gettingstartedqml.qdoc @@ -148,7 +148,7 @@ \code Rectangle { - id:Button + id: button ... property color buttonColor: "lightblue" -- cgit v0.12 From 9679add86ec1562d24d587c6c2343c47ca4b61d7 Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Mon, 6 Dec 2010 16:09:26 +0100 Subject: Some whitespace fixes. --- doc/src/declarative/modules.qdoc | 64 ++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/doc/src/declarative/modules.qdoc b/doc/src/declarative/modules.qdoc index 011eb63..2a2e4ff 100644 --- a/doc/src/declarative/modules.qdoc +++ b/doc/src/declarative/modules.qdoc @@ -31,14 +31,14 @@ \section1 QML Modules -A module is a set of QML content files that can be imported as a unit into a QML +A module is a set of QML content files that can be imported as a unit into a QML application. Modules can be used to organize QML content into independent units, -and they can use a versioning mechanism that allows for independent +and they can use a versioning mechanism that allows for independent upgradability of the modules. While QML component files within the same directory are automatically accessible -within the global namespace, components defined elsewhere must be imported -explicitly using the \c import statement to import them as modules. For +within the global namespace, components defined elsewhere must be imported +explicitly using the \c import statement to import them as modules. For example, an \c import statement is required to use: \list @@ -54,13 +54,13 @@ This can be seen in the snippet commonly found at the top of QML files: \qml import QtQuick 1.0 \endqml - -This imports version 4.7 of the "Qt" module into the global namespace. (The QML + +This imports version 1.0 of the "QtQuick" module into the global namespace. (The QML library itself must be imported to use any of the \l {QML Elements}, as they are not included in the global namespace by default.) -The \c Qt module is an \e installed module; it is found in the -\l{The QML import path}{import path}. There are two types of QML modules: +The \c Qt module is an \e installed module; it is found in the +\l{The QML import path}{import path}. There are two types of QML modules: location modules (defined by a URL) and installed modules (defined by a URI). @@ -87,8 +87,8 @@ directory using a relative or absolute path, like this: MyQMLProject |- MyComponents |- Slider.qml - |- CheckBox.qml - |- Main + |- CheckBox.qml + |- Main |- application.qml \endcode @@ -112,7 +112,7 @@ be imported like this: Remote location modules must have a \l{Writing a qmldir file}{qmldir file} in the same directory to specify which QML files should be made available. See the -\l {#qmldirexample}{example} below. The qmldir file is optional for modules on +\l {#qmldirexample}{example} below. The qmldir file is optional for modules on the local filesystem. @@ -121,8 +121,8 @@ the local filesystem. Installed modules are modules that are installed on the -local filesystem within the QML import path, or modules defined in C++ -application code. When importing an installed module, an un-quoted URI is +local filesystem within the QML import path, or modules defined in C++ +application code. When importing an installed module, an un-quoted URI is used, with a mandatory version number: \code @@ -131,7 +131,7 @@ used, with a mandatory version number: \endcode Installed modules that are installed into the import path or created -as a \l{QDeclarativeExtensionPlugin}{QML C++ plugin} must define a +as a \l{QDeclarativeExtensionPlugin}{QML C++ plugin} must define a \l{Writing a qmldir file}{qmldir file}. @@ -142,7 +142,7 @@ The default import path includes: \list \o The directory of the current file -\o The location specified by QLibraryInfo::ImportsPath +\o The location specified by QLibraryInfo::ImportsPath \o Paths specified by the \c QML_IMPORT_PATH environment variable \endlist @@ -153,10 +153,10 @@ When running the \l {QML Viewer}, use the \c -I option to add paths to the impor \section2 Creating installed modules in C++ -C++ applications can dynamically define installed modules using -qmlRegisterType(). +C++ applications can dynamically define installed modules using +qmlRegisterType(). -For \l{QDeclarativeExtensionPlugin}{QML C++ plugins}, the +For \l{QDeclarativeExtensionPlugin}{QML C++ plugins}, the module URI is automatically passed to QDeclarativeExtensionPlugin::registerTypes(). The QDeclarativeExtensionPlugin documentation shows how to use this URI to call qmlRegisterType() to enable the plugin library to be built as @@ -167,7 +167,7 @@ in QML, like this: import com.nokia.TimeExample 1.0 \endcode -A \l{QDeclarativeExtensionPlugin}{QML C++ plugin} also requires a +A \l{QDeclarativeExtensionPlugin}{QML C++ plugin} also requires a \l{Writing a qmldir file}{qmldir file} to make it available to the QML engine. @@ -190,9 +190,9 @@ Types from these modules can then only be used when qualified by the namespace: \qml QtLibrary.Rectangle { ... } - + MyComponents.Slider { ... } - + MyModule.SomeComponent { ... } \endqml @@ -209,7 +209,7 @@ JavaScript files must always be imported with a named import: \qml import "somescript.js" as MyScript - + Item { //... Component.onCompleted: MyScript.doSomething() @@ -220,8 +220,8 @@ JavaScript files must always be imported with a named import: \section1 Writing a qmldir file -A \c qmldir file is a metadata file for a module that maps all type names in -the module to versioned QML files. It is required for installed modules, and +A \c qmldir file is a metadata file for a module that maps all type names in +the module to versioned QML files. It is required for installed modules, and location modules that are loaded from a network source. It is defined by a plain text file named "qmldir" that contains one or more lines of the form: @@ -237,7 +237,7 @@ plugin [] \bold { [] } lines are used to add QML files as types. is the type being made available, the optional is a version -number, and is the (relative) file name of the QML file defining the type. +number, and is the (relative) file name of the QML file defining the type. Installed files do not need to import the module of which they are a part, as they can refer to the other QML files in the module as relative (local) files, but @@ -264,10 +264,10 @@ provide those identifiers. \bold {plugin []} lines are used to add \l{QDeclarativeExtensionPlugin}{QML C++ plugins} to the module. is the name of the library. It is usually not the same as the file name of the plugin binary, which is platform dependent; e.g. the library \c MyAppTypes would produce -\c libMyAppTypes.so on Linux and \c MyAppTypes.dll on Windows. +\c libMyAppTypes.so on Linux and \c MyAppTypes.dll on Windows. is an optional argument specifying either an absolute path to the directory containing the -plugin file, or a relative path from the directory containing the \c qmldir file to the directory +plugin file, or a relative path from the directory containing the \c qmldir file to the directory containing the plugin file. By default the engine searches for the plugin library in the directory that contains the \c qmldir file. The plugin search path can be queried with QDeclarativeEngine::pluginPathList() and modified using QDeclarativeEngine::addPluginPath(). When running the \l {QML Viewer}, use the \c -P option to add paths to the plugin search path. @@ -275,7 +275,7 @@ file. The plugin search path can be queried with QDeclarativeEngine::pluginPathL \target qmldirexample \section2 Example -If the components in the \c MyComponents directory from the +If the components in the \c MyComponents directory from the \l{Location Modules}{earlier example} were to be made available as a network resource, the directory would need to contain a \c qmldir file similar to this: @@ -284,7 +284,7 @@ ComponentA 1.0 ComponentA.qml ComponentB 1.0 ComponentB.qml \endcode -The \c MyComponents directory could then be imported as a module using: +The \c MyComponents directory could then be imported as a module using: \code import "http://the-server-name.com/MyComponents" @@ -298,15 +298,15 @@ a later version is used, as the \c qmldir file specifies that these elements are only available in the 1.0 version. -For examples of \c qmldir files for plugins, see the -\l {declarative/cppextensions/plugins}{Plugins} example and +For examples of \c qmldir files for plugins, see the +\l {declarative/cppextensions/plugins}{Plugins} example and \l {Tutorial: Writing QML extensions with C++}. \section1 Debugging The \c QML_IMPORT_TRACE environment variable can be useful for debugging -when there are problems with finding and loading modules. See +when there are problems with finding and loading modules. See \l{Debugging module imports} for more information. -- cgit v0.12 From 686dfda2146a84e6653faa56a1484e84571cc4fa Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Mon, 6 Dec 2010 17:39:21 +0100 Subject: Fixed link to qtestlib-tools by adding link to qt-webpages.qdoc. Link is now linking to the gitorious project site. Task-number: QTBUG-15714 Reviewed-by: David Boddie --- doc/src/development/qtestlib.qdoc | 29 ++++++++++++++--------------- doc/src/qt-webpages.qdoc | 10 ++++++++++ 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/doc/src/development/qtestlib.qdoc b/doc/src/development/qtestlib.qdoc index e53957f..08fdfc6 100644 --- a/doc/src/development/qtestlib.qdoc +++ b/doc/src/development/qtestlib.qdoc @@ -245,10 +245,10 @@ \endtable In short, walltime is always available but requires many repetitions to - get a useful result. - Tick counters are usually available and can provide - results with fewer repetitions, but can be susceptible to CPU frequency - scaling issues. + get a useful result. + Tick counters are usually available and can provide + results with fewer repetitions, but can be susceptible to CPU frequency + scaling issues. Valgrind provides exact results, but does not take I/O waits into account, and is only available on a limited number of platforms. @@ -264,7 +264,7 @@ See the chapter 5 in the \l{QTestLib Tutorial} for more benchmarking examples. \section1 Using QTestLib remotely on Windows CE - \c cetest is a convenience application which helps the user to launch an + \c cetest is a convenience application which helps the user to launch an application remotely on a Windows CE device or emulator. It needs to be executed after the unit test has been successfully compiled. @@ -717,15 +717,15 @@ \section1 Writing a Benchmark To create a benchmark we extend a test function with a QBENCHMARK macro. - A benchmark test function will then typically consist of setup code and + A benchmark test function will then typically consist of setup code and a QBENCHMARK macro that contains the code to be measured. This test function benchmarks QString::localeAwareCompare(). \snippet examples/qtestlib/tutorial5/benchmarking.cpp 0 - Setup can be done at the beginning of the function, the clock is not + Setup can be done at the beginning of the function, the clock is not running at this point. The code inside the QBENCHMARK macro will be - measured, and possibly repeated several times in order to get an + measured, and possibly repeated several times in order to get an accurate measurement. Several \l {testlib-benchmarking-measurement}{back-ends} are available @@ -733,7 +733,7 @@ \section1 Data Functions - Data functions are useful for creating benchmarks that compare + Data functions are useful for creating benchmarks that compare multiple data inputs, for example locale aware compare against standard compare. @@ -743,20 +743,19 @@ \snippet examples/qtestlib/tutorial5/benchmarking.cpp 2 - The "if(useLocaleCompare)" switch is placed outside the QBENCHMARK + The "if(useLocaleCompare)" switch is placed outside the QBENCHMARK macro to avoid measuring its overhead. Each benchmark test function - can have one active QBENCHMARK macro. + can have one active QBENCHMARK macro. \section1 External Tools Tools for handling and visualizing test data are available as part of - the qtestlib-tools project on the - \l{http://labs.qt.nokia.com/}{http://labs.qt.nokia.com/}Qt Labs Web site. + the \l {qtestlib-tools} project in the \l{Qt Labs} web site. These include a tool for comparing performance data obtained from test runs and a utility to generate Web-based graphs of performance data. - See the \l{qtestlib-tools Announcement} for more information on these - tools and a simple graphing example. + See the \l{qtestlib-tools Announcement}{qtestlib-tools announcement} + for more information on these tools and a simple graphing example. */ diff --git a/doc/src/qt-webpages.qdoc b/doc/src/qt-webpages.qdoc index 05817df..b7b9fba 100644 --- a/doc/src/qt-webpages.qdoc +++ b/doc/src/qt-webpages.qdoc @@ -239,3 +239,13 @@ \externalpage http://get.qt.nokia.com/nokiasmartinstaller/ \title Smart Installer */ + +/*! + \externalpage http://qt.gitorious.org/qt-labs/qtestlib-tools + \title qtestlib-tools +*/ + +/*! + \externalpage http://labs.qt.nokia.com + \title Qt Labs +*/ -- cgit v0.12 From 1eb7dca7fe6a81bada556c1310905be08e1b1d10 Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Mon, 6 Dec 2010 17:43:31 +0100 Subject: Added QML coding convention for "private" properties. Private properties start with two underscores. __property Reviewed-by: David Boddie --- doc/src/declarative/codingconventions.qdoc | 18 ++++++-- .../declarative/codingconventions/private.qml | 49 ++++++++++++++++++++++ 2 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 doc/src/snippets/declarative/codingconventions/private.qml diff --git a/doc/src/declarative/codingconventions.qdoc b/doc/src/declarative/codingconventions.qdoc index ba789e0..3f92d46 100644 --- a/doc/src/declarative/codingconventions.qdoc +++ b/doc/src/declarative/codingconventions.qdoc @@ -35,7 +35,7 @@ This page assumes that you are already familiar with the QML language. If you need an introduction to the language, please read \l {Introduction to the QML language}{the QML introduction} first. -\section1 QML objects +\section1 QML Objects Through our documentation and examples, QML objects are always structured in the following order: @@ -58,7 +58,7 @@ For example, a hypothetical \e photo QML object would look like this: \snippet doc/src/snippets/declarative/codingconventions/photo.qml 0 -\section1 Grouped properties +\section1 Grouped Properties If using multiple properties from a group of properties, we use the \e {group notation} rather than the \e {dot notation} to improve readability. @@ -72,6 +72,18 @@ can be written like this: \snippet doc/src/snippets/declarative/codingconventions/dotproperties.qml 1 +\section1 Private Properties + +QML and JavaScript do not enforce private properties like C++. There is a need +to hide these private properties, for example, when the properties are part of +the implementation. As a convention, private properties begin with two +\e underscore characters. For example, \c __area, is a property that is +accessible but is not meant for public use. Note that QML and JavaScript will +grant the user access to these properties. + +\snippet doc/src/snippets/declarative/codingconventions/private.qml 0 + + \section1 Lists If a list contains only one element, we generally omit the square brackets. @@ -87,7 +99,7 @@ we will write this: \snippet doc/src/snippets/declarative/codingconventions/lists.qml 1 -\section1 JavaScript code +\section1 JavaScript Code If the script is a single expression, we recommend writing it inline: diff --git a/doc/src/snippets/declarative/codingconventions/private.qml b/doc/src/snippets/declarative/codingconventions/private.qml new file mode 100644 index 0000000..1d3dda8 --- /dev/null +++ b/doc/src/snippets/declarative/codingconventions/private.qml @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +//! [0] +Item { + id: component + width: 40; height: 50 + property real __area: width * height * 0.5 //not meant for outside use +} +//! [0] -- cgit v0.12 From 608b66b5af75ae6982be428439eea735c00cc455 Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Mon, 6 Dec 2010 17:46:28 +0100 Subject: Fixed the QML Focus document. Fixed snippets, images, and formatting. Reviewed-by: David Boddie --- doc/src/declarative/focus.qdoc | 339 ++++++++------------- doc/src/images/declarative-qmlfocus1.png | Bin 0 -> 1890 bytes doc/src/images/declarative-qmlfocus2.png | Bin 0 -> 2756 bytes doc/src/images/declarative-qmlfocus3.png | Bin 0 -> 2743 bytes doc/src/images/declarative-qmlfocus4.png | Bin 0 -> 4137 bytes doc/src/images/declarative-qmlfocus5.png | Bin 0 -> 1376 bytes .../snippets/declarative/focus/advancedFocus.qml | 67 ++++ doc/src/snippets/declarative/focus/basicwidget.qml | 59 ++++ .../snippets/declarative/focus/clickablewidget.qml | 61 ++++ doc/src/snippets/declarative/focus/focusColumn.qml | 25 ++ .../declarative/focus/focusscopewidget.qml | 61 ++++ .../declarative/focus/myclickablewidget.qml | 69 +++++ .../declarative/focus/myfocusscopewidget.qml | 66 ++++ doc/src/snippets/declarative/focus/mywidget.qml | 58 ++++ doc/src/snippets/declarative/focus/qmldir | 4 + doc/src/snippets/declarative/focus/rectangle.qml | 62 ++++ doc/src/snippets/declarative/focus/widget.qml | 61 ++++ 17 files changed, 713 insertions(+), 219 deletions(-) create mode 100644 doc/src/images/declarative-qmlfocus1.png create mode 100644 doc/src/images/declarative-qmlfocus2.png create mode 100644 doc/src/images/declarative-qmlfocus3.png create mode 100644 doc/src/images/declarative-qmlfocus4.png create mode 100644 doc/src/images/declarative-qmlfocus5.png create mode 100644 doc/src/snippets/declarative/focus/advancedFocus.qml create mode 100644 doc/src/snippets/declarative/focus/basicwidget.qml create mode 100644 doc/src/snippets/declarative/focus/clickablewidget.qml create mode 100644 doc/src/snippets/declarative/focus/focusColumn.qml create mode 100644 doc/src/snippets/declarative/focus/focusscopewidget.qml create mode 100644 doc/src/snippets/declarative/focus/myclickablewidget.qml create mode 100644 doc/src/snippets/declarative/focus/myfocusscopewidget.qml create mode 100644 doc/src/snippets/declarative/focus/mywidget.qml create mode 100644 doc/src/snippets/declarative/focus/qmldir create mode 100644 doc/src/snippets/declarative/focus/rectangle.qml create mode 100644 doc/src/snippets/declarative/focus/widget.qml diff --git a/doc/src/declarative/focus.qdoc b/doc/src/declarative/focus.qdoc index 2e74fe0..ae72c3c 100644 --- a/doc/src/declarative/focus.qdoc +++ b/doc/src/declarative/focus.qdoc @@ -31,7 +31,7 @@ \title Keyboard Focus in QML When a key is pressed or released, a key event is generated and delivered to the -focused QML \l Item. To facilitate the construction of reusable components +focused QML \l Item. To facilitate the construction of reusable components and to address some of the cases unique to fluid user interfaces, the QML items add a \e scope based extension to Qt's traditional keyboard focus model. @@ -42,27 +42,21 @@ and to address some of the cases unique to fluid user interfaces, the QML items When the user presses or releases a key, the following occurs: \list 1 \o Qt receives the key action and generates a key event. -\o If the Qt widget containing the \l QDeclarativeView has focus, the key event is delivered to it. Otherwise, regular Qt key handling continues. -\o The key event is delivered by the scene to the QML \l Item with \e {active focus}. If no \l Item has \e {active focus}, the key event is \l {QEvent::ignore()}{ignored} and regular Qt key handling continues. -\o If the QML \l Item with \e {active focus} accepts the key event, propagation stops. Otherwise the event is "bubbled up", by recursively passing it to each \l Item's parent until either the event is accepted, or the root \l Item is reached. - -If the \c {Rectangle} element in the following example has active focus and the \e A key is pressed, -it will bubble up to its parent. However, pressing the \e B key will bubble up to the root -item and thus subsequently be \l {QEvent::ignore()}{ignored}. - -\code -Item { - Item { - Keys.onPressed: { - if (event.key == Qt.Key_A) { - console.log('Key A was pressed'); - event.accepted = true; - } - } - Rectangle {} - } -} -\endcode +\o If the Qt widget containing the \l QDeclarativeView has focus, the key event +is delivered to it. Otherwise, regular Qt key handling continues. +\o The key event is delivered by the scene to the QML \l Item with +\e {active focus}. If no Item has active focus, the key event is +\l {QEvent::ignore()}{ignored} and regular Qt key handling continues. +\o If the QML Item with active focus accepts the key event, propagation +stops. Otherwise the event is "bubbled up", by recursively passing it to each +Item's parent until either the event is accepted, or the root Item is reached. + +If the \c {Rectangle} element in the following example has active focus and the \c A key is pressed, +it will bubble up to its parent. However, pressing the \c B key will bubble up to the root +item and thus subsequently be ignored. + +\snippet doc/src/snippets/declarative/focus/rectangle.qml simple key event +\snippet doc/src/snippets/declarative/focus/rectangle.qml simple key event end \o If the root \l Item is reached, the key event is \l {QEvent::ignore()}{ignored} and regular Qt key handling continues. @@ -72,232 +66,139 @@ See also the \l {Keys}{Keys attached property} and \l {KeyNavigation}{KeyNavigat \section1 Querying the Active Focus Item -Whether or not an \l Item has \e {active focus} can be queried through the -property \c {Item::activeFocus}. For example, here we have a \l Text -element whose text is determined by whether or not it has \e {active focus}. +Whether or not an \l Item has active focus can be queried through the +property \c {Item::activeFocus} property. For example, here we have a \l Text +element whose text is determined by whether or not it has active focus. -\code -Text { - text: activeFocus ? "I have active focus!" : "I do not have active focus" -} -\endcode +\snippet doc/src/snippets/declarative/focus/rectangle.qml active focus \section1 Acquiring Focus and Focus Scopes -An \l Item requests focus by setting the \c {Item::focus} property to true. - -For very simple cases simply setting the \c {Item::focus} property is sometimes -sufficient. If we run the following example with the \l {QML Viewer}, we see that -the \c {keyHandler} element has \e {active focus} and pressing the 'A', 'B' -or 'C' keys modifies the text appropriately. - -\table -\row -\o \code - Rectangle { - color: "lightsteelblue"; width: 240; height: 25 - Text { id: myText } - Item { - id: keyHandler - focus: true - Keys.onPressed: { - if (event.key == Qt.Key_A) - myText.text = 'Key A was pressed' - else if (event.key == Qt.Key_B) - myText.text = 'Key B was pressed' - else if (event.key == Qt.Key_C) - myText.text = 'Key C was pressed' - } - } - } -\endcode -\o \image declarative-qmlfocus1.png -\endtable - -However, were the above example to be used as a self-contained component, this -simple use of the \c {Item::focus} property is no longer sufficient. The left -hand side of the following table shows what we would like to be able to write. -Here we create two instances of our previously defined component, and set the -second one to have focus. The intention is that when the \e A, \e B, or \e C -keys are pressed, the second of the two components receives the event and +An \l Item requests focus by setting the \c focus property to \c true. + +For very simple cases simply setting the \c focus property is sometimes +sufficient. If we run the following example with the \l {QML Viewer}, we see that +the \c {keyHandler} element has active focus and pressing the \c A, \c B, +or \c C keys modifies the text appropriately. + +\snippet doc/src/snippets/declarative/focus/basicwidget.qml focus true + +\image declarative-qmlfocus1.png + +However, were the above example to be used as a reusable or imported component, +this simple use of the \c focus property is no longer sufficient. + +To demonstrate, we create two instances of our previously defined component and +set the first one to have focus. The intention is that when the \c A, \c B, or +\c C keys are pressed, the first of the two components receives the event and responds accordingly. -\table -\row -\o \code -Rectangle { - color: "red"; width: 240; height: 55 - MyWidget {} - MyWidget { y: 30; focus: true } -} -\endcode -\o \code -Rectangle { - color: "red"; width: 240; height: 55 - Rectangle { - color: "lightsteelblue"; width: 240; height: 25 - Text { id: myText } - Item { - id: keyHandler - focus: true - Keys.onPressed: { - if (event.key == Qt.Key_A) - myText.text = 'Key A was pressed' - else if (event.key == Qt.Key_B) - myText.text = 'Key B was pressed' - else if (event.key == Qt.Key_C) - myText.text = 'Key C was pressed' - } - } - } - Rectangle { - y: 30; focus: true - color: "lightsteelblue"; width: 240; height: 25 - Text { id: myText } - Item { - id: keyHandler - focus: true - Keys.onPressed: { - if (event.key == Qt.Key_A) - myText.text = 'Key A was pressed' - else if (event.key == Qt.Key_B) - myText.text = 'Key B was pressed' - else if (event.key == Qt.Key_C) - myText.text = 'Key C was pressed' - } - } - } -} -\endcode -\endtable - -The right hand side of the example shows the expanded code - the equivalent QML -without the use of the component \c {MyWidget}. From this, the problem is -evident - there are no less than three elements that have the \c {Item::focus} -property set to true. Ultimately only one element can have keyboard focus, and the -system has to decide which on. In this case the first appearance of the -\c {Item::focus} property being set to true on line 4 is selected, and the value -of \c {Item::focus} in the other two instances is reverted back to false. This -is exactly the opposite of what was wanted! - -This problem is fundamentally one of visibility. The \c {MyWidget} -components each set their \c {keyHandler} Items as focused as that is all they can -do - they don't know how they are going to be used, but they do know that when -they're in use their \c {keyHandler} element is what needs focus. Likewise -the code that uses the two \c {MyWidgets} sets the second \c {MyWidget} as -focused. While it doesn't know exactly how the \c {MyWidget} is -implemented, it knows that it wants the second one to be focused. This allows us -to achieve encapsulation, allowing each widget to focus on it's appropriate behaviour -itself. - -To solve this problem - allowing components to care about what they know about -and ignore everything else - the QML items introduce a concept known as a -\e {focus scope}. For existing Qt users, a \e {focus scope} is like an -automatic focus proxy. A \e {focus scope} is created using the \l FocusScope -element. - -In the next example, a \l FocusScope is added to the component, and the visual -result shown. - -\table -\row -\o \code -FocusScope { - width: 240; height: 25 - Rectangle { - color: "lightsteelblue"; width: 240; height: 25 - Text { id: myText } - Item { - id: keyHandler - focus: true - Keys.onPressed: { - if (event.key == Qt.Key_A) - myText.text = 'Key A was pressed' - else if (event.key == Qt.Key_B) - myText.text = 'Key B was pressed' - else if (event.key == Qt.Key_C) - myText.text = 'Key C was pressed' - } - } - } -} -\endcode -\o \image declarative-qmlfocus2.png -\endtable +The code that imports and creates two MyWidget instances: +\snippet doc/src/snippets/declarative/focus/widget.qml window + +The MyWidget code: +\snippet doc/src/snippets/declarative/focus/mywidget.qml mywidget + +We would like to have the first MyWidget object to have the focus by setting its +\c focus property to \c true. However, by running the code, we can confirm that +the second widget receives the focus. + +\image declarative-qmlfocus2.png + +Looking at both \c MyWidget and \c window code, the problem is evident - there +are three elements that set the \c focus property set to \c true. The two +MyWidget sets the \c focus to \c true and the \c window component also sets the +focus. Ultimately, only one element can have keyboard focus, and the system has +to decide which element receives the focus. When the second MyWidget is created, +it receives the focus because it is the last element to set its \c focus +property to \c true. + +This problem is due to visibility. The \c MyWidget component would like to have +the focus, but it cannot control the focus when it is imported or reused. +Likewise, the \c window component does not have the ability to know if its +imported components are requesting the focus. + +To solve this problem, the QML introduces a concept known as a \e {focus scope}. +For existing Qt users, a focus scope is like an automatic focus proxy. +A focus scope is created by declaring the \l FocusScope element. + +In the next example, a \l FocusScope element is added to the component, and the +visual result shown. + +\snippet doc/src/snippets/declarative/focus/myfocusscopewidget.qml widget in focusscope + +\image declarative-qmlfocus3.png + Conceptually \e {focus scopes} are quite simple. \list -\o Within each \e {focus scope} one element may have \c {Item::focus} set to true. -If more than one \l Item has the \c {Item::focus} property set, the first is selected -and the others are unset, just like when there are no \e {focus scopes}. -\o When a \e {focus scope} receives \e {active focus}, the contained element with -\c {Item::focus} set (if any) also gets \e {active focus}. If this element is -also a \l FocusScope, the proxying behaviour continues. Both the -\e {focus scope} and the sub-focused item will have \c {Item::activeFocus} set. +\o Within each focus scope one element may have \c {Item::focus} set to +\c true. If more than one \l Item has the \c focus property set, the +last element to set the \c focus will have the focus and the others are unset, +similar to when there are no focus scopes. +\o When a focus scope receives active focus, the contained element with +\c focus set (if any) also gets the active focus. If this element is +also a \l FocusScope, the proxying behavior continues. Both the +focus scope and the sub-focused item will have \c activeFocus property set. \endlist -So far the example has the second component statically selected. It is trivial +Note that, since the FocusScope element is not a visual element, the properties +of its children need to be exposed to the parent item of the FocusScope. Layouts +and positioning elements will use these visual and styling properties to create +the layout. In our example, the \c Column element cannot display the two widgets +properly because the FocusScope lacks visual properties of its own. The MyWidget +component directly binds to the \c rectangle properties to allow the \c Column +element to create the layout containing the children of the FocusScope. + +So far, the example has the second component statically selected. It is trivial now to extend this component to make it clickable, and add it to the original -application. We still set a one of the widgets as focused by default, but from -then on clicking the either one gives it focus. - -\table -\row -\o \code -Rectangle { - color: "red"; width: 240; height: 55 - MyClickableWidget {} - MyClickableWidget { y: 30; focus: true } -} -\endcode -\o \code -FocusScope { - id: page; width: 240; height: 25 - MyWidget { focus: true } - MouseArea { anchors.fill: parent; onClicked: { page.focus = true } } -} -\endcode -\endtable +application. We still set one of the widgets as focused by default. +Now, clicking either MyClickableWidget gives it focus and the other widget +loses the focus. -\image declarative-qmlfocus3.png +The code that imports and creates two MyClickableWidget instances: +\snippet doc/src/snippets/declarative/focus/clickablewidget.qml clickable window + +The MyClickableWidget code: +\snippet doc/src/snippets/declarative/focus/myclickablewidget.qml clickable in focusscope -When a QML item explicitly relinquishes focus (by setting its -\c {Item::focus} property to false while it has \e {active focus}), the system -does not automatically select another element to receive focus. That is, it -is possible for there to be no currently \e {active focus}. +\image declarative-qmlfocus4.png -See the \l{declarative/keyinteraction/focus}{Keyboard Focus example} for a +When a QML \l Item explicitly relinquishes focus (by setting its +\c focus property to \c false while it has active focus), the +system does not automatically select another element to receive focus. That is, +it is possible for there to be no currently active focus. + +See the \l{declarative/keyinteraction/focus}{Keyboard Focus example} for a demonstration of moving keyboard focus between multiple areas using FocusScope elements. \section1 Advanced uses of Focus Scopes -Focus scopes allow focus to allocation to be easily partitioned. Several +Focus scopes allow focus to allocation to be easily partitioned. Several QML items use it to this effect. -\l ListView, for example, is itself a focus scope. Generally this isn't +\l ListView, for example, is itself a focus scope. Generally this isn't noticeable as \l ListView doesn't usually have manually added visual children. By being a focus scope, \l ListView can focus the current list item without -worrying about how that will effect the rest of the application. This allows -the current item delegate to react to key presses. +worrying about how that will effect the rest of the application. This allows the +current item delegate to react to key presses. -This contrived example shows how this works. Pressing the \c Return key will +This contrived example shows how this works. Pressing the \c Return key will print the name of the current list item. -\table -\row -\o \snippet doc/src/snippets/declarative/focusscopes.qml 0 -\o \image declarative-qmlfocus4.png -\endtable +\snippet doc/src/snippets/declarative/focus/advancedFocus.qml FocusScope delegate + +\image declarative-qmlfocus5.png -While the example is simple, there's a lot going on behind the scenes. Whenever +While the example is simple, there are a lot going on behind the scenes. Whenever the current item changes, the \l ListView sets the delegate's \c {Item::focus} -property. As the \l ListView is a \e {focus scope}, this doesn't effect the -rest of the application. However, if the \l ListView itself has -\e {active focus} this causes the delegate itself to receive \e {active focus}. -In this example, the root element of the delegate is also a \e {focus scope}, -which in turn gives \e {active focus} to the \c {Text} element that -actually performs the work of handling the \e {Return} key. +property. As the \l ListView is a focus scope, this doesn't affect the +rest of the application. However, if the \l ListView itself has +active focus this causes the delegate itself to receive active focus. +In this example, the root element of the delegate is also a focus scope, +which in turn gives active focus to the \c {Text} element that actually performs +the work of handling the \c {Return} key. All of the QML view classes, such as \l PathView and \l GridView, behave in a similar manner to allow key handling in their respective delegates. diff --git a/doc/src/images/declarative-qmlfocus1.png b/doc/src/images/declarative-qmlfocus1.png new file mode 100644 index 0000000..317b34b Binary files /dev/null and b/doc/src/images/declarative-qmlfocus1.png differ diff --git a/doc/src/images/declarative-qmlfocus2.png b/doc/src/images/declarative-qmlfocus2.png new file mode 100644 index 0000000..e3f9643 Binary files /dev/null and b/doc/src/images/declarative-qmlfocus2.png differ diff --git a/doc/src/images/declarative-qmlfocus3.png b/doc/src/images/declarative-qmlfocus3.png new file mode 100644 index 0000000..a5897ce Binary files /dev/null and b/doc/src/images/declarative-qmlfocus3.png differ diff --git a/doc/src/images/declarative-qmlfocus4.png b/doc/src/images/declarative-qmlfocus4.png new file mode 100644 index 0000000..f2e64cd Binary files /dev/null and b/doc/src/images/declarative-qmlfocus4.png differ diff --git a/doc/src/images/declarative-qmlfocus5.png b/doc/src/images/declarative-qmlfocus5.png new file mode 100644 index 0000000..ec7307b Binary files /dev/null and b/doc/src/images/declarative-qmlfocus5.png differ diff --git a/doc/src/snippets/declarative/focus/advancedFocus.qml b/doc/src/snippets/declarative/focus/advancedFocus.qml new file mode 100644 index 0000000..274f54f --- /dev/null +++ b/doc/src/snippets/declarative/focus/advancedFocus.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the FOO module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ +import QtQuick 1.0 + +//! [FocusScope delegate] +Rectangle { + color: "lightsteelblue"; width: 100; height: 50 + + ListView { + anchors.fill: parent + focus: true + + model: ListModel { + ListElement { name: "Bob" } + ListElement { name: "John" } + ListElement { name: "Michael" } + } + + delegate: FocusScope { + width: childrenRect.width; height: childrenRect.height + x:childrenRect.x; y: childrenRect.y + TextInput { + focus: true + text: name + Keys.onReturnPressed: console.log(name) + } + } + } +} +//! [FocusScope delegate] diff --git a/doc/src/snippets/declarative/focus/basicwidget.qml b/doc/src/snippets/declarative/focus/basicwidget.qml new file mode 100644 index 0000000..71e75ff --- /dev/null +++ b/doc/src/snippets/declarative/focus/basicwidget.qml @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the FOO module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ +import QtQuick 1.0 + +//! [focus true] +Rectangle { + color: "lightsteelblue"; width: 240; height: 25 + Text { id: myText } + Item { + id: keyHandler + focus: true + Keys.onPressed: { + if (event.key == Qt.Key_A) + myText.text = 'Key A was pressed' + else if (event.key == Qt.Key_B) + myText.text = 'Key B was pressed' + else if (event.key == Qt.Key_C) + myText.text = 'Key C was pressed' + } + } +} +//! [focus true] diff --git a/doc/src/snippets/declarative/focus/clickablewidget.qml b/doc/src/snippets/declarative/focus/clickablewidget.qml new file mode 100644 index 0000000..34b0d87 --- /dev/null +++ b/doc/src/snippets/declarative/focus/clickablewidget.qml @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the FOO module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ +import QtQuick 1.0 + +//! [clickable window] +Rectangle { + id: window + + color: "white"; width: 240; height: 150 + + Column { + anchors.centerIn: parent; spacing: 15 + + MyClickableWidget { + focus: true //set this MyWidget to receive the focus + color: "lightblue" + } + MyClickableWidget { + color: "palegreen" + } + } + +} +//! [clickable window] diff --git a/doc/src/snippets/declarative/focus/focusColumn.qml b/doc/src/snippets/declarative/focus/focusColumn.qml new file mode 100644 index 0000000..eb59309 --- /dev/null +++ b/doc/src/snippets/declarative/focus/focusColumn.qml @@ -0,0 +1,25 @@ +import QtQuick 1.0 + +Rectangle { + width: 200; height: 200 + + // Column { + FocusScope { + x: rect1.x; y:rect1.y; width: rect1.width; height: rect1.height + Rectangle {id: rect1; width: 50; height: 50; focus:true + color: focus ? "red":"blue" + } + Rectangle {id: rect2; width: 50; height: 50; focus:true + color: focus ? "red":"blue" + y: 75 + } +// } +/* + FocusScope { + x: rect2.x; y:rect2.y; width: rect2.width; height: rect2.height + Rectangle {id: rect2; width: 50; height: 50; color: "red"} + } +*/ + } + +} diff --git a/doc/src/snippets/declarative/focus/focusscopewidget.qml b/doc/src/snippets/declarative/focus/focusscopewidget.qml new file mode 100644 index 0000000..48e5750 --- /dev/null +++ b/doc/src/snippets/declarative/focus/focusscopewidget.qml @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the FOO module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ +import QtQuick 1.0 + +//! [focusscope window] +Rectangle { + id: window + + color: "white"; width: 240; height: 150 + + Column { + anchors.centerIn: parent; spacing: 15 + + MyFocusScopeWidget { + focus: true //set this MyWidget to receive the focus + color: "lightblue" + } + MyFocusScopeWidget { + color: "palegreen" + } + } + +} +//! [focusscope window] diff --git a/doc/src/snippets/declarative/focus/myclickablewidget.qml b/doc/src/snippets/declarative/focus/myclickablewidget.qml new file mode 100644 index 0000000..3294662 --- /dev/null +++ b/doc/src/snippets/declarative/focus/myclickablewidget.qml @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the FOO module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ +import QtQuick 1.0 + +//! [clickable in focusscope] +FocusScope { + + id: scope + + //FocusScope needs to bind to visual properties of the children + property alias color: rectangle.color + x: rectangle.x; y: rectangle.y + width: rectangle.width; height: rectangle.height + + Rectangle { + id: rectangle + anchors.centerIn: parent + color: "lightsteelblue"; width: 175; height: 25; radius: 10; smooth: true + Text { id: label; anchors.centerIn: parent } + focus: true + Keys.onPressed: { + if (event.key == Qt.Key_A) + label.text = 'Key A was pressed' + else if (event.key == Qt.Key_B) + label.text = 'Key B was pressed' + else if (event.key == Qt.Key_C) + label.text = 'Key C was pressed' + } + } + MouseArea { anchors.fill: parent; onClicked: { scope.focus = true } } +} +//! [clickable in focusscope] diff --git a/doc/src/snippets/declarative/focus/myfocusscopewidget.qml b/doc/src/snippets/declarative/focus/myfocusscopewidget.qml new file mode 100644 index 0000000..231ae3a --- /dev/null +++ b/doc/src/snippets/declarative/focus/myfocusscopewidget.qml @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the FOO module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ +import QtQuick 1.0 + +//! [widget in focusscope] +FocusScope { + + //FocusScope needs to bind to visual properties of the children + property alias color: rectangle.color + x: rectangle.x; y: rectangle.y + width: rectangle.width; height: rectangle.height + + Rectangle { + id: rectangle + anchors.centerIn: parent + color: "lightsteelblue"; width: 175; height: 25; radius: 10; smooth: true + Text { id: label; anchors.centerIn: parent } + focus: true + Keys.onPressed: { + if (event.key == Qt.Key_A) + label.text = 'Key A was pressed' + else if (event.key == Qt.Key_B) + label.text = 'Key B was pressed' + else if (event.key == Qt.Key_C) + label.text = 'Key C was pressed' + } + } +} +//! [widget in focusscope] diff --git a/doc/src/snippets/declarative/focus/mywidget.qml b/doc/src/snippets/declarative/focus/mywidget.qml new file mode 100644 index 0000000..bea723d --- /dev/null +++ b/doc/src/snippets/declarative/focus/mywidget.qml @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the FOO module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ +import QtQuick 1.0 + +//! [mywidget] +//MyWidget code +Rectangle { + id: widget + color: "lightsteelblue"; width: 175; height: 25; radius: 10; smooth: true + Text { id: label; anchors.centerIn: parent} + focus: true + Keys.onPressed: { + if (event.key == Qt.Key_A) + label.text = 'Key A was pressed' + else if (event.key == Qt.Key_B) + label.text = 'Key B was pressed' + else if (event.key == Qt.Key_C) + label.text = 'Key C was pressed' + } +} +//! [mywidget] diff --git a/doc/src/snippets/declarative/focus/qmldir b/doc/src/snippets/declarative/focus/qmldir new file mode 100644 index 0000000..d0683b2 --- /dev/null +++ b/doc/src/snippets/declarative/focus/qmldir @@ -0,0 +1,4 @@ +MyWidget 1.0 mywidget.qml +MyFocusScopeWidget 1.0 myfocusscopewidget.qml +MyClickableWidget 1.0 myclickablewidget.qml + diff --git a/doc/src/snippets/declarative/focus/rectangle.qml b/doc/src/snippets/declarative/focus/rectangle.qml new file mode 100644 index 0000000..01d1f0c --- /dev/null +++ b/doc/src/snippets/declarative/focus/rectangle.qml @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the FOO module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ +import QtQuick 1.0 + +//! [simple key event] +Rectangle { + width: 100; height: 100 + focus: true + Keys.onPressed: { + if (event.key == Qt.Key_A) { + console.log('Key A was pressed'); + event.accepted = true; + } + } +//! [simple key event] + +//! [active focus] + Text { + text: activeFocus ? "I have active focus!" : "I do not have active focus" + } +//! [active focus] + +//! [simple key event end] +} +//! [simple key event end] diff --git a/doc/src/snippets/declarative/focus/widget.qml b/doc/src/snippets/declarative/focus/widget.qml new file mode 100644 index 0000000..cef34c5 --- /dev/null +++ b/doc/src/snippets/declarative/focus/widget.qml @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the FOO module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ +import QtQuick 1.0 + +//! [window] + +//Window code that imports MyWidget +Rectangle { + id: window + color: "white"; width: 240; height: 150 + + Column { + anchors.centerIn: parent; spacing: 15 + + MyWidget { + focus: true //set this MyWidget to receive the focus + color: "lightblue" + } + MyWidget { + color: "palegreen" + } + } +} +//! [window] -- cgit v0.12 From 146ea109f9980beda939088687b37549f4d7a125 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 7 Dec 2010 17:04:29 +0100 Subject: Doc: Added a missing external page reference. --- doc/src/external-resources.qdoc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/src/external-resources.qdoc b/doc/src/external-resources.qdoc index 8eeaeb1..9bc3b1c 100644 --- a/doc/src/external-resources.qdoc +++ b/doc/src/external-resources.qdoc @@ -448,3 +448,8 @@ \externalpage https://developer.mozilla.org/en/JavaScript/About_JavaScript \title About JavaScript */ + +/*! + \externalpage http://www.libusb.org/ + \title libusb +*/ -- cgit v0.12 From 2c55c106839a4ba1a9d9c1d3f6f6cf7e835ccc1d Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 7 Dec 2010 17:29:04 +0100 Subject: Doc: Added documentation about the use of null custom title bar widgets. Task-number: QTBUG-15516 --- src/gui/widgets/qdockwidget.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/gui/widgets/qdockwidget.cpp b/src/gui/widgets/qdockwidget.cpp index df9b171..0a6269d 100644 --- a/src/gui/widgets/qdockwidget.cpp +++ b/src/gui/widgets/qdockwidget.cpp @@ -1531,8 +1531,11 @@ QAction * QDockWidget::toggleViewAction() const /*! \since 4.3 + Sets an arbitrary \a widget as the dock widget's title bar. If \a widget - is 0, the title bar widget is removed, but not deleted. + is 0, any custom title bar widget previously set on the dock widget is + removed, but not deleted, and the default title bar will be used + instead. If a title bar widget is set, QDockWidget will not use native window decorations when it is floated. @@ -1540,23 +1543,27 @@ QAction * QDockWidget::toggleViewAction() const Here are some tips for implementing custom title bars: \list - \i Mouse events that are not explicitly handled by the title bar widget + \o Mouse events that are not explicitly handled by the title bar widget must be ignored by calling QMouseEvent::ignore(). These events then propagate to the QDockWidget parent, which handles them in the usual manner, moving when the title bar is dragged, docking and undocking when it is double-clicked, etc. - \i When DockWidgetVerticalTitleBar is set on QDockWidget, the title + \o When DockWidgetVerticalTitleBar is set on QDockWidget, the title bar widget is repositioned accordingly. In resizeEvent(), the title bar should check what orientation it should assume: \snippet doc/src/snippets/code/src_gui_widgets_qdockwidget.cpp 0 - \i The title bar widget must have a valid QWidget::sizeHint() and + \o The title bar widget must have a valid QWidget::sizeHint() and QWidget::minimumSizeHint(). These functions should take into account the current orientation of the title bar. + + \o It is not possible to remove a title bar from a dock widget. However, + a similar effect can be achieved by setting a default constructed + QWidget as the title bar widget. \endlist - Using qobject_cast as shown above, the title bar widget has full access + Using qobject_cast() as shown above, the title bar widget has full access to its parent QDockWidget. Hence it can perform such operations as docking and hiding in response to user actions. -- cgit v0.12 From aa4b28cbe52eedfe898da04958339509b1d173bc Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 7 Dec 2010 17:36:01 +0100 Subject: Doc: Fixed a link to the correct searchPaths() function. --- src/corelib/io/qresource.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp index ce9c57e..b45710c 100644 --- a/src/corelib/io/qresource.cpp +++ b/src/corelib/io/qresource.cpp @@ -187,7 +187,7 @@ Q_GLOBAL_STATIC(QStringList, resourceSearchPaths) A QResource can either be loaded with an absolute path, either treated as a file system rooted with a \c{/} character, or in resource notation rooted with a \c{:} character. A relative resource can also be opened - which will be found through the searchPaths(). + which will be found in the list of paths returned by QDir::searchPaths(). A QResource that is representing a file will have data backing it, this data can possibly be compressed, in which case qUncompress() must be -- cgit v0.12 From 4483325532f57157f9ce6953670f9ab175dbaf2a Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 7 Dec 2010 17:36:40 +0100 Subject: Doc: Removed duplicate external page reference. --- doc/src/qt-webpages.qdoc | 5 ----- 1 file changed, 5 deletions(-) diff --git a/doc/src/qt-webpages.qdoc b/doc/src/qt-webpages.qdoc index b7b9fba..0a03157 100644 --- a/doc/src/qt-webpages.qdoc +++ b/doc/src/qt-webpages.qdoc @@ -201,11 +201,6 @@ */ /*! - \externalpage http://labs.qt.nokia.com/gitweb?p=qtestlib-tools;a=summary - \title qtestlib-tools -*/ - -/*! \externalpage http://qt.nokia.com/products/library/modular-class-library#info_scripting \title Qt Script for Applications (QSA) */ -- cgit v0.12 From 68a21753acd3e4159025bc73b0a31e652340e039 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 7 Dec 2010 17:37:12 +0100 Subject: Doc: Added a link to the QML Basic Types page. --- doc/src/declarative/declarativeui.qdoc | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc index 5d9eaaf..3d963e2 100644 --- a/doc/src/declarative/declarativeui.qdoc +++ b/doc/src/declarative/declarativeui.qdoc @@ -136,6 +136,7 @@ Module. \list \o \l{QML Elements} +\o \l{QML Basic Types} \o \l{QML Global Object} \o \l{QML Internationalization} \o \l{QML Security} -- cgit v0.12 From 30272ee4f7b37a75bd9b56aa5eb763073a6c965a Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 7 Dec 2010 17:47:32 +0100 Subject: Doc: Fixed incorrect case in a page file name. --- doc/src/getting-started/installation.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc index a68310c..aa10aaf 100644 --- a/doc/src/getting-started/installation.qdoc +++ b/doc/src/getting-started/installation.qdoc @@ -684,7 +684,7 @@ Binary Package} document. We hope you will enjoy using Qt. */ -/*! \page install-Symbian-linux.html +/*! \page install-symbian-linux.html \title Installing Qt for the Symbian platform using Linux (experimental) \ingroup installation \ingroup qtsymbian -- cgit v0.12 From 90928a986d8f37cf394d45cbcf12aaeeaa62d565 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 7 Dec 2010 17:48:11 +0100 Subject: Doc: Added missing What's New information for Qt 4.6 and 4.7. Task-number: QTBUG-15670 --- doc/src/network-programming/bearermanagement.qdoc | 8 +-- doc/src/qt4-intro.qdoc | 62 ++++++++++++++++++++--- 2 files changed, 58 insertions(+), 12 deletions(-) diff --git a/doc/src/network-programming/bearermanagement.qdoc b/doc/src/network-programming/bearermanagement.qdoc index 98de5bf..12da55b 100644 --- a/doc/src/network-programming/bearermanagement.qdoc +++ b/doc/src/network-programming/bearermanagement.qdoc @@ -26,11 +26,11 @@ ****************************************************************************/ /*! - \page bearer-management.html +\page bearer-management.html - \title Bearer Management - \ingroup qt-network - \brief An API to control the system's connectivity state. +\title Bearer Management +\ingroup qt-network +\brief An API to control the system's connectivity state. Bearer Management controls the connectivity state of the system so that the user can start or stop interfaces or roam transparently between diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc index 62decbb..7325e27 100644 --- a/doc/src/qt4-intro.qdoc +++ b/doc/src/qt4-intro.qdoc @@ -60,7 +60,53 @@ \section1 Recent Additions to Qt 4 - The following features have been added to Qt since the first release of Qt 4: + The following features have been added to Qt since the first release of Qt 4. + + In Qt 4.7: + \list + \o Declarative UI Development with \l{Qt Quick}, technologies for creating + fluid, dynamic user interfaces. + \o Support for \l{Bearer Management}{network bearer management}, enabling + features such as control over network interfaces and support for roaming + between networks. + \o Feature and performance improvements in QtWebKit, including a new tiled + backing store, control over scroll bars used in frames and framesets, + accelerated compositing and \l{The QtWebKit Bridge}{support for hybrid + development}. + \o General performance improvements, including the use of "alien widgets" + on Mac OS X, the QStaticText class for optimized text rendering, a new + \l{QPainter::drawPixmapFragments()}{API for rendering pixmap fragments} + and an updated version of the JavaScriptCore engine for the QtScript + module with improved performance. + \endlist + + In Qt 4.6: + \list + \o Support for \l{The Symbian platform - Introduction to Qt}{the Symbian Platform} + as a mainstream Qt platform, with integration into the S60 framework. + \o The \l{The Animation Framework}{animation framework} allows animations to be + created using both widgets and graphics items. + \o The \l{The State Machine Framework}{state machine framework} provides a robust + state chart implementation based on Harel statecharts and SCXML. + \o Support for \l{QTouchEvent}{touch input} and \l{Gestures Programming}{gestures} + enable developers to create intuitive user interfaces for touch-based devices. + \o A \l{QWebElement}{DOM access API} for QtWebKit provides a cleaner and safer way + to access elements and structures of Web pages without the use of JavaScript. + \o A collection of performance improvements, covering QGraphicsView, QPixmapCache, + QNetworkAccessManager, QContiguousCache class, hardware-accelerated rendering + support through \l{OpenVG Rendering in Qt}{OpenVG}, and the removal of Win9x + support. + \o A collection of \l{QGraphicsEffect}{graphics effects} make it easy to apply + and simple effects to graphics items and combine them to produce more complex + effects. + \o Support for XML schema validation in the QtXmlPatterns module covering + large parts of version 1.0 of the specification. + \o Qt3D enablers, including math primitives for \l{QMatrix4x4}{matrix multiplication}, + \l{QVector3D}{vectors}, \l{QQuaternion}{quaternions} (client-side), and an API + for \l{QGLShader}{vertex and fragment shaders}, GLSL/ES. + \o \l{QtMultimedia Module}{Multimedia services} providing low-level access to the + system's audio system. + \endlist In Qt 4.5: \list @@ -209,7 +255,7 @@ \row \o \l{Qt3Support} \o Qt 3 support classes \row \o \l{QAxContainer} \o ActiveQt client extension \row \o \l{QAxServer} \o ActiveQt server extension - \row \o \l{QtHelp} \o Classes for integrating online documentation + \row \o \l{QtHelp} \o Classes for integrating online documentation \row \o \l{QtDesigner} \o Classes for extending and embedding Qt Designer \row \o \l{QtUiTools} \o Classes for dynamic GUI generation \row \o \l{QtTest} \o Tool classes for unit testing @@ -451,7 +497,7 @@ A list of other Qt 4 features can be found on the \bold{\l{What's New in Qt 4}} page. - \section1 Declarative UI development with Qt Quick + \section1 Declarative UI Development with Qt Quick \image quick_screens.png @@ -508,7 +554,7 @@ For hybrid QtWebKit and C++ projects, Qt 4.7 has added support for transporting \l{QPixmap}s between Qt C++ and WebKit. We have also - improved the documentation hybrid development. Read more here: + improved the documentation for hybrid development. Read more here: \l{The QtWebKit Bridge}. \section1 QtWebKit Performance Benchmarks @@ -680,7 +726,7 @@ See the QTouchEvent class documentation for more information on touch input and QGestureEvent for gestures. - \section1 DOM access API + \section1 DOM Access API Web pages and XML both have very complex document object models. The W3C selector API provides a very simple way to access and @@ -699,7 +745,7 @@ \list \o Rewritten the QGraphicsView rendering algorithm. - \o Made QPixmapCache support efficient Key datastructure. + \o Made QPixmapCache support efficient Key data structure. \o Reduced overhead in QNetworkAccessManager. \o Added the QContiguousCache class, which provides efficient caching of contiguous data. @@ -740,7 +786,7 @@ See the \l{XML Processing} and QXmlSchema class documentation for more information. - \section1 Qt3D enablers + \section1 Qt3D Enablers As more of Qt, and more of the applications built on Qt go 3D, API's should be provided to simplify this. Mainly, the new API @@ -750,7 +796,7 @@ The main features of the Qt3D enablers are currently: Math primitives for matrix multiplication, vectors, quaternions - (client-side), and API for vertex and fragment shaders, GLSL/ES. + (client-side), and an API for vertex and fragment shaders, GLSL/ES. Future research will, among other things include stencils, scissors, vertex buffers and arrays, texture manipulation, and geometry shaders. -- cgit v0.12 From c799f87057d1a61112c0165b15ec37bbef39fffe Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Wed, 8 Dec 2010 15:48:39 +0100 Subject: Doc: Added link to QML Basic Types in main Qt Quick page. Reviewed-by: David Boddie --- doc/src/declarative/declarativeui.qdoc | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc index 5d9eaaf..f8f47c9 100644 --- a/doc/src/declarative/declarativeui.qdoc +++ b/doc/src/declarative/declarativeui.qdoc @@ -108,6 +108,7 @@ Module. \section1 Handling Data \list +\o \l{QML Basic Types}{QML Basic Data Types} \o \l{Using QML Positioner and Repeater Items} \o \l{QML Data Models} \o \l{Presenting Data with QML} -- cgit v0.12 From 1e84041247505502fa3b3f4865126719321f70d3 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 9 Dec 2010 10:09:30 +0100 Subject: doc: Removed some empty \row commands from a table. --- doc/src/platforms/platform-notes.qdoc | 3 --- 1 file changed, 3 deletions(-) diff --git a/doc/src/platforms/platform-notes.qdoc b/doc/src/platforms/platform-notes.qdoc index 9c5f3c8..a7c05e2 100644 --- a/doc/src/platforms/platform-notes.qdoc +++ b/doc/src/platforms/platform-notes.qdoc @@ -81,14 +81,11 @@ \header \o \o Concurrent \o XmlPatterns \o WebKit(*) \o CLucene \o Phonon \row \o g++ 3.3 \o \o \bold{X} \o \o \bold{X} \o \bold{X} \row \o g++ 3.4 and up \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} - \row \row \o SunCC 5.5 \o \o \o \o \bold{X} \o \bold{X} - \row \row \o aCC series 3 \o \o \o \o \bold{X} \o \bold{X} \row \o aCC series 6 \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \row \o xlC 6 \o \o \o \o \bold{X} \o \bold{X} \row \o Intel CC 10 \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} - \row \row \o MSVC 2003 \o \bold{X} \o \bold{X} \o \o \bold{X} \o \bold{X} \row \o MSVC 2005 and up \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \o \bold{X} \endtable -- cgit v0.12 From bd4ac06eb3c8ac3a9044689481873ce91aeb3180 Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Thu, 9 Dec 2010 12:40:10 +0100 Subject: Doc: Fixed doc bug in Diagram Scene example Task-number: QTBUG-15647 --- doc/src/examples/diagramscene.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/examples/diagramscene.qdoc b/doc/src/examples/diagramscene.qdoc index 98bc983..d5cc4e3 100644 --- a/doc/src/examples/diagramscene.qdoc +++ b/doc/src/examples/diagramscene.qdoc @@ -195,7 +195,7 @@ This function returns a QWidget containing a QToolButton with an image of one of the \c DiagramItems, i.e., flowchart shapes. The image is created by the \c DiagramItem through the \c image() - function. The QButtonGroup class lets us attach a QVariant with + function. The QButtonGroup class lets us attach an id (int) with each button; we store the diagram's type, i.e., the DiagramItem::DiagramType enum. We use the stored diagram type when we create new diagram items for the scene. The widgets created -- cgit v0.12 From ad68c845e3e368dc4235e64b54e15a9ee886b078 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Thu, 9 Dec 2010 14:25:16 +0200 Subject: QLabel wraps text at fixed lengths There are multiple problems with text wrapping and dialogs. First, teh CBA height was assumed to be zero, or fetch from previous layout, which caused the dialog to be half under the CBA. Now, CBA height is always asked from AVKON metrics, since asking it from actual component might fail (or produce incorrect results) due to that the component is not created yet (or might still have previous layout active). Additionally, qinputDialog label is now having a size policy to restrict its growing out of dialog borders. Task-number: QT-4354 Reviewed-by: Janne Koskinen --- src/gui/dialogs/qdialog.cpp | 13 ++++++------- src/gui/dialogs/qinputdialog.cpp | 2 ++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp index fbdc522..16ea045 100644 --- a/src/gui/dialogs/qdialog.cpp +++ b/src/gui/dialogs/qdialog.cpp @@ -901,15 +901,13 @@ bool QDialog::symbianAdjustedPosition() QPoint p; const bool doS60Positioning = !(isFullScreen()||isMaximized()); if (doS60Positioning) { + QPoint oldPos = pos(); // naive way to deduce screen orientation if (S60->screenHeightInPixels > S60->screenWidthInPixels) { int cbaHeight; - const CEikButtonGroupContainer* bgContainer = S60->buttonGroupContainer(); - if (!bgContainer) { - cbaHeight = 0; - } else { - cbaHeight = qt_TSize2QSize(bgContainer->Size()).height(); - } + TRect rect; + AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EControlPane, rect); + cbaHeight = rect.Height(); p.setY(S60->screenHeightInPixels - height() - cbaHeight); p.setX(0); } else { @@ -939,7 +937,8 @@ bool QDialog::symbianAdjustedPosition() p.setX(qMax(0,S60->screenWidthInPixels - width())); } } - move(p); + if (oldPos != p || p.y() < 0) + move(p); } return doS60Positioning; #else diff --git a/src/gui/dialogs/qinputdialog.cpp b/src/gui/dialogs/qinputdialog.cpp index ce27bd3..a29376a 100644 --- a/src/gui/dialogs/qinputdialog.cpp +++ b/src/gui/dialogs/qinputdialog.cpp @@ -234,6 +234,8 @@ void QInputDialogPrivate::ensureLayout() //we want to let the input dialog grow to available size on Symbian. #ifndef Q_OS_SYMBIAN mainLayout->setSizeConstraint(QLayout::SetMinAndMaxSize); +#else + label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); #endif mainLayout->addWidget(label); mainLayout->addWidget(inputWidget); -- cgit v0.12 From 9d8dac4e4509795b6af8a5885f6e9f1a3ccbaa06 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Fri, 10 Dec 2010 11:12:23 +0200 Subject: QDateTimeEdit is not showing correctly when resizes in symbian The problem boils down to using large square area for QDateTime widget (which is more or less a date-aware combobox). Style tries to make the combobox button as wide as it is tall, and as button is as tall as the combobox frame, it steals the whole square widget for itself. To fix this, we now limit the combobox button height to be no more than fourth of the total width of the widget. Thus, in normal, non-resized case, button is, as tall as the frame, but as widget is made larger, button stops to grow after reaching quarter of width of the widget. Task-number: QT-4312 Reviewed-by: Janne Koskinen --- src/gui/styles/qs60style.cpp | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 2f09529..3c715b7 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -104,11 +104,11 @@ const int QS60StylePrivate::m_numberOfLayouts = const short QS60StylePrivate::data[][MAX_PIXELMETRICS] = { // *** generated pixel metrics *** -{5,0,-909,0,0,2,0,0,-1,7,12,22,15,15,7,198,-909,-909,-909,20,13,2,0,0,21,7,18,30,3,3,1,-909,-909,0,1,0,0,12,20,15,15,18,18,1,115,18,0,-909,-909,-909,-909,0,0,16,2,-909,0,0,-909,16,-909,-909,-909,-909,32,18,55,24,55,4,4,4,9,13,-909,5,51,11,5,0,3,3,6,8,3,3,-909,2,-909,-909,-909,-909,5,5,3,1,106}, -{5,0,-909,0,0,1,0,0,-1,8,14,22,15,15,7,164,-909,-909,-909,19,15,2,0,0,21,8,27,28,4,4,1,-909,-909,0,7,6,0,13,23,17,17,21,21,7,115,21,0,-909,-909,-909,-909,0,0,15,1,-909,0,0,-909,15,-909,-909,-909,-909,32,21,65,27,65,3,3,5,10,15,-909,5,58,13,5,0,4,4,7,9,4,4,-909,2,-909,-909,-909,-909,6,6,3,1,106}, -{7,0,-909,0,0,2,0,0,-1,25,69,46,37,37,9,258,-909,-909,-909,23,19,26,0,0,32,25,72,44,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,13,3,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135}, -{7,0,-909,0,0,2,0,0,-1,25,68,46,37,37,9,258,-909,-909,-909,31,19,6,0,0,32,25,60,52,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,96,35,96,12,3,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135}, -{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,7,32,30,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,106} +{5,0,-909,0,0,2,0,2,-1,7,12,22,15,15,7,198,-909,-909,-909,20,13,2,0,0,21,7,18,30,3,3,1,-909,-909,0,1,0,0,12,20,15,15,18,18,1,115,18,0,-909,-909,-909,-909,0,0,16,2,-909,0,0,-909,16,-909,-909,-909,-909,32,18,55,24,55,4,4,4,9,13,-909,5,51,11,5,0,3,3,6,8,3,3,-909,2,-909,-909,-909,-909,5,5,3,1,106}, +{5,0,-909,0,0,1,0,2,-1,8,14,22,15,15,7,164,-909,-909,-909,19,15,2,0,0,21,8,27,28,4,4,1,-909,-909,0,7,6,0,13,23,17,17,21,21,7,115,21,0,-909,-909,-909,-909,0,0,15,1,-909,0,0,-909,15,-909,-909,-909,-909,32,21,65,27,65,3,3,5,10,15,-909,5,58,13,5,0,4,4,7,9,4,4,-909,2,-909,-909,-909,-909,6,6,3,1,106}, +{7,0,-909,0,0,2,0,5,-1,25,69,46,37,37,9,258,-909,-909,-909,23,19,26,0,0,32,25,72,44,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,13,3,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135}, +{7,0,-909,0,0,2,0,5,-1,25,68,46,37,37,9,258,-909,-909,-909,31,19,6,0,0,32,25,60,52,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,96,35,96,12,3,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135}, +{7,0,-909,0,0,2,0,2,-1,10,20,27,18,18,9,301,-909,-909,-909,29,18,5,0,0,35,7,32,30,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,106} // *** End of generated data *** }; @@ -1071,11 +1071,11 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom // Button frame QStyleOptionFrame buttonOption; buttonOption.QStyleOption::operator=(*cmb); - const int maxHeight = cmbxFrame.height(); - const int maxWidth = cmbxFrame.width() - cmbxEditField.width(); + const int maxButtonSide = cmbxFrame.width() - cmbxEditField.width(); + const int newTop = cmbxEditField.center().y() - maxButtonSide / 2; const int topLeftPoint = direction ? - (cmbxEditField.right() + 1) : (cmbxEditField.left() + 1 - maxWidth); - const QRect buttonRect(topLeftPoint, cmbxEditField.top(), maxWidth, maxHeight); + (cmbxEditField.right() + 1) : (cmbxEditField.left() + 1 - maxButtonSide); + const QRect buttonRect(topLeftPoint, newTop, maxButtonSide, maxButtonSide); buttonOption.rect = buttonRect; buttonOption.state = cmb->state; drawPrimitive(PE_PanelButtonCommand, &buttonOption, painter, widget); @@ -2884,30 +2884,24 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple ret = cmb->rect; const int width = cmb->rect.width(); const int height = cmb->rect.height(); - const int buttonIconSize = QS60StylePrivate::pixelMetric(PM_ButtonIconSize); const int buttonMargin = cmb->frame ? 2 : 0; // 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 = qMax(cmb->rect.height(), buttonIconSize); - + const int buttonMinSize = QS60StylePrivate::pixelMetric(PM_ButtonIconSize) + 2 * buttonMargin; QSize buttonSize; - buttonSize.setWidth(buttonWidth + 2 * buttonMargin); - buttonSize.setHeight(qMax(8, (cmb->rect.height() >> 1) - frameThickness)); //buttons should be squares + //allow button to grow to one fourth of the frame height, if the frame is really tall + buttonSize.setHeight(qMin(height, qMax(width / 4, buttonMinSize))); + buttonSize.setWidth(buttonSize.height()); buttonSize = buttonSize.expandedTo(QApplication::globalStrut()); switch (scontrol) { case SC_ComboBoxArrow: { - const int xposMod = cmb->rect.x() + width - buttonMargin - buttonWidth; + const int xposMod = cmb->rect.x() + width - buttonMargin - buttonSize.width(); const int ypos = cmb->rect.y(); - ret.setRect(xposMod, ypos + buttonMargin, buttonWidth, height - 2 * buttonMargin); + ret.setRect(xposMod, ypos + buttonMargin, buttonSize.width(), height - 2 * buttonMargin); } break; case SC_ComboBoxEditField: { - const int withFrameX = cmb->rect.x() + width - frameThickness - buttonSize.width(); - ret = QRect( - frameThickness, - frameThickness, - withFrameX - frameThickness, - height - 2 * frameThickness); + ret = QRect(0, 0, cmb->rect.x() + width - buttonSize.width(), height); } break; case SC_ComboBoxListBoxPopup: { -- cgit v0.12 From f2ab8acd583941dcd673c627ff03d25e519e1f6b Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Fri, 10 Dec 2010 11:34:45 +0200 Subject: Fix whitespace in qs60style.cpp Reviewed-by: TrustMe --- 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 3c715b7..56d2d19 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2889,7 +2889,7 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple const int frameThickness = cmb->frame ? pixelMetric(PM_SpinBoxFrameWidth, cmb, widget) : 0; const int buttonMinSize = QS60StylePrivate::pixelMetric(PM_ButtonIconSize) + 2 * buttonMargin; QSize buttonSize; - //allow button to grow to one fourth of the frame height, if the frame is really tall + //allow button to grow to one fourth of the frame height, if the frame is really tall buttonSize.setHeight(qMin(height, qMax(width / 4, buttonMinSize))); buttonSize.setWidth(buttonSize.height()); buttonSize = buttonSize.expandedTo(QApplication::globalStrut()); -- cgit v0.12 From 891d0c143b33c6e2e16af322652e4d7bccca2292 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 10 Dec 2010 14:57:03 +0100 Subject: Doc: Added a note about the Public Suffix List. Added at the request of Peter Hartmann and Legal. --- doc/src/legal/3rdparty.qdoc | 81 ++++++++++++++++++++++++++++----------------- 1 file changed, 51 insertions(+), 30 deletions(-) diff --git a/doc/src/legal/3rdparty.qdoc b/doc/src/legal/3rdparty.qdoc index 8b3d5f2..9cc83a6 100644 --- a/doc/src/legal/3rdparty.qdoc +++ b/doc/src/legal/3rdparty.qdoc @@ -683,36 +683,57 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - + \hr - jquery 1.4.2.js Copyright 2010 John Resig - This software is dual licensed under the MIT or GPL version 2 licenses. - Nokia has used the software herein under the MIT license. - - jquery includes Sizzle.js Copyright 2010 The Dojo Foundaton and is - licensed under the MIT, BSD and GPL licenses. Nokia has used this - software herein under the MIT license. - - The MIT License - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - - + jquery 1.4.2.js Copyright 2010 John Resig + This software is dual licensed under the MIT or GPL version 2 licenses. + Nokia has used the software herein under the MIT license. + + jquery includes Sizzle.js Copyright 2010 The Dojo Foundaton and is + licensed under the MIT, BSD and GPL licenses. Nokia has used this + software herein under the MIT license. + + The MIT License + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + + + \section1 The Public Suffix List + + \e{The Public Suffix List is an initiative of the Mozilla Project, but is + maintained as a community resource. It is available for use in any + software, but was originally created to meet the needs of browser + manufacturers. It allows browsers to, for example:} + \list + \o \e{Avoid privacy-damaging "supercookies" being set for high-level + domain name suffixes} + \o \e{Highlight the most important part of a domain name in the user + interface} + \o \e{Accurately sort history entries by site} + \endlist + -- quoted from \l{publicsuffix.org}. + + The public suffix list is used inside Qt to avoid such "supercookies" + mentioned above being set in the cookie jar supported by Qt (by the + QNetworkCookieJar class). + + See \c src/network/access/qnetworkcookiejartlds_p.h.INFO for more + information about how the list is used. */ -- cgit v0.12 From 35f964ac3d88831c857a850bbdc58fcbfdbaf13c Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 13 Dec 2010 13:49:52 +1000 Subject: A QAIM model resulted in items moving to incorrect locations QAbstractItemModel moves items to the gaps between items. QML views assume items are moved to the destination index. This means we need to adjust the destination when moving forward to a gap. Task-number: QTBUG-15841 Reviewed-by: Michael Brasser --- src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp index 4fe6c4c..4f5213a 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp @@ -1367,7 +1367,7 @@ void QDeclarativeVisualDataModel::_q_rowsMoved(const QModelIndex &sourceParent, Q_D(QDeclarativeVisualDataModel); const int count = sourceEnd - sourceStart + 1; if (destinationParent == d->m_root && sourceParent == d->m_root) { - _q_itemsMoved(sourceStart, destinationRow, count); + _q_itemsMoved(sourceStart, sourceStart > destinationRow ? destinationRow : destinationRow-1, count); } else if (sourceParent == d->m_root) { _q_itemsRemoved(sourceStart, count); } else if (destinationParent == d->m_root) { -- cgit v0.12 From 18b940539d0633f30ae055feedb48aeb15969814 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Wed, 8 Dec 2010 13:38:48 +1000 Subject: Add mirroring-positioners.qml example --- .../positioners/mirroring-positioners.qml | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 examples/declarative/positioners/mirroring-positioners.qml diff --git a/examples/declarative/positioners/mirroring-positioners.qml b/examples/declarative/positioners/mirroring-positioners.qml new file mode 100644 index 0000000..0db95dd --- /dev/null +++ b/examples/declarative/positioners/mirroring-positioners.qml @@ -0,0 +1,70 @@ +import QtQuick 1.0 + +Rectangle { + width: column.width+10 + height: column.height+10 + property bool arabic: false + Column { + id: column + spacing: 10 + anchors.centerIn: parent + Text { + text: "Row" + anchors.horizontalCenter: parent.horizontalCenter + } + Row { + flow: arabic ? Row.RightToLeft : Row.LeftToRight + spacing: 10 + Repeater { + model: 4 + Loader { + property int value: index + sourceComponent: delegate + } + } + } + Text { + text: "Grid" + anchors.horizontalCenter: parent.horizontalCenter + } + Grid { + flow: arabic ? Grid.RightToLeft : Grid.LeftToRight + spacing: 10; columns: 4 + Repeater { + model: 11 + Loader { + property int value: index + sourceComponent: delegate + } + } + } + Rectangle { + height: 50; width: parent.width + color: mouseArea.pressed ? "black" : "gray" + Text { + text: arabic ? "RTL" : "LTR" + color: "white" + font.pixelSize: 20 + anchors.centerIn: parent + } + MouseArea { + id: mouseArea + onClicked: arabic = !arabic + anchors.fill: parent + } + } + } + Component { + id: delegate + Rectangle { + width: 50; height: 50 + color: Qt.rgba(0.8/(parent.value+1),0.8/(parent.value+1),0.8/(parent.value+1),1.0) + Text { + text: parent.parent.value+1 + color: "white" + font.pixelSize: 20 + anchors.centerIn: parent + } + } + } +} -- cgit v0.12 From ad653d169aaecf6273787a01797c7647a13eec04 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 13 Dec 2010 16:09:52 +1000 Subject: Fix dragging Flickable back over start point. Change 810e21d9e404aa2fcb602cb68bfd892387b234e7 caused regression. Once stealMouse is set to true is must stay that way until release. Task-number: QTBUG-15998 Reviewed-by: Michael Brasser --- src/declarative/graphicsitems/qdeclarativeflickable.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index 377f3b5..f1d92c5 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -700,8 +700,8 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent bool rejectY = false; bool rejectX = false; - bool stealY = false; - bool stealX = false; + bool stealY = stealMouse; + bool stealX = stealMouse; if (q->yflick()) { int dy = int(event->pos().y() - pressPos.y()); -- cgit v0.12 From 2e2f26072647b08292955ebad631c34d58c828f9 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Mon, 13 Dec 2010 17:08:09 +1000 Subject: Revert "Add mirroring-positioners.qml example" that was accidentally pushed This reverts commit 18b940539d0633f30ae055feedb48aeb15969814. --- .../positioners/mirroring-positioners.qml | 70 ---------------------- 1 file changed, 70 deletions(-) delete mode 100644 examples/declarative/positioners/mirroring-positioners.qml diff --git a/examples/declarative/positioners/mirroring-positioners.qml b/examples/declarative/positioners/mirroring-positioners.qml deleted file mode 100644 index 0db95dd..0000000 --- a/examples/declarative/positioners/mirroring-positioners.qml +++ /dev/null @@ -1,70 +0,0 @@ -import QtQuick 1.0 - -Rectangle { - width: column.width+10 - height: column.height+10 - property bool arabic: false - Column { - id: column - spacing: 10 - anchors.centerIn: parent - Text { - text: "Row" - anchors.horizontalCenter: parent.horizontalCenter - } - Row { - flow: arabic ? Row.RightToLeft : Row.LeftToRight - spacing: 10 - Repeater { - model: 4 - Loader { - property int value: index - sourceComponent: delegate - } - } - } - Text { - text: "Grid" - anchors.horizontalCenter: parent.horizontalCenter - } - Grid { - flow: arabic ? Grid.RightToLeft : Grid.LeftToRight - spacing: 10; columns: 4 - Repeater { - model: 11 - Loader { - property int value: index - sourceComponent: delegate - } - } - } - Rectangle { - height: 50; width: parent.width - color: mouseArea.pressed ? "black" : "gray" - Text { - text: arabic ? "RTL" : "LTR" - color: "white" - font.pixelSize: 20 - anchors.centerIn: parent - } - MouseArea { - id: mouseArea - onClicked: arabic = !arabic - anchors.fill: parent - } - } - } - Component { - id: delegate - Rectangle { - width: 50; height: 50 - color: Qt.rgba(0.8/(parent.value+1),0.8/(parent.value+1),0.8/(parent.value+1),1.0) - Text { - text: parent.parent.value+1 - color: "white" - font.pixelSize: 20 - anchors.centerIn: parent - } - } - } -} -- cgit v0.12 From 95ddfa13737164c93c58ce3694ce59ec68a016d9 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 13 Dec 2010 17:33:13 +1000 Subject: Ensure ListView contentHeight is set to a valid size. If the view height is 0 no items will be created so the contentHeight can not be estimated. The currentItem is usually created, so it is possible to use that to estimate. Task-number: QTBUG-16037 Reviewed-by: Bea Lam --- .../graphicsitems/qdeclarativelistview.cpp | 6 ++++ .../qdeclarativelistview/data/qtbug16037.qml | 37 ++++++++++++++++++++++ .../tst_qdeclarativelistview.cpp | 20 ++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 tests/auto/declarative/qdeclarativelistview/data/qtbug16037.qml diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index d008f91..2a7f508 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -265,6 +265,8 @@ public: } } pos = (*(--visibleItems.constEnd()))->endPosition() + invisibleCount * (averageSize + spacing); + } else if (model && model->count()) { + pos = model->count() * averageSize + (model->count()-1) * spacing; } return pos; } @@ -1050,6 +1052,8 @@ void QDeclarativeListViewPrivate::updateCurrent(int modelIndex) // This is slightly sub-optimal, but section heading caching minimizes the impact. if (currentItem->section) currentItem->section->setVisible(false); + if (visibleItems.isEmpty()) + averageSize = currentItem->size(); } updateHighlight(); emit q->currentIndexChanged(); @@ -1576,6 +1580,7 @@ void QDeclarativeListView::setModel(const QVariant &model) d->updateTrackedItem(); } } + d->updateViewport(); } connect(d->model, SIGNAL(itemsInserted(int,int)), this, SLOT(itemsInserted(int,int))); connect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int))); @@ -1647,6 +1652,7 @@ void QDeclarativeListView::setDelegate(QDeclarativeComponent *delegate) d->highlight->setPosition(d->currentItem->position()); d->updateTrackedItem(); } + d->updateViewport(); } } emit delegateChanged(); diff --git a/tests/auto/declarative/qdeclarativelistview/data/qtbug16037.qml b/tests/auto/declarative/qdeclarativelistview/data/qtbug16037.qml new file mode 100644 index 0000000..0756618 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelistview/data/qtbug16037.qml @@ -0,0 +1,37 @@ +import QtQuick 1.0 + +Item { + width: 640 + height: 480 + + function setModel() { + listView.model = listModel1 + } + + ListModel { + id: listModel1 + ListElement { text: "Apple" } + ListElement { text: "Banana" } + ListElement { text: "Orange" } + ListElement { text: "Coconut" } + } + + Rectangle { + width: 200 + height: listView.contentHeight + color: "yellow" + anchors.centerIn: parent + + ListView { + id: listView + objectName: "listview" + anchors.fill: parent + + delegate: Item { + width: 200 + height: 20 + Text { text: model.text; anchors.centerIn: parent } + } + } + } +} diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp index ff90d32..b834d46 100644 --- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp +++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp @@ -104,6 +104,7 @@ private slots: void sizeLessThan1(); void QTBUG_14821(); void resizeDelegate(); + void QTBUG_16037(); private: template void items(); @@ -1944,6 +1945,25 @@ void tst_QDeclarativeListView::resizeDelegate() delete canvas; } +void tst_QDeclarativeListView::QTBUG_16037() +{ + QDeclarativeView *canvas = createView(); + + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/qtbug16037.qml")); + qApp->processEvents(); + + QDeclarativeListView *listview = findItem(canvas->rootObject(), "listview"); + QTRY_VERIFY(listview != 0); + + QVERIFY(listview->contentHeight() <= 0.0); + + QMetaObject::invokeMethod(canvas->rootObject(), "setModel"); + + QTRY_COMPARE(listview->contentHeight(), 80.0); + + delete canvas; +} + void tst_QDeclarativeListView::qListModelInterface_items() { items(); -- cgit v0.12 From de1632cc7be17df234cd86d49df9787e6aa68107 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Fri, 10 Dec 2010 13:05:40 +0100 Subject: Add expected failures for JS test suite on Symbian These are bugs in the back-end (JavaScriptCore), not in the QtScript layer. Flag them as such. Task-number: QTBUG-15435 Reviewed-by: Jedrzej Nowacki --- tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp b/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp index a280256..4b14cc9 100644 --- a/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp +++ b/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp @@ -745,6 +745,16 @@ tst_Suite::tst_Suite() addExpectedFailure("ecma/TypeConversion/9.3.1-3.js", "1/-1e-2000", willFixInNextReleaseMessage); #endif +#ifdef Q_OS_SYMBIAN + addExpectedFailure("ecma/Math/15.8.2.13.js", "Math.pow(-1, 0.5)", willFixInNextReleaseMessage); + addExpectedFailure("ecma/Math/15.8.2.13.js", "Math.pow(-1, -0.5)", willFixInNextReleaseMessage); + addExpectedFailure("ecma_3/Operators/order-01.js", "operator evaluation order: 11.5.1 *", willFixInNextReleaseMessage); + addExpectedFailure("ecma_3/Operators/order-01.js", "operator evaluation order: 11.5.2 /", willFixInNextReleaseMessage); + addExpectedFailure("ecma_3/Operators/order-01.js", "operator evaluation order: 11.6.2 -", willFixInNextReleaseMessage); + addExpectedFailure("ecma_3/Operators/order-01.js", "operator evaluation order: 11.13.2 *=", willFixInNextReleaseMessage); + addExpectedFailure("ecma_3/Operators/order-01.js", "operator evaluation order: 11.13.2 /=", willFixInNextReleaseMessage); +#endif + static const char klass[] = "tst_QScriptJsTestSuite"; QVector *data = qt_meta_data_tst_Suite(); -- cgit v0.12 From 6160f8541e4d7cb66de7680b5fb439fb757c59dd Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Mon, 13 Dec 2010 10:28:42 +0200 Subject: Symbian specific input methods should use 'Text' mode as default case Currently default case is 'lower'. It makes more sense to set the default as 'Text', as it is natural default case for most text entries. Task-number: QTBUG-10311 Reviewed-by: Miikka Heikkinen --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 4a1b9b9..5e8a2e1 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -89,7 +89,7 @@ QCoeFepInputContext::QCoeFepInputContext(QObject *parent) m_fepState->SetFlags(EAknEditorFlagDefault); m_fepState->SetDefaultInputMode( EAknEditorTextInputMode ); m_fepState->SetPermittedInputModes( EAknEditorAllInputModes ); - m_fepState->SetDefaultCase( EAknEditorLowerCase ); + m_fepState->SetDefaultCase( EAknEditorTextCase ); m_fepState->SetPermittedCases( EAknEditorAllCaseModes ); m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG); m_fepState->SetNumericKeymap( EAknEditorStandardNumberModeKeymap ); -- cgit v0.12 From 97954165ddeb8a57d8b6349c00fa50019450213b Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 13 Dec 2010 10:31:07 +0100 Subject: doc: Replaced some \raw and \endraw uses with \table and \endtable In DITA XML, there is no straightforward way to translate raw html into DITA XML, because the XML stream writer automagically escapes all the raw html elements. So I am beginning to replace uses of the \raw command with \table, which gets output correctly. The problem is the XML stream writer must see each XML element start and end, because it keeps them on a stack. When you output XML elements with the writeCharacters() function, it escapes the '<' and '>' of any XML elements the character string contains. --- doc/src/widgets-and-layouts/gallery-cde.qdoc | 427 ++++++--------------------- 1 file changed, 91 insertions(+), 336 deletions(-) diff --git a/doc/src/widgets-and-layouts/gallery-cde.qdoc b/doc/src/widgets-and-layouts/gallery-cde.qdoc index c783399..69287b9 100644 --- a/doc/src/widgets-and-layouts/gallery-cde.qdoc +++ b/doc/src/widgets-and-layouts/gallery-cde.qdoc @@ -34,345 +34,100 @@ This page shows some of the widgets available in Qt when configured to use the "cde" style. -\raw HTML -

Buttons

+\section2 Buttons - -- - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage cde-pushbutton.png -\raw HTML - -\endraw -\inlineimage cde-toolbutton.png -\raw HTML -
-\endraw -The QPushButton widget provides a command button. -\raw HTML - -\endraw -\raw HTML -
-\endraw -\inlineimage cde-checkbox.png -\raw HTML - -\endraw -\inlineimage cde-radiobutton.png -\raw HTML -
-\endraw -The QCheckBox widget provides a checkbox with a text label.\raw HTML - -\endraw -The QRadioButton widget provides a radio button with a text or pixmap label.\raw HTML -
-\endraw -\raw HTML -

Containers

+\table 100% +\row +\o \image cde-checkbox.png + \caption The QCheckBox widget provides a checkbox with a text label. +\o \image cde-radiobutton.png + \caption The QRadioButton widget provides a radio button with a text or pixmap label. +\o \image cde-pushbutton.png + \image cde-toolbutton.png + \caption The QPushButton widget provides a command button. +\endtable - -- - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage cde-groupbox.png -\raw HTML - -\endraw -\inlineimage cde-tabwidget.png -\raw HTML -
-\endraw -The QGroupBox widget provides a group box frame with a title.\raw HTML - -\endraw -The QTabWidget class provides a stack of tabbed widgets.\raw HTML -
-\endraw -\inlineimage cde-frame.png -\raw HTML - -\endraw -\inlineimage cde-toolbox.png -\raw HTML -
-\endraw -The QFrame widget provides a simple decorated container for other widgets.\raw HTML - -\endraw -The QToolBox class provides a column of tabbed widget items.\raw HTML -
-\endraw -\raw HTML -

Item Views

+\section2 Containers - -- - - - - - - - - - - - - - - -
-\endraw -\inlineimage cde-listview.png -\raw HTML - -\endraw -\inlineimage cde-treeview.png -\raw HTML -
-\endraw -The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view.\raw HTML - -\endraw -The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view.\raw HTML -
-\endraw -\inlineimage cde-tableview.png -\raw HTML -
-\endraw -The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\raw HTML -
-\endraw -\raw HTML -

Display Widgets

+\table 100% +\row +\o \image cde-groupbox.png + The The QGroupBox widget provides a group box frame with a title. +\o \image cde-tabwidget.png + The QTabWidget class provides a stack of tabbed widgets. +\o \image cde-frame.png + The QFrame widget provides a simple decorated container for other widgets. +\o \image cde-toolbox.png + The QToolBox class provides a column of tabbed widget items. +\endtable - -- - - - - - - - - - - - - - - -
-\endraw -\inlineimage cde-progressbar.png -\raw HTML - -\endraw -\inlineimage cde-lcdnumber.png -\raw HTML -
-\endraw -The QProgressBar widget provides a horizontal progress bar.\raw HTML - -\endraw -The QLCDNumber widget displays a number with LCD-like digits.\raw HTML -
-\endraw -\inlineimage cde-label.png -\raw HTML -
-\endraw -The QLabel widget provides a text or image display.\raw HTML -
-\endraw -\raw HTML -

Input Widgets

+\section2 Item Views + +\table 100% +\row +\o \image cde-listview.png + The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. +\o \image cde-treeview.png + The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. +\o \image cde-tableview.png + The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\o +\o +\endtable + +\section2 Display Widgets + +\table 100% +\row +\o \image cde-progressbar.png + The QProgressBar widget provides a horizontal progress bar. +\o \image cde-label.png + The QLabel widget provides a text or image display. +\o \image cde-lcdnumber.png + The QLCDNumber widget displays a number with LCD-like digits. +\endtable + +\section2 Input Widgets + +\table 100% +\row +\o \image cde-lineedit.png + The QLineEdit widget is a one-line text editor. +\o \image cde-dateedit.png + The QDateEdit class provides a widget for editing dates. +\o \image cde-timeedit.png + The QTimeEdit class provides a widget for editing times. +\o \image cde-datetimeedit.png + The QDateTimeEdit class provides a widget for editing dates and times. +\endtable + +\table 100% +\row +\o \image cde-slider.png + The QSlider widget provides a vertical or horizontal slider. +\o \image cde-combobox.png + The QComboBox widget is a combined button and pop-up list. +\o \image cde-spinbox.png + The QSpinBox class provides a spin box widget. +\endtable + +\table 100% +\row +\o \image cde-fontcombobox.png + The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. +\o \image cde-doublespinbox.png + The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. +\o \image cde-horizontalscrollbar.png + The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. +\endtable + +\table 100% +\row +\o \image cde-dial.png + The QDial class provides a rounded range control (like a speedometer or potentiometer). +\o \image cde-textedit.png + The QTextEdit class provides a widget that is used to edit and display both plain and rich text. +\o \image cde-calendarwidget.png + The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. +\endtable - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage cde-slider.png -\raw HTML - -\endraw -\inlineimage cde-lineedit.png -\raw HTML -
-\endraw -The QSlider widget provides a vertical or horizontal slider.\raw HTML - -\endraw -The QLineEdit widget is a one-line text editor.\raw HTML -
-\endraw -\inlineimage cde-combobox.png -\raw HTML - -\endraw -\inlineimage cde-doublespinbox.png -\raw HTML -
-\endraw -The QComboBox widget is a combined button and pop-up list.\raw HTML - -\endraw -The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered.\raw HTML -
-\endraw -\inlineimage cde-spinbox.png -\raw HTML - -\endraw -\inlineimage cde-timeedit.png -\raw HTML -
-\endraw -The QSpinBox class provides a spin box widget.\raw HTML - -\endraw -The QTimeEdit class provides a widget for editing times.\raw HTML -
-\endraw -\inlineimage cde-dateedit.png -\raw HTML - -\endraw -\inlineimage cde-datetimeedit.png -\raw HTML -
-\endraw -The QDateEdit class provides a widget for editing dates.\raw HTML - -\endraw -The QDateTimeEdit class provides a widget for editing dates and times.\raw HTML -
-\endraw -\inlineimage cde-textedit.png -\raw HTML - -\endraw -\inlineimage cde-horizontalscrollbar.png -\raw HTML -
-\endraw -The QTextEdit class provides a widget that is used to edit and - display both plain and rich text.\raw HTML - -\endraw -The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation.\raw HTML -
-\endraw -\inlineimage cde-dial.png -\raw HTML - -\endraw -\inlineimage cde-calendarwidget.png -\raw HTML -
-\endraw -The QDial class provides a rounded range control (like a - speedometer or potentiometer).\raw HTML - -\endraw -The QCalendarWidget class provides a monthly calendar widget that can be used to select dates.\raw HTML -
-\endraw -\inlineimage cde-fontcombobox.png -\raw HTML -
-\endraw -The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts.\raw HTML -
-\endraw */ -- cgit v0.12 From ad3783ecd1308d357eb0451fe5b4fc24b49ed15a Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 13 Dec 2010 11:42:38 +0100 Subject: doc: Replaced some \raw and \endraw uses with \table and \endtable In DITA XML, there is no straightforward way to translate raw html into DITA XML, because the XML stream writer automagically escapes all the raw html elements. So I am beginning to replace uses of the \raw command with \table, which gets output correctly. The problem is the XML stream writer must see each XML element start and end, because it keeps them on a stack. When you output XML elements with the writeCharacters() function, it escapes the '<' and '>' of any XML elements the character string contains. --- .../widgets-and-layouts/gallery-cleanlooks.qdoc | 432 +++++--------------- doc/src/widgets-and-layouts/gallery-gtk.qdoc | 436 +++++---------------- doc/src/widgets-and-layouts/gallery-macintosh.qdoc | 432 +++++--------------- doc/src/widgets-and-layouts/gallery-motif.qdoc | 432 +++++--------------- doc/src/widgets-and-layouts/gallery-plastique.qdoc | 432 +++++--------------- doc/src/widgets-and-layouts/gallery-windows.qdoc | 432 +++++--------------- .../widgets-and-layouts/gallery-windowsvista.qdoc | 432 +++++--------------- doc/src/widgets-and-layouts/gallery-windowsxp.qdoc | 432 +++++--------------- 8 files changed, 768 insertions(+), 2692 deletions(-) diff --git a/doc/src/widgets-and-layouts/gallery-cleanlooks.qdoc b/doc/src/widgets-and-layouts/gallery-cleanlooks.qdoc index d03adc8..59e2934 100644 --- a/doc/src/widgets-and-layouts/gallery-cleanlooks.qdoc +++ b/doc/src/widgets-and-layouts/gallery-cleanlooks.qdoc @@ -34,345 +34,105 @@ This page shows some of the widgets available in Qt when configured to use the "cleanlooks" style. -\raw HTML -

Buttons

+\section2 Buttons - -- - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage cleanlooks-pushbutton.png -\raw HTML - -\endraw -\inlineimage cleanlooks-toolbutton.png -\raw HTML -
-\endraw -The QPushButton widget provides a command button.\raw HTML - -\endraw -The QToolButton class provides a quick-access button to commands - or options, usually used inside a QToolBar.\raw HTML -
-\endraw -\inlineimage cleanlooks-checkbox.png -\raw HTML - -\endraw -\inlineimage cleanlooks-radiobutton.png -\raw HTML -
-\endraw -The QCheckBox widget provides a checkbox with a text label.\raw HTML - -\endraw -The QRadioButton widget provides a radio button with a text or pixmap label.\raw HTML -
-\endraw -\raw HTML -

Containers

+\table 100% +\row +\o \image cleanlooks-pushbutton.png + \caption The QPushButton widget provides a command button. +\o \image cleanlooks-toolbutton.png + \caption The QToolButton class provides a quick-access button to commands + or options, usually used inside a QToolBar. +\endtable - -- - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage cleanlooks-groupbox.png -\raw HTML - -\endraw -\inlineimage cleanlooks-tabwidget.png -\raw HTML -
-\endraw -The QGroupBox widget provides a group box frame with a title.\raw HTML - -\endraw -The QTabWidget class provides a stack of tabbed widgets.\raw HTML -
-\endraw -\inlineimage cleanlooks-frame.png -\raw HTML - -\endraw -\inlineimage cleanlooks-toolbox.png -\raw HTML -
-\endraw -The QFrame widget provides a simple decorated container for other widgets.\raw HTML - -\endraw -The QToolBox class provides a column of tabbed widget items.\raw HTML -
-\endraw -\raw HTML -

Item Views

+\table 100% +\row +\o \image cleanlooks-checkbox.png + \caption The QCheckBox widget provides a checkbox with a text label. +\o \image cleanlooks-radiobutton.png + \caption The QRadioButton widget provides a radio button with a text or pixmap label. +\endtable - -- - - - - - - - - - - - - - - -
-\endraw -\inlineimage cleanlooks-listview.png -\raw HTML - -\endraw -\inlineimage cleanlooks-treeview.png -\raw HTML -
-\endraw -The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view.\raw HTML - -\endraw -The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view.\raw HTML -
-\endraw -\inlineimage cleanlooks-tableview.png -\raw HTML -
-\endraw -The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\raw HTML -
-\endraw -\raw HTML -

Display Widgets

+\section2 Containers - -- - - - - - - - - - - - - - - -
-\endraw -\inlineimage cleanlooks-progressbar.png -\raw HTML - -\endraw -\inlineimage cleanlooks-lcdnumber.png -\raw HTML -
-\endraw -The QProgressBar widget provides a horizontal progress bar.\raw HTML - -\endraw -The QLCDNumber widget displays a number with LCD-like digits.\raw HTML -
-\endraw -\inlineimage cleanlooks-label.png -\raw HTML -
-\endraw -The QLabel widget provides a text or image display.\raw HTML -
-\endraw -\raw HTML -

Input Widgets

+\table 100% +\row +\o \image cleanlooks-groupbox.png + The The QGroupBox widget provides a group box frame with a title. +\o \image cleanlooks-tabwidget.png + The QTabWidget class provides a stack of tabbed widgets. +\o \image cleanlooks-frame.png + The QFrame widget provides a simple decorated container for other widgets. +\o \image cleanlooks-toolbox.png + The QToolBox class provides a column of tabbed widget items. +\endtable - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage cleanlooks-slider.png -\raw HTML - -\endraw -\inlineimage cleanlooks-lineedit.png -\raw HTML -
-\endraw -The QSlider widget provides a vertical or horizontal slider.\raw HTML - -\endraw -The QLineEdit widget is a one-line text editor.\raw HTML -
-\endraw -\inlineimage cleanlooks-combobox.png -\raw HTML - -\endraw -\inlineimage cleanlooks-doublespinbox.png -\raw HTML -
-\endraw -The QComboBox widget is a combined button and pop-up list.\raw HTML - -\endraw -The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered.\raw HTML -
-\endraw -\inlineimage cleanlooks-spinbox.png -\raw HTML - -\endraw -\inlineimage cleanlooks-timeedit.png -\raw HTML -
-\endraw -The QSpinBox class provides a spin box widget.\raw HTML - -\endraw -The QTimeEdit class provides a widget for editing times.\raw HTML -
-\endraw -\inlineimage cleanlooks-dateedit.png -\raw HTML - -\endraw -\inlineimage cleanlooks-datetimeedit.png -\raw HTML -
-\endraw -The QDateEdit class provides a widget for editing dates.\raw HTML - -\endraw -The QDateTimeEdit class provides a widget for editing dates and times.\raw HTML -
-\endraw -\inlineimage cleanlooks-textedit.png -\raw HTML - -\endraw -\inlineimage cleanlooks-horizontalscrollbar.png -\raw HTML -
-\endraw -The QTextEdit class provides a widget that is used to edit and - display both plain and rich text.\raw HTML - -\endraw -The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation.\raw HTML -
-\endraw -\inlineimage cleanlooks-dial.png -\raw HTML - -\endraw -\inlineimage cleanlooks-calendarwidget.png -\raw HTML -
-\endraw -The QDial class provides a rounded range control (like a - speedometer or potentiometer).\raw HTML - -\endraw -The QCalendarWidget class provides a monthly calendar widget that can be used to select dates.\raw HTML -
-\endraw -\inlineimage cleanlooks-fontcombobox.png -\raw HTML -
-\endraw -The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts.\raw HTML -
-\endraw +\section2 Item Views + +\table 100% +\row +\o \image cleanlooks-listview.png + The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. +\o \image cleanlooks-treeview.png + The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. +\o \image cleanlooks-tableview.png + The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\o +\o +\endtable + +\section2 Display Widgets + +\table 100% +\row +\o \image cleanlooks-progressbar.png + The QProgressBar widget provides a horizontal progress bar. +\o \image cleanlooks-label.png + The QLabel widget provides a text or image display. +\o \image cleanlooks-lcdnumber.png + The QLCDNumber widget displays a number with LCD-like digits. +\endtable + +\section2 Input Widgets + +\table 100% +\row +\o \image cleanlooks-lineedit.png + The QLineEdit widget is a one-line text editor. +\o \image cleanlooks-dateedit.png + The QDateEdit class provides a widget for editing dates. +\o \image cleanlooks-timeedit.png + The QTimeEdit class provides a widget for editing times. +\o \image cleanlooks-datetimeedit.png + The QDateTimeEdit class provides a widget for editing dates and times. +\endtable + +\table 100% +\row +\o \image cleanlooks-slider.png + The QSlider widget provides a vertical or horizontal slider. +\o \image cleanlooks-combobox.png + The QComboBox widget is a combined button and pop-up list. +\o \image cleanlooks-spinbox.png + The QSpinBox class provides a spin box widget. +\endtable + +\table 100% +\row +\o \image cleanlooks-fontcombobox.png + The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. +\o \image cleanlooks-doublespinbox.png + The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. +\o \image cleanlooks-horizontalscrollbar.png + The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. +\endtable + +\table 100% +\row +\o \image cleanlooks-dial.png + The QDial class provides a rounded range control (like a speedometer or potentiometer). +\o \image cleanlooks-textedit.png + The QTextEdit class provides a widget that is used to edit and display both plain and rich text. +\o \image cleanlooks-calendarwidget.png + The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. +\endtable */ diff --git a/doc/src/widgets-and-layouts/gallery-gtk.qdoc b/doc/src/widgets-and-layouts/gallery-gtk.qdoc index b3a6372..b2f8458 100644 --- a/doc/src/widgets-and-layouts/gallery-gtk.qdoc +++ b/doc/src/widgets-and-layouts/gallery-gtk.qdoc @@ -37,349 +37,105 @@ Take a look at the \l{Qt Widget Gallery} to see how Qt applications appear in other styles. -\raw HTML -

Buttons

+\section2 Buttons - -- - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage gtk-pushbutton.png -\raw HTML - -\endraw -\inlineimage gtk-toolbutton.png -\raw HTML -
-\endraw -The QPushButton widget provides a command button.\raw HTML - -\endraw -The QToolButton class provides a quick-access button to commands - or options, usually used inside a QToolBar.\raw HTML -
-\endraw -\inlineimage gtk-checkbox.png -\raw HTML - -\endraw -\inlineimage gtk-radiobutton.png -\raw HTML -
-\endraw -The QCheckBox widget provides a checkbox with a text label.\raw HTML - -\endraw -The QRadioButton widget provides a radio button with a text or pixmap label.\raw HTML -
-\endraw -\raw HTML -

Containers

+\table 100% +\row +\o \image gtk-pushbutton.png + \caption The QPushButton widget provides a command button. +\o \image gtk-toolbutton.png + \caption The QToolButton class provides a quick-access button to commands + or options, usually used inside a QToolBar. +\endtable - -- - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage gtk-groupbox.png -\raw HTML - -\endraw -\inlineimage gtk-tabwidget.png -\raw HTML -
-\endraw -The QGroupBox widget provides a group box frame with a title.\raw HTML - -\endraw -The QTabWidget class provides a stack of tabbed widgets.\raw HTML -
-\endraw -\inlineimage gtk-toolbox.png -\raw HTML - -\endraw -\inlineimage gtk-frame.png -\raw HTML -
-\endraw -The QToolBox class provides a column of tabbed widget items.\raw HTML - -\endraw -The QFrame widget provides a simple decorated container for other widgets.\raw HTML -
-\endraw -\raw HTML -

Item Views

+\table 100% +\row +\o \image gtk-checkbox.png + \caption The QCheckBox widget provides a checkbox with a text label. +\o \image gtk-radiobutton.png + \caption The QRadioButton widget provides a radio button with a text or pixmap label. +\endtable - -- - - - - - - - - - - - - - - - -
-\endraw -\inlineimage gtk-listview.png -\raw HTML - -\endraw -\inlineimage gtk-treeview.png -\raw HTML -
-\endraw -The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view.\raw HTML - -\endraw -The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view.\raw HTML -
-\endraw -\inlineimage gtk-tableview.png -\raw HTML -
-\endraw -The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\raw HTML - -\endraw -\raw HTML -
-\endraw -\raw HTML -

Display Widgets

+\section2 Containers - -- - - - - - - - - - - - - - - -
-\endraw -\inlineimage gtk-progressbar.png -\raw HTML - -\endraw -\inlineimage gtk-lcdnumber.png -\raw HTML -
-\endraw -The QProgressBar widget provides a horizontal progress bar.\raw HTML - -\endraw -The QLCDNumber widget displays a number with LCD-like digits.\raw HTML -
-\endraw -\inlineimage gtk-label.png -\raw HTML -
-\endraw -The QLabel widget provides a text or image display.\raw HTML -
-\endraw -\raw HTML -

Input Widgets

+\table 100% +\row +\o \image gtk-groupbox.png + The The QGroupBox widget provides a group box frame with a title. +\o \image gtk-tabwidget.png + The QTabWidget class provides a stack of tabbed widgets. +\o \image gtk-frame.png + The QFrame widget provides a simple decorated container for other widgets. +\o \image gtk-toolbox.png + The QToolBox class provides a column of tabbed widget items. +\endtable - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage gtk-slider.png -\raw HTML - -\endraw -\inlineimage gtk-lineedit.png -\raw HTML -
-\endraw -The QSlider widget provides a vertical or horizontal slider.\raw HTML - -\endraw -The QLineEdit widget is a one-line text editor.\raw HTML -
-\endraw -\inlineimage gtk-combobox.png -\raw HTML - -\endraw -\inlineimage gtk-doublespinbox.png -\raw HTML -
-\endraw -The QComboBox widget is a combined button and pop-up list.\raw HTML - -\endraw -The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered.\raw HTML -
-\endraw -\inlineimage gtk-spinbox.png -\raw HTML - -\endraw -\inlineimage gtk-timeedit.png -\raw HTML -
-\endraw -The QSpinBox class provides a spin box widget.\raw HTML - -\endraw -The QTimeEdit class provides a widget for editing times.\raw HTML -
-\endraw -\inlineimage gtk-dateedit.png -\raw HTML - -\endraw -\inlineimage gtk-datetimeedit.png -\raw HTML -
-\endraw -The QDateEdit class provides a widget for editing dates.\raw HTML - -\endraw -The QDateTimeEdit class provides a widget for editing dates and times.\raw HTML -
-\endraw -\inlineimage gtk-textedit.png -\raw HTML - -\endraw -\inlineimage gtk-horizontalscrollbar.png -\raw HTML -
-\endraw -The QTextEdit class provides a widget that is used to edit and - display both plain and rich text.\raw HTML - -\endraw -The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation.\raw HTML -
-\endraw -\inlineimage gtk-dial.png -\raw HTML - -\endraw -\inlineimage gtk-calendarwidget.png -\raw HTML -
-\endraw -The QDial class provides a rounded range control (like a - speedometer or potentiometer).\raw HTML - -\endraw -The QCalendarWidget class provides a monthly calendar widget that can be used to select dates.\raw HTML -
-\endraw -\inlineimage gtk-fontcombobox.png -\raw HTML -
-\endraw -The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts.\raw HTML -
-\endraw +\section2 Item Views + +\table 100% +\row +\o \image gtk-listview.png + The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. +\o \image gtk-treeview.png + The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. +\o \image gtk-tableview.png + The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\o +\o +\endtable + +\section2 Display Widgets + +\table 100% +\row +\o \image gtk-progressbar.png + The QProgressBar widget provides a horizontal progress bar. +\o \image gtk-label.png + The QLabel widget provides a text or image display. +\o \image gtk-lcdnumber.png + The QLCDNumber widget displays a number with LCD-like digits. +\endtable + +\section2 Input Widgets + +\table 100% +\row +\o \image gtk-lineedit.png + The QLineEdit widget is a one-line text editor. +\o \image gtk-dateedit.png + The QDateEdit class provides a widget for editing dates. +\o \image gtk-timeedit.png + The QTimeEdit class provides a widget for editing times. +\o \image gtk-datetimeedit.png + The QDateTimeEdit class provides a widget for editing dates and times. +\endtable + +\table 100% +\row +\o \image gtk-slider.png + The QSlider widget provides a vertical or horizontal slider. +\o \image gtk-combobox.png + The QComboBox widget is a combined button and pop-up list. +\o \image gtk-spinbox.png + The QSpinBox class provides a spin box widget. +\endtable + +\table 100% +\row +\o \image gtk-fontcombobox.png + The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. +\o \image gtk-doublespinbox.png + The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. +\o \image gtk-horizontalscrollbar.png + The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. +\endtable + +\table 100% +\row +\o \image gtk-dial.png + The QDial class provides a rounded range control (like a speedometer or potentiometer). +\o \image gtk-textedit.png + The QTextEdit class provides a widget that is used to edit and display both plain and rich text. +\o \image gtk-calendarwidget.png + The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. +\endtable */ diff --git a/doc/src/widgets-and-layouts/gallery-macintosh.qdoc b/doc/src/widgets-and-layouts/gallery-macintosh.qdoc index 30a78ca..44d7eb9 100644 --- a/doc/src/widgets-and-layouts/gallery-macintosh.qdoc +++ b/doc/src/widgets-and-layouts/gallery-macintosh.qdoc @@ -34,345 +34,105 @@ This page shows some of the widgets available in Qt when configured to use the "macintosh" style. -\raw HTML -

Buttons

+\section2 Buttons - -- - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage macintosh-pushbutton.png -\raw HTML - -\endraw -\inlineimage macintosh-toolbutton.png -\raw HTML -
-\endraw -The QPushButton widget provides a command button.\raw HTML - -\endraw -The QToolButton class provides a quick-access button to commands - or options, usually used inside a QToolBar.\raw HTML -
-\endraw -\inlineimage macintosh-checkbox.png -\raw HTML - -\endraw -\inlineimage macintosh-radiobutton.png -\raw HTML -
-\endraw -The QCheckBox widget provides a checkbox with a text label.\raw HTML - -\endraw -The QRadioButton widget provides a radio button with a text or pixmap label.\raw HTML -
-\endraw -\raw HTML -

Containers

+\table 100% +\row +\o \image macintosh-pushbutton.png + \caption The QPushButton widget provides a command button. +\o \image macintosh-toolbutton.png + \caption The QToolButton class provides a quick-access button to commands + or options, usually used inside a QToolBar. +\endtable - -- - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage macintosh-groupbox.png -\raw HTML - -\endraw -\inlineimage macintosh-tabwidget.png -\raw HTML -
-\endraw -The QGroupBox widget provides a group box frame with a title.\raw HTML - -\endraw -The QTabWidget class provides a stack of tabbed widgets.\raw HTML -
-\endraw -\inlineimage macintosh-frame.png -\raw HTML - -\endraw -\inlineimage macintosh-toolbox.png -\raw HTML -
-\endraw -The QFrame widget provides a simple decorated container for other widgets.\raw HTML - -\endraw -The QToolBox class provides a column of tabbed widget items.\raw HTML -
-\endraw -\raw HTML -

Item Views

+\table 100% +\row +\o \image macintosh-checkbox.png + \caption The QCheckBox widget provides a checkbox with a text label. +\o \image macintosh-radiobutton.png + \caption The QRadioButton widget provides a radio button with a text or pixmap label. +\endtable - -- - - - - - - - - - - - - - - -
-\endraw -\inlineimage macintosh-listview.png -\raw HTML - -\endraw -\inlineimage macintosh-treeview.png -\raw HTML -
-\endraw -The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view.\raw HTML - -\endraw -The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view.\raw HTML -
-\endraw -\inlineimage macintosh-tableview.png -\raw HTML -
-\endraw -The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\raw HTML -
-\endraw -\raw HTML -

Display Widgets

+\section2 Containers - -- - - - - - - - - - - - - - - -
-\endraw -\inlineimage macintosh-progressbar.png -\raw HTML - -\endraw -\inlineimage macintosh-lcdnumber.png -\raw HTML -
-\endraw -The QProgressBar widget provides a horizontal progress bar.\raw HTML - -\endraw -The QLCDNumber widget displays a number with LCD-like digits.\raw HTML -
-\endraw -\inlineimage macintosh-label.png -\raw HTML -
-\endraw -The QLabel widget provides a text or image display.\raw HTML -
-\endraw -\raw HTML -

Input Widgets

+\table 100% +\row +\o \image macintosh-groupbox.png + The The QGroupBox widget provides a group box frame with a title. +\o \image macintosh-tabwidget.png + The QTabWidget class provides a stack of tabbed widgets. +\o \image macintosh-frame.png + The QFrame widget provides a simple decorated container for other widgets. +\o \image macintosh-toolbox.png + The QToolBox class provides a column of tabbed widget items. +\endtable - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage macintosh-slider.png -\raw HTML - -\endraw -\inlineimage macintosh-lineedit.png -\raw HTML -
-\endraw -The QSlider widget provides a vertical or horizontal slider.\raw HTML - -\endraw -The QLineEdit widget is a one-line text editor.\raw HTML -
-\endraw -\inlineimage macintosh-combobox.png -\raw HTML - -\endraw -\inlineimage macintosh-doublespinbox.png -\raw HTML -
-\endraw -The QComboBox widget is a combined button and pop-up list.\raw HTML - -\endraw -The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered.\raw HTML -
-\endraw -\inlineimage macintosh-spinbox.png -\raw HTML - -\endraw -\inlineimage macintosh-timeedit.png -\raw HTML -
-\endraw -The QSpinBox class provides a spin box widget.\raw HTML - -\endraw -The QTimeEdit class provides a widget for editing times.\raw HTML -
-\endraw -\inlineimage macintosh-dateedit.png -\raw HTML - -\endraw -\inlineimage macintosh-datetimeedit.png -\raw HTML -
-\endraw -The QDateEdit class provides a widget for editing dates.\raw HTML - -\endraw -The QDateTimeEdit class provides a widget for editing dates and times.\raw HTML -
-\endraw -\inlineimage macintosh-textedit.png -\raw HTML - -\endraw -\inlineimage macintosh-horizontalscrollbar.png -\raw HTML -
-\endraw -The QTextEdit class provides a widget that is used to edit and - display both plain and rich text.\raw HTML - -\endraw -The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation.\raw HTML -
-\endraw -\inlineimage macintosh-dial.png -\raw HTML - -\endraw -\inlineimage macintosh-calendarwidget.png -\raw HTML -
-\endraw -The QDial class provides a rounded range control (like a - speedometer or potentiometer).\raw HTML - -\endraw -The QCalendarWidget class provides a monthly calendar widget that can be used to select dates.\raw HTML -
-\endraw -\inlineimage macintosh-fontcombobox.png -\raw HTML -
-\endraw -The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts.\raw HTML -
-\endraw +\section2 Item Views + +\table 100% +\row +\o \image macintosh-listview.png + The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. +\o \image macintosh-treeview.png + The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. +\o \image macintosh-tableview.png + The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\o +\o +\endtable + +\section2 Display Widgets + +\table 100% +\row +\o \image macintosh-progressbar.png + The QProgressBar widget provides a horizontal progress bar. +\o \image macintosh-label.png + The QLabel widget provides a text or image display. +\o \image macintosh-lcdnumber.png + The QLCDNumber widget displays a number with LCD-like digits. +\endtable + +\section2 Input Widgets + +\table 100% +\row +\o \image macintosh-lineedit.png + The QLineEdit widget is a one-line text editor. +\o \image macintosh-dateedit.png + The QDateEdit class provides a widget for editing dates. +\o \image macintosh-timeedit.png + The QTimeEdit class provides a widget for editing times. +\o \image macintosh-datetimeedit.png + The QDateTimeEdit class provides a widget for editing dates and times. +\endtable + +\table 100% +\row +\o \image macintosh-slider.png + The QSlider widget provides a vertical or horizontal slider. +\o \image macintosh-combobox.png + The QComboBox widget is a combined button and pop-up list. +\o \image macintosh-spinbox.png + The QSpinBox class provides a spin box widget. +\endtable + +\table 100% +\row +\o \image macintosh-fontcombobox.png + The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. +\o \image macintosh-doublespinbox.png + The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. +\o \image macintosh-horizontalscrollbar.png + The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. +\endtable + +\table 100% +\row +\o \image macintosh-dial.png + The QDial class provides a rounded range control (like a speedometer or potentiometer). +\o \image macintosh-textedit.png + The QTextEdit class provides a widget that is used to edit and display both plain and rich text. +\o \image macintosh-calendarwidget.png + The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. +\endtable */ diff --git a/doc/src/widgets-and-layouts/gallery-motif.qdoc b/doc/src/widgets-and-layouts/gallery-motif.qdoc index 861c22a..b9c95c8 100644 --- a/doc/src/widgets-and-layouts/gallery-motif.qdoc +++ b/doc/src/widgets-and-layouts/gallery-motif.qdoc @@ -34,345 +34,105 @@ This page shows some of the widgets available in Qt when configured to use the "motif" style. -\raw HTML -

Buttons

+\section2 Buttons - -- - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage motif-pushbutton.png -\raw HTML - -\endraw -\inlineimage motif-toolbutton.png -\raw HTML -
-\endraw -The QPushButton widget provides a command button.\raw HTML - -\endraw -The QToolButton class provides a quick-access button to commands - or options, usually used inside a QToolBar.\raw HTML -
-\endraw -\inlineimage motif-checkbox.png -\raw HTML - -\endraw -\inlineimage motif-radiobutton.png -\raw HTML -
-\endraw -The QCheckBox widget provides a checkbox with a text label.\raw HTML - -\endraw -The QRadioButton widget provides a radio button with a text or pixmap label.\raw HTML -
-\endraw -\raw HTML -

Containers

+\table 100% +\row +\o \image motif-pushbutton.png + \caption The QPushButton widget provides a command button. +\o \image motif-toolbutton.png + \caption The QToolButton class provides a quick-access button to commands + or options, usually used inside a QToolBar. +\endtable - -- - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage motif-groupbox.png -\raw HTML - -\endraw -\inlineimage motif-tabwidget.png -\raw HTML -
-\endraw -The QGroupBox widget provides a group box frame with a title.\raw HTML - -\endraw -The QTabWidget class provides a stack of tabbed widgets.\raw HTML -
-\endraw -\inlineimage motif-frame.png -\raw HTML - -\endraw -\inlineimage motif-toolbox.png -\raw HTML -
-\endraw -The QFrame widget provides a simple decorated container for other widgets.\raw HTML - -\endraw -The QToolBox class provides a column of tabbed widget items.\raw HTML -
-\endraw -\raw HTML -

Item Views

+\table 100% +\row +\o \image motif-checkbox.png + \caption The QCheckBox widget provides a checkbox with a text label. +\o \image motif-radiobutton.png + \caption The QRadioButton widget provides a radio button with a text or pixmap label. +\endtable - -- - - - - - - - - - - - - - - -
-\endraw -\inlineimage motif-listview.png -\raw HTML - -\endraw -\inlineimage motif-treeview.png -\raw HTML -
-\endraw -The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view.\raw HTML - -\endraw -The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view.\raw HTML -
-\endraw -\inlineimage motif-tableview.png -\raw HTML -
-\endraw -The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\raw HTML -
-\endraw -\raw HTML -

Display Widgets

+\section2 Containers - -- - - - - - - - - - - - - - - -
-\endraw -\inlineimage motif-progressbar.png -\raw HTML - -\endraw -\inlineimage motif-lcdnumber.png -\raw HTML -
-\endraw -The QProgressBar widget provides a horizontal progress bar.\raw HTML - -\endraw -The QLCDNumber widget displays a number with LCD-like digits.\raw HTML -
-\endraw -\inlineimage motif-label.png -\raw HTML -
-\endraw -The QLabel widget provides a text or image display.\raw HTML -
-\endraw -\raw HTML -

Input Widgets

+\table 100% +\row +\o \image motif-groupbox.png + The The QGroupBox widget provides a group box frame with a title. +\o \image motif-tabwidget.png + The QTabWidget class provides a stack of tabbed widgets. +\o \image motif-frame.png + The QFrame widget provides a simple decorated container for other widgets. +\o \image motif-toolbox.png + The QToolBox class provides a column of tabbed widget items. +\endtable - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage motif-slider.png -\raw HTML - -\endraw -\inlineimage motif-lineedit.png -\raw HTML -
-\endraw -The QSlider widget provides a vertical or horizontal slider.\raw HTML - -\endraw -The QLineEdit widget is a one-line text editor.\raw HTML -
-\endraw -\inlineimage motif-combobox.png -\raw HTML - -\endraw -\inlineimage motif-doublespinbox.png -\raw HTML -
-\endraw -The QComboBox widget is a combined button and pop-up list.\raw HTML - -\endraw -The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered.\raw HTML -
-\endraw -\inlineimage motif-spinbox.png -\raw HTML - -\endraw -\inlineimage motif-timeedit.png -\raw HTML -
-\endraw -The QSpinBox class provides a spin box widget.\raw HTML - -\endraw -The QTimeEdit class provides a widget for editing times.\raw HTML -
-\endraw -\inlineimage motif-dateedit.png -\raw HTML - -\endraw -\inlineimage motif-datetimeedit.png -\raw HTML -
-\endraw -The QDateEdit class provides a widget for editing dates.\raw HTML - -\endraw -The QDateTimeEdit class provides a widget for editing dates and times.\raw HTML -
-\endraw -\inlineimage motif-textedit.png -\raw HTML - -\endraw -\inlineimage motif-horizontalscrollbar.png -\raw HTML -
-\endraw -The QTextEdit class provides a widget that is used to edit and - display both plain and rich text.\raw HTML - -\endraw -The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation.\raw HTML -
-\endraw -\inlineimage motif-dial.png -\raw HTML - -\endraw -\inlineimage motif-calendarwidget.png -\raw HTML -
-\endraw -The QDial class provides a rounded range control (like a - speedometer or potentiometer).\raw HTML - -\endraw -The QCalendarWidget class provides a monthly calendar widget that can be used to select dates.\raw HTML -
-\endraw -\inlineimage motif-fontcombobox.png -\raw HTML -
-\endraw -The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts.\raw HTML -
-\endraw +\section2 Item Views + +\table 100% +\row +\o \image motif-listview.png + The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. +\o \image motif-treeview.png + The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. +\o \image motif-tableview.png + The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\o +\o +\endtable + +\section2 Display Widgets + +\table 100% +\row +\o \image motif-progressbar.png + The QProgressBar widget provides a horizontal progress bar. +\o \image motif-label.png + The QLabel widget provides a text or image display. +\o \image motif-lcdnumber.png + The QLCDNumber widget displays a number with LCD-like digits. +\endtable + +\section2 Input Widgets + +\table 100% +\row +\o \image motif-lineedit.png + The QLineEdit widget is a one-line text editor. +\o \image motif-dateedit.png + The QDateEdit class provides a widget for editing dates. +\o \image motif-timeedit.png + The QTimeEdit class provides a widget for editing times. +\o \image motif-datetimeedit.png + The QDateTimeEdit class provides a widget for editing dates and times. +\endtable + +\table 100% +\row +\o \image motif-slider.png + The QSlider widget provides a vertical or horizontal slider. +\o \image motif-combobox.png + The QComboBox widget is a combined button and pop-up list. +\o \image motif-spinbox.png + The QSpinBox class provides a spin box widget. +\endtable + +\table 100% +\row +\o \image motif-fontcombobox.png + The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. +\o \image motif-doublespinbox.png + The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. +\o \image motif-horizontalscrollbar.png + The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. +\endtable + +\table 100% +\row +\o \image motif-dial.png + The QDial class provides a rounded range control (like a speedometer or potentiometer). +\o \image motif-textedit.png + The QTextEdit class provides a widget that is used to edit and display both plain and rich text. +\o \image motif-calendarwidget.png + The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. +\endtable */ diff --git a/doc/src/widgets-and-layouts/gallery-plastique.qdoc b/doc/src/widgets-and-layouts/gallery-plastique.qdoc index 0ea62ee..5f2a1ec 100644 --- a/doc/src/widgets-and-layouts/gallery-plastique.qdoc +++ b/doc/src/widgets-and-layouts/gallery-plastique.qdoc @@ -34,345 +34,105 @@ This page shows some of the widgets available in Qt when configured to use the "plastique" style. -\raw HTML -

Buttons

+\section2 Buttons - -- - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage plastique-pushbutton.png -\raw HTML - -\endraw -\inlineimage plastique-toolbutton.png -\raw HTML -
-\endraw -The QPushButton widget provides a command button.\raw HTML - -\endraw -The QToolButton class provides a quick-access button to commands - or options, usually used inside a QToolBar.\raw HTML -
-\endraw -\inlineimage plastique-checkbox.png -\raw HTML - -\endraw -\inlineimage plastique-radiobutton.png -\raw HTML -
-\endraw -The QCheckBox widget provides a checkbox with a text label.\raw HTML - -\endraw -The QRadioButton widget provides a radio button with a text or pixmap label.\raw HTML -
-\endraw -\raw HTML -

Containers

+\table 100% +\row +\o \image plastique-pushbutton.png + \caption The QPushButton widget provides a command button. +\o \image plastique-toolbutton.png + \caption The QToolButton class provides a quick-access button to commands + or options, usually used inside a QToolBar. +\endtable - -- - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage plastique-groupbox.png -\raw HTML - -\endraw -\inlineimage plastique-tabwidget.png -\raw HTML -
-\endraw -The QGroupBox widget provides a group box frame with a title.\raw HTML - -\endraw -The QTabWidget class provides a stack of tabbed widgets.\raw HTML -
-\endraw -\inlineimage plastique-frame.png -\raw HTML - -\endraw -\inlineimage plastique-toolbox.png -\raw HTML -
-\endraw -The QFrame widget provides a simple decorated container for other widgets.\raw HTML - -\endraw -The QToolBox class provides a column of tabbed widget items.\raw HTML -
-\endraw -\raw HTML -

Item Views

+\table 100% +\row +\o \image plastique-checkbox.png + \caption The QCheckBox widget provides a checkbox with a text label. +\o \image plastique-radiobutton.png + \caption The QRadioButton widget provides a radio button with a text or pixmap label. +\endtable - -- - - - - - - - - - - - - - - -
-\endraw -\inlineimage plastique-listview.png -\raw HTML - -\endraw -\inlineimage plastique-treeview.png -\raw HTML -
-\endraw -The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view.\raw HTML - -\endraw -The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view.\raw HTML -
-\endraw -\inlineimage plastique-tableview.png -\raw HTML -
-\endraw -The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\raw HTML -
-\endraw -\raw HTML -

Display Widgets

+\section2 Containers - -- - - - - - - - - - - - - - - -
-\endraw -\inlineimage plastique-progressbar.png -\raw HTML - -\endraw -\inlineimage plastique-lcdnumber.png -\raw HTML -
-\endraw -The QProgressBar widget provides a horizontal progress bar.\raw HTML - -\endraw -The QLCDNumber widget displays a number with LCD-like digits.\raw HTML -
-\endraw -\inlineimage plastique-label.png -\raw HTML -
-\endraw -The QLabel widget provides a text or image display.\raw HTML -
-\endraw -\raw HTML -

Input Widgets

+\table 100% +\row +\o \image plastique-groupbox.png + The The QGroupBox widget provides a group box frame with a title. +\o \image plastique-tabwidget.png + The QTabWidget class provides a stack of tabbed widgets. +\o \image plastique-frame.png + The QFrame widget provides a simple decorated container for other widgets. +\o \image plastique-toolbox.png + The QToolBox class provides a column of tabbed widget items. +\endtable - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage plastique-slider.png -\raw HTML - -\endraw -\inlineimage plastique-lineedit.png -\raw HTML -
-\endraw -The QSlider widget provides a vertical or horizontal slider.\raw HTML - -\endraw -The QLineEdit widget is a one-line text editor.\raw HTML -
-\endraw -\inlineimage plastique-combobox.png -\raw HTML - -\endraw -\inlineimage plastique-doublespinbox.png -\raw HTML -
-\endraw -The QComboBox widget is a combined button and pop-up list.\raw HTML - -\endraw -The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered.\raw HTML -
-\endraw -\inlineimage plastique-spinbox.png -\raw HTML - -\endraw -\inlineimage plastique-timeedit.png -\raw HTML -
-\endraw -The QSpinBox class provides a spin box widget.\raw HTML - -\endraw -The QTimeEdit class provides a widget for editing times.\raw HTML -
-\endraw -\inlineimage plastique-dateedit.png -\raw HTML - -\endraw -\inlineimage plastique-datetimeedit.png -\raw HTML -
-\endraw -The QDateEdit class provides a widget for editing dates.\raw HTML - -\endraw -The QDateTimeEdit class provides a widget for editing dates and times.\raw HTML -
-\endraw -\inlineimage plastique-textedit.png -\raw HTML - -\endraw -\inlineimage plastique-horizontalscrollbar.png -\raw HTML -
-\endraw -The QTextEdit class provides a widget that is used to edit and - display both plain and rich text.\raw HTML - -\endraw -The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation.\raw HTML -
-\endraw -\inlineimage plastique-dial.png -\raw HTML - -\endraw -\inlineimage plastique-calendarwidget.png -\raw HTML -
-\endraw -The QDial class provides a rounded range control (like a - speedometer or potentiometer).\raw HTML - -\endraw -The QCalendarWidget class provides a monthly calendar widget that can be used to select dates.\raw HTML -
-\endraw -\inlineimage plastique-fontcombobox.png -\raw HTML -
-\endraw -The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts.\raw HTML -
-\endraw +\section2 Item Views + +\table 100% +\row +\o \image plastique-listview.png + The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. +\o \image plastique-treeview.png + The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. +\o \image plastique-tableview.png + The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\o +\o +\endtable + +\section2 Display Widgets + +\table 100% +\row +\o \image plastique-progressbar.png + The QProgressBar widget provides a horizontal progress bar. +\o \image plastique-label.png + The QLabel widget provides a text or image display. +\o \image plastique-lcdnumber.png + The QLCDNumber widget displays a number with LCD-like digits. +\endtable + +\section2 Input Widgets + +\table 100% +\row +\o \image plastique-lineedit.png + The QLineEdit widget is a one-line text editor. +\o \image plastique-dateedit.png + The QDateEdit class provides a widget for editing dates. +\o \image plastique-timeedit.png + The QTimeEdit class provides a widget for editing times. +\o \image plastique-datetimeedit.png + The QDateTimeEdit class provides a widget for editing dates and times. +\endtable + +\table 100% +\row +\o \image plastique-slider.png + The QSlider widget provides a vertical or horizontal slider. +\o \image plastique-combobox.png + The QComboBox widget is a combined button and pop-up list. +\o \image plastique-spinbox.png + The QSpinBox class provides a spin box widget. +\endtable + +\table 100% +\row +\o \image plastique-fontcombobox.png + The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. +\o \image plastique-doublespinbox.png + The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. +\o \image plastique-horizontalscrollbar.png + The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. +\endtable + +\table 100% +\row +\o \image plastique-dial.png + The QDial class provides a rounded range control (like a speedometer or potentiometer). +\o \image plastique-textedit.png + The QTextEdit class provides a widget that is used to edit and display both plain and rich text. +\o \image plastique-calendarwidget.png + The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. +\endtable */ diff --git a/doc/src/widgets-and-layouts/gallery-windows.qdoc b/doc/src/widgets-and-layouts/gallery-windows.qdoc index d3464a0..fe38745 100644 --- a/doc/src/widgets-and-layouts/gallery-windows.qdoc +++ b/doc/src/widgets-and-layouts/gallery-windows.qdoc @@ -34,345 +34,105 @@ This page shows some of the widgets available in Qt when configured to use the "windows" style. -\raw HTML -

Buttons

+\section2 Buttons - -- - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage windows-pushbutton.png -\raw HTML - -\endraw -\inlineimage windows-toolbutton.png -\raw HTML -
-\endraw -The QPushButton widget provides a command button.\raw HTML - -\endraw -The QToolButton class provides a quick-access button to commands - or options, usually used inside a QToolBar.\raw HTML -
-\endraw -\inlineimage windows-checkbox.png -\raw HTML - -\endraw -\inlineimage windows-radiobutton.png -\raw HTML -
-\endraw -The QCheckBox widget provides a checkbox with a text label.\raw HTML - -\endraw -The QRadioButton widget provides a radio button with a text or pixmap label.\raw HTML -
-\endraw -\raw HTML -

Containers

+\table 100% +\row +\o \image windows-pushbutton.png + \caption The QPushButton widget provides a command button. +\o \image windows-toolbutton.png + \caption The QToolButton class provides a quick-access button to commands + or options, usually used inside a QToolBar. +\endtable - -- - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage windows-groupbox.png -\raw HTML - -\endraw -\inlineimage windows-tabwidget.png -\raw HTML -
-\endraw -The QGroupBox widget provides a group box frame with a title.\raw HTML - -\endraw -The QTabWidget class provides a stack of tabbed widgets.\raw HTML -
-\endraw -\inlineimage windows-frame.png -\raw HTML - -\endraw -\inlineimage windows-toolbox.png -\raw HTML -
-\endraw -The QFrame widget provides a simple decorated container for other widgets.\raw HTML - -\endraw -The QToolBox class provides a column of tabbed widget items.\raw HTML -
-\endraw -\raw HTML -

Item Views

+\table 100% +\row +\o \image windows-checkbox.png + \caption The QCheckBox widget provides a checkbox with a text label. +\o \image windows-radiobutton.png + \caption The QRadioButton widget provides a radio button with a text or pixmap label. +\endtable - -- - - - - - - - - - - - - - - -
-\endraw -\inlineimage windows-listview.png -\raw HTML - -\endraw -\inlineimage windows-treeview.png -\raw HTML -
-\endraw -The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view.\raw HTML - -\endraw -The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view.\raw HTML -
-\endraw -\inlineimage windows-tableview.png -\raw HTML -
-\endraw -The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\raw HTML -
-\endraw -\raw HTML -

Display Widgets

+\section2 Containers - -- - - - - - - - - - - - - - - -
-\endraw -\inlineimage windows-progressbar.png -\raw HTML - -\endraw -\inlineimage windows-lcdnumber.png -\raw HTML -
-\endraw -The QProgressBar widget provides a horizontal progress bar.\raw HTML - -\endraw -The QLCDNumber widget displays a number with LCD-like digits.\raw HTML -
-\endraw -\inlineimage windows-label.png -\raw HTML -
-\endraw -The QLabel widget provides a text or image display.\raw HTML -
-\endraw -\raw HTML -

Input Widgets

+\table 100% +\row +\o \image windows-groupbox.png + The The QGroupBox widget provides a group box frame with a title. +\o \image windows-tabwidget.png + The QTabWidget class provides a stack of tabbed widgets. +\o \image windows-frame.png + The QFrame widget provides a simple decorated container for other widgets. +\o \image windows-toolbox.png + The QToolBox class provides a column of tabbed widget items. +\endtable - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage windows-slider.png -\raw HTML - -\endraw -\inlineimage windows-lineedit.png -\raw HTML -
-\endraw -The QSlider widget provides a vertical or horizontal slider.\raw HTML - -\endraw -The QLineEdit widget is a one-line text editor.\raw HTML -
-\endraw -\inlineimage windows-combobox.png -\raw HTML - -\endraw -\inlineimage windows-doublespinbox.png -\raw HTML -
-\endraw -The QComboBox widget is a combined button and pop-up list.\raw HTML - -\endraw -The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered.\raw HTML -
-\endraw -\inlineimage windows-spinbox.png -\raw HTML - -\endraw -\inlineimage windows-timeedit.png -\raw HTML -
-\endraw -The QSpinBox class provides a spin box widget.\raw HTML - -\endraw -The QTimeEdit class provides a widget for editing times.\raw HTML -
-\endraw -\inlineimage windows-dateedit.png -\raw HTML - -\endraw -\inlineimage windows-datetimeedit.png -\raw HTML -
-\endraw -The QDateEdit class provides a widget for editing dates.\raw HTML - -\endraw -The QDateTimeEdit class provides a widget for editing dates and times.\raw HTML -
-\endraw -\inlineimage windows-textedit.png -\raw HTML - -\endraw -\inlineimage windows-horizontalscrollbar.png -\raw HTML -
-\endraw -The QTextEdit class provides a widget that is used to edit and - display both plain and rich text.\raw HTML - -\endraw -The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation.\raw HTML -
-\endraw -\inlineimage windows-dial.png -\raw HTML - -\endraw -\inlineimage windows-calendarwidget.png -\raw HTML -
-\endraw -The QDial class provides a rounded range control (like a - speedometer or potentiometer).\raw HTML - -\endraw -The QCalendarWidget class provides a monthly calendar widget that can be used to select dates.\raw HTML -
-\endraw -\inlineimage windows-fontcombobox.png -\raw HTML -
-\endraw -The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts.\raw HTML -
-\endraw +\section2 Item Views + +\table 100% +\row +\o \image windows-listview.png + The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. +\o \image windows-treeview.png + The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. +\o \image windows-tableview.png + The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\o +\o +\endtable + +\section2 Display Widgets + +\table 100% +\row +\o \image windows-progressbar.png + The QProgressBar widget provides a horizontal progress bar. +\o \image windows-label.png + The QLabel widget provides a text or image display. +\o \image windows-lcdnumber.png + The QLCDNumber widget displays a number with LCD-like digits. +\endtable + +\section2 Input Widgets + +\table 100% +\row +\o \image windows-lineedit.png + The QLineEdit widget is a one-line text editor. +\o \image windows-dateedit.png + The QDateEdit class provides a widget for editing dates. +\o \image windows-timeedit.png + The QTimeEdit class provides a widget for editing times. +\o \image windows-datetimeedit.png + The QDateTimeEdit class provides a widget for editing dates and times. +\endtable + +\table 100% +\row +\o \image windows-slider.png + The QSlider widget provides a vertical or horizontal slider. +\o \image windows-combobox.png + The QComboBox widget is a combined button and pop-up list. +\o \image windows-spinbox.png + The QSpinBox class provides a spin box widget. +\endtable + +\table 100% +\row +\o \image windows-fontcombobox.png + The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. +\o \image windows-doublespinbox.png + The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. +\o \image windows-horizontalscrollbar.png + The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. +\endtable + +\table 100% +\row +\o \image windows-dial.png + The QDial class provides a rounded range control (like a speedometer or potentiometer). +\o \image windows-textedit.png + The QTextEdit class provides a widget that is used to edit and display both plain and rich text. +\o \image windows-calendarwidget.png + The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. +\endtable */ diff --git a/doc/src/widgets-and-layouts/gallery-windowsvista.qdoc b/doc/src/widgets-and-layouts/gallery-windowsvista.qdoc index 00afd52..e017a2c 100644 --- a/doc/src/widgets-and-layouts/gallery-windowsvista.qdoc +++ b/doc/src/widgets-and-layouts/gallery-windowsvista.qdoc @@ -34,345 +34,105 @@ This page shows some of the widgets available in Qt when configured to use the "windowsvista" style. -\raw HTML -

Buttons

+\section2 Buttons - -- - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage windowsvista-pushbutton.png -\raw HTML - -\endraw -\inlineimage windowsvista-toolbutton.png -\raw HTML -
-\endraw -The QPushButton widget provides a command button.\raw HTML - -\endraw -The QToolButton class provides a quick-access button to commands - or options, usually used inside a QToolBar.\raw HTML -
-\endraw -\inlineimage windowsvista-checkbox.png -\raw HTML - -\endraw -\inlineimage windowsvista-radiobutton.png -\raw HTML -
-\endraw -The QCheckBox widget provides a checkbox with a text label.\raw HTML - -\endraw -The QRadioButton widget provides a radio button with a text or pixmap label.\raw HTML -
-\endraw -\raw HTML -

Containers

+\table 100% +\row +\o \image windowsvista-pushbutton.png + \caption The QPushButton widget provides a command button. +\o \image windowsvista-toolbutton.png + \caption The QToolButton class provides a quick-access button to commands + or options, usually used inside a QToolBar. +\endtable - -- - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage windowsvista-groupbox.png -\raw HTML - -\endraw -\inlineimage windowsvista-tabwidget.png -\raw HTML -
-\endraw -The QGroupBox widget provides a group box frame with a title.\raw HTML - -\endraw -The QTabWidget class provides a stack of tabbed widgets.\raw HTML -
-\endraw -\inlineimage windowsvista-frame.png -\raw HTML - -\endraw -\inlineimage windowsvista-toolbox.png -\raw HTML -
-\endraw -The QFrame widget provides a simple decorated container for other widgets.\raw HTML - -\endraw -The QToolBox class provides a column of tabbed widget items.\raw HTML -
-\endraw -\raw HTML -

Item Views

+\table 100% +\row +\o \image windowsvista-checkbox.png + \caption The QCheckBox widget provides a checkbox with a text label. +\o \image windowsvista-radiobutton.png + \caption The QRadioButton widget provides a radio button with a text or pixmap label. +\endtable - -- - - - - - - - - - - - - - - -
-\endraw -\inlineimage windowsvista-listview.png -\raw HTML - -\endraw -\inlineimage windowsvista-treeview.png -\raw HTML -
-\endraw -The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view.\raw HTML - -\endraw -The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view.\raw HTML -
-\endraw -\inlineimage windowsvista-tableview.png -\raw HTML -
-\endraw -The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\raw HTML -
-\endraw -\raw HTML -

Display Widgets

+\section2 Containers - -- - - - - - - - - - - - - - - -
-\endraw -\inlineimage windowsvista-progressbar.png -\raw HTML - -\endraw -\inlineimage windowsvista-lcdnumber.png -\raw HTML -
-\endraw -The QProgressBar widget provides a horizontal progress bar.\raw HTML - -\endraw -The QLCDNumber widget displays a number with LCD-like digits.\raw HTML -
-\endraw -\inlineimage windowsvista-label.png -\raw HTML -
-\endraw -The QLabel widget provides a text or image display.\raw HTML -
-\endraw -\raw HTML -

Input Widgets

+\table 100% +\row +\o \image windowsvista-groupbox.png + The The QGroupBox widget provides a group box frame with a title. +\o \image windowsvista-tabwidget.png + The QTabWidget class provides a stack of tabbed widgets. +\o \image windowsvista-frame.png + The QFrame widget provides a simple decorated container for other widgets. +\o \image windowsvista-toolbox.png + The QToolBox class provides a column of tabbed widget items. +\endtable - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage windowsvista-slider.png -\raw HTML - -\endraw -\inlineimage windowsvista-lineedit.png -\raw HTML -
-\endraw -The QSlider widget provides a vertical or horizontal slider.\raw HTML - -\endraw -The QLineEdit widget is a one-line text editor.\raw HTML -
-\endraw -\inlineimage windowsvista-combobox.png -\raw HTML - -\endraw -\inlineimage windowsvista-doublespinbox.png -\raw HTML -
-\endraw -The QComboBox widget is a combined button and pop-up list.\raw HTML - -\endraw -The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered.\raw HTML -
-\endraw -\inlineimage windowsvista-spinbox.png -\raw HTML - -\endraw -\inlineimage windowsvista-timeedit.png -\raw HTML -
-\endraw -The QSpinBox class provides a spin box widget.\raw HTML - -\endraw -The QTimeEdit class provides a widget for editing times.\raw HTML -
-\endraw -\inlineimage windowsvista-dateedit.png -\raw HTML - -\endraw -\inlineimage windowsvista-datetimeedit.png -\raw HTML -
-\endraw -The QDateEdit class provides a widget for editing dates.\raw HTML - -\endraw -The QDateTimeEdit class provides a widget for editing dates and times.\raw HTML -
-\endraw -\inlineimage windowsvista-textedit.png -\raw HTML - -\endraw -\inlineimage windowsvista-horizontalscrollbar.png -\raw HTML -
-\endraw -The QTextEdit class provides a widget that is used to edit and - display both plain and rich text.\raw HTML - -\endraw -The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation.\raw HTML -
-\endraw -\inlineimage windowsvista-dial.png -\raw HTML - -\endraw -\inlineimage windowsvista-calendarwidget.png -\raw HTML -
-\endraw -The QDial class provides a rounded range control (like a - speedometer or potentiometer).\raw HTML - -\endraw -The QCalendarWidget class provides a monthly calendar widget that can be used to select dates.\raw HTML -
-\endraw -\inlineimage windowsvista-fontcombobox.png -\raw HTML -
-\endraw -The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts.\raw HTML -
-\endraw +\section2 Item Views + +\table 100% +\row +\o \image windowsvista-listview.png + The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. +\o \image windowsvista-treeview.png + The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. +\o \image windowsvista-tableview.png + The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\o +\o +\endtable + +\section2 Display Widgets + +\table 100% +\row +\o \image windowsvista-progressbar.png + The QProgressBar widget provides a horizontal progress bar. +\o \image windowsvista-label.png + The QLabel widget provides a text or image display. +\o \image windowsvista-lcdnumber.png + The QLCDNumber widget displays a number with LCD-like digits. +\endtable + +\section2 Input Widgets + +\table 100% +\row +\o \image windowsvista-lineedit.png + The QLineEdit widget is a one-line text editor. +\o \image windowsvista-dateedit.png + The QDateEdit class provides a widget for editing dates. +\o \image windowsvista-timeedit.png + The QTimeEdit class provides a widget for editing times. +\o \image windowsvista-datetimeedit.png + The QDateTimeEdit class provides a widget for editing dates and times. +\endtable + +\table 100% +\row +\o \image windowsvista-slider.png + The QSlider widget provides a vertical or horizontal slider. +\o \image windowsvista-combobox.png + The QComboBox widget is a combined button and pop-up list. +\o \image windowsvista-spinbox.png + The QSpinBox class provides a spin box widget. +\endtable + +\table 100% +\row +\o \image windowsvista-fontcombobox.png + The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. +\o \image windowsvista-doublespinbox.png + The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. +\o \image windowsvista-horizontalscrollbar.png + The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. +\endtable + +\table 100% +\row +\o \image windowsvista-dial.png + The QDial class provides a rounded range control (like a speedometer or potentiometer). +\o \image windowsvista-textedit.png + The QTextEdit class provides a widget that is used to edit and display both plain and rich text. +\o \image windowsvista-calendarwidget.png + The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. +\endtable */ diff --git a/doc/src/widgets-and-layouts/gallery-windowsxp.qdoc b/doc/src/widgets-and-layouts/gallery-windowsxp.qdoc index 60c8ff0..f3c53ee 100644 --- a/doc/src/widgets-and-layouts/gallery-windowsxp.qdoc +++ b/doc/src/widgets-and-layouts/gallery-windowsxp.qdoc @@ -34,345 +34,105 @@ This page shows some of the widgets available in Qt when configured to use the "windowsxp" style. -\raw HTML -

Buttons

+\section2 Buttons - -- - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage windowsxp-pushbutton.png -\raw HTML - -\endraw -\inlineimage windowsxp-toolbutton.png -\raw HTML -
-\endraw -The QPushButton widget provides a command button.\raw HTML - -\endraw -The QToolButton class provides a quick-access button to commands - or options, usually used inside a QToolBar.\raw HTML -
-\endraw -\inlineimage windowsxp-checkbox.png -\raw HTML - -\endraw -\inlineimage windowsxp-radiobutton.png -\raw HTML -
-\endraw -The QCheckBox widget provides a checkbox with a text label.\raw HTML - -\endraw -The QRadioButton widget provides a radio button with a text or pixmap label.\raw HTML -
-\endraw -\raw HTML -

Containers

+\table 100% +\row +\o \image windowsxp-pushbutton.png + \caption The QPushButton widget provides a command button. +\o \image windowsxp-toolbutton.png + \caption The QToolButton class provides a quick-access button to commands + or options, usually used inside a QToolBar. +\endtable - -- - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage windowsxp-groupbox.png -\raw HTML - -\endraw -\inlineimage windowsxp-tabwidget.png -\raw HTML -
-\endraw -The QGroupBox widget provides a group box frame with a title.\raw HTML - -\endraw -The QTabWidget class provides a stack of tabbed widgets.\raw HTML -
-\endraw -\inlineimage windowsxp-frame.png -\raw HTML - -\endraw -\inlineimage windowsxp-toolbox.png -\raw HTML -
-\endraw -The QFrame widget provides a simple decorated container for other widgets.\raw HTML - -\endraw -The QToolBox class provides a column of tabbed widget items.\raw HTML -
-\endraw -\raw HTML -

Item Views

+\table 100% +\row +\o \image windowsxp-checkbox.png + \caption The QCheckBox widget provides a checkbox with a text label. +\o \image windowsxp-radiobutton.png + \caption The QRadioButton widget provides a radio button with a text or pixmap label. +\endtable - -- - - - - - - - - - - - - - - -
-\endraw -\inlineimage windowsxp-listview.png -\raw HTML - -\endraw -\inlineimage windowsxp-treeview.png -\raw HTML -
-\endraw -The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view.\raw HTML - -\endraw -The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view.\raw HTML -
-\endraw -\inlineimage windowsxp-tableview.png -\raw HTML -
-\endraw -The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\raw HTML -
-\endraw -\raw HTML -

Display Widgets

+\section2 Containers - -- - - - - - - - - - - - - - - -
-\endraw -\inlineimage windowsxp-progressbar.png -\raw HTML - -\endraw -\inlineimage windowsxp-lcdnumber.png -\raw HTML -
-\endraw -The QProgressBar widget provides a horizontal progress bar.\raw HTML - -\endraw -The QLCDNumber widget displays a number with LCD-like digits.\raw HTML -
-\endraw -\inlineimage windowsxp-label.png -\raw HTML -
-\endraw -The QLabel widget provides a text or image display.\raw HTML -
-\endraw -\raw HTML -

Input Widgets

+\table 100% +\row +\o \image windowsxp-groupbox.png + The The QGroupBox widget provides a group box frame with a title. +\o \image windowsxp-tabwidget.png + The QTabWidget class provides a stack of tabbed widgets. +\o \image windowsxp-frame.png + The QFrame widget provides a simple decorated container for other widgets. +\o \image windowsxp-toolbox.png + The QToolBox class provides a column of tabbed widget items. +\endtable - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-\endraw -\inlineimage windowsxp-slider.png -\raw HTML - -\endraw -\inlineimage windowsxp-lineedit.png -\raw HTML -
-\endraw -The QSlider widget provides a vertical or horizontal slider.\raw HTML - -\endraw -The QLineEdit widget is a one-line text editor.\raw HTML -
-\endraw -\inlineimage windowsxp-combobox.png -\raw HTML - -\endraw -\inlineimage windowsxp-doublespinbox.png -\raw HTML -
-\endraw -The QComboBox widget is a combined button and pop-up list.\raw HTML - -\endraw -The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered.\raw HTML -
-\endraw -\inlineimage windowsxp-spinbox.png -\raw HTML - -\endraw -\inlineimage windowsxp-timeedit.png -\raw HTML -
-\endraw -The QSpinBox class provides a spin box widget.\raw HTML - -\endraw -The QTimeEdit class provides a widget for editing times.\raw HTML -
-\endraw -\inlineimage windowsxp-dateedit.png -\raw HTML - -\endraw -\inlineimage windowsxp-datetimeedit.png -\raw HTML -
-\endraw -The QDateEdit class provides a widget for editing dates.\raw HTML - -\endraw -The QDateTimeEdit class provides a widget for editing dates and times.\raw HTML -
-\endraw -\inlineimage windowsxp-textedit.png -\raw HTML - -\endraw -\inlineimage windowsxp-horizontalscrollbar.png -\raw HTML -
-\endraw -The QTextEdit class provides a widget that is used to edit and - display both plain and rich text.\raw HTML - -\endraw -The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation.\raw HTML -
-\endraw -\inlineimage windowsxp-dial.png -\raw HTML - -\endraw -\inlineimage windowsxp-calendarwidget.png -\raw HTML -
-\endraw -The QDial class provides a rounded range control (like a - speedometer or potentiometer).\raw HTML - -\endraw -The QCalendarWidget class provides a monthly calendar widget that can be used to select dates.\raw HTML -
-\endraw -\inlineimage windowsxp-fontcombobox.png -\raw HTML -
-\endraw -The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts.\raw HTML -
-\endraw +\section2 Item Views + +\table 100% +\row +\o \image windowsxp-listview.png + The QListView class provides a default model/view implementation of a list/icon view. The QListWidget class provides a classic item-based list/icon view. +\o \image windowsxp-treeview.png + The QTreeView class provides a default model/view implementation of a tree view. The QTreeWidget class provides a classic item-based tree view. +\o \image windowsxp-tableview.png + The QTableView class provides a default model/view implementation of a table view. The QTableWidget class provides a classic item-based table view.\o +\o +\endtable + +\section2 Display Widgets + +\table 100% +\row +\o \image windowsxp-progressbar.png + The QProgressBar widget provides a horizontal progress bar. +\o \image windowsxp-label.png + The QLabel widget provides a text or image display. +\o \image windowsxp-lcdnumber.png + The QLCDNumber widget displays a number with LCD-like digits. +\endtable + +\section2 Input Widgets + +\table 100% +\row +\o \image windowsxp-lineedit.png + The QLineEdit widget is a one-line text editor. +\o \image windowsxp-dateedit.png + The QDateEdit class provides a widget for editing dates. +\o \image windowsxp-timeedit.png + The QTimeEdit class provides a widget for editing times. +\o \image windowsxp-datetimeedit.png + The QDateTimeEdit class provides a widget for editing dates and times. +\endtable + +\table 100% +\row +\o \image windowsxp-slider.png + The QSlider widget provides a vertical or horizontal slider. +\o \image windowsxp-combobox.png + The QComboBox widget is a combined button and pop-up list. +\o \image windowsxp-spinbox.png + The QSpinBox class provides a spin box widget. +\endtable + +\table 100% +\row +\o \image windowsxp-fontcombobox.png + The QFontComboBox widget is a specialized combobox that enables fonts to be selected from a pop-up list containing previews of available fonts. +\o \image windowsxp-doublespinbox.png + The QDoubleSpinBox class provides a spin box widget that allows double precision floating point numbers to be entered. +\o \image windowsxp-horizontalscrollbar.png + The QScrollBar widget provides a vertical or horizontal scroll bar. Here, we show a scroll bar with horizontal orientation. +\endtable + +\table 100% +\row +\o \image windowsxp-dial.png + The QDial class provides a rounded range control (like a speedometer or potentiometer). +\o \image windowsxp-textedit.png + The QTextEdit class provides a widget that is used to edit and display both plain and rich text. +\o \image windowsxp-calendarwidget.png + The QCalendarWidget class provides a monthly calendar widget that can be used to select dates. +\endtable */ -- cgit v0.12 From 21fd6c0d818f3f4a3efa8904c8ddbfeb3a1e931d Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 13 Dec 2010 12:25:54 +0100 Subject: doc: Replaced some \raw and \endraw uses with \table and \endtable In DITA XML, there is no straightforward way to translate raw html into DITA XML, because the XML stream writer automagically escapes all the raw html elements. So I am beginning to replace uses of the \raw command with \table, which gets output correctly. The problem is the XML stream writer must see each XML element start and end, because it keeps them on a stack. When you output XML elements with the writeCharacters() function, it escapes the '<' and '>' of any XML elements the character string contains. --- doc/src/widgets-and-layouts/gallery.qdoc | 112 +++++++++---------------------- 1 file changed, 30 insertions(+), 82 deletions(-) diff --git a/doc/src/widgets-and-layouts/gallery.qdoc b/doc/src/widgets-and-layouts/gallery.qdoc index 201817b..d11d9c8 100644 --- a/doc/src/widgets-and-layouts/gallery.qdoc +++ b/doc/src/widgets-and-layouts/gallery.qdoc @@ -34,103 +34,51 @@ with the native desktop enviroment. Below, you can find links to the various widget styles that are supplied with Qt 4. - \raw HTML - - - - - - - - - - - - - - - - - - - - - - - - -
- \endraw - \image plastique-tabwidget.png Plastique Style Widget Gallery - - \bold{\l{Plastique Style Widget Gallery}} + \table + \row + \o \image plastique-tabwidget.png Plastique Style Widget Gallery + \caption \l{Plastique Style Widget Gallery} The Plastique style is provided by QPlastiqueStyle. - \raw HTML - - \endraw - \image windowsxp-tabwidget.png Windows XP Style Widget Gallery - - \bold{\l{Windows XP Style Widget Gallery}} + \o \image windowsxp-tabwidget.png Windows XP Style Widget Gallery + \caption \l{Windows XP Style Widget Gallery} The Windows XP style is provided by QWindowsXPStyle. - \raw HTML -
- \endraw - \image gtk-tabwidget.png GTK Style Widget Gallery + \o \image windows-tabwidget.png Windows Style Widget Gallery + \caption \l{Windows Style Widget Gallery} - \bold{\l{GTK Style Widget Gallery}} - - The GTK style is provided by QGtkStyle. - \raw HTML - - \endraw - \image macintosh-tabwidget.png Macintosh Style Widget Gallery + The Windows style is provided by QWindowsStyle. + \endtable - \bold{\l{Macintosh Style Widget Gallery}} + \table + \row + \o \image macintosh-tabwidget.png Macintosh Style Widget Gallery + \caption \l{Macintosh Style Widget Gallery} The Macintosh style is provided by QMacStyle. - \raw HTML -
- \endraw - \image cleanlooks-tabwidget.png Cleanlooks Style Widget Gallery - - \bold{\l{Cleanlooks Style Widget Gallery}} + \o \image cleanlooks-tabwidget.png Cleanlooks Style Widget Gallery + \caption \l{Cleanlooks Style Widget Gallery} The Cleanlooks style is provided by QCleanlooksStyle. - \raw HTML - - \endraw - \image windowsvista-tabwidget.png Windows Vista Style Widget Gallery - - \bold{\l{Windows Vista Style Widget Gallery}} + \o \image windowsvista-tabwidget.png Windows Vista Style Widget Gallery + \caption \l{Windows Vista Style Widget Gallery} The Windows Vista style is provided by QWindowsVistaStyle. - \raw HTML -
- \endraw - \image motif-tabwidget.png Motif Style Widget Gallery + \endtable - \bold{\l{Motif Style Widget Gallery}} + \table + \row + \o \image gtk-tabwidget.png GTK Style Widget Gallery + \caption \l{GTK Style Widget Gallery} - The Motif style is provided by QMotifStyle. - \raw HTML - - \endraw - \image windows-tabwidget.png Windows Style Widget Gallery - - \bold{\l{Windows Style Widget Gallery}} - - The Windows style is provided by QWindowsStyle. - \raw HTML -
- \endraw - \image cde-tabwidget.png CDE Style Widget Gallery + The GTK style is provided by QGtkStyle. + \o \image motif-tabwidget.png Motif Style Widget Gallery + \caption \l{Motif Style Widget Gallery} - \bold{\l{CDE Style Widget Gallery}} + The Motif style is provided by QMotifStyle. + \o \image cde-tabwidget.png CDE Style Widget Gallery + \caption \l{CDE Style Widget Gallery} The Common Desktop Environment style is provided by QCDEStyle. - \raw HTML -
- \endraw + \endtable */ -- cgit v0.12 From 7ee2e9fd873b2c38a1a362170c4a0e4754cfd22a Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Mon, 18 Oct 2010 09:28:14 +0200 Subject: Cocoa: native child filedialogs sometimes shows non-native on screen The reason is that we make all child dialogs of a modal dialogs non-modaly shaddowed, as documented. But we forgot to check if a window is actually visible before raising it to front. Also adding harmless auto release pool Rev-By: prasanth --- src/gui/kernel/qeventdispatcher_mac.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qeventdispatcher_mac.mm b/src/gui/kernel/qeventdispatcher_mac.mm index 515c6d3..dc926e0 100644 --- a/src/gui/kernel/qeventdispatcher_mac.mm +++ b/src/gui/kernel/qeventdispatcher_mac.mm @@ -844,7 +844,7 @@ static void setChildrenWorksWhenModal(QWidget *widget, bool worksWhenModal) NSWindow *window = qt_mac_window_for(dialogs[i]); if (window && [window isKindOfClass:[NSPanel class]]) { [static_cast(window) setWorksWhenModal:worksWhenModal]; - if (worksWhenModal && dialogs[i]->isVisible()){ + if (worksWhenModal && [window isVisible]){ [window orderFront:window]; } } @@ -856,6 +856,7 @@ void QEventDispatcherMacPrivate::updateChildrenWorksWhenModal() // Make the dialog children of the widget // active. And make the dialog children of // the previous modal dialog unactive again: + QMacCocoaAutoReleasePool pool; int size = cocoaModalSessionStack.size(); if (size > 0){ if (QWidget *prevModal = cocoaModalSessionStack[size-1].widget) -- cgit v0.12 From a04b19d34c23df5bb6e4f499b6b12c7a1211969a Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Mon, 18 Oct 2010 15:27:02 +0200 Subject: Cocoa: make sure stays on top child windows are not levelled down [NSWindow addChild] levels the child to the level of the parent. In Qt we do not want this. So we do a check after setting up the parent-child relationship for this. Reviewed-by: cduclos --- src/gui/kernel/qwidget_mac.mm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 997419b..08af3ac 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -2822,8 +2822,12 @@ void QWidgetPrivate::setSubWindowStacking(bool set) if (NSWindow *pwin = [qt_mac_nativeview_for(parent) window]) { if (set) { Qt::WindowType ptype = parent->window()->windowType(); - if ([pwin isVisible] && (ptype == Qt::Window || ptype == Qt::Dialog) && ![qwin parentWindow]) + if ([pwin isVisible] && (ptype == Qt::Window || ptype == Qt::Dialog) && ![qwin parentWindow]) { + NSInteger level = [qwin level]; [pwin addChildWindow:qwin ordered:NSWindowAbove]; + if ([qwin level] < level) + [qwin setLevel:level]; + } } else { [pwin removeChildWindow:qwin]; } @@ -2837,8 +2841,12 @@ void QWidgetPrivate::setSubWindowStacking(bool set) if (NSWindow *cwin = [qt_mac_nativeview_for(child) window]) { if (set) { Qt::WindowType ctype = child->window()->windowType(); - if ([cwin isVisible] && (ctype == Qt::Window || ctype == Qt::Dialog) && ![cwin parentWindow]) + if ([cwin isVisible] && (ctype == Qt::Window || ctype == Qt::Dialog) && ![cwin parentWindow]) { + NSInteger level = [cwin level]; [qwin addChildWindow:cwin ordered:NSWindowAbove]; + if ([cwin level] < level) + [cwin setLevel:level]; + } } else { [qwin removeChildWindow:qt_mac_window_for(child)]; } -- cgit v0.12 From 19148694b1e094ad968e26e6fab448d3d2c7f4d4 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Mon, 18 Oct 2010 15:30:12 +0200 Subject: Cocoa: cannot use staysOnTop flag for native file dialogs We cannot mix staysOnTop and native file dialogs, since Cocoa will anyway set it back to NSModalPanelWindowLevel when running it app modal. There are ways to work around this issue, but the file dialog also has a button for showing a "create directory" modal panel, and this we cannot control. Reviewed-by: cduclos --- src/gui/dialogs/qfiledialog_mac.mm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gui/dialogs/qfiledialog_mac.mm b/src/gui/dialogs/qfiledialog_mac.mm index 87850a7..1e13113 100644 --- a/src/gui/dialogs/qfiledialog_mac.mm +++ b/src/gui/dialogs/qfiledialog_mac.mm @@ -719,6 +719,14 @@ bool QFileDialogPrivate::setVisible_sys(bool visible) if (!visible == q->isHidden()) return false; + if (q->windowFlags() & Qt::WindowStaysOnTopHint) { + // The native file dialog tries all it can to stay + // on the NSModalPanel level. And it might also show + // its own "create directory" dialog that we cannot control. + // So we need to use the non-native version in this case... + return false; + } + #ifndef QT_MAC_USE_COCOA return visible ? showCarbonNavServicesDialog() : hideCarbonNavServicesDialog(); #else -- cgit v0.12 From 3e2cb226277998a7841c85048493c89bc1ccc95f Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Mon, 18 Oct 2010 16:12:46 +0200 Subject: Cocoa: Fix addChildWindow bug where we connect a grandparent to a child A plain bug where we ask for a list of widgets, but forget that qFindChildren is recursive, which is not what we want. Reviewed-by: jbache --- src/gui/kernel/qwidget_mac.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 08af3ac..b89cb88 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -2834,9 +2834,9 @@ void QWidgetPrivate::setSubWindowStacking(bool set) } } - QList widgets = q->findChildren(); + QObjectList widgets = q->children(); for (int i=0; i(widgets.at(i)); if (child && child->isWindow()) { if (NSWindow *cwin = [qt_mac_nativeview_for(child) window]) { if (set) { -- cgit v0.12 From 780b4d84205f16c46f6c5e85e6c1925beb4e4dba Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Mon, 22 Nov 2010 11:08:34 +0100 Subject: Cocoa: combobox does not hightlight when mouse re-hovers the first item The reason is that on Mac, the highlight is supposed to switch off when the mouse moves out of the drop down menu. On X11, it stays. So there is a separate code path for this in qcombobox.cpp. But it fails to clear the index set in the view when the mouse leaves, which stops the item from re-highligh when the mouse re-enters. Reviewed-by: ogoffart --- 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 7859bdc..5a4e507 100644 --- a/src/gui/widgets/qcombobox.cpp +++ b/src/gui/widgets/qcombobox.cpp @@ -398,7 +398,7 @@ void QComboBoxPrivateContainer::leaveEvent(QEvent *) #ifdef Q_WS_MAC QStyleOptionComboBox opt = comboStyleOption(); if (combo->style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, combo)) - view->clearSelection(); + view->setCurrentIndex(QModelIndex()); #endif } -- cgit v0.12 From d9004ddf237a09f3b7f25128ceb83a0e79e7b1aa Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Mon, 13 Dec 2010 13:39:34 +0100 Subject: Cocoa: popup hides behind window Reason: when cocoa receives a mouse press/release in a window, it finds the correct view inside that window and sends the mouse event to it. But NSWindow also does some other stuff just before sending the event, like raise and lower windows. So when we override sendEvent, and more over, do not call [super sendEvent], we stop this raise/lower etc from working. So, to make this work again, I partially revert change 0b2eab87ad3bd73a0744469a45c29ca098649c9b Task-number: QTBUG-15638, QTBUG-1517 Reviewed-by: Fabien Freling --- src/gui/kernel/qcocoasharedwindowmethods_mac_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h index ddf1a27..1e2e71b 100644 --- a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h +++ b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h @@ -182,7 +182,7 @@ QT_END_NAMESPACE bool handled = false; // sometimes need to redirect mouse events to the popup. QWidget *popup = qAppInstance()->activePopupWidget(); - if (popup) { + if (popup && popup != widget) { switch([event type]) { case NSLeftMouseDown: -- cgit v0.12 From 69ed34d2aa77a3bacc7f66797baa514f35358b7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 13 Dec 2010 14:21:39 +0100 Subject: Fixed GL 2 engine rendering of images / pixmaps above max texture size. Down-scale images or pixmaps that are above the max texture size. Not optimal performance-wise, but better than failing. Task-number: QTBUG-16033 Reviewed-by: Eskil Abrahamsen Blomfeldt --- .../gl2paintengineex/qpaintengineex_opengl2.cpp | 52 +++++++++++++++++++--- .../gl2paintengineex/qpaintengineex_opengl2_p.h | 2 + 2 files changed, 49 insertions(+), 5 deletions(-) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 4a64f39..668a3f0 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -163,6 +163,8 @@ void QGL2PaintEngineExPrivate::setBrush(const QBrush& brush) Q_ASSERT(newStyle != Qt::NoBrush); currentBrush = brush; + if (!currentBrushPixmap.isNull()) + currentBrushPixmap = QPixmap(); brushUniformsDirty = true; // All brushes have at least one uniform if (newStyle > Qt::SolidPattern) @@ -221,10 +223,14 @@ void QGL2PaintEngineExPrivate::updateBrushTexture() updateTextureFilter(GL_TEXTURE_2D, GL_CLAMP_TO_EDGE, q->state()->renderHints & QPainter::SmoothPixmapTransform); } else if (style == Qt::TexturePattern) { - const QPixmap& texPixmap = currentBrush.texture(); + currentBrushPixmap = currentBrush.texture(); + + int max_texture_size = ctx->d_func()->maxTextureSize(); + if (currentBrushPixmap.width() > max_texture_size || currentBrushPixmap.height() > max_texture_size) + currentBrushPixmap = currentBrushPixmap.scaled(max_texture_size, max_texture_size, Qt::KeepAspectRatio); glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT); - QGLTexture *tex = ctx->d_func()->bindTexture(texPixmap, GL_TEXTURE_2D, GL_RGBA, + QGLTexture *tex = ctx->d_func()->bindTexture(currentBrushPixmap, GL_TEXTURE_2D, GL_RGBA, QGLContext::InternalBindOption | QGLContext::CanFlipNativePixmapBindOption); updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform); @@ -1305,13 +1311,30 @@ void QGL2PaintEngineEx::transformChanged() } +static const QRectF scaleRect(const QRectF &r, qreal sx, qreal sy) +{ + return QRectF(r.x() * sx, r.y() * sy, r.width() * sx, r.height() * sy); +} + void QGL2PaintEngineEx::drawPixmap(const QRectF& dest, const QPixmap & pixmap, const QRectF & src) { Q_D(QGL2PaintEngineEx); + QGLContext *ctx = d->ctx; + + int max_texture_size = ctx->d_func()->maxTextureSize(); + if (pixmap.width() > max_texture_size || pixmap.height() > max_texture_size) { + QPixmap scaled = pixmap.scaled(max_texture_size, max_texture_size, Qt::KeepAspectRatio); + + const qreal sx = scaled.width() / qreal(pixmap.width()); + const qreal sy = scaled.height() / qreal(pixmap.height()); + + drawPixmap(dest, scaled, scaleRect(src, sx, sy)); + return; + } + ensureActive(); d->transferMode(ImageDrawingMode); - QGLContext *ctx = d->ctx; glActiveTexture(GL_TEXTURE0 + QT_IMAGE_TEXTURE_UNIT); QGLTexture *texture = ctx->d_func()->bindTexture(pixmap, GL_TEXTURE_2D, GL_RGBA, @@ -1334,11 +1357,24 @@ void QGL2PaintEngineEx::drawImage(const QRectF& dest, const QImage& image, const Qt::ImageConversionFlags) { Q_D(QGL2PaintEngineEx); + QGLContext *ctx = d->ctx; + + int max_texture_size = ctx->d_func()->maxTextureSize(); + if (image.width() > max_texture_size || image.height() > max_texture_size) { + QImage scaled = image.scaled(max_texture_size, max_texture_size, Qt::KeepAspectRatio); + + const qreal sx = scaled.width() / qreal(image.width()); + const qreal sy = scaled.height() / qreal(image.height()); + + drawImage(dest, scaled, scaleRect(src, sx, sy)); + return; + } + ensureActive(); d->transferMode(ImageDrawingMode); - QGLContext *ctx = d->ctx; glActiveTexture(GL_TEXTURE0 + QT_IMAGE_TEXTURE_UNIT); + QGLTexture *texture = ctx->d_func()->bindTexture(image, GL_TEXTURE_2D, GL_RGBA, QGLContext::InternalBindOption); GLuint id = texture->id; @@ -1737,7 +1773,13 @@ void QGL2PaintEngineEx::drawPixmapFragments(const QPainter::PixmapFragment *frag } ensureActive(); - d->drawPixmapFragments(fragments, fragmentCount, pixmap, hints); + int max_texture_size = d->ctx->d_func()->maxTextureSize(); + if (pixmap.width() > max_texture_size || pixmap.height() > max_texture_size) { + QPixmap scaled = pixmap.scaled(max_texture_size, max_texture_size, Qt::KeepAspectRatio); + d->drawPixmapFragments(fragments, fragmentCount, scaled, hints); + } else { + d->drawPixmapFragments(fragments, fragmentCount, pixmap, hints); + } } diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h index b255e75..02b737b 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -274,6 +274,8 @@ public: QBrush currentBrush; // May not be the state's brush! const QBrush noBrush; + QPixmap currentBrushPixmap; + QGL2PEXVertexArray vertexCoordinateArray; QGL2PEXVertexArray textureCoordinateArray; QVector elementIndices; -- cgit v0.12 From 0af1f5508e165f3b494ab236cb1cdf1b0edcffa5 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 13 Dec 2010 11:29:22 +0100 Subject: Fixes text jitter in QtQuick components when using the virtual keyboard QGraphicsView::mapFromScene() returns a QRect instead of a QRectF. Thus, we were prematurely rounding the micro focus rectangle coordinates in QGraphicsView::inputMethodQuery(). (The Qt::ImMicroFocus query returns a QRectF from QGraphicsScene, which is the result of querying QDeclarativeTextEdit and mapping it to the scene.) Auto-test included. Reviewed-by: leo Reviewed-by: bnilsen Task-number: QTCOMPONENTS-288 Task-number: QTBUG-16063 --- src/gui/graphicsview/qgraphicsview.cpp | 2 +- tests/auto/qgraphicsview/tst_qgraphicsview.cpp | 39 ++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index a566c8e..2acea8a 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -2494,7 +2494,7 @@ QVariant QGraphicsView::inputMethodQuery(Qt::InputMethodQuery query) const QVariant value = d->scene->inputMethodQuery(query); if (value.type() == QVariant::RectF) - value = mapFromScene(value.toRectF()).boundingRect(); + value = d->mapRectFromScene(value.toRectF()); else if (value.type() == QVariant::PointF) value = mapFromScene(value.toPointF()); else if (value.type() == QVariant::Rect) diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index 0a9633f..e1fbaee 100644 --- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp @@ -246,6 +246,7 @@ private slots: void QTBUG_4151_clipAndIgnore(); void QTBUG_5859_exposedRect(); void QTBUG_7438_cursor(); + void QTBUG_16063_microFocusRect(); public slots: void dummySlot() {} @@ -4450,5 +4451,43 @@ void tst_QGraphicsView::QTBUG_7438_cursor() #endif } +class IMItem : public QGraphicsRectItem +{ +public: + IMItem(QGraphicsItem *parent = 0): + QGraphicsRectItem(mf.adjusted(-5, -5, 5, 5), parent) + { + setFlag(QGraphicsItem::ItemIsFocusable, true); + setFlag(QGraphicsItem::ItemAcceptsInputMethod, true); + } + + QVariant inputMethodQuery(Qt::InputMethodQuery query) const + { + return mf; + } + + static QRectF mf; +}; + +QRectF IMItem::mf(1.5, 1.6, 10, 10); + +void tst_QGraphicsView::QTBUG_16063_microFocusRect() +{ + QGraphicsScene scene; + IMItem *item = new IMItem(); + scene.addItem(item); + + QGraphicsView view(&scene); + + view.setFixedSize(40, 40); + view.show(); + QTest::qWaitForWindowShown(&view); + + scene.setFocusItem(item); + view.setFocus(); + QRectF mfv = view.inputMethodQuery(Qt::ImMicroFocus).toRectF(); + QCOMPARE(mfv, QRectF(13.5, 13.6, 10, 10)); +} + QTEST_MAIN(tst_QGraphicsView) #include "tst_qgraphicsview.moc" -- cgit v0.12 From d5fe82b2ab939727f573429605abd99c039a99d1 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 13 Dec 2010 15:41:16 +0200 Subject: Fix crash when creating more than one QApplication in single test case CBA pointer is stored in static variable and it wasn't cleaned up properly at QApplication destruction, which led to crash. Task-number: QTBUG-15915 Reviewed-by: Sami Merila Reviewed-by: Janne Koskinen --- src/gui/kernel/qapplication_s60.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 8596563..81fa4e6 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1633,6 +1633,13 @@ void qt_cleanup() //Change mouse pointer back S60->wsSession().SetPointerCursorMode(EPointerCursorNone); +#ifdef Q_WS_S60 + // Clear CBA + CEikonEnv::Static()->AppUiFactory()->SwapButtonGroup(0); + delete S60->buttonGroupContainer(); + S60->setButtonGroupContainer(0); +#endif + if (S60->qtOwnsS60Environment) { // Restore the S60 framework trap handler. See qt_init(). User::SetTrapHandler(S60->s60InstalledTrapHandler); -- cgit v0.12 From 50d3c15bd16f4e70327f8de30c8c0df5ed2f995c Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 13 Dec 2010 16:08:36 +0200 Subject: Minor optimization Use already defined factory pointer instead of re-asking it twice. Reviewed-by: Janne Koskinen --- src/gui/kernel/qwidget_s60.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 609307c..d6ad3c3 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -504,7 +504,7 @@ void QWidgetPrivate::show_sys() CEikButtonGroupContainer *cba = CEikButtonGroupContainer::NewL(CEikButtonGroupContainer::ECba, CEikButtonGroupContainer::EHorizontal,ui,R_AVKON_SOFTKEYS_EMPTY_WITH_IDS); - CEikButtonGroupContainer *oldCba = CEikonEnv::Static()->AppUiFactory()->SwapButtonGroup(cba); + CEikButtonGroupContainer *oldCba = factory->SwapButtonGroup(cba); Q_ASSERT(!oldCba); S60->setButtonGroupContainer(cba); @@ -513,7 +513,7 @@ void QWidgetPrivate::show_sys() menuBar->SetMenuType(CEikMenuBar::EMenuOptions); S60->appUi()->AddToStackL(menuBar,ECoeStackPriorityMenu,ECoeStackFlagRefusesFocus); - CEikMenuBar *oldMenu = CEikonEnv::Static()->AppUiFactory()->SwapMenuBar(menuBar); + CEikMenuBar *oldMenu = factory->SwapMenuBar(menuBar); Q_ASSERT(!oldMenu); ) -- cgit v0.12 From 5e0be0aae4aa4011b4dbf7d1d457e4c8b4f6d4dc Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 13 Dec 2010 16:12:25 +0200 Subject: Fix qapplication autotest deployment Necessary default deployment was getting removed from qapplication test Task-number: QTBUG-15915 Reviewed-by: Janne Koskinen --- tests/auto/qapplication/test/test.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qapplication/test/test.pro b/tests/auto/qapplication/test/test.pro index 2c54c37..d946e7e 100644 --- a/tests/auto/qapplication/test/test.pro +++ b/tests/auto/qapplication/test/test.pro @@ -17,7 +17,7 @@ symbian: { someTest.sources = test.pro someTest.path = test windowIcon.sources = ../heart.svg - DEPLOYMENT = additional deploy someTest windowIcon + DEPLOYMENT += additional deploy someTest windowIcon LIBS += -lcone -lavkon } -- cgit v0.12 From 44911b0d44f4840e0d7678f8de7227a3a4018d34 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 13 Dec 2010 16:15:51 +0200 Subject: Non-hacky fix for qwidget autotest Turns out there is a nice way for getting current CBA, CEikButtonGroupContainer::Current(), so using that instead of the previous hack. Task-number: QTBUG-15915 Reviewed-by: Janne Koskinen --- tests/auto/qwidget/tst_qwidget.cpp | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 6069383..d611225 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -10029,28 +10029,6 @@ void tst_QWidget::openModal_taskQTBUG_5804() } #ifdef Q_OS_SYMBIAN - -static CEikButtonGroupContainer* cba() -{ - CEikButtonGroupContainer *oldCba = NULL; - - // Due to convoluted/buggy implementation of MEikAppUiFactory interface in Symbian, - // the only way to get the correct cba is to use SwapButtonGroup function. - // Calling SwapButtonGroup doesn't trigger anything, it only changes the value of iToolbar - // member variable, so this double switching should not cause any interference for test. - QT_TRAP_THROWING( - CEikButtonGroupContainer *dummyCba = CEikButtonGroupContainer::NewL( - CEikButtonGroupContainer::ECba, CEikButtonGroupContainer::EHorizontal, NULL, 0); - - oldCba = CEikonEnv::Static()->AppUiFactory()->SwapButtonGroup(dummyCba); - CEikonEnv::Static()->AppUiFactory()->SwapButtonGroup(oldCba); - - delete dummyCba; - ) - - return oldCba; -} - void tst_QWidget::cbaVisibility() { // Test case for task 261048 @@ -10083,7 +10061,7 @@ void tst_QWidget::cbaVisibility() // Verify window decorations i.e. status pane and CBA are visible. CEikStatusPane* statusPane = CEikonEnv::Static()->AppUiFactory()->StatusPane(); QVERIFY(statusPane->IsVisible()); - CEikButtonGroupContainer* buttonGroup = cba(); + CEikButtonGroupContainer* buttonGroup = CEikButtonGroupContainer::Current(); QVERIFY(buttonGroup->IsVisible()); } @@ -10100,7 +10078,7 @@ void tst_QWidget::fullScreenWindowModeTransitions() const QRect fullScreenGeometry = qApp->desktop()->screenGeometry(&widget); const QRect maximumScreenGeometry = qApp->desktop()->availableGeometry(&widget); CEikStatusPane *statusPane = CEikonEnv::Static()->AppUiFactory()->StatusPane(); - CEikButtonGroupContainer *buttonGroup = cba(); + CEikButtonGroupContainer *buttonGroup = CEikButtonGroupContainer::Current(); //Enter widget.showNormal(); @@ -10154,7 +10132,7 @@ void tst_QWidget::maximizedWindowModeTransitions() const QRect fullScreenGeometry = qApp->desktop()->screenGeometry(&widget); const QRect maximumScreenGeometry = qApp->desktop()->availableGeometry(&widget); CEikStatusPane *statusPane = CEikonEnv::Static()->AppUiFactory()->StatusPane(); - CEikButtonGroupContainer *buttonGroup = cba(); + CEikButtonGroupContainer *buttonGroup = CEikButtonGroupContainer::Current(); //Enter widget.showNormal(); @@ -10210,7 +10188,7 @@ void tst_QWidget::minimizedWindowModeTransitions() const QRect fullScreenGeometry = qApp->desktop()->screenGeometry(&widget); const QRect maximumScreenGeometry = qApp->desktop()->availableGeometry(&widget); CEikStatusPane *statusPane = CEikonEnv::Static()->AppUiFactory()->StatusPane(); - CEikButtonGroupContainer *buttonGroup = cba(); + CEikButtonGroupContainer *buttonGroup = CEikButtonGroupContainer::Current(); //Enter widget.showNormal(); @@ -10266,7 +10244,7 @@ void tst_QWidget::normalWindowModeTransitions() const QRect fullScreenGeometry = qApp->desktop()->screenGeometry(&widget); const QRect maximumScreenGeometry = qApp->desktop()->availableGeometry(&widget); CEikStatusPane *statusPane = CEikonEnv::Static()->AppUiFactory()->StatusPane(); - CEikButtonGroupContainer *buttonGroup = cba(); + CEikButtonGroupContainer *buttonGroup = CEikButtonGroupContainer::Current(); //Enter widget.showMaximized(); -- cgit v0.12 From b8f639f27a05043f9f9ac371352508d6527f0123 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 10 Dec 2010 10:00:54 +0100 Subject: Comment a bit more the timer ID allocation code. Also add the notes for where to place .loadAcquire when that function exists. Reviewed-By: Bradley T. Hughes --- src/corelib/kernel/qabstracteventdispatcher.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/corelib/kernel/qabstracteventdispatcher.cpp b/src/corelib/kernel/qabstracteventdispatcher.cpp index bcf4477..1c1c6e3 100644 --- a/src/corelib/kernel/qabstracteventdispatcher.cpp +++ b/src/corelib/kernel/qabstracteventdispatcher.cpp @@ -120,11 +120,20 @@ void QAbstractEventDispatcherPrivate::init() } } +// Timer IDs are implemented using a free-list; +// there's a vector initialized with: +// X[i] = i + 1 +// and nextFreeTimerId starts with 1. +// +// Allocating a timer ID involves taking the ID from +// X[nextFreeTimerId] +// updating nextFreeTimerId to this value and returning the old value +// (continues below). int QAbstractEventDispatcherPrivate::allocateTimerId() { int timerId, newTimerId; do { - timerId = nextFreeTimerId; + timerId = nextFreeTimerId; //.loadAcquire(); // ### FIXME Proper memory ordering semantics // which bucket are we looking in? int which = timerId & 0x00ffffff; @@ -148,6 +157,17 @@ int QAbstractEventDispatcherPrivate::allocateTimerId() return timerId; } +// Releasing a timer ID requires putting the current ID back in the vector; +// we do it by setting: +// X[timerId] = nextFreeTimerId; +// then we update nextFreeTimerId to the timer we've just released +// +// The extra code in allocateTimerId and releaseTimerId are ABA prevention +// and bucket memory. The buckets are simply to make sure we allocate only +// the necessary number of timers. See above. +// +// ABA prevention simply adds a value to 7 of the top 8 bits when resetting +// nextFreeTimerId. void QAbstractEventDispatcherPrivate::releaseTimerId(int timerId) { int which = timerId & 0x00ffffff; @@ -157,7 +177,7 @@ void QAbstractEventDispatcherPrivate::releaseTimerId(int timerId) int freeId, newTimerId; do { - freeId = nextFreeTimerId; + freeId = nextFreeTimerId;//.loadAcquire(); // ### FIXME Proper memory ordering semantics b[at] = freeId & 0x00ffffff; newTimerId = prepareNewValueWithSerialNumber(freeId, timerId); -- cgit v0.12 From f0a892a46fdc438277c8b401c267db4bd92aec1b Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 13 Dec 2010 14:50:07 +0100 Subject: Fix ABA problem with: the serial must be updated on all accesses The nextFreeTimerId's serial counter was only being updated on timer ID releasing. It needs to be updated on allocation too. Reviewed-by: Bradley T. Hughes --- src/corelib/kernel/qabstracteventdispatcher.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qabstracteventdispatcher.cpp b/src/corelib/kernel/qabstracteventdispatcher.cpp index 1c1c6e3..5619921 100644 --- a/src/corelib/kernel/qabstracteventdispatcher.cpp +++ b/src/corelib/kernel/qabstracteventdispatcher.cpp @@ -151,7 +151,7 @@ int QAbstractEventDispatcherPrivate::allocateTimerId() } } - newTimerId = b[at]; + newTimerId = prepareNewValueWithSerialNumber(timerId, b[at]); } while (!nextFreeTimerId.testAndSetRelaxed(timerId, newTimerId)); return timerId; -- cgit v0.12 From a02a747a9d5294127dfe3e676a2759e228257e70 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 13 Dec 2010 14:58:16 +0100 Subject: Use constants the timer ID masks instead of values everywhere Reviewed-By: Bradley T. Hughes --- src/corelib/kernel/qabstracteventdispatcher.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/corelib/kernel/qabstracteventdispatcher.cpp b/src/corelib/kernel/qabstracteventdispatcher.cpp index 5619921..002d360 100644 --- a/src/corelib/kernel/qabstracteventdispatcher.cpp +++ b/src/corelib/kernel/qabstracteventdispatcher.cpp @@ -77,10 +77,14 @@ Q_DESTRUCTOR_FUNCTION(timerIdsDestructorFunction) static QBasicAtomicInt nextFreeTimerId = Q_BASIC_ATOMIC_INITIALIZER(1); +static const int TimerIdMask = 0x00ffffff; +static const int TimerSerialMask = ~TimerIdMask & ~0x80000000; +static const int TimerSerialCounter = TimerIdMask + 1; + // avoid the ABA-problem by using 7 of the top 8 bits of the timerId as a serial number static inline int prepareNewValueWithSerialNumber(int oldId, int newId) { - return (newId & 0x00FFFFFF) | ((oldId + 0x01000000) & 0x7f000000); + return (newId & TimerIdMask) | ((oldId + TimerSerialCounter) & TimerSerialMask); } static inline int bucketOffset(int timerId) @@ -136,7 +140,7 @@ int QAbstractEventDispatcherPrivate::allocateTimerId() timerId = nextFreeTimerId; //.loadAcquire(); // ### FIXME Proper memory ordering semantics // which bucket are we looking in? - int which = timerId & 0x00ffffff; + int which = timerId & TimerIdMask; int bucket = bucketOffset(which); int at = bucketIndex(bucket, which); int *b = timerIds[bucket]; @@ -170,7 +174,7 @@ int QAbstractEventDispatcherPrivate::allocateTimerId() // nextFreeTimerId. void QAbstractEventDispatcherPrivate::releaseTimerId(int timerId) { - int which = timerId & 0x00ffffff; + int which = timerId & TimerIdMask; int bucket = bucketOffset(which); int at = bucketIndex(bucket, which); int *b = timerIds[bucket]; @@ -178,7 +182,7 @@ void QAbstractEventDispatcherPrivate::releaseTimerId(int timerId) int freeId, newTimerId; do { freeId = nextFreeTimerId;//.loadAcquire(); // ### FIXME Proper memory ordering semantics - b[at] = freeId & 0x00ffffff; + b[at] = freeId & TimerIdMask; newTimerId = prepareNewValueWithSerialNumber(freeId, timerId); } while (!nextFreeTimerId.testAndSetRelease(freeId, newTimerId)); -- cgit v0.12 From bd9d5c80235ce6d1b005df96c3058b75e82bd6f0 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 13 Dec 2010 15:02:27 +0100 Subject: Add a small protection against releasing a timer twice. The cell corresponding to an allocated timer ID in the free list is unused (because the ID isn't free). So use it to store an invalid value that we can check against the user's value. This provides some protection against a given timer being released twice. Since we store the serial counter of the nextFreeTimerId, getting the same ID twice is a 1-in-128 chance. Reviewed-By: Bradley T. Hughes --- src/corelib/kernel/qabstracteventdispatcher.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/corelib/kernel/qabstracteventdispatcher.cpp b/src/corelib/kernel/qabstracteventdispatcher.cpp index 002d360..bf675a7 100644 --- a/src/corelib/kernel/qabstracteventdispatcher.cpp +++ b/src/corelib/kernel/qabstracteventdispatcher.cpp @@ -132,18 +132,24 @@ void QAbstractEventDispatcherPrivate::init() // Allocating a timer ID involves taking the ID from // X[nextFreeTimerId] // updating nextFreeTimerId to this value and returning the old value +// +// When the timer ID is allocated, its cell in the vector is unused (it's a +// free list). As an added protection, we use the cell to store an invalid +// (negative) value that we can later check for integrity. +// // (continues below). int QAbstractEventDispatcherPrivate::allocateTimerId() { int timerId, newTimerId; + int at, *b; do { timerId = nextFreeTimerId; //.loadAcquire(); // ### FIXME Proper memory ordering semantics // which bucket are we looking in? int which = timerId & TimerIdMask; int bucket = bucketOffset(which); - int at = bucketIndex(bucket, which); - int *b = timerIds[bucket]; + at = bucketIndex(bucket, which); + b = timerIds[bucket]; if (!b) { // allocate a new bucket @@ -158,6 +164,8 @@ int QAbstractEventDispatcherPrivate::allocateTimerId() newTimerId = prepareNewValueWithSerialNumber(timerId, b[at]); } while (!nextFreeTimerId.testAndSetRelaxed(timerId, newTimerId)); + b[at] = -timerId; + return timerId; } @@ -179,6 +187,8 @@ void QAbstractEventDispatcherPrivate::releaseTimerId(int timerId) int at = bucketIndex(bucket, which); int *b = timerIds[bucket]; + Q_ASSERT(b[at] == -timerId); + int freeId, newTimerId; do { freeId = nextFreeTimerId;//.loadAcquire(); // ### FIXME Proper memory ordering semantics -- cgit v0.12 From 8d0863f175199384e41a00fa18a9ea7d177c7f0e Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 13 Dec 2010 22:57:17 +0100 Subject: qrgb565: Use the trivial qt_memconvert() and qt_rectconvert() Use memcpy() instead of the generic conversion routines where both template arguments are qrgb565. Yields a massive performance gain for tiling opaque (background) images in WebKit on 16-bit displays. This was previously restricted to Q_WS_QWS for some unknown reason. Reviewed-by: Benjamin Poulain --- src/gui/painting/qdrawhelper_p.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h index 0cc2e40..33fd21e 100644 --- a/src/gui/painting/qdrawhelper_p.h +++ b/src/gui/painting/qdrawhelper_p.h @@ -1684,9 +1684,7 @@ QT_TRIVIAL_MEMCONVERT_IMPL(qrgb888) QT_TRIVIAL_MEMCONVERT_IMPL(qargb6666) QT_TRIVIAL_MEMCONVERT_IMPL(qrgb666) QT_TRIVIAL_MEMCONVERT_IMPL(quint16) -#ifdef Q_WS_QWS QT_TRIVIAL_MEMCONVERT_IMPL(qrgb565) -#endif QT_TRIVIAL_MEMCONVERT_IMPL(qargb8565) QT_TRIVIAL_MEMCONVERT_IMPL(qargb8555) QT_TRIVIAL_MEMCONVERT_IMPL(qrgb555) @@ -1783,9 +1781,7 @@ QT_RECTCONVERT_TRIVIAL_IMPL(quint32) QT_RECTCONVERT_TRIVIAL_IMPL(qrgb888) QT_RECTCONVERT_TRIVIAL_IMPL(qargb6666) QT_RECTCONVERT_TRIVIAL_IMPL(qrgb666) -#ifdef Q_WS_QWS QT_RECTCONVERT_TRIVIAL_IMPL(qrgb565) -#endif QT_RECTCONVERT_TRIVIAL_IMPL(qargb8565) QT_RECTCONVERT_TRIVIAL_IMPL(quint16) QT_RECTCONVERT_TRIVIAL_IMPL(qargb8555) -- cgit v0.12 From 2eee49127b80b5b56c605f76ccea004b03d89577 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Tue, 14 Dec 2010 11:22:50 +1000 Subject: Remove active selection when TextEdit loses focus Task-number: QTBUG-15341 Reviewed-by: Yann Bodson --- .../graphicsitems/qdeclarativetextedit.cpp | 14 ++++++++ .../graphicsitems/qdeclarativetextedit_p.h | 1 + .../tst_qdeclarativetextedit.cpp | 40 ++++++++++++++++++++++ 3 files changed, 55 insertions(+) diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index e05f4e4..1042cf1 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -994,6 +994,20 @@ void QDeclarativeTextEditPrivate::focusChanged(bool hasFocus) QDeclarativeItemPrivate::focusChanged(hasFocus); } +void QDeclarativeTextEdit::focusOutEvent(QFocusEvent *event) +{ + Q_D(QDeclarativeTextEdit); + if (event->reason() != Qt::ActiveWindowFocusReason + && event->reason() != Qt::PopupFocusReason) { + QTextCursor cursor = d->control->textCursor(); + if (cursor.hasSelection()) { + cursor.clearSelection(); + d->control->setTextCursor(cursor); + } + } + QDeclarativePaintedItem::focusOutEvent(event); +} + /*! \qmlmethod void TextEdit::selectAll() diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p.h index 68fde3d..6826cb5 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit_p.h +++ b/src/declarative/graphicsitems/qdeclarativetextedit_p.h @@ -249,6 +249,7 @@ protected: void keyPressEvent(QKeyEvent *); void keyReleaseEvent(QKeyEvent *); void focusInEvent(QFocusEvent *event); + void focusOutEvent(QFocusEvent *event); // mouse filter? void mousePressEvent(QGraphicsSceneMouseEvent *event); diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp index a7971cc..ed02451 100644 --- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp +++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp @@ -110,6 +110,7 @@ private slots: void mouseSelection_data(); void mouseSelection(); void inputMethodHints(); + void clearSelectionOnFocusLost(); void cursorDelegate(); void delegateLoading_data(); @@ -748,6 +749,45 @@ void tst_qdeclarativetextedit::inputMethodHints() QVERIFY(textEditObject->inputMethodHints() & Qt::ImhUppercaseOnly); } +// QTBUG-15341 +void tst_qdeclarativetextedit::clearSelectionOnFocusLost() +{ + + // create a visible scene with two text edits + QGraphicsScene scene; + QGraphicsView view(&scene); + QDeclarativeTextEdit edit; + QDeclarativeTextEdit secondEdit; + edit.setText("Hello world!"); + scene.addItem(&edit); + scene.addItem(&secondEdit); + view.show(); + QApplication::setActiveWindow(&view); + QTest::qWaitForWindowShown(&view); + QTRY_COMPARE(QApplication::activeWindow(), static_cast(&view)); + + int index = 0; + while (index < Qt::NoFocusReason) { + + // focus the first text edit and select text + edit.setFocus(true); + edit.selectAll(); + QVERIFY(edit.hasActiveFocus() && !secondEdit.hasActiveFocus()); + QCOMPARE(edit.selectedText().size(), 12); + + // lose focus in the first text edit + qobject_cast(&secondEdit)->setFocus(Qt::FocusReason(index)); + QVERIFY(!edit.hasActiveFocus() && secondEdit.hasActiveFocus()); + + // depending on the focus reason, selection should now be cleared + bool clearSelection = (index != Qt::ActiveWindowFocusReason && index != Qt::PopupFocusReason); + QCOMPARE(edit.selectedText().isEmpty(), clearSelection); + index++; + } +} + + + void tst_qdeclarativetextedit::cursorDelegate() { QDeclarativeView* view = createView(SRCDIR "/data/cursorTest.qml"); -- cgit v0.12 From e4257e41c1c9e764d27f1c61f9173c34444236f3 Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Tue, 14 Dec 2010 14:27:38 +1000 Subject: Abort working replies with error when network session fails. Otherwise the connections will stay in a zombie state until the TCP keep alive timer times out in a couple of hours. Task-number: Maemo 201619 --- src/network/access/qnetworkreplyimpl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp index cf6e674..3d1df06 100644 --- a/src/network/access/qnetworkreplyimpl.cpp +++ b/src/network/access/qnetworkreplyimpl.cpp @@ -271,8 +271,8 @@ void QNetworkReplyImplPrivate::_q_networkSessionConnected() void QNetworkReplyImplPrivate::_q_networkSessionFailed() { - // Abort waiting replies. - if (state == WaitingForSession) { + // Abort waiting and working replies. + if (state == WaitingForSession || state == Working) { state = Working; error(QNetworkReplyImpl::UnknownNetworkError, QCoreApplication::translate("QNetworkReply", "Network session error.")); -- cgit v0.12 From f58cf707dd5668ca2849f457e951a9cef7d1d544 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Tue, 14 Dec 2010 15:27:23 +1000 Subject: Revert a fix made for bug QTBUG-15341 Reverted a commit 2eee49127b80b5b56c605f76ccea004b03d89577 "Remove active selection when TextEdit loses focus". Contrary to TextInput, by default TextEdit keeps the selection visible when the editor loses active focus. If this is not wanted, a property called persistentSelection can be set false to make selection dependant on the focus. --- .../graphicsitems/qdeclarativetextedit.cpp | 14 -------- .../graphicsitems/qdeclarativetextedit_p.h | 1 - .../tst_qdeclarativetextedit.cpp | 40 ---------------------- 3 files changed, 55 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index 1042cf1..e05f4e4 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -994,20 +994,6 @@ void QDeclarativeTextEditPrivate::focusChanged(bool hasFocus) QDeclarativeItemPrivate::focusChanged(hasFocus); } -void QDeclarativeTextEdit::focusOutEvent(QFocusEvent *event) -{ - Q_D(QDeclarativeTextEdit); - if (event->reason() != Qt::ActiveWindowFocusReason - && event->reason() != Qt::PopupFocusReason) { - QTextCursor cursor = d->control->textCursor(); - if (cursor.hasSelection()) { - cursor.clearSelection(); - d->control->setTextCursor(cursor); - } - } - QDeclarativePaintedItem::focusOutEvent(event); -} - /*! \qmlmethod void TextEdit::selectAll() diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p.h index 6826cb5..68fde3d 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit_p.h +++ b/src/declarative/graphicsitems/qdeclarativetextedit_p.h @@ -249,7 +249,6 @@ protected: void keyPressEvent(QKeyEvent *); void keyReleaseEvent(QKeyEvent *); void focusInEvent(QFocusEvent *event); - void focusOutEvent(QFocusEvent *event); // mouse filter? void mousePressEvent(QGraphicsSceneMouseEvent *event); diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp index ed02451..a7971cc 100644 --- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp +++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp @@ -110,7 +110,6 @@ private slots: void mouseSelection_data(); void mouseSelection(); void inputMethodHints(); - void clearSelectionOnFocusLost(); void cursorDelegate(); void delegateLoading_data(); @@ -749,45 +748,6 @@ void tst_qdeclarativetextedit::inputMethodHints() QVERIFY(textEditObject->inputMethodHints() & Qt::ImhUppercaseOnly); } -// QTBUG-15341 -void tst_qdeclarativetextedit::clearSelectionOnFocusLost() -{ - - // create a visible scene with two text edits - QGraphicsScene scene; - QGraphicsView view(&scene); - QDeclarativeTextEdit edit; - QDeclarativeTextEdit secondEdit; - edit.setText("Hello world!"); - scene.addItem(&edit); - scene.addItem(&secondEdit); - view.show(); - QApplication::setActiveWindow(&view); - QTest::qWaitForWindowShown(&view); - QTRY_COMPARE(QApplication::activeWindow(), static_cast(&view)); - - int index = 0; - while (index < Qt::NoFocusReason) { - - // focus the first text edit and select text - edit.setFocus(true); - edit.selectAll(); - QVERIFY(edit.hasActiveFocus() && !secondEdit.hasActiveFocus()); - QCOMPARE(edit.selectedText().size(), 12); - - // lose focus in the first text edit - qobject_cast(&secondEdit)->setFocus(Qt::FocusReason(index)); - QVERIFY(!edit.hasActiveFocus() && secondEdit.hasActiveFocus()); - - // depending on the focus reason, selection should now be cleared - bool clearSelection = (index != Qt::ActiveWindowFocusReason && index != Qt::PopupFocusReason); - QCOMPARE(edit.selectedText().isEmpty(), clearSelection); - index++; - } -} - - - void tst_qdeclarativetextedit::cursorDelegate() { QDeclarativeView* view = createView(SRCDIR "/data/cursorTest.qml"); -- cgit v0.12 From c34225b62ea2dd2a545baf2ade41629be6a55473 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Tue, 14 Dec 2010 13:59:36 +1000 Subject: Clarify that XmlListModel is read only --- src/declarative/util/qdeclarativexmllistmodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp index ce5b483..49a12b1 100644 --- a/src/declarative/util/qdeclarativexmllistmodel.cpp +++ b/src/declarative/util/qdeclarativexmllistmodel.cpp @@ -503,9 +503,9 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty Date: Tue, 14 Dec 2010 16:38:02 +1000 Subject: Docs: implications of creating network access managers in other threads Task-number: QTBUG-16032 --- .../qdeclarativenetworkaccessmanagerfactory.cpp | 53 ++++++++++++++-------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp b/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp index d22798d..36e9721 100644 --- a/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp +++ b/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp @@ -46,27 +46,44 @@ QT_BEGIN_NAMESPACE /*! \class QDeclarativeNetworkAccessManagerFactory \since 4.7 - \brief The QDeclarativeNetworkAccessManagerFactory class provides a factory for QNetworkAccessManager for use by a Qt Declarative engine. + \brief The QDeclarativeNetworkAccessManagerFactory class creates QNetworkAccessManager instances for a QML engine. - QNetworkAccessManager is used for all network access by QML. - By implementing a factory it is possible to create custom - QNetworkAccessManager with specialized caching, proxy and - cookie support. + A QML engine uses QNetworkAccessManager for all network access. + By implementing a factory, it is possible to provide the QML engine + with custom QNetworkAccessManager instances with specialized caching, + proxy and cookies support. - To implement a factory, subclass QDeclarativeNetworkAccessManagerFactory and implement - the create() method. + To implement a factory, subclass QDeclarativeNetworkAccessManagerFactory and + implement the virtual create() method, then assign it to the relevant QML + engine using QDeclarativeEngine::setNetworkAccessManagerFactory(). - To use a factory, assign it to the relevant QDeclarativeEngine using - QDeclarativeEngine::setNetworkAccessManagerFactory(). + Note the QML engine may create QNetworkAccessManager instances + from multiple threads. Because of this, the implementation of the create() + method must be \l{Reentrancy and Thread-Safety}{reentrant}. In addition, + the developer should be careful if the signals of the object to be + returned from create() are connected to the slots of an object that may + be created in a different thread: - Note: the create() method may be called by multiple threads, so ensure the - implementation of this method is reentrant. + \list + \o The QML engine internally handles all requests, and cleans up any + QNetworkReply objects it creates. Receiving the + QNetworkAccessManager::finished() signal in another thread may not + provide the receiver with a valid reply object if it has already + been deleted. + \o Authentication details provided to QNetworkAccessManager::authenticationRequired() + must be provided immediately, so this signal cannot be connected as a + Qt::QueuedConnection (or as the default Qt::AutoConnection from another + thread). + \endlist + + For more information about signals and threads, see + \l {Threads and QObjects} and \l {Signals and Slots Across Threads}. - \sa QDeclarativeEngine::setNetworkAccessManagerFactory(), {declarative/cppextensions/networkaccessmanagerfactory}{NetworkAccessManagerFactory example} + \sa {declarative/cppextensions/networkaccessmanagerfactory}{NetworkAccessManagerFactory example} */ /*! - The destructor is empty. + Destroys the factory. The default implementation does nothing. */ QDeclarativeNetworkAccessManagerFactory::~QDeclarativeNetworkAccessManagerFactory() { @@ -75,13 +92,9 @@ QDeclarativeNetworkAccessManagerFactory::~QDeclarativeNetworkAccessManagerFactor /*! \fn QNetworkAccessManager *QDeclarativeNetworkAccessManagerFactory::create(QObject *parent) - Implement this method to create a QNetworkAccessManager with \a parent. - This allows proxies, caching and cookie support to be setup appropriately. - - This method must return a new QNetworkAccessManager each time it is called. - The parent of the QNetworkAccessManager must be the \a parent provided. - The QNetworkAccessManager(s) created by this - function will be destroyed automatically when their parent is destroyed. + Creates and returns a network access manager with the specified \a parent. + This method must return a new QNetworkAccessManager instance each time + it is called. Note: this method may be called by multiple threads, so ensure the implementation of this method is reentrant. -- cgit v0.12 From 725716bcf158988ac664da8f8bcd2d9a8e91a916 Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 10 Dec 2010 10:32:11 +0100 Subject: Fixed several compile and deployment issues in the mmf phonon plugin. RevBy: Trust me --- src/3rdparty/phonon/mmf/abstractaudioeffect.h | 2 +- src/3rdparty/phonon/mmf/audioequalizer.cpp | 2 +- src/3rdparty/phonon/mmf/bassboost.cpp | 2 +- src/3rdparty/phonon/mmf/environmentalreverb.cpp | 2 +- src/3rdparty/phonon/mmf/loudness.cpp | 2 +- src/3rdparty/phonon/mmf/stereowidening.cpp | 2 +- src/plugins/phonon/mmf/mmf.pro | 4 ++-- src/s60installs/s60installs.pro | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.h b/src/3rdparty/phonon/mmf/abstractaudioeffect.h index 8879636..70adcf6 100644 --- a/src/3rdparty/phonon/mmf/abstractaudioeffect.h +++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.h @@ -21,7 +21,7 @@ along with this library. If not, see . #include -#include +#include #include diff --git a/src/3rdparty/phonon/mmf/audioequalizer.cpp b/src/3rdparty/phonon/mmf/audioequalizer.cpp index 28433f6..1d2bbd4 100644 --- a/src/3rdparty/phonon/mmf/audioequalizer.cpp +++ b/src/3rdparty/phonon/mmf/audioequalizer.cpp @@ -16,7 +16,7 @@ along with this library. If not, see . */ -#include +#include #include "audioequalizer.h" QT_BEGIN_NAMESPACE diff --git a/src/3rdparty/phonon/mmf/bassboost.cpp b/src/3rdparty/phonon/mmf/bassboost.cpp index 81d9208..67076f6 100644 --- a/src/3rdparty/phonon/mmf/bassboost.cpp +++ b/src/3rdparty/phonon/mmf/bassboost.cpp @@ -16,7 +16,7 @@ along with this library. If not, see . */ -#include +#include #include "bassboost.h" QT_BEGIN_NAMESPACE diff --git a/src/3rdparty/phonon/mmf/environmentalreverb.cpp b/src/3rdparty/phonon/mmf/environmentalreverb.cpp index c500385..d4f5223 100644 --- a/src/3rdparty/phonon/mmf/environmentalreverb.cpp +++ b/src/3rdparty/phonon/mmf/environmentalreverb.cpp @@ -16,7 +16,7 @@ along with this library. If not, see . */ -#include +#include #include "environmentalreverb.h" QT_BEGIN_NAMESPACE diff --git a/src/3rdparty/phonon/mmf/loudness.cpp b/src/3rdparty/phonon/mmf/loudness.cpp index 22d7518..ca05ab0 100644 --- a/src/3rdparty/phonon/mmf/loudness.cpp +++ b/src/3rdparty/phonon/mmf/loudness.cpp @@ -16,7 +16,7 @@ along with this library. If not, see . */ -#include +#include #include "loudness.h" QT_BEGIN_NAMESPACE diff --git a/src/3rdparty/phonon/mmf/stereowidening.cpp b/src/3rdparty/phonon/mmf/stereowidening.cpp index e452160..f90651b 100644 --- a/src/3rdparty/phonon/mmf/stereowidening.cpp +++ b/src/3rdparty/phonon/mmf/stereowidening.cpp @@ -16,7 +16,7 @@ along with this library. If not, see . */ -#include +#include #include "stereowidening.h" QT_BEGIN_NAMESPACE diff --git a/src/plugins/phonon/mmf/mmf.pro b/src/plugins/phonon/mmf/mmf.pro index 691fc80..5d7b61d 100644 --- a/src/plugins/phonon/mmf/mmf.pro +++ b/src/plugins/phonon/mmf/mmf.pro @@ -103,7 +103,7 @@ symbian { exists($${EPOCROOT}epoc32/include/mw/downloadmgrclient.h) { HEADERS += $$PHONON_MMF_DIR/download.h SOURCES += $$PHONON_MMF_DIR/download.cpp - LIBS += -ldownloadmgr + LIBS += -lDownloadMgr DEFINES += PHONON_MMF_PROGRESSIVE_DOWNLOAD } } @@ -125,7 +125,7 @@ symbian { LIBS += -lmediaclientaudiostream # For CMdaAudioOutputStream # These are for effects. - LIBS += -lAudioEqualizerEffect -lBassBoostEffect -lDistanceAttenuationEffect -lDopplerBase -lEffectBase -lEnvironmentalReverbEffect -lListenerDopplerEffect -lListenerLocationEffect -lListenerOrientationEffect -lLocationBase -lLoudnessEffect -lOrientationBase -lSourceDopplerEffect -lSourceLocationEffect -lSourceOrientationEffect -lStereoWideningEffect + LIBS += -lAudioEqualizerEffect -lBassBoostEffect -lDistanceAttenuationEffect -lDopplerbase -lEffectBase -lEnvironmentalReverbEffect -lListenerDopplerEffect -lListenerLocationEffect -lListenerOrientationEffect -lLocationBase -lLoudnessEffect -lOrientationBase -lSourceDopplerEffect -lSourceLocationEffect -lSourceOrientationEffect -lStereoWideningEffect # This is needed for having the .qtplugin file properly created on Symbian. QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/phonon_backend diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro index ff67bcf..5a435cd 100644 --- a/src/s60installs/s60installs.pro +++ b/src/s60installs/s60installs.pro @@ -132,7 +132,7 @@ symbian: { codecs_plugins.path = c:$$QT_PLUGINS_BASE_DIR/codecs contains(QT_CONFIG, phonon-backend) { - phonon_backend_plugins.sources += $$QMAKE_LIBDIR_QT/phonon_mmf$${QT_LIBINFIX}.dll + phonon_backend_plugins.sources += $$QT_BUILD_TREE/plugins/phonon_backend/phonon_mmf$${QT_LIBINFIX}.dll phonon_backend_plugins.path = c:$$QT_PLUGINS_BASE_DIR/phonon_backend DEPLOYMENT += phonon_backend_plugins -- cgit v0.12 From 6aa1ab84404c92f2048270b1932fa10cecdcc58d Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 10 Dec 2010 15:35:06 +0100 Subject: Fixed a bug in the input methods on S60 with QGraphicsWebView. The bug happened because we did not expect to receive a call to CancelFepInlineEdit() when the widget had not previously been given any preedit text by S60. However, this can happen, and if it happens at the same time that there is a temporarily visible character in the widget (because it will be obscured as a password a second later), then the temporary character would be discarded. Fixed by checking in the beginning of CancelFepInlineEdit() whether we currently have any temporary preedit text or not, and if we do, we don't clear the contents, since it is the input context itself that generated the preedit text, not S60. Also made sure that the temporary preedit text is committed if we receive a call to UpdateFepInlineTextL(), which may sometimes happen without a call to StartFepInlineEditL(). Task: QT-4314 AutoTest: Included RevBy: Shane Kearns --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 8 ++ tests/auto/qinputcontext/qinputcontext.pro | 2 + tests/auto/qinputcontext/tst_qinputcontext.cpp | 141 +++++++++++++++++++++++- 3 files changed, 148 insertions(+), 3 deletions(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 4a1b9b9..686f388 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -657,6 +657,8 @@ void QCoeFepInputContext::UpdateFepInlineTextL(const TDesC& aNewInlineText, if (!w) return; + commitTemporaryPreeditString(); + m_inlinePosition = aPositionOfInsertionPointInInlineText; QList attributes; @@ -694,6 +696,12 @@ void QCoeFepInputContext::SetInlineEditingCursorVisibilityL(TBool aCursorVisibil void QCoeFepInputContext::CancelFepInlineEdit() { + // We are not supposed to ever have a tempPreeditString and a real preedit string + // from S60 at the same time, so it should be safe to rely on this test to determine + // whether we should honor S60's request to clear the text or not. + if (m_hasTempPreeditString) + return; + QList attributes; QInputMethodEvent event(QLatin1String(""), attributes); event.setCommitString(QLatin1String(""), 0, 0); diff --git a/tests/auto/qinputcontext/qinputcontext.pro b/tests/auto/qinputcontext/qinputcontext.pro index ec6831e..4b3ab96 100644 --- a/tests/auto/qinputcontext/qinputcontext.pro +++ b/tests/auto/qinputcontext/qinputcontext.pro @@ -1,6 +1,8 @@ load(qttest_p4) SOURCES += tst_qinputcontext.cpp +contains(QT_CONFIG, webkit):QT += webkit + symbian { LIBS += -lws32 -lcone } diff --git a/tests/auto/qinputcontext/tst_qinputcontext.cpp b/tests/auto/qinputcontext/tst_qinputcontext.cpp index 5a258a9..020f177 100644 --- a/tests/auto/qinputcontext/tst_qinputcontext.cpp +++ b/tests/auto/qinputcontext/tst_qinputcontext.cpp @@ -50,6 +50,13 @@ #include #include #include +#include +#include + +#ifdef QT_WEBKIT_LIB +#include +#include +#endif #ifdef Q_OS_SYMBIAN #include @@ -466,6 +473,115 @@ void tst_QInputContext::focusProxy() QCOMPARE(gic->focusWidget(), &proxy); } +#ifdef QT_WEBKIT_LIB +class AutoWebView : public QWebView +{ + Q_OBJECT + +public: + AutoWebView() + : m_length(0) + , m_mode(QLineEdit::Normal) + { + updatePage(); + } + ~AutoWebView() {} + + void updatePage() + { + // The update might reset the input method parameters. + bool imEnabled = testAttribute(Qt::WA_InputMethodEnabled); + Qt::InputMethodHints hints = inputMethodHints(); + + QString page = "" + "
"; + if (m_mode == QLineEdit::Password) + page = page.arg("password"); + else + page = page.arg("text"); + + if (m_length == 0) + page = page.arg(""); + else + page = page.arg("maxlength=\"" + QString::number(m_length) + "\""); + + setHtml(page); + + setAttribute(Qt::WA_InputMethodEnabled, imEnabled); + setInputMethodHints(hints); + } + void setMaxLength(int length) + { + m_length = length; + updatePage(); + } + void setEchoMode(QLineEdit::EchoMode mode) + { + m_mode = mode; + updatePage(); + } + + int m_length; + QLineEdit::EchoMode m_mode; +}; + +class AutoGraphicsWebView : public QGraphicsView +{ + Q_OBJECT + +public: + AutoGraphicsWebView() + : m_length(0) + , m_mode(QLineEdit::Normal) + { + m_scene.addItem(&m_view); + setScene(&m_scene); + m_view.setFocus(); + updatePage(); + } + ~AutoGraphicsWebView() {} + + void updatePage() + { + // The update might reset the input method parameters. + bool imEnabled = testAttribute(Qt::WA_InputMethodEnabled); + Qt::InputMethodHints hints = inputMethodHints(); + + QString page = "" + "
"; + if (m_mode == QLineEdit::Password) + page = page.arg("password"); + else + page = page.arg("text"); + + if (m_length == 0) + page = page.arg(""); + else + page = page.arg("maxlength=\"" + QString::number(m_length) + "\""); + + m_view.setHtml(page); + + setAttribute(Qt::WA_InputMethodEnabled, imEnabled); + setInputMethodHints(hints); + } + void setMaxLength(int length) + { + m_length = length; + updatePage(); + } + void setEchoMode(QLineEdit::EchoMode mode) + { + m_mode = mode; + updatePage(); + } + + int m_length; + QLineEdit::EchoMode m_mode; + QGraphicsScene m_scene; + QGraphicsWebView m_view; +}; +#endif // QT_WEBKIT_LIB + void tst_QInputContext::symbianTestCoeFepInputContext_data() { #ifdef Q_OS_SYMBIAN @@ -481,6 +597,10 @@ void tst_QInputContext::symbianTestCoeFepInputContext_data() symbianTestCoeFepInputContext_addData(); symbianTestCoeFepInputContext_addData(); symbianTestCoeFepInputContext_addData(); +# ifdef QT_WEBKIT_LIB + symbianTestCoeFepInputContext_addData(); + symbianTestCoeFepInputContext_addData(); +# endif #endif } @@ -1087,13 +1207,28 @@ void tst_QInputContext::symbianTestCoeFepInputContext() editwidget->setAttribute(Qt::WA_InputMethodEnabled, inputMethodEnabled); editwidget->setInputMethodHints(inputMethodHints); - QLineEdit *lineedit = qobject_cast(editwidget); - if (lineedit) { + if (QLineEdit *lineedit = qobject_cast(editwidget)) { if (maxLength > 0) lineedit->setMaxLength(maxLength); lineedit->setEchoMode(echoMode); +#ifdef QT_WEBKIT_LIB + } else if (AutoWebView *webView = qobject_cast(editwidget)) { + if (maxLength > 0) + webView->setMaxLength(maxLength); + webView->setEchoMode(echoMode); + // WebKit disables T9 everywhere. + if (inputMethodEnabled && !(inputMethodHints & Qt::ImhNoPredictiveText)) + return; + } else if (AutoGraphicsWebView *webView = qobject_cast(editwidget)) { + if (maxLength > 0) + webView->setMaxLength(maxLength); + webView->setEchoMode(echoMode); + // WebKit disables T9 everywhere. + if (inputMethodEnabled && !(inputMethodHints & Qt::ImhNoPredictiveText)) + return; +#endif } else if (maxLength > 0 || echoMode != QLineEdit::Normal) { - // Only QLineEdits support these features so don't attempt any tests using those + // Only some widgets support these features so don't attempt any tests using those // on other widgets. return; } -- cgit v0.12 From 284211ccbd2cbdfea46cdf4b8628a1a967271985 Mon Sep 17 00:00:00 2001 From: Michael Dominic K Date: Tue, 14 Dec 2010 10:26:39 +0100 Subject: Prevent ::flush from being called on QGLWindowSurface if no painting happened. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge-request: 2527 Reviewed-by: Harald Fernengel Reviewed-by: Samuel Rødal --- src/opengl/qwindowsurface_gl.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index f64b93c..6749826 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -267,6 +267,7 @@ struct QGLWindowSurfacePrivate int tried_pb : 1; int destructive_swap_buffers : 1; int geometry_updated : 1; + int did_paint : 1; QGLContext *ctx; @@ -330,6 +331,7 @@ QGLWindowSurface::QGLWindowSurface(QWidget *window) d_ptr->glDevice.d = d_ptr; d_ptr->q_ptr = this; d_ptr->geometry_updated = false; + d_ptr->did_paint = false; } QGLWindowSurface::~QGLWindowSurface() @@ -461,6 +463,8 @@ void QGLWindowSurface::beginPaint(const QRegion &) glClearColor(0.0, 0.0, 0.0, 0.0); glClear(clearFlags); } + + d_ptr->did_paint = true; } void QGLWindowSurface::endPaint(const QRegion &rgn) @@ -513,6 +517,13 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint & if (d_ptr->geometry_updated) return; + // did_paint is set to true in ::beginPaint. ::beginPaint means that we + // at least cleared the background (= painted something). In EGL API it's a + // mistakte to call swapBuffers if nothing was painted. This check protects + // the flush func from being executed if it's for nothing. + if (! d_ptr->did_paint) + return; + QWidget *parent = widget->internalWinId() ? widget : widget->nativeParentWidget(); Q_ASSERT(parent); @@ -736,6 +747,8 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint & ctx->swapBuffers(); else glFlush(); + + d_ptr->did_paint = false; } -- cgit v0.12 From 4d93a606ea0438be8062fda82baf639a9ced78ba Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Tue, 14 Dec 2010 10:28:26 +0100 Subject: Trivial: Fix coding style Fix coding style of merge request --- src/opengl/qwindowsurface_gl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index 6749826..7dc7dc7 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -521,7 +521,7 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint & // at least cleared the background (= painted something). In EGL API it's a // mistakte to call swapBuffers if nothing was painted. This check protects // the flush func from being executed if it's for nothing. - if (! d_ptr->did_paint) + if (!d_ptr->did_paint) return; QWidget *parent = widget->internalWinId() ? widget : widget->nativeParentWidget(); -- cgit v0.12 From e864a530a5c48459c433518ff6ad893f33ec93d8 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 14 Dec 2010 10:57:11 +0100 Subject: Fix failing tst_QGraphicsView::QTBUG_16063_microFocusRect auto-test This ammends commit 0af1f5508e165f3b494ab236cb1cdf1b0edcffa5. Reviewed-by: trust me --- tests/auto/qgraphicsview/tst_qgraphicsview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index e1fbaee..e259177 100644 --- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp @@ -4455,7 +4455,7 @@ class IMItem : public QGraphicsRectItem { public: IMItem(QGraphicsItem *parent = 0): - QGraphicsRectItem(mf.adjusted(-5, -5, 5, 5), parent) + QGraphicsRectItem(QRectF(0, 0, 20, 20), parent) { setFlag(QGraphicsItem::ItemIsFocusable, true); setFlag(QGraphicsItem::ItemAcceptsInputMethod, true); @@ -4486,7 +4486,7 @@ void tst_QGraphicsView::QTBUG_16063_microFocusRect() scene.setFocusItem(item); view.setFocus(); QRectF mfv = view.inputMethodQuery(Qt::ImMicroFocus).toRectF(); - QCOMPARE(mfv, QRectF(13.5, 13.6, 10, 10)); + QCOMPARE(mfv, IMItem::mf.translated(-view.mapToScene(view.sceneRect().toRect()).boundingRect().topLeft())); } QTEST_MAIN(tst_QGraphicsView) -- cgit v0.12 From 736b8205158dd7b98af862a029b273dff6fb716d Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 8 Dec 2010 13:23:23 +0100 Subject: QApplication: fix crash exit whith native windows Regression introduced in 8dd8db250d92521fda619bdcf3e1c859b37b2da0 Patch comes from the task Task-number: QTBUG-15774 --- src/gui/kernel/qapplication.cpp | 6 +++--- tests/auto/qapplication/modal/main.cpp | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index a4ae46b..b4ff7c4 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -1101,6 +1101,9 @@ QApplication::~QApplication() QApplicationPrivate::is_app_closing = true; QApplicationPrivate::is_app_running = false; + delete QWidgetPrivate::mapper; + QWidgetPrivate::mapper = 0; + // delete all widgets if (QWidgetPrivate::allWidgets) { QWidgetSet *mySet = QWidgetPrivate::allWidgets; @@ -1130,9 +1133,6 @@ QApplication::~QApplication() delete d->ignore_cursor; d->ignore_cursor = 0; #endif - delete QWidgetPrivate::mapper; - QWidgetPrivate::mapper = 0; - delete QApplicationPrivate::app_pal; QApplicationPrivate::app_pal = 0; delete QApplicationPrivate::sys_pal; diff --git a/tests/auto/qapplication/modal/main.cpp b/tests/auto/qapplication/modal/main.cpp index f9d8fb4..3eaaa0d 100644 --- a/tests/auto/qapplication/modal/main.cpp +++ b/tests/auto/qapplication/modal/main.cpp @@ -47,6 +47,7 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); + QApplication::setAttribute(Qt::AA_NativeWindows); //QTBUG-15774 base *b = new base(); return app.exec(); } -- cgit v0.12 From 3778c3f5208f3db99d6b23a2a3c4abf1fe2ec64f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Tue, 14 Dec 2010 11:46:57 +0100 Subject: Make sure that d->init() is called from both ctors. QGraphicsLayout uses the protected ctor that did not call d->init(), so all its subclasses was potentially suffering from this. Task-number: QTBUG-15333 Reviewed-by: John Tapsell --- src/gui/graphicsview/qgraphicslayoutitem.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/graphicsview/qgraphicslayoutitem.cpp b/src/gui/graphicsview/qgraphicslayoutitem.cpp index df13039..b11dc9e 100644 --- a/src/gui/graphicsview/qgraphicslayoutitem.cpp +++ b/src/gui/graphicsview/qgraphicslayoutitem.cpp @@ -129,7 +129,6 @@ void QGraphicsLayoutItemPrivate::init() { sizeHintCacheDirty = true; sizeHintWithConstraintCacheDirty = true; - sizePolicy = QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); } /*! @@ -400,6 +399,7 @@ QGraphicsLayoutItem::QGraphicsLayoutItem(QGraphicsLayoutItem *parent, bool isLay { Q_D(QGraphicsLayoutItem); d->init(); + sizePolicy = QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); d->q_ptr = this; } @@ -410,6 +410,7 @@ QGraphicsLayoutItem::QGraphicsLayoutItem(QGraphicsLayoutItemPrivate &dd) : d_ptr(&dd) { Q_D(QGraphicsLayoutItem); + d->init(); d->q_ptr = this; } -- cgit v0.12 From 542fe69cdeff81acb8f986ff4606043613345dc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Tue, 14 Dec 2010 13:03:43 +0100 Subject: Fix to commit 3778c3f5208f3db99d6b23a2a3c4abf1fe2ec64f This is what could happen if you go to lunch before comitting. --- src/gui/graphicsview/qgraphicslayoutitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/graphicsview/qgraphicslayoutitem.cpp b/src/gui/graphicsview/qgraphicslayoutitem.cpp index b11dc9e..0a24aae 100644 --- a/src/gui/graphicsview/qgraphicslayoutitem.cpp +++ b/src/gui/graphicsview/qgraphicslayoutitem.cpp @@ -399,7 +399,7 @@ QGraphicsLayoutItem::QGraphicsLayoutItem(QGraphicsLayoutItem *parent, bool isLay { Q_D(QGraphicsLayoutItem); d->init(); - sizePolicy = QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); + d->sizePolicy = QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); d->q_ptr = this; } -- cgit v0.12 From 0727539b89898544047d32e63633790fa0c44b5a Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 14 Dec 2010 14:03:08 +0100 Subject: Don't delete FBO when resetting glyph cache When the glyph cache is cleared because the max texture size has been exceeded, we shouldn't delete the fbo as this is only created in setContext() and will thus not be recreated. All subsequent resizing of the cache will fail. Task-number: QT-3971 Reviewed-by: Samuel --- src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp index 66445cd..1b879c3 100644 --- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp +++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp @@ -83,13 +83,9 @@ void QGLTextureGlyphCache::clear() if (ctx) { QGLShareContextScope scope(ctx); - if (!ctx->d_ptr->workaround_brokenFBOReadBack) - glDeleteFramebuffers(1, &m_fbo); - if (m_width || m_height) glDeleteTextures(1, &m_texture); - m_fbo = 0; m_texture = 0; m_width = 0; m_height = 0; @@ -105,6 +101,13 @@ void QGLTextureGlyphCache::clear() QGLTextureGlyphCache::~QGLTextureGlyphCache() { + if (ctx) { + QGLShareContextScope scope(ctx); + + if (!ctx->d_ptr->workaround_brokenFBOReadBack) + glDeleteFramebuffers(1, &m_fbo); + } + clear(); } -- cgit v0.12 From c031e5808ee406277a5401c69801e5c6e2ebfaea Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Wed, 15 Dec 2010 14:16:36 +1000 Subject: Fix invalid configurations being added to bearermonitor list. --- examples/network/bearermonitor/bearermonitor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/network/bearermonitor/bearermonitor.cpp b/examples/network/bearermonitor/bearermonitor.cpp index 75ffb01..bfa3d1f 100644 --- a/examples/network/bearermonitor/bearermonitor.cpp +++ b/examples/network/bearermonitor/bearermonitor.cpp @@ -226,7 +226,7 @@ void BearerMonitor::updateConfigurations() if (defaultConfiguration.type() == QNetworkConfiguration::ServiceNetwork) updateSnapConfiguration(defaultItem, defaultConfiguration); - } else { + } else if (defaultConfiguration.isValid()) { configurationAdded(defaultConfiguration); } -- cgit v0.12 From c9faf2defa9fa3209e44e8a5c1ae2da8e630d379 Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Wed, 8 Dec 2010 17:48:14 +1000 Subject: Ensure that DBus is connected before all uses. In early system startup applications may try to use ICD before it is contactable. Ensure that the connection to ICD is established before all calls are made. If ICD is still not contactable QDBusServiceWatcher is used to monitor registration of the com.nokia.icd2 address and reconnection is attempted once ICD is started. Task-number: Maemo 199755 --- src/plugins/bearer/icd/qicdengine.cpp | 93 ++++++++++++++++++++++++++++++----- src/plugins/bearer/icd/qicdengine.h | 6 +++ 2 files changed, 88 insertions(+), 11 deletions(-) diff --git a/src/plugins/bearer/icd/qicdengine.cpp b/src/plugins/bearer/icd/qicdengine.cpp index bdf4e2e..a5a183b 100644 --- a/src/plugins/bearer/icd/qicdengine.cpp +++ b/src/plugins/bearer/icd/qicdengine.cpp @@ -229,7 +229,7 @@ void IapMonitor::iapRemoved(const QString &iap_id) /******************************************************************************/ QIcdEngine::QIcdEngine(QObject *parent) -: QBearerEngine(parent), iapMonitor(0), m_dbusInterface(0), +: QBearerEngine(parent), iapMonitor(0), m_dbusInterface(0), m_icdServiceWatcher(0), firstUpdate(true), m_scanGoingOn(false) { } @@ -248,9 +248,10 @@ QNetworkConfigurationManager::Capabilities QIcdEngine::capabilities() const QNetworkConfigurationManager::NetworkSessionRequired; } -void QIcdEngine::initialize() +bool QIcdEngine::ensureDBusConnection() { - QMutexLocker locker(&mutex); + if (m_dbusInterface) + return true; // Setup DBus Interface for ICD m_dbusInterface = new QDBusInterface(ICD_DBUS_API_INTERFACE, @@ -259,9 +260,22 @@ void QIcdEngine::initialize() QDBusConnection::systemBus(), this); - // abort if cannot connect to DBus. - if (!m_dbusInterface->isValid()) - return; + if (!m_dbusInterface->isValid()) { + delete m_dbusInterface; + m_dbusInterface = 0; + + if (!m_icdServiceWatcher) { + m_icdServiceWatcher = new QDBusServiceWatcher(ICD_DBUS_API_INTERFACE, + QDBusConnection::systemBus(), + QDBusServiceWatcher::WatchForOwnerChange, + this); + + connect(m_icdServiceWatcher, SIGNAL(serviceOwnerChanged(QString,QString,QString)), + this, SLOT(icdServiceOwnerChanged(QString,QString,QString))); + } + + return false; + } connect(&m_scanTimer, SIGNAL(timeout()), this, SLOT(finishAsyncConfigurationUpdate())); m_scanTimer.setSingleShot(true); @@ -289,6 +303,19 @@ void QIcdEngine::initialize() doRequestUpdate(); getIcdInitialState(); + + return true; +} + +void QIcdEngine::initialize() +{ + QMutexLocker locker(&mutex); + + if (!ensureDBusConnection()) { + locker.unlock(); + emit updateCompleted(); + locker.relock(); + } } static inline QString network_attrs_to_security(uint network_attrs) @@ -792,6 +819,9 @@ QNetworkConfigurationPrivatePointer QIcdEngine::defaultConfiguration() { QMutexLocker locker(&mutex); + if (!ensureDBusConnection()) + return QNetworkConfigurationPrivatePointer(); + // Here we just return [ANY] request to icd and let the icd decide which IAP to connect. return userChoiceConfigurations.value(OSSO_IAP_ANY); } @@ -933,13 +963,52 @@ void QIcdEngine::connectionStateSignalsSlot(QDBusMessage msg) locker.relock(); } +void QIcdEngine::icdServiceOwnerChanged(const QString &serviceName, const QString &oldOwner, + const QString &newOwner) +{ + QMutexLocker locker(&mutex); + + if (newOwner.isEmpty()) { + // Disconnected from ICD, remove all configurations + cleanup(); + delete iapMonitor; + iapMonitor = 0; + delete m_dbusInterface; + m_dbusInterface = 0; + + QMutableHashIterator i(accessPointConfigurations); + while (i.hasNext()) { + i.next(); + + QNetworkConfigurationPrivatePointer ptr = i.value(); + i.remove(); + + locker.unlock(); + emit configurationRemoved(ptr); + locker.relock(); + } + + userChoiceConfigurations.clear(); + } else { + // Connected to ICD ensure connection. + ensureDBusConnection(); + } +} + void QIcdEngine::requestUpdate() { QMutexLocker locker(&mutex); - if (m_scanGoingOn) { + if (!ensureDBusConnection()) { + locker.unlock(); + emit updateCompleted(); + locker.relock(); return; } + + if (m_scanGoingOn) + return; + m_scanGoingOn = true; m_dbusInterface->connection().connect(ICD_DBUS_API_INTERFACE, @@ -956,14 +1025,16 @@ void QIcdEngine::requestUpdate() void QIcdEngine::cancelAsyncConfigurationUpdate() { - if (!m_scanGoingOn) { + if (!ensureDBusConnection()) return; - } + + if (!m_scanGoingOn) + return; + m_scanGoingOn = false; - if (m_scanTimer.isActive()) { + if (m_scanTimer.isActive()) m_scanTimer.stop(); - } m_dbusInterface->connection().disconnect(ICD_DBUS_API_INTERFACE, ICD_DBUS_API_PATH, diff --git a/src/plugins/bearer/icd/qicdengine.h b/src/plugins/bearer/icd/qicdengine.h index d528f15..d5b4fb3 100644 --- a/src/plugins/bearer/icd/qicdengine.h +++ b/src/plugins/bearer/icd/qicdengine.h @@ -53,6 +53,7 @@ QT_BEGIN_NAMESPACE class QNetworkConfigurationPrivate; class IapMonitor; class QDBusInterface; +class QDBusServiceWatcher; inline QNetworkConfiguration::BearerType bearerTypeFromIapType(const QString &iapType) { @@ -147,12 +148,15 @@ private Q_SLOTS: void finishAsyncConfigurationUpdate(); void asyncUpdateConfigurationsSlot(QDBusMessage msg); void connectionStateSignalsSlot(QDBusMessage msg); + void icdServiceOwnerChanged(const QString &serviceName, const QString &oldOwner, + const QString &newOwner); private: void startListeningStateSignalsForAllConnections(); void doRequestUpdate(QList scanned = QList()); void cancelAsyncConfigurationUpdate(); void getIcdInitialState(); + bool ensureDBusConnection(); private: IapMonitor *iapMonitor; @@ -162,6 +166,8 @@ private: QStringList m_typesToBeScanned; QList m_scanResult; + QDBusServiceWatcher *m_icdServiceWatcher; + bool firstUpdate; bool m_scanGoingOn; }; -- cgit v0.12 From e75980a322ea1088e1c6bf60259b8ba853d32444 Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Wed, 15 Dec 2010 15:30:43 +1000 Subject: Fix possible null pointer dereference. When parsing a new connection an access point with the same SSID may not have been previously seen. Task-number: QTBUG-15276 --- src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp index 554f9b7..f93b605 100644 --- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp +++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp @@ -743,9 +743,11 @@ QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QStri QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.take(accessPointId); - mutex.unlock(); - emit configurationRemoved(ptr); - mutex.lock(); + if (ptr) { + mutex.unlock(); + emit configurationRemoved(ptr); + mutex.lock(); + } } break; } -- cgit v0.12 From 27de60f2f6047cb3f698825af96e569fde04ef06 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 15 Dec 2010 17:06:25 +1000 Subject: Add extra type of embedded license. Marketing needs this for commercial customers. Reviewed-by: Trust Me --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 7141880..aa8d047 100755 --- a/configure +++ b/configure @@ -480,7 +480,7 @@ elif [ $COMMERCIAL_USER = "yes" ]; then # Qt All-OS LICENSE_EXTENSION="-ALLOS" ;; - 8M,* | KM,* | S9,* | SC,* | SU,* | SW,* | X9,* | XC,* | XU,* | XW,*) + 8M,* | KM,* | S9,* | SC,* | SM,* | SU,* | SW,* | X9,* | XC,* | XU,* | XW,*) # Qt for Embedded Linux LICENSE_EXTENSION="-EMBEDDED" ;; -- cgit v0.12 From 915a31420c4f8d04c82103e3dd4d33b468a9334d Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 15 Dec 2010 11:44:19 +0200 Subject: Resize event for QDesktopWidget was sent too early Some recent changes had caused a change in events sent from avkon to QSymbianControl, causing QDesktopWidget to be get resize event before the client area of application was correct. Moved the resize event sending from HandleStatusPaneSizeChange to HandleResourceChange (case KEikDynamicLayoutVariantSwitch). Task-number: QTBUG-16095 Reviewed-by: Sami Merila --- src/gui/kernel/qapplication_s60.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 81fa4e6..6db1fa8 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -667,9 +667,6 @@ void QSymbianControl::HandleStatusPaneSizeChange() { QS60MainAppUi *s60AppUi = static_cast(S60->appUi()); s60AppUi->HandleStatusPaneSizeChange(); - // Send resize event to trigger desktopwidget workAreaResized signal - QResizeEvent e(qt_desktopWidget->size(), qt_desktopWidget->size()); - QApplication::sendEvent(qt_desktopWidget, &e); } #endif @@ -1310,6 +1307,9 @@ void QSymbianControl::HandleResourceChange(int resourceType) case KEikDynamicLayoutVariantSwitch: { handleClientAreaChange(); + // Send resize event to trigger desktopwidget workAreaResized signal + QResizeEvent e(qt_desktopWidget->size(), qt_desktopWidget->size()); + QApplication::sendEvent(qt_desktopWidget, &e); break; } #endif -- cgit v0.12 From e0aa9897bc2d04054cc65dbe3452bee2ed2eacd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 15 Dec 2010 12:41:08 +0100 Subject: Prevent crash in drawhelper code when the cpu has MMXEXT but no SSE. We can't use the qdrawhelper_sse.cpp or qdrawhelper_sse3dnow.cpp when SSE is not run-time detected, as those are compiled with -msse and MMXEXT is just a subset of SSE. The compiler might choose to use an instruction not in the subset, causing a crash at run-time. Task-number: QTBUG-15693 Reviewed-by: Thiago Macieira --- src/gui/painting/qdrawhelper.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 024a69d..62af212 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -7711,17 +7711,6 @@ void qInitDrawhelperAsm() } #endif #endif // SSE -#if defined(QT_HAVE_MMXEXT) && defined(QT_HAVE_SSE) - } else if (features & MMXEXT) { - qt_memfill32 = qt_memfill32_sse; - qDrawHelper[QImage::Format_RGB16].bitmapBlit = qt_bitmapblit16_sse; -# ifdef QT_HAVE_3DNOW - if (features & MMX3DNOW) { - qt_memfill32 = qt_memfill32_sse3dnow; - qDrawHelper[QImage::Format_RGB16].bitmapBlit = qt_bitmapblit16_sse3dnow; - } -# endif // 3DNOW -#endif // MMXEXT } #ifdef QT_HAVE_MMX if (features & MMX) { -- cgit v0.12 From 21b1b5a9af95af10b281176564f14cafa2339006 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Sat, 11 Dec 2010 00:03:14 +0100 Subject: Improve performance of clipping to a scaled QRectF Clipping to a scaled QRectF was so far hitting the slow code path in the raster paintengine that generates clip spans for every line. This is not needed as we also clip translated QRectF's to integer rects. This patch does the same for scaled rectangles and ensures the clipping really happens at the closest pixel boundary. Reviewed-by: Samuel --- src/gui/painting/qpaintengine_raster.cpp | 33 ++++++++++++++++++++++---------- src/gui/painting/qpaintengine_raster_p.h | 2 ++ 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 89202ac..4d06c9f 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -1212,7 +1212,7 @@ void QRasterPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op) // There are some cases that are not supported by clip(QRect) if (op != Qt::UniteClip && (op != Qt::IntersectClip || !s->clip || s->clip->hasRectClip || s->clip->hasRegionClip)) { - if (s->matrix.type() <= QTransform::TxTranslate + if (s->matrix.type() <= QTransform::TxScale && ((path.shape() == QVectorPath::RectangleHint) || (isRect(points, path.elementCount()) && (!types || (types[0] == QPainterPath::MoveToElement @@ -1224,8 +1224,8 @@ void QRasterPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op) #endif QRectF r(points[0], points[1], points[4]-points[0], points[5]-points[1]); - clip(r.toRect(), op); - return; + if (setClipRectInDeviceCoords(s->matrix.mapRect(r).toRect(), op)) + return; } } @@ -1286,7 +1286,6 @@ void QRasterPaintEngine::clip(const QRect &rect, Qt::ClipOperation op) qDebug() << "QRasterPaintEngine::clip(): " << rect << op; #endif - Q_D(QRasterPaintEngine); QRasterPaintEngineState *s = state(); if (op == Qt::NoClip) { @@ -1296,11 +1295,23 @@ void QRasterPaintEngine::clip(const QRect &rect, Qt::ClipOperation op) QPaintEngineEx::clip(rect, op); return; - } else if (op == Qt::ReplaceClip || s->clip == 0) { + } else if (!setClipRectInDeviceCoords(s->matrix.mapRect(rect), op)) { + QPaintEngineEx::clip(rect, op); + return; + } +} + + +bool QRasterPaintEngine::setClipRectInDeviceCoords(const QRect &r, Qt::ClipOperation op) +{ + Q_D(QRasterPaintEngine); + QRect clipRect = r & d->deviceRect; + QRasterPaintEngineState *s = state(); + + if (op == Qt::ReplaceClip || s->clip == 0) { // No current clip, hence we intersect with sysclip and be // done with it... - QRect clipRect = s->matrix.mapRect(rect) & d->deviceRect; QRegion clipRegion = systemClip(); QClipData *clip = new QClipData(d->rasterBuffer->height()); @@ -1316,12 +1327,11 @@ void QRasterPaintEngine::clip(const QRect &rect, Qt::ClipOperation op) s->clip->enabled = true; s->flags.has_clip_ownership = true; - } else { // intersect clip with current clip + } else if (op == Qt::IntersectClip){ // intersect clip with current clip QClipData *base = s->clip; Q_ASSERT(base); if (base->hasRectClip || base->hasRegionClip) { - QRect clipRect = s->matrix.mapRect(rect) & d->deviceRect; if (!s->flags.has_clip_ownership) { s->clip = new QClipData(d->rasterBuffer->height()); s->flags.has_clip_ownership = true; @@ -1332,11 +1342,14 @@ void QRasterPaintEngine::clip(const QRect &rect, Qt::ClipOperation op) s->clip->setClipRegion(base->clipRegion & clipRect); s->clip->enabled = true; } else { - QPaintEngineEx::clip(rect, op); - return; + return false; } + } else { + return false; } + qrasterpaintengine_dirty_clip(d, s); + return true; } diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h index 1016f8d..7d4d3b6 100644 --- a/src/gui/painting/qpaintengine_raster_p.h +++ b/src/gui/painting/qpaintengine_raster_p.h @@ -266,6 +266,8 @@ private: void drawGlyphsS60(const QPointF &p, const QTextItemInt &ti); #endif // Q_OS_SYMBIAN && QT_NO_FREETYPE + bool setClipRectInDeviceCoords(const QRect &r, Qt::ClipOperation op); + inline void ensureBrush(const QBrush &brush) { if (!qbrush_fast_equals(state()->lastBrush, brush) || (brush.style() != Qt::NoBrush && state()->fillFlags)) updateBrush(brush); -- cgit v0.12 From 3e7adcb80a86748608d5517413301cd2b1b8df78 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 15 Dec 2010 16:42:05 +0100 Subject: Check for null-pointer to avoid a crash in textedit demo. Task-number: QTBUG-16125 Reviewed-by: trustme --- demos/textedit/textedit.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/demos/textedit/textedit.cpp b/demos/textedit/textedit.cpp index 165c97c..9fa1949 100644 --- a/demos/textedit/textedit.cpp +++ b/demos/textedit/textedit.cpp @@ -262,7 +262,8 @@ void TextEdit::setupEditActions() tb->addAction(a); menu->addAction(a); #ifndef QT_NO_CLIPBOARD - actionPaste->setEnabled(QApplication::clipboard()->mimeData()->hasText()); + if (const QMimeData *md = QApplication::clipboard()->mimeData()) + actionPaste->setEnabled(md->hasText()); #endif } @@ -681,7 +682,8 @@ void TextEdit::cursorPositionChanged() void TextEdit::clipboardDataChanged() { #ifndef QT_NO_CLIPBOARD - actionPaste->setEnabled(QApplication::clipboard()->mimeData()->hasText()); + if (const QMimeData *md = QApplication::clipboard()->mimeData()) + actionPaste->setEnabled(md->hasText()); #endif } -- cgit v0.12 From cb51c2157f870a5c83ae6d9435ec4b1004392bc9 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 13 Dec 2010 22:26:39 +0100 Subject: Don't need to set FD_CLOEXEC since qt_safe_* will have done that. Reviewed-By: Trust Me --- src/network/socket/qnativesocketengine_unix.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp index f6bfbac..021acd0 100644 --- a/src/network/socket/qnativesocketengine_unix.cpp +++ b/src/network/socket/qnativesocketengine_unix.cpp @@ -202,9 +202,6 @@ bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType soc return false; } - // Ensure that the socket is closed on exec*(). - ::fcntl(socket, F_SETFD, FD_CLOEXEC); - socketDescriptor = socket; return true; } @@ -565,16 +562,6 @@ int QNativeSocketEnginePrivate::nativeAccept() #else int acceptedDescriptor = qt_safe_accept(socketDescriptor, 0, 0); #endif - //check if we have valid descriptor at all - if(acceptedDescriptor > 0) { - // Ensure that the socket is closed on exec*() - ::fcntl(acceptedDescriptor, F_SETFD, FD_CLOEXEC); - } -#ifdef Q_OS_SYMBIAN - else { - qWarning("QNativeSocketEnginePrivate::nativeAccept() - acceptedDescriptor <= 0"); - } -#endif return acceptedDescriptor; } -- cgit v0.12 From e1955231478df8990cf8b1f80438abf957c5d6f2 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 14 Dec 2010 11:25:32 +0100 Subject: Add a warning about trying to release a timer ID that isn't active Reviewed-By: Trust Me --- src/corelib/kernel/qeventdispatcher_unix.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp index f50994c..b2ccc68 100644 --- a/src/corelib/kernel/qeventdispatcher_unix.cpp +++ b/src/corelib/kernel/qeventdispatcher_unix.cpp @@ -501,6 +501,7 @@ bool QTimerInfoList::unregisterTimer(int timerId) } } // id not found + qWarning("Application asked to unregister timer 0x%x which is not registered in this thread. Fix application.", timerId); return false; } -- cgit v0.12 From 038927f1208ff346cbe8d2cfefbd39808ffb5711 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 15 Dec 2010 18:48:05 +0100 Subject: Autotest: Add some comments about this obscure test. More information, see commit d9bf386d917c64ad5d8f11f9daadf82b2be9d531 (old qt-history) and old TT task 90183. Reviewed-By: Trust Me --- tests/auto/qprocess/tst_qprocess.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/auto/qprocess/tst_qprocess.cpp b/tests/auto/qprocess/tst_qprocess.cpp index fd310f4..13f1d26 100644 --- a/tests/auto/qprocess/tst_qprocess.cpp +++ b/tests/auto/qprocess/tst_qprocess.cpp @@ -1999,11 +1999,15 @@ void tst_QProcess::spaceInName() void tst_QProcess::lockupsInStartDetached() { #if !defined(Q_OS_SYMBIAN) - // What exactly is this call supposed to achieve anyway? + // Check that QProcess doesn't cause a lock up at this program's + // exit if a thread was started and we tried to run a program that + // doesn't exist. Before Qt 4.2, this used to lock up on Unix due + // to calling ::exit instead of ::_exit if execve failed. + QHostInfo::lookupHost(QString("something.invalid"), 0, 0); -#endif QProcess::execute("yjhbrty"); QProcess::startDetached("yjhbrty"); +#endif } //----------------------------------------------------------------------------- -- cgit v0.12 From 7b0809edf975f3226b43d3b43b5fe8035298fde9 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 15 Dec 2010 18:48:48 +0100 Subject: ICC: Don't print warning 1259 since it's too annoying. ICC 12 keeps outputting this when you copy a type of larger size to a smaller, or from int to float. --- mkspecs/linux-icc/qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/linux-icc/qmake.conf b/mkspecs/linux-icc/qmake.conf index af56a9a..ba707e23 100644 --- a/mkspecs/linux-icc/qmake.conf +++ b/mkspecs/linux-icc/qmake.conf @@ -23,7 +23,7 @@ QMAKE_YACC = yacc QMAKE_YACCFLAGS = -d QMAKE_CFLAGS = -falign-stack=maintain-16-byte QMAKE_CFLAGS_DEPS = -M -QMAKE_CFLAGS_WARN_ON = -w1 -Wcheck -wd654,1572,411,873,1125 +QMAKE_CFLAGS_WARN_ON = -w1 -Wcheck -wd654,1572,411,873,1125,2259 QMAKE_CFLAGS_WARN_OFF = -w QMAKE_CFLAGS_RELEASE = -O2 -falign-functions=16 -ansi-alias -fstrict-aliasing QMAKE_CFLAGS_DEBUG = -O0 -g -- cgit v0.12 From 981a83d7832e8cd1ee7bcd42dfaba62f0b04f2c1 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 15 Dec 2010 18:53:57 +0100 Subject: Suppress a warning about killing a timer that isn't active. The timer was active, but it got killed by ~QObject. The QObject d-pointer is deleted after the timers (as is expected), which means that the QBasicTimer destructors in QAbstractItemViewPrivate are run after the timers are already gone. Reviewed-by: Trust Me --- src/gui/itemviews/qabstractitemview.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index acc8deb..177b088 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -595,6 +595,8 @@ QAbstractItemView::QAbstractItemView(QAbstractItemViewPrivate &dd, QWidget *pare */ QAbstractItemView::~QAbstractItemView() { + // stop this timer here before ~QObject + d_func()->delayedReset.stop(); } /*! -- cgit v0.12 From fa57982fadab625fb022d32f690ef05427920581 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 16 Dec 2010 11:30:17 +0100 Subject: QmlDebugger: Fix runtime warnings about unregistered metatypes Check whether the type of a property is known to the metatype system before trying to read from it. That avoids lots of runtime warnings e.g. for the QSequentialGroup::currentAnimation property, which type QAbstractAnimation * isn't registered by default via qRegisterMetaType<>(). Reviewed-by: Christiaan Janssen Task-number: QTCREATORBUG-2853 --- src/declarative/qml/qdeclarativeenginedebug.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp index bffe681..e54f7d6 100644 --- a/src/declarative/qml/qdeclarativeenginedebug.cpp +++ b/src/declarative/qml/qdeclarativeenginedebug.cpp @@ -146,7 +146,10 @@ QDeclarativeEngineDebugServer::propertyData(QObject *obj, int propIdx) if (binding) rv.binding = binding->expression(); - QVariant value = prop.read(obj); + QVariant value; + if (prop.userType() != 0) { + value = prop.read(obj); + } rv.value = valueContents(value); if (QDeclarativeValueTypeFactory::isValueType(prop.userType())) { -- cgit v0.12 From 6f9642572c392536c07a52037e4c1de587489c49 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 16 Dec 2010 13:21:22 +0100 Subject: Add work around for bug when painting w/glTexSubImage into large texture It seems that copying small rectangles from glTexSubImage2D into a texture which is 2048x2048 is busted on some SGX drivers, even though the driver reports 2048 as the maximum texture size. This caused text to turn into flickering garbage once the texture glyph cache had grown to its max size (e.g. when painting very many Chinese glyphs.) To work around the problem, we hardcore the maximum texture height to 1024 on this driver so that the texture glyph cache is reset whenever that size is exceeded. Task-number: QT-3971 Done-with: Samuel --- src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp | 5 ++++- src/opengl/qgl.cpp | 1 + src/opengl/qgl_egl.cpp | 2 ++ src/opengl/qgl_p.h | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp index 1b879c3..ba311c3 100644 --- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp +++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp @@ -323,6 +323,9 @@ int QGLTextureGlyphCache::maxTextureWidth() const int QGLTextureGlyphCache::maxTextureHeight() const { - return ctx->d_ptr->maxTextureSize(); + if (ctx->d_ptr->workaround_brokenTexSubImage) + return qMin(1024, ctx->d_ptr->maxTextureSize()); + else + return ctx->d_ptr->maxTextureSize(); } QT_END_NAMESPACE diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 18f1203..9bf879a 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1706,6 +1706,7 @@ void QGLContextPrivate::init(QPaintDevice *dev, const QGLFormat &format) active_engine = 0; workaround_needsFullClearOnEveryFrame = false; workaround_brokenFBOReadBack = false; + workaround_brokenTexSubImage = false; workaroundsCached = false; workaround_brokenTextureFromPixmap = false; diff --git a/src/opengl/qgl_egl.cpp b/src/opengl/qgl_egl.cpp index 8902099..6f9e39c 100644 --- a/src/opengl/qgl_egl.cpp +++ b/src/opengl/qgl_egl.cpp @@ -204,6 +204,8 @@ void QGLContext::makeCurrent() const char *egl_version = eglQueryString(d->eglContext->display(), EGL_VERSION); if (egl_version && strstr(egl_version, "1.3")) d->workaround_brokenFBOReadBack = true; + else if (egl_version && strstr(egl_version, "1.4")) + d->workaround_brokenTexSubImage = true; } } } diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index b46d428..bf830ba 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -401,6 +401,7 @@ public: // workarounds for driver/hw bugs on different platforms uint workaround_needsFullClearOnEveryFrame : 1; uint workaround_brokenFBOReadBack : 1; + uint workaround_brokenTexSubImage : 1; uint workaroundsCached : 1; uint workaround_brokenTextureFromPixmap : 1; -- cgit v0.12 From ab8a9e77d877fd53eaec8dca1eeca619a4ba81d6 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 16 Dec 2010 12:57:06 +0200 Subject: Avoid duplicate resize event No need to have two resize events in queue for same widget, so do not post a new one if one is already pending in QSymbianControl::SizeChanged(). Reviewed-by: Sami Merila --- src/gui/kernel/qapplication_s60.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 6db1fa8..181fcc7 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1174,8 +1174,10 @@ void QSymbianControl::SizeChanged() if (!slowResize && tlwExtra) tlwExtra->inTopLevelResize = false; } else { - QResizeEvent *e = new QResizeEvent(newSize, oldSize); - QApplication::postEvent(qwidget, e); + if (!qwidget->testAttribute(Qt::WA_PendingResizeEvent)) { + QResizeEvent *e = new QResizeEvent(newSize, oldSize); + QApplication::postEvent(qwidget, e); + } } } -- cgit v0.12 From f0347c8c0c37bd90dcaefb8f4b669096f7eb66b5 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 16 Dec 2010 15:23:51 +0200 Subject: Improved orientation change autotest The test wasn't even compiling anymore, so fixed that. Also added additional orientation change and an available geometry check after each orientation change. Reviewed-by: Sami Merila --- .../orientationchange/orientationchange.pro | 1 + .../orientationchange/tst_orientationchange.cpp | 43 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/tests/auto/symbian/orientationchange/orientationchange.pro b/tests/auto/symbian/orientationchange/orientationchange.pro index 08b34f9..98aa2ad 100644 --- a/tests/auto/symbian/orientationchange/orientationchange.pro +++ b/tests/auto/symbian/orientationchange/orientationchange.pro @@ -4,4 +4,5 @@ SOURCES += tst_orientationchange.cpp symbian { INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + LIBS += -lcone -leikcore -lavkon # Screen orientation } diff --git a/tests/auto/symbian/orientationchange/tst_orientationchange.cpp b/tests/auto/symbian/orientationchange/tst_orientationchange.cpp index eb3709d..2ac2f7f 100644 --- a/tests/auto/symbian/orientationchange/tst_orientationchange.cpp +++ b/tests/auto/symbian/orientationchange/tst_orientationchange.cpp @@ -45,6 +45,8 @@ #include #include +#include +#include class tst_orientationchange : public QObject { @@ -151,6 +153,47 @@ void tst_orientationchange::resizeEventOnOrientationChange() } QCOMPARE(normalWidget->resizeEventCount, 0); + QDesktopWidget desktop; + QRect qtAvail = desktop.availableGeometry(normalWidget); + TRect clientRect = static_cast(CCoeEnv::Static()-> AppUi())->ClientRect(); + QRect symbianAvail = qt_TRect2QRect(clientRect); + QCOMPARE(qtAvail, symbianAvail); + + // Switch orientation back to original + orientation = orientation == CAknAppUi::EAppUiOrientationPortrait + ? CAknAppUi::EAppUiOrientationLandscape + : CAknAppUi::EAppUiOrientationPortrait; + + + fullScreenWidget->reset(); + maximizedWidget->reset(); + normalWidget->reset(); + + TRAP(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); + + qtAvail = desktop.availableGeometry(normalWidget); + clientRect = static_cast(CCoeEnv::Static()-> AppUi())->ClientRect(); + symbianAvail = qt_TRect2QRect(clientRect); + QCOMPARE(qtAvail, symbianAvail); + TRAP(err, appUi->SetOrientationL(CAknAppUi::EAppUiOrientationUnspecified)); delete normalWidget; -- cgit v0.12 From 7857e0cf4673fb0defab5af9c60d0c2dea93e55c Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 15 Dec 2010 18:55:48 +0100 Subject: Doc: typo fixed in doc/src/declarative/extending.qdoc Reviewed-by: TrustMe --- doc/src/declarative/extending.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc index e23ca91..748ec6c 100644 --- a/doc/src/declarative/extending.qdoc +++ b/doc/src/declarative/extending.qdoc @@ -461,7 +461,7 @@ constructing an animation object and manually setting the animation's "target" property, a property value source can be assigned directly to a property of any type and automatically set up this association. -The example shown here is rather contrived: the \c announcment property of the +The example shown here is rather contrived: the \c announcement property of the \c BirthdayParty object is a string that is printed every time it is assigned and the \c HappyBirthdaySong value source generates the lyrics of the song "Happy Birthday". -- cgit v0.12 From 632016368e26ba06d7d09740a8a1805f4ea911f1 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Fri, 17 Dec 2010 15:24:30 +1000 Subject: Update test bitmaps for QDeclarativeImage::svg() autotest on Linux Task-number: Reviewed-by: Martin Jones --- .../declarative/qdeclarativeimage/data/heart.png | Bin 12424 -> 12577 bytes .../declarative/qdeclarativeimage/data/heart200.png | Bin 7943 -> 8063 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/tests/auto/declarative/qdeclarativeimage/data/heart.png b/tests/auto/declarative/qdeclarativeimage/data/heart.png index ff93f6c..abe97fe 100644 Binary files a/tests/auto/declarative/qdeclarativeimage/data/heart.png and b/tests/auto/declarative/qdeclarativeimage/data/heart.png differ diff --git a/tests/auto/declarative/qdeclarativeimage/data/heart200.png b/tests/auto/declarative/qdeclarativeimage/data/heart200.png index 5a31ae8..7fbb13c 100644 Binary files a/tests/auto/declarative/qdeclarativeimage/data/heart200.png and b/tests/auto/declarative/qdeclarativeimage/data/heart200.png differ -- cgit v0.12 From e0abcb2ff7a3044305580659f9a432a9630a5943 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Fri, 17 Dec 2010 16:18:03 +1000 Subject: Fix QDeclarativeState::reset() autotest Current state reset mechanism does not really work for Text elements as the keeping implicit correct would require relayouting of text twice (See bug QTBUG-15118). Changed QDeclarativeState reset autotest to use Image element instead of Text element until the issue has been fixed. Task-number: Reviewed-by: Yann Bodson --- tests/auto/declarative/qdeclarativestates/data/image.png | Bin 0 -> 173 bytes tests/auto/declarative/qdeclarativestates/data/reset.qml | 9 ++++----- .../qdeclarativestates/tst_qdeclarativestates.cpp | 13 ++++++------- 3 files changed, 10 insertions(+), 12 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativestates/data/image.png diff --git a/tests/auto/declarative/qdeclarativestates/data/image.png b/tests/auto/declarative/qdeclarativestates/data/image.png new file mode 100644 index 0000000..ed1833c Binary files /dev/null and b/tests/auto/declarative/qdeclarativestates/data/image.png differ diff --git a/tests/auto/declarative/qdeclarativestates/data/reset.qml b/tests/auto/declarative/qdeclarativestates/data/reset.qml index 8799c97..a140ffa 100644 --- a/tests/auto/declarative/qdeclarativestates/data/reset.qml +++ b/tests/auto/declarative/qdeclarativestates/data/reset.qml @@ -3,17 +3,16 @@ import QtQuick 1.0 Rectangle { width: 640 height: 480 - Text { - id: theText + Image { + id: image width: 40 - wrapMode: Text.WordWrap - text: "a text string that is longer than 40 pixels" + source: "image.png" } states: State { name: "state1" PropertyChanges { - target: theText + target: image width: undefined } } diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp index b8409a5..870842c 100644 --- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp +++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp @@ -44,7 +44,6 @@ #include #include #include -#include #include #include #include @@ -1126,15 +1125,15 @@ void tst_qdeclarativestates::reset() QDeclarativeRectangle *rect = qobject_cast(c.create()); QVERIFY(rect != 0); - QDeclarativeText *text = rect->findChild(); - QVERIFY(text != 0); - QCOMPARE(text->width(), qreal(40.)); - QVERIFY(text->width() < text->height()); + QDeclarativeImage *image = rect->findChild(); + QVERIFY(image != 0); + QCOMPARE(image->width(), qreal(40.)); + QCOMPARE(image->height(), qreal(20.)); QDeclarativeItemPrivate::get(rect)->setState("state1"); - QVERIFY(text->width() > 41); - QVERIFY(text->width() > text->height()); + QCOMPARE(image->width(), 20.0); + QCOMPARE(image->height(), qreal(20.)); } void tst_qdeclarativestates::illegalObjectCreation() -- cgit v0.12 From 80eb3ebbfe24738163532494e8866ac20fd1b0e4 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 16 Dec 2010 16:03:13 +0200 Subject: Fix incorrect file name case for OpenGL libraries in symbian.conf. To support linux builds, file names must be cased correctly. Task-number: QT-4375 Reviewed-by: Miikka Heikkinen --- mkspecs/common/symbian/symbian.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf index 707335c..00cf0d7 100644 --- a/mkspecs/common/symbian/symbian.conf +++ b/mkspecs/common/symbian/symbian.conf @@ -70,12 +70,12 @@ QMAKE_LIBS_CORE = $$QMAKE_LIBS -lefsrv -lhal -lbafl QMAKE_LIBS_GUI = $$QMAKE_LIBS_CORE -lfbscli -lbitgdi -lgdi -lws32 -lapgrfx -lcone -leikcore -lmediaclientaudio -lapparc -lcentralrepository QMAKE_LIBS_NETWORK = QMAKE_LIBS_EGL = -llibEGL -QMAKE_LIBS_OPENGL = -llibglesv2 +QMAKE_LIBS_OPENGL = -llibGLESv2 QMAKE_LIBS_OPENGL_ES1 = -llibGLESv1_CM -QMAKE_LIBS_OPENGL_ES2 = -llibglesv2 -QMAKE_LIBS_OPENGL_QT = -llibglesv2 -lcone -lws32 +QMAKE_LIBS_OPENGL_ES2 = -llibGLESv2 +QMAKE_LIBS_OPENGL_QT = -llibGLESv2 -lcone -lws32 QMAKE_LIBS_OPENGL_ES1_QT = -llibGLESv1_CM -lcone -lws32 -QMAKE_LIBS_OPENGL_ES2_QT = -llibglesv2 -lcone -lws32 +QMAKE_LIBS_OPENGL_ES2_QT = -llibGLESv2 -lcone -lws32 QMAKE_LIBS_OPENVG = -llibOpenVG -lfbscli -lbitgdi -lgdi QMAKE_LIBS_THREAD = -llibpthread QMAKE_LIBS_COMPAT = -- cgit v0.12 From d238b0ba236da4c3c33c0707d8dd6f5e5903d6c0 Mon Sep 17 00:00:00 2001 From: Ville Pernu Date: Fri, 17 Dec 2010 11:08:53 +0200 Subject: Fix waitForOpened not working with already active configuration When an active QNetworkConfiguration is already in use (e.g. browser already open), the QNetworkSession::waitForOpened() did not work properly. Changed one if-statement in the function to adapt to the scenario. Reviewed-by: Perttu Pohjonen Task-number: QTBUG-565 --- src/network/bearer/qnetworksession.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/network/bearer/qnetworksession.cpp b/src/network/bearer/qnetworksession.cpp index 226c3c5..db1a37c 100644 --- a/src/network/bearer/qnetworksession.cpp +++ b/src/network/bearer/qnetworksession.cpp @@ -310,8 +310,9 @@ bool QNetworkSession::waitForOpened(int msecs) if (d->isOpen) return true; - if (d->state != Connecting) + if (!(d->state == Connecting || d->state == Connected)) { return false; + } QEventLoop* loop = new QEventLoop(this); QObject::connect(d, SIGNAL(quitPendingWaitsForOpened()), -- cgit v0.12 From b54efea2e97baac1d9442e829be2d6fb322c5085 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 17 Dec 2010 11:37:52 +0200 Subject: Use relative include instead of absolute in default qmake.conf Absolute include path breaks QtP releases which copy mkspecs under epoc32 and do not necessarily have the sources available in the original absolute path and can't patch the paths either at installation time. Task-number: QTBUG-16172 Reviewed-by: Oswald Buddenhagen --- tools/configure/configureapp.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index c967dad..915a56d 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -3267,8 +3267,14 @@ void Configure::generateConfigfiles() if (qmakeConfFile.open(QFile::WriteOnly | QFile::Text)) { QTextStream qmakeConfStream; qmakeConfStream.setDevice(&qmakeConfFile); + // While QMAKESPEC_ORIGINAL being relative or absolute doesn't matter for the + // primary use of this variable by qmake to identify the original mkspec, the + // variable is also used for few special cases where the absolute path is required. + // Conversely, the include of the original qmake.conf must be done using relative path, + // as some Qt binary deployments are done in a manner that doesn't allow for patching + // the paths at the installation time. qmakeConfStream << "QMAKESPEC_ORIGINAL=" << pltSpec << endl << endl; - qmakeConfStream << "include(" << pltSpec << "/qmake.conf)" << endl; + qmakeConfStream << "include(" << "../" << spec << "/qmake.conf)" << endl << endl; qmakeConfStream.flush(); qmakeConfFile.close(); } -- cgit v0.12 From 184458394b344947bea1852ab88561dc60db6038 Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Mon, 20 Dec 2010 10:32:54 +1000 Subject: Quiet unused parameter warnings. --- src/plugins/bearer/icd/qicdengine.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/bearer/icd/qicdengine.cpp b/src/plugins/bearer/icd/qicdengine.cpp index a5a183b..96827f3 100644 --- a/src/plugins/bearer/icd/qicdengine.cpp +++ b/src/plugins/bearer/icd/qicdengine.cpp @@ -966,6 +966,9 @@ void QIcdEngine::connectionStateSignalsSlot(QDBusMessage msg) void QIcdEngine::icdServiceOwnerChanged(const QString &serviceName, const QString &oldOwner, const QString &newOwner) { + Q_UNUSED(serviceName); + Q_UNUSED(oldOwner); + QMutexLocker locker(&mutex); if (newOwner.isEmpty()) { -- cgit v0.12 From 95b0418a7ee7aee9658fd19b363e73d583af0b04 Mon Sep 17 00:00:00 2001 From: Damian Jansen Date: Mon, 20 Dec 2010 13:09:48 +1000 Subject: Fix deployment of minehunt for Symbian Task: QT-4298 --- demos/declarative/minehunt/minehunt.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/declarative/minehunt/minehunt.pro b/demos/declarative/minehunt/minehunt.pro index 8a7fdc5..5929ecf 100644 --- a/demos/declarative/minehunt/minehunt.pro +++ b/demos/declarative/minehunt/minehunt.pro @@ -18,6 +18,6 @@ symbian:{ TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) qmlminehuntfiles.sources = MinehuntCore minehunt.qml - DEPLOYMENT = qmlminehuntfiles + DEPLOYMENT += qmlminehuntfiles } -- cgit v0.12 From 0aeebdc851682d2afd63494ddeafa4e745ad2b72 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Mon, 20 Dec 2010 14:30:09 +1000 Subject: Update docs on importing javascript files --- doc/src/declarative/javascriptblocks.qdoc | 4 +++- doc/src/declarative/modules.qdoc | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/src/declarative/javascriptblocks.qdoc b/doc/src/declarative/javascriptblocks.qdoc index 155bd6e..68cb392 100644 --- a/doc/src/declarative/javascriptblocks.qdoc +++ b/doc/src/declarative/javascriptblocks.qdoc @@ -99,7 +99,9 @@ resource, the component's \l {QDeclarativeComponent::status()}{status} is set to Imported JavaScript files are always qualified using the "as" keyword. The qualifier for JavaScript files must be unique, so there is always a one-to-one -mapping between qualifiers and JavaScript files. +mapping between qualifiers and JavaScript files. (This also means qualifiers cannot +be named the same as built-in JavaScript objects such as \c Date and \c Math). + \section2 Code-Behind Implementation Files diff --git a/doc/src/declarative/modules.qdoc b/doc/src/declarative/modules.qdoc index 011eb63..bf9f5fd 100644 --- a/doc/src/declarative/modules.qdoc +++ b/doc/src/declarative/modules.qdoc @@ -216,6 +216,8 @@ JavaScript files must always be imported with a named import: } \endqml +The qualifier ("MyScript" in the above example) must be unique within the QML document. +Unlike ordinary modules, multiple scripts cannot be imported into the same namespace. \section1 Writing a qmldir file -- cgit v0.12 From 327169a6a3fb0bac258cb878019734211a707cce Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Mon, 20 Dec 2010 14:30:27 +1000 Subject: Don't truncate image:// url strings prematurely Url fragments and queries were being removed from the image ids passed to QDeclarativeImageProvider. Task-number: QTBUG-16195 Reviewed-by: Martin Jones --- src/declarative/qml/qdeclarativeengine.cpp | 12 ++++-- src/declarative/qml/qdeclarativeimageprovider.cpp | 16 ++++++-- .../tst_qdeclarativeimageprovider.cpp | 46 ++++++++++++++++++++-- 3 files changed, 62 insertions(+), 12 deletions(-) diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 201e675..cf3ea42 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -760,8 +760,10 @@ QImage QDeclarativeEnginePrivate::getImageFromProvider(const QUrl &url, QSize *s QImage image; QSharedPointer provider = imageProviders.value(url.host()); locker.unlock(); - if (provider) - image = provider->requestImage(url.path().mid(1), size, req_size); + if (provider) { + QString imageId = url.toString(QUrl::RemoveScheme | QUrl::RemoveAuthority).mid(1); + image = provider->requestImage(imageId, size, req_size); + } return image; } @@ -771,8 +773,10 @@ QPixmap QDeclarativeEnginePrivate::getPixmapFromProvider(const QUrl &url, QSize QPixmap pixmap; QSharedPointer provider = imageProviders.value(url.host()); locker.unlock(); - if (provider) - pixmap = provider->requestPixmap(url.path().mid(1), size, req_size); + if (provider) { + QString imageId = url.toString(QUrl::RemoveScheme | QUrl::RemoveAuthority).mid(1); + pixmap = provider->requestPixmap(imageId, size, req_size); + } return pixmap; } diff --git a/src/declarative/qml/qdeclarativeimageprovider.cpp b/src/declarative/qml/qdeclarativeimageprovider.cpp index ef31be7..e3da645 100644 --- a/src/declarative/qml/qdeclarativeimageprovider.cpp +++ b/src/declarative/qml/qdeclarativeimageprovider.cpp @@ -182,13 +182,17 @@ QDeclarativeImageProvider::ImageType QDeclarativeImageProvider::imageType() cons Implement this method to return the image with \a id. The default implementation returns an empty image. + The \a id is the requested image source, with the "image:" scheme and + provider identifier removed. For example, if the image \l{Image::}{source} + was "image://myprovider/icons/home", the given \a id would be "icons/home". + The \a requestedSize corresponds to the \l {Image::sourceSize} requested by an Image element. If \a requestedSize is a valid size, the image returned should be of that size. In all cases, \a size must be set to the original size of the image. This - is used to set the \l {Item::}{width} and \l {Item::}{height} of image - elements that should be automatically sized to the loaded image. + is used to set the \l {Item::}{width} and \l {Item::}{height} of the + relevant \l Image if these values have not been set explicitly. \note this method may be called by multiple threads, so ensure the implementation of this method is reentrant. @@ -207,13 +211,17 @@ QImage QDeclarativeImageProvider::requestImage(const QString &id, QSize *size, c Implement this method to return the pixmap with \a id. The default implementation returns an empty pixmap. + The \a id is the requested image source, with the "image:" scheme and + provider identifier removed. For example, if the image \l{Image::}{source} + was "image://myprovider/icons/home", the given \a id would be "icons/home". + The \a requestedSize corresponds to the \l {Image::sourceSize} requested by an Image element. If \a requestedSize is a valid size, the image returned should be of that size. In all cases, \a size must be set to the original size of the image. This - is used to set the \l {Item::}{width} and \l {Item::}{height} of image - elements that should be automatically sized to the loaded image. + is used to set the \l {Item::}{width} and \l {Item::}{height} of the + relevant \l Image if these values have not been set explicitly. */ QPixmap QDeclarativeImageProvider::requestPixmap(const QString &id, QSize *size, const QSize& requestedSize) { diff --git a/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp b/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp index cd12e3a..5b214e6 100644 --- a/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp +++ b/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp @@ -100,6 +100,8 @@ public: QImage requestImage(const QString &id, QSize *size, const QSize& requestedSize) { + lastImageId = id; + if (id == QLatin1String("no-such-file.png")) return QImage(); @@ -114,6 +116,7 @@ public: } bool *deleteWatch; + QString lastImageId; }; Q_DECLARE_METATYPE(TestQImageProvider*); @@ -134,6 +137,8 @@ public: QPixmap requestPixmap(const QString &id, QSize *size, const QSize& requestedSize) { + lastImageId = id; + if (id == QLatin1String("no-such-file.png")) return QPixmap(); @@ -148,6 +153,7 @@ public: } bool *deleteWatch; + QString lastImageId; }; Q_DECLARE_METATYPE(TestQPixmapProvider*); @@ -164,22 +170,49 @@ QString tst_qdeclarativeimageprovider::newImageFileName() const void tst_qdeclarativeimageprovider::fillRequestTestsData(const QString &id) { QTest::addColumn("source"); + QTest::addColumn("imageId"); QTest::addColumn("properties"); QTest::addColumn("size"); QTest::addColumn("error"); - QTest::newRow(QTest::toString(id + " exists")) << newImageFileName() << "" << QSize(100,100) << ""; - QTest::newRow(QTest::toString(id + " scaled")) << newImageFileName() << "sourceSize: \"80x30\"" << QSize(80,30) << ""; + QString fileName = newImageFileName(); + QTest::newRow(QTest::toString(id + " simple test")) + << "image://test/" + fileName << fileName << "" << QSize(100,100) << ""; + + fileName = newImageFileName(); + QTest::newRow(QTest::toString(id + " url with no id")) + << "image://test/" + fileName << "" + fileName << "" << QSize(100,100) << ""; + + fileName = newImageFileName(); + QTest::newRow(QTest::toString(id + " url with path")) + << "image://test/test/path" + fileName << "test/path" + fileName << "" << QSize(100,100) << ""; + + fileName = newImageFileName(); + QTest::newRow(QTest::toString(id + " url with fragment")) + << "image://test/faq.html?#question13" + fileName << "faq.html?#question13" + fileName << "" << QSize(100,100) << ""; - QTest::newRow(QTest::toString(id + " missing")) << "image://test/no-such-file.png" << "" << QSize() + fileName = newImageFileName(); + QTest::newRow(QTest::toString(id + " url with query")) + << "image://test/cgi-bin/drawgraph.cgi?type=pie&color=green" + fileName << "cgi-bin/drawgraph.cgi?type=pie&color=green" + fileName + << "" << QSize(100,100) << ""; + + fileName = newImageFileName(); + QTest::newRow(QTest::toString(id + " scaled image")) + << "image://test/" + fileName << fileName << "sourceSize: \"80x30\"" << QSize(80,30) << ""; + + QTest::newRow(QTest::toString(id + " missing")) + << "image://test/no-such-file.png" << "no-such-file.png" << "" << QSize(100,100) << "file::2:1: QML Image: Failed to get image from provider: image://test/no-such-file.png"; - QTest::newRow(QTest::toString(id + " unknown provider")) << "image://bogus/exists.png" << "" << QSize() + + QTest::newRow(QTest::toString(id + " unknown provider")) + << "image://bogus/exists.png" << "" << "" << QSize() << "file::2:1: QML Image: Failed to get image from provider: image://bogus/exists.png"; } void tst_qdeclarativeimageprovider::runTest(bool async, QDeclarativeImageProvider *provider) { QFETCH(QString, source); + QFETCH(QString, imageId); QFETCH(QString, properties); QFETCH(QSize, size); QFETCH(QString, error); @@ -210,6 +243,11 @@ void tst_qdeclarativeimageprovider::runTest(bool async, QDeclarativeImageProvide QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready); else QVERIFY(obj->status() == QDeclarativeImage::Ready); + if (QByteArray(QTest::currentDataTag()).startsWith("qimage")) + QCOMPARE(static_cast(provider)->lastImageId, imageId); + else + QCOMPARE(static_cast(provider)->lastImageId, imageId); + QCOMPARE(obj->width(), qreal(size.width())); QCOMPARE(obj->height(), qreal(size.height())); QCOMPARE(obj->pixmap().width(), size.width()); -- cgit v0.12 From 28973e50710cfcd96da037cdad7f46700221c185 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Mon, 20 Dec 2010 15:50:41 +1000 Subject: Make it clear which security updates are needed for Visual Studio 2005. As well as Service Pack 1, the compiler also needs four additional security updates in order to work correctly with Qt's pre-built binary package. Task-number: QTBUG-7633 Reviewed-by: Toby Tomkins --- doc/src/getting-started/installation.qdoc | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc index a68310c..5b009cd 100644 --- a/doc/src/getting-started/installation.qdoc +++ b/doc/src/getting-started/installation.qdoc @@ -963,6 +963,7 @@ We hope you will enjoy using Qt. first install the Visual Studio Service Pack 1 available \l{http://www.microsoft.com/downloads/details.aspx?FamilyId=BB4A75AB-E2D4-4C96-B39D-37BAF6B5B1DC&displaylang=en}{here} to avoid runtime conflicts. + Additionally, you must use the Check for Updates feature in the Help menu of the Visual Studio 2005 IDE to apply at least the following security updates: KB937061, KB971023, KB971090, KB973673. If you are using a source edition of Qt, you must first install Perl so that the syncqt script invoked by configure can be executed. You can download -- cgit v0.12 From 95e64de1827f9b2bae829d40756f7142c56c460f Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Mon, 20 Dec 2010 15:44:25 +1000 Subject: Update test bitmaps for QDeclarativeImage::svg() autotest on Windows Task-number: Reviewed-by: Martin Jones --- .../qdeclarativeimage/data/heart-win32.png | Bin 12457 -> 12621 bytes .../qdeclarativeimage/data/heart200-win32.png | Bin 7939 -> 8062 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/tests/auto/declarative/qdeclarativeimage/data/heart-win32.png b/tests/auto/declarative/qdeclarativeimage/data/heart-win32.png index 5992e79..351da13 100644 Binary files a/tests/auto/declarative/qdeclarativeimage/data/heart-win32.png and b/tests/auto/declarative/qdeclarativeimage/data/heart-win32.png differ diff --git a/tests/auto/declarative/qdeclarativeimage/data/heart200-win32.png b/tests/auto/declarative/qdeclarativeimage/data/heart200-win32.png index 19b20a8..4976ff9 100644 Binary files a/tests/auto/declarative/qdeclarativeimage/data/heart200-win32.png and b/tests/auto/declarative/qdeclarativeimage/data/heart200-win32.png differ -- cgit v0.12 From 197ec350e4014330851a013501c6dde3068ac26f Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 20 Dec 2010 17:07:34 +1000 Subject: Setting TextInput.cursorPosition outside bounds crashed. Check bounds in TextInput and TextEdit. Task-number: QTBUG-16188 Reviewed-by: Bea Lam --- src/declarative/graphicsitems/qdeclarativetextedit.cpp | 2 ++ src/declarative/graphicsitems/qdeclarativetextinput.cpp | 2 ++ .../qdeclarativetextedit/tst_qdeclarativetextedit.cpp | 13 +++++++++++++ .../qdeclarativetextinput/tst_qdeclarativetextinput.cpp | 13 +++++++++++++ 4 files changed, 30 insertions(+) diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index e05f4e4..4e16d24 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -643,6 +643,8 @@ int QDeclarativeTextEdit::cursorPosition() const void QDeclarativeTextEdit::setCursorPosition(int pos) { Q_D(QDeclarativeTextEdit); + if (pos < 0 || pos > d->text.length()) + return; QTextCursor cursor = d->control->textCursor(); if (cursor.position() == pos) return; diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index df103de..521e4ab 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -437,6 +437,8 @@ int QDeclarativeTextInput::cursorPosition() const void QDeclarativeTextInput::setCursorPosition(int cp) { Q_D(QDeclarativeTextInput); + if (cp < 0 || cp > d->control->text().length()) + return; d->control->moveCursor(cp); } diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp index a7971cc..c7a51f7 100644 --- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp +++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp @@ -652,6 +652,19 @@ void tst_qdeclarativetextedit::selection() QVERIFY(textEditObject->selectionEnd() == 0); QVERIFY(textEditObject->selectedText().isNull()); + // Verify invalid positions are ignored. + textEditObject->setCursorPosition(-1); + QVERIFY(textEditObject->cursorPosition() == 0); + QVERIFY(textEditObject->selectionStart() == 0); + QVERIFY(textEditObject->selectionEnd() == 0); + QVERIFY(textEditObject->selectedText().isNull()); + + textEditObject->setCursorPosition(textEditObject->text().count()+1); + QVERIFY(textEditObject->cursorPosition() == 0); + QVERIFY(textEditObject->selectionStart() == 0); + QVERIFY(textEditObject->selectionEnd() == 0); + QVERIFY(textEditObject->selectedText().isNull()); + //Test selection for(int i=0; i<= testStr.size(); i++) { textEditObject->select(0,i); diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp index 76e0102..7b2310a 100644 --- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp +++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp @@ -354,6 +354,19 @@ void tst_qdeclarativetextinput::selection() QVERIFY(textinputObject->selectionEnd() == 0); QVERIFY(textinputObject->selectedText().isNull()); + // Verify invalid positions are ignored. + textinputObject->setCursorPosition(-1); + QVERIFY(textinputObject->cursorPosition() == 0); + QVERIFY(textinputObject->selectionStart() == 0); + QVERIFY(textinputObject->selectionEnd() == 0); + QVERIFY(textinputObject->selectedText().isNull()); + + textinputObject->setCursorPosition(textinputObject->text().count()+1); + QVERIFY(textinputObject->cursorPosition() == 0); + QVERIFY(textinputObject->selectionStart() == 0); + QVERIFY(textinputObject->selectionEnd() == 0); + QVERIFY(textinputObject->selectedText().isNull()); + //Test selection for(int i=0; i<= testStr.size(); i++) { textinputObject->select(0,i); -- cgit v0.12 From de72670c620e1193fa875bf1a4adee553700bacb Mon Sep 17 00:00:00 2001 From: Ville Pernu Date: Mon, 20 Dec 2010 09:57:24 +0200 Subject: QNAM HTTP: Fix missing error() signal During download, if a QAbstractSocket::RemoteHostClosedError occurs, the error handling is deferred to _q_disconnected() slot. However, the error message is not saved for the function, and thus the _q_disconnected only emits a finished-signal. We now store an unhandled error into a private member. It is handled and reset by the _q_disconnected (or more specifically, allDone-function). Also, an additional check is made that there are no simultaneous HTTP errors. If a HTTP error exists, any socket errors are suppressed. Task-Number: QT-3494 Reviewed-By: Markus Goetz --- src/network/access/qhttpnetworkconnectionchannel.cpp | 20 +++++++++++++++++++- src/network/access/qhttpnetworkconnectionchannel_p.h | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index c8caad4..c4471eb 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -66,6 +66,7 @@ QHttpNetworkConnectionChannel::QHttpNetworkConnectionChannel() , bytesTotal(0) , resendCurrent(false) , lastStatus(0) + , unhandledError(QNetworkReply::NoError) , pendingEncrypt(false) , reconnectAttempts(2) , authMethod(QAuthenticatorPrivate::None) @@ -642,7 +643,23 @@ void QHttpNetworkConnectionChannel::allDone() // slot connected to it. The socket will not fire readyRead signal, if we are already // in the slot connected to readyRead if (emitFinished) - QMetaObject::invokeMethod(reply, "finished", Qt::QueuedConnection); + { + // Check whether _q_error was invoked previously and if it left a socket + // error unhandled AND that there are no http errors. + // In case there are both socket errors and http errors, the socket error is suppressed. + // Http errors are handled in the QNetworkAccessHttpBackend. + if(unhandledError != QNetworkReply::NoError && reply->statusCode() == 200) { + QString errorString = connection->d_func()->errorDetail(unhandledError, socket, socket->errorString()); + qRegisterMetaType("QNetworkReply::NetworkError"); + QMetaObject::invokeMethod(reply, "finishedWithError", + Qt::QueuedConnection, + Q_ARG(QNetworkReply::NetworkError, unhandledError), + Q_ARG(QString, errorString)); + } else { + QMetaObject::invokeMethod(reply, "finished", Qt::QueuedConnection); + } + unhandledError = QNetworkReply::NoError; // Reset the value + } // reset the reconnection attempts after we receive a complete reply. // in case of failures, each channel will attempt two reconnects before emitting error. reconnectAttempts = 2; @@ -964,6 +981,7 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket errorCode = QNetworkReply::RemoteHostClosedError; } } else { + unhandledError = QNetworkReply::RemoteHostClosedError; return; } break; diff --git a/src/network/access/qhttpnetworkconnectionchannel_p.h b/src/network/access/qhttpnetworkconnectionchannel_p.h index fd18042..e1d42fb 100644 --- a/src/network/access/qhttpnetworkconnectionchannel_p.h +++ b/src/network/access/qhttpnetworkconnectionchannel_p.h @@ -105,6 +105,7 @@ public: qint64 bytesTotal; bool resendCurrent; int lastStatus; // last status received on this channel + QNetworkReply::NetworkError unhandledError; // Stored code of an unhandled error. bool pendingEncrypt; // for https (send after encrypted) int reconnectAttempts; // maximum 2 reconnection attempts QAuthenticatorPrivate::Method authMethod; -- cgit v0.12 From d9dbdb1afde441c8ab87f42b4a5e0e29ad54480c Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Mon, 20 Dec 2010 14:05:53 +0100 Subject: Fixed QStatusBar not to repaint itself too early When the toplevel containing a statusbar is initially shown, QStatusBar will repaint itself way too early - repaint() is called from the LayoutRequest event causing a whole window repaint before the window was resized to the proper size. This caused Qt Creator to paint itself in small size in a maximized window on its startup. Task-number: QTBUG-14547 Reviewed-by: Olivier Goffart --- src/gui/widgets/qstatusbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widgets/qstatusbar.cpp b/src/gui/widgets/qstatusbar.cpp index c88d2a1..c60913e 100644 --- a/src/gui/widgets/qstatusbar.cpp +++ b/src/gui/widgets/qstatusbar.cpp @@ -575,7 +575,7 @@ void QStatusBar::reformat() d->savedStrut = maxH; vbox->addSpacing(2); d->box->activate(); - repaint(); + update(); } /*! -- cgit v0.12 From 215748d3be876ffec5d72f2d1dfcce56bb7a5937 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 20 Dec 2010 17:38:05 +0200 Subject: Fix using QFileDialog statics in Symbian. Trying to access files outside C:/data with QFileDialog static functions either paniced or simply threw an exception depending on what you were trying to do exactly. To fix this, QFileDialog static functions now will default to QDir::rootPath() if the path specified by user is invalid. Task-number: QTBUG-16204 Reviewed-by: Janne Koskinen --- src/gui/dialogs/qfiledialog_symbian.cpp | 69 ++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 28 deletions(-) diff --git a/src/gui/dialogs/qfiledialog_symbian.cpp b/src/gui/dialogs/qfiledialog_symbian.cpp index 1f70305..d82ce2b 100644 --- a/src/gui/dialogs/qfiledialog_symbian.cpp +++ b/src/gui/dialogs/qfiledialog_symbian.cpp @@ -119,36 +119,49 @@ static QString launchSymbianDialog(const QString dialogCaption, const QString st { QString selection; #if defined(Q_WS_S60) && defined(SYMBIAN_VERSION_SYMBIAN3) - QT_TRAP_THROWING( - TFileName startFolder; - if (!startDirectory.isEmpty()) { - QString dir = QDir::toNativeSeparators(startDirectory); + TFileName startFolder; + if (!startDirectory.isEmpty()) { + QString dir = QDir::toNativeSeparators(QFileDialogPrivate::workingDirectory(startDirectory)); + startFolder = qt_QString2TPtrC(dir); + } + TInt types = AknCommonDialogsDynMem::EMemoryTypeMMCExternal| + AknCommonDialogsDynMem::EMemoryTypeInternalMassStorage| + AknCommonDialogsDynMem::EMemoryTypePhone; + + TPtrC titlePtr(qt_QString2TPtrC(dialogCaption)); + TFileName target; + bool select = false; + int tryCount = 2; + while (tryCount--) { + TInt err(KErrNone); + TRAP(err, + if (dialogMode == DialogOpen) { + CExtensionFilter* extensionFilter = new (ELeave) CExtensionFilter; + CleanupStack::PushL(extensionFilter); + extensionFilter->setFilter(filter); + select = AknCommonDialogsDynMem::RunSelectDlgLD(types, target, + startFolder, NULL, NULL, titlePtr, extensionFilter); + CleanupStack::Pop(extensionFilter); + } else if (dialogMode == DialogSave) { + select = AknCommonDialogsDynMem::RunSaveDlgLD(types, target, + startFolder, NULL, NULL, titlePtr); + } else if (dialogMode == DialogFolder) { + select = AknCommonDialogsDynMem::RunFolderSelectDlgLD(types, target, startFolder, + 0, 0, titlePtr, NULL, NULL); + } + ); + + if (err == KErrNone) { + tryCount = 0; + } else { + // Symbian native file dialog doesn't allow accessing files outside C:/Data + // It will always leave in that case, so default into QDir::rootPath() in error cases. + QString dir = QDir::toNativeSeparators(QDir::rootPath()); startFolder = qt_QString2TPtrC(dir); } - TInt types = AknCommonDialogsDynMem::EMemoryTypeMMCExternal| - AknCommonDialogsDynMem::EMemoryTypeInternalMassStorage| - AknCommonDialogsDynMem::EMemoryTypePhone; - - TPtrC titlePtr(qt_QString2TPtrC(dialogCaption)); - TFileName target; - bool select = false; - if (dialogMode == DialogOpen) { - CExtensionFilter* extensionFilter = new (ELeave) CExtensionFilter; - CleanupStack::PushL(extensionFilter); - extensionFilter->setFilter(filter); - select = AknCommonDialogsDynMem::RunSelectDlgLD(types, target, - startFolder, NULL, NULL, titlePtr, extensionFilter); - CleanupStack::Pop(extensionFilter); - } else if (dialogMode == DialogSave) { - select = AknCommonDialogsDynMem::RunSaveDlgLD(types, target, - startFolder, NULL, NULL, titlePtr); - } else if (dialogMode == DialogFolder) { - select = AknCommonDialogsDynMem::RunFolderSelectDlgLD(types, target, startFolder, - 0, 0, titlePtr, NULL, NULL); - } - if (select) - selection.append(qt_TDesC2QString(target)); - ); + } + if (select) + selection.append(qt_TDesC2QString(target)); #endif return selection; } -- cgit v0.12 From e8d42e5861bdfd6acec3bf1ccc8d55b09b1cc573 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 20 Dec 2010 17:53:57 +0200 Subject: Remove few compile warnings Reviewed-by: Janne Koskinen --- src/gui/dialogs/qfiledialog_symbian.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/dialogs/qfiledialog_symbian.cpp b/src/gui/dialogs/qfiledialog_symbian.cpp index d82ce2b..1fc5f5e 100644 --- a/src/gui/dialogs/qfiledialog_symbian.cpp +++ b/src/gui/dialogs/qfiledialog_symbian.cpp @@ -64,7 +64,7 @@ public: filterList.clear(); if (filter.left(2) == QLatin1String("*.")) { //Filter has only extensions - filterList << filter.split(" "); + filterList << filter.split(QLatin1String(" ")); return; } else { //Extensions are in parenthesis and there may be several filters @@ -75,7 +75,7 @@ public: return; } } - QRegExp rx("\\(([^\\)]*)\\)"); + QRegExp rx(QLatin1String("\\(([^\\)]*)\\)")); int pos = 0; while ((pos = rx.indexIn(filter, pos)) != -1) { filterList << rx.cap(1).split(QLatin1String(" ")); -- cgit v0.12 From 7747e8864db4518e35d5a472cec37697b85b3b15 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Mon, 20 Dec 2010 16:02:33 +0000 Subject: runonphone: Check that the device->config is valid before dereferencing it In some occasions (encountered on OS X), this can be null for some devices. Merge-request: 834 Reviewed-by: Shane Kearns --- tools/runonphone/serenum_unix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/runonphone/serenum_unix.cpp b/tools/runonphone/serenum_unix.cpp index db6375e..f65497e 100644 --- a/tools/runonphone/serenum_unix.cpp +++ b/tools/runonphone/serenum_unix.cpp @@ -82,7 +82,7 @@ QList enumerateSerialPorts(int loglevel) for (struct usb_bus *bus = usb_get_busses(); bus; bus = bus->next) { for (struct usb_device *device = bus->devices; device; device = device->next) { - for (int n = 0; n < device->descriptor.bNumConfigurations; ++n) { + for (int n = 0; n < device->descriptor.bNumConfigurations && device->config; ++n) { struct usb_config_descriptor &usbConfig =device->config[n]; QList usableInterfaces; for (int m = 0; m < usbConfig.bNumInterfaces; ++m) { -- cgit v0.12 From 11ea9609129205cd08dc5fbeb889cc60f4f84f65 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Mon, 20 Dec 2010 16:02:37 +0000 Subject: reword: Make the USB serial device enumeration work on OS X, too Tested on OS X Snow Leopard with libusb-0.1.12. The devices are named /dev/cu.usbmodem, where the opaque id doesn't seem to be available via the current libusb interface, but finding it would require usage of native OS X APIs. The interface number is available at least, and searching for cu\.usbmodem.* as a regexp finds the right devices as long as not too many devices are connected. Merge-request: 834 Reviewed-by: Shane Kearns --- tools/runonphone/serenum_unix.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/tools/runonphone/serenum_unix.cpp b/tools/runonphone/serenum_unix.cpp index f65497e..93d8c67 100644 --- a/tools/runonphone/serenum_unix.cpp +++ b/tools/runonphone/serenum_unix.cpp @@ -158,6 +158,10 @@ QList enumerateSerialPorts(int loglevel) << "device" << device->filename << "interface" << descriptor.bInterfaceNumber; } +#ifdef Q_OS_MAC + eligibleInterfaces << QString("^cu\\.usbmodem.*%1$") + .arg(QString("%1").arg(descriptor.bInterfaceNumber, 1, 16).toUpper()); +#else // ### manufacturer and product strings are only readable as root :( if (!manufacturerString.isEmpty() && !productString.isEmpty()) { eligibleInterfaces << QString("usb-%1_%2-if%3") @@ -167,6 +171,7 @@ QList enumerateSerialPorts(int loglevel) } else { eligibleInterfaces << QString("if%1").arg(i, 2, 16, QChar('0')); // fix! } +#endif eligibleInterfacesInfo << InterfaceInfo(manufacturerString, productString, device->descriptor.idVendor, device->descriptor.idProduct); } } @@ -179,14 +184,24 @@ QList enumerateSerialPorts(int loglevel) if (loglevel > 1) qDebug() << " searching for interfaces:" << eligibleInterfaces; +#ifdef Q_OS_MAC + QDir dir("/dev/"); + bool allowAny = false; +#else QDir dir("/dev/serial/by-id/"); - foreach (const QFileInfo &info, dir.entryInfoList()) { + bool allowAny = eligibleInterfaces.isEmpty(); +#endif + foreach (const QFileInfo &info, dir.entryInfoList(QDir::System)) { if (!info.isDir()) { - bool usable = eligibleInterfaces.isEmpty(); + bool usable = allowAny; + QString friendlyName = info.fileName(); foreach (const QString &iface, eligibleInterfaces) { - if (info.fileName().contains(iface)) { + if (info.fileName().contains(QRegExp(iface))) { if (loglevel > 1) qDebug() << " found device file:" << info.fileName() << endl; +#ifdef Q_OS_MAC + friendlyName = eligibleInterfacesInfo[eligibleInterfaces.indexOf(iface)].product; +#endif usable = true; break; } @@ -195,7 +210,7 @@ QList enumerateSerialPorts(int loglevel) continue; SerialPortId id; - id.friendlyName = info.fileName(); + id.friendlyName = friendlyName; id.portName = info.canonicalFilePath(); list << id; } -- cgit v0.12 From d6a7931c5a2b90c0c276a1367135c9dc4e7532cd Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Mon, 20 Dec 2010 16:02:42 +0000 Subject: runonphone: Only print the modprobe instructions on linux Merge-request: 834 Reviewed-by: Shane Kearns --- tools/runonphone/serenum_unix.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/runonphone/serenum_unix.cpp b/tools/runonphone/serenum_unix.cpp index 93d8c67..86e797b 100644 --- a/tools/runonphone/serenum_unix.cpp +++ b/tools/runonphone/serenum_unix.cpp @@ -223,11 +223,15 @@ QList enumerateSerialPorts(int loglevel) << iface.manufacturer << "Product:" << iface.product +#ifdef Q_OS_LINUX << endl << " Load generic driver using:" << QString("sudo modprobe usbserial vendor=0x%1 product=0x%2") .arg(iface.manufacturerid, 4, 16, QChar('0')) .arg(iface.productid, 4, 16, QChar('0')); +#else + ; +#endif } } return list; -- cgit v0.12 From 7d2dc192477c0d10b2c5c9f144e2a37a270093f0 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Tue, 21 Dec 2010 10:57:44 +1000 Subject: Add tests for ListView.indexAt() and GridView.IndexAt() --- .../tst_qdeclarativegridview.cpp | 37 ++++++++++++++++++++++ .../tst_qdeclarativelistview.cpp | 33 +++++++++++++++++++ 2 files changed, 70 insertions(+) diff --git a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp index fd5d140..a2dcf1c 100644 --- a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp +++ b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp @@ -84,6 +84,7 @@ private slots: void manualHighlight(); void footer(); void header(); + void indexAt(); private: QDeclarativeView *createView(); @@ -1299,6 +1300,42 @@ void tst_QDeclarativeGridView::header() QTRY_COMPARE(header->y(), 0.0); } +void tst_QDeclarativeGridView::indexAt() +{ + QDeclarativeView *canvas = createView(); + + TestModel model; + model.addItem("Fred", "12345"); + model.addItem("John", "2345"); + model.addItem("Bob", "54321"); + model.addItem("Billy", "22345"); + model.addItem("Sam", "2945"); + model.addItem("Ben", "04321"); + model.addItem("Jim", "0780"); + + QDeclarativeContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + ctxt->setContextProperty("testTopToBottom", QVariant(false)); + + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/gridview1.qml")); + qApp->processEvents(); + + QDeclarativeGridView *gridview = findItem(canvas->rootObject(), "grid"); + QTRY_VERIFY(gridview != 0); + + QDeclarativeItem *contentItem = gridview->contentItem(); + QTRY_VERIFY(contentItem != 0); + + QTRY_COMPARE(gridview->count(), model.count()); + + QCOMPARE(gridview->indexAt(0, 0), 0); + QCOMPARE(gridview->indexAt(79, 59), 0); + QCOMPARE(gridview->indexAt(80, 0), 1); + QCOMPARE(gridview->indexAt(0, 60), 3); + QCOMPARE(gridview->indexAt(240, 0), -1); + + delete canvas; +} QDeclarativeView *tst_QDeclarativeGridView::createView() { diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp index b834d46..3df10a9 100644 --- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp +++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp @@ -105,6 +105,7 @@ private slots: void QTBUG_14821(); void resizeDelegate(); void QTBUG_16037(); + void indexAt(); private: template void items(); @@ -1964,6 +1965,38 @@ void tst_QDeclarativeListView::QTBUG_16037() delete canvas; } +void tst_QDeclarativeListView::indexAt() +{ + QDeclarativeView *canvas = createView(); + + TestModel model; + for (int i = 0; i < 30; i++) + model.addItem("Item" + QString::number(i), ""); + + QDeclarativeContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + TestObject *testObject = new TestObject; + ctxt->setContextProperty("testObject", testObject); + + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/listviewtest.qml")); + qApp->processEvents(); + + QDeclarativeListView *listview = findItem(canvas->rootObject(), "list"); + QTRY_VERIFY(listview != 0); + + QDeclarativeItem *contentItem = listview->contentItem(); + QTRY_VERIFY(contentItem != 0); + + QCOMPARE(listview->indexAt(0,0), 0); + QCOMPARE(listview->indexAt(0,19), 0); + QCOMPARE(listview->indexAt(239,19), 0); + QCOMPARE(listview->indexAt(0,20), 1); + QCOMPARE(listview->indexAt(240,20), -1); + + delete canvas; +} + void tst_QDeclarativeListView::qListModelInterface_items() { items(); -- cgit v0.12 From bc679ceb8ad36de1da696f7f67e71145ceec7f98 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Tue, 21 Dec 2010 11:11:59 +1000 Subject: More testing for KeyNavigation attached properties. --- .../qdeclarativeitem/data/keynavigationtest.qml | 40 ++++++++++++++++++++++ .../qdeclarativeitem/tst_qdeclarativeitem.cpp | 5 +++ 2 files changed, 45 insertions(+) diff --git a/tests/auto/declarative/qdeclarativeitem/data/keynavigationtest.qml b/tests/auto/declarative/qdeclarativeitem/data/keynavigationtest.qml index 229f969..f614a12 100644 --- a/tests/auto/declarative/qdeclarativeitem/data/keynavigationtest.qml +++ b/tests/auto/declarative/qdeclarativeitem/data/keynavigationtest.qml @@ -3,6 +3,46 @@ import QtQuick 1.0 Grid { columns: 2 width: 100; height: 100 + function verify() { + if (item1.KeyNavigation.right != item2) + return false; + if (item1.KeyNavigation.down != item3) + return false; + if (item1.KeyNavigation.tab != item2) + return false; + if (item1.KeyNavigation.backtab != item4) + return false; + + if (item2.KeyNavigation.left != item1) + return false; + if (item2.KeyNavigation.down != item4) + return false; + if (item2.KeyNavigation.tab != item3) + return false; + if (item2.KeyNavigation.backtab != item1) + return false; + + if (item3.KeyNavigation.right != item4) + return false; + if (item3.KeyNavigation.up != item1) + return false; + if (item3.KeyNavigation.tab != item4) + return false; + if (item3.KeyNavigation.backtab != item2) + return false; + + if (item4.KeyNavigation.left != item3) + return false; + if (item4.KeyNavigation.up != item2) + return false; + if (item4.KeyNavigation.tab != item1) + return false; + if (item4.KeyNavigation.backtab != item3) + return false; + + return true; + } + Rectangle { id: item1 objectName: "item1" diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp index 711bf00..0ebb8b7 100644 --- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp +++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp @@ -393,6 +393,11 @@ void tst_QDeclarativeItem::keyNavigation() QVERIFY(item); QVERIFY(item->hasActiveFocus()); + QVariant result; + QVERIFY(QMetaObject::invokeMethod(canvas->rootObject(), "verify", + Q_RETURN_ARG(QVariant, result))); + QVERIFY(result.toBool()); + // right QKeyEvent key(QEvent::KeyPress, Qt::Key_Right, Qt::NoModifier, "", false, 1); QApplication::sendEvent(canvas, &key); -- cgit v0.12 From 4ff05f2ed8cef9a126af023a4692eb8c50a0a892 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Tue, 21 Dec 2010 15:58:12 +1000 Subject: Fix number of chapters in qtestlib tutorial. Task-number: QTBUG-10248 Reviewed-by: Trust Me --- doc/src/development/qtestlib.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/development/qtestlib.qdoc b/doc/src/development/qtestlib.qdoc index e53957f..38c2220 100644 --- a/doc/src/development/qtestlib.qdoc +++ b/doc/src/development/qtestlib.qdoc @@ -370,7 +370,7 @@ \title QTestLib Tutorial This tutorial gives a short introduction to how to use some of the - features of the QTestLib framework. It is divided into four + features of the QTestLib framework. It is divided into five chapters: \list 1 -- cgit v0.12 From ff187688e113ec157dd14abcef0faf602b68901c Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 21 Dec 2010 14:21:21 +0100 Subject: Doc: Added a missing license header. --- doc/src/snippets/declarative/focus/focusColumn.qml | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/doc/src/snippets/declarative/focus/focusColumn.qml b/doc/src/snippets/declarative/focus/focusColumn.qml index eb59309..42ee3da 100644 --- a/doc/src/snippets/declarative/focus/focusColumn.qml +++ b/doc/src/snippets/declarative/focus/focusColumn.qml @@ -1,3 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ import QtQuick 1.0 Rectangle { -- cgit v0.12 From afa22a20c1b89960b647b0e3a9dc390fe6f87eae Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Wed, 22 Dec 2010 08:48:40 +1000 Subject: tst_headers: make failure more detailed when failing to open a file Replace QVERIFY(f.open(...)) with QVERIFY2(f.open(...), qPrintable(f.errorString())) This pattern should be followed for all functions which can provide an error string on failure. --- tests/auto/headers/tst_headers.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/auto/headers/tst_headers.cpp b/tests/auto/headers/tst_headers.cpp index 7ccf058..8c8bc2c 100644 --- a/tests/auto/headers/tst_headers.cpp +++ b/tests/auto/headers/tst_headers.cpp @@ -203,7 +203,7 @@ void tst_Headers::licenseCheck() QFETCH(QString, sourceFile); QFile f(sourceFile); - QVERIFY(f.open(QIODevice::ReadOnly)); + QVERIFY2(f.open(QIODevice::ReadOnly), qPrintable(f.errorString())); QByteArray data = f.readAll(); data.replace("\r\n", "\n"); // Windows data.replace('\r', '\n'); // Mac OS9 @@ -264,7 +264,7 @@ void tst_Headers::privateSlots() return; QFile f(header); - QVERIFY(f.open(QIODevice::ReadOnly)); + QVERIFY2(f.open(QIODevice::ReadOnly), qPrintable(f.errorString())); QStringList content = QString::fromLocal8Bit(f.readAll()).split("\n"); foreach (QString line, content) { @@ -286,7 +286,7 @@ void tst_Headers::macros() return; QFile f(header); - QVERIFY(f.open(QIODevice::ReadOnly)); + QVERIFY2(f.open(QIODevice::ReadOnly), qPrintable(f.errorString())); QByteArray data = f.readAll(); QStringList content = QString::fromLocal8Bit(data.replace('\r', "")).split("\n"); -- cgit v0.12