Commit Graph

22874 Commits

Author SHA1 Message Date
Gabriel de Dietrich
a4c2e95ce1 Use own QIconEngine in QFileIconProvider
This allows us to lazily load icons from the platform theme
by reimplementing the pixmap(). Otherwise, we would instantiate
pixmaps in several sizes even though we would not need them
right away. Since, at least on OS X, icon sizes can go up to
128x128 pixels, we can end up saving an order of magnitude of
memory on icon pixmaps alone if we only use the smallest sizes
in our application.

Two side modifications are included. The first allows sub-
classing QPixmapIconEngine by exporting this class. The second
fixes the q_ptr in QFileIconProviderPrivate which was never set.

Change-Id: I91af322ded2823e475703871e607773177ae25d3
Task-number: QTBUG-41796
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2015-03-11 17:04:55 +00:00
Nico Vertriest
6ef8387e42 Doc: Json classes added to list of implic.shared classes
Task-number: QTBUG-44053
Change-Id: I52a1b6c413aaa594bfee9bf7484c3d0ce7e9c9fa
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-03-11 14:09:26 +00:00
Ulf Hermann
a3aaabc646 Clarify limitations of QCoreApplication::libraryPaths()
If you call libraryPaths() before constructing a QCoreApplication,
intersting things may happen.

Task-number: QTBUG-38598
Change-Id: I2861746277e391ede9e921e4a8ad825007e25fa0
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-03-11 14:08:24 +00:00
Shawn Rutledge
42a8613ffa QScreen availableGeometryChanged signal: emit correct value
Need to emit availableGeometry not geometry

Task-number: QTBUG-44916
Change-Id: I6eb7eb0b8e46d6d8249fa67f57374b25e21f2ade
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2015-03-11 14:08:08 +00:00
Laszlo Agocs
367a91d278 Enhance EGL_CONTEXT_LOST checks
Apparently failures can occur not just when doing eglMakeCurrent() but
also when creating window surfaces.

Change-Id: Ife1210293d5120fd41352164d9c89e83fb5ce468
Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-03-11 09:43:14 +00:00
Kai Koehne
f29007b1d5 Gui: Fix compilation with QT_NO_OPENGL
Change-Id: I96674b39fd4176cf9d93b7ce00efa2b035128b61
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-03-11 09:40:49 +00:00
Kai Koehne
fdb7fa937a Windows: Add -static-runtime configure option
Support statically linking the MSVC/mingw runtime libraries without
manually tweaking mkspecs. This is helpful for projects like the
installer framework.

MSVC does not support mixing MT[d]/MD[d] flags in different
compilation units. The static_runtime option is therefore added
to both QT_CONFIG and CONFIG.

Change-Id: Ifd6dc9c362090457de8e2c62477d0445f9479722
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-03-11 09:26:37 +00:00
Ulf Hermann
aad3c08902 Clean up QLibraryInfoPrivate::findConfiguration()
The QFile::exists() check in the end was redundant if one of the
!QFile::exists() had returned false before. By always doing the
positive check we can get rid of it and also avoid excessive
nesting.

Also, on OSX the isEmpty() clause probably never evaluated
to true, with the effect that qt.conf in an applicationDirPath was
never found.

Change-Id: I750735741b707d3e98c4bf6c6b9558618e1fcc59
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-03-11 09:10:18 +00:00
Nico Vertriest
8eaddf8343 Doc: corrected snippet issue in Defining Plugins doc
Task-number: QTBUG-44629
Change-Id: I70e20209b6b33f7adcbcafc6b7d959660cdc2e87
Reviewed-by: Martin Smith <martin.smith@digia.com>
2015-03-11 09:01:46 +00:00
Nico Vertriest
3128df99d6 Doc: QDataStream Serializing doc error
Task-number: QTBUG-44707
Change-Id: I0ccfb47fe0b2464c5b7331040ea658ace3442366
Reviewed-by: Martin Smith <martin.smith@digia.com>
2015-03-11 09:00:53 +00:00
J-P Nurmi
595c91f58a QGtkStyle: identify QtQuick.Controls.GroupBox as QAccessible::Grouping
This allows QGtkStyle to check the role and do appropriate styling
(bold font) for the label.

Task-number: QTBUG-43736
Change-Id: I735f5f7ffadd7a435fa9e28fab45b202eec0252e
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2015-03-11 07:59:36 +00:00
Shawn Rutledge
37b7c5164c xcb: another QXcbScreen null pointer check
In QXcbWindow::setParent(), the window may not have a screen,
and in that case we cannot get the root window in this way.

Task-number: QTBUG-44719
Change-Id: I719e5e2f8cad13b1460b4d9df6ffd6c4a48e0d37
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-03-11 07:46:01 +00:00
André Klitzing
cacae82a70 CMake: Fix regression with quoted OPTIONS parameter
If a parameter contains quotes the check for "-binary" fails.

Change-Id: I27148b590d85291a93f1992dfd277fb857bec6e2
Reviewed-by: Stephen Kelly <steveire@gmail.com>
2015-03-11 07:31:33 +00:00
Thiago Macieira
6272f01617 tst_QDateTime: remove silly test for timezone date too early
Let's not try to to compare our QTimeZone handling with the system one.
Our handling goes beyond the range of the POSIX APIs, so that's a recipe
for error.

Change-Id: Iee8cbc07c4434ce9b560ffff13ca4a4f335bdbae
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-03-11 07:23:21 +00:00
Andy Shaw
c87f8a3797 Windows: Only set the touch flags if the window is not already registered
It is possible for there to be a HCBT_CREATEWND hook which can set the
touch window flags already while the window is being created. Therefore
we want to defer to those settings instead as they should take precedence.

Change-Id: If8dcbd34db2b3bbbfb1bc36731665fb17fb87c24
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-03-11 07:15:53 +00:00
Daniel Vrátil
3b30a8215e Improve handling of XRandR events in XCB backend
Querying X server for data can be very expensive, especially when there
are multiple processes querying it at the same time (which is exactly what
happens when screen configuration changes and all Qt applications receive
XRandR change notifications). This patch is aiming to reduce the number of
queries to X server as much as possible by making use of detailed information
available in the RRCrtcChangeNotify and RROutputChangeNotify events.

Firstly, the backend now does not rebuild all QXcbScreens on any change (which
involved the very expensive xcb_randr_get_screen_resources() call), but only
builds the full set of QXcbScreens once in initializeScreens(), and then just
incrementally updates it.

Secondly, it avoids querying X server for all screens geometry as much as
possible, and only does so when CRTC/Output change notification for a particular
screen is delivered.

As a result, handling of all XRandR events on screen change is reduced from tens
of seconds to less then a seconds and applications are better responsive after
that, because we don't block the event loop for long. The X server is also more
responsive after the screen change, since we are not overloading it with requests.

Change-Id: I9b8308341cada71dfc9590030909b1e68a335a1f
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-03-11 07:15:28 +00:00
Thiago Macieira
d3f6249de3 tst_QDateTime: Mark more Windows incorrect transitions
The refactoring from a8c74ddcf7 commit
exposed more issues in the Windows API. There were already quite a few
QEXPECT_FAIL for this, so this isn't new.

For example, localtime(1351386000) on the Central European Timezone
should be "Sun Oct 28 02:00:00 CET 2012" (the second occurrence of 2
am), but the Windows API returns tm_isdst = 1 (i.e., still in the CEST
timezone) and that's incorrect.

Change-Id: I1bc63ac99b1d67b55d783f9606e5c59b24223b13
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-03-11 07:00:24 +00:00
Thiago Macieira
3b36a550b0 QDateTime: ensure we always use the daylight status if known
Refactor the code so that the localMSecsToEpochMSecs function always
gets the daylight status as input. The calculation can be very wrong if
we forget to set it.

Change-Id: I39e2a3fa6dc7c4a417f23288f10b303e450b8b98
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-03-11 06:56:54 +00:00
Thiago Macieira
7858838293 QTest: Print hex instead of octal for QByteArray QCOMPARE failures
Change-Id: Ia0aac2f09e9245339951ffff13c65b2234d01ad0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-03-11 01:50:29 +00:00
Thiago Macieira
7acc7a8eb3 Fix const correctness in Harfbuzz
to_tis620 modifies cstr, so it mustn't be const.

Change-Id: Ia0aac2f09e9245339951ffff13c8d77c886f767d
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-03-11 01:50:27 +00:00
Thiago Macieira
d6268ea91c QtSql: Fix const correctness in old style casts
Found with GCC's -Wcast-qual.

Change-Id: Ia0aac2f09e9245339951ffff13c94688f5b6ed76
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-03-11 01:50:25 +00:00
Thiago Macieira
6b38d9fa77 qdoc: Fix const correctness in old style casts
Found with GCC's -Wcast-qual.

Change-Id: Ia0aac2f09e9245339951ffff13c94687a79b3f40
Reviewed-by: Martin Smith <martin.smith@digia.com>
2015-03-11 01:50:23 +00:00
Thiago Macieira
a0e693b1e8 QtXml: Fix const correctness in old style casts
Found with GCC's -Wcast-qual.

Change-Id: Ia0aac2f09e9245339951ffff13c94686ec193958
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-03-11 01:50:23 +00:00
Thiago Macieira
ff807df6c9 QtDBus: Fix const correctness in old style casts
Found with GCC's -Wcast-qual.

Change-Id: Ia0aac2f09e9245339951ffff13c9468642b2db83
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-03-11 01:50:21 +00:00
Frederik Gladhorn
3dbb526329 Fix regression in time zone handling
In QtScript we use the msecs since epoch conversion (JS date is based on
the concept). After a8c74ddcf7 the date
conversion test in qtscript started to fail. Instead of relying on the
code working by chance, simply update the date when setting it with
setMSecsSinceEpoch.

Task-number: QTBUG-44885
Change-Id: I9f95c9cdccea52e7d1f808f3cb9e18570ef0df13
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-11 01:50:08 +00:00
Lars Knoll
a29b7635bd Simplify calculation of week number
This also removes a dependency to 3rd party licensed code.

Change-Id: Ia4818a5cf306501bdb7192265edc4bcba8e597d8
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-03-10 13:36:49 +00:00
Tor Arne Vestbø
de92efd448 CF event dispatcher: Decide if eventsProcessed before breaking out of loop
In the case of calling processEvents with WaitForMoreEvents and ending up
processing a Qt timer, we explicitly interrupt the runloop, as CF doesn't
normally treat handling timers as having handled a source. That way we
can re-evaluate whether processEvents should return.

But, we need to compute eventsProcessed before breaking out of the
Q_FOREVER loop, otherwise processEvents will return false when
waiting for events and processing a timer.

Change-Id: Ie5f8905228cce1508b5b2e040cf1186820855191
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
2015-03-10 12:48:32 +00:00
Tor Arne Vestbø
dfd6fc7bce iOS: Only use root level native runloop if at first level of processEvents
We used to support calling QEventLoop::exec() from within a processEvent
recursion and still jump down to the root native runloop, but this does
not work as intended due to how QEventDispatcherCoreFoundation uses
flags in its ProcessEventsState for e.g. deferred wake up or timer
updates. The logic in QEventDispatcherCoreFoundation assumes that
the next recursion to processEvents will be handled by itself, so
that it can interpret the flags in ProcessEventsState. The iOS
event dispatcher subclass, QIOSEventDispatcher, does neither of
these things, and should only be used from a 'clean' state.

Change-Id: I44fa156feecc45772806002465c35bef0797ead2
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
2015-03-10 12:48:16 +00:00
Tor Arne Vestbø
4c542ab592 iOS: Handle an QIOSViewController outliving its related QIOSScreen
We release the UIWindow that retains QIOSViewController in the
QIOSScreen destructor, but other parts of the OS may have retained
the view controller, so the dealloc may not happen until later. In
the meantime we may receive calls to shouldAutorotate, so we need to
guard this code for the situation that m_screen has been deleted.

Change-Id: Iefeb75f4fc698b5e80417ffd3a971b7de625bcd5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
2015-03-10 12:46:37 +00:00
Allan Sandfeld Jensen
3ce88e13b9 Add AVX2 autovectorized versions of premultiply
Following up on using GCC's autovectorizing for faster SSE4.1
premultiply, this patch adds specialized autovectorized versions
of premultiply for AVX2, giving another almost doubling in speed.
To make the speed up for AVX2 and also SSE4_1 available to non-GCC
compilers, the target-specific methods have been moved to separate
files.

Change-Id: I97ce05be67f4adeeb9a096eef80fd5fb662099f3
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-03-10 12:28:13 +00:00
Ulf Hermann
1fc6056ff5 Detect qt.conf in bundle on OSX without QCoreApplication
On OSX we don't need the applicationDirPath to find a qt.conf
located in the application bundle. Let's take advantage of this and
allow findConfiguration to use it.

Task-number: QTBUG-24541
Change-Id: I38c349a3bcd140fcf91352c88c24ca662e6e6f2e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-03-10 11:56:53 +00:00
Ulf Hermann
d96c29a5d1 Reload QLibraryInfo's settings when QCoreApplication becomes available
Some of the paths may only be resolvable if the application path is
known. On some platforms we can only figure out the application path
if argv[0] is known. Thus, if the paths have been queried before the
QCoreApplication is created, the cached settings may be wrong. We have
to reload them after creating the QCoreApplication.

Task-number: QTBUG-38598
Change-Id: Idf5822be87aa0872b099480040acd7b49939a22c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-03-10 11:48:24 +00:00
Alex Trotsenko
35ee5349f2 QIODevice: Fix some 64-bit issues
Change-Id: I77354a3069b256135c5792975a1445bcbe816e20
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-03-10 11:45:41 +00:00
Frederik Gladhorn
971b8413f2 QAbstractButton: emit released on focus out or disable
When pressing a button with the mouse and then moving the focus away,
the internal and visual state of the button would get updated, but the
released signal would not be emitted.
The same goes for disabling the button, although in 99% of the cases,
disabling the button will also move the focus, so the first case
already takes care of emitting the signal.

Task-number: QTBUG-42775
Change-Id: Ib6ba8e0a75f0349b66d1e799b02bd8498db85022
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2015-03-10 11:35:32 +00:00
David Edmundson
4c0c537421 Avoid detaching pixmaps when it has not changed
setDevicePixelRatio is often called unconditionally even when the
devicePixelRatio matches the pixmap or image.

This causes a lot of unncessary detaches wasting some memory.

Change-Id: I27535b2b22312ec0edc9bdc00c99d322afb727c1
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-03-09 21:14:16 +00:00
Frederik Gladhorn
1cc8ec1e78 Remove cruft
Change-Id: I8e0bf5b9befb0e9639da15b07072d046c038ea85
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2015-03-09 21:07:20 +00:00
Laszlo Agocs
6653e49cf2 Add missing flush for multisampled QOpenGLWidget
QOpenGLWidget exhibits the same issue as QQuickWidget in the linked bug.

Task-number: QTBUG-39917
Change-Id: Ib231fb88f73c6ef68f12cc3fecf462679e8184a7
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2015-03-09 14:49:31 +00:00
Eskil Abrahamsen Blomfeldt
ac3502345f Fix design metrics for text on Windows
The trick to get design metrics on Windows is to request the
font with the design size, however we were passing the em square
size in as the cell height instead of the em square size (aka
character height in Windows docs). This would give us hinted metrics
and thus the design metrics would differ from other platforms.

[ChangeLog][Windows][Text] Fixed design metrics for text

Task-number: QTBUG-44501
Change-Id: I4cffc3b86359cfdaf2ece07e1259f6fa862132bc
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-03-09 14:45:06 +00:00
Venugopal Shivashankar
3e6a14168b Example: Removed the code to handle 'num_entries' info.
The Google Suggest API doesn't return the 'num_queries'
anymore. Had to remove code related to 'num_queries' entry
so that the suggestion list shows up.

Task-number: QTBUG-42817
Change-Id: Ic918d1c86840fa4c1e18f32a984f5a9dd911261d
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-03-09 14:21:08 +00:00
Samuli Piippo
b0ae0db61a Remove neon command line options from configureapp
Neon support needs to be enabled unconditionally in mkspecs, so removing
-neon and -no-neon command line options from configure app. It now has
the same functionality as configure script.

Task-number: QTBUG-44690
Change-Id: Iaf5bf7ac4e11fcb798f643660e48a4ed3ce1036b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-09 14:19:31 +00:00
Samuli Piippo
a31823176a QNX: enable Neon support to be compiled in for QNX
Neon detection in configure does not work unless correct
flags are passed to compiler.

Task-number: QTBUG-44690
Change-Id: If119cc9ed80275aaa8796c1be8853559a7670d6a
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2015-03-09 14:19:24 +00:00
Thiago Macieira
afe3e24711 QPA plugins: Fix const correctness in old style casts
Found with GCC's -Wcast-qual.

Change-Id: Ia0aac2f09e9245339951ffff13c946899b4ba15b
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-03-09 13:21:38 +00:00
Tor Arne Vestbø
3d7a0111e3 iOS: Auto-detect available devices when running make check for testing
Change-Id: I447d8faf421c31de68dde64211b795eaccec17a4
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
2015-03-09 13:01:28 +00:00
Tor Arne Vestbø
17d690952b iOS: Use Xcode project to filter out environment variables instead of shell
Xcode has a setting for script phases to filter out the environment
variables, so we don't need to use grep.

Change-Id: Ica1c64321385ab3e3b47cf6f8f4d4191bd963540
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
2015-03-09 13:01:12 +00:00
Konstantin Ritt
58073a02fc [QFontEngineFT] Use FT_Library associated with a given face
Change-Id: I4f9927e2c5cb014523bebbe9c719aca89bb86019
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-03-09 12:34:56 +00:00
Andy Shaw
72ef272733 (Re)introduce loopLevel into QThread
This function used to reside in QEventLoop in Qt 3 and was deprecated in
Qt 4. However this is useful for those who want to know how many event
loops are running within the thread so we just make it possible to get at
the already available variable.

Change-Id: Ia6a7d94ff443a1d1577633363694bc2fa8eca7e4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2015-03-09 12:29:43 +00:00
Allan Sandfeld Jensen
1edd16879c Fix building tests on QNX
Use qmath and cmath methods instead of math.h methods.

Change-Id: I86ee2465c999822bf00a7cefee1642c4c30590a6
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
2015-03-09 11:23:24 +00:00
Laszlo Agocs
3fea1e53a1 Add joystick/gamepad recognition to device discovery
And to keep things readable, migrate to categorized logging.

Change-Id: Ie9d82bb4e93d3b96f1a7bf54a37cfde4a941bc7d
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
2015-03-09 11:13:54 +00:00
Andrew Knight
0fce009f1c eglfs_kms: remove deprecated QString uses
Fixes "warning: ‘QString::QString(const char*)’ is deprecated"

While we're here, make the locals const.

Change-Id: Iee70253a46f91937b93e06cc08cd361716cd669d
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-03-09 11:10:10 +00:00
Nico Vertriest
59495d180b Doc: removed invalid warning about Qt stylesheets
Task-number: QTBUG-44549
Change-Id: I386e75ae5c931f49a0198ae1f24706899bdedd94
Reviewed-by: Martin Smith <martin.smith@digia.com>
2015-03-09 10:38:13 +00:00