3 years agotst_QDialog::snapToDefaultButton - tune the test for OS X 5.5
Timur Pocheptsov [Wed, 13 May 2015 07:55:03 +0000 (09:55 +0200)]
tst_QDialog::snapToDefaultButton - tune the test for OS X

QCursor::setPos with Cocoa integration is calling CGEventPost. Some time is required
before the cursor position is really set, so we can not immediately call QCOMPARE.

Change-Id: I83a4c13f06ec151a4b9ab18c83de1eb5247ea9cc
Task-number: QTBUG-45553
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
3 years agoTests: Remove EXPECT_FAIL in tst_QWidget::widgetAt()
Caroline Chao [Fri, 15 May 2015 07:17:22 +0000 (09:17 +0200)]
Tests: Remove EXPECT_FAIL in tst_QWidget::widgetAt()

The test is marked as XPASS in CI. This change follow 201bf9e6736a3.

Change-Id: I0938b1417f792aa88fc1b40c08e7cd810e7d22f7
Task-number: QTBUG-22326
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
3 years agoxcb: Fix FP1616 to double conversion
Alexander Volkov [Thu, 14 May 2015 09:49:31 +0000 (12:49 +0300)]
xcb: Fix FP1616 to double conversion

We should divide the fractional part of the FP1616 value by 0x10000
instead of 0xFFFF, otherwise 1.FFFF will be converted to 2.0.
And right-shifting the integer part by 16 is equal to dividing it
by 0x10000. So just divide the whole FP1616 value by 0x10000.

Change-Id: Ia89a274b81be9cf502e1f311f696a610a7f37d7f
Task-number: QTBUG-45378
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
3 years agoReorder member variables to avoid padding.
Volker Krause [Mon, 11 May 2015 08:45:38 +0000 (10:45 +0200)]
Reorder member variables to avoid padding.

Saves 8 byte in each case on 64bit systems, no change on 32bit systems.

Change-Id: I2a2e8786fc7914ee9ae369ba05bedfc9e5e0ca5c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
3 years agoSet correct target.path for legacy GL examples
Morten Johan Sørvig [Wed, 13 May 2015 19:30:04 +0000 (21:30 +0200)]
Set correct target.path for legacy GL examples

Fix Library not loaded/image not found error on application

With @rpath enabled (commit 6e18f57a) qmake now requires
a correct target.path in order to emit correct -rpath @loader_path
linker directives.

Change-Id: Ia32b038ad2d64819477be5cd9d1ed36768e2251b
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
3 years agoBetter match thin font styles
Allan Sandfeld Jensen [Wed, 13 May 2015 11:13:51 +0000 (13:13 +0200)]
Better match thin font styles

A style name 'Extra Thin' or 'Thin Italic' should be parsed as Thin
font weight.

Change-Id: I8acebed7330c23231b3742d887081d8b3d0aeb19
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
3 years agoFix division by zero crash when restoring screen settings
Kati Kankaanpaa [Wed, 13 May 2015 17:28:42 +0000 (10:28 -0700)]
Fix division by zero crash when restoring screen settings

The restoredScreenNumber was used before it's existence was checked,
which caused 'division by zero' if the screen has been removed after
storing the screen number.

The check if restoredScreenNumber exists was moved to happen before
restoredScreenNumber is used for the first time.

Change-Id: Iada0e8c5cbb6d8ca88df171dbee045be249f50cd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
3 years agoQSize, QSizeF: Add Q_REQUIRED_RESULT
Sérgio Martins [Fri, 8 May 2015 17:13:44 +0000 (18:13 +0100)]

...to signatures matching the pattern:
T T::<verb in past tense>() const;

Change-Id: I75d724a3eef5cb94559e31d86914c6e0655b7f13
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
3 years agoiOS: remove 'truncation from double to float' compiler warning
Richard Moe Gustavsen [Mon, 11 May 2015 12:21:06 +0000 (14:21 +0200)]
iOS: remove 'truncation from double to float' compiler warning

Change-Id: I0b4b1f062180cfe09ceb275484c39afeaaa90cac
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
3 years agoIntroduce a version number to QPlatformInputContextFactoryInterface.
Friedemann Kleint [Mon, 11 May 2015 08:00:30 +0000 (10:00 +0200)]
Introduce a version number to QPlatformInputContextFactoryInterface.

Append a version number to QPlatformInputContextFactoryInterface_iid
as is done for QPlatformIntegrationFactoryInterface. Start with 5.1 since
c91c05b056c769c3df0d7634aed7d9bf2c0e550d changes the API in 5.4.
Use macro in plugins.

Task-number: QTBUG-46009
Change-Id: I1d1a89bde50d263354f33a6917efb1c084211842
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
3 years agoIntroduce a version number to QPlatformPrinterSupportFactoryInterface.
Friedemann Kleint [Mon, 11 May 2015 07:36:17 +0000 (09:36 +0200)]
Introduce a version number to QPlatformPrinterSupportFactoryInterface.

Append a version number to QPlatformPrinterSupportFactoryInterface_iid
as is done for QPlatformIntegrationFactoryInterface. Start with 5.1 since
a6bcdf151647ab7a97c9fe1d2c8c8dd2b718244e changes the API in 5.5.
Use macro in plugins.

Task-number: QTBUG-46009
Change-Id: Ib9d2a02d20b9c4c6ad6c1045a907d69d80e3def4
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
3 years agoIncrease version number of QPlatformIntegrationFactoryInterface.
Friedemann Kleint [Mon, 11 May 2015 07:27:02 +0000 (09:27 +0200)]
Increase version number of QPlatformIntegrationFactoryInterface.

Increase version 5.2->5.3 in macro
QPlatformIntegrationFactoryInterface_iid and use that in the plugins.

Task-number: QTBUG-46009
Change-Id: I491ab0ac169ede5c103b40e1bcbcbf511922a911
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
3 years agoQPA plugins: Use _iid macros instead of strings in Q_PLUGIN_METADATA.
Friedemann Kleint [Mon, 11 May 2015 08:16:32 +0000 (10:16 +0200)]
QPA plugins: Use _iid macros instead of strings in Q_PLUGIN_METADATA.

This makes it easier to change the version numbers by changing
the macros in QtGui.

Task-number: QTBUG-46009
Change-Id: I94c9591ec6f7c9173a698df9e1fe8fd6a904caf4
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
3 years agomoc: Generate qt_static_metacall for creatable-only gadgets
Gabriel de Dietrich [Mon, 11 May 2015 11:11:59 +0000 (13:11 +0200)]
moc: Generate qt_static_metacall for creatable-only gadgets

Prior to this, moc would not generate the function unless the
gadget class had a property or a non-constructor invokable.

Change-Id: Ic020ea5f8f59702f5e9e194a46e26850e53e5cfe
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
3 years agomoc: Fix type for gadget's CreateInstance metacall
Gabriel de Dietrich [Mon, 11 May 2015 10:52:34 +0000 (12:52 +0200)]
moc: Fix type for gadget's CreateInstance metacall

An error similar to the one below would be emitted
by the compiler on the moc generated file:

error: assigning to 'QObject *' from incompatible type 'Gadget *'
       if (_a[0]) *reinterpret_cast<QObject**>(_a[0]) = _r; } break;

Change-Id: I75ae7bd6c46d20db2d47a80eaa08aae302d7d6c8
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
3 years agoDoc: Added the Qt Multimedia backends wiki link
Venugopal Shivashankar [Tue, 12 May 2015 12:59:02 +0000 (14:59 +0200)]
Doc: Added the Qt Multimedia backends wiki link

The wiki will be linked to from the Qt Multimedia
index page.

Change-Id: I2b60c203f759494cdf12021659847817007639f1
Task-number: QTBUG-30381
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
3 years agoRemove QNSView from superview in ~QCocoaWindow()
Morten Johan Sørvig [Mon, 11 May 2015 19:56:57 +0000 (21:56 +0200)]
Remove QNSView from superview in ~QCocoaWindow()

A QNSView without a corresponding live QCocoaWindow
object is not in a valid state. Previously we would
call removeFromSuperview for child QWindows to avoid
having Cocoa send messages to the now invalid QNSView.

Do this for QWindows embedded in native Cocoa
hierarchies as well.

Change-Id: I49c6daef8ed061b3f40138fe9b4ce6be190f2fd0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
3 years agoPurge default locations from commonly used device makespecs
Laszlo Agocs [Tue, 12 May 2015 12:50:42 +0000 (14:50 +0200)]
Purge default locations from commonly used device makespecs

Including /usr/include and lib can cause cryptic failures if there is
already a Qt installed to /usr.

Having standard locations listed should not be necessary at all.

Change-Id: I08a15a064cc1aec126733f7e1962a2fa2ec38fcb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
3 years agoQSysInfo: Expand Linux distribution detection
Caroline Chao [Wed, 15 Apr 2015 11:26:55 +0000 (13:26 +0200)]
QSysInfo: Expand Linux distribution detection

Expand Linux distribution detection to /etc/redhat-release and
/etc/debian_version to follow what /usr/bin/lsb_release script does.
If /usr/bin/lsb_release fails to extract the distribution information
from /etc/lsb-release, it then checks /etc/redhat-release and, as a last
fallback, /etc/debian_version.

Some Red Hat distributions have a /etc/lsb-release file that
does not provide the values we are looking for (DISTRIB_ID,

If both productType or productVersion are empty after reading
/etc/lsb-release, readEtcLsbRelease() will return false, allowing
further parsing of /etc/redhat-release. This scenario mimics what
the /usr/bin/lsb_release script does if /etc/lsb-release does not
contains enough information.

The productType and productVersion returned by QSysInfo after reading
/etc/redhat-release match the distributor id and release information
returned by the /usr/bin/lsb_release script.

For Debian Linux distributions where /etc/os-release, /etc/lsb-release
and /etc/redhat-release are not available nor usable, the
/usr/bin/lsb_release script also checks for the /etc/debian_version

In this case, we also enable parsing of /etc/debian_version to retrieve a
fallback productVersion, the productType being set to Debian.

Change-Id: Ia20d513d78be8a8ee8c0410d0aaa052fde81a41d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
3 years agoTests: Remove tst_QHostInfo::abortHostLookupInDifferentThread() test
Caroline Chao [Wed, 29 Apr 2015 08:05:09 +0000 (10:05 +0200)]
Tests: Remove tst_QHostInfo::abortHostLookupInDifferentThread() test

This test has been initially blacklisted. However it is racy by design
and cannot be fixed. Removing it.

Change-Id: I6c386a12e54d8a382f17c4fc033428f56eb03f02
Task-number: QTBUG-23837
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
3 years agoCocoa integration - implement Qt::WindowModal file dialogs
Timur Pocheptsov [Fri, 24 Apr 2015 14:48:14 +0000 (16:48 +0200)]
Cocoa integration - implement Qt::WindowModal file dialogs

Previously, for Qt::WindowModal dialogs  we were creating modal sheet with beginSheetModalForWindow:
and later (from exec) calling -runModal, essentially making a window modal dialog into (now) application
modal sheet, which is not right- it's centered relative to desktop and the jump from window modal sheet's
position (centered relative to a window) to application modal was quite visible.
Now, instead of [panel runModal] (== [NSApp runModalForWindow:panel])
we call [NSApp runModalForWindow:theRequiredWindow].

Change-Id: I793dc72c7d1fe96497bb35754f4d0eac9a5e00e5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
3 years agoCocoa: Upgrade default surface format to include an alpha channel
Ulf Hermann [Wed, 8 Apr 2015 12:46:32 +0000 (14:46 +0200)]
Cocoa: Upgrade default surface format to include an alpha channel

The default surface format on OS X is changed to RGBA since this
is most performant. You can request a different surface format to
change this. You can not request the default format without alpha
channel, though.

Change-Id: I4f44d0abe01515c98ba699c76a0dd5e37b873766
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
3 years agoRemove init() function declaration.
Morten Johan Sørvig [Wed, 13 May 2015 08:18:44 +0000 (10:18 +0200)]
Remove init() function declaration.

Fix doc error. This function is not used in Qt 5
and there is no definition for it.

Change-Id: Id7e4fe1ada54005f65a559ae1ab393d011c37480
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
3 years agoBuild qtconnectivity for iOS.
Alex Blasche [Mon, 11 May 2015 09:01:53 +0000 (11:01 +0200)]
Build qtconnectivity for iOS.

Starting with Qt 5.5 qtconnectivity on iOS is supported

Change-Id: I30430ce351b7e2fc8031c5719bed5354ed234cc7
Task-number: QTBUG-45988
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
3 years agoConsider "assets" scheme as a local file on Android
BogDan Vatra [Tue, 12 May 2015 06:37:52 +0000 (09:37 +0300)]
Consider "assets" scheme as a local file on Android

Task-number: QTBUG-46010
Change-Id: Icb6c5c2529b77e3967f6d23217e63e7773a5d706
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
3 years agoBuild Qt for OS X and iOS with relative rpath.
Adam Strzelecki [Thu, 7 Aug 2014 11:04:48 +0000 (13:04 +0200)]
Build Qt for OS X and iOS with relative rpath.

Defaulting to absolute_library_soname on configure -rpath is no longer
necessary as now we support @rpath install name ids on OS X and iOS.

This also sets QMAKE_SONAME_PREFIX to @rpath for Qt modules when built
with rpath configuration.

This makes Qt libraries relocatable on OS X. Qt SDK is not yet
relocatable though, because plugin locations (including cocoa plugin)
are still resolved using absolute path (see QTBUG-14150). Also, there
are several absolute paths hardcoded in qmake mkspecs pri files.

Task-number: QTBUG-31814
Change-Id: I36b9384cd69ac609608acbe2b3d5e0512317e0d6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
3 years agoFix MSVC 64 bit compiler warnings in 3rdparty code
Kai Koehne [Tue, 12 May 2015 10:05:01 +0000 (12:05 +0200)]
Fix MSVC 64 bit compiler warnings in 3rdparty code

Make casts from size_t to int explicit to avoid warnings like

warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data

Change-Id: Ib69c25519dadf8732b0c08412cc97887df00a2d4
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
3 years agoQQuaternion: optimize op*
Marc Mutz [Mon, 4 May 2015 11:43:02 +0000 (13:43 +0200)]
QQuaternion: optimize op*

Swap subexpressions around so the expressions involving w
(the first member in memory order) execute first.

And no, compilers don't do that automatically. Well, GCC 4.9 doesn't.

Change-Id: I918ecc27a9ac9775fa91968c0548d182d7ad28e3
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
3 years agoFix hidden detach
Sérgio Martins [Tue, 12 May 2015 10:37:17 +0000 (11:37 +0100)]
Fix hidden detach

The methods are const but the member is mutable.

Spotted being detached a few times at app startup.
Strings were a few hundred chars big.

Change-Id: Iaa3dc42a4f01f819a3fc4f8d756e35d38ce0aa1b
Reviewed-by: David Faure <david.faure@kdab.com>
3 years agoQQuaternion: Deprecate conjugate() and introduce conjugated()
Sérgio Martins [Sun, 3 May 2015 19:03:00 +0000 (20:03 +0100)]
QQuaternion: Deprecate conjugate() and introduce conjugated()

Change-Id: I9aa835138e1e33448fea920f7a5ba99b26a95ebf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
3 years agoDon't assume QLocale::codecForLocale always returns non-null
Konstantin Ritt [Wed, 6 May 2015 18:24:46 +0000 (22:24 +0400)]
Don't assume QLocale::codecForLocale always returns non-null

It may return null during program exit, due to QCoreGlobalData global
static already having been destroyed, or due to the codec name/mib being
unsupported by ICU. If that's the case, QTextStream needs to fall back
to Latin 1, like QString::toLocal8Bit and fromLocal8Bit already do.

Change-Id: Ia888243669e051e78e0dbe0bb1bc55a1c4f519d8
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
3 years agoFix overcaching the fallback families list for a requested family
Konstantin Ritt [Wed, 22 Apr 2015 02:27:16 +0000 (06:27 +0400)]
Fix overcaching the fallback families list for a requested family

The cached list didn't take fontStyle, styleHint and script into account.
As long as QFontCache isn't explicitly disabled, loadEngine() rarely
called for the same family, foundry, style and size - so avoid caching
anything here at all.

Change-Id: I7779bf33fc074edc00799f9a39d67327f8c88ccc
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
3 years agoSimplify QFontDatabase::findFont()
Konstantin Ritt [Fri, 1 May 2015 04:18:36 +0000 (08:18 +0400)]
Simplify QFontDatabase::findFont()

QFontDatabase::load() is the only caller that passes non-null
QFontPrivate* to QFontDatabase::findFont(), to adjust the pointSize
with regards to the font's dpi; do that right in QFontDatabase::load().
The `multi` param's meaning is, in fact, an absence of the
QFont::NoFontMerging flag,
so prefer the latter and prevent ambiguity in the future.

Change-Id: Icc7751044e454ca438e7627364faa415287bf1ae
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
3 years ago[QFontDatabase::findFont] Get rid of the refactoring leftovers
Konstantin Ritt [Fri, 1 May 2015 04:14:04 +0000 (08:14 +0400)]
[QFontDatabase::findFont] Get rid of the refactoring leftovers

The logic this code was aimed for has been covered by a more complete
solution in QFontDatabase::load() years ago; simply drop the dead code.

Change-Id: Id8860353ff4f4d2f1529aa89810d6c5725e97d24
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
3 years agoFix compile error in XCB when XInput version < 2.2
Kati Kankaanpaa [Thu, 7 May 2015 20:56:41 +0000 (13:56 -0700)]
Fix compile error in XCB when XInput version < 2.2

Add version guards to prevent compiler error:
'XITouchClass' was not declared in this scope
in systems having XInput version < 2.2.

Change-Id: Ib1308f29ef97288eb994ab8bdd668199ca2ee1d7
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
3 years agoUpdate PCRE to 8.37
Giuseppe D'Angelo [Tue, 28 Apr 2015 14:01:36 +0000 (16:01 +0200)]
Update PCRE to 8.37

Change-Id: I0668a8ccdebc1a6b5f1cb8bbb74d91b44ac937f8
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
3 years agococoa: Do not access the integration instance when shutting down
Laszlo Agocs [Fri, 8 May 2015 14:41:40 +0000 (16:41 +0200)]
cocoa: Do not access the integration instance when shutting down

Task-number: QTBUG-46016
Change-Id: Icb7f0c73d5fe944538e2b9abf50c2532037e932f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
3 years agoOptionally apply orientation on QImage read
Allan Sandfeld Jensen [Mon, 4 May 2015 11:32:32 +0000 (13:32 +0200)]
Optionally apply orientation on QImage read

Make it possible to read images with EXIF orientation automatically
applied. This was originally implemented without opt-out in Qt 5.4, but
reverted. Here it is implemented as opt-in for JPEG, and opt-out for TIFF
to keep behavioral consistency.

The EXIF support for JPEG was written by Rainer Keller.

[ChangeLog][QtGui][Image plugins] An option has been added to
QImageReader to enable automatic application of EXIF orientation.
This behavior was default in Qt 5.4.1, but reverted in Qt 5.4.2.

Task-number: QTBUG-37946
Task-number: QTBUG-43563
Task-number: QTBUG-45552
Task-number: QTBUG-45865
Change-Id: Iaafd2519b63ede66ecc1f8aa4c7118081312b8f5
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
3 years agoRemove effectless statement.
Bjoern Breitmeyer [Tue, 28 Apr 2015 12:15:31 +0000 (14:15 +0200)]
Remove effectless statement.

The UNDER_NT define is useless as the include
already happens before in qfunctions...

Change-Id: I25fc23e169ce91d787331a7a86023aa7b424d687
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
3 years agoremove $INCLUDE/$LIB hack for mingw
Oswald Buddenhagen [Thu, 7 May 2015 09:54:17 +0000 (11:54 +0200)]
remove $INCLUDE/$LIB hack for mingw

mingw is not msvc, and nobody in their right mind would expect it to
behave like it.

[ChangeLog][Important Behavior Changes][qmake] Qt configure and qmake
used with a MinGW spec will no longer emulate MSVC by picking up the
INCLUDE and LIB environment variables. Use the -I/-L configure options
to pass additional paths, as you would under Unix.

Change-Id: I533bb97de34d14dcbd45e0416283a79f44096c67
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
3 years agoCreate contexts and pbuffers with the correct screen in QOpenGLWidget
Laszlo Agocs [Thu, 7 May 2015 17:00:11 +0000 (19:00 +0200)]
Create contexts and pbuffers with the correct screen in QOpenGLWidget

It won't be functional otherwise with GLX when the QOpenGLWidget is targeting
a separate X screen.

Change-Id: Ibe5b89023f833039bb67d94b78b173de2e021ac9
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
3 years agoCreate context with the correct screen in QOpenGLWindow
Laszlo Agocs [Thu, 7 May 2015 16:51:42 +0000 (18:51 +0200)]
Create context with the correct screen in QOpenGLWindow

Targeting a non-primary screen with a QOpenGLWindow requires (at least
with GLX) that the context is created with the same screen. Otherwise
the context cannot be used with the window (BadMatch due to different
X screens)

Change-Id: I64f38ad7317d39a164bb69bb1430692319fc49d4
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
3 years agoFix the qscreen manual test for separate X screens
Laszlo Agocs [Thu, 7 May 2015 16:05:00 +0000 (18:05 +0200)]
Fix the qscreen manual test for separate X screens

It is fully possible to show a window on all the connected screens
even when the screens are not virtual siblings, i.e. they do not
form one big desktop. When X is configured to use a separate screen
for each physical screen, it becomes essential to do setScreen()
either directly or via QDesktopWidget in case of widgets. The original
code attempting to call QWindow::setScreen() cannot succeed since there
is no QWindow available before the widget is shown. This is easy to
work around.

The app now works identically in all cases.

Change-Id: I519ca0c0109c68aac2f2d4e6972d14b55767b403
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
3 years agoMake the windowcontainer example more robust
Laszlo Agocs [Mon, 11 May 2015 12:29:17 +0000 (14:29 +0200)]
Make the windowcontainer example more robust

The QWindow tends to get mouse releases on Windows when
maximizing the window for example. This is likely a problem
in the platform, but the example should be improved too to
be more robust and ignore such unwanted events.

Task-number: QTBUG-42842
Change-Id: Iecf916a2f753ed1b37d644721ee212ca7c728c49
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
3 years agoxcb: Skip EGL integration with -no-opengl
Laszlo Agocs [Wed, 6 May 2015 19:53:55 +0000 (21:53 +0200)]
xcb: Skip EGL integration with -no-opengl

When EGL is autodetected but -no-opengl is specified the backend
must be skipped, just like the GLX one.

Task-number: QTBUG-44998
Change-Id: I1ccbaf540f3777a1fc39aaf12bded4febf20faa0
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
3 years agoMSVC: Silence compiler warning about INFINITY
Kai Koehne [Mon, 13 Apr 2015 13:50:45 +0000 (15:50 +0200)]
MSVC: Silence compiler warning about INFINITY

Contrary to the comment, MSVC does support INFINITY, but
always prints a warning when it's used:

qpainterpath.cpp(3066) : warning C4756: overflow in constant arithmetic

Avoid this by using numeric_limits<T>::infinity.

Change-Id: Ie925b036b807378da5298a275fa108347c24519e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
3 years agoqstandardpaths_ios: allow empty strings to be returned for undefined locations
Richard Moe Gustavsen [Thu, 7 May 2015 11:25:57 +0000 (13:25 +0200)]
qstandardpaths_ios: allow empty strings to be returned for undefined locations

According to the documentation for QStandardPaths::standardLocations() and
QStandardPaths::writableLocation, they should return empty lists / strings
if the location cannot be determined. So remove the section in
qstandardpath_ios.mm that always sets a default path for undefined

Change-Id: I0c7fc0a1a0bbe2a5e0fb4e79e0f96f0280a647e2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
3 years agoios: change file engine caching logic for loading assets
Richard Moe Gustavsen [Mon, 27 Apr 2015 11:41:40 +0000 (13:41 +0200)]
ios: change file engine caching logic for loading assets

The current caching strategy had a flaw in that it tried
to lazy-lock the mutex only if g_currentAssetData was non-zero.
For this to be somewhat reliable, g_currentAssetData would have
to be volatile. But that would still not be enough since
thread-unaware code optimizations might also happen on the CPU level.

Instead of complicating the current logic more, change it to
only do caching per thread. Since QThreadStorage will take ownership
of its data, we can't let it store a pointer to QIOSAssetData directly
since we need to control the life time of QIOSAssetData using deleteLater.

Change-Id: I2c3ffb3257ec2bdec8be71a3d63f666ab33b5277
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
3 years agoImprove QListView scroll bar calculation.
Christoph Schleifenbaum [Wed, 22 Apr 2015 11:06:32 +0000 (13:06 +0200)]
Improve QListView scroll bar calculation.

When both scroll bar's policies are set to ScrollBarAsNeeded, make sure
the scroll bars are shown if needed and not show if not. Even the corner
case, where one scroll bar's visibility depends on the other, is handled

Task-number: QTBUG-45470
Change-Id: I11d6ccf7c0b51644a5ce2d5c3fc59e2e4812755d
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
3 years agoUse ItemIsUserTristate instead of ItemIsTristate in table & list tests.
David Faure [Wed, 6 May 2015 15:00:59 +0000 (17:00 +0200)]
Use ItemIsUserTristate instead of ItemIsTristate in table & list tests.

ItemIsTristate only makes sense in tree widgets, where it triggers the
auto-tristate behavior between parents and children.

Change-Id: Idfa8bb5d0b9c63fe450115fb58d088929e11c7ff
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
3 years agoDon't overwrite applicationName if already set.
David Faure [Sun, 29 Mar 2015 20:09:56 +0000 (22:09 +0200)]
Don't overwrite applicationName if already set.

My commit 6c973dee2cb1686ea32657 broke the case where setApplicationName
is called before the QCoreApplication constructor.
Fixed and added autotest.

Task-number: QTBUG-45283
Change-Id: If7bdb0d82be50b50a95a04027f5f9d7143c1a7ac
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
3 years agoQDialogButtonBox: prevent crashes on deletions in slots
Giuseppe D'Angelo [Fri, 8 May 2015 11:49:54 +0000 (13:49 +0200)]
QDialogButtonBox: prevent crashes on deletions in slots

As usual, user code connected to signals emitted from Qt may destroy
an object's internal status while a signal is being emitted.

Guard a bit QDialogButtonBox signal emissions to prevent
crashes in case the button or a dialog get deleted from a slot
connected to clicked(). Also, be sure to emit the corresponding
accepted/rejected/etc. signal.

Change-Id: I7b1888070a8f2f56aa60923a17f90fb5efef145c
Task-number: QTBUG-45835
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
3 years agofix ANGLE build with VS2015
Oswald Buddenhagen [Wed, 6 May 2015 13:30:33 +0000 (15:30 +0200)]
fix ANGLE build with VS2015

... by making the conditional future-proof by inverting it.

Task-number: QTBUG-45972
Change-Id: I0bf8eac1b1095b9bf4dec0b82fc42e5a58d0499a
Reviewed-by: Andrew Knight <qt@panimo.net>
Reviewed-by: Gunnar Roth
3 years agofix wrong path separators in extra compiler commands
Oswald Buddenhagen [Wed, 6 May 2015 14:25:15 +0000 (16:25 +0200)]
fix wrong path separators in extra compiler commands

Change-Id: I19a2c53c301becbbe5b70e47067f9a3355f7b04a
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
3 years agochange approach to requesting headers-only modules
Oswald Buddenhagen [Tue, 5 May 2015 16:16:00 +0000 (18:16 +0200)]
change approach to requesting headers-only modules

there is no need to make exceptions for install targets now, so instead
of abusing qt_no_install_library, introduce a new header_module flag.

Change-Id: I4ad7e301d1b60938b17e1dea732b1dbe3ff88a1a
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
3 years agofix (un-)installation for TEMPLATE = aux
Oswald Buddenhagen [Tue, 5 May 2015 17:01:14 +0000 (19:01 +0200)]
fix (un-)installation for TEMPLATE = aux

don't try to install the primary target, as it obviously doesn't exist.
however, we must not disarm bundle installation.

Change-Id: I3074150f749220d77c1210a4978e71aff9c9a3a9
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
3 years agoMerge "Merge remote-tracking branch 'origin/5.4' into merge5.5" into refs/staging/5.5
Allan Sandfeld Jensen [Fri, 8 May 2015 15:29:43 +0000 (15:29 +0000)]
Merge "Merge remote-tracking branch 'origin/5.4' into merge5.5" into refs/staging/5.5

3 years agoAdd GPU_BLACKLIST support to QTestLib
Laszlo Agocs [Fri, 10 Apr 2015 11:55:10 +0000 (13:55 +0200)]
Add GPU_BLACKLIST support to QTestLib

In addition to BLACKLIST, Qt will now look for GPU_BLACKLIST too.
Test cases that are specified as disabled in the GPU blacklist
will be skipped. This is particularly relevant when running tests
on Embedded Linux devices.

For example, the following JSON would configure the test case
glxContextWrap to be skipped on drivers where GL_VENDOR contains

    "entries": [ {
            "gl_vendor": "UnstableDriverVendor",
            "features": [ "disable_glxContextWrap" ]
    } ]

In contrast to the regular blacklist, GPU-blacklisted test cases are
not run at all. This is because driver problems and instabilities
often lead to crashes.

Change-Id: I340cf5c0261a206109b78409774408981bba5c68
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
3 years agoMerge remote-tracking branch 'origin/5.4' into merge5.5
Allan Sandfeld Jensen [Fri, 8 May 2015 11:22:49 +0000 (13:22 +0200)]
Merge remote-tracking branch 'origin/5.4' into merge5.5


Change-Id: I01de8c1c28efcedfd7953d05025f54802dc08ab3

3 years agoAutotest: Check if this D-Bus library knows about file descriptors
Thiago Macieira [Tue, 5 May 2015 01:20:07 +0000 (18:20 -0700)]
Autotest: Check if this D-Bus library knows about file descriptors

Because if it doesn't, then calling dbus_type_is_fixed or is_basic may
result in a failed assertion.

 process 16304: arguments to dbus_type_is_fixed() were incorrect,
 assertion "_dbus_type_is_valid (typecode) || typecode ==
 DBUS_TYPE_INVALID" failed in file dbus-signature.c line 345.

Change-Id: Idf715b895bac4d56b4afffff13db2ed71b1516a5
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
3 years agoMerge "Merge remote-tracking branch 'origin/5.4.2' into 5.4" into refs/staging/5.4
Allan Sandfeld Jensen [Fri, 8 May 2015 09:04:10 +0000 (09:04 +0000)]
Merge "Merge remote-tracking branch 'origin/5.4.2' into 5.4" into refs/staging/5.4

3 years agoQNAM: Fix compiler warning
Markus Goetz [Wed, 6 May 2015 10:57:58 +0000 (12:57 +0200)]
QNAM: Fix compiler warning

Change-Id: I2ae6493e13c9b168c64c458e42ea90d4ec2d8628
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
3 years agoMerge remote-tracking branch 'origin/5.4.2' into 5.4
Allan Sandfeld Jensen [Fri, 8 May 2015 08:08:24 +0000 (10:08 +0200)]
Merge remote-tracking branch 'origin/5.4.2' into 5.4

Change-Id: I944e9e59d28172290930db0e162c1597ad05c59e

3 years agoUse kqueue on NetBSD in qfilesystemwatcher.
Niclas Rosenvik [Tue, 5 May 2015 09:04:11 +0000 (11:04 +0200)]
Use kqueue on NetBSD in qfilesystemwatcher.

Enable kqueue on NetBSD in qfilesystemwatcher.

NetBSD has kqueue.

Change-Id: I6305a37df079c35b9a9b1f70c75ec00e05d25b47
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
3 years agoTests: Remove EXPECT_FAIL in tst_QWidget::widgetAt()
Caroline Chao [Mon, 27 Apr 2015 07:20:42 +0000 (09:20 +0200)]
Tests: Remove EXPECT_FAIL in tst_QWidget::widgetAt()

The test is always marked as XPASS in CI.

Change-Id: I629bdec6f038cd8b6208fc4db61c67a9ea003b2e
Task-number: QTBUG-22326
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
3 years agoANGLE: Allow Windows Phone to communicate swap region
Andrew Knight [Sun, 3 May 2015 17:56:04 +0000 (20:56 +0300)]
ANGLE: Allow Windows Phone to communicate swap region

eglPostSubBufferNV is used to communicate the size of the window, as
otherwise there is no way for the renderer to know if the last frame was
rendered in landscape or portrait, causing rendering glitches when the
orientation changes. The rotation flags are utilized in a few additional
places now to fix some corner cases where the rotation was not applied.

This patch should be squashed into "ANGLE-Improve-Windows-Phone-Support"
during the next ANGLE rebase.

Task-number: QTBUG-44333
Task-number: QTBUG-43502
Change-Id: Iec37f7531854184819c30c87eab82d96d56ff133
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
3 years agowinrt: Use ANGLE sub-buffer swap on Windows Phone
Andrew Knight [Sun, 3 May 2015 17:52:15 +0000 (20:52 +0300)]
winrt: Use ANGLE sub-buffer swap on Windows Phone

This allows the plugin to communicate the swap region to ANGLE and avoid
glitches when the orientation changes.

Task-number: QTBUG-44333
Change-Id: I40240cbcb3aaec92dbf4a82f4957965e92b9c3da
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
3 years agoQLineEdit: show the clear button if it gets enabled after setting a text
Giuseppe D'Angelo [Wed, 6 May 2015 15:00:21 +0000 (17:00 +0200)]
QLineEdit: show the clear button if it gets enabled after setting a text

We were fetching "lastText" too late, and setting the opacity
of the clear button to 0.

Change-Id: I82c2aea7dab4af4424fb57e12f78d07a0374457e
Task-number: QTBUG-45518
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
3 years agoQColumnView: re-enable scrolling of the preview widget
Giuseppe D'Angelo [Wed, 6 May 2015 12:02:48 +0000 (14:02 +0200)]
QColumnView: re-enable scrolling of the preview widget

For some reason, each column in a QColumnView is a QAbstractItemView,
*including* the preview widget's column. Unfortunately,
the preview widget's column class was not overriding scrollContentsBy,
so scrolling it had no effect.

A more comprehensive solution would be a major refactoring of the
code to make that column a plain Q(Abstract)ScrollArea, as it doesn't
need QAIV's APIs at all, but I don't want to change code and risk
breaking behavior.

Change-Id: Ice500a8eaef13c295df4cc274b9f80d9a24c65f4
Task-number: QTBUG-11392
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
3 years agoRequire -fPIC instead of just -fPIE for -reduce-relocations
Thiago Macieira [Tue, 5 May 2015 15:43:42 +0000 (08:43 -0700)]
Require -fPIC instead of just -fPIE for -reduce-relocations

GCC 5 combined with a recent binutils have a new optimization that
allows them to generate copy relocations even in -fPIE code. Clang has
the same functionality when compiling an executable with -flto. We need
to let the compilers know that they cannot use copy relocations, so they
need to use really position-independent code.

Position independent code throughout is not really required. We just
need the compilers to use position-independent access to symbols coming
from the Qt libraries, but there's currently no other way of doing that.

Task-number: QTBUG-45755
Change-Id: I0d4913955e3745b69672ffff13db5df7377398c5
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
3 years agoRevert "configure: Change default of CFG_REDUCE_RELOCATIONS to "no"."
Friedemann Kleint [Thu, 7 May 2015 06:34:19 +0000 (08:34 +0200)]
Revert "configure: Change default of CFG_REDUCE_RELOCATIONS to "no"."

This reverts commit d0eba497c1c34d35ddda2b5d44902ebd636d4f9e.

A better fix is to use -fPIC instead of just -fPIE fo

Task-number: QTBUG-45755
Change-Id: I1759291b684fd76d4009e4be9ba1354eb056e659
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
3 years agoBlacklist task256322_highlight on OS X
Allan Sandfeld Jensen [Thu, 7 May 2015 11:10:13 +0000 (13:10 +0200)]
Blacklist task256322_highlight on OS X

The test keeps failing. The approach of sending mouse move events is
inherently fragile due to the use of QCursor::setPos and the expectation
that that produces the correct sequence of mouse move events.

Change-Id: I07ec75460b70c27152e8775deffcb77fa9328d0c
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
3 years agoQSizePolicy: improve docs of retainSizeWhenHidden
Marc Mutz [Wed, 6 May 2015 13:56:28 +0000 (15:56 +0200)]
QSizePolicy: improve docs of retainSizeWhenHidden

Fixed markup and grammar.

Change-Id: Ie2427965f905135572fd1f81e4a6d7514dea7022
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
3 years agoGive QSizePolicy its own .cpp
Marc Mutz [Wed, 6 May 2015 11:59:37 +0000 (13:59 +0200)]
Give QSizePolicy its own .cpp

Previously, implementation was spread between qlayout.cpp and qlayoutitem.cpp
and the docs between those two files and qsizepolicy.qdoc.

Move everything into a new qsizepolicy.cpp.

Change-Id: Id15c2c13572b7b8863be596603100f388eafea07
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
3 years agoQStateMachine: allow posting of events when starting.
Erik Verbruggen [Wed, 22 Apr 2015 12:17:13 +0000 (14:17 +0200)]
QStateMachine: allow posting of events when starting.

This allows subclasses to submit any queued events that have to be
handled before normal operation starts. For example, if an error event
got generated during initialization which has to be handled by the
state machine, the startup hook in the private class can be used to post
those events and have the state machine handle them appropriately.

Change-Id: I62249a31d8840f47bc19920870ad5da9647e61f9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
3 years agoQStateMachine: Fix transition ordering.
Erik Verbruggen [Wed, 22 Apr 2015 10:24:16 +0000 (12:24 +0200)]
QStateMachine: Fix transition ordering.

When there are conflicting transitions, a transition that is nested
deeper (i.e. more specific) has priority. If two transitions have the
same nesting level, the one that comes first in the document order gets

Before this patch, only the document order was considered.

Change-Id: I58f188c270cabe2c386a783ceef7a0a955105425
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
3 years agoios: Add support for QOpenGLWidget and QQuickWidget
Laszlo Agocs [Mon, 4 May 2015 08:56:02 +0000 (10:56 +0200)]
ios: Add support for QOpenGLWidget and QQuickWidget

The global shared context is now always enabled on iOS. This means that
contexts used by QOpenGLWindow/Widget and QQuickWindow/Widget and the
iOS backingstore will share with each other.

[ChangeLog][QtGui] QOpenGLWidget and QQuickWidget are now supported on iOS.

Task-number: QTBUG-40034
Change-Id: Ibfb99ffcb18f8f8d263662fbf237bc348fc730ee
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
3 years agoMake it explicit that a few Qt::WindowFlags are overlapping
Tor Arne Vestbø [Thu, 19 Mar 2015 12:09:00 +0000 (13:09 +0100)]
Make it explicit that a few Qt::WindowFlags are overlapping

Change-Id: Ia161fb9b7196d139e22fe7b3b576c5c72ee8a2f1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
3 years agoDoc: Fix spelling errors in the QXcbWindowFunctions docs
Alexander Volkov [Tue, 5 May 2015 13:18:46 +0000 (16:18 +0300)]
Doc: Fix spelling errors in the QXcbWindowFunctions docs

Change-Id: I0fe7dab6e80876b0fd17f59559295feecfd8cf63
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
3 years agoios: implement Qt::WindowTransparentForInput
Richard Moe Gustavsen [Mon, 4 May 2015 11:02:40 +0000 (13:02 +0200)]
ios: implement Qt::WindowTransparentForInput

If the flag is set, report to UIKit that it should
continue searching for the touch target by returning
'NO' from [UIView pointInside:].

Change-Id: I723f64fd855284fa60d0be18b2535dfa61f31381
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
3 years agoios: don't autoactivate if _q_showWithoutActivating
Richard Moe Gustavsen [Thu, 30 Apr 2015 12:58:15 +0000 (14:58 +0200)]
ios: don't autoactivate if _q_showWithoutActivating

Widgets can have the attribute Qt::WA_ShowWithoutActivating
set, which is forwarded to QWindow as a property
(_q_showWithoutActivating). Both The cocoa plugin and
the windows plugin check for this property before
activating a window upon setVisible, so lets do the
same for the iOS plugin.

Note that this is not the same as shouldAutoActivate, since
the window should gain focus like normal if the user
taps on it.

Change-Id: Ie6c95d4044906d97f0a03d27009a23d462c6ca34
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
3 years agoios: don't accept first responder if Qt::WindowDoesNotAcceptFocus
Richard Moe Gustavsen [Thu, 30 Apr 2015 12:49:13 +0000 (14:49 +0200)]
ios: don't accept first responder if Qt::WindowDoesNotAcceptFocus

Change-Id: I01801648a1971444e0727e1bf0790cb3a0d0aad5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
3 years agoios: factor out authorization check
Richard Moe Gustavsen [Fri, 24 Apr 2015 10:14:49 +0000 (12:14 +0200)]
ios: factor out authorization check

Factor out the check since it's needed both
when loading assets and when creating an entry list.

Note that the file flags returned from the file engine
will report if the asset is not readable due to
authorization status, so we don't need to check this
again when trying to load.

Change-Id: I77ebbc370f0a7a6020ed484e53ece32bc7fa51bd
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
3 years agoios: add support for fetching entry list in QIOSFileEngineAssetsLibrary
Richard Moe Gustavsen [Tue, 14 Apr 2015 12:35:17 +0000 (14:35 +0200)]
ios: add support for fetching entry list in QIOSFileEngineAssetsLibrary

This patch will implement support for listing all available
pictures on the device by e.g doing:

QDir dir(QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).last());
QStringList list = dir.entryList();

Change-Id: I52a07ba48e074bc6e509f2ed3afc3dfea17abc5d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
3 years agoios: add fallback in QIOSFileEngineAssetsLibrary for loading assets from ALAssetsGrou...
Richard Moe Gustavsen [Thu, 16 Apr 2015 11:14:19 +0000 (13:14 +0200)]
ios: add fallback in QIOSFileEngineAssetsLibrary for loading assets from ALAssetsGroupPhotoStream

[ALAssetsLibrary assetForUrl:] will not load assets coming from ALAssetsGroupPhotoStream. Such
assets can be stored in the cloud and might need to be downloaded first. Unfortunately, forcing
that to happen is hidden behind private APIs ([ALAsset requestDefaultRepresentation]). So if
the user through QIOSFileDialog opens the photo stream folder and chooses a
photo inside it, QIOSFileEngineAssetsLibrary will fail loading it.

This patch implements a work-around that basically asks ALAssetLibrary to enumerate all assets
in the photo library, and stop once we find an asset with the correct url. At that point we also
have a pointer to a ALAsset that can be used for loading. This is off course a slow way of loading
an asset, but at least better than not being able to load it at all.

Change-Id: Ie50344974f043f909ee94fa12e7eb4a40a666c7f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
3 years agoios: add helper class for enumerating all available assets
Richard Moe Gustavsen [Mon, 20 Apr 2015 10:29:35 +0000 (12:29 +0200)]
ios: add helper class for enumerating all available assets

Add support for enumerating all available assets on the device.

Trailing patches will use the class to fetch a list of all available
assets for directory listing, and to search for assets that cannot be
loaded by [ALAssetsLibrary assetForURL:].

Change-Id: I319721b536b14424fc8f54f683513aa7ca64e7f0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
3 years agoQSettings: use QStandardPath to resolve path on iOS
Richard Moe Gustavsen [Wed, 15 Apr 2015 08:31:24 +0000 (10:31 +0200)]
QSettings: use QStandardPath to resolve path on iOS

The current solution hard-codes a settings path that on iOS
will point to a write protected path inside the sandbox. So
change the QSP fallback in QSettings to also include iOS.

Note that changing settings path would normally be problematic
since it would cause migration issues. However, since the
current solution can never have worked on iOS, starting
to use QSP now should be fine.

Change-Id: Iecad7d84595aee24ca0e2446fa5997296ad8b5a8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
3 years agoMark QGraphicsScene::focusNextPrevChild as virtual in Qt 6
Giuseppe D'Angelo [Wed, 6 May 2015 13:21:27 +0000 (15:21 +0200)]
Mark QGraphicsScene::focusNextPrevChild as virtual in Qt 6

It's supposed to mirror QWidget's one, but this one isn't virtual,
making it useless.

Change-Id: I0dc531bd12b5e18fa11816c03ef5b3941851198f
Task-number: QTBUG-45633
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
3 years agodoc: document how QFileDialog can be used to pick photos on iOS
Richard Moe Gustavsen [Wed, 6 May 2015 09:31:04 +0000 (11:31 +0200)]
doc: document how QFileDialog can be used to pick photos on iOS

Change-Id: Iab4a0842f811cd26484123e6949c9b6a0ef0d524
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
3 years agoQTextTable/QTextDocumentLayout: remove dead code
David Faure [Mon, 30 Mar 2015 15:12:02 +0000 (17:12 +0200)]
QTextTable/QTextDocumentLayout: remove dead code

Change-Id: I3eb72a43129c58574036b6ca8c8c8413ca24b43a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
3 years agococoa: ensure app don't crash when receiving drag from other app
Richard Moe Gustavsen [Tue, 5 May 2015 11:11:12 +0000 (13:11 +0200)]
cocoa: ensure app don't crash when receiving drag from other app

Change 939f21be53ef introduced a crash when dragging data from
a 3rd party app into the app. Basically the current code assumed
that we always have QCocoaIntegration::instance()->drag()->currentDrag()
but this seems to only be the case if the drag was started by the
app itself.

The crash was found by testing the fridgemagnets example. Just
drag text from other app into the example to see it crash.

Also, refactored the cursor code into a separate method
to simplify code reading.

Change-Id: Ica611a4452a0dd02e01451111aeda14c879f8f1b
Reviewed-by: Filipe Azevedo <filipe.azevedo@kdab.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
3 years agodocs: QFile doesn't support QUrl style qrc paths
Sérgio Martins [Tue, 5 May 2015 20:30:44 +0000 (21:30 +0100)]
docs: QFile doesn't support QUrl style qrc paths

Change-Id: I2c5f90e7d1e64d652e920bdbf9da98ad8ac1e4f9
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
3 years agoxcb: Fix -no-opengl builds
Laszlo Agocs [Mon, 4 May 2015 10:34:48 +0000 (12:34 +0200)]
xcb: Fix -no-opengl builds

The GLX and EGL integrations are skipped correctly but the base class still
contained createPlatformOpenGLContext() with OpenGL-specific types.

Task-number: QTBUG-44998
Change-Id: I727ded7ca8589b163fc1271709dd718572b51c3e
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
3 years agoAdd flip support to QPlatformBackingStore::toTexture()
Laszlo Agocs [Tue, 21 Apr 2015 09:05:07 +0000 (11:05 +0200)]
Add flip support to QPlatformBackingStore::toTexture()

Necessary for iOS. In addition to swizzle we also need to communicate the need
for flipping, so switch to flags instead of bools.

Task-number: QTBUG-40034
Change-Id: I055e591afd838878503be6f5f69aa7347965d9cf
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
3 years agoios: report correct file flags for assets 'directory'
Richard Moe Gustavsen [Fri, 24 Apr 2015 11:24:42 +0000 (13:24 +0200)]
ios: report correct file flags for assets 'directory'

If the asset url indicates that this file engine points
to the asset folder, report the file as a directory.
Also, if the app is authorized to access assets, report
that the directory has read access.

Change-Id: Ic8f656fa30a1b2a0ec6402e8b19256bdf5f7345e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
3 years agoios: don't report read access to assets if unauthorized access
Richard Moe Gustavsen [Fri, 24 Apr 2015 10:34:36 +0000 (12:34 +0200)]
ios: don't report read access to assets if unauthorized access

Don't report read access to assets if we know that we are unauthorized
to load them. Note that if authorization is ALAuthorizationStatusNotDetermined
we continue to report read access, since we don't really know the permissions
until we try to load.

Change-Id: If51cfe9f5c57f8f33f463bddf81a77fade5fb89d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
3 years agoios: resolve m_assetUrl already in QIOSFileEngineAssetsLibrary::setFileName()
Richard Moe Gustavsen [Thu, 16 Apr 2015 08:32:53 +0000 (10:32 +0200)]
ios: resolve m_assetUrl already in QIOSFileEngineAssetsLibrary::setFileName()

Resolve m_assetUrl already when setting file name. The variable will be
used several places in patches that follows.

At the same time, change the logic to be more robust to work around QDir
removing slashes (both single a double) after the scheme. In the end, what
matters is that we still recognize the file name as an asset url, and that we can
restore the original url based on the hash-tag contained inside the file name.

Change-Id: I988c6a73b2484e46d63917b442c13aa5a3666787
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
3 years agoQShapedPixmapWindow: ensure we set a valid geometry
Richard Moe Gustavsen [Thu, 30 Apr 2015 13:18:44 +0000 (15:18 +0200)]
QShapedPixmapWindow: ensure we set a valid geometry

On touch platforms, QCursor::pos() will only be 'valid' when a
touch event has (at least once) been translated to a mouse event.
Currently this never happens in QtQuick since QtQuick always
accepts all touch events and performs its own translations.

So rather than setting the geometry of QShapedPixmapWindow from
QCursor directly, we instead base it on mouse events. This will
ensure that we never try to set the geometry of the window to
an 'invalid' value, which can cause a crash on platforms like iOS.

Note that we currenly miss an API in Qt to get the current
touch points. When that is in place, we can also set
a correct start position for the window before the
first mouse move event arrives.

Task-number: QTBUG-45877
Change-Id: I320598e87d43f6e9e087c204a69b95465128f468
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
3 years agoQShapedPixmapWindow: don't accept input focus
Richard Moe Gustavsen [Thu, 30 Apr 2015 13:26:58 +0000 (15:26 +0200)]
QShapedPixmapWindow: don't accept input focus

Inform the platform that it should not activate the window
when shown by setting Qt::WindowDoesNotAcceptFocus. This compliments
the already set Qt::WindowTransparentForInput, which specifies
that mouse/touch events should also pass through the window. In
other words, the window is just for showing output and should not
respond to input.

Change-Id: I3e90a28be2f2e27e2044effedf64f47c94a857a5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
3 years agoClean up API of QPlatformPrintDevice (QPA).
Friedemann Kleint [Wed, 22 Apr 2015 11:50:21 +0000 (13:50 +0200)]
Clean up API of QPlatformPrintDevice (QPA).

The class inherited QSharedData, had a non-virtual clone() function and
a non-virtual operator==() which compared QPlatformPrintDevice::id().
Derived classes implemented clone() and operator==() comparing ids
to no effect. The class does not have any setters modifying its values,
so detaching, copying and assigning does not make sense.

Remove the inheritance, clone(), and  operator==() and make the class
a non-copyable base class. Use a QSharedPointer instead of
a QSharedDataPointer to store it in QPrintDevice.
Remove copy constructors and clone() reimplementations that were never
called in implementations.

Found while investigating QTBUG-44991.

Task-number: QTBUG-44991
Change-Id: Ib79354b37048d04d50d936f1d0ae06c36efaac00
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>