Commit Graph

23126 Commits

Author SHA1 Message Date
Kai Koehne
a60571b370 QSaveFile: Fix permissions on creation
QSaveFile is intended to be a replacement for QFile, and should use the
same permissions for newly created files. QTemporaryFile however creates
new files with 0600 mask by default.

Fix this by making the mode_t argument QTemporaryFileEngine uses
configurable, and using 0666 for QSaveFile (like we do in QFile).

[ChangeLog][Important behavior changes] Files created by QSaveFile do
now have the same rights as files created by QFile. This also fixes a
regression in QSettings: In the Qt 5.4 series, new files created by
QSettings were only readable by the current user.

Task-number: QTBUG-44086
Change-Id: Ie1cc20e9f25c6e72e1bc9176490c419c27c5fc82
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-04-08 07:48:17 +00:00
Laszlo Agocs
a715c6ceb8 Use the default fbo in Qt sense in blitFramebuffer
QOpenGLFramebufferObject::blitFramebuffer() passes 0 when no FBO is specified.
This goes against the rest of the framework where the default fbo is what
QOpenGLContext::defaultFramebufferObject() returns. This becomes significant
with QOpenGLWidget and on iOS.

Task-number: QTBUG-45328
Change-Id: Iaeb82cd3786ad395116679c9626bdcb10e93b4e3
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-08 05:58:27 +00:00
Alex Richardson
f041757d7a Allow overriding ar binary in configure script by setting AR env var
Unlike all the QMAKE_* command variables it requires the arguments "cqs"
to be part of the variable. This means we need to append the arguments
for compatibility with autoconf.

Change-Id: I961e89d506612873ba1f9cbecff97c448e83a5a2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-04-07 19:35:13 +00:00
Marc Mutz
8780381532 QByteArray: begin()/end() are not \internal
Docs copied from corresponding QString functions.

Change-Id: Ia2b0f0521780246d82003a1fda539c132823b294
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-04-07 16:34:25 +00:00
Marc Mutz
dc6e964f63 docs: QString contains characters, not items
Change-Id: I479a731780dfce81e138d1aca950385437266763
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-04-07 16:34:06 +00:00
Thiago Macieira
22dbf6111d Remove unnecessary QDateTime::detach() function
Last commit changed QDateTime::d to be a QSharedDataPointer that
implicitly detaches on non-const operator->() calls. That means we no
longer need to explicitly call detach().

More than that, we should not do it, so we avoid checking the ref count
and try to detach on every use. To do that, in functions where the d
pointer was accessed more than once, I detach at the top and shadow the
"d" variable with a local plain pointer. We don't compile our sources
with -Wshadow, so this should not be a problem.

Change-Id: Ic5d393bfd36e48a193fcffff13b969c281c36d0c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-04-07 14:48:47 +00:00
Topi Reinio
2a6249c00a Doc: Qt Concurrent: Link to essential usage information
Functions under the QtConcurrent namespace used to be documented
as header files, using the \headerfile command. These documents
have been since converted to standard pages using the \page
command, and the reference documentation for these functions
now live in the namespace page only.

However, the former pages contain useful usage information and
code snippets, but they've not been linked to from anywhere.

This change links to these pages from the module landing page,
as well as from the function reference doc.

Change-Id: Ia750d72d12503cec96ee2c9e202dd561e548cb24
Task-number: QTBUG-28977
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2015-04-07 14:38:29 +00:00
Konstantin Ritt
491b746473 Fix build with -directwrite
There were several issues caught by GCC:
* deleting object of polymorphic class type which has non-virtual
  destructor might cause undefined behaviour
* comparison between signed and unsigned integer expressions
* 'GetUserDefaultLocaleName' was not declared in this scope
  (depends on WINVER >= 0x0600)

Change-Id: I39f2cc0d5e158f4d85377edd55e9f74a512c7303
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-04-07 13:10:38 +00:00
Konstantin Ritt
3a845e4b4f Use QT_WARNING_.. instead of #pragma GCC diagnostic ..
Change-Id: I0bb55a7f1074f3b8d6fb681b1d4dab5105ae7569
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-07 13:09:48 +00:00
Konstantin Ritt
237cb0d082 [QFontEngineFT::loadGlyph] Consolidate paths for fetchMetricsOnly cases
Use GlyphInfo as a temporary buffer for storing the glyph metrics
and go through the same code for fetchMetricsOnly and !fetchMetricsOnly.

Change-Id: If8bb85056e5f09588cc3956b43dc51a54d5aecfe
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-04-07 13:09:27 +00:00
Konstantin Ritt
550fb85b65 [QFontEngineFT] Move code around to improve readability (no-op)
Move some variables initialization closer to the usage context.

Change-Id: I0f1de0ddc9f0fbe3ec4a56455ccc14f9e8d94e5a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-04-07 13:09:00 +00:00
Konstantin Ritt
037ad03182 [QFontEngineFT] Avoid double-negation of info.x
Make it consistent with fetchMetricsOnly path.

Change-Id: I6a2d2568d5579255582217515a4e598722547c60
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-04-07 13:08:02 +00:00
Konstantin Ritt
95d034a14f Introduce QQuaternion::fromDirection()
...which constructs a quaternion using specified forward and upward
directions, so that the resulting Z axis "faces" a given forward direction.

Change-Id: Ib77b8ab5c359a4880b0d946face87026acdc6f0b
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Michael Krasnyk <michael.krasnyk@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-04-07 13:07:48 +00:00
Konstantin Ritt
3fb6014ce7 [QFontEngineFT] Guarantee correct metrics for alphamap and its bounding box
...for both cached and non-cached modes, by disabling hinting
for transformed glyphs in loadGlyphFor().

Change-Id: I13766a653ebd72cbed0f5c38ca3536d042aed762
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-04-07 13:07:40 +00:00
Konstantin Ritt
134c6db858 [QFontEngineFT] Consolidate .*lpha.*MapForGlyph() behavior
...and decrease code duplication.

Change-Id: I5eb3c0694dde9030405a3bd3d410ff9784ed7717
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-04-07 13:06:55 +00:00
Marc Mutz
51028d1472 QQueue: unhide QList::swap(int, int)
Task-number: QTBUG-34197
Change-Id: I0b405ab0fabff8852b2705d651848fbff74fc4c2
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-04-07 13:05:50 +00:00
Oliver Wolff
32849f4997 qmake: Rework dll deployment
QT_INSTALL_LIBS is not the right place to check for Qt dlls, as they
cannot be found there in a non-developer build. In order to be able
to find the dlls and make adding dll locations easier for the user,
QMAKE_DLLS_PATHS was added. On Windows, the variable points to Qt's
bin directory by default.

Task-number: QTBUG-44960
Change-Id: Ie4e5beeaadee798a055599387e842d7c0502c27a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-04-07 12:55:24 +00:00
Morten Johan Sørvig
f8cb4ee310 Add tests for detach on setDevicePixelRatio()
Change-Id: I414ff0b794e0202a7f8c931b59b973cb1e7dc148

Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2015-03-24 11:22:36 +00:00
Topi Reinio
b929006513 qdoc: Use the title instead of plain name when listing groups
When listing group nodes, for example, with \annotatedlist command,
QDoc created a link with the plain name (the string that was passed
to \group command as parameter) as the link text.

This change makes QDoc use the group \title, if one exists.

Change-Id: I30b7f9eefc60c12f67b1e579bbc4c5cebe84474b
Task-number: QTBUG-45420
Reviewed-by: Martin Smith <martin.smith@digia.com>
2015-04-07 11:49:13 +00:00
Morten Johan Sørvig
6cd32e218d Add tests for detach on setDevicePixelRatio()
Change-Id: I414ff0b794e0202a7f8c931b59b973cb1e7dc148

Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2015-03-24 11:22:36 +00:00
Timur Pocheptsov
9b134f4e72 Add Q_UNUSED for parameter (OS X)
Ifdefs exclude the code on OS X, but there is still unused parameter
and annoying compiler (either warning or error, depending on ...).

Change-Id: I913c25b4f96ebe275a6b1d15873bccf4aebe9e7a
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2015-04-07 10:39:46 +00:00
Alex Trotsenko
add3c14a28 QAbstractSocket: fix some 64-bit issues in debug code
Change-Id: I78b307b2841353f84b033a815035436ec3eef3b0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-07 06:42:42 +00:00
Morten Johan Sørvig
0b6bfe8c44 Add tests for detach on setDevicePixelRatio()
Change-Id: I414ff0b794e0202a7f8c931b59b973cb1e7dc148

Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2015-03-24 11:22:36 +00:00
Thiago Macieira
9eb0b09abc Removed unused code on QT_STRING_UCS4 macro
This isn't defined or used anywhere else.

Change-Id: I9a75ad8521ae4e5cbbe5ffff13d2356883b82dbc
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2015-04-05 19:40:04 +00:00
Morten Johan Sørvig
d9437af198 Add tests for detach on setDevicePixelRatio()
Change-Id: I414ff0b794e0202a7f8c931b59b973cb1e7dc148

Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2015-03-24 11:22:36 +00:00
Kai Koehne
1db3de6a1e QVLA: Add operator= for initializer lists
Add a dedicated operator=(std::initializer_list) that
first resizes the QCLA, and then replaces the elements
one by one.

This should be usually faster than creating a temporary
QCLA and then copying it, except for the case where the
new array does not fit into the allocated stack - but this
is IMO nothing to optimize for.

Task-number: QTBUG-45041
Change-Id: I147d6d01186b1ca3c635b2c8365d8f6e638ce6fe
GPush-Base: 08de3113051e1289f0de0651ec5647c9ee6feb27
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-04 15:48:13 +00:00
Allan Sandfeld Jensen
c51240ca75 Optimize fetching pixel values for SSE2 bilinear sampling
Most of the CPU time was spending in fetching pixel values instead of
calculating the bilinear sample. The access to vectors unions turns
out to be very slow, and should be avoided. This patch removes the
uses of vector,int array union in the bilinear sampling for SSE2.

Change-Id: Ie765a80963c4899db59a583ea9a59d15e05f2b13
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-04 15:42:22 +00:00
Morten Johan Sørvig
22b5e178e5 Add tests for detach on setDevicePixelRatio()
Change-Id: I414ff0b794e0202a7f8c931b59b973cb1e7dc148

Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2015-03-24 11:22:36 +00:00
David Faure
5aa40e5b00 QComboBox: also adjust size on model reset, with AdjustToContents
When the size adjust policy is QComboBox::AdjustToContents, the combobox
sizeHint was recalculated on dataChanged, rowsInserted, rowsRemoved,
and setModel, but not when the model was reset. This led to truncated
items in the combobox when models are filled asynchronously.

Task-number: QTBUG-5413
Change-Id: I3456c327d680dfffa58d6dcb26c79456c67b2a32
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-04-04 12:24:44 +00:00
Sérgio Martins
ddb0628181 Fix BlackBerry build.
BlackBerry SDK uses gcc 4.6 which supports nullptr, but by default
it uses the dinkum C++ library, which doesn't support nullptr_t.

Change-Id: Ifa95029a9bfa4dc2fc064db5d7a67012e95ac0e2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-04 11:55:23 +00:00
Morten Johan Sørvig
558c9caddd Add tests for detach on setDevicePixelRatio()
Change-Id: I414ff0b794e0202a7f8c931b59b973cb1e7dc148

Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2015-03-24 11:22:36 +00:00
Saytgalin Alexander
1bd07b0293 Always release surfaces when application is suspended or hidden.
It is needed to recreate surfaces and to redraw when application is
resumed because on some devices when the application is suspended
Android destroys the surfaces.

Change-Id: I8934e94af038b4ecf116d93aea223ad040b0bff1
Task-number: QTBUG-45019
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Reviewed-by: Sergey Galin <s.galin@2gis.ru>
2015-04-04 09:12:03 +00:00
Richard Moe Gustavsen
d3277bdf02 QComboBox: open popup on touch release if QStyleHints has setFocusOnTouchRelease()
If we give focus to the combobox on touch release, we need to await opening
the popup until touch release as well. Otherwise we might end up showing
a popup for an unfocused combobox.

Especially on iOS, there is a strong coupling between focus object and
popup menus, which means that we effectively require the combobox to gain
focus before it can show the popup.

Change-Id: Ifb7ba091bb39b77f325cdbf61e00ab3e8ff2e522
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2015-04-04 08:47:06 +00:00
Richard Moe Gustavsen
9cb38baaf8 iOS: check if Qt has an active window before scrolling to cursor
In hybrid applications an external view can be first reponder. And when
that is the case, Qt will have no active windows and focusView will return 0.
We therefore need to protect scrollToCursor from this case, so it doesn't try
to access e.g focusView().window, which will lead to a crash.

Task-number: QTBUG-45182
Change-Id: I87d470631f5beda22fd64fc1f2b0f7259344f830
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2015-04-04 08:46:57 +00:00
Richard Moe Gustavsen
ce4a759c3d iOS: enable changing menu items in QIOSMenu while it's showing
If the menu items change while a menu is showing, the current
implementation would crash. The current code tried to take this
scenario into account by using a copy of the item list inside
the native menus, but failed since the list contained pointers
to menu items. And those items would be deleted in a higher layer
when removed from the owning QMenu, even if the native menu was
visible.

One could argue that the list of items should not change while
the menu is visible, but from testing, other platforms handle
this scenario gracefully. So this patch will ensure we do the
same on iOS.

Task-number: QTBUG-44275
Change-Id: I5508e1d6d47039a9aa948c246b33479bd6801868
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2015-04-04 08:46:42 +00:00
Alex Trotsenko
f40cf77b0f QIODevice: do not change the 'pos' member for sequential devices
Concept of 'current position' exists only for random-access devices.
As documented, for sequential devices QIODevice::pos() must always
return 0. Prevent a modification of the internal 'pos' member in
QIODevice::readAll() method to follow this rule.

Change-Id: Ida2ee6a629ccfc3068d62f95ab1064ada13fdda5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-04 08:40:01 +00:00
Morten Johan Sørvig
6dcbaa487d Add tests for detach on setDevicePixelRatio()
Change-Id: I414ff0b794e0202a7f8c931b59b973cb1e7dc148

Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2015-03-24 11:22:36 +00:00
Marc Mutz
1b109967c5 QUuid: add missing relational operators
QUuid has ==, !=, <, and >. Add <= and =>, too.

Change-Id: I11a0b8028be766e2d48dc7664d935df4d327b3d3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-04 06:40:27 +00:00
Marc Mutz
09c1bd2eb0 QUuid: add some noexcept
Change-Id: I43647e558a761ff6e7a275e30382919ba038f467
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-04 06:40:00 +00:00
Morten Johan Sørvig
23330d498d Add tests for detach on setDevicePixelRatio()
Change-Id: I414ff0b794e0202a7f8c931b59b973cb1e7dc148

Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2015-03-24 11:22:36 +00:00
Marc Mutz
2b3d3cabe1 QUuid: properly scope macros
Limit scope and undef after last use.

Change-Id: I94f0adb2b9fc3ec65dd7a3b5e6f03685bc226d3d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-03 19:44:08 +00:00
Marc Mutz
650de56c7f QUuid: implement op> in terms of op<
More maintainable, and less code.

Change-Id: Ia99e5deefe4c510fe870076a03ec243ba631a7a3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-03 19:43:59 +00:00
Timur Pocheptsov
a72b3ab73c QSSLSocketPrivateBackend::transmit - fix Secure Transport version
New SSL backend fails to read data most of the time.

This patch:

1. Removes direct call to _q_SSLRead - it was never executed (intentionally)
   and is completely  horrible and redundant.
2. Changes the reading loop - read not while we have bytesAvailable, but
   until we have errSSLWouldBlock.

Change-Id: I3fc5ff94ded76fcc1748d4979f7af85740b4b6aa
Task-number: QTBUG-45290
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Jeremy Lainé <jeremy.laine@m4x.org>
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
2015-04-01 15:36:45 +00:00
Christoph Schleifenbaum
2432a821aa Cocoa: Fix minimizing/zooming frameless windows.
Use miniaturize instead of performMiniaturize when the window has no
minimize button (even if frameless).
Make sure the window is resizable before performing zoom. Even restore
this, of course.

Change-Id: I43217153b4d4fcec0ded4afcde3009817e01feba
Task-number: QTBUG-32184 QTBUG-45339
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2015-04-01 15:17:32 +00:00
Timur Pocheptsov
9f34943245 Revert "Cocoa plugin - showMaximized/showMinimized and Qt::FramelessWindowHint"
This reverts commit d024f0a922.
Qt::FramelessWindowHint actually DO require 'non-resizable' window.
Let's assume, non-resizable means 'resize by mouse dragging'.
There is a better fix that will follow this patch (temporary
setting/resetting resizable mask).

Change-Id: I61cefcade437d3e54719e2e1ff0e8d070c577df0
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2015-04-01 15:17:20 +00:00
Thiago Macieira
f25d6ad2aa forkfd: Fix compilation with older glibc
glibc 2.9 is required for pipe2 and version 2.7 for eventfd.

Bionic added them to Android version 2.3.1, but I can't find a version
macro.

uclibc masquerades as glibc version 2.2, so this function won't be
thread-safe with uclibc.

Change-Id: Iee8cbc07c4434ce9b560ffff13cd3c3b63dd7e83
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2015-04-01 14:44:42 +00:00
Friedemann Kleint
06671a3cbd Windows: Use FORMAT_MESSAGE_IGNORE_INSERTS for qt_error_string().
This will cause FormatMessage() to return messages with placeholders
as well even though we do not pass the message parameters (for
example: "The operating system cannot run %1." for ERROR_INVALID_ORDINAL).

Task-number: QTBUG-43164
Change-Id: Ib95c1c0fabb543bbe4e8ab2bd8f244f73dff5fa4
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-04-01 14:26:43 +00:00
Olivier Goffart
5322200076 Silence clang warnings in C++03 mode
C++03 forbid the use of local or unnamed type as template parameter.
But in C++11 that is allowed, and clang accept them even in C++03
mode, but with a warning.

The Warning happen for example with this code:

  enum { Foo = 3 };
  int x = 3 << Foo;

Then the compiler issues warnings:

metatype.h:1379:31: warning: template argument uses local type [-Wlocal-type-template-args]
        enum { Value = sizeof(qt_getEnumMetaObject(declval())) == sizeof(QMetaObject*) };
                              ^~~~~~~~~~~~~~~~~~~~
qdebug.h:269:42: note: in instantiation of template class 'QtPrivate::IsQEnumHelper<(anonymous enum)>' requested here
typename QtPrivate::QEnableIf<QtPrivate::IsQEnumHelper<T>::Value, QDebug>::Type operator<<(QDebug dbg, T value)

Normaly the compiler should not even try to instantiate the operator<<
with such types in C++03 mode.

Change-Id: I48c7d5d1836fd87986835fe15c7e0b1beb73c728
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-01 14:20:50 +00:00
Olivier Goffart
8cec5e9a34 Update a few doc regarding Q_FLAG
Change-Id: Ic26b3d64c9a5d5109bd8a0b359f063529d0181fc
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-04-01 14:20:28 +00:00
Andrew Knight
4a6ba203b5 winrt: Fix non-PCH build
This cpp file did not include its header.

Change-Id: Ib68f4a1470c1dc213add5e8825ef972c07ee57df
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-04-01 14:13:30 +00:00