diff options
author | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2009-10-09 08:51:12 +0200 |
---|---|---|
committer | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2009-10-09 08:51:12 +0200 |
commit | 80892f907be2f271d567d902c2b3d909b0178853 (patch) | |
tree | b965540aa9a4d09d9c378acdcfb39551d7d7d79a | |
parent | db1162da76f1d257ba9bfcaef574275e7430385f (diff) | |
parent | f370b5d986529155baf7d9dd95678854df4105e0 (diff) | |
download | qt4-tools-80892f907be2f271d567d902c2b3d909b0178853.tar.gz |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
84 files changed, 1280 insertions, 812 deletions
diff --git a/configure.exe b/configure.exe Binary files differindex aa254f3187..838889c3b9 100755 --- a/configure.exe +++ b/configure.exe diff --git a/demos/embedded/styledemo/stylewidget.ui b/demos/embedded/styledemo/stylewidget.ui index a084dde21f..767f44aead 100644 --- a/demos/embedded/styledemo/stylewidget.ui +++ b/demos/embedded/styledemo/stylewidget.ui @@ -6,28 +6,16 @@ <rect> <x>0</x> <y>0</y> - <width>174</width> - <height>220</height> + <width>184</width> + <height>245</height> </rect> </property> <property name="windowTitle"> <string>Form</string> </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="spacing"> - <number>4</number> - </property> - <property name="margin"> - <number>4</number> - </property> - <item> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0" colspan="2"> <widget class="QGroupBox" name="groupBox"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> <property name="title"> <string>Styles</string> </property> @@ -141,7 +129,7 @@ </layout> </widget> </item> - <item> + <item row="1" column="0" colspan="2"> <spacer name="verticalSpacer_3"> <property name="orientation"> <enum>Qt::Vertical</enum> @@ -154,156 +142,137 @@ </property> </spacer> </item> - <item> - <widget class="QFrame" name="frame"> + <item row="2" column="0" colspan="2"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="margin"> + <number>4</number> + </property> + <item> + <widget class="QLabel" name="label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Value:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="spinBox"> + <property name="focusPolicy"> + <enum>Qt::WheelFocus</enum> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + <property name="keyboardTracking"> + <bool>false</bool> + </property> + </widget> + </item> + </layout> + </item> + <item row="3" column="0"> + <widget class="QScrollBar" name="horizontalScrollBar"> <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> + <property name="minimumSize"> + <size> + <width>0</width> + <height>24</height> + </size> </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> + <property name="focusPolicy"> + <enum>Qt::TabFocus</enum> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QScrollBar" name="horizontalScrollBar_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>24</height> + </size> + </property> + <property name="focusPolicy"> + <enum>Qt::TabFocus</enum> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> </property> - <layout class="QVBoxLayout" name="frameLayout"> - <property name="margin"> - <number>0</number> - </property> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QLabel" name="label"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>My Value is:</string> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="spinBox"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="focusPolicy"> - <enum>Qt::WheelFocus</enum> - </property> - <property name="alignment"> - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> - </property> - <property name="keyboardTracking"> - <bool>false</bool> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QGridLayout" name="gridLayout"> - <property name="spacing"> - <number>4</number> - </property> - <item row="0" column="0"> - <widget class="QScrollBar" name="horizontalScrollBar"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>24</height> - </size> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QPushButton" name="pushButton_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="focusPolicy"> - <enum>Qt::StrongFocus</enum> - </property> - <property name="text"> - <string>Show</string> - </property> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="checked"> - <bool>true</bool> - </property> - <property name="flat"> - <bool>false</bool> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QScrollBar" name="horizontalScrollBar_2"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>24</height> - </size> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QPushButton" name="pushButton"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="focusPolicy"> - <enum>Qt::StrongFocus</enum> - </property> - <property name="text"> - <string>Enable</string> - </property> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="checked"> - <bool>true</bool> - </property> - <property name="flat"> - <bool>false</bool> - </property> - </widget> - </item> - </layout> - </item> - </layout> </widget> </item> - <item> + <item row="4" column="0"> + <widget class="QPushButton" name="pushButton_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="focusPolicy"> + <enum>Qt::StrongFocus</enum> + </property> + <property name="text"> + <string>Show</string> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="checked"> + <bool>true</bool> + </property> + <property name="flat"> + <bool>false</bool> + </property> + </widget> + </item> + <item row="4" column="1"> + <widget class="QPushButton" name="pushButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="focusPolicy"> + <enum>Qt::StrongFocus</enum> + </property> + <property name="text"> + <string>Enable</string> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="checked"> + <bool>true</bool> + </property> + <property name="flat"> + <bool>false</bool> + </property> + </widget> + </item> + <item row="5" column="0" colspan="2"> <spacer name="verticalSpacer"> <property name="orientation"> <enum>Qt::Vertical</enum> @@ -319,32 +288,28 @@ </property> </spacer> </item> - <item> - <layout class="QHBoxLayout"> - <item> - <spacer> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="close"> - <property name="focusPolicy"> - <enum>Qt::StrongFocus</enum> - </property> - <property name="text"> - <string>Close</string> - </property> - </widget> - </item> - </layout> + <item row="6" column="0"> + <spacer> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="6" column="1"> + <widget class="QPushButton" name="close"> + <property name="focusPolicy"> + <enum>Qt::StrongFocus</enum> + </property> + <property name="text"> + <string>Close</string> + </property> + </widget> </item> </layout> </widget> diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index f2cae5bd43..87132cc101 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -920,7 +920,7 @@ {deployment guide for Windows}. - \section1 S60 + \section1 Symbian platform Features specific to this platform include handling of static data, capabilities, stack and heap size, compiler specific options, and unique @@ -940,7 +940,7 @@ \section2 Stack and heap size - Symbian uses predefined sizes for stacks and heaps. If an + The Symbian platform uses predefined sizes for stacks and heaps. If an application exceeds either limit, it may crash or fail to complete its task. Crashes that seem to have no reason can often be traced back to insufficient stack and/or heap sizes. @@ -1095,7 +1095,7 @@ \target BLD_INF_RULES \section1 BLD_INF_RULES - \e {This is only used on Symbian.} + \e {This is only used on the Symbian platform.} Generic \c bld.inf file content can be specified with \c BLD_INF_RULES variables. The section of \c bld.inf file where each rule goes is appended to @@ -1288,7 +1288,7 @@ The build process for bundles is also influenced by the contents of the \l{#QMAKE_BUNDLE_DATA}{QMAKE_BUNDLE_DATA} variable. - These options only have an effect on Symbian: + These options only have an effect on the Symbian platform: \table 95% \header \o Option \o Description @@ -1345,7 +1345,7 @@ \target DEPLOYMENT \section1 DEPLOYMENT - \e {This is only used on Windows CE and Symbian.} + \e {This is only used on Windows CE and the Symbian platform.} Specifies which additional files will be deployed. Deployment means the transfer of files from the development system to the target device or @@ -1363,8 +1363,8 @@ The default deployment target path for Windows CE is \c{%CSIDL_PROGRAM_FILES%\target}, which usually gets expanded to - \c{\Program Files\target}. For Symbian, the default target is the application - private directory on the drive it is installed to. + \c{\Program Files\target}. For the Symbian platform, the default target +is the application private directory on the drive it is installed to. It is also possible to specify multiple \c sources to be deployed on target \c paths. In addition, different variables can be used for @@ -1375,10 +1375,10 @@ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 29 \note In Windows CE all linked Qt libraries will be deployed to the path - specified by \c{myFiles.path}. In Symbian all libraries and executables + specified by \c{myFiles.path}. On Symbian platform all libraries and executables will always be deployed to the \\sys\\bin of the installation drive. - Since the Symbian build system automatically moves binaries to certain + Since the Symbian platform build system automatically moves binaries to certain directories under the epoc32 directory, custom plugins, executables or dynamically loadable libraries need special handling. When deploying extra executables or dynamically loadable libraries, the target path @@ -1393,13 +1393,13 @@ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 128 - In Symbian, generic PKG file content can also be specified with this + On the Symbian platform, generic PKG file content can also be specified with this variable. You can use either \c pkg_prerules or \c pkg_postrules to pass raw data to PKG file. The strings in \c pkg_prerules are added before package-body and \c pkg_postrules after. The strings defined in \c pkg_postrules or \c pkg_prerules are not parsed by qmake, so they should be in a format understood by Symbian package generation tools. - Please consult Symbian documentation for correct syntax. + Please consult the Symbian platform documentation for correct syntax. For example, to deploy DLL and add a new dependency: @@ -1424,7 +1424,7 @@ override languages statement, you must override also package-header statement and all other statements which are language specific. - In Symbian, the \c default_deployment item specifies + On the Symbian platform, the \c default_deployment item specifies default platform dependencies. It can be overwritten if a more restrictive set is needed - e.g. if a specific device is required to run the application. @@ -1436,7 +1436,7 @@ \target DEPLOYMENT_PLUGIN \section1 DEPLOYMENT_PLUGIN - \e {This is only used on Windows CE and Symbian.} + \e {This is only used on Windows CE and the Symbian platform.} This variable specifies the Qt plugins that will be deployed. All plugins available in Qt can be explicitly deployed to the device. See @@ -1446,9 +1446,9 @@ If the application depends on plugins, these plugins have to be specified manually. - \note In Symbian, all plugins supported by this variable will be deployed - by default with Qt libraries, so generally using this variable is not - needed. + \note On the Symbian platform, all plugins supported by this variable +will be deployed by default with Qt libraries, so generally using this +variable is not needed. For example: @@ -1556,7 +1556,7 @@ \target ICON \section1 ICON - This variable is used only in MAC and S60 to set the application icon. + This variable is used only in MAC and the Symbian platform to set the application icon. Please see \l{Setting the Application Icon}{the application icon documentation} for more information. @@ -1623,10 +1623,10 @@ This variable contains a list of libraries to be linked into the project. You can use the Unix \c -l (library) and -L (library path) flags and qmake - will do the correct thing with these libraries on Windows and Symbian - (namely this means passing the full path of the library to the linker). The - only limitation to this is the library must exist, for qmake to find which - directory a \c -l lib lives in. + will do the correct thing with these libraries on Windows and the + Symbian platform (namely this means passing the full path of the library to + the linker). The only limitation to this is the library must exist, for + qmake to find which directory a \c -l lib lives in. For example: @@ -1647,7 +1647,8 @@ explicitly specify the library to be used by including the \c{.lib} file name suffix. - \bold{Note:} On S60, the build system makes a distinction between shared and + \bold{Note:} On the Symbian platform, the build system makes a +distinction between shared and static libraries. In most cases, qmake will figure out which library you are refering to, but in some cases you may have to specify it explicitly to get the expected behavior. This typically happens if you are building a @@ -1693,7 +1694,7 @@ \target MMP_RULES \section1 MMP_RULES - \e {This is only used on Symbian.} + \e {This is only used on the Symbian platform.} Generic MMP file content can be specified with this variable. @@ -2013,8 +2014,9 @@ the \c QMAKE_CXXFLAGS_DEBUG and \c QMAKE_CXXFLAGS_RELEASE variables, respectively. - \bold{Note:} On S60, this variable can be used to pass architecture specific - options to each compiler in the Symbian build system. For example: + \bold{Note:} On the Symbian platform, this variable can be used to pass +architecture specific options to each compiler in the Symbian build system. +For example: \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 131 @@ -2812,7 +2814,7 @@ \target RSS_RULES \section1 RSS_RULES - \e {This is only used on Symbian.} + \e {This is only used on the Symbian platform.} Generic RSS file content can be specified with this variable. The syntax is similar to \c MMP_RULES and \c BLD_INF_RULES. @@ -2832,10 +2834,12 @@ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 145 - This example will install the application to MyFolder in S60 application - shell. In addition it will make the application to be launched in background. + This example will install the application to MyFolder in the Symbian + platform application shell. In addition it will make the application to + be launched in background. - For detailed list of possible RSS statements, please refer to Symbian OS help. + For detailed list of possible RSS statements, please refer to the + Symbian platform help. \note You should not use \c RSS_RULES variable to set the following RSS statements: @@ -2848,7 +2852,7 @@ \target S60_VERSION \section1 S60_VERSION - \e {This is only used on Symbian.} + \e {This is only used on the Symbian platform.} Contains the version number of the underlying S60 SDK; e.g. "5.0". @@ -2918,7 +2922,7 @@ \target TARGET.CAPABILITY \section1 TARGET.CAPABILITY - \e {This is only used on Symbian.} + \e {This is only used on the Symbian platform.} Specifies which platform capabilities the application should have. For more information, please refer to the S60 SDK documentation. @@ -2926,7 +2930,7 @@ \target TARGET.EPOCALLOWDLLDATA \section1 TARGET.EPOCALLOWDLLDATA - \e {This is only used on Symbian.} + \e {This is only used on the Symbian platform.} Specifies whether static data should be allowed in the application. Symbian disallows this by default in order to save memory. To use it, set this to 1. @@ -2934,7 +2938,7 @@ \target TARGET.EPOCHEAPSIZE \section1 TARGET.EPOCHEAPSIZE - \e {This is only used on Symbian.} + \e {This is only used on the Symbian platform.} Specifies the minimum and maximum heap size of the application. The program will refuse to run if the minimum size is not available when it starts. For @@ -2945,7 +2949,7 @@ \target TARGET.EPOCSTACKSIZE \section1 TARGET.EPOCSTACKSIZE - \e {This is only used on Symbian.} + \e {This is only used on the Symbian platform.} Specifies the maximum stack size of the application. For example: @@ -2954,7 +2958,7 @@ \target TARGET.SID \section1 TARGET.SID - \e {This is only used on Symbian.} + \e {This is only used on the Symbian platform.} Specifies which secure identifier to use for the target application or library. For more information, see the S60 SDK documentation. @@ -2962,7 +2966,7 @@ \target TARGET.UID2 \section1 TARGET.UID2 - \e {This is only used on Symbian.} + \e {This is only used on the Symbian platform.} Specifies which unique identifier 2 to use for the target application or library. If this variable is not specified, it defaults to the same value @@ -2971,7 +2975,7 @@ \target TARGET.UID3 \section1 TARGET.UID3 - \e {This is only used on Symbian.} + \e {This is only used on the Symbian platform.} Specifies which unique identifier 3 to use for the target application or library. If this variable is not specified, a UID3 suitable for development @@ -2982,7 +2986,7 @@ \target TARGET.VID \section1 TARGET.VID - \e {This is only used on Symbian.} + \e {This is only used on the Symbian platform.} Specifies which vendor identifier to use for the target application or library. For more information, see the S60 SDK documentation. @@ -3862,9 +3866,10 @@ \o Indicates that the output should not be added to the list of objects to be linked in. \endtable - \note Symbian specific: Generating objects to be linked in is not supported in Symbian, - so either the \c CONFIG option \c no_link or variable \c variable_out - should always be defined for extra compilers. + \note Symbian platform specific: Generating objects to be linked in is + not supported on the Symbian platform, so either the \c CONFIG option + \c no_link or variable \c variable_out should always be defined for + extra compilers. */ diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc index 2ace8de78e..366a906145 100644 --- a/doc/src/getting-started/installation.qdoc +++ b/doc/src/getting-started/installation.qdoc @@ -497,14 +497,14 @@ in the \l{Qt for Windows CE Requirements} document. We hope you will enjoy using Qt. Good luck! */ -/*! \page install-S60-installer.html +/*! \page install-Symbian-installer.html -\title Installing Qt on S60 using binary package +\title Installing Qt on the Symbian platform using binary package \ingroup qts60 -\brief How to install Qt on S60 using the binary package. +\brief How to install Qt on the Symbian platform using the binary package. -\note Qt for S60 has some requirements that are given in more detail -in the \l{Qt for S60 Requirements} document. +\note Qt for Symbian platform has some requirements that are given in more detail +in the \l{Qt for Symbian platform Requirements} document. \list 1 @@ -527,7 +527,7 @@ in the \l{Qt for S60 Requirements} document. and follow the instructions. To run the demos and examples on the emulator, you need to build them first. - Open the "Qt for S60 Command Prompt" from the Start menu and type: + Open the "Qt for Symbian platform Command Prompt" from the Start menu and type: \snippet doc/src/snippets/code/doc_src_installation.qdoc 25 @@ -536,27 +536,29 @@ in the \l{Qt for S60 Requirements} document. \snippet doc/src/snippets/code/doc_src_installation.qdoc 27 - For more information about building and running Qt programs on S60, - see \l{S60 - Introduction to using Qt}. + For more information about building and running Qt programs on the +Symbian platform, + see \l{Symbian platform - Introduction to using Qt}. We hope you will enjoy using Qt. \endlist */ -/*! \page install-S60.html +/*! \page install-Symbian.html -\title Installing Qt on S60 +\title Installing Qt on the Symbian platform \ingroup installation \ingroup qts60 -\brief How to install Qt on S60 +\brief How to install Qt for the Symbian platform -\note Qt for S60 has some requirements that are given in more detail -in the \l{Qt for S60 Requirements} document. +\note Qt for the Symbian platform has some requirements that are given in more detail +in the \l{Qt for Symbian platform Requirements} document. -\note \bold {This document describes how to install and configure Qt for S60 from scratch. +\note \bold {This document describes how to install and configure Qt for +the Symbian platform from scratch. If you are using pre-built binaries, follow the instructions -\l{Installing Qt on S60 using binary package}{here}.} +\l{Installing Qt on the Symbian platform using binary package}{here}.} \list 1 @@ -586,7 +588,7 @@ If you are using pre-built binaries, follow the instructions \o Configure Qt - To configure Qt for S60, do: + To configure Qt for the Symbian platform, do: \snippet doc/src/snippets/code/doc_src_installation.qdoc 23 to build the tools using MinGW, and the libraries using abld. @@ -633,8 +635,8 @@ If you are using pre-built binaries, follow the instructions \snippet doc/src/snippets/code/doc_src_installation.qdoc 27 - For more information about building and running Qt programs on S60, - see \l{S60 - Introduction to using Qt}. + For more information about building and running Qt programs on the +Symbian platform, see \l{Symbian platform - Introduction to using Qt}. We hope you will enjoy using Qt. @@ -669,7 +671,7 @@ If you are using pre-built binaries, follow the instructions \list \o \l{Qt for Embedded Linux Requirements} \o \l{Qt for Mac OS X Requirements} - \o \l{Qt for S60 Requirements} + \o \l{Qt for Symbian platform Requirements} \o \l{Qt for Windows CE Requirements} \o \l{Qt for Windows Requirements} \o \l{Qt for X11 Requirements} @@ -953,13 +955,13 @@ If you are using pre-built binaries, follow the instructions */ /*! - \page requirements-s60.html - \title Qt for S60 Requirements + \page requirements-symbian.html + \title Qt for Symbian platform Requirements \ingroup installation - \brief Setting up the S60 environment for Qt. + \brief Setting up the Symbian platform environment for Qt. \previouspage General Qt Requirements - Qt for S60 requires the following software installed on your development PC: + Qt for Symbian platform requires the following software installed on your development PC: \list \o \l{http://www.mingw.org/}{MinGW 3.4.5 or higher}, or another windows compiler to build the tools. \o \l{http://www.forum.nokia.com/main/resources/tools_and_sdks/carbide_cpp/}{Carbide.c++ v2.0.0 or higher} diff --git a/doc/src/howtos/appicon.qdoc b/doc/src/howtos/appicon.qdoc index ece2dcf9a4..4108c11cb0 100644 --- a/doc/src/howtos/appicon.qdoc +++ b/doc/src/howtos/appicon.qdoc @@ -213,9 +213,9 @@ The GNOME developer website is at \l{http://developer.gnome.org/}. - \section1 Setting the Application Icon on S60 platforms + \section1 Setting the Application Icon on the Symbian platform - In order to set the application icon for S60 applications, you need + In order to set the application icon for Symbian platform applications, you need an SVG-T icon. For information on how to create SVG-T compliant icons, please refer to \l{http://wiki.forum.nokia.com/index.php/How_to_create_application_icon(SVG)_in_S60_3rd_edition/} diff --git a/doc/src/images/qt-embedded-architecture.png b/doc/src/images/qt-embedded-architecture.png Binary files differindex d3f8edc11b..20b3e7ffc1 100644 --- a/doc/src/images/qt-embedded-architecture.png +++ b/doc/src/images/qt-embedded-architecture.png diff --git a/doc/src/platforms/qt-embedded.qdoc b/doc/src/platforms/qt-embedded.qdoc index 0b2c2ac562..c39a967641 100644 --- a/doc/src/platforms/qt-embedded.qdoc +++ b/doc/src/platforms/qt-embedded.qdoc @@ -54,7 +54,7 @@ Currently, three embedded platforms are supported by Qt: \table 90% - \header \o Embedded Linux \o Windows CE \o S60 + \header \o Embedded Linux \o Windows CE \o Symbian platform \row \o \l{Qt for Embedded Linux} is designed to be used on Linux devices without X11 or existing graphical environments. This flavor of @@ -67,8 +67,9 @@ Applications use the appropriate style for the embedded environment and use native features, such as menus, to conform to the native style guidelines. - \o \l{S60 - Introduction to using Qt}{Qt for S60} is used to create - applications running in existing S60 environments. + \o \l{Symbian platform - Introduction to using Qt}{Qt for the Symbian +platform} is used to create + applications running in existing Symbian platform environments. Applications use the appropriate style for the embedded environment and use native features, such as menus, to conform to the native style guidelines. diff --git a/doc/src/platforms/s60-introduction.qdoc b/doc/src/platforms/s60-introduction.qdoc index 086ee52dc9..d145a82b28 100644 --- a/doc/src/platforms/s60-introduction.qdoc +++ b/doc/src/platforms/s60-introduction.qdoc @@ -40,10 +40,10 @@ ****************************************************************************/ /*! - \page s60-with-qt-introduction.html + \page symbian-with-qt-introduction.html - \title S60 - Introduction to using Qt - \brief An introduction to Qt for S60 developers. + \title Symbian platform - Introduction to using Qt + \brief An introduction to Qt for Symbian platform developers. \ingroup howto \ingroup qts60 @@ -51,21 +51,22 @@ \section1 Required tools - See \l{Qt for S60 Requirements} to see what tools are required to use Qt for S60. + See \l{Qt for Symbian platform Requirements} to see what tools are +required to use Qt for Symbian platform. \section1 Installing Qt and running demos - Follow the instructions found in \l{Installing Qt on S60 using binary package} to learn how + Follow the instructions found in \l{Installing Qt on the Symbian platform using binary package} to learn how to install Qt using binary package and how to build and run Qt demos. - Follow the instructions found in \l{Installing Qt on S60} to learn how to install Qt using + Follow the instructions found in \l{Installing Qt on the Symbian platform} to learn how to install Qt using using source package and how to build and run the Qt demos. \section1 Building your own applications If you are new to Qt development, have a look at \l{How to Learn Qt}. In general, the difference between developing a - Qt application on S60 compared to any of the other platforms supported + Qt application on the Symbian platform compared to any of the other platforms supported by Qt is not that big. Once you have crated a \c .pro file for your project, generate the @@ -76,10 +77,10 @@ For more information on how to use qmake have a look at the \l {qmake Tutorial}. - Now you can build the Qt on S60 application with standard build - tools. By default, running \c make will produce binaries for the - emulator. However, S60 comes with several alternative build targets, - as shown in the table below: + Now you can build the Qt for the Symbian platform application with +standard build tools. By default, running \c make will produce binaries for +the emulator. However, the Symbian platform comes with several alternative +build targets, as shown in the table below: \table \row \o \c debug-winscw \o Build debug binaries for the emulator (default). @@ -121,8 +122,8 @@ \row \o \c QT_SIS_OPTIONS \o Options accepted by \c .sis creation. -i, install the package right away using PC suite. -c=<file>, read certificate information from a file. - Execute \c{createpackage.pl} script without any - parameters for more information about options. + Execute \c{perl createpackage.pl} for more information + about options. By default no otions are given. \row \o \c QT_SIS_TARGET \o Target for which \c .sis file is created. Accepted values are build targets listed in diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc index 6224cd4d17..38f346f275 100644 --- a/doc/src/qt4-intro.qdoc +++ b/doc/src/qt4-intro.qdoc @@ -661,10 +661,9 @@ See the \l{QtMultimedia Module} documentation for more information. - \section1 Classes, functions, and other items introduced in 4.6 + \section1 Classes, functions, etc new in 4.6 - Links to classes, function, and other items that were added in - 4.6. + Links to classes, functions, and other items that are new in 4.6. \sincelist 4.6 diff --git a/examples/opengl/hellogl/glwidget.cpp b/examples/opengl/hellogl/glwidget.cpp index 282f21f8cf..ffb3b15750 100644 --- a/examples/opengl/hellogl/glwidget.cpp +++ b/examples/opengl/hellogl/glwidget.cpp @@ -150,10 +150,10 @@ void GLWidget::paintGL() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); - glTranslated(0.0, 0.0, -10.0); - glRotated(xRot / 16.0, 1.0, 0.0, 0.0); - glRotated(yRot / 16.0, 0.0, 1.0, 0.0); - glRotated(zRot / 16.0, 0.0, 0.0, 1.0); + glTranslatef(0.0, 0.0, -10.0); + glRotatef(xRot / 16.0, 1.0, 0.0, 0.0); + glRotatef(yRot / 16.0, 0.0, 1.0, 0.0); + glRotatef(zRot / 16.0, 0.0, 0.0, 1.0); logo->draw(); } //! [7] @@ -166,7 +166,11 @@ void GLWidget::resizeGL(int width, int height) glMatrixMode(GL_PROJECTION); glLoadIdentity(); +#ifdef QT_OPENGL_ES_1 + glOrthof(-0.5, +0.5, -0.5, +0.5, 4.0, 15.0); +#else glOrtho(-0.5, +0.5, -0.5, +0.5, 4.0, 15.0); +#endif glMatrixMode(GL_MODELVIEW); } //! [8] diff --git a/examples/opengl/hellogl/main.cpp b/examples/opengl/hellogl/main.cpp index e645dbaef6..f610b3b179 100644 --- a/examples/opengl/hellogl/main.cpp +++ b/examples/opengl/hellogl/main.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include <QApplication> +#include <QDesktopWidget> #include "window.h" @@ -47,6 +48,13 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Window window; - window.show(); + window.resize(window.sizeHint()); + int desktopArea = QApplication::desktop()->width() * + QApplication::desktop()->height(); + int widgetArea = window.width() * window.height(); + if (((float)widgetArea / (float)desktopArea) < 0.75f) + window.show(); + else + window.showMaximized(); return app.exec(); } diff --git a/examples/opengl/hellogl/window.cpp b/examples/opengl/hellogl/window.cpp index 2b06b9c50a..19a8aacc99 100644 --- a/examples/opengl/hellogl/window.cpp +++ b/examples/opengl/hellogl/window.cpp @@ -88,3 +88,11 @@ QSlider *Window::createSlider() return slider; } //! [2] + +void Window::keyPressEvent(QKeyEvent *e) +{ + if (e->key() == Qt::Key_Escape) + close(); + else + QWidget::keyPressEvent(e); +} diff --git a/examples/opengl/hellogl/window.h b/examples/opengl/hellogl/window.h index 7269a05e0e..4cfd31b8b5 100644 --- a/examples/opengl/hellogl/window.h +++ b/examples/opengl/hellogl/window.h @@ -57,6 +57,9 @@ class Window : public QWidget public: Window(); +protected: + void keyPressEvent(QKeyEvent *event); + private: QSlider *createSlider(); diff --git a/examples/opengl/opengl.pro b/examples/opengl/opengl.pro index 2cb8227068..eaac9b8924 100644 --- a/examples/opengl/opengl.pro +++ b/examples/opengl/opengl.pro @@ -9,6 +9,9 @@ contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles1cl)|contains(QT_CONF !contains(QT_CONFIG, opengles1cl) { SUBDIRS += textures } + contains(QT_CONFIG, opengles1) { + SUBDIRS += hellogl + } } else { SUBDIRS = 2dpainting \ grabber \ diff --git a/examples/opengl/shared/qtlogo.cpp b/examples/opengl/shared/qtlogo.cpp index b32b416a92..bad83d10d4 100644 --- a/examples/opengl/shared/qtlogo.cpp +++ b/examples/opengl/shared/qtlogo.cpp @@ -39,6 +39,12 @@ ** ****************************************************************************/ +#include <QGLWidget> +#include <QMatrix4x4> +#include <QVector3D> + +#include <qmath.h> + #include "qtlogo.h" static const qreal tee_height = 0.311126; diff --git a/examples/opengl/shared/qtlogo.h b/examples/opengl/shared/qtlogo.h index 4f5c35776f..152958b0fe 100644 --- a/examples/opengl/shared/qtlogo.h +++ b/examples/opengl/shared/qtlogo.h @@ -43,7 +43,7 @@ #define QTLOGO_H #include <QObject> -#include <QtOpenGL> +#include <QColor> class Patch; struct Geometry; diff --git a/src/3rdparty/phonon/phonon/objectdescriptionmodel.h b/src/3rdparty/phonon/phonon/objectdescriptionmodel.h index 9af261551a..a3c72b2396 100644 --- a/src/3rdparty/phonon/phonon/objectdescriptionmodel.h +++ b/src/3rdparty/phonon/phonon/objectdescriptionmodel.h @@ -139,6 +139,21 @@ namespace Phonon ObjectDescriptionModelDataPrivate *const d; }; +/* Required to ensure template class vtables are exported on both symbian +and existing builds. */ +#if defined(Q_OS_SYMBIAN) && defined(Q_CC_RVCT) +// RVCT compiler (2.2.686) requires the export declaration to be on the class to export vtables +// MWC compiler works both ways +// GCCE compiler is unknown (it can't compile QtCore yet) +#define PHONON_TEMPLATE_CLASS_EXPORT PHONON_EXPORT +#define PHONON_TEMPLATE_CLASS_MEMBER_EXPORT +#else +// Windows builds (at least) do not support export declaration on templated class +// But if you export a member function, the vtable is implicitly exported +#define PHONON_TEMPLATE_CLASS_EXPORT +#define PHONON_TEMPLATE_CLASS_MEMBER_EXPORT PHONON_EXPORT +#endif + /** \class ObjectDescriptionModel objectdescriptionmodel.h Phonon/ObjectDescriptionModel * \short The ObjectDescriptionModel class provides a model from * a list of ObjectDescription objects. @@ -175,18 +190,26 @@ namespace Phonon * \author Matthias Kretz <kretz@kde.org> */ template<ObjectDescriptionType type> - class PHONON_EXPORT ObjectDescriptionModel : public QAbstractListModel + class PHONON_TEMPLATE_CLASS_EXPORT ObjectDescriptionModel : public QAbstractListModel { public: Q_OBJECT_CHECK +/* MinGW 3.4.x gives an ICE when trying to instantiate one of the + ObjectDescriptionModel<foo> classes because it can't handle + half exported classes correct. gcc 4.3.x has a fix for this but + we currently there's no official gcc 4.3 on windows available. + Because of this we need this little hack + */ +#if !defined(Q_CC_MINGW) || __MINGW32_MAJOR_VERSION >= 4 /** \internal */ - static const QMetaObject staticMetaObject; + static PHONON_TEMPLATE_CLASS_MEMBER_EXPORT const QMetaObject staticMetaObject; /** \internal */ - const QMetaObject *metaObject() const; + PHONON_TEMPLATE_CLASS_MEMBER_EXPORT const QMetaObject *metaObject() const; /** \internal */ - void *qt_metacast(const char *_clname); + PHONON_TEMPLATE_CLASS_MEMBER_EXPORT void *qt_metacast(const char *_clname); //int qt_metacall(QMetaObject::Call _c, int _id, void **_a); +#endif /** * Returns the number of rows in the model. This value corresponds diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 9d76dcc991..4234a7ec2d 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -71,8 +71,8 @@ Qt { Q_ENUMS(ArrowType ToolButtonStyle PenStyle PenCapStyle PenJoinStyle BrushStyle) Q_ENUMS(FillRule MaskMode BGMode ClipOperation SizeMode) Q_ENUMS(BackgroundMode) // Qt3 - Q_ENUMS(Axis Corner LayoutDirection SizeHint Orientation) - Q_FLAGS(Alignment Orientations) + Q_ENUMS(Axis Corner LayoutDirection SizeHint Orientation DropAction) + Q_FLAGS(Alignment Orientations DropActions) Q_FLAGS(DockWidgetAreas ToolBarAreas) Q_ENUMS(DockWidgetArea ToolBarArea) Q_ENUMS(TextFormat) diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index b7775bdffc..ab232bf72e 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -713,7 +713,13 @@ \omitvalue Dither_Mask \omitvalue AlphaDither_Mask \omitvalue DitherMode_Mask - \omitvalue NoOpaqueDetection + + \value NoOpaqueDetection Do not check whether the image contains non-opaque + pixels. Use this if you know that the image is semi-transparent and + you want to avoid the overhead of checking the pixels in the image + until a non-opaque pixel is found, or if you want the pixmap to + retain an alpha channel for some other reason. If the image has no + alpha channel this flag has no effect. */ /*! \enum Qt::GUIStyle diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 1b559cfaf3..1277623748 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -54,7 +54,6 @@ #ifndef Q_WS_WIN #include <locale.h> #endif - #include <time.h> #if defined(Q_OS_WINCE) #include "qfunctions_wince.h" @@ -69,6 +68,31 @@ # define QDTPDEBUGN if (false) qDebug #endif +#if defined(Q_OS_SYMBIAN) + // Workaround for OpenC bug. + + // OpenC incorrectly caches DST information between localtime_r + // calls, i.e. if previous call to localtime_r has been called for DST + // affected date, also the second call will be affected by DST even + // the date is such that DST should not be applied. + + // The workaround is to call mktime with non-DST affected date before + // calling localtime_r. mktime call resets the OpenC internal DST cache + // to right value and localtime_r will return correct values. +#define FIX_OPENC_DSTCACHE \ + tm localTM; \ + localTM.tm_sec = 0; \ + localTM.tm_min = 0; \ + localTM.tm_hour = 12; \ + localTM.tm_mday = 1; \ + localTM.tm_mon = 1; \ + localTM.tm_year = 2002 - 1900; \ + localTM.tm_isdst = -1; \ + time_t temp = mktime(&localTM); +#else +#define FIX_OPENC_DSTCACHE +#endif + #if defined(Q_WS_MAC) #include <private/qcore_mac_p.h> #endif @@ -1138,6 +1162,7 @@ QDate QDate::currentDate() // use the reentrant version of localtime() where available tzset(); tm res; + FIX_OPENC_DSTCACHE t = localtime_r(<ime, &res); #else t = localtime(<ime); @@ -1834,12 +1859,13 @@ QTime QTime::currentTime() // use the reentrant version of localtime() where available tzset(); tm res; + FIX_OPENC_DSTCACHE t = localtime_r(<ime, &res); #else t = localtime(<ime); #endif Q_CHECK_PTR(t); - + ct.mds = MSECS_PER_HOUR * t->tm_hour + MSECS_PER_MIN * t->tm_min + 1000 * t->tm_sec + tv.tv_usec / 1000; #else @@ -2887,6 +2913,7 @@ QDateTime QDateTime::currentDateTime() // use the reentrant version of localtime() where available tzset(); tm res; + FIX_OPENC_DSTCACHE t = localtime_r(<ime, &res); #else t = localtime(<ime); @@ -3704,6 +3731,7 @@ static QDateTimePrivate::Spec utcToLocal(QDate &date, QTime &time) // use the reentrant version of localtime() where available tzset(); tm res; + FIX_OPENC_DSTCACHE brokenDown = localtime_r(&secsSince1Jan1970UTC, &res); #elif defined(_MSC_VER) && _MSC_VER >= 1400 tm res; diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp index 7df49fa68f..ed2d67689b 100644 --- a/src/gui/dialogs/qdialog.cpp +++ b/src/gui/dialogs/qdialog.cpp @@ -673,28 +673,6 @@ void QDialog::keyPressEvent(QKeyEvent *e) case Qt::Key_Escape: reject(); break; - case Qt::Key_Up: - case Qt::Key_Left: - if (focusWidget() && - (focusWidget()->focusPolicy() == Qt::StrongFocus || - focusWidget()->focusPolicy() == Qt::WheelFocus)) { - e->ignore(); - break; - } - // call ours, since c++ blocks us from calling the one - // belonging to focusWidget(). - focusNextPrevChild(false); - break; - case Qt::Key_Down: - case Qt::Key_Right: - if (focusWidget() && - (focusWidget()->focusPolicy() == Qt::StrongFocus || - focusWidget()->focusPolicy() == Qt::WheelFocus)) { - e->ignore(); - break; - } - focusNextPrevChild(true); - break; default: e->ignore(); return; diff --git a/src/gui/dialogs/qfiledialog_p.h b/src/gui/dialogs/qfiledialog_p.h index 44289d9db3..32cd397ebf 100644 --- a/src/gui/dialogs/qfiledialog_p.h +++ b/src/gui/dialogs/qfiledialog_p.h @@ -76,7 +76,7 @@ #include <qdebug.h> #include "qsidebar_p.h" #include "qfscompleter_p.h" -#include "../kernel/qguiplatformplugin_p.h" +#include "private/qguiplatformplugin_p.h" #if defined (Q_OS_UNIX) diff --git a/src/gui/dialogs/qprintdialog_win.cpp b/src/gui/dialogs/qprintdialog_win.cpp index f66c27feed..843c4e2815 100644 --- a/src/gui/dialogs/qprintdialog_win.cpp +++ b/src/gui/dialogs/qprintdialog_win.cpp @@ -52,6 +52,13 @@ #include <private/qprintengine_win_p.h> #include <private/qprinter_p.h> +#if defined(Q_CC_MINGW) && !defined(PD_NOCURRENTPAGE) +#define PD_NOCURRENTPAGE 0x00800000 +#define PD_RESULT_PRINT 1 +#define PD_RESULT_APPLY 2 +#define START_PAGE_GENERAL 0XFFFFFFFF +#endif + QT_BEGIN_NAMESPACE extern void qt_win_eatMouseMove(); diff --git a/src/gui/egl/qeglproperties.cpp b/src/gui/egl/qeglproperties.cpp index 02ae729e46..c61e1d3c36 100644 --- a/src/gui/egl/qeglproperties.cpp +++ b/src/gui/egl/qeglproperties.cpp @@ -313,7 +313,7 @@ QString QEglProperties::toString() const int alpha = value(EGL_ALPHA_SIZE); int bufferSize = value(EGL_BUFFER_SIZE); if (bufferSize == (red + green + blue + alpha)) - bufferSize = EGL_DONT_CARE; + bufferSize = 0; str += QLatin1String(" rgba="); str += QString::number(red); str += QLatin1Char(','); @@ -322,7 +322,7 @@ QString QEglProperties::toString() const str += QString::number(blue); str += QLatin1Char(','); str += QString::number(alpha); - if (bufferSize != EGL_DONT_CARE) { + if (bufferSize != 0) { // Only report buffer size if different than r+g+b+a. str += QLatin1String(" buffer-size="); str += QString::number(bufferSize); diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index 3448459f78..e0779a0f65 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -962,15 +962,10 @@ QString QIcon::themeName() */ QIcon QIcon::fromTheme(const QString &name, const QIcon &fallback) { - static QCache <QString, QIcon> iconCache; QIcon icon; - icon = qt_guiPlatformPlugin()->loadIcon(name); - if (!icon.isNull()) - return icon; - if (iconCache.contains(name)) { icon = *iconCache.object(name); } else { diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp index adc2967bf4..5412e11ce1 100644 --- a/src/gui/image/qiconloader.cpp +++ b/src/gui/image/qiconloader.cpp @@ -43,7 +43,7 @@ #include <private/qapplication_p.h> #include <private/qicon_p.h> -#include <private/qkde_p.h> +#include <private/qguiplatformplugin_p.h> #include <QtGui/QIconEnginePlugin> #include <QtGui/QPixmapCache> @@ -68,47 +68,25 @@ QT_BEGIN_NAMESPACE Q_GLOBAL_STATIC(QIconLoader, iconLoaderInstance) +/* Theme to use in last resort, if the theme does not have the icon, neither the parents */ static QString fallbackTheme() { - QString defaultTheme; -#ifdef Q_WS_X11 - if (X11->desktopEnvironment == DE_GNOME) - defaultTheme = QLatin1String("gnome"); - else if (X11->desktopEnvironment == DE_KDE) - defaultTheme = X11->desktopVersion >= 4 ? - QString::fromLatin1("oxygen") : - QString::fromLatin1("crystalsvg"); -#endif - return defaultTheme; -} - -static QString systemThemeName() -{ - QString result = fallbackTheme(); #ifdef Q_WS_X11 if (X11->desktopEnvironment == DE_GNOME) { -#ifndef QT_NO_STYLE_GTK - result = QGtk::getGConfString(QLatin1String("/desktop/gnome/interface/icon_theme"), - result); -#endif + return QLatin1String("gnome"); } else if (X11->desktopEnvironment == DE_KDE) { - QSettings settings(QKde::kdeHome() + - QLatin1String("/share/config/kdeglobals"), - QSettings::IniFormat); - - settings.beginGroup(QLatin1String("Icons")); - - result = settings.value(QLatin1String("Theme"), result).toString(); + return X11->desktopVersion >= 4 + ? QString::fromLatin1("oxygen") + : QString::fromLatin1("crystalsvg"); } #endif - return result; + return QString(); } - QIconLoader::QIconLoader() : m_themeKey(1), m_supportsSvg(false) { - m_systemTheme = systemThemeName(); + m_systemTheme = qt_guiPlatformPlugin()->systemIconThemeName(); QFactoryLoader iconFactoryLoader(QIconEngineFactoryInterfaceV2_iid, QLatin1String("/iconengines"), @@ -128,7 +106,7 @@ void QIconLoader::updateSystemTheme() { // Only change if this is not explicitly set by the user if (m_userTheme.isEmpty()) { - QString theme = systemThemeName(); + QString theme = qt_guiPlatformPlugin()->systemIconThemeName(); if (theme != m_systemTheme) { m_systemTheme = theme; invalidateKey(); @@ -152,51 +130,7 @@ void QIconLoader::setThemeSearchPath(const QStringList &searchPaths) QStringList QIconLoader::themeSearchPaths() const { if (m_iconDirs.isEmpty()) { - -#if defined(Q_WS_X11) - - QString xdgDirString = QFile::decodeName(getenv("XDG_DATA_DIRS")); - if (xdgDirString.isEmpty()) - xdgDirString = QLatin1String("/usr/local/share/:/usr/share/"); - - QStringList xdgDirs = xdgDirString.split(QLatin1Char(':')); - - for (int i = 0 ; i < xdgDirs.size() ; ++i) { - QDir dir(xdgDirs[i]); - if (dir.exists()) - m_iconDirs.append(dir.path() + - QLatin1String("/icons")); - } - - if (X11->desktopEnvironment == DE_KDE) { - - m_iconDirs << QLatin1Char(':') + - QKde::kdeHome() + - QLatin1String("/share/icons"); - QStringList kdeDirs = - QFile::decodeName(getenv("KDEDIRS")).split(QLatin1Char(':')); - - for (int i = 0 ; i< kdeDirs.count() ; ++i) { - QDir dir(QLatin1Char(':') + kdeDirs.at(i) + - QLatin1String("/share/icons")); - if (dir.exists()) - m_iconDirs.append(dir.path()); - } - } - - // Add home directory first in search path - QDir homeDir(QDir::homePath() + QLatin1String("/.icons")); - if (homeDir.exists()) - m_iconDirs.prepend(homeDir.path()); -#endif - -#if defined(Q_WS_WIN) - m_iconDirs.append(qApp->applicationDirPath() + - QLatin1String("/icons")); -#elif defined(Q_WS_MAC) - m_iconDirs.append(qApp->applicationDirPath() + - QLatin1String("/../Resources/icons")); -#endif + m_iconDirs = qt_guiPlatformPlugin()->iconThemeSearchPaths(); // Allways add resource directory as search path m_iconDirs.append(QLatin1String(":/icons")); } @@ -291,7 +225,7 @@ QThemeIconEntries QIconLoader::findIconHelper(const QString &themeName, if (!theme.isValid()) { theme = QIconTheme(themeName); if (!theme.isValid()) - theme = fallbackTheme(); + theme = QIconTheme(fallbackTheme()); themeList.insert(themeName, theme); } diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp index 37b64381cc..554c0f30e7 100644 --- a/src/gui/image/qpixmap_s60.cpp +++ b/src/gui/image/qpixmap_s60.cpp @@ -229,24 +229,15 @@ static CFbsBitmap* uncompress(CFbsBitmap* bitmap) lock.relock(); - CBitmapContext *bitmapContext = 0; CFbsBitmapDevice* bitmapDevice = 0; + CFbsBitGc *bitmapGc = 0; QT_TRAP_THROWING(bitmapDevice = CFbsBitmapDevice::NewL(uncompressed)); - TInt err = bitmapDevice->CreateBitmapContext(bitmapContext); - if (err != KErrNone) { - delete bitmap; - delete bitmapDevice; - bitmap = 0; - bitmapDevice = 0; - - lock.relock(); + QT_TRAP_THROWING(bitmapGc = CFbsBitGc::NewL()); + bitmapGc->Activate(bitmapDevice); - return bitmap; - } + bitmapGc->DrawBitmap(TPoint(), bitmap); - bitmapContext->DrawBitmap(TPoint(), bitmap); - - delete bitmapContext; + delete bitmapGc; delete bitmapDevice; return uncompressed; @@ -355,7 +346,7 @@ QS60PixmapData::QS60PixmapData(PixelType type) : QRasterPixmapData(type), symbianBitmapDataAccess(new QSymbianBitmapDataAccess), cfbsBitmap(0), bitmapDevice(0), - bitmapContext(0), + bitmapGc(0), pengine(0), bytes(0) { @@ -365,6 +356,7 @@ QS60PixmapData::QS60PixmapData(PixelType type) : QRasterPixmapData(type), QS60PixmapData::~QS60PixmapData() { release(); + delete symbianBitmapDataAccess; } void QS60PixmapData::resize(int width, int height) @@ -391,6 +383,8 @@ void QS60PixmapData::resize(int width, int height) if(cfbsBitmap->SizeInPixels() != newSize) { cfbsBitmap->Resize(TSize(width, height)); + bitmapDevice->Resize(TSize(width, height)); + bitmapGc->Resized(); if(pengine) { delete pengine; pengine = 0; @@ -404,12 +398,9 @@ void QS60PixmapData::resize(int width, int height) bool QS60PixmapData::initSymbianBitmapContext() { QT_TRAP_THROWING(bitmapDevice = CFbsBitmapDevice::NewL(cfbsBitmap)); - TInt err = bitmapDevice->CreateBitmapContext(bitmapContext); - if (err != KErrNone) { - delete bitmapDevice; - bitmapDevice = 0; - return false; - } + QT_TRAP_THROWING(bitmapGc = CFbsBitGc::NewL()); + bitmapGc->Activate(bitmapDevice); + return true; } @@ -417,7 +408,7 @@ void QS60PixmapData::release() { if (cfbsBitmap) { QSymbianFbsHeapLock lock(QSymbianFbsHeapLock::Unlock); - delete bitmapContext; + delete bitmapGc; delete bitmapDevice; delete cfbsBitmap; lock.relock(); @@ -426,7 +417,7 @@ void QS60PixmapData::release() delete pengine; image = QImage(); cfbsBitmap = 0; - bitmapContext = 0; + bitmapGc = 0; bitmapDevice = 0; pengine = 0; bytes = 0; @@ -559,13 +550,15 @@ void QS60PixmapData::copy(const QPixmapData *data, const QRect &rect) resize(rect.width(), rect.height()); cfbsBitmap->SetDisplayMode(s60Data->cfbsBitmap->DisplayMode()); - bitmapContext->BitBlt(TPoint(0, 0), s60Data->cfbsBitmap, qt_QRect2TRect(rect)); + bitmapGc->BitBlt(TPoint(0, 0), s60Data->cfbsBitmap, qt_QRect2TRect(rect)); } bool QS60PixmapData::scroll(int dx, int dy, const QRect &rect) { - bitmapContext->CopyRect(TPoint(dx, dy), qt_QRect2TRect(rect)); - return true; + beginDataAccess(); + bool res = QRasterPixmapData::scroll(dx, dy, rect); + endDataAccess(); + return res; } int QS60PixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const diff --git a/src/gui/image/qpixmap_s60_p.h b/src/gui/image/qpixmap_s60_p.h index 4498c05460..b23961a148 100644 --- a/src/gui/image/qpixmap_s60_p.h +++ b/src/gui/image/qpixmap_s60_p.h @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE class CFbsBitmap; class CFbsBitmapDevice; -class CBitmapContext; +class CFbsBitGc; class QSymbianBitmapDataAccess; @@ -114,7 +114,7 @@ private: CFbsBitmap *cfbsBitmap; CFbsBitmapDevice *bitmapDevice; - CBitmapContext *bitmapContext; + CFbsBitGc *bitmapGc; QPaintEngine *pengine; uchar* bytes; diff --git a/src/gui/inputmethod/qwininputcontext_p.h b/src/gui/inputmethod/qwininputcontext_p.h index 39d50fd479..dd0490df11 100644 --- a/src/gui/inputmethod/qwininputcontext_p.h +++ b/src/gui/inputmethod/qwininputcontext_p.h @@ -56,6 +56,19 @@ #include "QtGui/qinputcontext.h" #include "QtCore/qt_windows.h" +#if defined(Q_CC_MINGW) && !defined(IMR_RECONVERTSTRING) +typedef struct tagRECONVERTSTRING { + DWORD dwSize; + DWORD dwVersion; + DWORD dwStrLen; + DWORD dwStrOffset; + DWORD dwCompStrLen; + DWORD dwCompStrOffset; + DWORD dwTargetStrLen; + DWORD dwTargetStrOffset; +} RECONVERTSTRING, *PRECONVERTSTRING; +#endif + QT_BEGIN_NAMESPACE class QWinInputContext : public QInputContext diff --git a/src/gui/inputmethod/qwininputcontext_win.cpp b/src/gui/inputmethod/qwininputcontext_win.cpp index 4a160d7b8f..e9ab870906 100644 --- a/src/gui/inputmethod/qwininputcontext_win.cpp +++ b/src/gui/inputmethod/qwininputcontext_win.cpp @@ -701,7 +701,7 @@ void QWinInputContext::updateImeStatus(QWidget *w, bool hasFocus) if (!focusProxyWidget) focusProxyWidget = w; bool e = w->testAttribute(Qt::WA_InputMethodEnabled) && w->isEnabled() - && !(focusProxyWidget->inputMethodHints() & Qt::ImhExclusiveInputMask); + && !(focusProxyWidget->inputMethodHints() & (Qt::ImhExclusiveInputMask | Qt::ImhHiddenText)); bool hasIme = e && hasFocus; #ifdef Q_IME_DEBUG qDebug("%s HasFocus = %d hasIme = %d e = %d ", w->className(), hasFocus, hasIme, e); diff --git a/src/gui/inputmethod/qximinputcontext_x11.cpp b/src/gui/inputmethod/qximinputcontext_x11.cpp index bee3ce89cf..b46b162d0a 100644 --- a/src/gui/inputmethod/qximinputcontext_x11.cpp +++ b/src/gui/inputmethod/qximinputcontext_x11.cpp @@ -612,7 +612,7 @@ void QXIMInputContext::setFocusWidget(QWidget *w) QInputContext::setFocusWidget(w); - if (!w || w->inputMethodHints() & Qt::ImhExclusiveInputMask) + if (!w || w->inputMethodHints() & (Qt::ImhExclusiveInputMask | Qt::ImhHiddenText)) return; ICData *data = ximData.value(w->effectiveWinId()); diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index 27528deb93..37f4184dcb 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -761,7 +761,7 @@ void QAbstractItemView::setItemDelegate(QAbstractItemDelegate *delegate) } } d->itemDelegate = delegate; - update(); + viewport()->update(); } /*! @@ -826,7 +826,7 @@ void QAbstractItemView::setItemDelegateForRow(int row, QAbstractItemDelegate *de } d->rowDelegates.insert(row, delegate); } - update(); + viewport()->update(); } /*! @@ -883,7 +883,7 @@ void QAbstractItemView::setItemDelegateForColumn(int column, QAbstractItemDelega } d->columnDelegates.insert(column, delegate); } - update(); + viewport()->update(); } /*! diff --git a/src/gui/itemviews/qfileiconprovider.cpp b/src/gui/itemviews/qfileiconprovider.cpp index c78a49be31..e3d17ade04 100644 --- a/src/gui/itemviews/qfileiconprovider.cpp +++ b/src/gui/itemviews/qfileiconprovider.cpp @@ -61,6 +61,7 @@ #endif #include <private/qfunctions_p.h> +#include <private/qguiplatformplugin_p.h> #ifndef SHGFI_ADDOVERLAYS #define SHGFI_ADDOVERLAYS 0x000000020 @@ -385,6 +386,10 @@ QIcon QFileIconProvider::icon(const QFileInfo &info) const { Q_D(const QFileIconProvider); + QIcon platformIcon = qt_guiPlatformPlugin()->fileSystemIcon(info); + if (!platformIcon.isNull()) + return platformIcon; + #if defined(Q_WS_X11) && !defined(QT_NO_STYLE_GTK) if (X11->desktopEnvironment == DE_GNOME) { QIcon gtkIcon = QGtk::getFilesystemIcon(info); diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp index fc9820f7df..a754579566 100644 --- a/src/gui/itemviews/qheaderview.cpp +++ b/src/gui/itemviews/qheaderview.cpp @@ -524,8 +524,10 @@ QSize QHeaderView::sizeHint() const Q_D(const QHeaderView); if (d->cachedSizeHint.isValid()) return d->cachedSizeHint; - d->cachedSizeHint = QSize(0, 0); //reinitialize the cached size hint + int width = 0; + int height = 0; const int sectionCount = count(); + d->executePostedLayout(); // get size hint for the first n sections int i = 0; diff --git a/src/gui/kernel/qapplication_mac.mm b/src/gui/kernel/qapplication_mac.mm index a95ae9db1b..f9c8aa3e24 100644 --- a/src/gui/kernel/qapplication_mac.mm +++ b/src/gui/kernel/qapplication_mac.mm @@ -1708,12 +1708,30 @@ QApplicationPrivate::globalEventProcessor(EventHandlerCallRef er, EventRef event sizeof(axis), 0, &axis); // The 'new' event has acceleration applied by the OS, while the old (on - // Carbon only), has not. So we introduce acceleration here to be consistent: - int scrollFactor = 120 * qMin(5, qAbs(mdelt)); + // Carbon only), has not. So we introduce acceleration here to be consistent. + // The acceleration is trying to respect both pixel based and line scrolling, + // which turns out to be rather difficult. + int linesToScroll = mdelt > 0 ? 1 : -1; + static QTime t; + int elapsed = t.elapsed(); + t.restart(); + if (elapsed < 20) + linesToScroll *= 120; + else if (elapsed < 30) + linesToScroll *= 60; + else if (elapsed < 50) + linesToScroll *= 30; + else if (elapsed < 100) + linesToScroll *= 6; + else if (elapsed < 200) + linesToScroll *= 3; + else if (elapsed < 300) + linesToScroll *= 2; + if (axis == kEventMouseWheelAxisX) - wheel_deltaX = mdelt * scrollFactor; + wheel_deltaX = linesToScroll * 120; else - wheel_deltaY = mdelt * scrollFactor; + wheel_deltaY = linesToScroll * 120; } } diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index 44f82b6cc4..270562fc69 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -171,10 +171,13 @@ typedef struct tagTOUCHINPUT #include <mywinsock.h> #endif +#ifndef IMR_RECONVERTSTRING +#define IMR_RECONVERTSTRING 4 +#endif + #ifndef IMR_CONFIRMRECONVERTSTRING #define IMR_CONFIRMRECONVERTSTRING 0x0005 #endif - QT_BEGIN_NAMESPACE #ifdef Q_WS_WINCE diff --git a/src/gui/kernel/qguiplatformplugin.cpp b/src/gui/kernel/qguiplatformplugin.cpp index c48b8f6482..6e074a12f7 100644 --- a/src/gui/kernel/qguiplatformplugin.cpp +++ b/src/gui/kernel/qguiplatformplugin.cpp @@ -41,6 +41,9 @@ #include "qguiplatformplugin_p.h" #include <qdebug.h> +#include <qfile.h> +#include <qdir.h> +#include <qsettings.h> #include "private/qfactoryloader_p.h" #include "qstylefactory.h" #include "qapplication.h" @@ -58,6 +61,7 @@ extern bool qt_wince_is_pocket_pc(); //qguifunctions_wince.cpp #if defined(Q_WS_X11) #include "qkde_p.h" #include "qt_x11_p.h" +#include <private/gtksymbols_p.h> #endif @@ -194,8 +198,68 @@ QPalette QGuiPlatformPlugin::palette() return QPalette(); } -/* backend for QIcon::fromTheme. A null icon means it uses the default backend */ -QIcon QGuiPlatformPlugin::loadIcon(const QString &name) +/* the default icon theme name for QIcon::fromTheme. */ +QString QGuiPlatformPlugin::systemIconThemeName() +{ + QString result; +#ifdef Q_WS_X11 + if (X11->desktopEnvironment == DE_GNOME) { + result = QString::fromLatin1("gnome"); +#ifndef QT_NO_STYLE_GTK + result = QGtk::getGConfString(QLatin1String("/desktop/gnome/interface/icon_theme"), result); +#endif + } else if (X11->desktopEnvironment == DE_KDE) { + result = X11->desktopVersion >= 4 ? QString::fromLatin1("oxygen") : QString::fromLatin1("crystalsvg"); + QSettings settings(QKde::kdeHome() + QLatin1String("/share/config/kdeglobals"), QSettings::IniFormat); + settings.beginGroup(QLatin1String("Icons")); + result = settings.value(QLatin1String("Theme"), result).toString(); + } +#endif + return result; +} + + +QStringList QGuiPlatformPlugin::iconThemeSearchPaths() +{ + QStringList paths; +#if defined(Q_WS_X11) + QString xdgDirString = QFile::decodeName(getenv("XDG_DATA_DIRS")); + if (xdgDirString.isEmpty()) + xdgDirString = QLatin1String("/usr/local/share/:/usr/share/"); + + QStringList xdgDirs = xdgDirString.split(QLatin1Char(':')); + + for (int i = 0 ; i < xdgDirs.size() ; ++i) { + QDir dir(xdgDirs[i]); + if (dir.exists()) + paths.append(dir.path() + QLatin1String("/icons")); + } + if (X11->desktopEnvironment == DE_KDE) { + paths << QLatin1Char(':') + QKde::kdeHome() + QLatin1String("/share/icons"); + QStringList kdeDirs = QFile::decodeName(getenv("KDEDIRS")).split(QLatin1Char(':')); + for (int i = 0 ; i< kdeDirs.count() ; ++i) { + QDir dir(QLatin1Char(':') + kdeDirs.at(i) + QLatin1String("/share/icons")); + if (dir.exists()) + paths.append(dir.path()); + } + } + + // Add home directory first in search path + QDir homeDir(QDir::homePath() + QLatin1String("/.icons")); + if (homeDir.exists()) + paths.prepend(homeDir.path()); +#endif + +#if defined(Q_WS_WIN) + paths.append(qApp->applicationDirPath() + QLatin1String("/icons")); +#elif defined(Q_WS_MAC) + paths.append(qApp->applicationDirPath() + QLatin1String("/../Resources/icons")); +#endif + return paths; +} + +/* backend for QFileIconProvider, null icon means default */ +QIcon QGuiPlatformPlugin::fileSystemIcon(const QFileInfo &) { return QIcon(); } diff --git a/src/gui/kernel/qguiplatformplugin_p.h b/src/gui/kernel/qguiplatformplugin_p.h index 57ea8af2b6..2a70ee78c3 100644 --- a/src/gui/kernel/qguiplatformplugin_p.h +++ b/src/gui/kernel/qguiplatformplugin_p.h @@ -68,6 +68,7 @@ class QPalette; class QIcon; class QFileDialog; class QColorDialog; +class QFileInfo; struct Q_GUI_EXPORT QGuiPlatformPluginInterface : public QFactoryInterface { @@ -89,8 +90,11 @@ class Q_GUI_EXPORT QGuiPlatformPlugin : public QObject, public QGuiPlatformPlugi virtual QString styleName(); virtual QPalette palette(); - virtual QIcon loadIcon(const QString &name); - enum PlatformHint { PH_ToolButtonStyle, PH_ToolBarIconSize }; + virtual QString systemIconThemeName(); + virtual QStringList iconThemeSearchPaths(); + virtual QIcon fileSystemIcon(const QFileInfo &); + + enum PlatformHint { PH_ToolButtonStyle, PH_ToolBarIconSize, PH_ItemView_ActivateItemOnSingleClick }; virtual int platformHint(PlatformHint hint); diff --git a/src/gui/kernel/qkeymapper_win.cpp b/src/gui/kernel/qkeymapper_win.cpp index 10958f3013..be207df67d 100644 --- a/src/gui/kernel/qkeymapper_win.cpp +++ b/src/gui/kernel/qkeymapper_win.cpp @@ -905,8 +905,8 @@ bool QKeyMapperPrivate::translateKeyEvent(QWidget *widget, const MSG &msg, bool if(msg.wParam == VK_PROCESSKEY) return true; - // Ignore invalid virtual keycode (see bug 127424) - if (msg.wParam == 0xFF) + // Ignore invalid virtual keycodes (see bugs 127424, QTBUG-3630) + if (msg.wParam == 0 || msg.wParam == 0xFF) return true; // Translate VK_* (native) -> Key_* (Qt) keys diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 3328cee612..b0d405afb3 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -434,7 +434,7 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de void QWidgetPrivate::show_sys() { Q_Q(QWidget); - + if (q->testAttribute(Qt::WA_OutsideWSRange)) return; @@ -490,7 +490,12 @@ void QWidgetPrivate::hide_sys() QSymbianControl *id = static_cast<QSymbianControl *>(q->internalWinId()); if (id) { - if(id->IsFocused()) // Avoid unnecessary calls to FocusChanged() + //Incorrect optimisation - for popup windows, Qt's focus is moved before + //hide_sys is called, resulting in the popup window keeping its elevated + //position in the CONE control stack. + //This can result in keyboard focus being in an invisible widget in some + //conditions - e.g. QTBUG-4733 + //if(id->IsFocused()) // Avoid unnecessary calls to FocusChanged() id->setFocusSafely(false); id->MakeVisible(false); if (QWidgetBackingStore *bs = maybeBackingStore()) @@ -1253,7 +1258,7 @@ void QWidget::grabMouse() WId id = effectiveWinId(); id->SetPointerCapture(true); QWidgetPrivate::mouseGrabber = this; - + #ifndef QT_NO_CURSOR QApplication::setOverrideCursor(cursor()); #endif diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp index 612258a4bd..58865127f7 100644 --- a/src/gui/styles/qcommonstyle.cpp +++ b/src/gui/styles/qcommonstyle.cpp @@ -5058,7 +5058,7 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget break; case SH_ItemView_ActivateItemOnSingleClick: - ret = false; + ret = qt_guiPlatformPlugin()->platformHint(QGuiPlatformPlugin::PH_ItemView_ActivateItemOnSingleClick); break; case SH_TitleBar_ModifyNotification: diff --git a/src/gui/styles/qplastiquestyle.cpp b/src/gui/styles/qplastiquestyle.cpp index 5052755c0e..ce2109a2c0 100644 --- a/src/gui/styles/qplastiquestyle.cpp +++ b/src/gui/styles/qplastiquestyle.cpp @@ -3309,7 +3309,7 @@ void QPlastiqueStyle::drawControl(ControlElement element, const QStyleOption *op // Draw the text centered QFont font = painter->font(); - font.setPointSize(font.pointSize() - 1); + font.setPointSize(QFontInfo(font).pointSize() - 1); painter->setFont(font); painter->setPen(dockWidget->palette.windowText().color()); painter->drawText(titleRect, diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 6bdb79e725..4fa1d03276 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -706,11 +706,10 @@ void QS60StylePrivate::setThemePalette(QPalette *palette) const palette->setColor(QPalette::AlternateBase, Qt::transparent); palette->setBrush(QPalette::Base, Qt::transparent); // set button and tooltipbase based on pixel colors -// After natitive pixmap support, colorFromFrameGraphics caused reproducable crashes on some setups. -// const QColor buttonColor = colorFromFrameGraphics(SF_ButtonNormal); -// palette->setColor(QPalette::Button, buttonColor); -// const QColor toolTipColor = colorFromFrameGraphics(SF_ToolTip); -// palette->setColor(QPalette::ToolTipBase, toolTipColor); + const QColor buttonColor = colorFromFrameGraphics(SF_ButtonNormal); + palette->setColor(QPalette::Button, buttonColor); + const QColor toolTipColor = colorFromFrameGraphics(SF_ToolTip); + palette->setColor(QPalette::ToolTipBase, toolTipColor); palette->setColor(QPalette::Light, palette->color(QPalette::Button).lighter()); palette->setColor(QPalette::Dark, palette->color(QPalette::Button).darker()); palette->setColor(QPalette::Midlight, palette->color(QPalette::Button).lighter(125)); @@ -1865,7 +1864,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, painter->save(); painter->setRenderHint(QPainter::Antialiasing); painter->setOpacity(opacity); - painter->setPen(QPen(option->palette.color(QPalette::Highlight), penWidth)); + painter->setPen(QPen(option->palette.color(QPalette::Text), penWidth)); painter->drawRoundedRect(adjustedRect, roundRectRadius, roundRectRadius); painter->restore(); } diff --git a/src/gui/util/qdesktopservices_win.cpp b/src/gui/util/qdesktopservices_win.cpp index bf29870015..c0bd5e7c1f 100644 --- a/src/gui/util/qdesktopservices_win.cpp +++ b/src/gui/util/qdesktopservices_win.cpp @@ -59,6 +59,11 @@ # endif #endif +#if defined(Q_CC_MINGW) && !defined(CSIDL_MYMUSIC) +#define CSIDL_MYMUSIC 13 +#define CSIDL_MYVIDEO 14 +#endif + #ifndef QT_NO_DESKTOPSERVICES QT_BEGIN_NAMESPACE @@ -186,7 +191,11 @@ QString QDesktopServices::storageLocation(StandardLocation type) switch (type) { case DataLocation: +#if defined Q_WS_WINCE + if (SHGetSpecialFolderPath(0, path, CSIDL_APPDATA, FALSE)) +#else if (SHGetSpecialFolderPath(0, path, CSIDL_LOCAL_APPDATA, FALSE)) +#endif result = QString::fromWCharArray(path); if (!QCoreApplication::organizationName().isEmpty()) result = result + QLatin1String("\\") + QCoreApplication::organizationName(); diff --git a/src/gui/widgets/qabstractslider.cpp b/src/gui/widgets/qabstractslider.cpp index 19a8b63d8b..588a48ee8a 100644 --- a/src/gui/widgets/qabstractslider.cpp +++ b/src/gui/widgets/qabstractslider.cpp @@ -715,8 +715,7 @@ void QAbstractSlider::wheelEvent(QWheelEvent * e) #else stepsToScroll = int(d->offset_accumulated) * QApplication::wheelScrollLines() * d->singleStep; #endif - if (qAbs(stepsToScroll) > d->pageStep) - stepsToScroll = currentOffset > 0 ? d->pageStep : -d->pageStep; + stepsToScroll = qBound(-d->pageStep, stepsToScroll, d->pageStep); } if (d->invertedControls) diff --git a/src/gui/widgets/qdialogbuttonbox.cpp b/src/gui/widgets/qdialogbuttonbox.cpp index 6cc720d2b6..280ca6340b 100644 --- a/src/gui/widgets/qdialogbuttonbox.cpp +++ b/src/gui/widgets/qdialogbuttonbox.cpp @@ -468,18 +468,6 @@ void QDialogButtonBoxPrivate::layoutButtons() if (center) buttonLayout->addStretch(); - -#ifdef QT_SOFTKEYS_ENABLED - QWidget *dialog = 0; - QWidget *p = q; - while (p && !p->isWindow()) { - p = p->parentWidget(); - if (dialog = qobject_cast<QDialog *>(p)) - break; - } - if (dialog) - q->setFixedSize(0, 0); -#endif } QPushButton *QDialogButtonBoxPrivate::createButton(QDialogButtonBox::StandardButton sbutton, @@ -1196,10 +1184,12 @@ bool QDialogButtonBox::event(QEvent *event) if (!hasDefault && firstAcceptButton) firstAcceptButton->setDefault(true); #ifdef QT_SOFTKEYS_ENABLED - if (dialog) + if (dialog) { + setFixedSize(0,0); dialog->addActions(d->softKeyActions.values()); - else + } else { addActions(d->softKeyActions.values()); + } #endif }else if (event->type() == QEvent::LanguageChange) { d->retranslateStrings(); diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index c656ef8d6f..d757f98818 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -74,12 +74,13 @@ struct SymbianMenuItem QAction* action; }; +Q_GLOBAL_STATIC_WITH_ARGS(QAction, contextAction, (0)) + static QList<SymbianMenuItem*> symbianMenus; static QList<QMenuBar*> nativeMenuBars; static uint qt_symbian_menu_static_cmd_id = QT_SYMBIAN_FIRST_MENU_ITEM; static QPointer<QWidget> widgetWithContextMenu; static QList<QAction*> contextMenuActionList; -static QAction contextAction(0); static int contexMenuCommand=0; bool menuExists() @@ -400,8 +401,8 @@ void QMenuBarPrivate::QSymbianMenuBarPrivate::rebuild() contextMenuActionList.clear(); if (widgetWithContextMenu) { contexMenuCommand = qt_symbian_menu_static_cmd_id; // Increased inside insertNativeMenuItems - contextAction.setText(QMenuBar::tr("Actions")); - contextMenuActionList.append(&contextAction); + contextAction()->setText(QMenuBar::tr("Actions")); + contextMenuActionList.append(contextAction()); insertNativeMenuItems(contextMenuActionList); } } diff --git a/src/gui/widgets/qtoolbarextension_p.h b/src/gui/widgets/qtoolbarextension_p.h index 5d622ec6d9..5fe74a9b57 100644 --- a/src/gui/widgets/qtoolbarextension_p.h +++ b/src/gui/widgets/qtoolbarextension_p.h @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE #ifndef QT_NO_TOOLBUTTON -class QToolBarExtension : public QToolButton +class Q_AUTOTEST_EXPORT QToolBarExtension : public QToolButton { Q_OBJECT Qt::Orientation orientation; diff --git a/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp b/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp index 866d1a2968..1fe3999f5c 100644 --- a/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp +++ b/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp @@ -67,7 +67,30 @@ void QGL2PEXVertexArray::addRect(const QRectF &rect) << rect.bottomRight() << rect.bottomLeft() << rect.topLeft(); } -void QGL2PEXVertexArray::addPath(const QVectorPath &path, GLfloat curveInverseScale) +void QGL2PEXVertexArray::addClosingLine(int index) +{ + if (QPointF(vertexArray.at(index)) != QPointF(vertexArray.last())) + vertexArray.add(vertexArray.at(index)); +} + +void QGL2PEXVertexArray::addCentroid(const QVectorPath &path, int subPathIndex) +{ + const QPointF *const points = reinterpret_cast<const QPointF *>(path.points()); + const QPainterPath::ElementType *const elements = path.elements(); + + QPointF sum = points[subPathIndex]; + int count = 1; + + for (int i = subPathIndex + 1; i < path.elementCount() && (!elements || elements[i] != QPainterPath::MoveToElement); ++i) { + sum += points[i]; + ++count; + } + + const QPointF centroid = sum / qreal(count); + vertexArray.add(centroid); +} + +void QGL2PEXVertexArray::addPath(const QVectorPath &path, GLfloat curveInverseScale, bool outline) { const QPointF* const points = reinterpret_cast<const QPointF*>(path.points()); const QPainterPath::ElementType* const elements = path.elements(); @@ -78,6 +101,10 @@ void QGL2PEXVertexArray::addPath(const QVectorPath &path, GLfloat curveInverseSc boundingRectDirty = false; } + if (!outline) + addCentroid(path, 0); + + int lastMoveTo = vertexArray.size(); vertexArray.add(points[0]); // The first element is always a moveTo do { @@ -96,8 +123,14 @@ void QGL2PEXVertexArray::addPath(const QVectorPath &path, GLfloat curveInverseSc const QPainterPath::ElementType elementType = elements[i]; switch (elementType) { case QPainterPath::MoveToElement: + if (!outline) + addClosingLine(lastMoveTo); // qDebug("element[%d] is a MoveToElement", i); vertexArrayStops.append(vertexArray.size()); + if (!outline) { + addCentroid(path, i); + lastMoveTo = vertexArray.size(); + } lineToArray(points[i].x(), points[i].y()); // Add the moveTo as a new vertex break; case QPainterPath::LineToElement: @@ -115,6 +148,8 @@ void QGL2PEXVertexArray::addPath(const QVectorPath &path, GLfloat curveInverseSc } } while (0); + if (!outline) + addClosingLine(lastMoveTo); vertexArrayStops.append(vertexArray.size()); } diff --git a/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h b/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h index 08ce23439a..719904f6c3 100644 --- a/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h +++ b/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h @@ -104,7 +104,7 @@ public: boundingRectDirty(true) {} void addRect(const QRectF &rect); - void addPath(const QVectorPath &path, GLfloat curveInverseScale); + void addPath(const QVectorPath &path, GLfloat curveInverseScale, bool outline = true); void clear(); QGLPoint* data() {return vertexArray.data();} @@ -124,6 +124,9 @@ private: bool boundingRectDirty; inline void curveToArray(const QGLPoint &cp1, const QGLPoint &cp2, const QGLPoint &ep, GLfloat inverseScale); + + void addClosingLine(int index); + void addCentroid(const QVectorPath &path, int subPathIndex); }; QT_END_NAMESPACE diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 587512439e..ab02c69473 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -391,7 +391,6 @@ void QGL2PaintEngineExPrivate::setBrush(const QBrush* brush) } -// Unless this gets used elsewhere, it's probably best to merge it into fillStencilWithVertexArray void QGL2PaintEngineExPrivate::useSimpleShader() { shaderManager->simpleProgram()->enable(); @@ -881,26 +880,36 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) || path.shape() == QVectorPath::ConvexPolygonHint) { vertexCoordinateArray.clear(); - vertexCoordinateArray.addPath(path, inverseScale); + vertexCoordinateArray.addPath(path, inverseScale, false); prepareForDraw(currentBrush->isOpaque()); drawVertexArrays(vertexCoordinateArray, GL_TRIANGLE_FAN); } else { // The path is too complicated & needs the stencil technique vertexCoordinateArray.clear(); - vertexCoordinateArray.addPath(path, inverseScale); + vertexCoordinateArray.addPath(path, inverseScale, false); fillStencilWithVertexArray(vertexCoordinateArray, path.hasWindingFill()); - // Stencil the brush onto the dest buffer - glStencilFunc(GL_EQUAL, GL_STENCIL_HIGH_BIT, GL_STENCIL_HIGH_BIT); // Pass if stencil buff value != 0 - glStencilOp(GL_KEEP, GL_ZERO, GL_ZERO); - glStencilMask(GL_STENCIL_HIGH_BIT); + glStencilMask(0xff); + glStencilOp(GL_KEEP, GL_REPLACE, GL_REPLACE); + + if (q->state()->clipTestEnabled) { + // Pass when high bit is set, replace stencil value with current clip + glStencilFunc(GL_NOTEQUAL, q->state()->currentClip, GL_STENCIL_HIGH_BIT); + } else if (path.hasWindingFill()) { + // Pass when any bit is set, replace stencil value with 0 + glStencilFunc(GL_NOTEQUAL, 0, 0xff); + } else { + // Pass when high bit is set, replace stencil value with 0 + glStencilFunc(GL_NOTEQUAL, 0, GL_STENCIL_HIGH_BIT); + } prepareForDraw(currentBrush->isOpaque()); if (inRenderText) prepareDepthRangeForRenderText(); + // Stencil the brush onto the dest buffer composite(vertexCoordinateArray.boundingRect()); if (inRenderText) @@ -916,7 +925,7 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) void QGL2PaintEngineExPrivate::fillStencilWithVertexArray(QGL2PEXVertexArray& vertexArray, bool useWindingFill) { // qDebug("QGL2PaintEngineExPrivate::fillStencilWithVertexArray()"); - glStencilMask(0xffff); // Enable stencil writes + glStencilMask(0xff); // Enable stencil writes if (dirtyStencilRegion.intersects(currentScissorBounds)) { QVector<QRect> clearRegion = dirtyStencilRegion.intersected(currentScissorBounds).rects(); @@ -948,39 +957,30 @@ void QGL2PaintEngineExPrivate::fillStencilWithVertexArray(QGL2PEXVertexArray& ve if (useWindingFill) { if (q->state()->clipTestEnabled) { + // Flatten clip values higher than current clip, and set high bit to match current clip glStencilFunc(GL_LEQUAL, GL_STENCIL_HIGH_BIT | q->state()->currentClip, ~GL_STENCIL_HIGH_BIT); glStencilOp(GL_KEEP, GL_REPLACE, GL_REPLACE); composite(vertexArray.boundingRect()); glStencilFunc(GL_EQUAL, GL_STENCIL_HIGH_BIT, GL_STENCIL_HIGH_BIT); - } else { - glStencilFunc(GL_ALWAYS, 0, 0xffff); + } else if (!stencilClean) { + // Clear stencil buffer within bounding rect + glStencilFunc(GL_ALWAYS, 0, 0xff); glStencilOp(GL_ZERO, GL_ZERO, GL_ZERO); composite(vertexArray.boundingRect()); } // Inc. for front-facing triangle glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_INCR_WRAP, GL_INCR_WRAP); - //Dec. for back-facing "holes" + // Dec. for back-facing "holes" glStencilOpSeparate(GL_BACK, GL_KEEP, GL_DECR_WRAP, GL_DECR_WRAP); glStencilMask(~GL_STENCIL_HIGH_BIT); drawVertexArrays(vertexArray, GL_TRIANGLE_FAN); if (q->state()->clipTestEnabled) { - // clear high bit of stencil outside of path - glStencilFunc(GL_EQUAL, GL_STENCIL_HIGH_BIT | q->state()->currentClip, ~GL_STENCIL_HIGH_BIT); - glStencilOp(GL_KEEP, GL_INVERT, GL_INVERT); - glStencilMask(GL_STENCIL_HIGH_BIT); - composite(vertexArray.boundingRect()); - // reset lower bits of stencil inside path to current clip - glStencilFunc(GL_EQUAL, GL_STENCIL_HIGH_BIT | q->state()->currentClip, GL_STENCIL_HIGH_BIT); + // Clear high bit of stencil outside of path + glStencilFunc(GL_EQUAL, q->state()->currentClip, ~GL_STENCIL_HIGH_BIT); glStencilOp(GL_KEEP, GL_REPLACE, GL_REPLACE); - glStencilMask(~GL_STENCIL_HIGH_BIT); - composite(vertexArray.boundingRect()); - } else { - // set high bit of stencil inside path - glStencilFunc(GL_NOTEQUAL, 0, 0xffff); - glStencilOp(GL_KEEP, GL_INVERT, GL_INVERT); glStencilMask(GL_STENCIL_HIGH_BIT); composite(vertexArray.boundingRect()); } @@ -1020,7 +1020,7 @@ void QGL2PaintEngineExPrivate::resetClipIfNeeded() QGLRect rect(bounds.left(), bounds.top(), bounds.right(), bounds.bottom()); // Set high bit on clip region - glStencilFunc(GL_LEQUAL, q->state()->currentClip, 0xffff); + glStencilFunc(GL_LEQUAL, q->state()->currentClip, 0xff); glStencilOp(GL_KEEP, GL_INVERT, GL_INVERT); glStencilMask(GL_STENCIL_HIGH_BIT); composite(rect); @@ -1028,7 +1028,7 @@ void QGL2PaintEngineExPrivate::resetClipIfNeeded() // Reset clipping to 1 and everything else to zero glStencilFunc(GL_NOTEQUAL, 0x01, GL_STENCIL_HIGH_BIT); glStencilOp(GL_ZERO, GL_REPLACE, GL_REPLACE); - glStencilMask(0xFFFF); + glStencilMask(0xff); composite(rect); q->state()->currentClip = 1; @@ -1636,6 +1636,7 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev) d->use_system_clip = !systemClip().isEmpty(); d->dirtyStencilRegion = QRect(0, 0, d->width, d->height); + d->stencilClean = true; // Calling begin paint should make the correct context current. So, any // code which calls into GL or otherwise needs a current context *must* @@ -1731,7 +1732,7 @@ void QGL2PaintEngineExPrivate::updateClipScissorTest() glStencilFunc(GL_LEQUAL, q->state()->currentClip, ~GL_STENCIL_HIGH_BIT); } else { glDisable(GL_STENCIL_TEST); - glStencilFunc(GL_ALWAYS, 0, 0xffff); + glStencilFunc(GL_ALWAYS, 0, 0xff); } #ifdef QT_GL_NO_SCISSOR_TEST @@ -1787,7 +1788,7 @@ void QGL2PaintEngineExPrivate::clearClip(uint value) { dirtyStencilRegion -= currentScissorBounds; - glStencilMask(0xffff); + glStencilMask(0xff); glClearStencil(value); glClear(GL_STENCIL_BUFFER_BIT); glStencilMask(0x0); @@ -1802,6 +1803,8 @@ void QGL2PaintEngineExPrivate::writeClip(const QVectorPath &path, uint value) if (matrixDirty) updateMatrix(); + stencilClean = false; + const bool singlePass = !path.hasWindingFill() && (((q->state()->currentClip == maxClip - 1) && q->state()->clipTestEnabled) || q->state()->needsClipBufferClear); @@ -1819,10 +1822,10 @@ void QGL2PaintEngineExPrivate::writeClip(const QVectorPath &path, uint value) if (q->state()->clipTestEnabled) glStencilFunc(GL_LEQUAL, q->state()->currentClip, ~GL_STENCIL_HIGH_BIT); else - glStencilFunc(GL_ALWAYS, 0, 0xffff); + glStencilFunc(GL_ALWAYS, 0, 0xff); vertexCoordinateArray.clear(); - vertexCoordinateArray.addPath(path, inverseScale); + vertexCoordinateArray.addPath(path, inverseScale, false); if (!singlePass) fillStencilWithVertexArray(vertexCoordinateArray, path.hasWindingFill()); @@ -1841,9 +1844,17 @@ void QGL2PaintEngineExPrivate::writeClip(const QVectorPath &path, uint value) drawVertexArrays(vertexCoordinateArray, GL_TRIANGLE_FAN); } else { - glStencilFunc(GL_NOTEQUAL, value, GL_STENCIL_HIGH_BIT); glStencilOp(GL_KEEP, GL_REPLACE, GL_REPLACE); - glStencilMask(0xffff); + glStencilMask(0xff); + + if (!q->state()->clipTestEnabled && path.hasWindingFill()) { + // Pass when any clip bit is set, set high bit + glStencilFunc(GL_NOTEQUAL, GL_STENCIL_HIGH_BIT, ~GL_STENCIL_HIGH_BIT); + composite(vertexCoordinateArray.boundingRect()); + } + + // Pass when high bit is set, replace stencil value with new clip value + glStencilFunc(GL_NOTEQUAL, value, GL_STENCIL_HIGH_BIT); composite(vertexCoordinateArray.boundingRect()); } diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h index 28c972ed32..46be398fac 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -223,6 +223,7 @@ public: bool shaderMatrixUniformDirty; bool opacityUniformDirty; + bool stencilClean; // Has the stencil not been used for clipping so far? QRegion dirtyStencilRegion; QRect currentScissorBounds; uint maxClip; diff --git a/src/opengl/qgl_egl.cpp b/src/opengl/qgl_egl.cpp index fa876c7972..fbf034988a 100644 --- a/src/opengl/qgl_egl.cpp +++ b/src/opengl/qgl_egl.cpp @@ -75,7 +75,7 @@ void qt_egl_set_format(QEglProperties& props, int deviceType, const QGLFormat& f props.setValue(EGL_STENCIL_SIZE, f.stencilBufferSize() == -1 ? 1 : f.stencilBufferSize()); if (f.sampleBuffers()) { props.setValue(EGL_SAMPLE_BUFFERS, 1); - props.setValue(EGL_SAMPLES, f.samples()); + props.setValue(EGL_SAMPLES, f.samples() == -1 ? 1 : f.samples()); } else { props.setValue(EGL_SAMPLE_BUFFERS, 0); } diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index 3e54b353fa..558520823d 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -988,7 +988,7 @@ QImage QGLFramebufferObject::toImage() const bool wasBound = isBound(); if (!wasBound) const_cast<QGLFramebufferObject *>(this)->bind(); - QImage image = qt_gl_read_framebuffer(d->size, format().textureTarget() != GL_RGB, true); + QImage image = qt_gl_read_framebuffer(d->size, format().internalTextureFormat() != GL_RGB, true); if (!wasBound) const_cast<QGLFramebufferObject *>(this)->release(); diff --git a/src/opengl/qglpixelbuffer_egl.cpp b/src/opengl/qglpixelbuffer_egl.cpp index 4cba1bb07b..744fbd483d 100644 --- a/src/opengl/qglpixelbuffer_egl.cpp +++ b/src/opengl/qglpixelbuffer_egl.cpp @@ -151,7 +151,7 @@ bool QGLPixelBufferPrivate::init(const QSize &size, const QGLFormat &f, QGLWidge bool QGLPixelBufferPrivate::cleanup() { - eglDestroySurface(QEglContext::defaultDisplay(0), pbuf); + // No need to destroy "pbuf" here - it is done in QGLContext::reset(). return true; } @@ -202,13 +202,20 @@ GLuint QGLPixelBuffer::generateDynamicTexture() const bool QGLPixelBuffer::hasOpenGLPbuffers() { // See if we have at least 1 configuration that matches the default format. - QEglContext ctx; - if (!ctx.openDisplay(0)) + EGLDisplay dpy = QEglContext::defaultDisplay(0); + if (dpy == EGL_NO_DISPLAY) return false; QEglProperties configProps; qt_egl_set_format(configProps, QInternal::Pbuffer, QGLFormat::defaultFormat()); configProps.setRenderableType(QEgl::OpenGL); - return ctx.chooseConfig(configProps); + do { + EGLConfig cfg = 0; + EGLint matching = 0; + if (eglChooseConfig(dpy, configProps.properties(), + &cfg, 1, &matching) && matching > 0) + return true; + } while (configProps.reduceConfiguration()); + return false; } QT_END_NAMESPACE diff --git a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp index afee77eae2..09c0acee32 100644 --- a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp +++ b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp @@ -149,6 +149,18 @@ void PvrEglWindowSurface::setPermanentState(const QByteArray &state) Q_UNUSED(state); } +void PvrEglWindowSurface::flush + (QWidget *widget, const QRegion ®ion, const QPoint &offset) +{ + // The GL paint engine is responsible for the swapBuffers() call. + // If we were to call the base class's implementation of flush() + // then it would fetch the image() and manually blit it to the + // screeen instead of using the fast PVR2D blit. + Q_UNUSED(widget); + Q_UNUSED(region); + Q_UNUSED(offset); +} + QImage PvrEglWindowSurface::image() const { if (drawable) { @@ -165,14 +177,7 @@ QImage PvrEglWindowSurface::image() const QPaintDevice *PvrEglWindowSurface::paintDevice() { - QGLWidget *glWidget = qobject_cast<QGLWidget *>(window()); - if (glWidget) - return glWidget; - - // Should be a QGLWidget, but if not return a dummy paint device. - if (!pdevice) - pdevice = new QImage(50, 50, screen->pixelFormat()); - return pdevice; + return widget; } void PvrEglWindowSurface::setDirectRegion(const QRegion &r, int id) diff --git a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h index 80fc8f845e..0da36536ae 100644 --- a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h +++ b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h @@ -65,6 +65,8 @@ public: QByteArray permanentState() const; void setPermanentState(const QByteArray &state); + void flush(QWidget *widget, const QRegion ®ion, const QPoint &offset); + QImage image() const; QPaintDevice *paintDevice(); diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def index 581d3bc2e0..09ea6ab62a 100644 --- a/src/s60installs/eabi/QtGuiu.def +++ b/src/s60installs/eabi/QtGuiu.def @@ -10640,7 +10640,7 @@ EXPORTS _ZTI17QTextFramePrivate @ 10639 NONAME ABSENT _ZTI17QTextImageHandler @ 10640 NONAME ABSENT _ZTI17QTextTablePrivate @ 10641 NONAME ABSENT - _ZTI17QToolBarExtension @ 10642 NONAME ABSENT + _ZTI17QToolBarExtension @ 10642 NONAME _ZTI17QToolBarSeparator @ 10643 NONAME ABSENT _ZTI17QUpdateLaterEvent @ 10644 NONAME ABSENT _ZTI17QWhatsThisPrivate @ 10645 NONAME ABSENT @@ -11051,7 +11051,7 @@ EXPORTS _ZTV17QTextFramePrivate @ 11050 NONAME ABSENT _ZTV17QTextImageHandler @ 11051 NONAME ABSENT _ZTV17QTextTablePrivate @ 11052 NONAME ABSENT - _ZTV17QToolBarExtension @ 11053 NONAME ABSENT + _ZTV17QToolBarExtension @ 11053 NONAME _ZTV17QToolBarSeparator @ 11054 NONAME ABSENT _ZTV17QUpdateLaterEvent @ 11055 NONAME ABSENT _ZTV17QWhatsThisPrivate @ 11056 NONAME ABSENT @@ -13102,4 +13102,38 @@ EXPORTS _ZTI28QGraphicsAnchorLayoutPrivate @ 13101 NONAME _ZTV20QGraphicsBloomEffect @ 13102 NONAME _ZTV28QGraphicsAnchorLayoutPrivate @ 13103 NONAME + _ZN17QToolBarExtension10paintEventEP11QPaintEvent @ 13104 NONAME + _ZN17QToolBarExtension11qt_metacallEN11QMetaObject4CallEiPPv @ 13105 NONAME + _ZN17QToolBarExtension11qt_metacastEPKc @ 13106 NONAME + _ZN17QToolBarExtension14setOrientationEN2Qt11OrientationE @ 13107 NONAME + _ZN17QToolBarExtension16staticMetaObjectE @ 13108 NONAME DATA 16 + _ZN17QToolBarExtension19getStaticMetaObjectEv @ 13109 NONAME + _ZN17QToolBarExtensionC1EP7QWidget @ 13110 NONAME + _ZN17QToolBarExtensionC2EP7QWidget @ 13111 NONAME + _ZN18QGuiPlatformPlugin11qt_metacallEN11QMetaObject4CallEiPPv @ 13112 NONAME + _ZN18QGuiPlatformPlugin11qt_metacastEPKc @ 13113 NONAME + _ZN18QGuiPlatformPlugin12platformHintENS_12PlatformHintE @ 13114 NONAME + _ZN18QGuiPlatformPlugin14fileSystemIconERK9QFileInfo @ 13115 NONAME + _ZN18QGuiPlatformPlugin16staticMetaObjectE @ 13116 NONAME DATA 16 + _ZN18QGuiPlatformPlugin19getStaticMetaObjectEv @ 13117 NONAME + _ZN18QGuiPlatformPlugin19systemIconThemeNameEv @ 13118 NONAME + _ZN18QGuiPlatformPlugin20iconThemeSearchPathsEv @ 13119 NONAME + _ZN18QGuiPlatformPlugin7paletteEv @ 13120 NONAME + _ZN18QGuiPlatformPlugin9styleNameEv @ 13121 NONAME + _ZN18QGuiPlatformPluginC1EP7QObject @ 13122 NONAME + _ZN18QGuiPlatformPluginC2EP7QObject @ 13123 NONAME + _ZN18QGuiPlatformPluginD0Ev @ 13124 NONAME + _ZN18QGuiPlatformPluginD1Ev @ 13125 NONAME + _ZN18QGuiPlatformPluginD2Ev @ 13126 NONAME + _ZN28QGraphicsAnchorLayoutPrivate14solveExpandingE5QListIP18QSimplexConstraintE @ 13127 NONAME + _ZN28QGraphicsAnchorLayoutPrivate21identifyNonFloatItemsE4QSetIP10AnchorDataENS_11OrientationE @ 13128 NONAME + _ZN28QGraphicsAnchorLayoutPrivate28identifyNonFloatItems_helperEPK10AnchorDataNS_11OrientationE @ 13129 NONAME + _ZNK17QToolBarExtension10metaObjectEv @ 13130 NONAME + _ZNK17QToolBarExtension8sizeHintEv @ 13131 NONAME + _ZNK18QGuiPlatformPlugin10metaObjectEv @ 13132 NONAME + _ZTI18QGuiPlatformPlugin @ 13133 NONAME + _ZTI27QGuiPlatformPluginInterface @ 13134 NONAME + _ZTV18QGuiPlatformPlugin @ 13135 NONAME + _ZThn8_N18QGuiPlatformPluginD0Ev @ 13136 NONAME + _ZThn8_N18QGuiPlatformPluginD1Ev @ 13137 NONAME diff --git a/src/s60installs/eabi/QtScriptu.def b/src/s60installs/eabi/QtScriptu.def index cca0a2aef8..1205c04f19 100644 --- a/src/s60installs/eabi/QtScriptu.def +++ b/src/s60installs/eabi/QtScriptu.def @@ -600,4 +600,5 @@ EXPORTS _ZN25QScriptEngineAgentPrivate18didReachBreakpointERKN5QTJSC17DebuggerCallFrameEiii @ 599 NONAME _ZN25QScriptEngineAgentPrivate6attachEv @ 600 NONAME _ZN25QScriptEngineAgentPrivate6detachEv @ 601 NONAME + _Z5qHashRK13QScriptString @ 602 NONAME diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h index 5f31054983..f1fc13542f 100644 --- a/src/script/api/qscriptengine_p.h +++ b/src/script/api/qscriptengine_p.h @@ -468,6 +468,22 @@ inline QScriptValue QScriptValuePrivate::property(const QString &name, int resol return property(JSC::Identifier(exec, name), resolveMode); } +inline void* QScriptValuePrivate::operator new(size_t size, QScriptEnginePrivate *engine) +{ + if (engine) + return engine->allocateScriptValuePrivate(size); + return qMalloc(size); +} + +inline void QScriptValuePrivate::operator delete(void *ptr) +{ + QScriptValuePrivate *d = reinterpret_cast<QScriptValuePrivate*>(ptr); + if (d->engine) + d->engine->freeScriptValuePrivate(d); + else + qFree(d); +} + inline void QScriptEnginePrivate::registerScriptString(QScriptStringPrivate *value) { Q_ASSERT(value->type == QScriptStringPrivate::HeapAllocated); diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp index 92c987cb72..b8340a7e51 100644 --- a/src/script/api/qscriptvalue.cpp +++ b/src/script/api/qscriptvalue.cpp @@ -280,7 +280,7 @@ QScriptValue QScriptValuePrivate::property(const JSC::Identifier &id, int resolv { Q_ASSERT(isObject()); JSC::ExecState *exec = engine->currentFrame; - JSC::JSObject *object = jscValue.getObject(); + JSC::JSObject *object = JSC::asObject(jscValue); JSC::PropertySlot slot(const_cast<JSC::JSObject*>(object)); JSC::JSValue result; if (const_cast<JSC::JSObject*>(object)->getOwnPropertySlot(exec, id, slot)) { @@ -303,7 +303,7 @@ QScriptValue QScriptValuePrivate::property(quint32 index, int resolveMode) const { Q_ASSERT(isObject()); JSC::ExecState *exec = engine->currentFrame; - JSC::JSObject *object = jscValue.getObject(); + JSC::JSObject *object = JSC::asObject(jscValue); JSC::PropertySlot slot(const_cast<JSC::JSObject*>(object)); JSC::JSValue result; if (const_cast<JSC::JSObject*>(object)->getOwnPropertySlot(exec, index, slot)) { @@ -466,22 +466,6 @@ void QScriptValuePrivate::detachFromEngine() engine = 0; } -void* QScriptValuePrivate::operator new(size_t size, QScriptEnginePrivate *engine) -{ - if (engine) - return engine->allocateScriptValuePrivate(size); - return qMalloc(size); -} - -void QScriptValuePrivate::operator delete(void *ptr) -{ - QScriptValuePrivate *d = reinterpret_cast<QScriptValuePrivate*>(ptr); - if (d->engine) - d->engine->freeScriptValuePrivate(d); - else - qFree(d); -} - /*! \internal */ diff --git a/src/script/api/qscriptvalue_p.h b/src/script/api/qscriptvalue_p.h index 6cbda971d2..77b5084966 100644 --- a/src/script/api/qscriptvalue_p.h +++ b/src/script/api/qscriptvalue_p.h @@ -66,10 +66,10 @@ class QScriptEnginePrivate; class QScriptValue; class QScriptValuePrivate { - Q_DISABLE_COPY(QScriptValuePrivate); + Q_DISABLE_COPY(QScriptValuePrivate) public: - void* operator new(size_t, QScriptEnginePrivate*); - void operator delete(void*); + inline void* operator new(size_t, QScriptEnginePrivate*); + inline void operator delete(void*); enum Type { JavaScriptCore, diff --git a/tests/auto/qabstractslider/tst_qabstractslider.cpp b/tests/auto/qabstractslider/tst_qabstractslider.cpp index 9f7a78e987..5c70bded8b 100644 --- a/tests/auto/qabstractslider/tst_qabstractslider.cpp +++ b/tests/auto/qabstractslider/tst_qabstractslider.cpp @@ -714,7 +714,11 @@ void tst_QAbstractSlider::wheelEvent_data() << 1 // delta << int(Qt::Vertical) // orientation of slider << int(Qt::Vertical) // orientation of wheel +#ifdef Q_WS_MAC + << 1 // expected position after +#else << 20 // expected position after +#endif << QPoint(0,0); QTest::newRow("Normal data page") << 0 // initial position @@ -773,7 +777,11 @@ void tst_QAbstractSlider::wheelEvent_data() << 1 // delta << int(Qt::Horizontal) // orientation of slider << int(Qt::Horizontal) // orientation of wheel +#ifdef Q_WS_MAC + << 49 // expected position after +#else << 30 // expected position after +#endif << QPoint(1,1); QTest::newRow("Past end") << 50 // initial position @@ -784,7 +792,11 @@ void tst_QAbstractSlider::wheelEvent_data() << false // inverted controls << 1 // wheel scroll lines << false // with modifiers +#ifdef Q_WS_MAC + << 60 // delta +#else << 2 // delta +#endif << int(Qt::Horizontal) // orientation of slider << int(Qt::Horizontal) // orientation of wheel << 100 // expected position after @@ -798,7 +810,11 @@ void tst_QAbstractSlider::wheelEvent_data() << false // inverted controls << 1 // wheel scroll lines << false // with modifiers - << -2 // delta +#ifdef Q_WS_MAC + << -60 // delta +#else + << -2 // delta +#endif << int(Qt::Horizontal) // orientation of slider << int(Qt::Horizontal) // orientation of wheel << 0 // expected position after diff --git a/tests/auto/qfiledialog/tst_qfiledialog.cpp b/tests/auto/qfiledialog/tst_qfiledialog.cpp index f6b082fbe6..dc2ca61e0f 100644 --- a/tests/auto/qfiledialog/tst_qfiledialog.cpp +++ b/tests/auto/qfiledialog/tst_qfiledialog.cpp @@ -944,7 +944,7 @@ void tst_QFiledialog::selectFiles() QVERIFY(listView); for (int i = 0; i < list.count(); ++i) { fd.selectFile(fd.directory().path() + "/" + list.at(i)); -#if defined(Q_WS_MAC) || defined(Q_WS_WIN) || defined(Q_OS_SYMBIAN) +#if defined(QT_MAC_USE_COCOA) || defined(Q_WS_WIN) || defined(Q_OS_SYMBIAN) QEXPECT_FAIL("", "This test does not work on Mac, Windows, or Symbian", Abort); #endif QTRY_VERIFY(!listView->selectionModel()->selectedRows().isEmpty()); diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp index 845933184b..f5e9acb50e 100644 --- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp @@ -2819,17 +2819,15 @@ void tst_QGraphicsScene::update2() CustomView view; view.setScene(&scene); view.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif - QTest::qWait(250); + QTest::qWaitForWindowShown(&view); + QTRY_VERIFY(view.repaints >= 1); view.repaints = 0; // Make sure QGraphicsScene::update only requires one event-loop iteration // before the view is updated. scene.update(); qApp->processEvents(); - QCOMPARE(view.repaints, 1); + QTRY_COMPARE(view.repaints, 1); view.repaints = 0; // The same for partial scene updates. diff --git a/tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp b/tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp index e8979eaa4e..b407fef2a2 100644 --- a/tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp +++ b/tests/auto/qgraphicstransform/tst_qgraphicstransform.cpp @@ -159,7 +159,11 @@ void tst_QGraphicsTransform::scale() // definitions correct for the difference. static inline bool fuzzyCompare(qreal p1, qreal p2) { - return (qAbs(p1 - p2) <= 0.00001f * qMin(qAbs(p1), qAbs(p2))); + // increase delta on small machines using float instead of double + if (sizeof(qreal) == sizeof(float)) + return (qAbs(p1 - p2) <= 0.00002f * qMin(qAbs(p1), qAbs(p2))); + else + return (qAbs(p1 - p2) <= 0.00001f * qMin(qAbs(p1), qAbs(p2))); } static bool fuzzyCompare(const QTransform& t1, const QTransform& t2) { diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp index 726ca5549d..4eb149f6a6 100644 --- a/tests/auto/qmenu/tst_qmenu.cpp +++ b/tests/auto/qmenu/tst_qmenu.cpp @@ -812,6 +812,9 @@ public: void tst_QMenu::task258920_mouseBorder() { +#ifdef Q_OS_WINCE_WM + QSKIP("Mouse move related signals for Windows Mobile unavailable", SkipAll); +#endif Menu258920 menu; QAction *action = menu.addAction("test"); diff --git a/tests/auto/qsound/qsound.pro b/tests/auto/qsound/qsound.pro index c48d50d50f..383a0859b1 100644 --- a/tests/auto/qsound/qsound.pro +++ b/tests/auto/qsound/qsound.pro @@ -4,7 +4,7 @@ SOURCES += tst_qsound.cpp wince*|symbian*: { deploy.sources += 4.wav DEPLOYMENT = deploy - DEFINES += SRCDIR=\\\"\\\" + !symbian:DEFINES += SRCDIR=\\\"\\\" } else { DEFINES += SRCDIR=\\\"$$PWD/\\\" } diff --git a/tests/auto/qsound/tst_qsound.cpp b/tests/auto/qsound/tst_qsound.cpp index dd5f2ced73..fdbf6a26b1 100644 --- a/tests/auto/qsound/tst_qsound.cpp +++ b/tests/auto/qsound/tst_qsound.cpp @@ -43,6 +43,10 @@ #include <QtTest/QtTest> #include <QtGui> +#if defined(Q_OS_SYMBIAN) +#define SRCDIR "" +#endif + class tst_QSound : public QObject { Q_OBJECT diff --git a/tests/auto/qspinbox/tst_qspinbox.cpp b/tests/auto/qspinbox/tst_qspinbox.cpp index 4829b6bca6..2389060292 100644 --- a/tests/auto/qspinbox/tst_qspinbox.cpp +++ b/tests/auto/qspinbox/tst_qspinbox.cpp @@ -980,26 +980,28 @@ void tst_QSpinBox::sizeHint() sizeHint_SpinBox *spinBox = new sizeHint_SpinBox; layout->addWidget(spinBox); widget->show(); - QTest::qWait(100); + QTest::qWaitForWindowShown(widget); // Prefix spinBox->sizeHintRequests = 0; spinBox->setPrefix(QLatin1String("abcdefghij")); qApp->processEvents(); - QVERIFY(spinBox->sizeHintRequests > 0); + QTRY_VERIFY(spinBox->sizeHintRequests > 0); // Suffix spinBox->sizeHintRequests = 0; spinBox->setSuffix(QLatin1String("abcdefghij")); qApp->processEvents(); - QVERIFY(spinBox->sizeHintRequests > 0); + QTRY_VERIFY(spinBox->sizeHintRequests > 0); // Range spinBox->sizeHintRequests = 0; spinBox->setRange(0, 1234567890); spinBox->setValue(spinBox->maximum()); qApp->processEvents(); - QVERIFY(spinBox->sizeHintRequests > 0); + QTRY_VERIFY(spinBox->sizeHintRequests > 0); + + delete widget; } QTEST_MAIN(tst_QSpinBox) diff --git a/tests/auto/qsqlrecord/qsqlrecord.pro b/tests/auto/qsqlrecord/qsqlrecord.pro index 7a720757c5..f36f0768a3 100644 --- a/tests/auto/qsqlrecord/qsqlrecord.pro +++ b/tests/auto/qsqlrecord/qsqlrecord.pro @@ -9,11 +9,11 @@ symbian { DEPLOYMENT += sqlite } } -} -TARGET.EPOCSTACKSIZE=50000 -TARGET.EPOCHEAPSIZE=50000 5000000 + TARGET.EPOCSTACKSIZE=50000 + TARGET.EPOCHEAPSIZE=50000 5000000 } + QT += sql diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp index 4bf7c2e2cb..bb0e226b11 100644 --- a/tests/auto/qtableview/tst_qtableview.cpp +++ b/tests/auto/qtableview/tst_qtableview.cpp @@ -3412,6 +3412,12 @@ void tst_QTableView::mouseWheel() QFETCH(int, horizontalPositon); QFETCH(int, verticalPosition); + if (scrollMode == int(QAbstractItemView::ScrollPerPixel)) + { +#ifdef Q_OS_WINCE + QSKIP("Since different Windows CE versions sport different taskbars, we skip this test", SkipSingle); +#endif + } QtTestTableModel model(100, 100); QtTestTableView view; view.resize(500, 500); diff --git a/tests/auto/qtextlayout/tst_qtextlayout.cpp b/tests/auto/qtextlayout/tst_qtextlayout.cpp index 5ccae946b5..fe87dfb175 100644 --- a/tests/auto/qtextlayout/tst_qtextlayout.cpp +++ b/tests/auto/qtextlayout/tst_qtextlayout.cpp @@ -1085,10 +1085,6 @@ QT_END_NAMESPACE void tst_QTextLayout::testTabDPIScale() { - #ifdef Q_OS_WINCE - QSKIP("This test fails for large DPIs.", SkipAll); - #endif - class MyPaintDevice : public QPaintDevice { QPaintEngine *paintEngine () const { return 0; } int metric (QPaintDevice::PaintDeviceMetric metric) const { @@ -1118,14 +1114,14 @@ void tst_QTextLayout::testTabDPIScale() QTextOption option = layout.textOption(); QList<QTextOption::Tab> tabs; QTextOption::Tab tab; - tab.position = 100; + tab.position = 200; tabs.append(tab); - tab.position = 200; + tab.position = 400; tab.type = QTextOption::RightTab; tabs.append(tab); - tab.position = 300; + tab.position = 600; tab.type = QTextOption::CenterTab; tabs.append(tab); option.setTabs(tabs); @@ -1133,7 +1129,7 @@ void tst_QTextLayout::testTabDPIScale() layout.beginLayout(); QTextLine line = layout.createLine(); - line.setLineWidth(500.); + line.setLineWidth(1500.); layout.endLayout(); QCOMPARE(line.cursorToX(0), 0.); QCOMPARE(line.cursorToX(1), (double) TESTFONT_SIZE); // check that the font does not resize @@ -1142,9 +1138,9 @@ void tst_QTextLayout::testTabDPIScale() int fixedScale = (int)( scale * qreal(64)); // into a QFixed scale = ((qreal)fixedScale)/(qreal)64; // and out of a QFixed - QCOMPARE(line.cursorToX(6), 100 * scale); - QCOMPARE(line.cursorToX(12), 200 * scale - TESTFONT_SIZE * 5); - QCOMPARE(line.cursorToX(18), 300 * scale - TESTFONT_SIZE * 3 / 2.0); + QCOMPARE(line.cursorToX(6), tabs.at(0).position * scale); + QCOMPARE(line.cursorToX(12), tabs.at(1).position * scale - TESTFONT_SIZE * 5); + QCOMPARE(line.cursorToX(18), tabs.at(2).position * scale - TESTFONT_SIZE * 3 / 2.0); } void tst_QTextLayout::tabHeight() diff --git a/tests/auto/qtimer/tst_qtimer.cpp b/tests/auto/qtimer/tst_qtimer.cpp index 0877500641..01a6317a84 100644 --- a/tests/auto/qtimer/tst_qtimer.cpp +++ b/tests/auto/qtimer/tst_qtimer.cpp @@ -46,10 +46,6 @@ #include <qtimer.h> #include <qthread.h> - - - - #if defined Q_OS_UNIX #include <unistd.h> #endif @@ -242,7 +238,6 @@ public: // sleep for 2ms QTest::qSleep(2); - killTimer(te->timerId()); } @@ -277,9 +272,11 @@ void tst_QTimer::livelock() #elif defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) QEXPECT_FAIL("zero timer", "", Continue); QEXPECT_FAIL("non-zero timer", "", Continue); -#elif defined(Q_OS_WIN) +#elif defined(Q_OS_WIN) && !defined(Q_OS_WINCE) if (QSysInfo::WindowsVersion < QSysInfo::WV_XP) QEXPECT_FAIL("non-zero timer", "Multimedia timers are not available on Windows 2000", Continue); +#elif defined(Q_OS_WINCE) + QEXPECT_FAIL("non-zero timer", "Windows CE devices often too slow", Continue); #endif QVERIFY(tester.postEventAtRightTime); } diff --git a/tests/auto/qtoolbar/tst_qtoolbar.cpp b/tests/auto/qtoolbar/tst_qtoolbar.cpp index e4f317c533..ac86fd98b1 100644 --- a/tests/auto/qtoolbar/tst_qtoolbar.cpp +++ b/tests/auto/qtoolbar/tst_qtoolbar.cpp @@ -54,6 +54,8 @@ #include <qtoolbutton.h> #include <qlineedit.h> #include <qkeysequence.h> +#include <qmenu.h> +#include <private/qtoolbarextension_p.h> #include "../../shared/util.h" @@ -569,6 +571,29 @@ void tst_QToolBar::actionGeometry() qt_x11_wait_for_window_manager(&tb); #endif + QList<QToolBarExtension *> extensions = tb.findChildren<QToolBarExtension *>(); + + QRect rect01; + QRect rect02; + QRect rect03; + QRect rect04; + QMenu *popupMenu; + + if (extensions.size() != 0) + { + QToolBarExtension *extension = extensions.at(0); + if (extension->isVisible()) { + QRect rect0 = extension->geometry(); + QTest::mouseClick( extension, Qt::LeftButton, 0, rect0.center(), -1 ); + QApplication::processEvents(); + popupMenu = qobject_cast<QMenu *>(extension->menu()); + rect01 = popupMenu->actionGeometry(&action1); + rect02 = popupMenu->actionGeometry(&action2); + rect03 = popupMenu->actionGeometry(&action3); + rect04 = popupMenu->actionGeometry(&action4); + } + } + QRect rect1 = tb.actionGeometry(&action1); QRect rect2 = tb.actionGeometry(&action2); QRect rect3 = tb.actionGeometry(&action3); @@ -590,10 +615,25 @@ void tst_QToolBar::actionGeometry() QVERIFY(!rect4.isNull()); QVERIFY(!rect4.isEmpty()); - QCOMPARE(tb.actionAt(rect1.center()), &action1); - QCOMPARE(tb.actionAt(rect2.center()), &action2); - QCOMPARE(tb.actionAt(rect3.center()), &action3); - QCOMPARE(tb.actionAt(rect4.center()), &action4); + if (rect01.isValid()) + QCOMPARE(popupMenu->actionAt(rect01.center()), &action1); + else + QCOMPARE(tb.actionAt(rect1.center()), &action1); + + if (rect02.isValid()) + QCOMPARE(popupMenu->actionAt(rect02.center()), &action2); + else + QCOMPARE(tb.actionAt(rect2.center()), &action2); + + if (rect03.isValid()) + QCOMPARE(popupMenu->actionAt(rect03.center()), &action3); + else + QCOMPARE(tb.actionAt(rect3.center()), &action3); + + if (rect04.isValid()) + QCOMPARE(popupMenu->actionAt(rect04.center()), &action4); + else + QCOMPARE(tb.actionAt(rect4.center()), &action4); } void tst_QToolBar::actionAt() @@ -864,33 +904,82 @@ void tst_QToolBar::actionTriggered() qt_x11_wait_for_window_manager(&tb); #endif + QList<QToolBarExtension *> extensions = tb.findChildren<QToolBarExtension *>(); + + QRect rect01; + QRect rect02; + QRect rect03; + QRect rect04; + QMenu *popupMenu; + + if (extensions.size() != 0) + { + QToolBarExtension *extension = extensions.at(0); + if (extension->isVisible()) { + QRect rect0 = extension->geometry(); + QTest::mouseClick( extension, Qt::LeftButton, 0, rect0.center(), -1 ); + QApplication::processEvents(); + popupMenu = qobject_cast<QMenu *>(extension->menu()); + rect01 = popupMenu->actionGeometry(&action1); + rect02 = popupMenu->actionGeometry(&action2); + rect03 = popupMenu->actionGeometry(&action3); + rect04 = popupMenu->actionGeometry(&action4); + } + } + QRect rect1 = tb.actionGeometry(&action1); QRect rect2 = tb.actionGeometry(&action2); QRect rect3 = tb.actionGeometry(&action3); QRect rect4 = tb.actionGeometry(&action4); - QAbstractButton *button1 = qobject_cast<QAbstractButton *>(tb.childAt(rect1.center())); - QAbstractButton *button2 = qobject_cast<QAbstractButton *>(tb.childAt(rect2.center())); - QAbstractButton *button3 = qobject_cast<QAbstractButton *>(tb.childAt(rect3.center())); - QAbstractButton *button4 = qobject_cast<QAbstractButton *>(tb.childAt(rect4.center())); - QVERIFY(button1 != 0); - QVERIFY(button2 != 0); - QVERIFY(button3 != 0); - QVERIFY(button4 != 0); + + QAbstractButton *button1; + QAbstractButton *button2; + QAbstractButton *button3; + QAbstractButton *button4; + + if (!rect01.isValid()) { + button1 = qobject_cast<QAbstractButton *>(tb.childAt(rect1.center())); + QVERIFY(button1 != 0); + } + if (!rect02.isValid()) { + button2 = qobject_cast<QAbstractButton *>(tb.childAt(rect2.center())); + QVERIFY(button2 != 0); + } + if (!rect03.isValid()) { + button3 = qobject_cast<QAbstractButton *>(tb.childAt(rect3.center())); + QVERIFY(button3 != 0); + } + if (!rect04.isValid()) { + button4 = qobject_cast<QAbstractButton *>(tb.childAt(rect4.center())); + QVERIFY(button4 != 0); + } ::triggered = 0; - QTest::mouseClick(button1, Qt::LeftButton); + if (!rect01.isValid()) + QTest::mouseClick(button1, Qt::LeftButton); + else + QTest::mouseClick(popupMenu, Qt::LeftButton, 0, rect01.center(), -1 ); QCOMPARE(::triggered, &action1); ::triggered = 0; - QTest::mouseClick(button2, Qt::LeftButton); + if (!rect02.isValid()) + QTest::mouseClick(button2, Qt::LeftButton); + else + QTest::mouseClick(popupMenu, Qt::LeftButton, 0, rect02.center(), -1 ); QCOMPARE(::triggered, &action2); ::triggered = 0; - QTest::mouseClick(button3, Qt::LeftButton); + if (!rect03.isValid()) + QTest::mouseClick(button3, Qt::LeftButton); + else + QTest::mouseClick(popupMenu, Qt::LeftButton, 0, rect03.center(), -1 ); QCOMPARE(::triggered, &action3); ::triggered = 0; - QTest::mouseClick(button4, Qt::LeftButton); + if (!rect04.isValid()) + QTest::mouseClick(button4, Qt::LeftButton); + else + QTest::mouseClick(popupMenu, Qt::LeftButton, 0, rect04.center(), -1 ); QCOMPARE(::triggered, &action4); } @@ -977,7 +1066,7 @@ void tst_QToolBar::accel() mw.show(); QApplication::setActiveWindow(&mw); QTest::qWait(100); - QTRY_COMPARE(QApplication::activeWindow(), &mw); + QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&mw)); QTest::keyClick(&mw, Qt::Key_T, Qt::AltModifier); QTest::qWait(300); diff --git a/tests/auto/selftests/tst_selftests.cpp b/tests/auto/selftests/tst_selftests.cpp index 1a2de65cc3..579f4eb959 100644 --- a/tests/auto/selftests/tst_selftests.cpp +++ b/tests/auto/selftests/tst_selftests.cpp @@ -299,7 +299,7 @@ void tst_Selftests::runSubTest() void tst_Selftests::initTestCase() { -#ifndef Q_OS_UNIX +#if !defined(Q_OS_UNIX) || defined(Q_WS_MAC) m_checkXMLBlacklist.append("crashes"); // This test crashes (XML valid on Unix only) #endif m_checkXMLBlacklist.append("waitwithoutgui"); // This test is not a QTestLib test. diff --git a/tools/configure/tools.cpp b/tools/configure/tools.cpp index 0d170f5149..c958dd9fcd 100644 --- a/tools/configure/tools.cpp +++ b/tools/configure/tools.cpp @@ -152,7 +152,7 @@ void Tools::checkLicense(QMap<QString,QString> &dictionary, QMap<QString,QString if (platforms == 'X') { dictionary["LICENSE_EXTENSION"] = "-ALLOS"; - } else if (strchr("3679ACDEHJKMSUWX", platforms)) { + } else if (strchr("2346789ABCDEGHJKMPQSTUVWX", platforms)) { dictionary["LICENSE_EXTENSION"] = "-EMBEDDED"; } else if (strchr("4BFPQRTY", platforms)) { dictionary["LICENSE_EXTENSION"] = "-DESKTOP"; diff --git a/tools/qdoc3/codemarker.h b/tools/qdoc3/codemarker.h index e400f8a834..9858484f7a 100644 --- a/tools/qdoc3/codemarker.h +++ b/tools/qdoc3/codemarker.h @@ -71,6 +71,8 @@ struct Section : name(name0), singularMember(singularMember0), pluralMember(pluralMember0) { } + void appendMember(Node* node) { members.append(node); } + void appendReimpMember(Node* node) { reimpMembers.append(node); } }; struct FastSection diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index ec5ce9619b..d93e24c6cb 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -541,9 +541,10 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc, else { lastPath = parentPath; } - - if (func) + if (func) { func->borrowParameterNames(clone); + func->setParentPath(clone->parentPath()); + } delete clone; } return func; @@ -1371,6 +1372,7 @@ bool CppCodeParser::matchFunctionDecl(InnerNode *parent, func->setAccess(access); func->setLocation(location()); func->setReturnType(returnType.toString()); + func->setParentPath(parentPath); func->setTemplateStuff(templateStuff); if (compat) func->setStatus(Node::Compat); diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 291f60b26e..033c62c022 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -59,6 +59,24 @@ QT_BEGIN_NAMESPACE #define COMMAND_VERSION Doc::alias("version") +QString HtmlGenerator::sinceTitles[] = + { + " New Namespaces", + " New Classes", + " New Member Functions", + " New Functions in Namespaces", + " New Global Functions", + " New Macros", + " New Enum Types", + " New Typedefs", + " New Properties", + " New Variables", + " New Qml Properties", + " New Qml Signals", + " New Qml Methods", + "" + }; + static bool showBrokenLinks = false; static QRegExp linkTag("(<@link node=\"([^\"]+)\">).*(</@link>)"); @@ -186,7 +204,7 @@ HtmlGenerator::HtmlGenerator() : helpProjectWriter(0), inLink(false), inContents(false), inSectionHeading(false), inTableHeader(false), numTableRows(0), threeColumnEnumValueTable(true), funcLeftParen("\\S(\\()"), - tre(0), slow(false), obsoleteLinks(false) + myTree(0), slow(false), obsoleteLinks(false) { } @@ -313,7 +331,7 @@ void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) ++styleIter; } - tre = tree; + myTree = tree; nonCompatClasses.clear(); mainClasses.clear(); compatClasses.clear(); @@ -332,64 +350,6 @@ void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) #endif findAllSince(tree->root()); -#if 0 - if (!sinceVersions.isEmpty()) { - SinceVersionMap::const_iterator v = sinceVersions.constEnd(); - do { - --v; - qDebug() << "SINCE:" << v.key(); - if (!v.value().isEmpty()) { - QString type; - SinceNodeMultiMap::const_iterator n = v.value().constBegin(); - while (n != v.value().constEnd()) { - switch (n.value()->type()) { - case Node::Namespace: - type = "namespace"; - break; - case Node::Class: - type = "class"; - break; - case Node::Fake: - type = "fake"; - break; - case Node::Enum: - type = "enum"; - break; - case Node::Typedef: - type = "typedef"; - break; - case Node::Function: - type = "function"; - break; - case Node::Property: - type = "property"; - break; - case Node::Variable: - type = "variable"; - break; - case Node::Target: - type = "target"; - break; - case Node::QmlProperty: - type = "QML property"; - break; - case Node::QmlSignal: - type = "QML signal"; - break; - case Node::QmlMethod: - type = "QML method"; - break; - default: - type = "No type"; - } - qDebug() << " " << type << n.key(); - ++n; - } - } - } while (v != sinceVersions.constBegin()); - } -#endif - PageGenerator::generateTree(tree, marker); dcfClassesRoot.ref = "classes.html"; @@ -433,7 +393,7 @@ void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) projectUrl, projectDescription); - helpProjectWriter->generate(tre); + helpProjectWriter->generate(myTree); } void HtmlGenerator::startText(const Node * /* relative */, @@ -598,13 +558,12 @@ int HtmlGenerator::generateAtom(const Atom *atom, break; case Atom::AnnotatedList: { - QList<Node*> values = tre->groups().values(atom->string()); - QMap<QString, const Node*> nodeMap; + QList<Node*> values = myTree->groups().values(atom->string()); + NodeMap nodeMap; for (int i = 0; i < values.size(); ++i) { const Node* n = values.at(i); if ((n->status() != Node::Internal) && (n->access() != Node::Private)) { nodeMap.insert(n->nameForLists(),n); - //qDebug() << " " << n->nameForLists(); } } generateAnnotatedList(relative, marker, nodeMap); @@ -633,7 +592,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, if (editionModuleMap.contains(editionName)) { // Add all classes in the modules listed for that edition. - QMap<QString, const Node *> editionClasses; + NodeMap editionClasses; foreach (const QString &moduleName, editionModuleMap[editionName]) { if (moduleClassMap.contains(moduleName)) editionClasses.unite(moduleClassMap[moduleName]); @@ -642,7 +601,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, // Add additional groups and remove groups of classes that // should be excluded from the edition. - QMultiMap <QString, Node *> groups = tre->groups(); + QMultiMap <QString, Node *> groups = myTree->groups(); foreach (const QString &groupName, editionGroupMap[editionName]) { QList<Node *> groupClasses; if (groupName.startsWith("-")) { @@ -689,7 +648,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, else if (atom->string() == "related") { const FakeNode *fake = static_cast<const FakeNode *>(relative); if (fake && !fake->groupMembers().isEmpty()) { - QMap<QString, const Node *> groupMembersMap; + NodeMap groupMembersMap; foreach (const Node *node, fake->groupMembers()) { if (node->type() == Node::Fake) groupMembersMap[fullName(node, relative, marker)] = node; @@ -713,34 +672,116 @@ int HtmlGenerator::generateAtom(const Atom *atom, break; case Atom::SinceList: { - QList<Node*> nodes; - SinceVersionMap::const_iterator v; - v = sinceVersions.find(atom->string()); - if ((v != sinceVersions.constEnd()) && !v.value().isEmpty()) { - for (int i=0; !Node::typeName(i).isEmpty(); i++) { - Node::Type t = (Node::Type) i; - SinceNodeMultiMap::const_iterator n=v.value().constBegin(); - QMultiMap<QString, const Node*> nodeMap; - while (n != v.value().constEnd()) { - const Node* node = n.value(); - if (node->type() == t) - nodeMap.insert(node->nameForLists(),node); - ++n; - } - if (!nodeMap.isEmpty()) { - out() << "<h2>" - << Node::typeName(i) - << " new in Qt " - << atom->string() - << "</h2>"; - generateAnnotatedList(relative, marker, nodeMap); - nodeMap.clear(); + NodeMultiMapMap::const_iterator v; + v = nodeMultiMapMap.find(atom->string()); + NodeMapMap::const_iterator nc; + nc = nodeMapMap.find(atom->string()); + if ((v != nodeMultiMapMap.constEnd()) && !v.value().isEmpty()) { + QList<Section> sections; + QList<Section>::ConstIterator s; + for (int i=0; i<LastSinceType; ++i) + sections.append(Section(sinceTitle(i),QString(),QString())); + + NodeMultiMap::const_iterator n = v.value().constBegin(); + while (n != v.value().constEnd()) { + const Node* node = n.value(); + switch (node->type()) { + case Node::Namespace: + sections[Namespace].appendMember((Node*)node); + break; + case Node::Class: + sections[Class].appendMember((Node*)node); + break; + case Node::Enum: + sections[Enum].appendMember((Node*)node); + break; + case Node::Typedef: + sections[Typedef].appendMember((Node*)node); + break; + case Node::Function: { + const FunctionNode* fn = static_cast<const FunctionNode*>(node); + if (fn->isMacro()) + sections[Macro].appendMember((Node*)node); + else { + Node* p = fn->parent(); + if (p) { + if (p->type() == Node::Class) + sections[MemberFunction].appendMember((Node*)node); + else if (p->type() == Node::Namespace) { + if (p->name().isEmpty()) + sections[GlobalFunction].appendMember((Node*)node); + else + sections[NamespaceFunction].appendMember((Node*)node); + } + else + sections[GlobalFunction].appendMember((Node*)node); + } + else + sections[GlobalFunction].appendMember((Node*)node); + } + break; + } + case Node::Property: + sections[Property].appendMember((Node*)node); + break; + case Node::Variable: + sections[Variable].appendMember((Node*)node); + break; + case Node::QmlProperty: + sections[QmlProperty].appendMember((Node*)node); + break; + case Node::QmlSignal: + sections[QmlSignal].appendMember((Node*)node); + break; + case Node::QmlMethod: + sections[QmlMethod].appendMember((Node*)node); + break; + default: + break; } + ++n; + } + int idx = 0; + s = sections.constBegin(); + while (s != sections.constEnd()) { + if (!(*s).members.isEmpty()) { + out() << "<a name=\"" + << registerRef((*s).name.toLower()) + << "\"></a>\n"; + out() << "<h3>" << protect((*s).name) << "</h3>\n"; + if (idx == Class) + generateCompactList(0, marker, nc.value(), QString("Q")); + else if (idx == MemberFunction) { + NodeMultiMapMap nodemultimapmap; + NodeMultiMapMap::iterator nmmap; + NodeList::const_iterator i = s->members.constBegin(); + while (i != s->members.constEnd()) { + Node* p = (*i)->parent(); + nmmap = nodemultimapmap.find(p->name()); + if (nmmap == nodemultimapmap.end()) + nmmap = nodemultimapmap.insert(p->name(),NodeMultiMap()); + nmmap->insert((*i)->name(),(*i)); + ++i; + } + nmmap = nodemultimapmap.begin(); + while (nmmap != nodemultimapmap.end()) { + NodeList nlist = nmmap->values(); + out() << "<p>New functions in " << protect(nmmap.key()) << ":</p>\n"; + generateSection(nlist, 0, marker, CodeMarker::Summary); + out() << "<br />"; + ++nmmap; + } + } + else + generateSection(s->members, 0, marker, CodeMarker::Summary); + } + ++idx; + ++s; } } } break; -case Atom::Image: + case Atom::Image: case Atom::InlineImage: { QString fileName = imageFileName(relative, atom->string()); @@ -1151,7 +1192,7 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, subtitleText << "[" << Atom(Atom::AutoLink, fixedModule) << " module]"; if (fixedModule.isEmpty()) { - QMultiMap<QString, QString> publicGroups = tre->publicGroups(); + QMultiMap<QString, QString> publicGroups = myTree->publicGroups(); QList<QString> groupNames = publicGroups.values(inner->name()); if (!groupNames.isEmpty()) { qSort(groupNames.begin(), groupNames.end()); @@ -1492,7 +1533,7 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) generateAlsoList(fake, marker); if (!fake->groupMembers().isEmpty()) { - QMap<QString, const Node *> groupMembersMap; + NodeMap groupMembersMap; foreach (const Node *node, fake->groupMembers()) { if (node->type() == Node::Class || node->type() == Node::Namespace) groupMembersMap[node->name()] = node; @@ -1564,7 +1605,7 @@ void HtmlGenerator::generateHeader(const QString& title, if (node && !node->doc().location().isEmpty()) out() << "<!-- " << node->doc().location().fileName() << " -->\n"; - shortVersion = tre->version(); + shortVersion = myTree->version(); if (shortVersion.count(QChar('.')) == 2) shortVersion.truncate(shortVersion.lastIndexOf(QChar('.'))); if (!shortVersion.isEmpty()) { @@ -1686,7 +1727,7 @@ void HtmlGenerator::generateHeader(const QString& title, "<body>\n"; if (mainPage) generateMacRef(node, marker); - out() << QString(postHeader).replace("\\" + COMMAND_VERSION, tre->version()); + out() << QString(postHeader).replace("\\" + COMMAND_VERSION, myTree->version()); if (node && !node->links().empty()) @@ -1717,8 +1758,8 @@ void HtmlGenerator::generateFooter(const Node *node) if (node && !node->links().empty()) out() << "<p>\n" << navigationLinks << "</p>\n"; - out() << QString(footer).replace("\\" + COMMAND_VERSION, tre->version()) - << QString(address).replace("\\" + COMMAND_VERSION, tre->version()) + out() << QString(footer).replace("\\" + COMMAND_VERSION, myTree->version()) + << QString(address).replace("\\" + COMMAND_VERSION, myTree->version()) << "</body>\n" "</html>\n"; } @@ -1970,8 +2011,8 @@ void HtmlGenerator::generateClassHierarchy(const Node *relative, if (classMap.isEmpty()) return; - QMap<QString, const Node *> topLevel; - QMap<QString, const Node *>::ConstIterator c = classMap.begin(); + NodeMap topLevel; + NodeMap::ConstIterator c = classMap.begin(); while (c != classMap.end()) { const ClassNode *classe = static_cast<const ClassNode *>(*c); if (classe->baseClasses().isEmpty()) @@ -1979,7 +2020,7 @@ void HtmlGenerator::generateClassHierarchy(const Node *relative, ++c; } - QStack<QMap<QString, const Node *> > stack; + QStack<NodeMap > stack; stack.push(topLevel); out() << "<ul>\n"; @@ -1996,7 +2037,7 @@ void HtmlGenerator::generateClassHierarchy(const Node *relative, out() << "</li>\n"; stack.top().erase(stack.top().begin()); - QMap<QString, const Node *> newTop; + NodeMap newTop; foreach (const RelatedClass &d, child->derivedClasses()) { if (d.access != Node::Private) newTop.insert(d.node->name(), d.node); @@ -2011,7 +2052,7 @@ void HtmlGenerator::generateClassHierarchy(const Node *relative, void HtmlGenerator::generateAnnotatedList(const Node *relative, CodeMarker *marker, - const QMap<QString, const Node *> &nodeMap) + const NodeMap &nodeMap) { out() << "<p><table width=\"100%\" class=\"annotated\" cellpadding=\"2\" " << "cellspacing=\"1\" border=\"0\">\n"; @@ -2049,9 +2090,19 @@ void HtmlGenerator::generateAnnotatedList(const Node *relative, out() << "</table></p>\n"; } +/*! + This function finds the common prefix of the names of all + the classes in \a classMap and then generates a compact + list of the class names alphabetized on the part of the + name not including the common prefix. You can tell the + function to use \a comonPrefix as the common prefix, but + normally you let it figure it out itself by looking at + the name of the first and last classes in \a classMap. + */ void HtmlGenerator::generateCompactList(const Node *relative, CodeMarker *marker, - const QMap<QString, const Node *> &classMap) + const NodeMap &classMap, + QString commonPrefix) { const int NumParagraphs = 37; // '0' to '9', 'A' to 'Z', '_' const int NumColumns = 4; // number of columns in the result @@ -2060,64 +2111,74 @@ void HtmlGenerator::generateCompactList(const Node *relative, return; /* - First, find out the common prefix of all non-namespaced classes. - For Qt, the prefix is Q. It can easily be derived from the first - and last classes in alphabetical order (QAccel and QXtWidget in Qt 2.1). - */ - int commonPrefixLen = 0; - QString commonPrefix; - QString first; - QString last; - - QMap<QString, const Node *>::const_iterator iter = classMap.begin(); - while (iter != classMap.end()) { - if (!iter.key().contains("::")) { - first = iter.key(); - break; + If commonPrefix is not empty, then the caller knows what + the common prefix is, so just use that. + */ + int commonPrefixLen = commonPrefix.length(); + if (commonPrefixLen == 0) { + QString first; + QString last; + + /* + First, find out the common prefix of all non-namespaced + classes. For Qt, the prefix is Q. It can easily be derived + from the first and last classes in alphabetical order + (QAccel and QXtWidget in Qt 2.1). + */ + + NodeMap::const_iterator iter = classMap.begin(); + while (iter != classMap.end()) { + if (!iter.key().contains("::")) { + first = iter.key(); + break; + } + ++iter; } - ++iter; - } - if (first.isEmpty()) - first = classMap.begin().key(); + if (first.isEmpty()) + first = classMap.begin().key(); - iter = classMap.end(); - while (iter != classMap.begin()) { - --iter; - if (!iter.key().contains("::")) { - last = iter.key(); - break; + iter = classMap.end(); + while (iter != classMap.begin()) { + --iter; + if (!iter.key().contains("::")) { + last = iter.key(); + break; + } } - } - if (last.isEmpty()) - last = classMap.begin().key(); + if (last.isEmpty()) + last = classMap.begin().key(); - if (classMap.size() > 1) { - while (commonPrefixLen < first.length() + 1 && - commonPrefixLen < last.length() + 1 && - first[commonPrefixLen] == last[commonPrefixLen]) - ++commonPrefixLen; - } + if (classMap.size() > 1) { + while (commonPrefixLen < first.length() + 1 && + commonPrefixLen < last.length() + 1 && + first[commonPrefixLen] == last[commonPrefixLen]) + ++commonPrefixLen; + } - commonPrefix = first.left(commonPrefixLen); + commonPrefix = first.left(commonPrefixLen); + } /* Divide the data into 37 paragraphs: 0, ..., 9, A, ..., Z, underscore (_). QAccel will fall in paragraph 10 (A) and QXtWidget in paragraph 33 (X). This is the only place where we assume that NumParagraphs is 37. Each paragraph is a - QMap<QString, const Node *>. + NodeMap. */ - QMap<QString, const Node *> paragraph[NumParagraphs+1]; + NodeMap paragraph[NumParagraphs+1]; QString paragraphName[NumParagraphs+1]; - QMap<QString, const Node *>::ConstIterator c = classMap.begin(); + NodeMap::ConstIterator c = classMap.begin(); while (c != classMap.end()) { QStringList pieces = c.key().split("::"); QString key; + int idx = commonPrefixLen; + if (!pieces.last().startsWith(commonPrefix)) + idx = 0; if (pieces.size() == 1) - key = pieces.last().mid(commonPrefixLen).toLower(); + key = pieces.last().mid(idx).toLower(); else key = pieces.last().toLower(); @@ -2206,7 +2267,7 @@ void HtmlGenerator::generateCompactList(const Node *relative, if ((currentParagraphNo[i] < NumParagraphs) && !paragraphName[currentParagraphNo[i]].isEmpty()) { - QMap<QString, const Node *>::Iterator it; + NodeMap::Iterator it; it = paragraph[currentParagraphNo[i]].begin(); for (j = 0; j < currentOffsetInParagraph[i]; j++) ++it; @@ -2253,7 +2314,7 @@ void HtmlGenerator::generateFunctionIndex(const Node *relative, #if 1 out() << "<ul>\n"; #endif - QMap<QString, QMap<QString, const Node *> >::ConstIterator f = funcIndex.begin(); + QMap<QString, NodeMap >::ConstIterator f = funcIndex.begin(); while (f != funcIndex.end()) { #if 1 out() << "<li>"; @@ -2268,7 +2329,7 @@ void HtmlGenerator::generateFunctionIndex(const Node *relative, nextLetter++; } - QMap<QString, const Node *>::ConstIterator s = (*f).begin(); + NodeMap::ConstIterator s = (*f).begin(); while (s != (*f).end()) { out() << " "; generateFullName((*s)->parent(), relative, marker, *s); @@ -2384,7 +2445,7 @@ void HtmlGenerator::generateOverviewList(const Node *relative, CodeMarker * /* m QMap<QString, FakeNode *> uncategorizedNodeMap; QRegExp singleDigit("\\b([0-9])\\b"); - const NodeList children = tre->root()->childNodes(); + const NodeList children = myTree->root()->childNodes(); foreach (Node *child, children) { if (child->type() == Node::Fake && child != relative) { FakeNode *fakeNode = static_cast<FakeNode *>(child); @@ -2436,7 +2497,7 @@ void HtmlGenerator::generateOverviewList(const Node *relative, CodeMarker * /* m else if (!isGroupPage) { // If we encounter a page that belongs to a group then // we add that page to the list for that group. - const FakeNode *groupNode = static_cast<const FakeNode *>(tre->root()->findNode(group, Node::Fake)); + const FakeNode *groupNode = static_cast<const FakeNode *>(myTree->root()->findNode(group, Node::Fake)); if (groupNode) fakeNodeMap[groupNode].insert(sortKey, fakeNode); //else @@ -2748,7 +2809,7 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, if (parseArg(src, funcTag, &i, n, &arg, &par1)) { QString link = linkForNode( marker->resolveTarget(par1.toString(), - tre, + myTree, relative), relative); addLink(link, arg, &html); @@ -2777,7 +2838,7 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, if (parseArg(src, typeTags[k], &i, n, &arg, &par1)) { par1 = QStringRef(); QString link = linkForNode( - marker->resolveTarget(arg.toString(), tre, relative), + marker->resolveTarget(arg.toString(), myTree, relative), relative); addLink(link, arg, &html); handled = true; @@ -3018,7 +3079,7 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, if (parseArg(src, funcTag, &i, n, &arg, &par1)) { QString link = linkForNode( marker->resolveTarget(par1.toString(), - tre, + myTree, relative), relative); addLink(link, arg, &html); @@ -3047,7 +3108,7 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, if (parseArg(src, typeTags[k], &i, n, &arg, &par1)) { par1 = QStringRef(); QString link = linkForNode( - marker->resolveTarget(arg.toString(), tre, relative), + marker->resolveTarget(arg.toString(), myTree, relative), relative); addLink(link, arg, &html); handled = true; @@ -3591,9 +3652,13 @@ void HtmlGenerator::findAllSince(const InnerNode *node) while (c != node->childNodes().constEnd()) { QString sinceVersion = (*c)->since(); if (((*c)->access() != Node::Private) && !sinceVersion.isEmpty()) { - SinceVersionMap::iterator vmap = sinceVersions.find(sinceVersion); - if (vmap == sinceVersions.end()) - vmap = sinceVersions.insert(sinceVersion,SinceNodeMultiMap()); + NodeMultiMapMap::iterator vmap = nodeMultiMapMap.find(sinceVersion); + if (vmap == nodeMultiMapMap.end()) + vmap = nodeMultiMapMap.insert(sinceVersion,NodeMultiMap()); + NodeMapMap::iterator ncmap = nodeMapMap.find(sinceVersion); + if (ncmap == nodeMapMap.end()) + ncmap = nodeMapMap.insert(sinceVersion,NodeMap()); + if ((*c)->type() == Node::Function) { FunctionNode *func = static_cast<FunctionNode *>(*c); if ((func->status() > Node::Obsolete) && @@ -3610,6 +3675,7 @@ void HtmlGenerator::findAllSince(const InnerNode *node) !(*c)->parent()->name().isEmpty()) className = (*c)->parent()->name()+"::"+className; vmap.value().insert(className,(*c)); + ncmap.value().insert(className,(*c)); } } else { @@ -3619,7 +3685,6 @@ void HtmlGenerator::findAllSince(const InnerNode *node) !(*c)->parent()->name().isEmpty()) name = (*c)->parent()->name()+"::"+name; vmap.value().insert(name,(*c)); - qDebug() << "GOT HEAH" << name; } if ((*c)->isInnerNode()) { findAllSince(static_cast<InnerNode *>(*c)); @@ -3646,9 +3711,10 @@ void HtmlGenerator::findAllFunctions(const InnerNode *node) } else if ((*c)->type() == Node::Function) { const FunctionNode *func = static_cast<const FunctionNode *>(*c); - if (func->status() > Node::Obsolete && func->metaness() != FunctionNode::Ctor - && func->metaness() != FunctionNode::Dtor) { - funcIndex[(*c)->name()].insert(tre->fullDocumentName((*c)->parent()), *c); + if ((func->status() > Node::Obsolete) && + (func->metaness() != FunctionNode::Ctor) && + (func->metaness() != FunctionNode::Dtor)) { + funcIndex[(*c)->name()].insert(myTree->fullDocumentName((*c)->parent()), *c); } } } @@ -3762,14 +3828,14 @@ const Node *HtmlGenerator::findNodeForTarget(const QString &target, node = relative; } else if (target.endsWith(".html")) { - node = tre->root()->findNode(target, Node::Fake); + node = myTree->root()->findNode(target, Node::Fake); } else if (marker) { - node = marker->resolveTarget(target, tre, relative); + node = marker->resolveTarget(target, myTree, relative); if (!node) - node = tre->findFakeNodeByTitle(target); + node = myTree->findFakeNodeByTitle(target); if (!node && atom) { - node = tre->findUnambiguousTarget(target, + node = myTree->findUnambiguousTarget(target, *const_cast<Atom**>(&atom)); } } @@ -3827,14 +3893,14 @@ QString HtmlGenerator::getLink(const Atom *atom, *node = relative; } else if (first.endsWith(".html")) { - *node = tre->root()->findNode(first, Node::Fake); + *node = myTree->root()->findNode(first, Node::Fake); } else { - *node = marker->resolveTarget(first, tre, relative); + *node = marker->resolveTarget(first, myTree, relative); if (!*node) - *node = tre->findFakeNodeByTitle(first); + *node = myTree->findFakeNodeByTitle(first); if (!*node) - *node = tre->findUnambiguousTarget(first, targetAtom); + *node = myTree->findUnambiguousTarget(first, targetAtom); } if (*node) { @@ -3886,7 +3952,7 @@ QString HtmlGenerator::getLink(const Atom *atom, } while (!path.isEmpty()) { - targetAtom = tre->findTarget(path.first(), *node); + targetAtom = myTree->findTarget(path.first(), *node); if (targetAtom == 0) break; path.removeFirst(); @@ -3915,7 +3981,7 @@ void HtmlGenerator::generateIndex(const QString &fileBase, const QString &url, const QString &title) { - tre->generateIndex(outputDir() + "/" + fileBase + ".index", url, title); + myTree->generateIndex(outputDir() + "/" + fileBase + ".index", url, title); } void HtmlGenerator::generateStatus(const Node *node, CodeMarker *marker) @@ -3930,18 +3996,21 @@ void HtmlGenerator::generateStatus(const Node *node, CodeMarker *marker) case Node::Compat: if (node->isInnerNode()) { text << Atom::ParaLeft - << Atom(Atom::FormattingLeft,ATOM_FORMATTING_BOLD) << "This " - << typeString(node) << " is part of the Qt 3 support library." + << Atom(Atom::FormattingLeft,ATOM_FORMATTING_BOLD) + << "This " + << typeString(node) + << " is part of the Qt 3 support library." << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD) - << " It is provided to keep old source code working. We strongly advise against " + << " It is provided to keep old source code working. " + << "We strongly advise against " << "using it in new code. See "; - const FakeNode *fakeNode = tre->findFakeNodeByTitle("Porting To Qt 4"); + const FakeNode *fakeNode = myTree->findFakeNodeByTitle("Porting To Qt 4"); Atom *targetAtom = 0; if (fakeNode && node->type() == Node::Class) { QString oldName(node->name()); - targetAtom = tre->findTarget(oldName.replace("3", ""), - fakeNode); + targetAtom = myTree->findTarget(oldName.replace("3", ""), + fakeNode); } if (targetAtom) { @@ -4151,7 +4220,7 @@ void HtmlGenerator::generateQmlInherits(const QmlClassNode* cn, QPair<QString,QString> linkPair; linkPair = cn->links()[Node::InheritsLink]; QStringList strList(linkPair.first); - const Node* n = tre->findNode(strList,Node::Fake); + const Node* n = myTree->findNode(strList,Node::Fake); if (n && n->subType() == Node::QmlClass) { const QmlClassNode* qcn = static_cast<const QmlClassNode*>(n); out() << "<p style=\"text-align: center\">"; @@ -4210,7 +4279,7 @@ void HtmlGenerator::generateInstantiatedBy(const ClassNode* cn, CodeMarker* marker) { if (cn && cn->status() != Node::Internal && !cn->qmlElement().isEmpty()) { - const Node* n = tre->root()->findNode(cn->qmlElement(),Node::Fake); + const Node* n = myTree->root()->findNode(cn->qmlElement(),Node::Fake); if (n && n->subType() == Node::QmlClass) { out() << "<p style=\"text-align: center\">"; Text text; diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index 3f6e564736..fabfed1a64 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -67,14 +67,34 @@ struct NavigationBar }; #endif -typedef QMultiMap<QString, Node*> SinceNodeMultiMap; -typedef QMap<QString, SinceNodeMultiMap> SinceVersionMap; +typedef QMultiMap<QString, Node*> NodeMultiMap; +typedef QMap<QString, NodeMultiMap> NodeMultiMapMap; +typedef QMap<QString, const Node*> NodeMap; +typedef QMap<QString, NodeMap> NodeMapMap; class HelpProjectWriter; class HtmlGenerator : public PageGenerator { public: + enum SinceType { + Namespace, + Class, + MemberFunction, + NamespaceFunction, + GlobalFunction, + Macro, + Enum, + Typedef, + Property, + Variable, + QmlProperty, + QmlSignal, + QmlMethod, + LastSinceType + }; + + public: HtmlGenerator(); ~HtmlGenerator(); @@ -85,6 +105,7 @@ class HtmlGenerator : public PageGenerator static QString protect(const QString& string); static QString cleanRef(const QString& ref); + static QString sinceTitle(int i) { return sinceTitles[i]; } protected: virtual void startText(const Node *relative, CodeMarker *marker); @@ -134,13 +155,14 @@ class HtmlGenerator : public PageGenerator CodeMarker::Status status); void generateClassHierarchy(const Node *relative, CodeMarker *marker, - const QMap<QString,const Node *> &classMap); + const NodeMap &classMap); void generateAnnotatedList(const Node *relative, CodeMarker *marker, - const QMap<QString, const Node *> &nodeMap); + const NodeMap &nodeMap); void generateCompactList(const Node *relative, CodeMarker *marker, - const QMap<QString, const Node *> &classMap); + const NodeMap &classMap, + QString commonPrefix = QString()); void generateFunctionIndex(const Node *relative, CodeMarker *marker); void generateLegaleseList(const Node *relative, CodeMarker *marker); void generateOverviewList(const Node *relative, CodeMarker *marker); @@ -273,23 +295,25 @@ class HtmlGenerator : public PageGenerator QString navigationLinks; QStringList stylesheets; QStringList customHeadElements; - const Tree *tre; + const Tree *myTree; bool slow; bool obsoleteLinks; - QMap<QString, QMap<QString, const Node *> > moduleClassMap; - QMap<QString, QMap<QString, const Node *> > moduleNamespaceMap; - QMap<QString, const Node *> nonCompatClasses; - QMap<QString, const Node *> mainClasses; - QMap<QString, const Node *> compatClasses; - QMap<QString, const Node *> obsoleteClasses; - QMap<QString, const Node *> namespaceIndex; - QMap<QString, const Node *> serviceClasses; + QMap<QString, NodeMap > moduleClassMap; + QMap<QString, NodeMap > moduleNamespaceMap; + NodeMap nonCompatClasses; + NodeMap mainClasses; + NodeMap compatClasses; + NodeMap obsoleteClasses; + NodeMap namespaceIndex; + NodeMap serviceClasses; #ifdef QDOC_QML - QMap<QString, const Node *> qmlClasses; + NodeMap qmlClasses; #endif - QMap<QString, QMap<QString, const Node *> > funcIndex; + QMap<QString, NodeMap > funcIndex; QMap<Text, const Node *> legaleseTexts; - SinceVersionMap sinceVersions; + NodeMultiMapMap nodeMultiMapMap; + static QString sinceTitles[]; + NodeMapMap nodeMapMap; }; #define HTMLGENERATOR_ADDRESS "address" @@ -303,3 +327,4 @@ class HtmlGenerator : public PageGenerator QT_END_NAMESPACE #endif + diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index d547d201cf..558808f8be 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -48,29 +48,17 @@ QT_BEGIN_NAMESPACE -QString Node::typeNames[] = - { - "Namespaces", - "Classes", - "Fake", - "Enums", - "Typedefs", - "Functions and Macros", - "Properties", - "Variables", - "Targets", - "Qml Properties", - "Qml Signals", - "Qml Methods", - "" - }; - /*! \class Node - \brief A node in a Tree. + \brief The Node class is a node in the Tree. + + A Node represents a class or function or something else + from the source code.. */ /*! + When this Node is destroyed, if it has a parent Node, it + removes itself from the parent node's child list. */ Node::~Node() { @@ -81,6 +69,11 @@ Node::~Node() } /*! + Sets this Node's Doc to \a doc. If \a replace is false and + this Node already has a Doc, a warning is reported that the + Doc is being overridden, and it reports where the previous + Doc was found. If \a replace is true, the Doc is replaced + silently. */ void Node::setDoc(const Doc& doc, bool replace) { @@ -840,9 +833,17 @@ void TypedefNode::setAssociatedEnum(const EnumNode *enume) /*! \class Parameter + \brief The class Parameter contains one parameter. + + A parameter can be a function parameter or a macro + parameter. */ /*! + Constructs this parameter from the left and right types + \a leftType and rightType, the parameter \a name, and the + \a defaultValue. In practice, \a rightType is not used, + and I don't know what is was meant for. */ Parameter::Parameter(const QString& leftType, const QString& rightType, @@ -853,6 +854,7 @@ Parameter::Parameter(const QString& leftType, } /*! + The standard copy constructor copies the strings from \a p. */ Parameter::Parameter(const Parameter& p) : lef(p.lef), rig(p.rig), nam(p.nam), def(p.def) @@ -860,6 +862,8 @@ Parameter::Parameter(const Parameter& p) } /*! + Assigning Parameter \a p to this Parameter copies the + strings across. */ Parameter& Parameter::operator=(const Parameter& p) { @@ -871,6 +875,23 @@ Parameter& Parameter::operator=(const Parameter& p) } /*! + Reconstructs the text describing the parameter and + returns it. If \a value is true, the default value + will be included, if there is one. + */ +QString Parameter::reconstruct(bool value) const +{ + QString p = lef + rig; + if (!p.endsWith(QChar('*')) && !p.endsWith(QChar('&')) && !p.endsWith(QChar(' '))) + p += " "; + p += nam; + if (value) + p += def; + return p; +} + + +/*! \class FunctionNode */ @@ -924,6 +945,8 @@ void FunctionNode::borrowParameterNames(const FunctionNode *source) } /*! + If this function is a reimplementation, \a from points + to the FunctionNode of the function being reimplemented. */ void FunctionNode::setReimplementedFrom(FunctionNode *from) { @@ -932,6 +955,8 @@ void FunctionNode::setReimplementedFrom(FunctionNode *from) } /*! + Sets the "associated" property to \a property. The function + might be the setter or getter for a property, for example. */ void FunctionNode::setAssociatedProperty(PropertyNode *property) { @@ -939,6 +964,8 @@ void FunctionNode::setAssociatedProperty(PropertyNode *property) } /*! + Returns the overload number for this function obtained + from the parent. */ int FunctionNode::overloadNumber() const { @@ -946,6 +973,8 @@ int FunctionNode::overloadNumber() const } /*! + Returns the number of times this function name has been + overloaded, obtained from the parent. */ int FunctionNode::numOverloads() const { @@ -953,6 +982,7 @@ int FunctionNode::numOverloads() const } /*! + Returns the list of parameter names. */ QStringList FunctionNode::parameterNames() const { @@ -966,6 +996,46 @@ QStringList FunctionNode::parameterNames() const } /*! + Returns the list of reconstructed parameters. If \a values + is true, the default values are included, if any are present. + */ +QStringList FunctionNode::reconstructParams(bool values) const +{ + QStringList params; + QList<Parameter>::ConstIterator p = parameters().begin(); + while (p != parameters().end()) { + params << (*p).reconstruct(values); + ++p; + } + return params; +} + +/*! + Reconstructs and returns the function's signature. If \a values + is true, the default values of the parameters are included, if + present. + */ +QString FunctionNode::signature(bool values) const +{ + QString s; + if (!returnType().isEmpty()) + s = returnType() + " "; + s += name() + "("; + QStringList params = reconstructParams(values); + int p = params.size(); + if (p > 0) { + for (int i=0; i<p; i++) { + s += params[i]; + if (i < (p-1)) + s += ", "; + } + } + s += ")"; + return s; +} + + +/*! \class PropertyNode */ diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index 09f38d26cd..f933270d98 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -175,13 +175,11 @@ class Node virtual QString fileBase() const; - static QString typeName(int i) { return typeNames[i]; } - protected: Node(Type type, InnerNode *parent, const QString& name); private: - static QString typeNames[]; + #ifdef Q_WS_WIN Type typ; Access acc; @@ -500,8 +498,10 @@ class Parameter { public: Parameter() {} - Parameter(const QString& leftType, const QString& rightType = "", - const QString& name = "", const QString& defaultValue = ""); + Parameter(const QString& leftType, + const QString& rightType = "", + const QString& name = "", + const QString& defaultValue = ""); Parameter(const Parameter& p); Parameter& operator=(const Parameter& p); @@ -514,6 +514,8 @@ class Parameter const QString& name() const { return nam; } const QString& defaultValue() const { return def; } + QString reconstruct(bool value = false) const; + private: QString lef; QString rig; @@ -541,6 +543,7 @@ class FunctionNode : public LeafNode virtual ~FunctionNode() { } void setReturnType(const QString& returnType) { rt = returnType; } + void setParentPath(const QStringList& parentPath) { pp = parentPath; } void setMetaness(Metaness metaness) { met = metaness; } void setVirtualness(Virtualness virtualness) { vir = virtualness; } void setConst(bool conste) { con = conste; } @@ -569,6 +572,10 @@ class FunctionNode : public LeafNode const FunctionNode *reimplementedFrom() const { return rf; } const QList<FunctionNode *> &reimplementedBy() const { return rb; } const PropertyNode *associatedProperty() const { return ap; } + const QStringList& parentPath() const { return pp; } + + QStringList reconstructParams(bool values = false) const; + QString signature(bool values = false) const; private: void setAssociatedProperty(PropertyNode *property); @@ -576,9 +583,10 @@ class FunctionNode : public LeafNode friend class InnerNode; friend class PropertyNode; - QString rt; + QString rt; + QStringList pp; #ifdef Q_WS_WIN - Metaness met; + Metaness met; Virtualness vir; #else Metaness met : 4; diff --git a/translations/translations.pri b/translations/translations.pri index b7924cdd22..c77876adb8 100644 --- a/translations/translations.pri +++ b/translations/translations.pri @@ -9,12 +9,9 @@ defineReplace(prependAll) { } defineReplace(fixPath) { -WIN { - return ($$replace($$1, /, \)) -} ELSE { + win32:1 ~= s|/|\\| return ($$1) } -} LUPDATE = $$fixPath($$QT_BUILD_TREE/bin/lupdate) -locations relative -no-ui-lines LRELEASE = $$fixPath($$QT_BUILD_TREE/bin/lrelease) |