diff options
Diffstat (limited to 'doc')
24 files changed, 478 insertions, 208 deletions
diff --git a/doc/src/declarative/advtutorial.qdoc b/doc/src/declarative/advtutorial.qdoc index 4c97e1a..2ca9418 100644 --- a/doc/src/declarative/advtutorial.qdoc +++ b/doc/src/declarative/advtutorial.qdoc @@ -423,7 +423,7 @@ Here is the \c saveHighScore() function in \c samegame.js: First we call \c sendHighScore() (explained in the section below) if it is possible to send the high scores to an online database. -Then, we use the \l{Offline Storage API} to maintain a persistant SQL database unique to this application. We create an offline storage database for the high scores using \c openDatabase() and prepare the data and SQL query that we want to use to save it. The offline storage API uses SQL queries for data manipulation and retrival, and in the \c db.transaction() call we use three SQL queries to initialize the database (if necessary), and then add to and retrieve high scores. To use the returned data, we turn it into a string with one line per row returned, and show a dialog containing that string. +Then, we use the \l{Offline Storage API} to maintain a persistent SQL database unique to this application. We create an offline storage database for the high scores using \c openDatabase() and prepare the data and SQL query that we want to use to save it. The offline storage API uses SQL queries for data manipulation and retrieval, and in the \c db.transaction() call we use three SQL queries to initialize the database (if necessary), and then add to and retrieve high scores. To use the returned data, we turn it into a string with one line per row returned, and show a dialog containing that string. This is one way of storing and displaying high scores locally, but certainly not the only way. A more complex alternative would be to create a high score dialog component, and pass it the results for processing and display (instead of reusing the \c Dialog). This would allow a more themeable dialog that could better present the high scores. If your QML is the UI for a C++ application, you could also have passed the score to a C++ function to store it locally in a variety of ways, including a simple format without SQL or in another SQL database. diff --git a/doc/src/declarative/basictypes.qdoc b/doc/src/declarative/basictypes.qdoc index e327d4a..e8aceb3 100644 --- a/doc/src/declarative/basictypes.qdoc +++ b/doc/src/declarative/basictypes.qdoc @@ -156,8 +156,10 @@ Example: \qml Rectangle { color: "steelblue" } + Rectangle { color: "transparent" } Rectangle { color: "#FF0000" } Rectangle { color: "#800000FF" } + Rectangle { color: "#00000000" } // ARGB fully transparent \endqml Or with the \l{QML:Qt::rgba()}{Qt.rgba()}, \l{QML:Qt::hsla()}{Qt.hsla()}, \l{QML:Qt::darker()}{Qt.darker()}, diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc index a1ffde0..df8a1e7 100644 --- a/doc/src/declarative/extending.qdoc +++ b/doc/src/declarative/extending.qdoc @@ -719,7 +719,7 @@ it in two steps, like this: \endcode If a default value is not supplied or set later in the file, each type has a -default value for when none is explictly set. Below are the default values +default value for when none is explicitly set. Below are the default values of some of the types. For the remaining types the default values are undefined. \table @@ -823,7 +823,7 @@ A property alias declaration looks a lot like a property definition: As the aliasing property has the same type as the aliased property, an explicit type is omitted, and the special "alias" keyword is used. Instead of a default -value, a property alias includes a compulsary alias reference. The alias +value, a property alias includes a compulsory alias reference. The alias reference is used to locate the aliased property. While similar to a property binding, the alias reference syntax is highly restricted. @@ -993,7 +993,7 @@ Return values of type QVariant are also supported via Q_RETURN_ARG. \target components A component is a reusable type with a well-defined interface built entirely in -QML. Components appear as regular QML elements, and can be used interchangably +QML. Components appear as regular QML elements, and can be used interchangeably with core types. Components allow developers to create new types to be reused in other projects without the use of C++. Components can also help to reduce duplication inside one project by limiting the need for large numbers of @@ -1086,7 +1086,7 @@ Methods and signals may be added in the same way. As all external methods, signals and properties are accessible to external users, developers should ensure that setting these properties does not have -any undesirable side-effects. For most resiliance, root level properties should +any undesirable side-effects. For most resilience, root level properties should only be used for literal default values. When a root level property must be used inside the component - such as the children property - property aliases can be used to redirect this property to a "safe" location for external users. diff --git a/doc/src/declarative/focus.qdoc b/doc/src/declarative/focus.qdoc index 56ea165..c3c94c5 100644 --- a/doc/src/declarative/focus.qdoc +++ b/doc/src/declarative/focus.qdoc @@ -120,7 +120,7 @@ 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 -reponds accordingly. +responds accordingly. \table \row @@ -276,7 +276,7 @@ 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 -noticable as \l ListView doesn't usually have manually added visual children. +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. @@ -301,14 +301,4 @@ actually performs the work of handling the \e {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. - -\section1 Focus Panels - -Traditional UIs are composed of many top-level windows. Windows actually -perform two tasks - they act as the visual bounds for a widget, and they segment -focus. Each window has a separate focused widget, that becomes (to mix -terminologies) the \e {active focus} widget when the window is the active -window. - -### Focus panels do basically the same thing. */ diff --git a/doc/src/declarative/modules.qdoc b/doc/src/declarative/modules.qdoc index 044c1e7..25a61c9 100644 --- a/doc/src/declarative/modules.qdoc +++ b/doc/src/declarative/modules.qdoc @@ -233,7 +233,7 @@ internal <TypeName> <File> plugin <Name> [<Path>] \endcode -\bold {# <Commment>} lines are used for comments. They are ignored by the QML engine. +\bold {# <Comment>} lines are used for comments. They are ignored by the QML engine. \bold {<TypeName> [<InitialVersion>] <File>} lines are used to add QML files as types. <TypeName> is the type being made available, the optional <InitialVersion> is a version @@ -246,7 +246,7 @@ the \c qmldir file. Types which you do not wish to export to users of your modul may be marked with the \c internal keyword: \bold {internal <TypeName> <File>}. The same type can be provided by different files in different versions, in which -case later versions (eg. 1.2) must precede earlier versions (eg. 1.0), +case later versions (e.g. 1.2) must precede earlier versions (e.g. 1.0), since the \e first name-version match is used and a request for a version of a type can be fulfilled by one defined in an earlier version of the module. If a user attempts to import a version earlier than the earliest provided or later than the latest provided, diff --git a/doc/src/declarative/propertybinding.qdoc b/doc/src/declarative/propertybinding.qdoc index 314bf67..f58d8fe 100644 --- a/doc/src/declarative/propertybinding.qdoc +++ b/doc/src/declarative/propertybinding.qdoc @@ -48,7 +48,7 @@ Rectangle { QML extends a standards compliant JavaScript engine, so any valid JavaScript expression can be used as a property binding. Bindings can access object properties, make function calls and even use builtin JavaScript objects like \e {Date} and \e {Math}. Assigning a constant value to a -property can even be thought of as a binding - afterall, a constant is a valid JavaScript +property can even be thought of as a binding - after all, a constant is a valid JavaScript expression! Here are some examples of more complex bindings: \code diff --git a/doc/src/declarative/qdeclarativeintro.qdoc b/doc/src/declarative/qdeclarativeintro.qdoc index 9d89edf..c97240c 100644 --- a/doc/src/declarative/qdeclarativeintro.qdoc +++ b/doc/src/declarative/qdeclarativeintro.qdoc @@ -173,7 +173,7 @@ Item { } \endcode -QML properties are what is known as \e typesafe. That is, they only allow you to assign a value that +QML properties are what is known as \e type-safe. That is, they only allow you to assign a value that matches the property type. For example, the \c x property of item is a real, and if you try to assign a string to it you will get an error. @@ -189,7 +189,7 @@ Each object can be given a special unique property called an \e id. No other obj same \l{QML Documents}{QML document} can have the same \c id value. Assigning an id enables the object to be referred to by other objects and scripts. -The first Rectangle element below has an \e id, "myRect". The second Rectange element defines its +The first Rectangle element below has an \e id, "myRect". The second Rectangle element defines its own width by referring to \tt myRect.width, which means it will have the same \tt width value as the first Rectangle element. diff --git a/doc/src/declarative/qdeclarativeperformance.qdoc b/doc/src/declarative/qdeclarativeperformance.qdoc index be8c029..061a71c 100644 --- a/doc/src/declarative/qdeclarativeperformance.qdoc +++ b/doc/src/declarative/qdeclarativeperformance.qdoc @@ -51,7 +51,7 @@ Rectangle { x: 20 width: 200; height: 200 } -Rectange { +Rectangle { id: rect2 x: rect1.x y: rect1.y + rect1.height @@ -68,7 +68,7 @@ Rectangle { x: 20 width: 200; height: 200 } -Rectange { +Rectangle { id: rect2 height: 200 anchors.left: rect1.left diff --git a/doc/src/declarative/qdeclarativesecurity.qdoc b/doc/src/declarative/qdeclarativesecurity.qdoc index 199e2da..7395af3 100644 --- a/doc/src/declarative/qdeclarativesecurity.qdoc +++ b/doc/src/declarative/qdeclarativesecurity.qdoc @@ -48,7 +48,7 @@ import "http://evil.com/evil.js" as Evil is equivalent to downloading "http://evil.com/evil.exe" and running it. The JavaScript execution environment of QML does not try to stop any particular accesses, including local file system access, just as for any native Qt application, so the "doEvil" function could do the same things -as a native Qt application, a Python application, a Perl script, ec. +as a native Qt application, a Python application, a Perl script, etc. As with any application accessing other content beyond it's control, a QML application should perform appropriate checks on untrusted data it loads. diff --git a/doc/src/declarative/qdeclarativestates.qdoc b/doc/src/declarative/qdeclarativestates.qdoc index 274040a..148726f 100644 --- a/doc/src/declarative/qdeclarativestates.qdoc +++ b/doc/src/declarative/qdeclarativestates.qdoc @@ -221,7 +221,7 @@ Rectangle { This \l Transition defines that if any \c x or \c y properties have changed during a state change within this item, their values should be animated over 500 -millliseconds. +milliseconds. See the \l Transitions documentation for more information. diff --git a/doc/src/declarative/qml-intro.qdoc b/doc/src/declarative/qml-intro.qdoc index b77611c..18fa439 100644 --- a/doc/src/declarative/qml-intro.qdoc +++ b/doc/src/declarative/qml-intro.qdoc @@ -262,7 +262,7 @@ myRectangle.top // Correct We can transform a graphical object to get additional effects. Rotate a piece of text by 180 degrees to display upside-down text. Rotate an image by 90 degrees to lay it on its side. These transformations require -additonal information. +additional information. For rotation, the additional information includes: the origin relative to the object being rotated, the axis of rotation, and the angle in degrees to diff --git a/doc/src/declarative/qtbinding.qdoc b/doc/src/declarative/qtbinding.qdoc index 35a05d2..53db5c7 100644 --- a/doc/src/declarative/qtbinding.qdoc +++ b/doc/src/declarative/qtbinding.qdoc @@ -134,7 +134,7 @@ the window text will update accordingly. To detect when a C++ property value - in this case the \c CustomPalette's \c text property - changes, the property must have a corresponding NOTIFY signal. The NOTIFY signal specifies a signal that is emitted whenever the property changes value. Implementers should take care to only emit the -signal if the value \e changes to prevent loops from occuring. Accessing a property from a +signal if the value \e changes to prevent loops from occurring. Accessing a property from a binding that does not have a NOTIFY signal will cause QML to issue a warning at runtime. \section2 Dynamic Structured Data @@ -256,7 +256,7 @@ For example: \snippet doc/src/snippets/declarative/qtbinding/resources/main.qml 0 Note that the resource system cannot be accessed from QML directly. If the main QML file is -loaded as a resource, all files specifed as relative paths in QML will also be loaded from +loaded as a resource, all files specified as relative paths in QML will also be loaded from the resource system. Using the resource system is completely transparent to the QML layer. This also means that if the main QML file is not loaded as a resource then files in the resource system cannot be accessed from QML. diff --git a/doc/src/declarative/qtprogrammers.qdoc b/doc/src/declarative/qtprogrammers.qdoc index c0639db..69e6358 100644 --- a/doc/src/declarative/qtprogrammers.qdoc +++ b/doc/src/declarative/qtprogrammers.qdoc @@ -32,7 +32,7 @@ \section1 Overview -While QML does not require Qt knowledge to use, if you \e are already familar with Qt, +While QML does not require Qt knowledge to use, if you \e are already familiar with Qt, much of your knowledge is directly relevant to learning and using QML. Of course, an application with a UI defined in QML also uses Qt for all the non-UI logic. @@ -103,7 +103,7 @@ So, to implement your reusable button, you would simply build a QML component. Parent widgets each provide a generic way to interface to one or more arbitrary other widgets. A QTabWidget provides an interface to multiple "pages", one of which is visible at any time, -and a mechnism for selecting among them (the QTabBar). A QScollArea provides scrollbars around +and a mechanism for selecting among them (the QTabBar). A QScollArea provides scrollbars around a widget that is otherwise too large to fit in available space. Nearly all such components can be created directly in QML. Only a few cases @@ -115,7 +115,7 @@ needs to be divided up into pages. A significant difference in the parenting concept with QML compare to QWidgets is that while child items are positioned relative to their parents, -there is no requirement that they be wholy contained ("clipped") to +there is no requirement that they be wholly contained ("clipped") to the parent (although the clipped property of the child Item does allow this where it is needed). This difference has rather far-reaching consequences, for example: diff --git a/doc/src/declarative/scope.qdoc b/doc/src/declarative/scope.qdoc index 5501242..17f8632 100644 --- a/doc/src/declarative/scope.qdoc +++ b/doc/src/declarative/scope.qdoc @@ -174,7 +174,7 @@ PathView { } \endcode -If the \l Image element omitted the \c root prefix, it would inadvertantly access +If the \l Image element omitted the \c root prefix, it would inadvertently access the unset \c {PathView.scale} attached property on itself. \section1 Component Scope diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index bc0df04..588a9cc 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -1449,6 +1449,46 @@ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 141 + On the Symbian platform, a default deployment is generated for all + application projects. You can modify the autogenerated default + deployment via following \c DEPLOYMENT variable values: + + \list + \o default_bin_deployment - Application executable + \o default_resource_deployment - Application resources, including icon + \o default_reg_deployment - Application registration file + \endlist + + For example: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 154 + + This will entirely remove the default application deployment. + + On the Symbian platform, you can specify file specific install options + with \c{.flags} modifier. Please consult the Symbian platform documentation + for supported options. + + For example: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 155 + + This will show a message box that gives user an option to cancel the + installation and then automatically runs the application after + installation is complete. + + \note Automatically running the applications after install may require signing + the package with better than self-signed certificate, depending on the phone model. + Additionally, some tools such as Runonphone may not work properly with sis + packages that automatically run the application upon install. + + On the Symbian platform, the default package name and the default name that + appears in application menu is derived from the \c TARGET variable. + Often the default is not optimal for displaying to end user. To set a better + display name for these purposes, use \c{DEPLOYMENT.display_name} variable: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 156 + On the Symbian platform, you can use \c{DEPLOYMENT.installer_header} variable to generate smart installer wrapper for your application. If you specify just UID of the installer package as the value, then diff --git a/doc/src/getting-started/gettingstartedqml.qdoc b/doc/src/getting-started/gettingstartedqml.qdoc index e2d6e72..a6159c3 100644 --- a/doc/src/getting-started/gettingstartedqml.qdoc +++ b/doc/src/getting-started/gettingstartedqml.qdoc @@ -122,7 +122,7 @@ items can anchor to another item, creating robust layouts. The \c MouseArea has many signal handlers that are called during mouse movements within - the specfied \c MouseArea boundaries. One of them is \c onClicked and it is called + the specified \c MouseArea boundaries. One of them is \c onClicked and it is called whenever the acceptable mouse button is clicked, the left click being the default. We can bind actions to the onClicked handler. In our example, \c console.log() outputs text whenever the mouse area is clicked. The function \c console.log() is a useful tool for @@ -546,7 +546,7 @@ a certain easing curve. An easing curve controls the animation rates and interpolation behavior during state transitions. The easing curve we chose is \l{PropertyAnimation::easing.type}{Easing.OutQuint}, which slows the movement near - the end of the animation. Pleae read \l {qdeclarativeanimation.html}{QML's Animation} + the end of the animation. Please read \l {qdeclarativeanimation.html}{QML's Animation} article. \snippet examples/tutorials/gettingStarted/gsQml/texteditor.qml transitions @@ -835,7 +835,7 @@ \c QDeclarativeListProperty<File>. The template type, \c File, needs to be a \c QObject derivative. Further, to create the \l {QDeclarativeListProperty}{QDeclarativeListProperty}, the list's accessor - and modifiers need to be passed to the consructor as function pointers. The list, + and modifiers need to be passed to the constructor as function pointers. The list, a \c QList in our case, also needs to be a list of \c File pointers. The constructor of \l {QDeclarativeListProperty}{QDeclarativeListProperty} @@ -980,7 +980,7 @@ Our \c FileMenu can now connect to their respective actions. The \c saveButton will transfer the text from the \c TextEdit onto the directory's \c fileContent property, then copy its file name from the editable text input. Finally, the button - calls the \c saveFile() function, saving the file. The \c sloadButton has a similar + calls the \c saveFile() function, saving the file. The \c loadButton has a similar execution. Also, the \c New action will empty the contents of the \c TextEdit. Further, the \c EditMenu buttons are connected to the \c TextEdit functions to copy, diff --git a/doc/src/images/qml-column.png b/doc/src/images/qml-column.png Binary files differnew file mode 100644 index 0000000..c589ad8 --- /dev/null +++ b/doc/src/images/qml-column.png diff --git a/doc/src/snippets/code/doc_src_qmake-manual.qdoc b/doc/src/snippets/code/doc_src_qmake-manual.qdoc index 379d081..ab67a3d 100644 --- a/doc/src/snippets/code/doc_src_qmake-manual.qdoc +++ b/doc/src/snippets/code/doc_src_qmake-manual.qdoc @@ -193,15 +193,15 @@ DEFINES += USE_MY_STUFF QT_DLL //! [28] -myFiles.sources = path\*.png +myFiles.files = path\*.png DEPLOYMENT += myFiles //! [28] //! [29] -myFiles.sources = path\file1.ext1 path2\file2.ext1 path3\* +myFiles.files = path\file1.ext1 path2\file2.ext1 path3\* myFiles.path = \some\path\on\device -someother.sources = C:\additional\files\* +someother.files = C:\additional\files\* someother.path = \myFiles\path2 DEPLOYMENT += myFiles someother //! [29] @@ -849,12 +849,12 @@ CONFIG(debug, debug|release) { //! [127] //! [128] -customplugin.sources = customimageplugin.dll -customplugin.sources += c:\myplugins\othercustomimageplugin.dll +customplugin.files = customimageplugin.dll +customplugin.files += c:\myplugins\othercustomimageplugin.dll customplugin.path = imageformats -dynamiclibrary.sources = mylib.dll helper.exe +dynamiclibrary.files = mylib.dll helper.exe dynamiclibrary.path = \sys\bin -globalplugin.sources = someglobalimageplugin.dll +globalplugin.files = someglobalimageplugin.dll globalplugin.path = \resource\qt\plugins\imageformats DEPLOYMENT += customplugin dynamiclibrary globalplugin //! [128] @@ -923,7 +923,7 @@ MMP_RULES += myIfdefBlock //! [139] //! [140] -somelib.sources = somelib.dll +somelib.files = somelib.dll somelib.path = \sys\bin somelib.pkg_prerules = "(0x12345678), 2, 2, 0, {\"Some Package\"}" \ "(0x87654321), 1, *, * ~ 2, 2, 0, {\"Some Other Package\"}" @@ -1014,3 +1014,18 @@ BLD_INF_RULES.prj_exports += my_exports my_note.pkg_postrules.installer = "\"myinstallnote.txt\" - \"\", FILETEXT, TEXTCONTINUE" DEPLOYMENT += my_note //! [153] + +//! [154] +DEPLOYMENT -= default_bin_deployment default_resource_deployment default_reg_deployment +//! [154] + +//! [155] +default_bin_deployment.flags += FILERUN RUNINSTALL +dep_note.files = install_note.txt +dep_note.flags = FILETEXT TEXTEXIT +DEPLOYMENT += dep_note +//! [155] + +//! [156] +DEPLOYMENT.display_name = My Qt App +//! [156] diff --git a/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp b/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp index 59e6ae0..07ff2a0 100644 --- a/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp +++ b/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp @@ -86,3 +86,38 @@ beginMoveRows(parent, 2, 2, parent, 0); //! [9] beginMoveRows(parent, 2, 2, parent, 4); //! [9] + + +//! [10] +class CustomDataProxy : public QSortFilterProxyModel +{ + Q_OBJECT +public: + CustomDataProxy(QObject *parent) + : QSortFilterProxyModel(parent) + { + } + + ... + + QVariant data(const QModelIndex &index, int role) + { + if (role != Qt::BackgroundRole) + return QSortFilterProxyModel::data(index, role); + + if (m_customData.contains(index.row())) + return m_customData.value(index.row()); + return QSortFilterProxyModel::data(index, role); + } + +private slots: + void resetInternalData() + { + m_customData.clear(); + } + +private: + QHash<int, QVariant> m_customData; +}; +//! [10] + diff --git a/doc/src/snippets/declarative/column/column.qml b/doc/src/snippets/declarative/column/column.qml index 45c6822..18e95e9 100644 --- a/doc/src/snippets/declarative/column/column.qml +++ b/doc/src/snippets/declarative/column/column.qml @@ -47,21 +47,21 @@ Item { Column { anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter - + spacing: 5 Rectangle { color: "lightblue"; radius: 10.0 width: 300; height: 50 - Text { anchors.fill: parent - font.pointSize: 32; text: "Books" } } + Text { anchors.centerIn: parent + font.pointSize: 24; text: "Books" } } Rectangle { color: "gold"; radius: 10.0 width: 300; height: 50 - Text { anchors.fill: parent - font.pointSize: 32; text: "Music" } } + Text { anchors.centerIn: parent + font.pointSize: 24; text: "Music" } } Rectangle { color: "lightgreen"; radius: 10.0 width: 300; height: 50 - Text { anchors.fill: parent - font.pointSize: 32; text: "Movies" } } + Text { anchors.centerIn: parent + font.pointSize: 24; text: "Movies" } } } } //! [document] diff --git a/doc/src/template/scripts/functions.js b/doc/src/template/scripts/functions.js index faa4ca4..47539d2 100755 --- a/doc/src/template/scripts/functions.js +++ b/doc/src/template/scripts/functions.js @@ -1,38 +1,57 @@ +// Removing search results +function hideSearchResults() { +/* hiding search results as the user clicks on the different categories */ + $('#resultdialog').removeClass('active'); + $("#resultlist").removeClass().addClass('all'); + $("#resultlinks").removeClass().addClass('all'); + $("#searchcount").removeClass().addClass('all'); +} +/* closing the searhc result dialog */ +$('#resultclose').click(function(e) { + e.preventDefault(); + hideSearchResults(); +}); + +$(document.body).click(function() { +}); + /* START non link areas where cursor should change to pointing hand */ $('.t_button').mouseover(function() { $('.t_button').css('cursor','pointer'); - /*document.getElementById(this.id).style.cursor='pointer';*/ }); /* END non link areas */ +/* Changing font size to smaller */ $('#smallA').click(function() { - $('.content .heading,.content h1, .content h2, .content h3, .content p, .content li, .content table').css('font-size','smaller'); + $('.mainContent .heading,.mainContent h1, .mainContent h2, .mainContent h3, .mainContent p, .mainContent li, .mainContent table').css('font-size','smaller'); $('.t_button').removeClass('active') $(this).addClass('active') }); +/* Reset font size */ $('#medA').click(function() { - $('.content .heading').css('font','600 16px/1 Arial'); - $('.content h1').css('font','600 18px/1.2 Arial'); - $('.content h2').css('font','600 16px/1.2 Arial'); - $('.content h3').css('font','600 14px/1.2 Arial'); - $('.content p').css('font','13px/20px Verdana'); - $('.content li').css('font','400 13px/1 Verdana'); - $('.content li').css('line-height','14px'); - $('.content .toc li').css('font', 'normal 10px/1.2 Verdana'); - $('.content table').css('font','13px/1.2 Verdana'); - $('.content .heading').css('font','600 16px/1 Arial'); - $('.content .indexboxcont li').css('font','600 13px/1 Verdana'); + $('.mainContent .heading').css('font','600 16px/1 Arial'); + $('.mainContent h1').css('font','600 18px/1.2 Arial'); + $('.mainContent h2').css('font','600 16px/1.2 Arial'); + $('.mainContent h3').css('font','600 14px/1.2 Arial'); + $('.mainContent p').css('font','13px/20px Verdana'); + $('.mainContent li').css('font','400 13px/1 Verdana'); + $('.mainContent li').css('line-height','14px'); + $('.mainContent .toc li').css('font', 'normal 10px/1.2 Verdana'); + $('.mainContent table').css('font','13px/1.2 Verdana'); + $('.mainContent .heading').css('font','600 16px/1 Arial'); + $('.mainContent .indexboxcont li').css('font','600 13px/1 Verdana'); $('.t_button').removeClass('active') $(this).addClass('active') }); - +/* Changing font size to bigger */ $('#bigA').click(function() { - $('.content .heading,.content h1, .content h2, .content h3, .content p, .content li, .content table').css('font-size','large'); - $('.content .heading,.content h1, .content h2, .content h3, .content p, .content li, .content table').css('line-height','25px'); + $('.mainContent .heading,.mainContent h1, .mainContent h2, .mainContent h3, .mainContent p, .mainContent li, .mainContent table').css('font-size','large'); + $('.mainContent .heading,.mainContent h1, .mainContent h2, .mainContent h3, .mainContent p, .mainContent li, .mainContent table').css('line-height','25px'); $('.t_button').removeClass('active') $(this).addClass('active') }); +/* Show page content after closing feedback box */ $('.feedclose').click(function() { $('.bd').show(); $('.hd').show(); @@ -41,6 +60,7 @@ $('.feedclose').click(function() { $('#blurpage').hide(); }); +/* Hide page content and show feedback box */ $('.feedback').click(function() { $('.bd').hide(); $('.hd').hide(); @@ -48,131 +68,176 @@ $('.feedback').click(function() { $('#feedbackBox').show(); $('#blurpage').show(); }); -var lookupCount = 0; -var articleCount = 0; -var exampleCount = 0; -var qturl = ""; // change from "http://doc.qt.nokia.com/4.6/" to 0 so we can have relative links +/* Default search URL */ +var qturl = ""; + +/* The next function handles the response data (in xml) returned by the search engine */ + +// Process data sent back from the server. The data is structured as a XML. +/* +XML structure handled by function processNokiaData() +<page> - container for each page returned +<pageWords/> - contains keywords +<pageTitle/> - contains page title/header content +<pageUrl/> - contains page URL - URL relative to root +<pageType> - contains page type - APIPage/Article/Example +</page> +*/ + function processNokiaData(response){ +/* fetch the responce from the server using page as the root element */ var propertyTags = response.getElementsByTagName('page'); - - for (var i=0; i< propertyTags.length; i++) { - var linkStart = "<li class=\"liveResult\"><a href='"+qturl+""; - var linkEnd = "</a></li>"; - - if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'APIPage'){ - lookupCount++; - - for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){ - full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue; - full_li_element = full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd; - $('#ul001').append(full_li_element); - $('#ul001 .defaultLink').css('display','none'); - - } - } - - if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Article'){ - articleCount++; - - for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){ - full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue; - full_li_element =full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd ; - - $('#ul002').append(full_li_element); - $('#ul002 .defaultLink').css('display','none'); - - } + /* reset counters */ + var apiCount = 0; + var articleCount = 0; + var exampleCount = 0; + var full_li_element; + +/* remove any old results */ + $('#resultlist li').remove(); + + + /* running through the elements in the xml structure */ + for (var i=0; i<propertyTags.length; i++) { + /* for every element named pageWords*/ + for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++) { + /* start a new list element */ + full_li_element = '<li'; + /* if the pageType element reads APIPage, add class name api */ + if (propertyTags[j].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'APIPage') { + full_li_element += ' class="api"'; + apiCount++; + } + /* if the pageType element reads Article, add class name article */ + else if (propertyTags[j].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Article') { + full_li_element += ' class="article"'; + articleCount++; + } + /* if the pageType element reads Example, add class name example */ + else if (propertyTags[j].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Example') { + full_li_element += ' class="example"'; + exampleCount++; + } + /* adding the link element*/ + full_li_element += '><a href="'+qturl; + /* adding the URL attribute*/ + full_li_element += propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue; + /* adding the link title and closing the link and list elements */ + full_li_element += '">' + propertyTags[i].getElementsByTagName('pageWords')[0].firstChild.nodeValue + '</a></li>'; + /* appending the list element to the #resultlist div*/ + $('#resultlist').append(full_li_element); + } + } + + /* if the result is not empty */ + if (propertyTags.length > 0) { + /* add class name active to show the dialog */ + $('#resultdialog').addClass('active'); + /* setting number of hits*/ + $('#resultcount').html(propertyTags.length); + $('#apicount').html(apiCount); + $('#articlecount').html(articleCount); + $('#examplecount').html(exampleCount); + + } + else { + $('#pageType').addClass('red'); + } + + + + // Filtering results in display + $('p#resultlinks a').click(function(e) { + e.preventDefault(); + // Displays API ref pages + if (this.id == "showapiresults") { + $("#resultlist").removeClass().addClass('api'); + $("#resultlinks").removeClass().addClass('api'); + $("#searchcount").removeClass().addClass('api'); + } + // Displays Articles + else if (this.id == "showarticleresults") { + $("#resultlist").removeClass().addClass('article'); + $("#resultlinks").removeClass().addClass('article'); + $("#searchcount").removeClass().addClass('article'); + } + // Displays Examples + if (this.id == "showexampleresults") { + $("#resultlist").removeClass().addClass('example'); + $("#resultlinks").removeClass().addClass('example'); + $("#searchcount").removeClass().addClass('example'); + } + // Displays All + if (this.id == "showallresults") { + $("#resultlist").removeClass().addClass('all'); + $("#resultlinks").removeClass().addClass('all'); + $("#searchcount").removeClass().addClass('all'); } - if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Example'){ - exampleCount++; - - - for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){ - full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue; - full_li_element =full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd ; - - $('#ul003').append(full_li_element); - $('#ul003 .defaultLink').css('display','none'); - - } - } - if(i==propertyTags.length){$('#pageType').removeClass('loading');} - - } - if(lookupCount > 0){$('#ul001 .menuAlert').remove();$('#ul001').prepend('<li class=\"menuAlert liveResult hit\">Found ' + lookupCount + ' hits</li>');$('#ul001 li').css('display','block');$('.sidebar .search form input').removeClass('loading');} - if(articleCount > 0){$('#ul002 .menuAlert').remove();$('#ul002').prepend('<li class=\"menuAlert liveResult hit\">Found ' + articleCount + ' hits</li>');$('#ul002 li').css('display','block');} - if(exampleCount > 0){$('#ul003 .menuAlert').remove();$('#ul003').prepend('<li class=\"menuAlert liveResult hit\">Found ' + articleCount + ' hits</li>');$('#ul003 li').css('display','block');} - - if(lookupCount == 0){$('#ul001 .menuAlert').remove();$('#ul001').prepend('<li class=\"menuAlert liveResult noMatch\">Found no result</li>');$('#ul001 li').css('display','block');$('.sidebar .search form input').removeClass('loading');} - if(articleCount == 0){$('#ul002 .menuAlert').remove();$('#ul002').prepend('<li class=\"menuAlert liveResult noMatch\">Found no result</li>');$('#ul002 li').css('display','block');} - if(exampleCount == 0){$('#ul003 .menuAlert').remove();$('#ul003').prepend('<li class=\"menuAlert liveResult noMatch\">Found no result</li>');$('#ul003 li').css('display','block');} - // reset count variables; - lookupCount=0; - articleCount = 0; - exampleCount = 0; - + }); } + //build regular expression object to find empty string or any number of blank var blankRE=/^\s*$/; + + function CheckEmptyAndLoadList() { + /* Start Extracting information for feedback and adding this to the feedback form */ var pageUrl = window.location.href; var pageVal = $('title').html(); + $('#pageType').removeClass('red'); $('#feedUrl').remove(); $('#pageVal').remove(); $('.menuAlert').remove(); $('#feedform').append('<input id="feedUrl" name="feedUrl" value="'+pageUrl+'" style="display:none;">'); $('#feedform').append('<input id="pageVal" name="pageVal" value="'+pageVal+'" style="display:none;">'); - $('.liveResult').remove(); - $('.defaultLink').css('display','block'); + /* End Extracting information for feedback and adding this to the feedback form */ + + /* extracts search query */ var value = document.getElementById('pageType').value; + /* if the search is less than three chars long remove class names and remove elements from old search*/ if((blankRE.test(value)) || (value.length < 3)) { - //empty inputbox - // load default li elements into the ul if empty - // loadAllList(); // replaced - $('.defaultLink').css('display','block'); - // $('.liveResult').css('display','none'); - }else{ - $('.defaultLink').css('display','none'); + $('#resultdialog').removeClass('active'); + $('#resultlist li').remove(); } } -/* -$(window).resize(function(){ -if($(window).width()<400) - $('body').addClass('offline'); -else - $('body').removeClass('offline'); - }); - */ -// Loads on doc ready + +// Loads on doc ready - prepares search $(document).ready(function () { - //alert(pageUrl); - //$('#pageUrl').attr('foo',pageUrl); + /* fetch page title*/ var pageTitle = $('title').html(); + /* getting content from search box */ var currentString = $('#pageType').val() ; + /* if the search box is not empty run CheckEmptyAndLoadList*/ if(currentString.length < 1){ - $('.defaultLink').css('display','block'); CheckEmptyAndLoadList(); } + /* on key-up in the search box execute the following */ $('#pageType').keyup(function () { + /* extract the search box content */ var searchString = $('#pageType').val() ; + /* if the string is less than three characters */ if ((searchString == null) || (searchString.length < 3)) { + /* remove classes and elements*/ $('#pageType').removeClass('loading'); - $('.liveResult').remove(); $('.searching').remove(); + /* run CheckEmptyAndLoadList */ CheckEmptyAndLoadList(); + $('.report').remove(); - // debug$('.content').prepend('<li>too short or blank</li>'); // debug return; } + /* if timer checks out */ if (this.timer) clearTimeout(this.timer); this.timer = setTimeout(function () { + /* add loading image by adding loading class */ $('#pageType').addClass('loading'); $('.searching').remove(); - $('.list ul').prepend('<li class="menuAlert searching">Searching...</li>'); + + /* run the actual search */ $.ajax({ contentType: "application/x-www-form-urlencoded", url: 'http://' + location.host + '/nokiasearch/GetDataServlet', @@ -180,15 +245,14 @@ else dataType:'xml', type: 'post', success: function (response, textStatus) { - - $('.liveResult').remove(); + /* on success remove loading img */ $('.searching').remove(); $('#pageType').removeClass('loading'); - $('.list ul').prepend('<li class="menuAlert searching">Searching...</li>'); + processNokiaData(response); } }); - }, 500); + }, 500); /* timer set to 500 ms */ }); - }); + });
\ No newline at end of file diff --git a/doc/src/template/scripts/narrow.js b/doc/src/template/scripts/narrow.js index 35c81bf..a5e8b97 100644 --- a/doc/src/template/scripts/narrow.js +++ b/doc/src/template/scripts/narrow.js @@ -1,17 +1,15 @@ +/* This function generates menus and search box in narrow/slim fit mode */ var narrowInit = function() { - /* TODO: - Could probably be more efficient, not hardcoding each element to be created - */ - // 1: Create search form + /* 1: Create search form */ var narrowSearch = $('<div id="narrowsearch"></div>'); var searchform = $("#qtdocsearch"); narrowSearch.append(searchform); $("#qtdocheader .content .qtref").after(narrowSearch); - // 2: Create dropdowns + /* 2: Create dropdowns */ var narrowmenu = $('<ul id="narrowmenu" class="sf-menu"></ul>'); - // Lookup + /* Lookup */ var lookuptext = $("#lookup h2").attr("title"); $("#lookup ul").removeAttr("id"); $("#lookup ul li").removeAttr("class"); @@ -24,7 +22,7 @@ var narrowInit = function() { lookuplist.append(lookupul); narrowmenu.append(lookuplist); - // Topics + /* Topics */ var topicstext = $("#topics h2").attr("title"); $("#topics ul").removeAttr("id"); $("#topics ul li").removeAttr("class"); @@ -37,7 +35,7 @@ var narrowInit = function() { topicslist.append(topicsul); narrowmenu.append(topicslist); - // Examples + /* Examples */ var examplestext = $("#examples h2").attr("title"); $("#examples ul").removeAttr("id"); $("#examples ul li").removeAttr("class"); @@ -58,32 +56,78 @@ var narrowInit = function() { }); } +/* Executes on doc ready */ $(document).ready(function(){ -/* if ($('body').hasClass('narrow')) { - narrowInit(); - } - */ - if($(window).width()<600) { - $('body').addClass('narrow'); - - if ($("#narrowsearch").length == 0) { - narrowInit(); - } - } - else { - $('body').removeClass('narrow'); + /* check if body has the narrow class */ + if ($('body').hasClass('narrow')) { + /* run narrowInit */ + narrowInit(); + } + + /* messure window width and add class if it is smaller than 600 px */ + if($(window).width()<600) { + $('body').addClass('narrow'); + /* if the search box contains */ + if ($("#narrowsearch").length == 0) { + /* run narrowInit */ + narrowInit(); + } + } + else { /* if the window is wider than 600 px, narrow is removed */ + $('body').removeClass('narrow'); + if ($("#narrowsearch").length == 0) { + } + } +}); +/* binding resize event to this funciton */ +$(window).bind('resize', function () { + /* if the window is wider than 600 px, narrow class is added */ + if($(window).width()<600) { + $('body').addClass('narrow'); + if ($("#narrowsearch").length == 0) { + narrowInit(); + } + } + else { + /* else we remove the narrow class */ + $('body').removeClass('narrow'); } }); -$(window).bind('resize', function () { - if($(window).width()<600) { - $('body').addClass('narrow'); + $('#narrowsearch').keyup(function () { + /* extract the search box content */ + var searchString = $('#narrowsearch').val(); + /* if the string is less than three characters */ + if ((searchString == null) || (searchString.length < 3)) { + /* remove classes and elements*/ + $('#narrowsearch').removeClass('loading'); + $('.searching').remove(); + /* run CheckEmptyAndLoadList */ + CheckEmptyAndLoadList(); + + $('.report').remove(); + return; + } + /* if timer checks out */ + if (this.timer) clearTimeout(this.timer); + this.timer = setTimeout(function () { + /* add loading image by adding loading class */ + $('#narrowsearch').addClass('loading'); + $('.searching').remove(); - if ($("#narrowsearch").length == 0) { - narrowInit(); - } - } - else { - $('body').removeClass('narrow'); - } -});
\ No newline at end of file + /* run the actual search */ + $.ajax({ + contentType: "application/x-www-form-urlencoded", + url: 'http://' + location.host + '/nokiasearch/GetDataServlet', + data: 'searchString='+searchString, + dataType:'xml', + type: 'post', + success: function (response, textStatus) { + /* on success remove loading img */ + $('.searching').remove(); + $('#narrowsearch').removeClass('loading'); + processNokiaData(response); + } + }); + }, 500); /* timer set to 500 ms */ + });
\ No newline at end of file diff --git a/doc/src/template/style/narrow.css b/doc/src/template/style/narrow.css index de5b0a0..c1e3f61 100644 --- a/doc/src/template/style/narrow.css +++ b/doc/src/template/style/narrow.css @@ -6,7 +6,7 @@ } .narrow a { - color: #44a51c; + color: #00732f; } .narrow .header, .narrow .header .content, .narrow .footer, .narrow .wrapper { @@ -45,7 +45,7 @@ { width: auto; height: auto; - color: #363534; + color: #00732f; position: static; float: left; margin-left: 25px; @@ -61,6 +61,7 @@ { background-image: none; text-indent: 0; + width: 260px; } .narrow .header #nav-topright @@ -163,7 +164,7 @@ } .narrow .wrap .breadcrumb ul li a { - color: #44a51c; + color: #00732f; } .narrow .wrap .breadcrumb ul li.last a { @@ -203,11 +204,7 @@ *border: 1px solid #fff; *height: 17px; _height: 18px; - /* to be fixed */ - display: none; - /* to be fixed */ } - .narrow .indexbox .indexIcon { display: none; } @@ -268,3 +265,6 @@ } /* end narrow mode */ + .creator #narrowsearch, .creator #narrowmenu{ + display:none; + } diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index 614e296..c07385c 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -204,6 +204,10 @@ { font-size: 13px; } + .red + { + color:red; + } /* end font style elements */ /* global settings*/ @@ -627,17 +631,94 @@ background:url("../images/spinner.gif") no-repeat scroll right center transparent; } -.floatingResult{ - z-index:1; - position:relative; - padding-top:0px; - background-color:white; - border:solid 1px black; - height:250px; - width:600px; - overflow-x:hidden; - overflow-y:auto; -} + .sidebar .search form { + _height: 23px; + _width: 169px; + } + + #resultdialog { + display: none; + position: absolute; + *left: 30px; + _left: 0; + *top: 35px; + _top: 30px; + _zoom: 1; + background-color: #fff; + border: 1px solid #666; + z-index: 4; + margin-top: 5px; + _margin: 0 0 0 -20px; + padding: 10px; + width: 220px; + _width: 196px; + height: 250px; + overflow: auto; + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + border-radius: .5em; + -webkit-box-shadow: 0 4px 6px 0 rgba(0,0,0,.2); + -moz-box-shadow: 0 4px 6px 0 rgba(0,0,0,.2); + box-shadow: 0 4px 6px 0 rgba(0,0,0,.2); + } + + #resultdialog.active { + display: block; + } + + #resultdialog #resultclose { + float: right; + } + + #resultdialog p, + #resultdialog ul { + clear: both; + margin: 3px 0; + } + + p#searchcount span { + display: none; + } + + p#searchcount.all span#resultcount, + p#searchcount.api span#apicount, + p#searchcount.article span#articlecount, + p#searchcount.example span#examplecount { + display: inline; + } + + #resultlist li { + display: none; + } + + #resultlist.api li.api, + #resultlist.article li.article, + #resultlist.example li.example, + #resultlist.all li { + display: block; + } + + #resultlinks.api a#showapiresults, + #resultlinks.api a#showapiresults:hover, + #resultlinks.article a#showarticleresults, + #resultlinks.article a#showarticleresults:hover, + #resultlinks.example a#showexampleresults, + #resultlinks.example a#showexampleresults:hover, + #resultlinks.all a#showallresults, + #resultlinks.all a#showallresults:hover { + color: #B0ADAB; + } + .floatingResult{ + z-index:1; + position:relative; + padding-top:0px; + background-color:white; + border:solid 1px black; + height:250px; + width:600px; + overflow-x:hidden; + overflow-y:auto; + } .floatingResult:hover{ display:block; @@ -830,7 +911,6 @@ .wrap .content table p { line-height: 20px; - /* padding: 0px;*/ } .wrap .content ul { |