Commit Graph

20045 Commits

Author SHA1 Message Date
Samuel Gaist
21d9ad8b11 QString:add (last)indexOf overload with QRegularExpressionMatch output
This patch adds indexOf and lastIndexOf with QRegularExpressionMatch
output overloads to QString. This allows to get the match corresponding
to the index returned.

[ChangeLog][QtCore][QString] Added support for retrieving the
QRegularExpressionMatch to indexOf and lastIndexOf.

Change-Id: Ia0ae2d3ff78864c7053ffa397874aca1d2b1c35c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-08-27 15:38:00 +02:00
Samuel Gaist
a8a8a3bfbd tst_QString: Use a non-empty string for lastIndexOfInvalidRegex
Testing using an empty string doesn't ensure that the regexp
gets validated. The function may return earlier thus making
the test useless. This patch adds a text to search in so that
no early optimization avoids the regexp validation part

Change-Id: If24b77385dde44a922d43e5ae1d7a5393d24f640
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-08-27 15:37:51 +02:00
Andrew Knight
ecbf6dfbf5 ssl: Share the host name matching utilities
This moves the socket backend's host name matching functions up to
QSslSocketPrivate so that they can be shared between backends. This
works, as there is no OpenSSL-specific code here.

Change-Id: I73c2081fdc2e60a44c90e90800d1e1877391a626
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-08-27 15:03:58 +02:00
Nico Vertriest
be4db73231 Doc: language corrections QStorageInfo class
Task-number: QTBUG-40984
Change-Id: Idf8c6ecedb25f6c55b3fe8db69e6de9d9f2eaf74
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
2014-08-27 14:45:18 +02:00
Risto Avila
e5b36bb54e Enables remap of NumpadKeys when Numlock is on and using evkeyboard.
Task-number: QTBUG-32823
Change-Id: I80841a965c61a117e8b50a2775431bb723ca8eca
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-27 14:38:11 +02:00
Jørgen Lind
23a2ad6f61 Fail early when creating QOpenGLVertexArrayObject
There is a significant performance regression with using
QOpenGLVertexArrayObject::Binder on platforms not supporting VAOs. This
is because of the function resolving/initialization in create which is
called once pr bind if d->vao == 0.

Change-Id: I74e77f50921116c306247dc371c68b287a2e22d7
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2014-08-26 20:55:17 +02:00
Marc Mutz
53eeddf855 Use ctor-init-list in QRegionPrivate(QRect) ctor
Change-Id: I531b862db7bdec0a504c6022c1a15635aaf3fc8d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-08-26 20:47:47 +02:00
Marc Mutz
2b153ad6cb QRegionPrivate: remove copy ctor and assignment operator
They're identical to the compiler-generated ones, and probably inhibit
move operators here and there.

Change-Id: I918f2946f6b6aa49aa883420dc87df44013938a5
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-08-26 20:47:41 +02:00
Topi Reinio
15c32361d9 qdoc: Enable listing of example files with .html extension
If a (non-external) link string ends in '.html', qdoc assumed it is
a direct link to a generated html page. However, it could also refer
to an example file with .html extension.

This commit fixes a corner case where links to an example file page
were broken for such files.

Task-number: QTBUG-40831
Change-Id: I31acc141970b6768f0a93964723be82611d37a3d
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-08-26 20:08:58 +02:00
Topi Reinio
d28e2e225c qdoc: Restore navigation bar title for module pages and groups
Adapt the code that generates the navigation bar to the recent
changes in node hierarchy - Module pages, QML module pages and
groups are no longer DocNodes.

This change will ensure that if a page has a title, it will be
visible in the navigation bar regardless of the the page (node)
type.

Change-Id: I697a12d5904d88f91771764ab7ed607b79e4eab1
Reviewed-by: Martin Smith <martin.smith@digia.com>
2014-08-26 20:08:40 +02:00
Topi Reinio
f286e0813b Doc: Add CSS rules for subtitles
In the offline template, the floating elements in the navigation bar
interfere with the layout of any elements displayed next to it. In
particular, subtitles used for example files and nested class
documentation have wrong horizontal position.

This change adds CSS for the subtitles to be displayed as block
elements, and disallows floating elements on the left side - TOC
is still allowed to float on the right side.

Task-number: QTBUG-40924
Change-Id: I89be3844985e6cf95263db575768034d9270d140
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-08-26 20:08:21 +02:00
Topi Reinio
4cc3a41819 qdoc: Write all generated files to .qhp
When writing the Qt Help Project XML file, QDoc traverses the
documentation nodes recursively, adding html filenames for each node
to the XML.

The logic that QDoc uses for this process is not perfect, and needs
to be kept up to date whenever the internal structure of the node
tree changes. This often leads to problems where some pages are
generated but not added to the .qhp, resulting in missing pages in
the offline documentation.

This change fixes this problem by having the generator keep track
of the created filenames, and passing that to the help project
writer.

Task-number: QTBUG-40572
Change-Id: Ife60a30724183a2b6dcd2397ea79bfbdc2addd04
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-08-26 20:08:05 +02:00
Topi Reinio
4f2d1e2e04 qdoc: Fix output of \br command
Since the \br was promoted from a macro to a QDoc command, its output
has been enclosed in extra paragraph end/start tags, adding to the
visible vertical space.

This change fixes the issue by not closing the paragraph when QDoc
encounters a \br command.

Also removes the now-obsolete \br and \hr macros, as they are both
proper commands. \BR and \HR substitute macros are kept.

Task-number: QTBUG-37361
Change-Id: Iabbefb6e79268419792ccba42386f6342ccd175d
Reviewed-by: Martin Smith <martin.smith@digia.com>
2014-08-26 20:07:40 +02:00
Friedemann Kleint
92c7cb8155 Close popup widgets when wheel events are received
Task-number: QTBUG-40656
Change-Id: I134b07705744c23af9718dee486ab5e9ad4352cf
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-08-26 19:58:56 +02:00
Oliver Wolff
0475822d01 Added qsslcertificate_qt.cpp
Having QAsn1Element in place, we can have a common foundation
for the ssl certificate class for upcoming ports like WinRT
and SecureTransport. The only thing that has to be added to
the existing class is the handle() functionality.

Change-Id: I560a8e412b26f350855c7bc456fcdb8e9b750939
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-08-26 18:48:36 +02:00
Tor Arne Vestbø
852dbe7658 iOS: Use dispatch_async instead of performSelectorOnMainThread for IME
Gets rid of awkward wrapping of Qt::InputMethodQueries as integer in a
NSObject.

Change-Id: Ia7e368fc12ec7957ca8ab602d8cec1e0a071af1d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-08-26 18:13:04 +02:00
Tor Arne Vestbø
ad120dbf13 iOS: Add UIResponder helper to get current first responder
Change-Id: I422d45860a52861893d963fabbecd4ac30477272
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-08-26 18:12:50 +02:00
Morten Johan Sørvig
7a413fa40c QCoreTextFontDatabase: Remove number type asserts.
On iOS 8, the value 0 is returned as a kCFNumberIntType.
The code still works - CFNumberGetValue converts it
to a 0.0 double.

Change-Id: Ic50900b22e4fa19ad1481e8e0e293559bbfd8cd2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-08-26 18:12:44 +02:00
Tor Arne Vestbø
9aff2fbd86 Send QWindow::focusObjectChanged when clearing widget focus
We do this for QWidget::setFocus(), but were missing a call on clearing
the focus widget. Since QWidgetWindow::focusObject() will fall back to
returning itself if there is no focus widget, we need to pass the
result of window->focusObject() to the change signal instead of 0.

Change-Id: I52a5519a19bb20e74b4a7c2a1abc9d47e2ea1315
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-08-26 18:12:37 +02:00
Friedemann Kleint
f85f3acd78 Document loading of high resolution versions of images.
Task-number: QTBUG-38858
Change-Id: I87ee18b66e137f5f5c01d77910f1a7f256b85e18
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-08-26 16:59:36 +02:00
Friedemann Kleint
4017605d56 Mention supportedMimeTypes() in QImageReader documentation.
Change-Id: Iaa07a463e07982352fe2c7dd77d691a390a65f35
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-08-26 16:59:28 +02:00
Frederik Gladhorn
910c639db6 Accessibility iOS: Fix crash after deleting a view
Change-Id: I64e8357fcbf7f312308490351b7c692d31db5a43
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-08-26 16:40:46 +02:00
Frederik Gladhorn
de95953c75 Clean up QAccessibleTabBar
Change-Id: Ic0949e4d76a7332ef1a42c93a06a0e4515c1192d
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-08-26 16:40:43 +02:00
Frederik Gladhorn
e944b93bf1 Remove QAccessibleToolButton::text
This function actually is worse than just calling
QAccessibleButton::text which it already does. It would mess up the
shortcut handling in addition to that.

Change-Id: I56cb95a44624da4c5fccb43e6835f6012a083337
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-08-26 16:40:40 +02:00
Frederik Gladhorn
0c3967f92c Remove unused variable
Change-Id: I0414d7bab89371f330d5b0cfa88758e3f1668f32
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2014-08-26 16:40:37 +02:00
Marc Mutz
2d4954810b QDataWidgetMapper: micro-optimize clearMapping()
QList<WidgetMapper>::takeLast() is a needlessly expensive operation
(involves copying a QPersistentModelIndex and a QPointer).

Instead of looping over takeLast() until empty, reverse-iterate
over the list and call removeEventFilter(), then clear the whole
list.

We reverse-iterate to preserve existing behavior. Also, since the
original code popped the WidgetMapper instance before calling
removeEventFilter(), we move the whole list into a local copy
before iterating. There's little chance that a removeEventFilter()
call will cause reentrancy into QDataWidgetMapper, but better safe
than sorry.

This and the previous change together save 448 bytes of text size in
libQt5Widgets.

Change-Id: I1bfe907751659f31e618aa05bbb7b840f0aa61f4
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-08-26 09:07:25 +02:00
Marc Mutz
1c73a237ce QDataWidgetMapper: micro-optimize handling of the widget map
Don't use index-based iteration, but use iterators.

Change-Id: I57c9582aed644fc58ced1a1af940dcd20d11d970
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-08-26 09:07:12 +02:00
Tasuku Suzuki
44b9e31a0a fix a camel case include guard macro
Change-Id: I502ecf6c862f101e426536e11f5c466ed3419946
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-08-26 03:43:20 +02:00
Samuel Gaist
76b4493595 Add test case for indexOf using an invalid QRegularExpression
Change-Id: I3677d0ecd406388a8f1eb65ec013595904da4c2d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-08-26 00:36:59 +02:00
Robin Burchell
6aa1b6e015 tst_qtreewidget: Skip test that crashes on Wayland.
Change-Id: I6cc2eb90df57eb5c33d3a93920ea719b5e2cfc0d
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-25 23:23:26 +02:00
Robin Burchell
f10eda7cb5 tst_qtreeview: Skip test that crashes on Wayland.
Change-Id: Iff2499dff1906a7c65fc5c007b96675f4bac2b42
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-25 23:23:20 +02:00
Friedemann Kleint
c47b04696a Add devicePixelRatio support to the Windows QPA plugin.
This adds support for the environment variable
QT_DEVICE_PIXEL_RATIO for the Windows platform plugin.

Task-number: QTBUG-38993
Task-number: QTBUG-38858
Change-Id: I6831eb6d3a09a80be7bbef46395e91531b61cc50
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-08-25 21:21:27 +02:00
Dyami Caliri
d8168f10a1 QEvent check for QT_NO_GESTURES in new debug code.
Latest changes to QEvent break compiling with -no-feature-gestures.

Change-Id: Ibbddd73a4f567051c3793a7aaf438240add6583a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-08-25 20:49:47 +02:00
Allan Sandfeld Jensen
8f547c4252 Avoid crash if querying device that has gone away
A device removed very fast after being inserted might disappear while
we are still seting it up. We must therefore check if we indeed still
get a matching device

Task-number: QTBUG-40820
Change-Id: I4372fb1932264e5799f37cea0d016795e28ebed6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-08-25 20:42:52 +02:00
Laszlo Agocs
f9de7efe60 QOpenGLTextureBlitter: Do not call vao functions if it failed to create
Follow the good practice of checking for isCreated() before calling
VAO functions like bind(). Use also the vao binder where applicable.

Change-Id: Ib827f3bce838396bf2e08f9480fa63801d4d3a50
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-08-25 17:40:28 +02:00
Laszlo Agocs
a4f50269f8 Support QOpenGLWidget and QQuickWidget on Android
It gets somewhat complicated due to the fact that a RasterGLSurface window
(i.e. any widget window since 5.3) may behave either like an OpenGLSurface
or a RasterSurface, and the expected behavior may change on each backingstore
sync.

This does not fit designs where the platform window implementation is separated
and there is different behavior for raster and GL windows.

Therefore QAndroidPlatformOpenGLWindow is now made capable of behaving like the
raster one, based on a flag communicated from the widget stack via QWindowPrivate
(since the plugin knows nothing about widgets).

This means that widget windows that do not have renderToTexture children (QOpenGLWidget,
QQuickWidget) will go through the raster path, while the ones that have will behave
like an OpenGL window with the actual rendering happening in
QPlatformBackingStore::composeAndFlush().
The surface type is RasterGLSurface in both cases nonetheless.

Task-number: QTBUG-37907
Change-Id: I6f9261fc0fd993afcda7f30d379c5410069033d3
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-08-25 17:40:23 +02:00
Laszlo Agocs
8688656641 Use QMenuBar::addMenu in the qopenglwidget example
Like in all other places. This way the resulting QMenu is correctly
parented so it will show up at the proper position even on platforms
which do not have a way to position top-level windows.

Task-number: QTBUG-29025
Change-Id: I2aa6fe73699379029c44a3f379366a2133753190
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2014-08-25 17:40:18 +02:00
Shawn Rutledge
0ce707d1d5 QColorDialog manual test improvements
Show debug output for rejected and currentColorChanged signals,
because accepting is not the only scenario to be tested.

Task-number: QTBUG-40855
Change-Id: If741ab19392e7d4314e0eff82a939d202ae86b48
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-08-25 17:04:47 +02:00
Shawn Rutledge
9d9ef74a6c OS X QColorDialog: emit reject() when closed by the titlebar button
but only if there is a Cancel button.  A color dialog without a cancel
button might be kept open and apply to various selections, so it
doesn't make sense to reject such a dialog, only to close it.

Task-number: QTBUG-40855
Change-Id: Ifffb4ae81307c72259ed388a4776ba09543603e7
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-08-25 17:04:37 +02:00
Laszlo Agocs
4ca7b23dc0 Initialize textureId in platform backing store
Setting it initially to 0 is very important, otherwise we will
do a glDeleteTextures with the undefined value.

The result sometimes goes unnoticed and sometimes causes bizarre
issues: For example in the 'textures' example one face of one cube
out of the six did go blank from time to time since the corresponding
texture was deleted by the backingstore.

Change-Id: Id19eb2164471b542b08a277a65edfcb5d0f8248d
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-08-25 16:57:58 +02:00
Andy Nichols
5afebb05b4 DirectFB Fix issue with showing dialogs
If the window was not visible when the geometry was set, then the
DirectFB window would not be resized.

Change-Id: I7790c90ed0fb755aebee0e32c877ebd9e48417cd
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-08-25 16:47:25 +02:00
Andy Nichols
6e7e73c014 DirectFB Unbreak mouse input for child windows
The local and global coordinates for mouse events were being translated
incorrectly from the native DirectFB events.

Change-Id: Id904a4335459b87c92f4b8b46d535c78fb7dad8c
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-08-25 16:47:18 +02:00
Andy Nichols
3fcebba79c DirectFB Make usable again with QWidget
Previously when we created any QWidget based application a
QDesktopWidget would be created as a physical window like any other, but
this window would steal input from the application.  We now create a
DirectFB window for the Qt::Desktop type of widget now, but it does not
receive input events and can not be painted to or displayed.

Change-Id: I6a090c5384b1f83383e40680dbede5d0edc41983
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-08-25 16:47:14 +02:00
Andy Nichols
8917d0be00 DirectFB Provide a native interface
Using the same multiple inheiritance that is used in the EGLFS platform
plugin.

Change-Id: I016f904bfc365bec6266c3f5d638ab15ecefe63b
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-25 16:47:08 +02:00
Andy Nichols
e3ef095469 DirectFB Add QGenericUnixServices and inputContext
The DirectFB platform plugin was missing support for services and
inputContext.

Change-Id: I010fdcbed5e172b019b4dce79f3beea0f9c5025d
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-25 16:47:02 +02:00
Morten Johan Sørvig
30bb830fc1 OS X: Fix pan gestures.
The QPanGesture recognizer requires single-point touch events. The touch
implementation in Qt 4 would test Qt::WA_TouchPadAcceptSingleTouchEvents
and forward single touch events if set.

Making this work in Qt 5 is a little bit more involved since the platform
plugins don't know about widgets.

Change the Cocoa touch implementation to send single-point touch events
to QWidgetWindow windows only. Make QApplication forward single-point
touch events only if the target widget has the
Qt::WA_TouchPadAcceptSingleTouchEvents attribute set.

Task-number: QTBUG-35893
Change-Id: I68712a5e3efb4ece7a81ca42f49c412e525eeb3a
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
2014-08-25 16:07:36 +02:00
Allan Sandfeld Jensen
7dce962200 Add operator-> to QJson iterators
The iterators for QJsonArray and QJsonObject are currently lacking an
operator-> definition. Unfortunately it is not possible to do in clean
way without redefining either the iterators or QJsonValueRef class.

This patch instead adds two fake pointer classes that are only used
to handle the operator-> return value.

Task-number: QTBUG-29573
Change-Id: Ief785a6afbbedc9e89cf3b6f3958c2c755997a66
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-08-25 16:03:42 +02:00
Laszlo Agocs
f16de5c1fd Fix composition for translucent AlwaysStackOnTop widgets
Writing out the alpha is re-enabled too early. When blitting the
AlwaysStackOnTop widgets as the last step of the composition, they
need the exact same settings as the backingstore content, meaning
blending but without writing out alpha.

Move the glColorMask call to fix this. This will avoid issues with
semi-transparent AlwaysStackOnTop widgets when the top-level has
alpha enabled too.

Task-number: QTBUG-40910
Change-Id: Id6d0d684cfa78bf79b65a097efd92de575e73b2c
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-08-24 23:01:58 +02:00
Laszlo Agocs
a0cc43fbc8 Set a size in qopenglwindow example
Use showMaximized(). Just calling show() without setting a size can result
in a zero-sized, invisible window on some platforms.

Change-Id: Ifa48258060e3d651c2fac3a1409a26a2c3db6bdb
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2014-08-24 23:01:39 +02:00
Giuseppe D'Angelo
4cd53ad3a6 Refactor QString::contains(QRegularExpression)
Unify the code of the two overloads; fix a typo in a warning;
and use an opportunity to insert a move.

Change-Id: I85eef86d35f0d1e2da25f09d92204e32abf6d7d3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-08-24 18:23:33 +02:00