summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dist/changes-4.7.4304
-rw-r--r--doc/src/declarative/declarativeui.qdoc2
-rw-r--r--doc/src/declarative/qtquick-intro.qdoc2
-rw-r--r--doc/src/index.qdoc4
-rw-r--r--doc/src/platforms/supported-platforms.qdoc12
-rw-r--r--doc/src/qt-features.qdoc204
-rw-r--r--doc/src/qt4-intro.qdoc3
-rw-r--r--src/corelib/io/qdir.cpp10
-rw-r--r--src/corelib/io/qfileinfo.cpp6
-rw-r--r--src/corelib/io/qfilesystemengine_win.cpp7
-rw-r--r--src/corelib/io/qtemporaryfile.cpp230
-rw-r--r--src/corelib/tools/qline.cpp5
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativeborderimage.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimage.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners.cpp6
-rw-r--r--src/declarative/graphicsitems/qdeclarativerepeater.cpp6
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext.cpp8
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp21
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit_p_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp18
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput_p_p.h2
-rw-r--r--src/declarative/util/qdeclarativelistmodel.cpp1
-rw-r--r--src/gui/accessible/qaccessible_unix.cpp2
-rw-r--r--src/gui/image/qpixmap_mac.cpp33
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp34
-rw-r--r--src/gui/kernel/qapplication_s60.cpp3
-rw-r--r--src/gui/kernel/qkeysequence.cpp4
-rw-r--r--src/gui/kernel/qsoftkeymanager.cpp14
-rw-r--r--src/gui/kernel/qt_s60_p.h26
-rw-r--r--src/gui/kernel/qwidget_s60.cpp13
-rw-r--r--src/gui/styles/qs60style_s60.cpp14
-rw-r--r--src/gui/styles/qwindowsstyle.cpp7
-rw-r--r--src/gui/text/qfontdatabase_s60.cpp30
-rw-r--r--src/gui/text/qtextcontrol.cpp34
-rw-r--r--src/gui/widgets/qcombobox.cpp2
-rw-r--r--src/gui/widgets/qlinecontrol.cpp6
-rw-r--r--src/gui/widgets/qtextedit.cpp2
-rwxr-xr-x[-rw-r--r--]src/imports/shaders/shadereffectitem.cpp110
-rw-r--r--src/imports/shaders/shadereffectitem.h4
-rw-r--r--src/imports/shaders/shadereffectsource.cpp43
-rw-r--r--src/imports/shaders/shadereffectsource.h3
-rw-r--r--src/xmlpatterns/expr/qevaluationcache.cpp5
-rw-r--r--src/xmlpatterns/expr/qevaluationcache_p.h1
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/horizontalAlignment_RightToLeft.qml1
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_words.qml5
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_words.qml5
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp61
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/data/horizontalAlignment_RightToLeft.qml1
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp13
-rw-r--r--tests/auto/qdir/tst_qdir.cpp6
-rw-r--r--tests/auto/qlineedit/tst_qlineedit.cpp7
-rw-r--r--tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp197
-rw-r--r--tools/qdoc3/cppcodemarker.cpp2
-rw-r--r--tools/qdoc3/ditaxmlgenerator.cpp83
-rw-r--r--tools/qdoc3/ditaxmlgenerator.h11
-rw-r--r--tools/qdoc3/doc.cpp2
-rw-r--r--tools/qdoc3/generator.cpp142
-rw-r--r--tools/qdoc3/generator.h12
-rw-r--r--tools/qdoc3/htmlgenerator.cpp103
-rw-r--r--tools/qdoc3/htmlgenerator.h11
-rw-r--r--tools/qdoc3/node.cpp13
-rw-r--r--tools/qdoc3/node.h2
68 files changed, 1107 insertions, 837 deletions
diff --git a/dist/changes-4.7.4 b/dist/changes-4.7.4
index a37e66a..9a08d15 100644
--- a/dist/changes-4.7.4
+++ b/dist/changes-4.7.4
@@ -19,13 +19,317 @@ Merge Request: http://qt.gitorious.org
* Library *
****************************************************************************
+QtGui
+-----
+
+ - [QTBUG-20214] QRentBook: LSK and RSK of booking page will change
+ somethimes
+ - [QTBUG-19656] Spectrum: the Mode menu disappears after the device is
+ changed from portrait to landscape.
+ - [QTBUG-19260] Cursor cannot be placed between letters f and i - "fi"
+ is interpreted as one character
+ - [QTBUG-19157] Crash in QGLContextPrivate::bindTexture() when using
+ QPainter::fillRect() with a brush having a size > max_texture_size
+ - [QTBUG-19089] TextInput positionToRectangle doesn't return correct
+ coordinates for the cursor in pre-edit mode
+ - [QTBUG-19067] Font glyphs get clipped on the top
+ - [QTBUG-18500] QTextBlock crash
+ - [QTBUG-18303] Arabic multiline text is clipped on the right
+ - [QTBUG-18185] QStaticText: Wrong kerning and baselines when rotating a
+ QGraphicsView
+ - [QTBUG-17443] Feedreadercrash: when opening feed with unicode characters
+ - [QTBUG-17244] QGraphicsLayout Layouting should be done in one go. Ugly
+ layouting visible otherwise
+ - [QTBUG-17209] Bug-231 introduces an off-by-one error
+ - [QTBUG-17117] Arabic reordering problem when 2 fonts are used
+ - [QTBUG-11131] QAbstractScrollArea::setViewport() causes crash when used
+ from within event handler method
+ - [QTBUG-16422] Big coordinate values cause segfault on ARM when calling
+ QGraphicsEllipseItem::contains
+ - [QTBUG-18017] Regression: Text selection with shift-click stopped working
+ - [QTBUG-18192] Crash when invoking blockBoundingRect over a QTextDocument
+ documentLayout
+ - [QTBUG-17505] Inflexible focus handling in QGraphicsScene
+ - [QTBUG-17020] QPainter::drawText() fails to draw correct text in some
+ circumstances. Related to QTBUG-12950
+ - [QTBUG-16401] QGraphicsScene returns focus incorrectly when QGraphicsView
+ is focused
+ - [QTBUG-17812] regression: qsortfilterproxymodel::reset doesn't invalidate
+ the model (Windows)
+ - [QTBUG-17230] QPlainTextEdit corruption/crash after scrolling
+ - [QTBUG-17536] qguistatemachine::cloneEvent doesn't clone
+ GraphicsSceneWheel Events correctly
+ - [QTBUG-17254] XPM files crash QImage (write)
+ - [QTBUG-16292] QTreeView crash in indexRowSizeHint/itemHeight
+ - [QTBUG-17390] Child widgets don't inherit their parent's input contexts
+ - [QTBUG-15910] setstylesheet on a QComboBox causes a segmentation fault
+ - [QTBUG-16652] Compilation of "4.7" branch fails:
+ private/qdrawhelper_arm_simd_p.h: No such file or directory
+
+QtNetwork
+---------
+
+ - [QTBUG-17464] SIGBUS in fetchAndAddOrdered from
+ QlcdEngine::connectionStateSignalsSlot
+ - [QTBUG-16022] QHttpNetworkConnectionChannel::expand discards data if
+ gzip-stream has missing end-of-stream marker
+ - [QTBUG-17199] ICD Bearer management: Causes the main thread to hang
+ when ran on a different thread.
+
+QtCore
+------
+
+ - [QTBUG-15421] QDirIterator returns hidden directories when it should only
+ return files and returns hidden files when it should only return
+ directories
+
+QtScript
+--------
+
+ - [QTBUG-17815] Missing APIShims in obsoleted QScriptValue constructor
+ - [QTBUG-17788] Crash when calling collectGarbage() after requesting
+ arguments object of native context
+
+QtDBus
+------
+
+ - [QTBUG-14228] Ensure Qt 4.7 doesn't crash when a D-Bus message with file
+ descriptors is received
+
+QtSql
+-----
+
+ - [QTBUG-14831] Dynamic sorting of a QSortFilterProxyModel on a
+ QSqlTableModel with OnManualSubmit is broken (4.7 regression)
+
+Declarative
+-----------
+
+ - [QTBUG-20159] No effect of setting color on a QStaticText or a
+ QML element
+ - [QTBUG-18428] Colored and underlined styled text are not underlined or
+ completely coloured on device
+ - [QTBUG-18362] wigglytext.qml does not behave correctly in qmlscene
+ - [QTBUG-18266] More than one XmlListModel - Lists randomly show data from
+ wrong model
+ - [QTBUG-15983] Cannot pass enum value as signal parameter from C++ to QML
+ - [QTBUG-14974] ListView and GridView + contentY performance
+ - [QTBUG-18412] Crash in sendPostedEvents() - QObject::isWidgetType()
+ (issue with QDeclarativePixmapReply)
+ - [QTBUG-15356] PathView doesn't update if preferredHighlightBegin and
+ preferredHighlightEnd changed
+ - [QTBUG-17562] TextInput text in echo mode PasswordEchoOnEdit revealed
+ on refocus
+ - [QTBUG-17775] Crash when using FolderListModel with a repeater
+ - [QTBUG-17361] Nested pressDelays crashes application
+ - [QTBUG-15705] QDeclarativeTextInput::mousePressEvent() doesn't call
+ QInputContext::mouseHandler()
+ - [QTBUG-17501] Focus: Tap any of the Rounded-cornered rectangle, the
+ context menu doesn't disappear.
+ - [QTBUG-17008] ListView + XmlListModel freeze application when change
+ language key combination
+ - [QTBUG-17324] incorrect 'version is not installed' error when importing
+ QML module
+ - [QTBUG-16999] QML TextInput doesn't scroll if writing preedit at the end
+ of the line
+ - [QTBUG-13451] Support property versioning in QML
+ - [QTBUG-16959] Crash when using Grid.TopToBottom flow with Repeater
+ inside Grid
+ - [QTBUG-16522] QML ListView Should Support Dynamic Headers and Footers
+ - [QTBUG-17114] QtQuick 1.1 alignment regression
+ - [QTBUG-16283] TextEdit and TextInput need text selection modes
+ - [QTBUG-16284] Disable drag and drop in TextEdit and TextInput
+
+OpenVG
+------
+ - [QTBUG-18682] QImage convertToFormat does not work with certain image
+ formats when default (OpenVG) rendering engine used.
+
+OpenGL
+------
+ - [QTBUG-14217] Unresolved symbol QGLWindowSurface::staticMetaObject when
+ building for Windows Mobile 5.0 with OpenGL ES 1.1 support
+ - [QTBUG-18184] mingw gcc 4 static build failed in tools/qml because of the
+ symbol export in libQtOpenGL
+ - [QTBUG-17256] Change QGLPixmapData load functions to use the
+ 'convertInPlace' versions of QImage to save memory
+
+3rdParty
+--------
+
+ - Image formats
+ * [QTBUG-20425] Update bundled libpng to 1.5.4 (security)
+
****************************************************************************
* Platform Specific Changes *
****************************************************************************
+Qt for Linux/X11
+----------------
+
+ - Declarative
+ * [QTBUG-19914] Segfault in QDeclarativeBinding::createBinding triggered
+ by QMultimediaKit
+ - gui
+ * [QTBUG-16175] REG: Qt 4.7/Linux Qt Designer / Qt Creator show multiple
+ warnings: "Application asked to unregister timer 0x17000002 which is
+ not registered in this thread. Fix application."
+
+Qt for Windows
+--------------
+
+ - gui
+ * [QTBUG-19878] QImage constructor crash when opening some tiff images
+ - corelib
+ * [QTBUG-17014] Qt event delivery is unreliable on windows platforms
+ - declarative
+ * [QTBUG-19198] ListView lose items
+ * [QTBUG-18587] Roles are not removed in listmodel
+ - qmake
+ * [QTBUG-18537] Compiling Qt on Windows XP x64 using MinGW-w64 fails
+
+Qt for Mac OS X
+---------------
+
+ - gui
+ * [QTBUG-20496] Qt does not compile under OSX Lion or llvm-gcc
+ * [QTBUG-18547] Buffer overrun in QMacPixmapData::macCreatePixels
+ (QPixmap_mac.cpp)
+ * [QTBUG-15474] Mac: Qt:Sheet dialog permanently loses focus after
+ moving the parent window
+ * [QTBUG-15897] QMainWindow crash in destructor when having a
+ QDockWidget of type Qt::Drawer containing a QTreeWidget
+ - corelib
+ * [QTBUG-11481] Floating Dock Widget behavior on Mac [REGRESSION]
+ - network
+ * [QTBUG-14520] SSL Isn't working with osx 10.5
+ * [QTBUG-5645] SSL Memory leaks on Mac.
+
+Qt for Symbian
+--------------
+
+ - general
+ * [QTBUG-20216] Update QtOpenGL section in Symbian platform notes
+ - examples
+ * [QTBUG-15176] Default heap/stack size might not be enough for symbian
+ - qmake & mkspecs
+ * [QTBUG-20669] Symbian: DEBUGGABLE_UDEBONLY keyword needed in
+ generated mmp files
+ * [QTBUG-20192] Qt sis can't be created on symbian^1 5.0 and
+ symbian^3 PS2 environments
+ * [QTBUG-18207] QMAKE_CLEAN items with wildcards in symbian-abld
+ builds will halt the build without obvious reason.
+ * [QTBUG-17927] Simplified Chinese language is not supported
+ in Qt 4.7.2
+ - openvg
+ * [QTBUG-20339] when camera application is opened and closed, the qml
+ application in the background is getting closed
+ * [QTBUG-18027] Lazy conversion in fromSymbianCFbsBitmap for openVG
+ - opengl
+ * [QTBUG-19183] Enable multisampling if there's hw support for it
+ on Symbian
+ * [QTBUG-19180] Simplify texture pooling in GL graphics system
+ * [QTBUG-18850] Fix orientation change. Current behaviour results to
+ black screen
+ * [QTBUG-15254] Implement QPixmap::fromSymbianRSgImage() in the
+ OpenGL graphics system
+ * [QTBUG-18209] Native image handle provider support in QGLPixmapData
+ * [QTBUG-18270] Use destroyed swap behaviour in GL graphics system
+ on Symbian
+ * [QTBUG-15252] Implement CFbsBitmap backend for QPixmap in OpenGL
+ graphics system on Symbian
+ * [QTBUG-17850] Implement GL graphics system releaseCachedResources()
+ * [QTBUG-15253] Verify that applications using the OpenGL graphics
+ system on Symbian consume zero graphics memory when they are
+ not visible
+ * [QTBUG-16977] Symbian: Implement QPixmap::fromSymbianCFbsBitmap() in
+ the OpenGL graphics system
+ * [QTBUG-16949] Symbian: Recreate EGL surface on native window resize
+ - gui
+ * [QTBUG-20255] Regression: Some QMenus are shown completely transparent
+ in Symbian
+ * [QTBUG-20240] Regression: QS60Style - All standardIcons are drawn as
+ "small icons"
+ * [QTBUG-20813] Disabled splitscreen translation still moves screen
+ * [QTBUG-20034] Splitview - Auto-translation should translate as
+ little as possible to ensure visibility of the cursor
+ * [QTBUG-20007] Symbian: Do not add linked fonts to the QFontDatabase
+ * [QTBUG-19911] Orientation change causes unnecessary resizes to top
+ level window on Symbian
+ * [QTBUG-19880] Drawing a QPixmap to QImage causes a deep copy on
+ Symbian
+ * [QTBUG-19864] Predicted word is duplicated when doing an orientation
+ switch
+ * [QTBUG-19856] Doing an orientation change while in splitview mode
+ and closing VKB causes QGraphicsView to be incorrectly resized
+ * [QTBUG-19782] UI of the QWidget based applications those uses
+ QGroupBoxs are mess up in latest Symbian RND release
+ * [QTBUG-19734] KERN-EXEC 3 panic in
+ QCoeFepInputContext::translateInputWidget() method
+ * [QTBUG-19689] Textinput: last word inputted was duplicated after
+ press "Password" button
+ * [QTBUG-19578] Fix BCM2727 detection function on Symbian
+ * [QTBUG-19528] Opening symbol menu while typing with prediction on
+ causes issues
+ * [QTBUG-19471] Using QFileDialog crashes in Symbian
+ * [QTBUG-19104] while setting a softkey action in a qt application
+ on symbian, the icon specified only is shown partially
+ * [QTBUG-19043] Fullscreen main window with softkeys initially layouts
+ using full screen dimensions instead of client area dimensions
+ * [QTBUG-18863] QS60Style: compiling simulated style crashes due to
+ missing placeHolderTexture implementation
+ * [QTBUG-18493] Qt reserves graphics resources when launching application
+ directly to background
+ * [QTBUG-18486] Control pane (RSK Cancel) of the test note is covered by
+ "Options, Exit" when re-launching the application from Open applications
+ list
+ * [QTBUG-18409] If fullscreen application without softkeys opens a
+ fullscreen child dialog with softkeys, once the child dialog closes,
+ softkeys remain visible on applicaiton main screen.
+ * [QTBUG-17874] autotest failure between Qt 4.6.3 and Qt 4.7.2 in
+ QLinearGradient::setStops method on Symbian^3 platform
+ * [QTBUG-17844] Different point size for the font created using QFont
+ class and returned by QFontDialog
+ * [QTBUG-16857] Black corners around popup menu in Symbian^3
+ * [QTBUG-16785] QML app: After layout switch the focused text input field
+ is not visible on Split view
+ * [QTBUG-15031] Predictive text is not committed when writing in a QLineEdit
+ * [QTBUG-14058] Wrong availableGeometry detected in Symbian
+ * [QTBUG-17576] GraphicsViews: Focused widget is not visible after
+ orientation change
+ * [QTBUG-17930] Regression: Theme background in style is incorrect
+ * [QTBUG-18024] Don't use EGL surfaces for translucency with 32MB GPU chip
+ * [QTBUG-17984] QML application: focused text input field is not visible
+ when split view is opened
+ - declarative
+ * [QTBUG-20218] Symbian 5.3: QML text edit components are sending
+ software input panel requests
+ * [QTBUG-19821] Flickr: There is gridding on picture
+ * [QTBUG-19669] All events that QDeclarativeDebugTrace shows on
+ Symbian are of duration '0'
+ * [QTBUG-18869] Compilation breakage for Symbian (qmltooling)
+ * [QTBUG-18549] Animation timer seems to take too long time to expire
+ during scrolling a qml list in Symbian device.
+ * [QTBUG-17592] qml.pri causes havoc on Symbian 3.2 and 5.0
+ - network
+ * [QTBUG-18795] QNetworkConfigurationManager::allConfigurations
+ (QNetworkConfiguration::Active) not returning any active configuration
+ when instantiated and called from Secondary thread
+ * [QTBUG-18722] QDesktopServices::openUrl() doesn't handle URL encodings
+ correctly
+ * [QTBUG-18572] Crash with KERN-EXEC 0 when
+ QNetworkConfigurationManagerPrivate fails to connect
+ - corelib
+ * [QTBUG-17776] Qmlviewer: qmlviewer will crash after closing the
+ application "flickr demo"
+
****************************************************************************
* Tools *
****************************************************************************
+ - [QTBUG-18595] Enable remote debugging for qmlviewer
+ - [QTBUG-18063] qdoc3 depends on private header files from QML
+ - [QTBUG-16462] qdoc3 segfaults due to a uninitialized member variable
+ when using the WebXML output.
diff --git a/doc/src/declarative/declarativeui.qdoc b/doc/src/declarative/declarativeui.qdoc
index cecccf6..d89ca53 100644
--- a/doc/src/declarative/declarativeui.qdoc
+++ b/doc/src/declarative/declarativeui.qdoc
@@ -46,7 +46,7 @@ Qt applications.
\section1 Getting Started
\list
-\o \l{Introduction to Qt Quick}
+\o \l{Intro to Qt Quick}{Introduction to Qt Quick}
\o \l{QML for Qt Programmers}{QML Programming for Qt Programmers}
\o \l{Getting Started Programming with QML}
diff --git a/doc/src/declarative/qtquick-intro.qdoc b/doc/src/declarative/qtquick-intro.qdoc
index 4cd5db3..bdad2c3 100644
--- a/doc/src/declarative/qtquick-intro.qdoc
+++ b/doc/src/declarative/qtquick-intro.qdoc
@@ -27,7 +27,7 @@
/*!
\page qml-intro.html
-\title Introduction to Qt Quick
+\title Intro to Qt Quick
Qt Quick is a collection of technologies that are designed to help developers
create the kind of intuitive, modern, and fluid user interfaces that are
diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc
index af418e0..2490374 100644
--- a/doc/src/index.qdoc
+++ b/doc/src/index.qdoc
@@ -38,7 +38,9 @@
\list
\o \l{Qt Features Overview}
\o \l{How to Learn Qt}
- \o \l{Introduction to Qt Quick}
+ \o \l{Introduction to Qt Quick}{Qt Quick}
+ \o \l{Qt Whitepaper}{Qt C++ Framework}
+ \o \l{Intro to Qt Quick}{Qt Quick}
\o \l{external: Qt Mobility Manual}{Qt Mobility}
\o \l{Qt WebKit}
\endlist
diff --git a/doc/src/platforms/supported-platforms.qdoc b/doc/src/platforms/supported-platforms.qdoc
index ba59c37..9d47695 100644
--- a/doc/src/platforms/supported-platforms.qdoc
+++ b/doc/src/platforms/supported-platforms.qdoc
@@ -334,8 +334,8 @@
\section2 Advanced Text Layout Engine
- Qt for Windows CE supports TrueType and raster fonts. Qt also has
- extended Unicode support and right-to-left languages. Qt's rich text
+ Qt for Windows CE supports TrueType® and raster fonts. Qt also has
+ extended Unicode support and right-to-left languages. Qt’s rich text
engine adds capabilities for complex text layouts including tables,
path tracing and text which flows around shapes.
@@ -373,7 +373,7 @@
by embedded Linux. You can use Qt to create highly memory efficient
devices and applications that have completely unique user experiences.
- Qt runs anywhere Linux runs. Qt's intuitive API means fewer lines of
+ Qt runs anywhere Linux runs. Qt’s intuitive API means fewer lines of
code and higher level functionality in less time. Use the code from
one single code-base and rebuild for all \l{Supported Platforms}
{supported platforms}.
@@ -410,7 +410,7 @@
frame buffer} that will match the physical device display, pixel for
pixel. This gives the developer a realistic testing infrastructure
testing on the desktop where the frame buffer simulates the physical
- device display's width, height and color depth.
+ device display’s width, height and color depth.
\section2 Inter-Process Communication (IPC)
@@ -421,7 +421,7 @@
\section2 Extended Font Format
Qt supports a wide range of font formats on embedded Linux including:
- TrueType, Postscript Type1 and Qt pre-rendered fonts. Qt has
+ TrueType®, Postscript® Type1 and Qt pre-rendered fonts. Qt has
extended Unicode support including automatic data extraction at build
time and automatic update at runtime.
@@ -681,7 +681,7 @@
\group platform-details
Qt is a cross-platform application and UI framework. Using Qt,
- you can write GUI applications once and deploy them
+ you can write web-enabled applications once and deploy them
across desktop, mobile and embedded operating systems without
rewriting the source code.
diff --git a/doc/src/qt-features.qdoc b/doc/src/qt-features.qdoc
deleted file mode 100644
index 0ae00b0..0000000
--- a/doc/src/qt-features.qdoc
+++ /dev/null
@@ -1,204 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** GNU Free Documentation License
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms
-** and conditions contained in a signed written agreement between you
-** and Nokia.
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \page qt-overview.html
- \title Qt Features Overview
-
- This document provides a summary of the most important features of Qt,
- providing links to other pages in the documentation that cover these
- features in more detail. It is not intended to be a comprehensive
- guide to Qt's features.
-
- \section1 Fundamental Technologies in Qt
-
- Qt is built upon a set of core technologies, provided by the \l QtCore
- and \l QtGui modules. These include the following:
-
- \list
- \o \l{The Tulip Container Classes}, a set of template container classes.
- \o \l{The Arthur Paint System}, the Qt 4 painting framework.
- \o \l{The Interview Framework}, a model/view architecture for item views
- and the \l{QtSQL Module}, which also uses this architecture.
- \o \l{The Scribe Classes}, a framework for creating text documents,
- performing low-level text layout and writing OpenDocument files.
- \o A collection of \l{Qt Widget Gallery}{common desktop widgets}, styled
- to fit in on each supported platform.
- \o \l{The Qt 4 Main Window Classes}, a main window, toolbar, menu, and
- docking architecture.
- \o The \l{Graphics View} framework provides a canvas for producing
- interactive graphics.
- \o The \l{QtNetwork Module} provides support for TCP, UDP and local
- sockets that are integrated with Qt's event model, including support
- for Secure Socket Layer (SSL) communications,
- \l{QNetworkProxy}{network proxy} servers and
- \l{Bearer Management}{network bearer management}.
- \o Enhanced \l{qt4-threads.html}{thread support} allows
- \l{Signals & Slots}{signal-slot} connections across threads and
- per-thread event loops.
- Additionally, \l{Thread Support in Qt}{a framework for concurrent programming}
- using Qt paradigms makes common threading tasks easier.
- \o A \l{resource system} for embedding images and other resource files
- into executable files makes it easier to deploy applications.
- \o A \l{QTestLib Manual}{unit testing framework} for Qt applications and
- libraries.
- \endlist
-
- The mature classes provided by these technologies have been used to build
- robust, cross-platform desktop applications. They are augmented by a number
- of additional technologies and improvements that have appeared over the
- lifetime of Qt 4.
-
- \section1 Graphical User Interfaces
-
- \div{class="float-right"}
- \inlineimage gtk-tabwidget.png
- \enddiv
- \div{class="float-right"}
- \inlineimage gtk-progressbar.png
- \br
- \inlineimage gtk-checkbox.png
- \br
- \inlineimage plastique-combobox.png
- \br
- \inlineimage plastique-radiobutton.png
- \enddiv
-
- Alongside the support for traditional desktop user interfaces, Qt includes
- support for declarative UI development with \l{Qt Quick}, a set of
- technologies for creating fluid, dynamic user interfaces. A starting point
- for exploring this approach can be found in the \l{Introduction to Qt Quick}
- guide.
-
- Qt provides a range of standard user interface elements, called widgets,
- for each supported platform. Widgets can be used as containers for other
- widgets, as windows, and as regular controls that the user interacts with.
- Where the platform supports it, widgets can be made to appear partially
- transparent, and may be styled with \l{Qt Style Sheets}.
-
- Support for \l{QTouchEvent}{touch input} and \l{Gestures Programming}{gestures}
- enable widgets to be used to create intuitive user interfaces for
- touch-enabled devices.
-
- User interfaces can also be created dynamically at run-time with the
- features provided by the \l{QtUiTools} module.
-
- A selection of available widgets are shown in the \l{Qt Widget Gallery}.
- An introduction to the concepts behind widgets can be found in the
- \l{Widgets Tutorial}.
-
- \clearfloat
- \section1 Painting, Printing and Rendering
-
- \div{class="float-left"}
- \inlineimage qpainter-affinetransformations.png
- \enddiv
-
- Widgets are just one of many kinds of paint device that Qt can render onto.
- This support for unified painting makes it possible for applications to use
- the same painting code for different tasks, as well as allowing Qt to be
- extended to support additional file formats.
-
- Qt provides support for common bitmap image formats,
- \l{QtSvg Module}{Scalable Vector Graphics} (SVG) drawings and animations,
- Postscript and Portable Document Format (PDF) files. Postscript and PDF are
- integrated with \l{Printing with Qt}{Qt's printing system}, which also
- allows printed output to be previewed.
-
- Interactive graphics can be created with the
- \l{The Animation Framework}{animation framework}, allowing animations to be
- used with both widgets and graphics items. Animations can be used with the
- \l{The State Machine Framework}{state machine framework}, which provides a
- way to express application logic and integrate it with the user interface.
- Animations can be enhanced with a collection of
- \l{QGraphicsEffect}{graphics effects} that operate on graphics items and
- can be applied individually or combined to create more complex effects.
-
- Qt supports integration with \l{QtOpenGL}{OpenGL} on a number of levels,
- providing convenience functions for handling textures and colors, as well
- as providing support for pixel and sample buffers. Future support for
- higher level 3D integration is provided by Qt3D enablers which include
- \l{QMatrix4x4}{matrix multiplication}, \l{QQuaternion}{quaternions}, and an
- API for \l{QGLShader}{vertex and fragment shaders}.
-
- Two APIs are provided for multimedia. The
- \l{Phonon Overview}{Phonon Multimedia Framework} has traditionally been
- used on desktop platforms. A set of
- \l{QtMultimedia Module}{multimedia services} provides low-level access to
- the system's audio system and is often used on mobile devices.
-
- \clearfloat
- \section1 Infrastructure
-
- \div{class="float-right"}
- \inlineimage qtscript-context2d.png
- \enddiv
-
- Facilities for Inter-Process Communication (IPC) and Remote Procedure
- Calling (RPC) mechanisms are available on platforms that support the
- \l{intro-to-dbus.html}{D-Bus} message bus system.
-
- An \l{Undo Framework}{Undo framework} based on the
- \l{Books about GUI Design#Design Patterns}{Command pattern} is designed to
- enable a consistent approach to handling data in editing applications.
-
- The \l{QtScript} and \l{QtScriptTools} modules provide support for
- application scripting and debugging using the ECMAScript language.
-
- The \l{QtHelp Module} provides the foundations of an interactive help
- system that can be used in conjunction with Qt Creator or integrated into
- applications directly.
-
- XML handling is supported in a number of places in Qt. The \l QtCore module
- provides classes for reading and writing XML streams. The \l QtXmlPatterns
- module includes XQuery, XPath and XSLT support, providing facilities for
- XML processing beyond that supported by the QtXml module, which contains
- SAX and DOM parsers. XML schema validation in the QtXmlPatterns module
- covers large parts of version 1.0 of the specification.
-
- \clearfloat
- \section1 Web Client Integration
-
- Integration between \l{Webkit in Qt}{Qt and WebKit} makes it possible for
- developers to use a fully-featured Web browser engine to display documents
- and access online services. Developers can access the browser's environment
- to create documents and run scripts within one or more browser widgets.
-
- A \l{QWebElement}{DOM access API} for QtWebKit provides a cleaner and safer
- way to access elements and structures of Web pages without the use of
- JavaScript.
-
- \section1 Further Reading
-
- Many of the technologies mentioned here, as well as other, more specific
- features, are listed in the \l{What's New in Qt 4} document. A complete
- list of Qt's modules can be found on the \l{All Modules} page, which
- also includes more domain-specific technologies.
-
- The tools that are supplied with Qt are covered by the listing in the
- \l{Qt's Tools} document.
-*/
diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc
index 01103a8..17dc1af 100644
--- a/doc/src/qt4-intro.qdoc
+++ b/doc/src/qt4-intro.qdoc
@@ -138,7 +138,7 @@
In Qt 4.4:
\list
- \o \l{WebKit in Qt}{Qt WebKit integration}, making it possible for developers
+ \o \l{Webkit in QT}{Qt WebKit integration}, making it possible for developers
to use a fully-featured Web browser to display documents and access online
services.
\o A multimedia API provided by the \l{Phonon Overview}{Phonon Multimedia Framework}.
@@ -707,6 +707,7 @@
introduced in Qt 4.7.
\sincelist 4.7
+
*/
/*!
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index f9196e0..c0c62e1 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -1633,9 +1633,13 @@ bool QDir::operator==(const QDir &dir) const
if (d->filters == other->filters
&& d->sort == other->sort
&& d->nameFilters == other->nameFilters) {
- d->resolveAbsoluteEntry();
- other->resolveAbsoluteEntry();
- return d->absoluteDirEntry.filePath().compare(other->absoluteDirEntry.filePath(), sensitive) == 0;
+
+ // Assume directories are the same if path is the same
+ if (d->dirEntry.filePath() == other->dirEntry.filePath())
+ return true;
+
+ // Fallback to expensive canonical path computation
+ return canonicalPath().compare(dir.canonicalPath(), sensitive) == 0;
}
return false;
}
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index ca42c87..ff328da 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -391,6 +391,11 @@ bool QFileInfo::operator==(const QFileInfo &fileinfo) const
return true;
if (d->isDefaultConstructed || fileinfo.d_ptr->isDefaultConstructed)
return false;
+
+ // Assume files are the same if path is the same
+ if (d->fileEntry.filePath() == fileinfo.d_ptr->fileEntry.filePath())
+ return true;
+
Qt::CaseSensitivity sensitive;
if (d->fileEngine == 0 || fileinfo.d_ptr->fileEngine == 0) {
if (d->fileEngine != fileinfo.d_ptr->fileEngine) // one is native, the other is a custom file-engine
@@ -406,6 +411,7 @@ bool QFileInfo::operator==(const QFileInfo &fileinfo) const
if (fileinfo.size() != size()) //if the size isn't the same...
return false;
+ // Fallback to expensive canonical path computation
return canonicalFilePath().compare(fileinfo.canonicalFilePath(), sensitive) == 0;
}
diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp
index f704fc3..764ee6d 100644
--- a/src/corelib/io/qfilesystemengine_win.cpp
+++ b/src/corelib/io/qfilesystemengine_win.cpp
@@ -536,7 +536,7 @@ QFileSystemEntry QFileSystemEngine::absoluteName(const QFileSystemEntry &entry)
// Force uppercase drive letters.
ret[0] = ret.at(0).toUpper();
}
- return QFileSystemEntry(ret);
+ return QFileSystemEntry(ret, QFileSystemEntry::FromInternalPath());
}
//static
@@ -1052,11 +1052,12 @@ QString QFileSystemEngine::tempPath()
}
if (ret.isEmpty()) {
#if !defined(Q_OS_WINCE)
- ret = QLatin1String("c:/tmp");
+ ret = QLatin1String("C:/tmp");
#else
ret = QLatin1String("/Temp");
#endif
- }
+ } else if (ret.length() >= 2 && ret[1] == QLatin1Char(':'))
+ ret[0] = ret.at(0).toUpper(); // Force uppercase drive letters.
return ret;
}
diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp
index d457601..e80a8b6 100644
--- a/src/corelib/io/qtemporaryfile.cpp
+++ b/src/corelib/io/qtemporaryfile.cpp
@@ -44,17 +44,18 @@
#ifndef QT_NO_TEMPORARYFILE
#include "qplatformdefs.h"
-#include "qabstractfileengine.h"
#include "private/qfile_p.h"
-#include "private/qabstractfileengine_p.h"
#include "private/qfsfileengine_p.h"
+#include "private/qsystemerror_p.h"
+#include "private/qfilesystemengine_p.h"
-#if !defined(Q_OS_WINCE)
-# include <errno.h>
+#if defined(Q_OS_SYMBIAN)
+#include "private/qcore_symbian_p.h"
#endif
-#if defined(Q_OS_UNIX)
-# include "private/qcore_unix_p.h" // overrides QT_OPEN
+#if !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN)
+#include "private/qcore_unix_p.h" // overrides QT_OPEN
+#include <errno.h>
#endif
#if defined(QT_BUILD_CORE_LIB)
@@ -63,6 +64,30 @@
QT_BEGIN_NAMESPACE
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+typedef ushort Char;
+
+static inline Char Latin1Char(char ch)
+{
+ return ushort(uchar(ch));
+}
+
+# ifdef Q_OS_WIN
+typedef HANDLE NativeFileHandle;
+# else // Q_OS_SYMBIAN
+# ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
+typedef RFile64 NativeFileHandle;
+# else
+typedef RFile NativeFileHandle;
+# endif
+# endif
+
+#else // POSIX
+typedef char Char;
+typedef char Latin1Char;
+typedef int NativeFileHandle;
+#endif
+
/*
* Copyright (c) 1987, 1993
* The Regents of the University of California. All rights reserved.
@@ -96,27 +121,33 @@ QT_BEGIN_NAMESPACE
\internal
Generates a unique file path and returns a native handle to the open file.
- \a path is used as a template when generating unique paths,
- \a placeholderStart and \a placeholderEnd delimit the sub-string that will
- be randomized.
+ \a path is used as a template when generating unique paths, \a pos
+ identifies the position of the first character that will be replaced in the
+ template and \a length the number of characters that may be substituted.
Returns an open handle to the newly created file if successful, an invalid
handle otherwise. In both cases, the string in \a path will be changed and
contain the generated path name.
*/
-static int createFileFromTemplate(char *const path,
- char *const placeholderStart, char *const placeholderEnd)
+static bool createFileFromTemplate(NativeFileHandle &file,
+ QFileSystemEntry::NativePath &path, size_t pos, size_t length,
+ QSystemError &error)
{
- Q_ASSERT(placeholderEnd > placeholderStart);
+ Q_ASSERT(length != 0);
+ Q_ASSERT(pos < size_t(path.length()));
+ Q_ASSERT(length <= size_t(path.length()) - pos);
+
+ Char *const placeholderStart = (Char *)path.data() + pos;
+ Char *const placeholderEnd = placeholderStart + length;
// Initialize placeholder with random chars + PID.
{
- char *rIter = placeholderEnd;
+ Char *rIter = placeholderEnd;
#if defined(QT_BUILD_CORE_LIB)
quint64 pid = quint64(QCoreApplication::applicationPid());
do {
- *--rIter = (pid % 10) + '0';
+ *--rIter = Latin1Char((pid % 10) + '0');
pid /= 10;
} while (rIter != placeholderStart && pid != 0);
#endif
@@ -124,48 +155,82 @@ static int createFileFromTemplate(char *const path,
while (rIter != placeholderStart) {
char ch = char((qrand() & 0xffff) % (26 + 26));
if (ch < 26)
- *--rIter = ch + 'A';
+ *--rIter = Latin1Char(ch + 'A');
else
- *--rIter = ch - 26 + 'a';
+ *--rIter = Latin1Char(ch - 26 + 'a');
}
}
+#ifdef Q_OS_SYMBIAN
+ RFs& fs = qt_s60GetRFs();
+#endif
+
for (;;) {
// Atomically create file and obtain handle
-#ifndef Q_OS_WIN
- {
- int fd = QT_OPEN(path, QT_OPEN_CREAT | O_EXCL | QT_OPEN_RDWR | QT_OPEN_LARGEFILE, 0600);
- if (fd != -1)
- return fd;
- if (errno != EEXIST)
- return -1;
+#if defined(Q_OS_WIN)
+ file = CreateFile((const wchar_t *)path.constData(),
+ GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_NEW,
+ FILE_ATTRIBUTE_NORMAL, NULL);
+
+ if (file != INVALID_HANDLE_VALUE)
+ return true;
+
+ DWORD err = GetLastError();
+ if (err != ERROR_FILE_EXISTS) {
+ error = QSystemError(err, QSystemError::NativeError);
+ return false;
+ }
+#elif defined(Q_OS_SYMBIAN)
+ TInt err = file.Create(fs, qt_QString2TPtrC(path),
+ EFileRead | EFileWrite | EFileShareReadersOrWriters);
+
+ if (err == KErrNone)
+ return true;
+
+ if (err != KErrAlreadyExists) {
+ error = QSystemError(err, QSystemError::NativeError);
+ return false;
+ }
+#else // POSIX
+ file = QT_OPEN(path.constData(),
+ QT_OPEN_CREAT | O_EXCL | QT_OPEN_RDWR | QT_OPEN_LARGEFILE,
+ 0600);
+
+ if (file != -1)
+ return true;
+
+ int err = errno;
+ if (err != EEXIST) {
+ error = QSystemError(err, QSystemError::NativeError);
+ return false;
}
-#else
- if (!QFileInfo(QString::fromLocal8Bit(path)).exists())
- return 1;
#endif
/* tricky little algorwwithm for backward compatibility */
- for (char *iter = placeholderStart;;) {
+ for (Char *iter = placeholderStart;;) {
// Character progression: [0-9] => 'a' ... 'z' => 'A' .. 'Z'
// String progression: "ZZaiC" => "aabiC"
- switch (*iter) {
+ switch (char(*iter)) {
case 'Z':
// Rollover, advance next character
- *iter = 'a';
- if (++iter == placeholderEnd)
- return -1;
+ *iter = Latin1Char('a');
+ if (++iter == placeholderEnd) {
+ // Out of alternatives. Return file exists error, previously set.
+ error = QSystemError(err, QSystemError::NativeError);
+ return false;
+ }
continue;
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
- *iter = 'a';
+ *iter = Latin1Char('a');
break;
case 'z':
// increment 'z' to 'A'
- *iter = 'A';
+ *iter = Latin1Char('A');
break;
default:
@@ -257,7 +322,7 @@ bool QTemporaryFileEngine::open(QIODevice::OpenMode openMode)
QString qfilename = d->fileEntry.filePath();
- // Find placeholder string.
+ // Ensure there is a placeholder mask
uint phPos = qfilename.length();
uint phLength = 0;
@@ -269,70 +334,73 @@ bool QTemporaryFileEngine::open(QIODevice::OpenMode openMode)
continue;
}
- if (qfilename[phPos] == QLatin1Char('/')
- || phLength >= 6) {
+ if (phLength >= 6
+ || qfilename[phPos] == QLatin1Char('/')) {
++phPos;
break;
}
+ // start over
phLength = 0;
}
- QStringRef prefix, suffix;
- if (phLength < 6) {
- qfilename += QLatin1Char('.');
- prefix = QStringRef(&qfilename);
- phLength = 6;
- } else {
- prefix = qfilename.leftRef(phPos);
- suffix = qfilename.midRef(phPos + phLength);
- }
+ if (phLength < 6)
+ qfilename.append(QLatin1String(".XXXXXX"));
+
+ // "Nativify" :-)
+ QFileSystemEntry::NativePath filename = QFileSystemEngine::absoluteName(
+ QFileSystemEntry(qfilename, QFileSystemEntry::FromInternalPath()))
+ .nativeFilePath();
- QByteArray filename = prefix.toLocal8Bit();
+ // Find mask in native path
phPos = filename.length();
- if (suffix.isEmpty())
- filename.resize(phPos + phLength);
- else
- filename.insert(phPos + phLength, suffix.toLocal8Bit());
-
- char *path = filename.data();
-
-#ifndef Q_OS_WIN
- int fd = createFileFromTemplate(path, path + phPos, path + phPos + phLength);
- if (fd != -1) {
- // First open the fd as an external file descriptor to
- // initialize the engine properly.
- if (QFSFileEngine::open(openMode, fd)) {
-
- // Allow the engine to close the handle even if it's "external".
- d->closeFileHandle = true;
-
- // Restore the file names (open() resets them).
- d->fileEntry = QFileSystemEntry(QString::fromLocal8Bit(path, filename.length())); //note that filename is NOT a native path
- filePathIsTemplate = false;
- return true;
+ phLength = 0;
+ while (phPos != 0) {
+ --phPos;
+
+ if (filename[phPos] == Latin1Char('X')) {
+ ++phLength;
+ continue;
}
- QT_CLOSE(fd);
- }
- setError(errno == EMFILE ? QFile::ResourceError : QFile::OpenError, qt_error_string(errno));
- return false;
-#else
- if (createFileFromTemplate(path, path + phPos, path + phPos + phLength) == -1) {
- return false;
+ if (phLength >= 6) {
+ ++phPos;
+ break;
+ }
+
+ // start over
+ phLength = 0;
}
- QString template_ = d->fileEntry.filePath();
- d->fileEntry = QFileSystemEntry(QString::fromLocal8Bit(path, filename.length()));
+ Q_ASSERT(phLength >= 6);
- if (QFSFileEngine::open(openMode)) {
- filePathIsTemplate = false;
- return true;
+ QSystemError error;
+#if defined(Q_OS_WIN)
+ NativeFileHandle &file = d->fileHandle;
+#elif defined(Q_OS_SYMBIAN)
+ NativeFileHandle &file = d->symbianFile;
+#else // POSIX
+ NativeFileHandle &file = d->fd;
+#endif
+
+ if (!createFileFromTemplate(file, filename, phPos, phLength, error)) {
+ setError(QFile::OpenError, error.toString());
+ return false;
}
- d->fileEntry = QFileSystemEntry(template_, QFileSystemEntry::FromInternalPath());
- return false;
+ d->fileEntry = QFileSystemEntry(filename, QFileSystemEntry::FromNativePath());
+
+#if !defined(Q_OS_WIN)
+ d->closeFileHandle = true;
#endif
+
+ filePathIsTemplate = false;
+
+ d->openMode = openMode;
+ d->lastFlushFailed = false;
+ d->tried_stat = 0;
+
+ return true;
}
bool QTemporaryFileEngine::remove()
diff --git a/src/corelib/tools/qline.cpp b/src/corelib/tools/qline.cpp
index 0f67652..af3b7d5 100644
--- a/src/corelib/tools/qline.cpp
+++ b/src/corelib/tools/qline.cpp
@@ -564,9 +564,8 @@ qreal QLineF::length() const
Returns the angle of the line in degrees.
- The return value will be in the range of values from 0.0 up to but not
- including 360.0. The angles are measured counter-clockwise from a point
- on the x-axis to the right of the origin (x > 0).
+ Positive values for the angles mean counter-clockwise while negative values
+ mean the clockwise direction. Zero degrees is at the 3 o'clock position.
\sa setAngle()
*/
diff --git a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
index b1ebec8..8787a5e 100644
--- a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
@@ -114,7 +114,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmlproperty bool AnimatedImage::cache
- \since QtQuick 1.1
+ \since Quick 1.1
Specifies whether the image should be cached. The default value is
true. Setting \a cache to false is useful when dealing with large images,
@@ -123,7 +123,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmlproperty bool AnimatedImage::mirror
- \since QtQuick 1.1
+ \since Quick 1.1
This property holds whether the image should be horizontally inverted
(effectively displaying a mirrored image).
diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
index 4b4efb6..9c274e9 100644
--- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
@@ -215,7 +215,7 @@ QDeclarativeBorderImage::~QDeclarativeBorderImage()
/*!
\qmlproperty bool BorderImage::cache
- \since QtQuick 1.1
+ \since Quick 1.1
Specifies whether the image should be cached. The default value is
true. Setting \a cache to false is useful when dealing with large images,
@@ -224,7 +224,7 @@ QDeclarativeBorderImage::~QDeclarativeBorderImage()
/*!
\qmlproperty bool BorderImage::mirror
- \since QtQuick 1.1
+ \since Quick 1.1
This property holds whether the image should be horizontally inverted
(effectively displaying a mirrored image).
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index fd2dc45..d5c58df 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -1399,7 +1399,7 @@ void QDeclarativeFlickable::setContentHeight(qreal h)
/*!
\qmlmethod Flickable::resizeContent(real width, real height, QPointF center)
\preliminary
- \since QtQuick 1.1
+ \since Quick 1.1
Resizes the content to \a width x \a height about \a center.
@@ -1439,7 +1439,7 @@ void QDeclarativeFlickable::resizeContent(qreal w, qreal h, QPointF center)
/*!
\qmlmethod Flickable::returnToBounds()
\preliminary
- \since QtQuick 1.1
+ \since Quick 1.1
Ensures the content is within legal bounds.
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index e53472d..23433d6 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -2618,7 +2618,7 @@ void QDeclarativeGridView::positionViewAtIndex(int index, int mode)
/*!
\qmlmethod GridView::positionViewAtBeginning()
\qmlmethod GridView::positionViewAtEnd()
- \since QtQuick 1.1
+ \since Quick 1.1
Positions the view at the beginning or end, taking into account any header or footer.
diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp
index 9b9d680..e6bb798 100644
--- a/src/declarative/graphicsitems/qdeclarativeimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp
@@ -473,7 +473,7 @@ QRectF QDeclarativeImage::boundingRect() const
/*!
\qmlproperty bool Image::cache
- \since QtQuick 1.1
+ \since Quick 1.1
Specifies whether the image should be cached. The default value is
true. Setting \a cache to false is useful when dealing with large images,
@@ -482,7 +482,7 @@ QRectF QDeclarativeImage::boundingRect() const
/*!
\qmlproperty bool Image::mirror
- \since QtQuick 1.1
+ \since Quick 1.1
This property holds whether the image should be horizontally inverted
(effectively displaying a mirrored image).
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index d36d163..805ca4d 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -3480,7 +3480,7 @@ qreal QDeclarativeItem::implicitHeight() const
/*!
\qmlproperty real Item::implicitWidth
\qmlproperty real Item::implicitHeight
- \since QtQuick 1.1
+ \since Quick 1.1
Defines the natural width or height of the Item if no \l width or \l height is specified.
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index f0fc96b..f29f778 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -3028,7 +3028,7 @@ void QDeclarativeListView::positionViewAtIndex(int index, int mode)
/*!
\qmlmethod ListView::positionViewAtBeginning()
\qmlmethod ListView::positionViewAtEnd()
- \since QtQuick 1.1
+ \since Quick 1.1
Positions the view at the beginning or end, taking into account any header or footer.
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
index 0e06a4c..18f008a 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
@@ -419,7 +419,7 @@ void QDeclarativeMouseArea::setEnabled(bool a)
/*!
\qmlproperty bool MouseArea::preventStealing
- \since QtQuick 1.1
+ \since Quick 1.1
This property holds whether the mouse events may be stolen from this
MouseArea.
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
index 483cad4..f3d1a68 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
@@ -584,7 +584,7 @@ QDeclarativeRow::QDeclarativeRow(QDeclarativeItem *parent)
/*!
\qmlproperty enumeration Row::layoutDirection
- \since QtQuick 1.1
+ \since Quick 1.1
This property holds the layoutDirection of the row.
@@ -878,7 +878,7 @@ void QDeclarativeGrid::setFlow(Flow flow)
/*!
\qmlproperty enumeration Grid::layoutDirection
- \since QtQuick 1.1
+ \since Quick 1.1
This property holds the layout direction of the layout.
@@ -1236,7 +1236,7 @@ void QDeclarativeFlow::setFlow(Flow flow)
/*!
\qmlproperty enumeration Flow::layoutDirection
- \since QtQuick 1.1
+ \since Quick 1.1
This property holds the layout direction of the layout.
diff --git a/src/declarative/graphicsitems/qdeclarativerepeater.cpp b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
index e881b96..813c255 100644
--- a/src/declarative/graphicsitems/qdeclarativerepeater.cpp
+++ b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
@@ -128,7 +128,7 @@ QDeclarativeRepeaterPrivate::~QDeclarativeRepeaterPrivate()
/*!
\qmlsignal Repeater::onItemAdded(int index, Item item)
- \since QtQuick 1.1
+ \since Quick 1.1
This handler is called when an item is added to the repeater. The \a index
parameter holds the index at which the item has been inserted within the
@@ -137,7 +137,7 @@ QDeclarativeRepeaterPrivate::~QDeclarativeRepeaterPrivate()
/*!
\qmlsignal Repeater::onItemRemoved(int index, Item item)
- \since QtQuick 1.1
+ \since Quick 1.1
This handler is called when an item is removed from the repeater. The \a index
parameter holds the index at which the item was removed from the repeater,
@@ -306,7 +306,7 @@ int QDeclarativeRepeater::count() const
/*!
\qmlmethod Item Repeater::itemAt(index)
- \since QtQuick 1.1
+ \since Quick 1.1
Returns the \l Item that has been created at the given \a index, or \c null
if no item exists at \a index.
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index 20e4eef..54ff406 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -1190,7 +1190,7 @@ void QDeclarativeText::setWrapMode(WrapMode mode)
/*!
\qmlproperty int Text::lineCount
- \since QtQuick 1.1
+ \since Quick 1.1
Returns the number of lines visible in the text item.
@@ -1206,7 +1206,7 @@ int QDeclarativeText::lineCount() const
/*!
\qmlproperty bool Text::truncated
- \since QtQuick 1.1
+ \since Quick 1.1
Returns true if the text has been truncated due to \l maximumLineCount
or \l elide.
@@ -1223,7 +1223,7 @@ bool QDeclarativeText::truncated() const
/*!
\qmlproperty int Text::maximumLineCount
- \since QtQuick 1.1
+ \since Quick 1.1
Set this property to limit the number of lines that the text item will show.
If elide is set to Text.ElideRight, the text will be elided appropriately.
@@ -1457,7 +1457,7 @@ qreal QDeclarativeText::paintedHeight() const
/*!
\qmlproperty real Text::lineHeight
- \since QtQuick 1.1
+ \since Quick 1.1
Sets the line height for the text.
The value can be in pixels or a multiplier depending on lineHeightMode.
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index ca7e948..0ea7ff3 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -107,7 +107,7 @@ TextEdit {
/*!
\qmlsignal TextEdit::onLinkActivated(string link)
- \since QtQuick 1.1
+ \since Quick 1.1
This handler is called when the user clicks on a link embedded in the text.
The link must be in rich text or HTML format and the
@@ -546,7 +546,15 @@ bool QDeclarativeTextEditPrivate::determineHorizontalAlignment()
{
Q_Q(QDeclarativeTextEdit);
if (hAlignImplicit && q->isComponentComplete()) {
- bool alignToRight = text.isEmpty() ? QApplication::keyboardInputDirection() == Qt::RightToLeft : rightToLeftText;
+ bool alignToRight;
+ if (text.isEmpty()) {
+ const QString preeditText = control->textCursor().block().layout()->preeditAreaText();
+ alignToRight = preeditText.isEmpty()
+ ? QApplication::keyboardInputDirection() == Qt::RightToLeft
+ : preeditText.isRightToLeft();
+ } else {
+ alignToRight = rightToLeftText;
+ }
return setHAlign(alignToRight ? QDeclarativeTextEdit::AlignRight : QDeclarativeTextEdit::AlignLeft);
}
return false;
@@ -615,7 +623,7 @@ void QDeclarativeTextEdit::setWrapMode(WrapMode mode)
/*!
\qmlproperty int TextEdit::lineCount
- \since QtQuick 1.1
+ \since Quick 1.1
Returns the total number of lines in the textEdit item.
*/
@@ -709,7 +717,7 @@ void QDeclarativeTextEdit::moveCursorSelection(int pos)
/*!
\qmlmethod void TextEdit::moveCursorSelection(int position, SelectionMode mode = TextEdit.SelectCharacters)
- \since QtQuick 1.1
+ \since Quick 1.1
Moves the cursor to \a position and updates the selection according to the optional \a mode
parameter. (To only move the cursor, set the \l cursorPosition property.)
@@ -1074,7 +1082,7 @@ void QDeclarativeTextEdit::setSelectByMouse(bool on)
/*!
\qmlproperty enum TextEdit::mouseSelectionMode
- \since QtQuick 1.1
+ \since Quick 1.1
Specifies how text should be selected using a mouse.
@@ -1220,7 +1228,7 @@ void QDeclarativeTextEditPrivate::focusChanged(bool hasFocus)
/*!
\qmlmethod void TextEdit::deselect()
- \since QtQuick 1.1
+ \since Quick 1.1
Removes active text selection.
*/
@@ -1581,6 +1589,7 @@ void QDeclarativeTextEdit::q_textChanged()
void QDeclarativeTextEdit::moveCursorDelegate()
{
Q_D(QDeclarativeTextEdit);
+ d->determineHorizontalAlignment();
updateMicroFocus();
emit cursorRectangleChanged();
if(!d->cursor)
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
index 412d33c..731d956 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
@@ -77,7 +77,7 @@ public:
yoff(0)
{
#ifdef Q_OS_SYMBIAN
- if (QSysInfo::symbianVersion() >= QSysInfo::SV_SF_1) {
+ if (QSysInfo::symbianVersion() == QSysInfo::SV_SF_1 || QSysInfo::symbianVersion() == QSysInfo::SV_SF_3) {
showInputPanelOnFocus = false;
}
#endif
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index 5245236..cc3f0b9 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -407,7 +407,11 @@ bool QDeclarativeTextInputPrivate::determineHorizontalAlignment()
if (hAlignImplicit) {
// if no explicit alignment has been set, follow the natural layout direction of the text
QString text = control->text();
- bool isRightToLeft = text.isEmpty() ? QApplication::keyboardInputDirection() == Qt::RightToLeft : text.isRightToLeft();
+ if (text.isEmpty())
+ text = control->preeditAreaText();
+ bool isRightToLeft = text.isEmpty()
+ ? QApplication::keyboardInputDirection() == Qt::RightToLeft
+ : text.isRightToLeft();
return setHAlign(isRightToLeft ? QDeclarativeTextInput::AlignRight : QDeclarativeTextInput::AlignLeft);
}
return false;
@@ -874,7 +878,8 @@ void QDeclarativeTextInputPrivate::updateInputMethodHints()
\o TextInput.Normal - Displays the text as it is. (Default)
\o TextInput.Password - Displays asterixes instead of characters.
\o TextInput.NoEcho - Displays nothing.
- \o TextInput.PasswordEchoOnEdit - Displays all but the current character as asterixes.
+ \o TextInput.PasswordEchoOnEdit - Displays characters as they are entered
+ while editing, otherwise displays asterisks.
\endlist
*/
QDeclarativeTextInput::EchoMode QDeclarativeTextInput::echoMode() const
@@ -1010,7 +1015,7 @@ int QDeclarativeTextInput::positionAt(int x) const
/*!
\qmlmethod int TextInput::positionAt(int x, CursorPosition position = CursorBetweenCharacters)
- \since QtQuick 1.1
+ \since Quick 1.1
This function returns the character position at
x pixels from the left of the textInput. Position 0 is before the
@@ -1398,7 +1403,7 @@ QVariant QDeclarativeTextInput::inputMethodQuery(Qt::InputMethodQuery property)
/*!
\qmlmethod void TextInput::deselect()
- \since QtQuick 1.1
+ \since Quick 1.1
Removes active text selection.
*/
@@ -1570,7 +1575,7 @@ void QDeclarativeTextInput::setSelectByMouse(bool on)
/*!
\qmlproperty enum TextInput::mouseSelectionMode
- \since QtQuick 1.1
+ \since Quick 1.1
Specifies how text should be selected using a mouse.
@@ -1618,7 +1623,7 @@ void QDeclarativeTextInput::moveCursorSelection(int position)
/*!
\qmlmethod void TextInput::moveCursorSelection(int position, SelectionMode mode = TextInput.SelectCharacters)
- \since QtQuick 1.1
+ \since Quick 1.1
Moves the cursor to \a position and updates the selection according to the optional \a mode
parameter. (To only move the cursor, set the \l cursorPosition property.)
@@ -1906,6 +1911,7 @@ void QDeclarativeTextInput::cursorPosChanged()
void QDeclarativeTextInput::updateCursorRectangle()
{
Q_D(QDeclarativeTextInput);
+ d->determineHorizontalAlignment();
d->updateHorizontalScroll();
updateRect();//TODO: Only update rect between pos's
updateMicroFocus();
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
index 0325016..4712c65 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
@@ -80,7 +80,7 @@ public:
selectPressed(false)
{
#ifdef Q_OS_SYMBIAN
- if (QSysInfo::symbianVersion() >= QSysInfo::SV_SF_1) {
+ if (QSysInfo::symbianVersion() == QSysInfo::SV_SF_1 || QSysInfo::symbianVersion() == QSysInfo::SV_SF_3) {
showInputPanelOnFocus = false;
}
#endif
diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp
index 28c2df6..9604117 100644
--- a/src/declarative/util/qdeclarativelistmodel.cpp
+++ b/src/declarative/util/qdeclarativelistmodel.cpp
@@ -784,6 +784,7 @@ void QDeclarativeListModelParser::setCustomData(QObject *obj, const QByteArray &
QDeclarativeListModel *rv = static_cast<QDeclarativeListModel *>(obj);
ModelNode *root = new ModelNode(rv->m_nested);
+ rv->m_nested->m_ownsRoot = true;
rv->m_nested->_root = root;
QStack<ModelNode *> nodes;
nodes << root;
diff --git a/src/gui/accessible/qaccessible_unix.cpp b/src/gui/accessible/qaccessible_unix.cpp
index 19fbe78..1c1eb2a 100644
--- a/src/gui/accessible/qaccessible_unix.cpp
+++ b/src/gui/accessible/qaccessible_unix.cpp
@@ -96,7 +96,7 @@ void QAccessible::updateAccessibility(QObject *o, int who, Event reason)
}
initialize();
- if (bridges()->isEmpty())
+ if (!bridges() || bridges()->isEmpty())
return;
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(o);
diff --git a/src/gui/image/qpixmap_mac.cpp b/src/gui/image/qpixmap_mac.cpp
index bdf1f90..47b6eef 100644
--- a/src/gui/image/qpixmap_mac.cpp
+++ b/src/gui/image/qpixmap_mac.cpp
@@ -851,7 +851,33 @@ static void qt_mac_grabDisplayRect(CGDirectDisplayID display, const QRect &displ
ptrCGLDestroyContext(glContextObj); // and destroy the context
}
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
// Returns a pixmap containing the screen contents at rect.
+static QPixmap qt_mac_grabScreenRect_10_6(const QRect &rect)
+{
+ const int maxDisplays = 128; // 128 displays should be enough for everyone.
+ CGDirectDisplayID displays[maxDisplays];
+ CGDisplayCount displayCount;
+ const CGRect cgRect = CGRectMake(rect.x(), rect.y(), rect.width(), rect.height());
+ const CGDisplayErr err = CGGetDisplaysWithRect(cgRect, maxDisplays, displays, &displayCount);
+
+ if (err && displayCount == 0)
+ return QPixmap();
+ QPixmap windowPixmap(rect.size());
+ for (uint i = 0; i < displayCount; ++i) {
+ const CGRect bounds = CGDisplayBounds(displays[i]);
+ // Translate to display-local coordinates
+ QRect displayRect = rect.translated(qRound(-bounds.origin.x), qRound(-bounds.origin.y));
+ QCFType<CGImageRef> image = CGDisplayCreateImageForRect(displays[i],
+ CGRectMake(displayRect.x(), displayRect.y(), displayRect.width(), displayRect.height()));
+ QPixmap pix = QPixmap::fromMacCGImageRef(image);
+ QPainter painter(&windowPixmap);
+ painter.drawPixmap(-bounds.origin.x, -bounds.origin.y, pix);
+ }
+ return windowPixmap;
+}
+#endif
+
static QPixmap qt_mac_grabScreenRect(const QRect &rect)
{
if (!resolveOpenGLSymbols())
@@ -927,7 +953,12 @@ QPixmap QPixmap::grabWindow(WId window, int x, int y, int w, int h)
QRect rect(globalCoord.x() + x, globalCoord.y() + y, w, h);
#ifdef QT_MAC_USE_COCOA
- return qt_mac_grabScreenRect(rect);
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
+ if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_6)
+ return qt_mac_grabScreenRect_10_6(rect);
+ else
+#endif
+ return qt_mac_grabScreenRect(rect);
#else
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_4) {
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index 899b792..5ddd53f 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -64,8 +64,6 @@
#define QT_EAknCursorPositionChanged MAknEdStateObserver::EAknEdwinStateEvent(6)
// MAknEdStateObserver::EAknActivatePenInputRequest
#define QT_EAknActivatePenInputRequest MAknEdStateObserver::EAknEdwinStateEvent(7)
-// MAknEdStateObserver::EAknClosePenInputRequest
-#define QT_EAknClosePenInputRequest MAknEdStateObserver::EAknEdwinStateEvent(10)
// EAknEditorFlagSelectionVisible is only valid from 3.2 onwards.
// Sym^3 AVKON FEP manager expects that this flag is used for FEP-aware editors
@@ -254,6 +252,9 @@ bool QCoeFepInputContext::needsInputPanel()
bool QCoeFepInputContext::filterEvent(const QEvent *event)
{
+ // The CloseSoftwareInputPanel event is not handled here, because the VK will automatically
+ // close when it discovers that the underlying widget does not have input capabilities.
+
if (!focusWidget())
return false;
@@ -317,12 +318,6 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event)
if (!needsInputPanel())
return false;
- if ((event->type() == QEvent::CloseSoftwareInputPanel)
- && (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0)) {
- m_fepState->ReportAknEdStateEventL(QT_EAknClosePenInputRequest);
- return false;
- }
-
if (event->type() == QEvent::RequestSoftwareInputPanel) {
// Only request virtual keyboard if it is not yet active or if this is the first time
// panel is requested for this application.
@@ -479,7 +474,7 @@ void QCoeFepInputContext::resetSplitViewWidget(bool keepInputWidget)
if (!alwaysResize) {
if (gv->scene()) {
- if (gv->scene()->focusItem() && S60->partial_keyboardAutoTranslation) {
+ if (gv->scene()->focusItem()) {
// Check if the widget contains cursorPositionChanged signal and disconnect from it.
QByteArray signal = QMetaObject::normalizedSignature(SIGNAL(cursorPositionChanged()));
int index = gv->scene()->focusItem()->toGraphicsObject()->metaObject()->indexOfSignal(signal.right(signal.length() - 1));
@@ -585,7 +580,7 @@ void QCoeFepInputContext::ensureFocusWidgetVisible(QWidget *widget)
if (!moveWithinVisibleArea) {
// Check if the widget contains cursorPositionChanged signal and connect to it.
QByteArray signal = QMetaObject::normalizedSignature(SIGNAL(cursorPositionChanged()));
- if (gv->scene() && gv->scene()->focusItem() && S60->partial_keyboardAutoTranslation) {
+ if (gv->scene() && gv->scene()->focusItem()) {
int index = gv->scene()->focusItem()->toGraphicsObject()->metaObject()->indexOfSignal(signal.right(signal.length() - 1));
if (index != -1)
connect(gv->scene()->focusItem()->toGraphicsObject(), SIGNAL(cursorPositionChanged()), this, SLOT(translateInputWidget()));
@@ -1085,18 +1080,7 @@ TInt QCoeFepInputContext::DocumentLengthForFep() const
return 0;
QVariant variant = w->inputMethodQuery(Qt::ImSurroundingText);
-
- int size = variant.value<QString>().size() + m_preeditString.size();
-
- // To fix an issue with backspaces not being generated if document size is zero,
- // fake document length to be at least one always, except when dealing with
- // hidden text widgets, where this faking would generate extra asterisk. Since the
- // primary use of hidden text widgets is password fields, they are unlikely to
- // support multiple lines anyway.
- if (size == 0 && !(m_textCapabilities & TCoeInputCapabilities::ESecretText))
- size = 1;
-
- return size;
+ return variant.value<QString>().size() + m_preeditString.size();
}
TInt QCoeFepInputContext::DocumentMaximumLengthForFep() const
@@ -1179,12 +1163,6 @@ void QCoeFepInputContext::GetEditorContentForFep(TDes& aEditorContent, TInt aDoc
// FEP expects the preedit string to be part of the editor content, so let's mix it in.
int cursor = w->inputMethodQuery(Qt::ImCursorPosition).toInt();
text.insert(cursor, m_preeditString);
-
- // Add additional space to empty non-password text to compensate
- // for the fake length we specified in DocumentLengthForFep().
- if (text.size() == 0 && !(m_textCapabilities & TCoeInputCapabilities::ESecretText))
- text += QChar(0x20);
-
aEditorContent.Copy(qt_QString2TPtrC(text.mid(aDocumentPosition, aLengthToRetrieve)));
}
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 31246f4..da1c778 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -2760,9 +2760,6 @@ QS60ThreadLocalData::QS60ThreadLocalData()
QS60ThreadLocalData::~QS60ThreadLocalData()
{
- for (int i = 0; i < releaseFuncs.count(); ++i)
- releaseFuncs[i]();
- releaseFuncs.clear();
if (!usingCONEinstances) {
delete screenDevice;
wsSession.Close();
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index 5fc72d4..117b72f 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -933,7 +933,7 @@ QKeySequence::QKeySequence(const QString &key)
}
/*!
- \since 4.7
+ \since 4.x
Creates a key sequence from the \a key string based on \a format.
*/
QKeySequence::QKeySequence(const QString &key, QKeySequence::SequenceFormat format)
@@ -1130,7 +1130,7 @@ int QKeySequence::assign(const QString &ks)
/*!
\fn int QKeySequence::assign(const QString &keys, QKeySequence::SequenceFormat format)
- \since 4.7
+ \since 4.x
Adds the given \a keys to the key sequence (based on \a format).
\a keys may contain up to four key codes, provided they are
diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp
index 9caa37e..510705f 100644
--- a/src/gui/kernel/qsoftkeymanager.cpp
+++ b/src/gui/kernel/qsoftkeymanager.cpp
@@ -123,10 +123,8 @@ QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *act
default:
break;
};
- if (key != 0) {
+ if (key != 0)
QSoftKeyManager::instance()->d_func()->softKeyCommandActions.insert(action, key);
- connect(action, SIGNAL(destroyed(QObject*)), QSoftKeyManager::instance(), SLOT(cleanupHash(QObject*)));
- }
#endif
QAction::SoftKeyRole softKeyRole = QAction::NoSoftKey;
switch (standardKey) {
@@ -159,13 +157,7 @@ QAction *QSoftKeyManager::createKeyedAction(StandardSoftKey standardKey, Qt::Key
QScopedPointer<QAction> action(createAction(standardKey, actionWidget));
connect(action.data(), SIGNAL(triggered()), QSoftKeyManager::instance(), SLOT(sendKeyEvent()));
-
-#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) && !defined(SYMBIAN_VERSION_9_3) && !defined(SYMBIAN_VERSION_9_2)
- // Don't connect destroyed slot if is was already connected in createAction
- if (!(QSoftKeyManager::instance()->d_func()->softKeyCommandActions.contains(action.data())))
-#endif
connect(action.data(), SIGNAL(destroyed(QObject*)), QSoftKeyManager::instance(), SLOT(cleanupHash(QObject*)));
-
QSoftKeyManager::instance()->d_func()->keyedActions.insert(action.data(), key);
return action.take();
#endif //QT_NO_ACTION
@@ -174,9 +166,7 @@ QAction *QSoftKeyManager::createKeyedAction(StandardSoftKey standardKey, Qt::Key
void QSoftKeyManager::cleanupHash(QObject *obj)
{
Q_D(QSoftKeyManager);
- // Can't use qobject_cast in destroyed() signal handler as that'll return NULL,
- // so use static_cast instead. Since the pointer is only used as a hash key, it is safe.
- QAction *action = static_cast<QAction *>(obj);
+ QAction *action = qobject_cast<QAction*>(obj);
d->keyedActions.remove(action);
#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) && !defined(SYMBIAN_VERSION_9_3) && !defined(SYMBIAN_VERSION_9_2)
d->softKeyCommandActions.remove(action);
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index 3ec4052..ada52a0 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -97,10 +97,6 @@ static const int qt_symbian_max_screens = 4;
//this macro exists because EColor16MAP enum value doesn't exist in Symbian OS 9.2
#define Q_SYMBIAN_ECOLOR16MAP TDisplayMode(13)
-class QSymbianTypeFaceExtras;
-typedef QHash<QString, const QSymbianTypeFaceExtras *> QSymbianTypeFaceExtrasHash;
-typedef void (*QThreadLocalReleaseFunc)();
-
class Q_AUTOTEST_EXPORT QS60ThreadLocalData
{
public:
@@ -109,8 +105,6 @@ public:
bool usingCONEinstances;
RWsSession wsSession;
CWsScreenDevice *screenDevice;
- QSymbianTypeFaceExtrasHash fontData;
- QVector<QThreadLocalReleaseFunc> releaseFuncs;
};
class QS60Data
@@ -184,8 +178,6 @@ public:
inline CWsScreenDevice* screenDevice(const QWidget *widget);
inline CWsScreenDevice* screenDevice(int screenNumber);
static inline int screenNumberForWidget(const QWidget *widget);
- inline QSymbianTypeFaceExtrasHash& fontData();
- inline void addThreadLocalReleaseFunc(QThreadLocalReleaseFunc func);
static inline CCoeAppUi* appUi();
static inline CEikMenuBar* menuBar();
#ifdef Q_WS_S60
@@ -486,24 +478,6 @@ inline int QS60Data::screenNumberForWidget(const QWidget *widget)
return qt_widget_private(const_cast<QWidget *>(w))->symbianScreenNumber;
}
-inline QSymbianTypeFaceExtrasHash& QS60Data::fontData()
-{
- if (!tls.hasLocalData()) {
- tls.setLocalData(new QS60ThreadLocalData);
- }
- return tls.localData()->fontData;
-}
-
-inline void QS60Data::addThreadLocalReleaseFunc(QThreadLocalReleaseFunc func)
-{
- if (!tls.hasLocalData()) {
- tls.setLocalData(new QS60ThreadLocalData);
- }
- QS60ThreadLocalData *data = tls.localData();
- if (!data->releaseFuncs.contains(func))
- data->releaseFuncs.append(func);
-}
-
inline CCoeAppUi* QS60Data::appUi()
{
return CCoeEnv::Static()-> AppUi();
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 807f68e..256e34b 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -235,22 +235,11 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
QSize oldSize(q->size());
QRect oldGeom(data.crect);
- bool checkExtra = true;
- if (q->isWindow() && (data.window_state & (Qt::WindowFullScreen | Qt::WindowMaximized))) {
- // Do not allow fullscreen/maximized windows to expand beyond client rect
- TRect r = S60->clientRect();
- w = qMin(w, r.Width());
- h = qMin(h, r.Height());
-
- if (w == r.Width() && h == r.Height())
- checkExtra = false;
- }
-
// Lose maximized status if deliberate resize
if (w != oldSize.width() || h != oldSize.height())
data.window_state &= ~Qt::WindowMaximized;
- if (checkExtra && extra) { // any size restrictions?
+ if (extra) { // any size restrictions?
w = qMin(w,extra->maxw);
h = qMin(h,extra->maxh);
w = qMax(w,extra->minw);
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index 913352a..33619d6 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -91,6 +91,7 @@ enum TSupportRelease {
ES60_5_1 = 0x0008,
ES60_5_2 = 0x0010,
ES60_5_3 = 0x0020,
+ ES60_5_4 = 0x0040,
ES60_3_X = ES60_3_1 | ES60_3_2,
// Releases before Symbian Foundation
ES60_PreSF = ES60_3_1 | ES60_3_2 | ES60_5_0,
@@ -98,8 +99,10 @@ enum TSupportRelease {
ES60_Pre52 = ES60_3_1 | ES60_3_2 | ES60_5_0 | ES60_5_1,
// Releases before S60 5.3
ES60_Pre53 = ES60_3_1 | ES60_3_2 | ES60_5_0 | ES60_5_1 | ES60_5_2,
+ // Releases before S60 5.4
+ ES60_Pre54 = ES60_3_1 | ES60_3_2 | ES60_5_0 | ES60_5_1 | ES60_5_2 | ES60_5_3,
// Add all new releases here
- ES60_All = ES60_3_1 | ES60_3_2 | ES60_5_0 | ES60_5_1 | ES60_5_2 | ES60_5_3
+ ES60_All = ES60_3_1 | ES60_3_2 | ES60_5_0 | ES60_5_1 | ES60_5_2 | ES60_5_3 | ES60_5_4
};
typedef struct {
@@ -707,7 +710,7 @@ QPixmap QS60StyleModeSpecifics::colorSkinnedGraphicsLX(
colorIndex,
icon,
iconMask,
- AknIconUtils::AvkonIconFileName(),
+ (fallbackGraphicID != KErrNotFound ? AknIconUtils::AvkonIconFileName() : KNullDesC),
fallbackGraphicID,
fallbackGraphicsMaskID,
defaultColor);
@@ -922,7 +925,7 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsLX(
skinId,
icon,
iconMask,
- AknIconUtils::AvkonIconFileName(),
+ (fallbackGraphicID != KErrNotFound ? AknIconUtils::AvkonIconFileName() : KNullDesC),
fallbackGraphicID ,
fallbackGraphicsMaskID);
@@ -1016,7 +1019,7 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsLX(
KAknsIIDDefault, //animation is not themed, lets force fallback graphics
animationFrame,
frameMask,
- AknIconUtils::AvkonIconFileName(),
+ (fallbackGraphicID != KErrNotFound ? AknIconUtils::AvkonIconFileName() : KNullDesC),
fallbackGraphicID ,
fallbackGraphicsMaskID);
}
@@ -1228,7 +1231,8 @@ bool QS60StyleModeSpecifics::checkSupport(const int supportedRelease)
(currentRelease == QSysInfo::SV_S60_5_0 && supportedRelease & ES60_5_0) ||
(currentRelease == QSysInfo::SV_S60_5_1 && supportedRelease & ES60_5_1) ||
(currentRelease == QSysInfo::SV_S60_5_2 && supportedRelease & ES60_5_2) ||
- (currentRelease == QSysInfo::SV_S60_5_3 && supportedRelease & ES60_5_3) );
+ (currentRelease == QSysInfo::SV_S60_5_3 && supportedRelease & ES60_5_3) ||
+ (currentRelease == QSysInfo::SV_S60_5_4 && supportedRelease & ES60_5_4) );
}
TAknsItemID QS60StyleModeSpecifics::partSpecificThemeId(int part)
diff --git a/src/gui/styles/qwindowsstyle.cpp b/src/gui/styles/qwindowsstyle.cpp
index c099273..9732c7e 100644
--- a/src/gui/styles/qwindowsstyle.cpp
+++ b/src/gui/styles/qwindowsstyle.cpp
@@ -177,11 +177,14 @@ bool QWindowsStyle::eventFilter(QObject *o, QEvent *e)
// Alt has been pressed - find all widgets that care
QList<QWidget *> l = widget->findChildren<QWidget *>();
- for (int pos=0 ; pos < l.size() ; ++pos) {
+ for (int pos=0 ; pos < l.size() ;) {
QWidget *w = l.at(pos);
if (w->isWindow() || !w->isVisible() ||
- w->style()->styleHint(SH_UnderlineShortcut, 0, w))
+ w->style()->styleHint(SH_UnderlineShortcut, 0, w)) {
l.removeAt(pos);
+ continue;
+ }
+ pos++;
}
// Update states before repainting
d->seenAlt.append(widget);
diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp
index ffa4e59..8400feb 100644
--- a/src/gui/text/qfontdatabase_s60.cpp
+++ b/src/gui/text/qfontdatabase_s60.cpp
@@ -166,6 +166,7 @@ public:
COpenFontRasterizer *m_rasterizer;
mutable QList<const QSymbianTypeFaceExtras *> m_extras;
+ mutable QHash<QString, const QSymbianTypeFaceExtras *> m_extrasHash;
mutable QSet<QString> m_applicationFontFamilies;
};
@@ -268,9 +269,8 @@ void QSymbianFontDatabaseExtrasImplementation::clear()
static_cast<const QSymbianFontDatabaseExtrasImplementation*>(db->symbianExtras);
if (!dbExtras)
return; // initializeDb() has never been called
- QSymbianTypeFaceExtrasHash &extrasHash = S60->fontData();
if (QSymbianTypeFaceExtras::symbianFontTableApiAvailable()) {
- qDeleteAll(extrasHash);
+ qDeleteAll(dbExtras->m_extrasHash);
} else {
typedef QList<const QSymbianTypeFaceExtras *>::iterator iterator;
for (iterator p = dbExtras->m_extras.begin(); p != dbExtras->m_extras.end(); ++p) {
@@ -279,16 +279,11 @@ void QSymbianFontDatabaseExtrasImplementation::clear()
}
dbExtras->m_extras.clear();
}
- extrasHash.clear();
+ dbExtras->m_extrasHash.clear();
}
void qt_cleanup_symbianFontDatabase()
{
- static bool cleanupDone = false;
- if (cleanupDone)
- return;
- cleanupDone = true;
-
QFontDatabasePrivate *db = privateDb();
if (!db)
return;
@@ -339,12 +334,9 @@ COpenFont* OpenFontFromBitmapFont(const CBitmapFont* aBitmapFont)
const QSymbianTypeFaceExtras *QSymbianFontDatabaseExtrasImplementation::extras(const QString &aTypeface,
bool bold, bool italic) const
{
- QSymbianTypeFaceExtrasHash &extrasHash = S60->fontData();
- if (extrasHash.isEmpty() && QThread::currentThread() != QApplication::instance()->thread())
- S60->addThreadLocalReleaseFunc(clear);
const QString typeface = qt_symbian_fontNameWithAppFontMarker(aTypeface);
const QString searchKey = typeface + QString::number(int(bold)) + QString::number(int(italic));
- if (!extrasHash.contains(searchKey)) {
+ if (!m_extrasHash.contains(searchKey)) {
TFontSpec searchSpec(qt_QString2TPtrC(typeface), 1);
if (bold)
searchSpec.iFontStyle.SetStrokeWeight(EStrokeWeightBold);
@@ -358,7 +350,7 @@ const QSymbianTypeFaceExtras *QSymbianFontDatabaseExtrasImplementation::extras(c
QScopedPointer<CFont, CFontFromScreenDeviceReleaser> sFont(font);
QSymbianTypeFaceExtras *extras = new QSymbianTypeFaceExtras(font);
sFont.take();
- extrasHash.insert(searchKey, extras);
+ m_extrasHash.insert(searchKey, extras);
} else {
const TInt err = m_store->GetNearestFontToDesignHeightInPixels(font, searchSpec);
Q_ASSERT(err == KErrNone && font);
@@ -372,20 +364,20 @@ const QSymbianTypeFaceExtras *QSymbianFontDatabaseExtrasImplementation::extras(c
const TOpenFontFaceAttrib* const attrib = openFont->FaceAttrib();
const QString foundKey =
QString((const QChar*)attrib->FullName().Ptr(), attrib->FullName().Length());
- if (!extrasHash.contains(foundKey)) {
+ if (!m_extrasHash.contains(foundKey)) {
QScopedPointer<CFont, CFontFromFontStoreReleaser> sFont(font);
QSymbianTypeFaceExtras *extras = new QSymbianTypeFaceExtras(font, openFont);
sFont.take();
m_extras.append(extras);
- extrasHash.insert(searchKey, extras);
- extrasHash.insert(foundKey, extras);
+ m_extrasHash.insert(searchKey, extras);
+ m_extrasHash.insert(foundKey, extras);
} else {
m_store->ReleaseFont(font);
- extrasHash.insert(searchKey, extrasHash.value(foundKey));
+ m_extrasHash.insert(searchKey, m_extrasHash.value(foundKey));
}
}
}
- return extrasHash.value(searchKey);
+ return m_extrasHash.value(searchKey);
}
void QSymbianFontDatabaseExtrasImplementation::removeAppFontData(
@@ -981,7 +973,7 @@ bool QFontDatabase::removeAllApplicationFonts()
bool QFontDatabase::supportsThreadedFontRendering()
{
- return QSymbianTypeFaceExtras::symbianFontTableApiAvailable();
+ return false;
}
static
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index e32e112..bde2c34 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -680,20 +680,30 @@ void QTextControlPrivate::extendWordwiseSelection(int suggestedNewPosition, qrea
if (!wordSelectionEnabled && (mouseXPosition < wordStartX || mouseXPosition > wordEndX))
return;
- // keep the already selected word even when moving to the left
- // (#39164)
- if (suggestedNewPosition < selectedWordOnDoubleClick.position())
- cursor.setPosition(selectedWordOnDoubleClick.selectionEnd());
- else
- cursor.setPosition(selectedWordOnDoubleClick.selectionStart());
+ if (wordSelectionEnabled) {
+ if (suggestedNewPosition < selectedWordOnDoubleClick.position()) {
+ cursor.setPosition(selectedWordOnDoubleClick.selectionEnd());
+ setCursorPosition(wordStartPos, QTextCursor::KeepAnchor);
+ } else {
+ cursor.setPosition(selectedWordOnDoubleClick.selectionStart());
+ setCursorPosition(wordEndPos, QTextCursor::KeepAnchor);
+ }
+ } else {
+ // keep the already selected word even when moving to the left
+ // (#39164)
+ if (suggestedNewPosition < selectedWordOnDoubleClick.position())
+ cursor.setPosition(selectedWordOnDoubleClick.selectionEnd());
+ else
+ cursor.setPosition(selectedWordOnDoubleClick.selectionStart());
- const qreal differenceToStart = mouseXPosition - wordStartX;
- const qreal differenceToEnd = wordEndX - mouseXPosition;
+ const qreal differenceToStart = mouseXPosition - wordStartX;
+ const qreal differenceToEnd = wordEndX - mouseXPosition;
- if (differenceToStart < differenceToEnd)
- setCursorPosition(wordStartPos, QTextCursor::KeepAnchor);
- else
- setCursorPosition(wordEndPos, QTextCursor::KeepAnchor);
+ if (differenceToStart < differenceToEnd)
+ setCursorPosition(wordStartPos, QTextCursor::KeepAnchor);
+ else
+ setCursorPosition(wordEndPos, QTextCursor::KeepAnchor);
+ }
if (interactionFlags & Qt::TextSelectableByMouse) {
#ifndef QT_NO_CLIPBOARD
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp
index 41394e3..fc251bf 100644
--- a/src/gui/widgets/qcombobox.cpp
+++ b/src/gui/widgets/qcombobox.cpp
@@ -2497,7 +2497,7 @@ void QComboBox::showPopup()
} else {
TRect staConTopRect = TRect();
AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStaconTop, staConTopRect);
- listRect.setWidth(listRect.height());
+ listRect.setWidth(screen.height());
//by default popup is centered on screen in landscape
listRect.moveCenter(screen.center());
if (staConTopRect.IsEmpty() && AknLayoutUtils::CbaLocation() != AknLayoutUtils::EAknCbaLocationBottom) {
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp
index a8031e7..b6e2f90 100644
--- a/src/gui/widgets/qlinecontrol.cpp
+++ b/src/gui/widgets/qlinecontrol.cpp
@@ -60,7 +60,7 @@
QT_BEGIN_NAMESPACE
#ifdef QT_GUI_PASSWORD_ECHO_DELAY
-static const int qt_passwordEchoDelay = QT_GUI_PASSWORD_ECHO_DELAY;
+static int qt_passwordEchoDelay = QT_GUI_PASSWORD_ECHO_DELAY;
#endif
/*!
@@ -93,8 +93,8 @@ void QLineControl::updateDisplayText(bool forceUpdate)
if (m_echoMode == QLineEdit::Password) {
str.fill(m_passwordCharacter);
#ifdef QT_GUI_PASSWORD_ECHO_DELAY
- if (m_passwordEchoTimer != 0 && m_cursor > 0 && m_cursor <= m_text.length()) {
- int cursor = m_cursor - 1;
+ if (m_passwordEchoTimer != 0 && !str.isEmpty()) {
+ int cursor = m_text.length() - 1;
QChar uc = m_text.at(cursor);
str[cursor] = uc;
if (cursor > 0 && uc.unicode() >= 0xdc00 && uc.unicode() < 0xe000) {
diff --git a/src/gui/widgets/qtextedit.cpp b/src/gui/widgets/qtextedit.cpp
index 61d4fed..2670089 100644
--- a/src/gui/widgets/qtextedit.cpp
+++ b/src/gui/widgets/qtextedit.cpp
@@ -2472,8 +2472,6 @@ bool QTextEdit::find(const QString &exp, QTextDocument::FindFlags options)
and the text edit will try to guess the right format.
Use setHtml() or setPlainText() directly to avoid text edit's guessing.
-
- \sa toPlainText(), toHtml()
*/
void QTextEdit::setText(const QString &text)
{
diff --git a/src/imports/shaders/shadereffectitem.cpp b/src/imports/shaders/shadereffectitem.cpp
index ca5c9a3..b954e5a 100644..100755
--- a/src/imports/shaders/shadereffectitem.cpp
+++ b/src/imports/shaders/shadereffectitem.cpp
@@ -199,8 +199,13 @@ Rectangle {
*/
+#ifdef Q_OS_SYMBIAN
+#define OBSERVE_GL_CONTEXT_LOSS 1
+#endif
+
ShaderEffectItem::ShaderEffectItem(QDeclarativeItem *parent)
: QDeclarativeItem(parent)
+ , m_program(0)
, m_meshResolution(1, 1)
, m_geometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4)
, m_blending(true)
@@ -214,15 +219,21 @@ ShaderEffectItem::ShaderEffectItem(QDeclarativeItem *parent)
, m_hasShaderPrograms(false)
, m_mirrored(false)
, m_defaultVertexShader(true)
+ , m_contextObserver(0)
{
setFlag(QGraphicsItem::ItemHasNoContents, false);
connect(this, SIGNAL(visibleChanged()), this, SLOT(handleVisibilityChange()));
m_active = isVisible();
+
+#ifndef OBSERVE_GL_CONTEXT_LOSS
+ m_program = new QGLShaderProgram(this);
+#endif
}
ShaderEffectItem::~ShaderEffectItem()
{
reset();
+ delete m_contextObserver;
}
@@ -402,10 +413,38 @@ void ShaderEffectItem::renderEffect(QPainter *painter, const QMatrix4x4 &matrix)
if (!painter || !painter->device())
return;
- if (!m_program.isLinked() || m_program_dirty)
+#ifdef OBSERVE_GL_CONTEXT_LOSS
+ QGLContext *context = const_cast <QGLContext*> (QGLContext::currentContext());
+ if (!m_program || !m_contextObserver || !m_contextObserver->isValid()) {
+ // Context has changed, re-create QGLShaderProgram
+ if (context) {
+ delete m_program;
+ m_program = 0;
+
+ delete m_contextObserver;
+ m_contextObserver = 0;
+
+ m_program = new QGLShaderProgram(this);
+ m_contextObserver = new QGLFramebufferObject(QSize(2,2));
+
+ if (!m_contextObserver || !m_program) {
+ delete m_program;
+ m_program = 0;
+ delete m_contextObserver;
+ m_contextObserver = 0;
+ qWarning() << "ShaderEffectItem::renderEffect - Creating QGLShaderProgram or QGLFrameBufferObject failed!";
+ }
+ }
+ }
+#endif
+
+ if (!m_program)
+ return;
+
+ if (!m_program->isLinked() || m_program_dirty)
updateShaderProgram();
- m_program.bind();
+ m_program->bind();
QMatrix4x4 combinedMatrix;
combinedMatrix.scale(2.0 / painter->device()->width(), -2.0 / painter->device()->height(), 1.0);
@@ -414,7 +453,7 @@ void ShaderEffectItem::renderEffect(QPainter *painter, const QMatrix4x4 &matrix)
updateEffectState(combinedMatrix);
for (int i = 0; i < m_attributeNames.size(); ++i) {
- m_program.enableAttributeArray(m_geometry.attributes()[i].position);
+ m_program->enableAttributeArray(m_geometry.attributes()[i].position);
}
bindGeometry();
@@ -452,11 +491,14 @@ void ShaderEffectItem::renderEffect(QPainter *painter, const QMatrix4x4 &matrix)
glDisable(GL_DEPTH_TEST);
for (int i = 0; i < m_attributeNames.size(); ++i)
- m_program.disableAttributeArray(m_geometry.attributes()[i].position);
+ m_program->disableAttributeArray(m_geometry.attributes()[i].position);
}
void ShaderEffectItem::updateEffectState(const QMatrix4x4 &matrix)
{
+ if (!m_program)
+ return;
+
for (int i = m_sources.size() - 1; i >= 0; --i) {
const ShaderEffectItem::SourceData &source = m_sources.at(i);
if (!source.source)
@@ -467,10 +509,10 @@ void ShaderEffectItem::updateEffectState(const QMatrix4x4 &matrix)
}
if (m_respectsOpacity)
- m_program.setUniformValue("qt_Opacity", static_cast<float> (effectiveOpacity()));
+ m_program->setUniformValue("qt_Opacity", static_cast<float> (effectiveOpacity()));
if (m_respectsMatrix){
- m_program.setUniformValue("qt_ModelViewProjectionMatrix", matrix);
+ m_program->setUniformValue("qt_ModelViewProjectionMatrix", matrix);
}
QSet<QByteArray>::const_iterator it;
@@ -480,37 +522,37 @@ void ShaderEffectItem::updateEffectState(const QMatrix4x4 &matrix)
switch (v.type()) {
case QVariant::Color:
- m_program.setUniformValue(name.constData(), qvariant_cast<QColor>(v));
+ m_program->setUniformValue(name.constData(), qvariant_cast<QColor>(v));
break;
case QVariant::Double:
- m_program.setUniformValue(name.constData(), (float) qvariant_cast<double>(v));
+ m_program->setUniformValue(name.constData(), (float) qvariant_cast<double>(v));
break;
case QVariant::Transform:
- m_program.setUniformValue(name.constData(), qvariant_cast<QTransform>(v));
+ m_program->setUniformValue(name.constData(), qvariant_cast<QTransform>(v));
break;
case QVariant::Int:
- m_program.setUniformValue(name.constData(), v.toInt());
+ m_program->setUniformValue(name.constData(), GLint(v.toInt()));
break;
case QVariant::Bool:
- m_program.setUniformValue(name.constData(), GLint(v.toBool()));
+ m_program->setUniformValue(name.constData(), GLint(v.toBool()));
break;
case QVariant::Size:
case QVariant::SizeF:
- m_program.setUniformValue(name.constData(), v.toSizeF());
+ m_program->setUniformValue(name.constData(), v.toSizeF());
break;
case QVariant::Point:
case QVariant::PointF:
- m_program.setUniformValue(name.constData(), v.toPointF());
+ m_program->setUniformValue(name.constData(), v.toPointF());
break;
case QVariant::Rect:
case QVariant::RectF:
{
QRectF r = v.toRectF();
- m_program.setUniformValue(name.constData(), r.x(), r.y(), r.width(), r.height());
+ m_program->setUniformValue(name.constData(), r.x(), r.y(), r.width(), r.height());
}
break;
case QVariant::Vector3D:
- m_program.setUniformValue(name.constData(), qvariant_cast<QVector3D>(v));
+ m_program->setUniformValue(name.constData(), qvariant_cast<QVector3D>(v));
break;
default:
break;
@@ -538,6 +580,9 @@ static inline int size_of_type(GLenum type)
void ShaderEffectItem::bindGeometry()
{
+ if (!m_program)
+ return;
+
char const *const *attrNames = m_attributeNames.constData();
int offset = 0;
for (int j = 0; j < m_attributeNames.size(); ++j) {
@@ -554,7 +599,7 @@ void ShaderEffectItem::bindGeometry()
if (normalize)
qWarning() << "ShaderEffectItem::bindGeometry() - non supported attribute type!";
- m_program.setAttributeArray(a.position, (GLfloat*) (((char*) m_geometry.vertexData()) + offset), a.tupleSize, m_geometry.stride());
+ m_program->setAttributeArray(a.position, (GLfloat*) (((char*) m_geometry.vertexData()) + offset), a.tupleSize, m_geometry.stride());
//glVertexAttribPointer(a.position, a.tupleSize, a.type, normalize, m_geometry.stride(), (char *) m_geometry.vertexData() + offset);
offset += a.tupleSize * size_of_type(a.type);
}
@@ -637,6 +682,16 @@ void ShaderEffectItem::setActive(bool enable)
}
}
+ // QGLShaderProgram is deleted when not active (to minimize GPU memory usage).
+#ifdef OBSERVE_GL_CONTEXT_LOSS
+ if (!m_active && m_program) {
+ delete m_program;
+ m_program = 0;
+ delete m_contextObserver;
+ m_contextObserver = 0;
+ }
+#endif
+
emit activeChanged();
markDirty();
}
@@ -756,7 +811,9 @@ void ShaderEffectItem::reset()
{
disconnectPropertySignals();
- m_program.removeAllShaders();
+ if (m_program)
+ m_program->removeAllShaders();
+
m_attributeNames.clear();
m_uniformNames.clear();
for (int i = 0; i < m_sources.size(); ++i) {
@@ -801,6 +858,9 @@ void ShaderEffectItem::updateProperties()
void ShaderEffectItem::updateShaderProgram()
{
+ if (!m_program)
+ return;
+
QString vertexCode = m_vertex_code;
QString fragmentCode = m_fragment_code;
@@ -810,16 +870,16 @@ void ShaderEffectItem::updateShaderProgram()
if (fragmentCode.isEmpty())
fragmentCode = QString::fromLatin1(qt_default_fragment_code);
- m_program.addShaderFromSourceCode(QGLShader::Vertex, vertexCode);
- m_program.addShaderFromSourceCode(QGLShader::Fragment, fragmentCode);
+ m_program->addShaderFromSourceCode(QGLShader::Vertex, vertexCode);
+ m_program->addShaderFromSourceCode(QGLShader::Fragment, fragmentCode);
for (int i = 0; i < m_attributeNames.size(); ++i) {
- m_program.bindAttributeLocation(m_attributeNames.at(i), m_geometry.attributes()[i].position);
+ m_program->bindAttributeLocation(m_attributeNames.at(i), m_geometry.attributes()[i].position);
}
- if (!m_program.link()) {
+ if (!m_program->link()) {
qWarning("ShaderEffectItem: Shader compilation failed:");
- qWarning() << m_program.log();
+ qWarning() << m_program->log();
}
if (!m_attributeNames.contains(qt_postion_attribute_name))
@@ -829,10 +889,10 @@ void ShaderEffectItem::updateShaderProgram()
if (!m_respectsMatrix)
qWarning("ShaderEffectItem: Missing reference to \'qt_ModelViewProjectionMatrix\'.");
- if (m_program.isLinked()) {
- m_program.bind();
+ if (m_program->isLinked()) {
+ m_program->bind();
for (int i = 0; i < m_sources.size(); ++i)
- m_program.setUniformValue(m_sources.at(i).name.constData(), i);
+ m_program->setUniformValue(m_sources.at(i).name.constData(), (GLint) i);
}
m_program_dirty = false;
diff --git a/src/imports/shaders/shadereffectitem.h b/src/imports/shaders/shadereffectitem.h
index aebe897..6c225a2 100644
--- a/src/imports/shaders/shadereffectitem.h
+++ b/src/imports/shaders/shadereffectitem.h
@@ -115,7 +115,7 @@ private:
private:
QString m_fragment_code;
QString m_vertex_code;
- QGLShaderProgram m_program;
+ QGLShaderProgram* m_program;
QVector<const char *> m_attributeNames;
QSet<QByteArray> m_uniformNames;
QSize m_meshResolution;
@@ -143,6 +143,8 @@ private:
bool m_hasShaderPrograms : 1;
bool m_mirrored : 1;
bool m_defaultVertexShader : 1;
+
+ QGLFramebufferObject* m_contextObserver;
};
QT_END_HEADER
diff --git a/src/imports/shaders/shadereffectsource.cpp b/src/imports/shaders/shadereffectsource.cpp
index 7916538..f7a8a93 100644
--- a/src/imports/shaders/shadereffectsource.cpp
+++ b/src/imports/shaders/shadereffectsource.cpp
@@ -160,15 +160,11 @@ void ShaderEffectSource::setSourceRect(const QRectF &rect)
return;
m_sourceRect = rect;
updateSizeAndTexture();
- updateBackbuffer();
emit sourceRectChanged();
emit repaintRequired();
- if (m_sourceItem) {
- ShaderEffect* effect = qobject_cast<ShaderEffect*> (m_sourceItem->graphicsEffect());
- if (effect)
- effect->m_changed = true;
- }
+ m_dirtyTexture = true;
+ markSourceItemDirty();
}
/*!
@@ -192,11 +188,8 @@ void ShaderEffectSource::setTextureSize(const QSize &size)
emit textureSizeChanged();
emit repaintRequired();
- if (m_sourceItem) {
- ShaderEffect* effect = qobject_cast<ShaderEffect*> (m_sourceItem->graphicsEffect());
- if (effect)
- effect->m_changed = true;
- }
+ m_dirtyTexture = true;
+ markSourceItemDirty();
}
/*!
@@ -264,8 +257,10 @@ void ShaderEffectSource::setWrapMode(WrapMode mode)
return;
m_wrapMode = mode;
- updateBackbuffer();
emit wrapModeChanged();
+
+ m_dirtyTexture = true;
+ markSourceItemDirty();
}
/*!
@@ -284,7 +279,7 @@ void ShaderEffectSource::grab()
emit repaintRequired();
}
-void ShaderEffectSource::bind() const
+void ShaderEffectSource::bind()
{
GLint filtering = smooth() ? GL_LINEAR : GL_NEAREST;
GLuint hwrap = (m_wrapMode == Repeat || m_wrapMode == RepeatHorizontally) ? GL_REPEAT : GL_CLAMP_TO_EDGE;
@@ -293,9 +288,13 @@ void ShaderEffectSource::bind() const
#if !defined(QT_OPENGL_ES_2)
glEnable(GL_TEXTURE_2D);
#endif
- if (m_fbo) {
+
+ if (m_fbo && m_fbo->isValid()) {
glBindTexture(GL_TEXTURE_2D, m_fbo->texture());
} else {
+ m_dirtyTexture = true;
+ emit repaintRequired();
+ markSourceItemDirty();
glBindTexture(GL_TEXTURE_2D, 0);
}
@@ -324,7 +323,7 @@ void ShaderEffectSource::derefFromEffectItem()
void ShaderEffectSource::updateBackbuffer()
{
- if (!m_sourceItem)
+ if (!m_sourceItem || !QGLContext::currentContext())
return;
// Multisampling is not (for now) supported.
@@ -340,7 +339,7 @@ void ShaderEffectSource::updateBackbuffer()
if (!m_fbo) {
m_fbo = new ShaderEffectBuffer(size, format);
} else {
- if (m_fbo->size() != size || m_fbo->format().internalTextureFormat() != GLenum(m_format)) {
+ if (!m_fbo->isValid() || m_fbo->size() != size || m_fbo->format().internalTextureFormat() != GLenum(m_format)) {
delete m_fbo;
m_fbo = 0;
m_fbo = new ShaderEffectBuffer(size, format);
@@ -367,6 +366,16 @@ void ShaderEffectSource::markSourceSizeDirty()
emit repaintRequired();
}
+void ShaderEffectSource::markSourceItemDirty()
+{
+ m_dirtyTexture = true;
+ if (m_sourceItem) {
+ ShaderEffect* effect = qobject_cast<ShaderEffect*> (m_sourceItem->graphicsEffect());
+ if (effect)
+ effect->m_changed = true;
+ }
+}
+
void ShaderEffectSource::updateSizeAndTexture()
{
if (m_sourceItem) {
@@ -377,7 +386,7 @@ void ShaderEffectSource::updateSizeAndTexture()
size.setWidth(1);
if (size.height() < 1)
size.setHeight(1);
- if (m_fbo && m_fbo->size() != size) {
+ if (m_fbo && (m_fbo->size() != size || !m_fbo->isValid())) {
delete m_fbo;
m_fbo = 0;
delete m_multisampledFbo;
diff --git a/src/imports/shaders/shadereffectsource.h b/src/imports/shaders/shadereffectsource.h
index 0f03a6a..af8a815 100644
--- a/src/imports/shaders/shadereffectsource.h
+++ b/src/imports/shaders/shadereffectsource.h
@@ -99,7 +99,7 @@ public:
void setWrapMode(WrapMode mode);
bool isActive() const { return m_refs; }
- void bind() const;
+ void bind();
void refFromEffectItem();
void derefFromEffectItem();
void updateBackbuffer();
@@ -124,6 +124,7 @@ Q_SIGNALS:
public Q_SLOTS:
void markSceneGraphDirty();
void markSourceSizeDirty();
+ void markSourceItemDirty();
private:
void updateSizeAndTexture();
diff --git a/src/xmlpatterns/expr/qevaluationcache.cpp b/src/xmlpatterns/expr/qevaluationcache.cpp
index 67109eb..3b6fc92 100644
--- a/src/xmlpatterns/expr/qevaluationcache.cpp
+++ b/src/xmlpatterns/expr/qevaluationcache.cpp
@@ -49,10 +49,9 @@ template<bool IsForGlobal>
EvaluationCache<IsForGlobal>::EvaluationCache(const Expression::Ptr &op,
const VariableDeclaration *varDecl,
const VariableSlotID aSlot) : SingleContainer(op)
- , m_declaration(varDecl)
+ , m_declarationUsedByMany(varDecl->usedByMany())
, m_varSlot(aSlot)
{
- Q_ASSERT(m_declaration);
Q_ASSERT(m_varSlot > -1);
}
@@ -199,7 +198,7 @@ Expression::Ptr EvaluationCache<IsForGlobal>::compress(const StaticContext::Ptr
if(m_operand->is(IDRangeVariableReference))
return m_operand;
- if(m_declaration->usedByMany())
+ if (m_declarationUsedByMany)
{
/* If it's only an atomic value an EvaluationCache is overkill. However,
* it's still needed for functions like fn:current-time() that must adhere to
diff --git a/src/xmlpatterns/expr/qevaluationcache_p.h b/src/xmlpatterns/expr/qevaluationcache_p.h
index 4111634..67ee5c2 100644
--- a/src/xmlpatterns/expr/qevaluationcache_p.h
+++ b/src/xmlpatterns/expr/qevaluationcache_p.h
@@ -125,6 +125,7 @@ namespace QPatternist
private:
static DynamicContext::Ptr topFocusContext(const DynamicContext::Ptr &context);
const VariableDeclaration* m_declaration;
+ bool m_declarationUsedByMany;
/**
* This variable must not be called m_slot. If it so, a compiler bug on
* HP-UX-aCC-64 is triggered in the constructor initializor. See the
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/horizontalAlignment_RightToLeft.qml b/tests/auto/declarative/qdeclarativetextedit/data/horizontalAlignment_RightToLeft.qml
index 43ea8d8..6e739bf 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/horizontalAlignment_RightToLeft.qml
+++ b/tests/auto/declarative/qdeclarativetextedit/data/horizontalAlignment_RightToLeft.qml
@@ -18,6 +18,7 @@ Rectangle {
objectName: "text"
anchors.fill: parent
text: top.text
+ focus: true
}
}
}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_words.qml b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_words.qml
index 22a9871..f8d2e4e 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_words.qml
+++ b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_false_words.qml
@@ -1,7 +1,8 @@
-import QtQuick 1.0
+import QtQuick 1.1
TextEdit {
focus: true
- text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ text: "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"
selectByMouse: false
+ mouseSelectionMode: TextEdit.SelectWords
}
diff --git a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_words.qml b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_words.qml
index d61da46..f58fd45 100644
--- a/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_words.qml
+++ b/tests/auto/declarative/qdeclarativetextedit/data/mouseselection_true_words.qml
@@ -1,7 +1,8 @@
-import QtQuick 1.0
+import QtQuick 1.1
TextEdit {
focus: true
- text: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ text: "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"
selectByMouse: true
+ mouseSelectionMode: TextEdit.SelectWords
}
diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
index 5d6f2a2..fde0588 100644
--- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
+++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp
@@ -454,6 +454,8 @@ void tst_qdeclarativetextedit::hAlign_RightToLeft()
QVERIFY(textEdit != 0);
canvas->show();
+ const QString rtlText = textEdit->text();
+
// implicit alignment should follow the reading direction of text
QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2);
@@ -530,6 +532,16 @@ void tst_qdeclarativetextedit::hAlign_RightToLeft()
QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignLeft);
QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2);
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ textEdit->setText(QString());
+ { QInputMethodEvent ev(rtlText, QList<QInputMethodEvent::Attribute>()); QApplication::sendEvent(canvas, &ev); }
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight);
+ { QInputMethodEvent ev("Hello world!", QList<QInputMethodEvent::Attribute>()); QApplication::sendEvent(canvas, &ev); }
+ QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignLeft);
+
#ifndef Q_OS_MAC // QTBUG-18040
// empty text with implicit alignment follows the system locale-based
// keyboard input direction from QApplication::keyboardInputDirection
@@ -1315,20 +1327,32 @@ void tst_qdeclarativetextedit::moveCursorSelectionSequence()
void tst_qdeclarativetextedit::mouseSelection_data()
{
QTest::addColumn<QString>("qmlfile");
- QTest::addColumn<bool>("expectSelection");
+ QTest::addColumn<int>("from");
+ QTest::addColumn<int>("to");
+ QTest::addColumn<QString>("selectedText");
// import installed
- QTest::newRow("on") << SRCDIR "/data/mouseselection_true.qml" << true;
- QTest::newRow("off") << SRCDIR "/data/mouseselection_false.qml" << false;
- QTest::newRow("default") << SRCDIR "/data/mouseselection_default.qml" << false;
- QTest::newRow("on word selection") << SRCDIR "/data/mouseselection_true_words.qml" << true;
- QTest::newRow("off word selection") << SRCDIR "/data/mouseselection_false_words.qml" << false;
+ QTest::newRow("on") << SRCDIR "/data/mouseselection_true.qml" << 4 << 9 << "45678";
+ QTest::newRow("off") << SRCDIR "/data/mouseselection_false.qml" << 4 << 9 << QString();
+ QTest::newRow("default") << SRCDIR "/data/mouseselection_default.qml" << 4 << 9 << QString();
+ QTest::newRow("off word selection") << SRCDIR "/data/mouseselection_false_words.qml" << 4 << 9 << QString();
+ QTest::newRow("on word selection (4,9)") << SRCDIR "/data/mouseselection_true_words.qml" << 4 << 9 << "0123456789";
+ QTest::newRow("on word selection (2,13)") << SRCDIR "/data/mouseselection_true_words.qml" << 2 << 13 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ QTest::newRow("on word selection (2,30)") << SRCDIR "/data/mouseselection_true_words.qml" << 2 << 30 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ QTest::newRow("on word selection (9,13)") << SRCDIR "/data/mouseselection_true_words.qml" << 9 << 13 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ QTest::newRow("on word selection (9,30)") << SRCDIR "/data/mouseselection_true_words.qml" << 9 << 30 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ QTest::newRow("on word selection (13,2)") << SRCDIR "/data/mouseselection_true_words.qml" << 13 << 2 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ QTest::newRow("on word selection (20,2)") << SRCDIR "/data/mouseselection_true_words.qml" << 20 << 2 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ QTest::newRow("on word selection (12,9)") << SRCDIR "/data/mouseselection_true_words.qml" << 12 << 9 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ QTest::newRow("on word selection (30,9)") << SRCDIR "/data/mouseselection_true_words.qml" << 30 << 9 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ";
}
void tst_qdeclarativetextedit::mouseSelection()
{
QFETCH(QString, qmlfile);
- QFETCH(bool, expectSelection);
+ QFETCH(int, from);
+ QFETCH(int, to);
+ QFETCH(QString, selectedText);
QDeclarativeView *canvas = createView(qmlfile);
@@ -1342,25 +1366,20 @@ void tst_qdeclarativetextedit::mouseSelection()
QVERIFY(textEditObject != 0);
// press-and-drag-and-release from x1 to x2
- int x1 = 10;
- int x2 = 70;
- int y = textEditObject->height()/2;
- QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(x1,y)));
+ QPoint p1 = canvas->mapFromScene(textEditObject->positionToRectangle(from).center());
+ QPoint p2 = canvas->mapFromScene(textEditObject->positionToRectangle(to).center());
+ QTest::mousePress(canvas->viewport(), Qt::LeftButton, 0, p1);
//QTest::mouseMove(canvas->viewport(), canvas->mapFromScene(QPoint(x2,y))); // doesn't work
- QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(QPoint(x2,y)), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
+ QMouseEvent mv(QEvent::MouseMove, canvas->mapFromScene(p2), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
QApplication::sendEvent(canvas->viewport(), &mv);
- QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, canvas->mapFromScene(QPoint(x2,y)));
- QString str = textEditObject->selectedText();
- if (expectSelection)
- QVERIFY(str.length() > 3); // don't reallly care *what* was selected (and it's too sensitive to platform)
- else
- QVERIFY(str.isEmpty());
+ QTest::mouseRelease(canvas->viewport(), Qt::LeftButton, 0, p2);
+ QCOMPARE(textEditObject->selectedText(), selectedText);
// Clicking and shift to clicking between the same points should select the same text.
textEditObject->setCursorPosition(0);
- QTest::mouseClick(canvas->viewport(), Qt::LeftButton, Qt::NoModifier, canvas->mapFromScene(QPoint(x1,y)));
- QTest::mouseClick(canvas->viewport(), Qt::LeftButton, Qt::ShiftModifier, canvas->mapFromScene(QPoint(x2,y)));
- QCOMPARE(textEditObject->selectedText(), str);
+ QTest::mouseClick(canvas->viewport(), Qt::LeftButton, Qt::NoModifier, p1);
+ QTest::mouseClick(canvas->viewport(), Qt::LeftButton, Qt::ShiftModifier, p2);
+ QCOMPARE(textEditObject->selectedText(), selectedText);
delete canvas;
}
diff --git a/tests/auto/declarative/qdeclarativetextinput/data/horizontalAlignment_RightToLeft.qml b/tests/auto/declarative/qdeclarativetextinput/data/horizontalAlignment_RightToLeft.qml
index b11535e..7f27bbe 100644
--- a/tests/auto/declarative/qdeclarativetextinput/data/horizontalAlignment_RightToLeft.qml
+++ b/tests/auto/declarative/qdeclarativetextinput/data/horizontalAlignment_RightToLeft.qml
@@ -18,6 +18,7 @@ Rectangle {
objectName: "text"
anchors.fill: parent
text: top.text
+ focus: true
}
}
}
diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
index 280f952..bb895bf 100644
--- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
+++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
@@ -1198,6 +1198,8 @@ void tst_qdeclarativetextinput::horizontalAlignment_RightToLeft()
QVERIFY(textInput != 0);
canvas->show();
+ const QString rtlText = textInput->text();
+
QDeclarativeTextInputPrivate *textInputPrivate = QDeclarativeTextInputPrivate::get(textInput);
QVERIFY(textInputPrivate != 0);
QVERIFY(-textInputPrivate->hscroll > canvas->width()/2);
@@ -1262,6 +1264,17 @@ void tst_qdeclarativetextinput::horizontalAlignment_RightToLeft()
QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignLeft);
QVERIFY(-textInputPrivate->hscroll < canvas->width()/2);
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ // If there is no committed text, the preedit text should determine the alignment.
+ textInput->setText(QString());
+ { QInputMethodEvent ev(rtlText, QList<QInputMethodEvent::Attribute>()); QApplication::sendEvent(canvas, &ev); }
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight);
+ { QInputMethodEvent ev("Hello world!", QList<QInputMethodEvent::Attribute>()); QApplication::sendEvent(canvas, &ev); }
+ QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignLeft);
+
#ifndef Q_OS_MAC // QTBUG-18040
// empty text with implicit alignment follows the system locale-based
// keyboard input direction from QApplication::keyboardInputDirection
diff --git a/tests/auto/qdir/tst_qdir.cpp b/tests/auto/qdir/tst_qdir.cpp
index 0a42a97..419eaae 100644
--- a/tests/auto/qdir/tst_qdir.cpp
+++ b/tests/auto/qdir/tst_qdir.cpp
@@ -444,9 +444,15 @@ void tst_QDir::QDir_default()
void tst_QDir::compare()
{
// operator==
+
+ // Not using QCOMPARE to test result of QDir::operator==
+
QDir dir;
dir.makeAbsolute();
QVERIFY(dir == QDir::currentPath());
+
+ QVERIFY(QDir() == QDir(QDir::currentPath()));
+ QVERIFY(QDir("../") == QDir(QDir::currentPath() + "/.."));
}
static QStringList filterLinks(const QStringList &list)
diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp
index 2c88561..6abbdcd 100644
--- a/tests/auto/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/qlineedit/tst_qlineedit.cpp
@@ -1770,13 +1770,6 @@ void tst_QLineEdit::passwordEchoDelay()
QApplication::sendEvent(testWidget, &ev);
QCOMPARE(testWidget->displayText(), QString(7, fillChar) + QLatin1Char('7'));
- testWidget->setCursorPosition(3);
- QCOMPARE(testWidget->displayText(), QString(7, fillChar) + QLatin1Char('7'));
- QTest::keyPress(testWidget, 'a');
- QCOMPARE(testWidget->displayText(), QString(3, fillChar) + QLatin1Char('a') + QString(5, fillChar));
- QTest::keyPress(testWidget, Qt::Key_Backspace);
- QCOMPARE(testWidget->displayText(), QString(8, fillChar));
-
// restore clean state
testWidget->setEchoMode(QLineEdit::Normal);
}
diff --git a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp
index 2edb93a..c9d4ba4 100644
--- a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp
+++ b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp
@@ -69,13 +69,7 @@
class tst_QTemporaryFile : public QObject
{
Q_OBJECT
-public:
- tst_QTemporaryFile();
- virtual ~tst_QTemporaryFile();
public slots:
- void init();
- void cleanup();
-
void initTestCase();
void cleanupTestCase();
@@ -100,22 +94,17 @@ private slots:
void resetTemplateAfterError();
void setTemplateAfterOpen();
void autoRemoveAfterFailedRename();
-
- void QTBUG_4796_data();
- void QTBUG_4796();
-
-public:
};
void tst_QTemporaryFile::initTestCase()
{
- // For QTBUG_4796
+ // For fileTemplate tests
QVERIFY(QDir("test-XXXXXX").exists() || QDir().mkdir("test-XXXXXX"));
}
void tst_QTemporaryFile::cleanupTestCase()
{
- // From QTBUG_4796
+ // From fileTemplate tests
QVERIFY(QDir().rmdir("test-XXXXXX"));
}
@@ -139,76 +128,6 @@ void tst_QTemporaryFile::getSetCheck()
QCOMPARE(true, obj1.autoRemove());
}
-tst_QTemporaryFile::tst_QTemporaryFile()
-{
-}
-
-tst_QTemporaryFile::~tst_QTemporaryFile()
-{
-
-}
-
-void tst_QTemporaryFile::init()
-{
-// TODO: Add initialization code here.
-// This will be executed immediately before each test is run.
-}
-
-void tst_QTemporaryFile::cleanup()
-{
-// TODO: Add cleanup code here.
-// This will be executed immediately after each test is run.
-}
-
-void tst_QTemporaryFile::fileTemplate_data()
-{
- QTest::addColumn<QString>("constructorTemplate");
- QTest::addColumn<QString>("prefix");
- QTest::addColumn<QString>("suffix");
- QTest::addColumn<QString>("fileTemplate");
-
- QTest::newRow("constructor default") << "" << "." << "" << "";
- QTest::newRow("constructor with xxx sufix") << "qt_XXXXXXxxx" << "qt_" << "xxx" << "";
- QTest::newRow("constructor with xXx sufix") << "qt_XXXXXXxXx" << "qt_" << "xXx" << "";
- QTest::newRow("constructor with no sufix") << "qt_XXXXXX" << "qt_" << "" << "";
- QTest::newRow("constructor with >6 X's and xxx suffix") << "qt_XXXXXXXXXXxxx" << "qt_" << "xxx" << "";
- QTest::newRow("constructor with >6 X's, no suffix") << "qt_XXXXXXXXXX" << "qt_" << "" << "";
-
- QTest::newRow("constructor with XXXX suffix") << "qt_XXXXXX_XXXX" << "qt_" << "_XXXX" << "";
- QTest::newRow("constructor with XXXXX suffix") << "qt_XXXXXX_XXXXX" << "qt_" << "_XXXXX" << "";
- QTest::newRow("constructor with XXXX prefix") << "qt_XXXX" << "qt_XXXX." << "" << "";
- QTest::newRow("constructor with XXXXX prefix") << "qt_XXXXX" << "qt_XXXXX." << "" << "";
- QTest::newRow("constructor with XXXX prefix and suffix") << "qt_XXXX_XXXXXX_XXXX" << "qt_XXXX_" << "_XXXX" << "";
- QTest::newRow("constructor with XXXXX prefix and suffix") << "qt_XXXXX_XXXXXX_XXXXX" << "qt_XXXXX_" << "_XXXXX" << "";
-
- QTest::newRow("set template, no suffix") << "" << "foo" << "" << "foo";
- QTest::newRow("set template, with lowercase XXXXXX") << "" << "qt_" << "xxxxxx" << "qt_XXXXXXxxxxxx";
- QTest::newRow("set template, with xxx") << "" << "qt_" << ".xxx" << "qt_XXXXXX.xxx";
- QTest::newRow("set template, with >6 X's") << "" << "qt_" << ".xxx" << "qt_XXXXXXXXXXXXXX.xxx";
- QTest::newRow("set template, with >6 X's, no suffix") << "" << "qt_" << "" << "qt_XXXXXXXXXXXXXX";
-}
-
-void tst_QTemporaryFile::fileTemplate()
-{
- QFETCH(QString, constructorTemplate);
- QFETCH(QString, prefix);
- QFETCH(QString, suffix);
- QFETCH(QString, fileTemplate);
-
- QTemporaryFile file(constructorTemplate);
- if (!fileTemplate.isEmpty())
- file.setFileTemplate(fileTemplate);
-
- QCOMPARE(file.open(), true);
-
- if (prefix.length())
- QCOMPARE(file.fileName().left(prefix.length()), prefix);
-
- if (suffix.length())
- QCOMPARE(file.fileName().right(suffix.length()), suffix);
-}
-
-
/*
This tests whether the temporary file really gets placed in QDir::tempPath
*/
@@ -411,11 +330,11 @@ void tst_QTemporaryFile::rename()
{
QTemporaryFile file(dir.filePath("temporary-file.XXXXXX"));
- QVERIFY(file.open());
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
tempname = file.fileName();
QVERIFY(dir.exists(tempname));
- QVERIFY(file.rename("temporary-file.txt"));
+ QVERIFY2(file.rename("temporary-file.txt"), qPrintable(file.errorString()));
QVERIFY(!dir.exists(tempname));
QVERIFY(dir.exists("temporary-file.txt"));
QCOMPARE(file.fileName(), QString("temporary-file.txt"));
@@ -622,7 +541,7 @@ void tst_QTemporaryFile::autoRemoveAfterFailedRename()
cleaner.reset();
}
-void tst_QTemporaryFile::QTBUG_4796_data()
+void tst_QTemporaryFile::fileTemplate_data()
{
QTest::addColumn<QString>("prefix");
QTest::addColumn<QString>("suffix");
@@ -631,15 +550,33 @@ void tst_QTemporaryFile::QTBUG_4796_data()
QString unicode = QString::fromUtf8("\xc3\xa5\xc3\xa6\xc3\xb8");
QTest::newRow("<empty>") << QString() << QString() << true;
+
+ QTest::newRow(".") << QString(".") << QString() << true;
+ QTest::newRow("..") << QString("..") << QString() << true;
+
+ QTest::newRow("foo") << QString("foo") << QString() << true;
+ QTest::newRow("qt_ ... xxxxxx") << QString("qt_") << QString("xxxxxx") << true;
+ QTest::newRow("qt_ ... xxx") << QString("qt_") << QString("xxx") << true;
+ QTest::newRow("qt_ ... xXx") << QString("qt_") << QString("xXx") << true;
+ QTest::newRow("qt_ ...") << QString("qt_") << QString() << true;
+ QTest::newRow("qt_ ... _XXXX") << QString("qt_") << QString("_XXXX") << true;
+ QTest::newRow("qt_ ... _XXXXX") << QString("qt_") << QString("_XXXXX") << true;
+ QTest::newRow("qt_XXXX_ ...") << QString("qt_XXXX_") << QString() << true;
+ QTest::newRow("qt_XXXXX_ ...") << QString("qt_XXXXX_") << QString() << true;
+ QTest::newRow("qt_XXXX_ ... _XXXX") << QString("qt_XXXX_") << QString("_XXXX") << true;
+ QTest::newRow("qt_XXXXX_ ... _XXXXX") << QString("qt_XXXXX_") << QString("_XXXXX") << true;
+
QTest::newRow("blaXXXXXX") << QString("bla") << QString() << true;
QTest::newRow("XXXXXXbla") << QString() << QString("bla") << true;
+
QTest::newRow("does-not-exist/qt_temp.XXXXXX") << QString("does-not-exist/qt_temp") << QString() << false;
+
QTest::newRow("XXXXXX<unicode>") << QString() << unicode << true;
QTest::newRow("<unicode>XXXXXX") << unicode << QString() << true;
QTest::newRow("<unicode>XXXXXX<unicode>") << unicode << unicode << true;
}
-void tst_QTemporaryFile::QTBUG_4796()
+void tst_QTemporaryFile::fileTemplate()
{
QVERIFY(QDir("test-XXXXXX").exists());
@@ -665,25 +602,56 @@ void tst_QTemporaryFile::QTBUG_4796()
QFETCH(QString, suffix);
QFETCH(bool, openResult);
+ enum IterationType {
+ UseConstructor,
+ UseSetFileTemplate,
+ Done
+ };
+
+ for (IterationType setFileTemplate = UseConstructor; setFileTemplate != Done;
+ setFileTemplate = IterationType(int(setFileTemplate) + 1))
{
+ Q_FOREACH(QString const &tempName, cleaner.tempNames)
+ QVERIFY( !QFile::exists(tempName) );
+
+ cleaner.reset();
+
QString fileTemplate1 = prefix + QString("XX") + suffix;
QString fileTemplate2 = prefix + QString("XXXX") + suffix;
QString fileTemplate3 = prefix + QString("XXXXXX") + suffix;
QString fileTemplate4 = prefix + QString("XXXXXXXX") + suffix;
- QTemporaryFile file1(fileTemplate1);
- QTemporaryFile file2(fileTemplate2);
- QTemporaryFile file3(fileTemplate3);
- QTemporaryFile file4(fileTemplate4);
- QTemporaryFile file5("test-XXXXXX/" + fileTemplate1);
- QTemporaryFile file6("test-XXXXXX/" + fileTemplate3);
+ QTemporaryFile file1(setFileTemplate ? QString() : fileTemplate1);
+ QTemporaryFile file2(setFileTemplate ? QString() : fileTemplate2);
+ QTemporaryFile file3(setFileTemplate ? QString() : fileTemplate3);
+ QTemporaryFile file4(setFileTemplate ? QString() : fileTemplate4);
+ QTemporaryFile file5(setFileTemplate ? QString() : "test-XXXXXX/" + fileTemplate1);
+ QTemporaryFile file6(setFileTemplate ? QString() : "test-XXXXXX/" + fileTemplate3);
+
+ if (setFileTemplate) {
+ file1.setFileTemplate(fileTemplate1);
+ file2.setFileTemplate(fileTemplate2);
+ file3.setFileTemplate(fileTemplate3);
+ file4.setFileTemplate(fileTemplate4);
+ file5.setFileTemplate("test-XXXXXX/" + fileTemplate1);
+ file6.setFileTemplate("test-XXXXXX/" + fileTemplate3);
+ }
- QCOMPARE(file1.open(), openResult);
- QCOMPARE(file2.open(), openResult);
- QCOMPARE(file3.open(), openResult);
- QCOMPARE(file4.open(), openResult);
- QCOMPARE(file5.open(), openResult);
- QCOMPARE(file6.open(), openResult);
+ if (openResult) {
+ QVERIFY2(file1.open(), qPrintable(file1.errorString()));
+ QVERIFY2(file2.open(), qPrintable(file2.errorString()));
+ QVERIFY2(file3.open(), qPrintable(file3.errorString()));
+ QVERIFY2(file4.open(), qPrintable(file4.errorString()));
+ QVERIFY2(file5.open(), qPrintable(file5.errorString()));
+ QVERIFY2(file6.open(), qPrintable(file6.errorString()));
+ } else {
+ QVERIFY(!file1.open());
+ QVERIFY(!file2.open());
+ QVERIFY(!file3.open());
+ QVERIFY(!file4.open());
+ QVERIFY(!file5.open());
+ QVERIFY(!file6.open());
+ }
QCOMPARE(file1.exists(), openResult);
QCOMPARE(file2.exists(), openResult);
@@ -701,28 +669,31 @@ void tst_QTemporaryFile::QTBUG_4796()
<< file5.fileName()
<< file6.fileName();
- QVERIFY(file1.fileName().startsWith(fileTemplate1 + QLatin1Char('.')));
- QVERIFY(file2.fileName().startsWith(fileTemplate2 + QLatin1Char('.')));
- QVERIFY(file5.fileName().startsWith("test-XXXXXX/" + fileTemplate1 + QLatin1Char('.')));
- QVERIFY(file6.fileName().startsWith("test-XXXXXX/" + prefix));
+ QDir currentDir;
+ QString fileName1 = currentDir.relativeFilePath(file1.fileName());
+ QString fileName2 = currentDir.relativeFilePath(file2.fileName());
+ QString fileName3 = currentDir.relativeFilePath(file3.fileName());
+ QString fileName4 = currentDir.relativeFilePath(file4.fileName());
+ QString fileName5 = currentDir.relativeFilePath(file5.fileName());
+ QString fileName6 = currentDir.relativeFilePath(file6.fileName());
+
+ QVERIFY2(fileName1.startsWith(fileTemplate1 + QLatin1Char('.')), qPrintable(file1.fileName()));
+ QVERIFY2(fileName2.startsWith(fileTemplate2 + QLatin1Char('.')), qPrintable(file2.fileName()));
+ QVERIFY2(fileName5.startsWith("test-XXXXXX/" + fileTemplate1 + QLatin1Char('.')), qPrintable(file5.fileName()));
+ QVERIFY2(fileName6.startsWith("test-XXXXXX/" + prefix), qPrintable(file6.fileName()));
if (!prefix.isEmpty()) {
- QVERIFY(file3.fileName().startsWith(prefix));
- QVERIFY(file4.fileName().startsWith(prefix));
+ QVERIFY2(fileName3.startsWith(prefix), qPrintable(file3.fileName()));
+ QVERIFY2(fileName4.startsWith(prefix), qPrintable(file4.fileName()));
}
if (!suffix.isEmpty()) {
- QVERIFY(file3.fileName().endsWith(suffix));
- QVERIFY(file4.fileName().endsWith(suffix));
- QVERIFY(file6.fileName().endsWith(suffix));
+ QVERIFY2(fileName3.endsWith(suffix), qPrintable(file3.fileName()));
+ QVERIFY2(fileName4.endsWith(suffix), qPrintable(file4.fileName()));
+ QVERIFY2(fileName6.endsWith(suffix), qPrintable(file6.fileName()));
}
}
}
-
- Q_FOREACH(QString const &tempName, cleaner.tempNames)
- QVERIFY( !QFile::exists(tempName) );
-
- cleaner.reset();
}
QTEST_MAIN(tst_QTemporaryFile)
diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp
index 585d6ce..b3dc31a 100644
--- a/tools/qdoc3/cppcodemarker.cpp
+++ b/tools/qdoc3/cppcodemarker.cpp
@@ -955,7 +955,7 @@ QString CppCodeMarker::addMarkUp(const QString &in,
ident += ch;
finish = i;
readChar();
- } while (ch >= 0 && isalnum(ch) || ch == '_');
+ } while (isalnum(ch) || ch == '_');
if (classRegExp.exactMatch(ident)) {
tag = QLatin1String("type");
diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp
index 9f512d3..fc66923 100644
--- a/tools/qdoc3/ditaxmlgenerator.cpp
+++ b/tools/qdoc3/ditaxmlgenerator.cpp
@@ -62,6 +62,25 @@ QT_BEGIN_NAMESPACE
#define COMMAND_VERSION Doc::alias("version")
int DitaXmlGenerator::id = 0;
+QString DitaXmlGenerator::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 Elements",
+ " New Qml Properties",
+ " New Qml Signals",
+ " New Qml Methods",
+ ""
+ };
+
/*
The strings in this array must appear in the same order as
the values in enum DitaXmlGenerator::DitaTag.
@@ -3934,6 +3953,70 @@ void DitaXmlGenerator::findAllClasses(const InnerNode* node)
}
}
+/*!
+ For generating the "New Classes... in 4.x" section on the
+ What's New in 4.x" page.
+ */
+void DitaXmlGenerator::findAllSince(const InnerNode* node)
+{
+ NodeList::const_iterator child = node->childNodes().constBegin();
+ while (child != node->childNodes().constEnd()) {
+ QString sinceVersion = (*child)->since();
+ if (((*child)->access() != Node::Private) && !sinceVersion.isEmpty()) {
+ NewSinceMaps::iterator nsmap = newSinceMaps.find(sinceVersion);
+ if (nsmap == newSinceMaps.end())
+ nsmap = newSinceMaps.insert(sinceVersion,NodeMultiMap());
+ NewClassMaps::iterator ncmap = newClassMaps.find(sinceVersion);
+ if (ncmap == newClassMaps.end())
+ ncmap = newClassMaps.insert(sinceVersion,NodeMap());
+ NewClassMaps::iterator nqcmap = newQmlClassMaps.find(sinceVersion);
+ if (nqcmap == newQmlClassMaps.end())
+ nqcmap = newQmlClassMaps.insert(sinceVersion,NodeMap());
+
+ if ((*child)->type() == Node::Function) {
+ FunctionNode *func = static_cast<FunctionNode *>(*child);
+ if ((func->status() > Node::Obsolete) &&
+ (func->metaness() != FunctionNode::Ctor) &&
+ (func->metaness() != FunctionNode::Dtor)) {
+ nsmap.value().insert(func->name(),(*child));
+ }
+ }
+ else if ((*child)->url().isEmpty()) {
+ if ((*child)->type() == Node::Class && !(*child)->doc().isEmpty()) {
+ QString className = (*child)->name();
+ if ((*child)->parent() &&
+ (*child)->parent()->type() == Node::Namespace &&
+ !(*child)->parent()->name().isEmpty())
+ className = (*child)->parent()->name()+"::"+className;
+ nsmap.value().insert(className,(*child));
+ ncmap.value().insert(className,(*child));
+ }
+ else if ((*child)->subType() == Node::QmlClass) {
+ QString className = (*child)->name();
+ if ((*child)->parent() &&
+ (*child)->parent()->type() == Node::Namespace &&
+ !(*child)->parent()->name().isEmpty())
+ className = (*child)->parent()->name()+"::"+className;
+ nsmap.value().insert(className,(*child));
+ nqcmap.value().insert(className,(*child));
+ }
+ }
+ else {
+ QString name = (*child)->name();
+ if ((*child)->parent() &&
+ (*child)->parent()->type() == Node::Namespace &&
+ !(*child)->parent()->name().isEmpty())
+ name = (*child)->parent()->name()+"::"+name;
+ nsmap.value().insert(name,(*child));
+ }
+ if ((*child)->isInnerNode()) {
+ findAllSince(static_cast<InnerNode *>(*child));
+ }
+ }
+ ++child;
+ }
+}
+
void DitaXmlGenerator::findAllFunctions(const InnerNode* node)
{
NodeList::ConstIterator c = node->childNodes().begin();
diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h
index d8d3563..408f46c 100644
--- a/tools/qdoc3/ditaxmlgenerator.h
+++ b/tools/qdoc3/ditaxmlgenerator.h
@@ -51,6 +51,12 @@
QT_BEGIN_NAMESPACE
+typedef QMultiMap<QString, Node*> NodeMultiMap;
+typedef QMap<QString, NodeMultiMap> NewSinceMaps;
+typedef QMap<Node*, NodeMultiMap> ParentMaps;
+typedef QMap<QString, const Node*> NodeMap;
+typedef QMap<QString, NodeMap> NewClassMaps;
+
typedef QMap<QString, QString> GuidMap;
typedef QMap<QString, GuidMap*> GuidMaps;
@@ -412,6 +418,7 @@ class DitaXmlGenerator : public PageGenerator
void findAllFunctions(const InnerNode *node);
void findAllLegaleseTexts(const InnerNode *node);
void findAllNamespaces(const InnerNode *node);
+ void findAllSince(const InnerNode *node);
static int hOffset(const Node *node);
static bool isThreeColumnEnumValueTable(const Atom *atom);
virtual QString getLink(const Atom *atom,
@@ -508,6 +515,10 @@ class DitaXmlGenerator : public PageGenerator
#endif
QMap<QString, NodeMap > funcIndex;
QMap<Text, const Node*> legaleseTexts;
+ NewSinceMaps newSinceMaps;
+ static QString sinceTitles[];
+ NewClassMaps newClassMaps;
+ NewClassMaps newQmlClassMaps;
static int id;
static QString ditaTags[];
QStack<QXmlStreamWriter*> xmlWriterStack;
diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp
index 37f68f8..479931d 100644
--- a/tools/qdoc3/doc.cpp
+++ b/tools/qdoc3/doc.cpp
@@ -828,7 +828,7 @@ void DocParser::parse(const QString& source,
append(Atom::AnnotatedList, getArgument());
break;
case CMD_SINCELIST:
- append(Atom::SinceList, getRestOfLine().simplified());
+ append(Atom::SinceList, getArgument());
break;
case CMD_GENERATELIST:
append(Atom::GeneratedList, getArgument());
diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp
index c20d2b4..3367301 100644
--- a/tools/qdoc3/generator.cpp
+++ b/tools/qdoc3/generator.cpp
@@ -77,25 +77,6 @@ QString Generator::outDir;
QString Generator::project;
QHash<QString, QString> Generator::outputPrefixes;
-QString Generator::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 Elements",
- " New QML Properties",
- " New QML Signals",
- " New QML Methods",
- ""
- };
-
static void singularPlural(Text& text, const NodeList& nodes)
{
if (nodes.count() == 1)
@@ -779,18 +760,8 @@ QString Generator::typeString(const Node *node)
case Node::Class:
return "class";
case Node::Fake:
- {
- switch (node->subType()) {
- case Node::QmlClass:
- return "element";
- case Node::QmlPropertyGroup:
- return "property group";
- case Node::QmlBasicType:
- return "type";
- default:
- return "documentation";
- }
- }
+ default:
+ return "documentation";
case Node::Enum:
return "enum";
case Node::Typedef:
@@ -799,8 +770,6 @@ QString Generator::typeString(const Node *node)
return "function";
case Node::Property:
return "property";
- default:
- return "documentation";
}
}
@@ -1122,21 +1091,11 @@ void Generator::generateSince(const Node *node, CodeMarker *marker)
text << " was introduced or modified in ";
else
text << " was introduced in ";
-
- QStringList since = node->since().split(" ");
- if (since.count() == 1) {
- // Handle legacy use of \since <version>.
- if (project.isEmpty())
- text << "version";
- else
- text << project;
- text << " " << since[0];
- } else {
- // Reconstruct the <project> <version> string.
- text << " " << since.join(" ");
- }
-
- text << "." << Atom::ParaRight;
+ if (project.isEmpty())
+ text << "version";
+ else
+ text << project;
+ text << " " << node->since() << "." << Atom::ParaRight;
generateText(text, node, marker);
}
}
@@ -1387,91 +1346,4 @@ QStringList Generator::getMetadataElements(const InnerNode* inner, const QString
return s;
}
-/*!
- For generating the "New Classes... in 4.6" section on the
- What's New in 4.6" page.
- */
-void Generator::findAllSince(const InnerNode *node)
-{
- NodeList::const_iterator child = node->childNodes().constBegin();
-
- // Traverse the tree, starting at the node supplied.
-
- while (child != node->childNodes().constEnd()) {
-
- QString sinceString = (*child)->since();
-
- if (((*child)->access() != Node::Private) && !sinceString.isEmpty()) {
-
- // Insert a new entry into each map for each new since string found.
- NewSinceMaps::iterator nsmap = newSinceMaps.find(sinceString);
- if (nsmap == newSinceMaps.end())
- nsmap = newSinceMaps.insert(sinceString,NodeMultiMap());
-
- NewClassMaps::iterator ncmap = newClassMaps.find(sinceString);
- if (ncmap == newClassMaps.end())
- ncmap = newClassMaps.insert(sinceString,NodeMap());
-
- NewClassMaps::iterator nqcmap = newQmlClassMaps.find(sinceString);
- if (nqcmap == newQmlClassMaps.end())
- nqcmap = newQmlClassMaps.insert(sinceString,NodeMap());
-
- if ((*child)->type() == Node::Function) {
- // Insert functions into the general since map.
- FunctionNode *func = static_cast<FunctionNode *>(*child);
- if ((func->status() > Node::Obsolete) &&
- (func->metaness() != FunctionNode::Ctor) &&
- (func->metaness() != FunctionNode::Dtor)) {
- nsmap.value().insert(func->name(),(*child));
- }
- }
- else if ((*child)->url().isEmpty()) {
- if ((*child)->type() == Node::Class && !(*child)->doc().isEmpty()) {
- // Insert classes into the since and class maps.
- QString className = (*child)->name();
- if ((*child)->parent() &&
- (*child)->parent()->type() == Node::Namespace &&
- !(*child)->parent()->name().isEmpty())
- className = (*child)->parent()->name()+"::"+className;
-
- nsmap.value().insert(className,(*child));
- ncmap.value().insert(className,(*child));
- }
- else if ((*child)->subType() == Node::QmlClass) {
- // Insert QML elements into the since and element maps.
- QString className = (*child)->name();
- if ((*child)->parent() &&
- (*child)->parent()->type() == Node::Namespace &&
- !(*child)->parent()->name().isEmpty())
- className = (*child)->parent()->name()+"::"+className;
-
- nsmap.value().insert(className,(*child));
- nqcmap.value().insert(className,(*child));
- }
- else if ((*child)->type() == Node::QmlProperty) {
- // Insert QML properties into the since map.
- QString propertyName = (*child)->name();
- nsmap.value().insert(propertyName,(*child));
- }
- }
- else {
- // Insert external documents into the general since map.
- QString name = (*child)->name();
- if ((*child)->parent() &&
- (*child)->parent()->type() == Node::Namespace &&
- !(*child)->parent()->name().isEmpty())
- name = (*child)->parent()->name()+"::"+name;
-
- nsmap.value().insert(name,(*child));
- }
-
- // Find child nodes with since commands.
- if ((*child)->isInnerNode()) {
- findAllSince(static_cast<InnerNode *>(*child));
- }
- }
- ++child;
- }
-}
-
QT_END_NAMESPACE
diff --git a/tools/qdoc3/generator.h b/tools/qdoc3/generator.h
index e66915b..e5e9747 100644
--- a/tools/qdoc3/generator.h
+++ b/tools/qdoc3/generator.h
@@ -57,12 +57,6 @@
QT_BEGIN_NAMESPACE
-typedef QMap<QString, const Node*> NodeMap;
-typedef QMultiMap<QString, Node*> NodeMultiMap;
-typedef QMap<QString, NodeMultiMap> NewSinceMaps;
-typedef QMap<Node*, NodeMultiMap> ParentMaps;
-typedef QMap<QString, NodeMap> NewClassMaps;
-
class ClassNode;
class Config;
class CodeMarker;
@@ -158,7 +152,6 @@ class Generator
QString getMetadataElement(const InnerNode* inner, const QString& t);
QStringList getMetadataElements(const InnerNode* inner, const QString& t);
- void findAllSince(const InnerNode *node);
private:
void generateReimplementedFrom(const FunctionNode *func,
@@ -187,11 +180,6 @@ class Generator
const NodeList& subs,
CodeMarker *marker);
- static QString sinceTitles[];
- NewSinceMaps newSinceMaps;
- NewClassMaps newClassMaps;
- NewClassMaps newQmlClassMaps;
-
private:
QString amp;
QString lt;
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 655c3b4..52da178 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -66,6 +66,25 @@ bool HtmlGenerator::debugging_on = false;
QString HtmlGenerator::divNavTop = "";
+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 Elements",
+ " New QML Properties",
+ " New QML Signals",
+ " New QML Methods",
+ ""
+ };
+
static bool showBrokenLinks = false;
static QRegExp linkTag("(<@link node=\"([^\"]+)\">).*(</@link>)");
@@ -587,18 +606,14 @@ int HtmlGenerator::generateAtom(const Atom *atom,
ncmap = newClassMaps.find(atom->string());
NewClassMaps::const_iterator nqcmap;
nqcmap = newQmlClassMaps.find(atom->string());
-
if ((nsmap != newSinceMaps.constEnd()) && !nsmap.value().isEmpty()) {
QList<Section> sections;
QList<Section>::ConstIterator s;
-
for (int i=0; i<LastSinceType; ++i)
sections.append(Section(sinceTitle(i),QString(),QString(),QString()));
NodeMultiMap::const_iterator n = nsmap.value().constBegin();
-
while (n != nsmap.value().constEnd()) {
-
const Node* node = n.value();
switch (node->type()) {
case Node::Fake:
@@ -1331,7 +1346,6 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
// Generate brief text and status for modules.
generateBrief(fake, marker);
generateStatus(fake, marker);
- generateSince(fake, marker);
if (moduleNamespaceMap.contains(fake->name())) {
out() << "<a name=\"" << registerRef("namespaces") << "\"></a>" << divNavTop << "\n";
@@ -1348,7 +1362,6 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
// Generate brief text and status for modules.
generateBrief(fake, marker);
generateStatus(fake, marker);
- generateSince(fake, marker);
out() << "<ul>\n";
@@ -1380,7 +1393,6 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
generateQmlInherits(qml_cn, marker);
generateQmlInheritedBy(qml_cn, marker);
generateQmlInstantiates(qml_cn, marker);
- generateSince(qml_cn, marker);
QString allQmlMembersLink = generateAllQmlMembersFile(qml_cn, marker);
if (!allQmlMembersLink.isEmpty()) {
@@ -2230,6 +2242,9 @@ void HtmlGenerator::generateCompactList(const Node *relative,
for (int i=0; i<NumParagraphs; i++) // i = 0..36
paragraphOffset[i+1] = paragraphOffset[i] + paragraph[i].count();
+ int curParNr = 0;
+ int curParOffset = 0;
+
/*
Output the alphabet as a row of links.
*/
@@ -2247,12 +2262,8 @@ void HtmlGenerator::generateCompactList(const Node *relative,
Output a <div> element to contain all the <dl> elements.
*/
out() << "<div class=\"flowListDiv\">\n";
- numTableRows = 0;
-
- int curParNr = 0;
- int curParOffset = 0;
- for (int i=0; i<classMap.count(); i++) {
+ for (int i=0; i<classMap.count()-1; i++) {
while ((curParNr < NumParagraphs) &&
(curParOffset == paragraph[curParNr].count())) {
++curParNr;
@@ -2313,9 +2324,7 @@ void HtmlGenerator::generateCompactList(const Node *relative,
out() << "</dd>\n";
curParOffset++;
}
- if (classMap.count() > 0)
- out() << "</dl>\n";
-
+ out() << "</dl>\n";
out() << "</div>\n";
}
@@ -3348,6 +3357,70 @@ void HtmlGenerator::findAllClasses(const InnerNode *node)
}
}
+/*!
+ For generating the "New Classes... in 4.6" section on the
+ What's New in 4.6" page.
+ */
+void HtmlGenerator::findAllSince(const InnerNode *node)
+{
+ NodeList::const_iterator child = node->childNodes().constBegin();
+ while (child != node->childNodes().constEnd()) {
+ QString sinceVersion = (*child)->since();
+ if (((*child)->access() != Node::Private) && !sinceVersion.isEmpty()) {
+ NewSinceMaps::iterator nsmap = newSinceMaps.find(sinceVersion);
+ if (nsmap == newSinceMaps.end())
+ nsmap = newSinceMaps.insert(sinceVersion,NodeMultiMap());
+ NewClassMaps::iterator ncmap = newClassMaps.find(sinceVersion);
+ if (ncmap == newClassMaps.end())
+ ncmap = newClassMaps.insert(sinceVersion,NodeMap());
+ NewClassMaps::iterator nqcmap = newQmlClassMaps.find(sinceVersion);
+ if (nqcmap == newQmlClassMaps.end())
+ nqcmap = newQmlClassMaps.insert(sinceVersion,NodeMap());
+
+ if ((*child)->type() == Node::Function) {
+ FunctionNode *func = static_cast<FunctionNode *>(*child);
+ if ((func->status() > Node::Obsolete) &&
+ (func->metaness() != FunctionNode::Ctor) &&
+ (func->metaness() != FunctionNode::Dtor)) {
+ nsmap.value().insert(func->name(),(*child));
+ }
+ }
+ else if ((*child)->url().isEmpty()) {
+ if ((*child)->type() == Node::Class && !(*child)->doc().isEmpty()) {
+ QString className = (*child)->name();
+ if ((*child)->parent() &&
+ (*child)->parent()->type() == Node::Namespace &&
+ !(*child)->parent()->name().isEmpty())
+ className = (*child)->parent()->name()+"::"+className;
+ nsmap.value().insert(className,(*child));
+ ncmap.value().insert(className,(*child));
+ }
+ else if ((*child)->subType() == Node::QmlClass) {
+ QString className = (*child)->name();
+ if ((*child)->parent() &&
+ (*child)->parent()->type() == Node::Namespace &&
+ !(*child)->parent()->name().isEmpty())
+ className = (*child)->parent()->name()+"::"+className;
+ nsmap.value().insert(className,(*child));
+ nqcmap.value().insert(className,(*child));
+ }
+ }
+ else {
+ QString name = (*child)->name();
+ if ((*child)->parent() &&
+ (*child)->parent()->type() == Node::Namespace &&
+ !(*child)->parent()->name().isEmpty())
+ name = (*child)->parent()->name()+"::"+name;
+ nsmap.value().insert(name,(*child));
+ }
+ if ((*child)->isInnerNode()) {
+ findAllSince(static_cast<InnerNode *>(*child));
+ }
+ }
+ ++child;
+ }
+}
+
void HtmlGenerator::findAllFunctions(const InnerNode *node)
{
NodeList::ConstIterator c = node->childNodes().begin();
diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h
index e36c562..70ec0b7 100644
--- a/tools/qdoc3/htmlgenerator.h
+++ b/tools/qdoc3/htmlgenerator.h
@@ -56,6 +56,12 @@
QT_BEGIN_NAMESPACE
+typedef QMultiMap<QString, Node*> NodeMultiMap;
+typedef QMap<QString, NodeMultiMap> NewSinceMaps;
+typedef QMap<Node*, NodeMultiMap> ParentMaps;
+typedef QMap<QString, const Node*> NodeMap;
+typedef QMap<QString, NodeMap> NewClassMaps;
+
class HelpProjectWriter;
class HtmlGenerator : public PageGenerator
@@ -218,6 +224,7 @@ class HtmlGenerator : public PageGenerator
void findAllFunctions(const InnerNode *node);
void findAllLegaleseTexts(const InnerNode *node);
void findAllNamespaces(const InnerNode *node);
+ void findAllSince(const InnerNode *node);
static int hOffset(const Node *node);
static bool isThreeColumnEnumValueTable(const Atom *atom);
virtual QString getLink(const Atom *atom,
@@ -285,6 +292,10 @@ class HtmlGenerator : public PageGenerator
NodeMap qmlClasses;
QMap<QString, NodeMap > funcIndex;
QMap<Text, const Node *> legaleseTexts;
+ NewSinceMaps newSinceMaps;
+ static QString sinceTitles[];
+ NewClassMaps newClassMaps;
+ NewClassMaps newQmlClassMaps;
static int id;
public:
static bool debugging_on;
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp
index 87bbd93..56d76d3 100644
--- a/tools/qdoc3/node.cpp
+++ b/tools/qdoc3/node.cpp
@@ -157,16 +157,6 @@ void Node::setLink(LinkType linkType, const QString &link, const QString &desc)
}
/*!
- Sets the information about the project and version a node was introduced
- in. The string is simplified, removing excess whitespace before being
- stored.
-*/
-void Node::setSince(const QString &since)
-{
- sinc = since.simplified();
-}
-
-/*!
Returns a string representing the access specifier.
*/
QString Node::accessString() const
@@ -555,7 +545,8 @@ void InnerNode::removeFromRelated()
*/
void InnerNode::deleteChildren()
{
- qDeleteAll(children);
+ NodeList childrenCopy = children; // `children` will be changed in ~Node()
+ qDeleteAll(childrenCopy);
}
/*!
diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h
index cb16bea..e1e9440 100644
--- a/tools/qdoc3/node.h
+++ b/tools/qdoc3/node.h
@@ -151,7 +151,7 @@ class Node
void setDoc(const Doc& doc, bool replace = false);
void setStatus(Status status) { sta = status; }
void setThreadSafeness(ThreadSafeness safeness) { saf = safeness; }
- void setSince(const QString &since);
+ void setSince(const QString &since) { sinc = since; }
void setRelates(InnerNode* pseudoParent);
void setModuleName(const QString &module) { mod = module; }
void setLink(LinkType linkType, const QString &link, const QString &desc);