Commit Graph

24182 Commits

Author SHA1 Message Date
Marc Mutz
61169b72c2 Fix UB in QIODevicePrivate
Passing nullptr as the second argument of memcpy/memmove
constitutes undefined behavior, even if the length argument
is zero at the same time.

Fix by protecting mem{cpy,move,chr} from nullptrs.

Found by UBSan:
  qtbase/src/corelib/io/qiodevice_p.h:105:33: runtime error: null pointer passed as argument 2, which is declared to never be null
  qtbase/src/corelib/io/qiodevice_p.h:175:53: runtime error: null pointer passed as argument 2, which is declared to never be null

Change-Id: I979158b0a74169ca4eb459928398ebc40f77dfb5
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-13 05:42:35 +00:00
Marc Mutz
13189360e5 Fix UB in QFileDevice::writeData()
Passing nullptr as the 2nd argument of memcpy
constitutes undefined behavior.

Fix by protecting the block with 'if (len)',
which, presumably, is the only valid case
where 'data' may be nullptr.

Change-Id: I7647d7e0808b1f26444ea3cf8bbf5cda9ddc9e6c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-12 06:11:53 +00:00
Marc Mutz
b4ab4868bc Fix UB in QFSFileEnginePrivate::writeFdFh()
Apparently, it is considered valid to call the function with
'data' set to nullptr, and 'len' to zero. But doing so
invokes undefined behavior because nullptr is passed to
fwrite().

Fix by protecting the loops with 'if (len)'.

Found by UBSan:
  qtbase/src/corelib/io/qfsfileengine.cpp:732:84: runtime error: null pointer passed as argument 1, which is declared to never be null

Change-Id: Idfe23875c868ebb21d2164550de3304d2f01e9df
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-11 22:39:43 +00:00
Marc Mutz
71ea41f999 Fix UB in QVariant::canConvert()
'currentType' was not sanitized before being used as a shift.

Fix by checking for a valid shift amount before shifting.
Also change the shifted value from 1 (int) to 1U (uint).
It's just the right thing to do.

Found by UBSan:
    qtbase/src/corelib/kernel/qvariant.cpp:3131:59: runtime error: shift exponent 1114 is too large for 32-bit type 'unsigned int'

Change-Id: Id3910d6d7f166fd7c80adf5ce1699f0eeb453562
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-11 18:16:31 +00:00
Dāvis Mosāns
c8af3160d2 Don't pass NULL Display to glXGetClientString
glXGetCurrentDisplay can return NULL so need to check
for that.

Change-Id: I1b85a5c575d1deb24dcce4719b6f737283adeabe
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-01-11 09:40:40 +00:00
Marc Mutz
1e2b42523f Fix UB in tst_QObject::disconnectDoesNotLeakFunctor()
If CountedStruct is passed a GetSenderObject object,
it will attempt to call a member on it from within
its own destructor.

That works usually quite well, but in this test case,
which tests for function object leaks when a connection
is torn down because the sender object is destroyed,
the destruction of the CountedStruct happens when all
connections are severed in ~QObject. At that point,
what used to be a GetSenderObject instance no longer
is one and the call into one of its member functions
invokes undefined behavior.

Fix by making QObject::sender() public by a using
declaration instead of a wrapper function.

Found by UBSan:
  tests/auto/corelib/kernel/qobject/tst_qobject.cpp:6007:104: runtime error: member call on address 0x7ffc6e7538b0 which does not point to an object of type 'GetSenderObject'
  0x7ffc6e7538b0: note: object is of type 'QObject'

Change-Id: Ia973140037b3c1b5a670a8a3949d09b956f40349
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-09 15:18:50 +00:00
Oswald Buddenhagen
889fcfbf2b fix quoting in makeabs()
'local' is treated as a command, so its arguments need to be quoted,
unlike in a real variable assignment.

amends 4b557751e.

Change-Id: I5a4c929e52e2344a6129c8e9dd4c0c80cd408ff0
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-01-08 12:40:14 +00:00
Marc Mutz
c38b14e251 Fix UB in tst_QSharedPointer::basics()
Binding a reference to the nullptr is undefined
behavior.

Just skip that particular test when 'ptr' is null.

Found by UBSan:
  tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp:258:32: runtime error: reference binding to null pointer of type 'struct Data'

Change-Id: I125588b9d269a6f76716d660d03142f409513885
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-07 13:00:40 +00:00
Marc Mutz
9c7be0a7ec Fix UB in tst_QDialog::showExtension()
Don't cast a QDialog to a subclass it is not.

Fix by creating it as the required subclass in the
first place.

Found by UBSan:
  tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp:203:20: runtime error: downcast of address 0x2b5f5000ad40 which does not point to an object of type 'DummyDialog'
  tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp:203:46: runtime error: member call on address 0x2b5f5000ad40 which does not point to an object of type 'DummyDialog'

Change-Id: I63ae7e782bda6a78d11af5c2bc2f7d88aacd0ac0
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-07 13:00:32 +00:00
Marc Mutz
f5291bf8b4 Fix UB in tst_QObject::noDeclarativeParentChangedOnDestruction()
If QObjectPrivate::declarativeData is set, it is
in various places in Qt expected to point to a
QAbstractDeclarativeDataImpl, from which ownedByQml1
is unconditionally read.

In noDeclarativeParentChangedOnDestruction(), the
declarativeData pointer is, however, set to a local
QAbstractDeclarativeData instance, which, being an
empty class, has size 1 and alignment 1.

Depending on the compiler's idea of bit field order,
this code either read uninitialized data from the
dummy object, or else some random stack memory outside
any (valid) object.

What caught UBSan's attention, though, was the
difference in alignment between the two classes:

  src/corelib/kernel/qobject.cpp:917:9: runtime error: member access within misaligned address 0x7fffc9cf706f for type 'struct QAbstractDeclarativeDataImpl', which requires 4 byte alignment

Fix by providing a properly initialized object of the
correct type.

Change-Id: Iae83a949ee5a7bc98df13e35ea614c063085fa13
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-01-07 13:00:28 +00:00
Marc Mutz
bccbb70de5 Fix UB in tst_QMetaType
Don't pass around meta-type IDs in QMetaType::Type
variables. It leads to reading values from an enum
variable that are invalid.

Fix by passing the IDs around as int.

Found by UBSan:
  tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp:408:5: runtime error: load of value 4028, which is not a valid value for type 'Type'

Change-Id: Idd106ee3d7960fe3d8fefc0fc5830fc22d38a513
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-06 22:07:09 +00:00
Marc Mutz
033205bb59 Fix UB in tst_QIODevice::getSetCheck()
The reinterpret cast from a QTcpSocket → QAbstractSocket → QIODevice
to MyIODevice → QIODevice was undefined.

Fix by simply instantiating a MyIODevice, which must then inherit
from QTcpSocket, of course.

Instead of fixing the class name in the overridden setOpenMode()
method, simply make the base class' implementation public with
a using declaration.

Found by UBSan:
  qtbase/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp:84:22: runtime error: member call on address 0x7ffcca2d23f0 which does not point to an object of type 'MyIODevice'
  0x7ffcca2d23f0: note: object is of type 'QTcpSocket'

Change-Id: I939b3548949b9b5765df4a6cc81875e169fd69dd
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-01-06 17:25:05 +00:00
Marc Mutz
4f48c3a309 Add missing qxml_p.h to src/xml/sax/sax.pri
Change-Id: I32acaebd53d8bee23f509ed404e360c1004f4a58
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2016-01-06 13:55:49 +00:00
Dmitry Shachnev
7e876bfcf7 qt_functions.prf: Add missing $$eval
Change-Id: I3d60617bdc887447f433c47ac6af3c1e13756c28
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-01-05 19:09:12 +00:00
Alex Trotsenko
02f70004c2 Allow socket events processing with a foreign event loop on Windows
While a native dialog is open, the application message queue is
handled by the native event loop which is external to Qt. In this
case, QEventDispatcherWin32::processEvents() does not run and socket
notifiers will not be activated. So, this patch moves the notifier
activation code into the window procedure, which enables socket
event processing with native dialogs.

Task-number: QTBUG-49782
Task-number: QTBUG-48901
Change-Id: Icbdd96b2e80c50b73505f4fe74957575b83d6cf1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-01-05 13:05:35 +00:00
Masaru Ueki
e0a5f661e5 QStateMachine: fix ignore high-priority events.
When a high-priority event is posted in overrided
'QStateMachine::beginSelectTransitions', the event may be remained in
event queue, and be not dispatched until another event posted.

Change-Id: Ifda288d9c00ac7985e426b9cc02bda382ebaac35
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2016-01-05 10:05:40 +00:00
Friedemann Kleint
38c8af7231 Revert "Fix global coordinate mapping for child widgets in QGraphicsView."
This reverts commit 56aad2ad60.

QWidget::mapFromGlobal() does not work correctly when the widget is
a child widget of another widget embedded into a QGraphicsView with a
transformation (scaling/rotation). It starts applying offsets going
up the widget tree (just as mapToGlobal) until it hits the embedded widget
not taking into account the transformation.

It would need to go in from to top to bottom or better be reimplemented
such that a QTransform for mapping coordinates from/to global is determined
which is then applied in reverse.

Task-number: QTBUG-50030
Task-number: QTBUG-50136
Change-Id: Iadeb891d793be1938c64942bfbf38d541a281c33
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-01-05 08:18:18 +00:00
Giuseppe D'Angelo
4829edfa4e QTreeView: take into account the min/max size of the header view
Mimicking what QTableView is already doing correctly, the header's
height needs to be constrained by its own minimum/maximum height.

Task-number: QTBUG-49277
Change-Id: I695a4398991b738c4b4c924716176b9ad2152e87
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2016-01-04 21:26:55 +00:00
Alex Trotsenko
55f0343a99 Do not discard WSAECONNRESET error code from UDP under Windows
When a datagram is sent to a closed host/port combination, the host will
likely send back an ICMP error message. In the regular socket API, there
isn't a good way of actually receiving this error, so some Windows kernels
wired that message back up to the call to WSARecvFrom() as a synthetic
datagram. Reading this datagram results in a WSAECONNRESET error code,
which should reported to the user as a refused connection attempt.

To make the errors a bit more informative, the native error strings for
WSAECONNRESET and WSAENETRESET were also added.

Task-number: QTBUG-49301
Change-Id: If659be54ba1b39965b5f481f0c0cb9eeea0a06d2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
2016-01-04 06:39:31 +00:00
Raphael Kubo da Costa
090bf50771 forkfd: Only enable pipe2 on FreeBSD >= 10.0.
The system call is not present on earlier releases, and since the 9.x
series will be supported until the end of 2016, add a check for the
__FreeBSD_version macro and only enable pipe2 support if the value is
high enough.

Change-Id: I5633531cec7e95d42ff5f4b14afe772ae8d7d66d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-03 13:42:13 +00:00
Raphael Kubo da Costa
655246969e forkfd: Also define BSD visibility macros in forkfd_qt.cpp.
This is a follow-up to c8c4ad0 ("forkfd: Define __BSD_VISIBLE and
_NETBSD_SOURCE").

Defining those macros in forkfd.c is not enough: forkfd_qt.cpp also sets
_POSIX_C_SOURCE, and sys/cdefs.h can be included implicitly via Qt's
headers (<algorithm> ends up pulling unistd.h that leads to sys/cdefs.h
and sys/types.h with both libstdc++ and older libc++ versions). In this
case, __BSD_VISIBLE/_NETBSD_SOURCE are not defined, _POSIX_C_SOURCE is,
several type definitions are omitted and by the time we include
sys/time.h in forkfd.c the build fails. On FreeBSD < 11, the error looks
like this:

In file included from io/../../3rdparty/forkfd/forkfd.c:36,
                 from io/forkfd_qt.cpp:80:
/usr/include/sys/time.h:94: error: 'u_int' has not been declared

Change-Id: I01fa2f5861027d99936d3026faeee9f0db3ecabd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-01-03 13:40:23 +00:00
Raphael Kubo da Costa
c8c4ad0c62 forkfd: Define __BSD_VISIBLE and _NETBSD_SOURCE.
pipe2's availability on BSD operating systems depends on the
__BSD_VISIBLE macro on FreeBSD and OpenBSD and _NETBSD_SOURCE on
NetBSD (DragonFly BSD appears to define it unconditionally).

Those two macros are generally set by default, except when
_POSIX_C_SOURCE is set. Since we consciously set _POSIX_C_SOURCE but
need pipe2, explicitly define the visibility macros.

This fixes the -no-pch build on FreeBSD at least.

Change-Id: Icc77f6b5d1f9a5bf7bd8048cabbb01f8f89397cc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-12-27 17:02:23 +00:00
Alex Trotsenko
6b6955c2ff QAbstractSocket: do not enable read notifications on TCP in bind()
In bind+connect scenario, rejected connection can trigger a read
notification while the socket is opened. But unlike UDP, reading from
the socket engine or emitting a readyRead() signal is not allowed for
the TCP socket in bound or connecting state.

To make a bind+connect scenario work properly, disable the read
notifications until a connection is established.

Task-number: QTBUG-50124
Change-Id: I7b3d015b0f6021fb9ff9f83560478aa5545f41f5
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-12-24 14:05:26 +00:00
Christian Kamm
1e2d35d488 QSystemTrayIcon: Fix double connection with qpa.
install_sys_qpa() is called for each QSystemTrayIcon::show(),
leading to spurious calls of user slots if the signal isn't
disconnected on remove_sys_qpa().

Task-number: QTBUG-48068
Change-Id: Ic830250c71fee6b584550ab5aabf54289e478fcb
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Richard Rondu <rondu.richard@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2015-12-22 21:11:58 +00:00
Gabriel de Dietrich
64481bcc67 QWidgetWindow: The alien widget should be from the window's hierarchy
This partially reverts commit 025d6a778c.

Change-Id: I7b964b0d598abe46137c22177fe2b5dcca5bb812
Task-number: QTBUG-49831
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
2015-12-21 23:02:40 +00:00
Joerg Bornemann
e96fa5a780 Fix timeout calculations using qt_subtract_from_timeout
Commit ed0c0070 introduced qt_subtract_from_timeout but used it
incorrectly in several places.

Change-Id: I80ea16088707929a45d5a61ec6f3370f8e63d1cd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-12-21 22:26:40 +00:00
Erik Verbruggen
1823c8f2dd Fix utf8->utf16 BOM/ZWNBSP decoding.
When the byte sequence for a BOM occurs in the middle of a utf8 stream,
it is a ZWNBSP.

When a ZWNBSP occurs in the middle of a utf8 character sequence, and the
SIMD conversion does some work (meaning: the length is at least 16
characters long), it would not recognize the fact some charactes were
already decoded. So the conversion would then strip the ZWNBSP out,
thinking it's a BOM.

The non-SIMD conversion did not have this problem: the very first
character conversion would already set the headerdone flag.

Change-Id: I39aacf607e2e068107106254021a8042d164f628
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-12-21 09:56:49 +00:00
BogDan Vatra
0629e87942 Fix extract style on Android 6.0
A few things were changed in Android 6.0

Task-number: QTBUG-49323
Change-Id: I3112d885881dce541d5c4f3a1561f6c34d75e319
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
(cherry picked from commit 361e24b79e)
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-12-18 06:41:53 +00:00
Maxim Mikityanskiy
33c9059f03 Fix XI2 smooth scroll with inverted direction
When touchpad scroll direction is inverted, verticalIncrement and
horizontalIncrement of scrollingDevice are negative, and rawDelta
remains unfilled. It leads to pixelDelta.isNull() being true in wheel
event handler even when XI2 smooth scrolling is available on the system.

Fix that and fill rawDelta with correct values when inverted scroll
direction is used.

Change-Id: I9c0bdbad2c6b9bbed765eaa895dca300c5c70e86
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2015-12-17 18:55:30 +00:00
Joerg Bornemann
ad5c768fc8 Update bundled libpng to version 1.6.19
Merged in the upstream version, which obsoleted some local
patches. The remaining diff to clean 1.6.19 is archived in
the qtpatches.diff file.

Change-Id: I676df2dab2c52c7fe576de284d472d70206f0a8c
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
2015-12-17 09:25:56 +00:00
Andy Shaw
a88da6377d The cache_cost is measured in bytes and not kilobytes.
When increaseCost() is called then it will convert from bytes to kilobytes
so we need to specify the cache_cost to be in bytes.

Task-number: QTBUG-47812
Change-Id: I842514c9ab4d86b60b2beb6c80979156ea0de59c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-12-16 13:15:12 +00:00
Andy Shaw
e109b8a0f3 Decrease the cache if necessary when adding a new font
It was possible for the cache to increase too quickly since it was
relying on the timer to decrease which caused problems with FreeType.
So by checking if it will be increased to be over the limit first before
adding the new font, we can decrease it earlier in preparation.

Task-number: QTBUG-47812
Task-number: QTBUG-49535
Change-Id: Iedc042d8903949140aa8c5257a9d54cde31a51be
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-12-16 13:13:02 +00:00
Andy Shaw
3fb0d851a0 Emit the activated signal when the platform menu item is selected.
Change-Id: I3485501643c60f28ef188100146ac305e3ef9073
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2015-12-16 13:01:32 +00:00
Pasi Petäjäjärvi
7ac5228144 Delete QInputDeviceManager when deleting QGuiApplication
Without deleting m_inputDeviceManager instance it will remain
in process and causes crash when creating+destroying QGuiApplication
multiple times in process. Crash happens because m_inputDeviceManager
already exists when creating new instance of QGuiApplication and
metadata for QInputDeviceManager is not anymore valid and crash when
accessing it e.g. using connect() function.

Change-Id: I5acb1c5f6ce2ba9665fa893047210a913debe4e4
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-12-12 20:05:25 +00:00
Vincas Dargis
e8eaf82e58 PostgreSQL: Fix memory leak in QPSQLDriverPrivate::getPSQLVersion()
Memory leak occurs when 'release' pointer variable is overwritten
for second use without releasing resources it is currently pointing
to. Leak occurs only in specific edge case depending on
client/server versions.

Task-number: QTBUG-49789
Change-Id: Ie5be8996ed158309f20dbb3574f956d2eb137460
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2015-12-12 10:21:13 +00:00
David Fries
b2c7c489ab QLockFile: decide on locking strategy per path
It is filesystem dependent if flock and fcntl locks are independent or
the same underlying lock (which causes getting the second lock to fail).
A temporary file in /tmp might be on a local file system and pass
while the lock file is placed on NFS and fail with:
  setNativeLocks failed: Resource temporarily unavailable
Instead check for lock conflicts per path and cache the result.

Change-Id: I39c59bb240cd99ef0a0ec271243770ffd5df8a7d
Reviewed-by: David Faure <david.faure@kdab.com>
2015-12-11 17:59:52 +00:00
Juha Turunen
672f7dfdcd Fix a crash when calling QOpenGLTexture::setData with a null QImage.
Change-Id: Idf8ae00cff6929114b38dcb003c259c83a11dbaa
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-12-11 17:58:21 +00:00
Andy Shaw
6e14d63db0 Add explicit note about removeMappings() not disconnecting the signal
There can be a bit of confusion here regarding what removeMappings()
will do in this case so add an explicit note to be clearer.

Task-number: QTBUG-49499
Change-Id: Iabcf5cb2653f0b747727b2c92a244e95ec1836f8
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2015-12-11 09:41:14 +00:00
Andy Shaw
1440c13c8c Check if the file is writable even while QT_BOOTSTRAPPED
QConfFile::isWritable() has the extra effect that it will try and
create the path where the file should be if it does not already
exist. So this cannot be omitted as 'qmake -set' may be used in a
situation where the path does not yet exist.

Change-Id: I0113644259f78d090a0687c44cf60d400be9c859
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-12-11 09:41:05 +00:00
Andy Shaw
faf4865b80 Use unique shortcuts for the different actions
Change-Id: Ibc143ffac83dfb30facc9e93651e5f18550ab612
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2015-12-11 09:40:55 +00:00
Rainer Keller
1641a9ae43 Remove additional copyright notice
Change-Id: I181579d755a79e2e0a26ff2de119d9642183a2ca
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
(cherry picked from commit 2766215c9e)
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-12-10 13:57:16 +00:00
Florian Bruhin
2223d4a368 doc: Remove wrong statement about cache filenames.
The cache actually generates paths like "http/data8/f/lr9un1so.d".

Change-Id: Ie564494a241c3d1c87b2f0f17b42bd0349948640
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
2015-12-10 13:42:37 +00:00
Florian Bruhin
ca3933f90d Add missing \since to QSslCipher QString overload.
This was added in 5.3 in 30d199a76c.

Change-Id: I35a209fcfe417cb14605c4db19a3d2e85b67ee49
Reviewed-by: Michał Dutkiewicz
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-12-10 13:42:31 +00:00
Thiago Macieira
f0d0192652 Remove "FOO module" from config.tests/common
Change-Id: I14839ba5678944c2864bffff1417413f16d4ffeb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-12-04 05:20:29 +00:00
Thiago Macieira
2398e225ab Auto-detect whether 64-bit std::atomic really works
The C++ standard says it must, but some badly-configured toolchains seem
to be lacking support.

In particular, for some 32-bit platforms without native support for
them, GCC implements 64-bit atomics via out-of-line functions in
libatomic. If that library is missing... well, then std::atomic 64-bit
doesn't work and we mustn't try to use it.

This was found when trying to compile Qt 5.6 for MIPS 32-bit:

Linking library libQt5Core.so.5.6.0
.obj/qsimd.o: In function `std::__atomic_base<unsigned long long>::load(std::memory_order) const':
/opt/poky/1.7/sysroots/mips32r2-poky-linux/usr/include/c++/4.9.1/bits/atomic_base.h:500: undefined reference to `__atomic_load_8'
.obj/qsimd.o: In function `std::__atomic_base<unsigned long long>::store(unsigned long long, std::memory_order)':
/opt/poky/1.7/sysroots/mips32r2-poky-linux/usr/include/c++/4.9.1/bits/atomic_base.h:478: undefined reference to `__atomic_store_8'

Yocto bug report: https://bugzilla.yoctoproject.org/show_bug.cgi?id=8274

Change-Id: I42e7ef1a481840699a8dffff140224d6614e5c36
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 3d7586b760)
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
2015-12-04 05:20:26 +00:00
Martin Afanasjew
6c222297ab Make -no-rpath build more useful on Apple platforms
[ChangeLog][Platform Specific Changes][OS X] Configure with -no-rpath
will now yield Qt dynamic libraries and frameworks with an absolute
install name (based in -libdir).

OS X package managers like Homebrew install Qt in a fixed location. This
change simplifies deployment for such package managers and is consistent
with the default expectation on Apple platforms for libraries with a
fixed location to also have absolute install names.

While a relocatable installation (the default) also works in this
scenario, it requires all software that depends on Qt to be aware of
this and to embed a suitable RPATH into application binaries (which is
not automatic for non-qmake builds). This might not be true for some
select fallback search locations, but as package managers on OS X tend
not to use those, embedding an RPATH becomes practically mandatory. In a
default Homebrew installation, Qt is configured such that the frameworks
end up in /usr/local/Cellar/qt5/<version>/lib and that will be later
symlinked to /usr/local/opt/qt5/lib, both of which are not searched by
the dynamic linker by default.

Task-number: QTBUG-48958
Change-Id: I4395df98771e06a2ce8a293d11dc755bdc50757f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-11-30 20:36:12 +00:00
Allan Sandfeld Jensen
833341e301 Detect alpha8 as having alpha-pixels
Change-Id: I09025da7e3df84b6092295ec1a02698bd7b24bed
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-11-30 11:00:44 +00:00
Laszlo Agocs
c83eefff97 Remove incorrect assertion from the backingstore
The ifdef gave an impression of the code path being hit only when
texture-backed widgets are present and OpenGL-based compositing is
active. This is false. Asserting on having a context current is
wrong (as shown by autotests on the 5.6 branch).

Change-Id: I2539f0aac75b26597f49f63edcd9580428be79b7
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-11-26 05:50:14 +00:00
Joni Poikelin
e4d1bf9829 Fix crash in QFileDialog::iconProvider() with native dialogs
Task-number: QTBUG-49600
Change-Id: Ied28c0e7efa6b4dce25705dab98377848db5a6d3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-11-24 08:35:42 +00:00
Friedemann Kleint
045abe631c Remove arch/qatomic_mips.h from src/corelib/arch/arch.pri.
Amend change 110a8c339f, fixing:
WARNING: Failure to find: arch/qatomic_mips.h

Task-number: QTBUG-49168
Change-Id: I7009037d3f4c51c9ed9713b6e94ee43022fe2645
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-11-24 05:24:39 +00:00