Commit Graph

5233 Commits

Author SHA1 Message Date
Thiago Macieira
cf4b413fa4 Make QtDBus unit tests compile with runtime dbus-1 too
There's a change in Qt 5.4.0 that makes Qt compile with its own set of
D-Bus headers, which means QT_CFLAGS_DBUS may be empty. Thus, we can't
compile or link if we're using the actual libdbus-1 API to build the
test.

This commit makes these unit tests use the same dynamic loading
mechanism.

Change-Id: I56b2a7320086ef88793f6552cb54ca6224010451
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2015-01-06 18:16:32 +01:00
Thiago Macieira
624ee454ec Make QDBusConnection and QDBusServer return an error on default objects
The error of "Not connected".

This incidentally solves a crash when QDBusServer().lastError() is
called but libdbus-1 couldn't be found.

Change-Id: Id93f447d00c0aa6660d4528c4bbce5998d9186a8
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-01-06 17:37:00 +01:00
Thiago Macieira
aa83bacb14 Autotest: fix a race condition in verifying a peer D-Bus connected
On the unit test side, everything is sequential: we first ask for the
connection, verify that it is connected, then ask the remote side via
the session bus if it is connected. Unfortunately, the remote site may
handle things in a different order: it may handle the incoming function
call to "isConnected" before doing accept(2) on the listening socket.

So, instead, make the local side block until the connection is received
on the other side. On the remote, we don't block, instead we use the
feature of delayed replies.

Change-Id: Ie386938b8b39dd94a9d7e5913668125fb4a3c7da
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-01-06 17:36:58 +01:00
Eskil Abrahamsen Blomfeldt
ce40b8b7ef Android: Fix QCryptographicHash test
Include test data in qrc when building on Android.

Change-Id: I611ca24fe8764eb709b6ce27e814840ea919d4f1
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-01-06 16:44:38 +01:00
Eskil Abrahamsen Blomfeldt
8057ce61d0 Android: Fix QCommandLineParser test
Skip the tests that require building and deploying an external
command line application, since that's not how we do things on
Android, and it's really not very relevant for that platform.

Change-Id: I2c1985687e25fb0cf124b1d57c8ba60e37d2ff96
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-01-06 16:44:36 +01:00
Eskil Abrahamsen Blomfeldt
4613e1d2c1 Android: Fix QCollator test
On Android the POSIX implementation of QCollator is used, and
this does not support setting other locales than the default.

Change-Id: I25d23949341fc555e8be4f6836ae68cc8813cc46
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-01-06 16:44:34 +01:00
Eskil Abrahamsen Blomfeldt
463835b306 Android: Fix QChar test
Include test data in qrc when building on Android.

Change-Id: Id80623324788dac21bd5ddbeef8108f54d6bc8f7
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-01-06 16:44:32 +01:00
Eskil Abrahamsen Blomfeldt
6a4704cc64 Android: Fix QByteArray test
Include test data in qrc so it can be found on Android.

Change-Id: Iaca8422120f1ef842aafeb0cc209cb9fdd70f05f
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-01-06 16:44:30 +01:00
Eskil Abrahamsen Blomfeldt
75f0578124 Android: Fix QTranslator tests
Bundle test data in qrc on Android. Extract it, as the tests
expect to find it in the file system.

Change-Id: I251eca3c23141a608b1cbac5ee0b7164c068f9b4
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2015-01-06 16:44:27 +01:00
BogDan Vatra
af32727362 Android: Check XML output and optionally stop on fail.
The failures will be printed in red color.
Use -f param to stop on fail.

Change-Id: Ife58f9264a9ac859d739842c6d1359acde807ce7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-01-06 14:26:39 +01:00
Friedemann Kleint
16c32c6dfb JPEG: Fix reading of EXIF orientation.
The orientation is unsigned short, read it as such. In
JPEG-files created by Ricoh/Pentax cameras, the data is saved in
Motorola format. Reading the wrong data size will produce invalid
values when converting the byte order.

Change-Id: I8f7c5dc5bfc10c02e090d3654aaefa047229a962
Task-number: QTBUG-43563
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-01-06 14:26:00 +01:00
Cory Bloor
f38b7e0343 Fix QFileSystemWatcher::directoryChanged docs/test
QFileSystemWatcher does not signal directoryChanged() when files are
modified in a watched directory. QTBUG-8945 was closed with the
decision that it should not signal. Updating the docs and tests to
reflect this fact.

The test code that is being changed is a partial revert of Qt4 commit
1428cc6d71a65c1ac7123c9c4cc3cfaf225cceed. It appears that Symbian
supported directoryChanged() on modification, hence why the check
was for 0 or 1.

Change-Id: I04320c68f227ca338ce65e525956ee201fd50699
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2015-01-05 23:52:58 +01:00
Marc Mutz
4c1f66a0b2 tst_QHash: Factor qHash()-related test cases into a separate test
This is in preparation of adding more qHash()-related tests.

Change-Id: Iae65bf8b123e1d6ac6d1eb34d74ba4eb9df8173c
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2015-01-05 20:18:51 +01:00
Marc Mutz
832aea1e8e tst_QSet: add a non-trivial test for op==
Change-Id: Id42b2361e8741ee0d719fd52885a2d6dfdf6a634
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2015-01-05 20:18:41 +01:00
David Edmundson
54079de9f9 Add annotation to rename methods created by qdbusxml2cpp
Under DBus it is possible to have methods and signals with the same name
or have methods which are reserved c++ keywords.

For example the logind session interface has a signal and method both
called Lock.

This patch allows generated methods to use a different method name
specified in the annotation that the original DBus name in the DBus
interface in a similar manner to how one can rename accessors.

[ChangeLog][QtDBus] Add annotation org.qtproject.QtDBus.MethodName to allow
autogenerating C++ methods with different names to the original DBus method

Change-Id: I08bbe77554fbdd348e93f82d45bab0d75d360c27
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-05 12:29:14 +01:00
Thiago Macieira
b699ac070c Don't bind to QHostAddress::Any if we want to do IPv4 multicast ops
Linux gracefully allows us to do that and treat the v6 socket as if it
were v4. Other OS (notably OS X) aren't so forgiving.

Change-Id: I13dd3274be2a4b13e8b1eef93cbc2dd17b648f96
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-01-05 08:07:10 +01:00
Giuseppe D'Angelo
84a3dacf46 QItemDelegate: let QTextEdit and QPlainTextEdit receive tab keypresses
We already let enter/return key presses to reach text edits instead
of closing the editor. Do the same for tab/backtabs.

[ChangeLog][QtWidgets][Important behavior changes] QItemDelegate will
now not close a QTextEdit/QPlainTextEdit editor when the tab key
is pressed; instead, the key will reach the editor.

Task-number: QTBUG-3305
Change-Id: Ife9e6fdc5678535c596d1068770b0963134d8d5a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2015-01-04 18:33:49 +01:00
Marc Mutz
4560ce4ec6 tst_QLockFile: simulate a crash better
Instead of leaking the QLockFile instance, which causes
leak-checkers to emit false positives, simply call exit(),
which doesn't run the destructors, yet doesn't lead to
leak-checker warnings.

Change-Id: Ia61010671e5218ae412e2bcf873e66255a2c5a99
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-04 09:43:25 +01:00
Thiago Macieira
9b869cfb01 Autotest: Forward stderr of the sub-processes
So we can get the output when running with QDBUS_DEBUG=1.

Change-Id: I6a6b8e0d82727c522914fb90a7ce594c86307d8f
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-01-02 17:25:24 +01:00
Thiago Macieira
6d3558b449 Autotest: Be nicer when asking the sub-processes to exit
Instead of killing them outright (and note that terminate() doesn't work
on Windows), ask them nicely to exit on their own. This way, if we run
them in valgrind, valgrind gets a chance to print the leak check output
and summary.

Change-Id: Ib6cc8d4560ff0bf255f94980eb220e97592c00f0
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-01-02 17:25:01 +01:00
Israel Lins
5fefec9136 Added ROUND test for PostgreSQL
The ROUND function for PostgreSQL only accept NUMERIC field as argument

Change-Id: I0c3753bfe4167cd47158e21b407cca8771816104
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2014-12-30 23:56:13 +01:00
Israel Lins
b60773934d [QDateTime] ISO Time zone designators can be [+-]HH
Added support on QDateTime::fromString to read correctly dates on ISO
format with Time zone designators at format [+-]HH

Change-Id: Ied5c3b7950aee3d0879af0e05398081395c18df5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2014-12-30 23:56:01 +01:00
Julien Blanc
190f64aab3 Added timezone support for datetime fields in PSQL
This patch adds correct timezone support in PSQL plugin. Prior to this
patch, no timezone support was provided, so only the following case
worked :
 * using local time in both client application and postgresql server
 * datetime were using second precision

This patch tries to take care that postgresql has two different
datatypes for date time, respectively :
 * timestamp with time zone
 * timestamp without time zone

Both are internally stored as UTC values, but are not parsed the same.
 * timestamp with time zone assumes that there is a time zone
   information and will parse date time accordingly, and then, convert
   into UTC before storing them
 * timestamp without time zone assumes that there is no time zone
   information and will silently ignore any, unless the datetime is
   explicitly specified as having a time zone, in case it will convert
   it into UTC before storing it

Both are retrieved as local time values, with the following difference
 * timestamp with time zone includes the timezone information
   (2014-02-12 10:20:12+0100 for example)
 * timestamp without time zone does not include it

The patch does the following :
 * parse the date retrieved by postgresql server using QDateTime
   functions, which work correctly
 * always convert the date to UTC before giving it to postgresql
 * force time zone so that timezone information is taken into account
   by postgresql
 * also adds the milliseconds when storing QDateTime values

The following configurations are tested to work :
 * client and server using same timezone, timestamp with or without tz
 * client and server using different timezone, timestamp with tz

The following configuration will *not* work :
 * client and server using different timezones, timestamp without tz

Because data will be converted to local time by the postgresql server,
so when returned it will be different from what had been serialized.
Prior to this patch, it gave the illusion to work because since TZ
information was lost, time was stored as local time from postgresql.
Lots of inconsistencies occurred, though, in case client tz changes...

I don't expect this to be an issue since having different TZ in server
and client and *not* handling this is a broken setup anyway.

Almost based on changes proposed by julien.blanc@nmc-company.fr

[ChangeLog][QtSql] Added timezone support for datetime fields in PSQL

Task-number: QTBUG-36211
Change-Id: I5650a5ef60cb3f14f0ab619825612831c7e90c12
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2014-12-30 23:49:14 +01:00
Frederik Gladhorn
8bd84b11d3 Fix cmake test_moc_macro_target with namespace
The interface macro needs to be in the Qt namespace, otherwise the
template specialization in Q_DECLARE_INTERFACE fails.

Task-number: QTBUG-41959
Change-Id: I818da5ba8460219d73c0d248ee410ac92f7498f4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
Reviewed-by: Stephen Kelly <steveire@gmail.com>
2014-12-30 10:05:58 +01:00
Frederik Gladhorn
aaff94c2df Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
	src/corelib/tools/qbytearray.cpp
	src/gui/kernel/qplatformsystemtrayicon.cpp
	src/gui/kernel/qplatformsystemtrayicon.h
	src/plugins/platforms/xcb/xcb-plugin.pro

Change-Id: I00355d3908b678af8a61c38f9e814a63df808c79
2014-12-29 16:37:38 +01:00
Thiago Macieira
1196f69112 tst_QUdpSocket: Fix inverted logic in getting a non-"any" address
We want to use "localhost" if the server's address is "any", as some OS
can't send datagrams to "any" (e.g., OS X and FreeBSD).

Change-Id: I1004bc2282e7f930cdb7ed394aa9f4b5a1cfcf82
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-12-28 15:58:54 +01:00
Thiago Macieira
9a70b67b5a Don't hardcode port numbers in tst_QUdpSocket wherever possible
On my Mac Mini, port 5000 is in use, which means the broadcasting test
fails.

Change-Id: Ifb0883263e277f388342430349ea7315d42f324a
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-12-28 15:58:10 +01:00
Thiago Macieira
c290ee69f2 Fix silly QSKIP for IPv6 in tst_QUdpSocket::multicast
It was unconditional. Someone forgot to check for IPv6 support before
skipping IPv6 tests.

Change-Id: I7b11528ad02560f0db9defde3c64f76f48a6c1f8
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-12-28 15:57:52 +01:00
Marc Mutz
574e073b08 tst_QSizePolicy: non-functional fixes
Fix indention, add empty line as separator, undef a local macro.

Change-Id: Ie0d8529322f87ca2bdedb9a7f2f4cf9f463a6e12
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-12-26 20:23:20 +01:00
Marc Mutz
933c06e3f7 tst_QSizePolicy: split a test function
Split off default-value check from getSetCheck().

This is in preparation of extracting getSetCheck_data().

Change-Id: I869c34014a92e29a07dc08584a93a4cbba372518
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-12-26 20:22:41 +01:00
Marc Mutz
4bf8613df1 tst_QSizePolicy: minor cleanup
Fix indention, remove unused functions, slots->Q_SLOTS.

Change-Id: I30ced40dcde2650977424864399b721bbe17013c
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-12-26 20:22:29 +01:00
Thiago Macieira
98a7497d74 Silence warning in tst_QUdpSocket::multicast for Any+IPv4
QUdpSocket doesn't support binding to QHostAddress::Any and then joining
an IPv4 multicat group since QHostAddress::Any is really an IPv6 socket
with v6only = false. The test did check this case, but failed to ignore
the warning.

Change-Id: I62d782408319a6e566e0ff1a6081b706ac1f669c
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-12-24 22:49:26 +01:00
Thiago Macieira
14c5f149cd Fix tst_QUdpSocket::multicastLeaveAfterClose
With IPv6, you cannot bind to a multicast address. You need to bind to a
local address only. The previous tests either checked this or didn't
check the result of bind().

Change-Id: Ief70887d8988fc1bc4394cf6ff34b5d560e5748e
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-12-24 22:49:20 +01:00
Nick Shaforostoff
5b11e43e9f QThreadPool::cancel() to remove individual jobs from the job queue.
[ChangeLog][QtCore][QThreadPool] Added QThreadPool::cancel() which allows
removing from the job queue a job that hasn't been started yet.

Change-Id: Ib8f1c1f32a34f5eec8338c641d820b928e470164
Reviewed-by: Nick Shaforostoff <shafff@ukr.net>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-12-24 15:01:36 +01:00
Thiago Macieira
e38631b5e9 Stabilize tst_QUdpSocket::broadcasting
Sending 100*8 packets of each type of message is WAY overkill. That's a
stress test without limiting. My Linux system starts reporting EAGAIN on
the socket, so reduce the amount of data sent.

Change-Id: I153f44cf3b91d37526dac580b400114cc80b1769
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-12-24 14:42:27 +01:00
Thiago Macieira
68d8d27fad Don't try to send broadcasts over IPv6
IPv6 has no such thing, so don't try to bind to an IPv6 address to send
broadcasts (even though that works) and it's a poor idea to bind to IPv6
to receive broadcasts. Moreover, skip any IPv6 network addresses
(broadcast() is invalid).

Change-Id: I2829b042c000158565adfd92db682f37d67dacae
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-12-24 14:42:05 +01:00
Thiago Macieira
7a303ff55f Suppress silly shell warning during qmake of qtcpsocket.pro
If you don't have /etc/lsb-release, you'd get
  sh: line 0: [: =: unary operator expected

Change-Id: Idb5c79f799879e4d32cd640ef74fb388227f831e
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-12-24 14:41:55 +01:00
Thiago Macieira
a0cec54220 Autotest: Disable multicast testing with proxies
It doesn't make sense because there is no command to ask the proxy
server to join a multicast group. At best, we could write a datagram via
proxy without joining, but we definitely can't receive.

Change-Id: Icc6b54572a053fb7821dfca1f4111f2046ff8686
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-12-24 14:40:21 +01:00
Shawn Rutledge
32422885fc emit lastWindowClosed even if quitOnLastWindowClosed is false
Behavior will agree with the docs.

[ChangeLog][QtGui][QWindow] lastWindowClosed will be emitted even if
quitOnLastWindowClosed is not set

Task-number: QTBUG-32956
Change-Id: I7bb269d53894859fee27e171eea7ad472ea86af0
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2014-12-23 14:12:25 +01:00
Thiago Macieira
c013104b04 Temporarily disable the QtDBus tests if the session bus isn't available
This is a temporary measure while the Qt CI system is updated to have
the correct D-Bus configuration. Once it is fixed, this commit should be
reverted, so that we don't run into the situation in which the tests
aren't getting run on some configurations and we never know about it.

Change-Id: I7192d4d95a60dcb63acfa6cc90bfdc58592b0664
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2014-12-23 12:22:56 +01:00
Eskil Abrahamsen Blomfeldt
244da85d3b Android: Fix QTemporaryDir/File::nonWritableCurrentDir() tests
The /home path doesn't exist on Android, so it doesn't work as
a non-writable current dir. Instead we use /data on Android.

Change-Id: Ib779f60822da1bef421a16a00c1030245a8c5b90
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-12-22 09:28:05 +01:00
Eskil Abrahamsen Blomfeldt
4bee095069 Android: Fix QLoggingRegistry test
The qtlogging.ini file needs to be detectable by QFINDTESTDATA,
so we put it in a qrc file on Android.

Change-Id: I5fb0217098c56f2b2e99ab8d1642c4a7904b18d1
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-12-22 09:27:55 +01:00
Eskil Abrahamsen Blomfeldt
4fec0dca87 Android: Disable QLockFile test
This test requires building a console application first, deploying
this as part of the APK and then being able to execute the
bundled file from the main application. Since IPC is a limited
use case on Android, we just skip this test instead.

Change-Id: Ie68e495ff64b69e7027924291a411b5de0e2da76
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-12-22 09:27:49 +01:00
Eskil Abrahamsen Blomfeldt
ae55d3ea27 Android: Fix QIODevice tests
Test requires that tst_qiodevice.cpp is available on file system,
but since we're not able to deploy directly to the file system
on Android and since we want to actually test file system access,
we bundle it in qrc and copy it out during initialization.

Change-Id: Ida2b5bf6f1dcd43bc740a2b9380352bab5eb6c62
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-12-22 09:27:44 +01:00
Eskil Abrahamsen Blomfeldt
e511d9b9dd Android: Fix QFileSystemWatcher test failures
Some of the tests expect QDir::homePath() and QDir::currentPath()
to be different, so we just set the current path to something
other than QDir::homePath().

Change-Id: Ib048d323f4745369821765230b995a73b8a97145
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-12-22 09:27:38 +01:00
Eskil Abrahamsen Blomfeldt
616ac8e59c Android: Fix test failure for test QFileInfo::lastRead()
This test may not be possible on Android, since the file system
can be mounted with noatime or relatime which means read access
will not be registered.

Change-Id: I40f587e1a1f131ee06f0e3700e908ccaa19c83ce
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-12-22 09:27:31 +01:00
Eskil Abrahamsen Blomfeldt
5681ae74e3 Android: Fix QFileInfo tests
Since there's no way to deploy files directly to the file file
system on Android, we put them in a qrc file and extract them
on startup.

Change-Id: I6a42aa5e0372bfd9fb2f7ccfea964c9c3c2e45d8
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-12-22 09:27:27 +01:00
Eskil Abrahamsen Blomfeldt
0dd7bd0c7a Android: Fix QDirIterator tests
This test requires that the resources are also available
in the file system. Since it's not possible to deploy directly
to the file system using Android, we extract the files on
startup instead.

Change-Id: I1d1fe7d62c4c618a89713e3a7d1903e42bfb10b8
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-12-22 09:26:57 +01:00
Eskil Abrahamsen Blomfeldt
0b16f42565 Android: Fix QDir tests
There's no way to install files automatically into the file
system on Android, so to test QDir on the file system, we have
to bundle the files in qrc and then copy them into the file system
on startup. This adds some complexity, but at least it will detect
regressions.

We also need to make sure the current directory is the same as
the data path, since the test assumes this, and /usr/ does not
exist on Android, so we have to use a different path to find the
root path.

Change-Id: I18d79b5ed99a0afff573beb30c61745c403f8991
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-12-22 09:26:49 +01:00
Eskil Abrahamsen Blomfeldt
999321fecb Android: Stabilize QPauseAnimation test
This will arbitrarily fail at certain points. Adjusting the
timeouts helps, but it's very unpredictable, so it's better
to do what we do on Windows and just expect-fail the results
that we get.

Change-Id: Ie6033c73539c2dd69115b06096919e173f097367
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-12-22 09:26:38 +01:00
BogDan Vatra
49517ac1dc Android: Fix qicoimageformat test.
Add all test data to resources.

Change-Id: Id42a4c033b75409f65cb4d56ebf1161336b93832
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2014-12-22 08:34:05 +01:00
BogDan Vatra
4cea71eebe Android: Fix qmovie test.
We must add all test data to resources.

Change-Id: Ic12f8fce9afb965aff32e7141516c8d223e64491
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2014-12-22 08:33:17 +01:00
BogDan Vatra
daa5679c8e Android: Fix qicon test.
We must add all test data to resources.

Change-Id: I7f9e7650156b174b7c16270d86b78e9408dff254
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2014-12-22 08:33:02 +01:00
BogDan Vatra
2073057bde Android: Fix json test.
Add test data to resources.

Change-Id: Ib8a5688e7caab8434b8f0676f53a2a79ec94b264
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2014-12-22 08:32:39 +01:00
BogDan Vatra
36132addd1 Remove old test script & project.
Change-Id: Ia31959228e188a3f9d2fe3a95c7381a3f4e5d1fb
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2014-12-20 07:42:09 +01:00
Thiago Macieira
d55db285fc Autotest: Fix a race condition in launching the QtDBus sub-processes
Wait for the subprocess to print "ready" before assuming that it is
ready to receive calls. waitForStarted() will return as soon as the
child is running, but it may not have registered on D-Bus yet.

This also solves the synchronization problem more elegantly than how
tst_qdbusmarshall.cpp was trying to do it.

Change-Id: I548dfba2677cc5a34ba50f4310c4d5baa98093b2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-12-20 07:37:17 +01:00
Thiago Macieira
36314ae75f Fix handling of subprocesses for QtDBus unit tests on Windows
The executables are not in the same dir as on Unix, so we need to use
QFINDTESTDATA to find them. The DESTDIR setting prevents qmake from
placing the executables in a "debug/" subdir.

Change-Id: I1d6d10e6f6f109f55fd9809dcf83da0386f38772
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-12-20 07:37:12 +01:00
Thiago Macieira
3148d0c7b4 Don't kill the subprocess in tst_qdbusabstractinterface
Rohan was right in e88f9a92b7 to stabilize
the test and reset the state, but killing the subprocess is overkill.
All we need is to reset the state in both applications, which includes
disconnecting and reconnecting to the peer, to discard any sent but not
yet received messages.

Change-Id: Ie01392e6e63bd70ef8345217d3fc641ed63c7aba
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-12-20 07:37:01 +01:00
Thiago Macieira
91fe8129fa Autotest: Make the peer executables report error if they failed
QDBusServer::address() will return an empty QString, which caused the
tests to fail later with no apparent reason.

Change-Id: I86f448dfc67a6cdb27ecda2d490f335766cfaf4f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-12-20 07:36:52 +01:00
Thiago Macieira
7b6ab50c68 Remove the hardcoding of Unix socket paths for QtDBus
This allows the tests to be run on Windows too by using TCP socket
connections instead of requiring Unix sockets. The tests shouldn't have
hardcoded the path, which came from QDBusServer anyway. Now the tests
simply defer to QDBusServer.

This is a slight behavior change for Windows, but not one that should
matter since anyone who was using the default constructor resulted in a
QDBusServer that failed to listen.

[ChangeLog][QtDBus][QDBusServer] Fixed a bug that made QDBusServer's
default constructor try to bind to a Unix socket on non-Unix systems.
Now QDBusServer will attempt to bind to a TCP socket instead.

Change-Id: I2a126019671c2d90257e739ed3aff7938d1fe946
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-12-20 07:36:42 +01:00
Thiago Macieira
9434162eda tst_qdbusconnection_no_bus: Fix build on Windows
There's no setenv, so use qputenv instead.

Change-Id: I357ff6d0e3d67e199661a9d87c720fc4e0131755
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-12-20 07:36:34 +01:00
Giuseppe D'Angelo
95092e2011 Make setting twice the very same model on QComboBox a no-op
Basically, introduce a small check for this corner-case situation.
Setting a model doesn't just store a pointer, but also resets the current
index, changes the line edit completion model, and so on, and seems silly
to trigger changes in such cases.

[ChangeLog][QtWidgets][QComboBox] A QComboBox does not reset itself any
more when setting the same model more than once.

Change-Id: If028b36cdfaa5552c156dd900e123ca9a04d4e3d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-12-20 06:36:29 +01:00
André Klitzing
ebd33883e7 QState: Added template PointerToMemberFunction
Added the function pointer to addTransition to take
advantage of the new connect syntax.

[ChangeLog][QtCore][State Machine] Added an addTransition() overload that
takes a pointer-to-member for the signal triggering the transition.

Change-Id: Ic97f7983839217ca0c8484b269d38221cbe804e3
Task-number: QTBUG-40293
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-12-20 06:36:26 +01:00
Pavel Krebs
1c1cce67fa QScrollBar: emit valueChanged once even if a slot takes too much time
Put also processing of control activation into initial timer check for possibly
pending mouse release event.

[ChangeLog][QtWidgets][QScrollBar] Fixed a bug where the valueChanged() signal
was emitted twice if a connected slot took too much time.

Task-number: QTBUG-42871
Change-Id: I7bad5279ef84463a033b55256d241d4445374081
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2014-12-19 17:15:07 +01:00
Eskil Abrahamsen Blomfeldt
678a283498 Android: Fix QStandardPaths test
QStandardPaths::writableLocation() is documented to return the
empty string if no matching writable location can be determined.
This is the case for e.g. FontsLocation and ApplicationsLocation on
Android. We need to still accept this as a valid response.

Change-Id: I2824e9dcfd41b1c24dbf3896b7ae9b5260e9accd
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-12-19 16:00:46 +01:00
Eskil Abrahamsen Blomfeldt
0fb839ac62 Android: Fix QResourceEngine tests
The test expects all the files to reside in the file system,
both for loading the runtime resources and for comparisons.
Since we can't deploy directly to the file system on Android,
we go via qrc and extract the files on startup instead.

Change-Id: I17ff8985cb17dbfc45f0fb692ca46558bb5c5cdc
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-12-19 16:00:41 +01:00
Andy Shaw
a07120d496 Don't clear lineedit in non normal echo mode when validation is invalid
This fixes a regression introduced with
c09e9f71173a698670d6c728291ee24f53d50800 which caused the lineedit to
clear the whole text when an invalid character was entered into a lineedit
with an echo mode that was not Normal and a validator was set.

Now if undo() is called directly then it will still clear the text as it
is considered to be called as a user. Whereas the validation will take
care of the invalid entry by using internalUndo() as before which avoids
the clearing of the entire text.

Task-number: QTBUG-29318
Change-Id: I5ff5777a75ab864de2217441b5f518f50646bd8f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2014-12-19 15:55:07 +01:00
Thiago Macieira
7fad14f4e2 tst_qlogging: add tests for %{pid} and %{threadid}
Since those are unpredictable, there's little we can match, besides the
"0x" for the QThread pointer. For the PID, at least we can compare it to
the value from QProcess.

Change-Id: I89420306863b95c82be761baabd733a7f17eba5e
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2014-12-19 01:54:41 +01:00
Thiago Macieira
0cd1ed0883 Fix running tst_qmessagehandler when QT_MESSAGE_PATTERN is set
This test fails if the environment has the variable set.

Change-Id: Ibd54ff3e6e22a885341898889088ac56e84282b1
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-12-18 22:17:36 +01:00
Simon Hausmann
622df95fee Prospective stabilization fix for tst_qwindow::positioning(default)
Our theory for the failure of framePosition() not having the expected
value after setFramePosition towards the end of the test is that we try
to call setFramePosition() while the getting-back-from-fullscreen-to-normal
window animation is still running, at which point the compositor may
just choose to ignore our move request.

Similarly to when going fullscreen, also wait when coming back from it.

Change-Id: Icfc92f277d96dccdfad772c4aac252b2a20c6196
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2014-12-18 17:56:03 +01:00
Simon Hausmann
e281537f20 Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
	src/corelib/global/qglobal.h
	src/platformsupport/platformcompositor/qopenglcompositor.cpp
	src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp
	tests/auto/gui/kernel/qwindow/tst_qwindow.cpp

Change-Id: I5422868500be695584a496dbbbc719d146bc572d
2014-12-18 12:12:58 +01:00
Laszlo Agocs
6c2da36c22 Prevent continuous painting with viewport QOpenGLWidget
Add the source widget to the texture list (may be null for custom
compositor implementations that add textures not belonging to actual
widgets). This allows us to do proper checks with the
dirtyRenderToTextureWidgets list.

As a result paint events are only sent to a QOpenGLWidget if (1) there
was an update() for it or (2) it was actually marked dirty. (2) was
previously behaving differently: the widget got a paint event when
anything in the window has changed. This is fine for naive animating
OpenGL code but less ideal for QGraphicsView.

Bool properties like stacksOnTop are now stored in a flags value to
prevent future explosion of texture list fields and parameters.

Task-number: QTBUG-43178
Change-Id: I48cbcf93df72ac682c9b5d64982a8b648fe21ef3
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2014-12-18 09:46:23 +01:00
Alex Blasche
8eb4b281d9 Change bugreports.qt-project.org -> bugreports.qt.io
The Qt bug tracker URL changes as part of the qt.io transition

Change-Id: Icb4ab198943b93639b5e3a8d99262303785c6459
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2014-12-18 09:46:09 +01:00
Simon Hausmann
bfbb985ed5 Add some debug information to tst_qwindow
The test still fails sporadically at a new place, so this adds some
debug information when it fails to may help us identify what is going
wrong.

Change-Id: Ife0f171299ef7e800a2d808602e76ca2f3885964
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2014-12-18 09:41:36 +01:00
Tony Sarajärvi
dd91e1bc4d Blacklist ioGetFromHttpBrokenServer:no-newline
Task-number: QTBUG-43388
Change-Id: Ie589d72723520152a4cdb28b2fe40e3013b0dd50
Reviewed-by: Simo Fält <simo.falt@theqtcompany.com>
2014-12-16 14:36:16 +01:00
Eskil Abrahamsen Blomfeldt
19bb9aa9e5 Fix possibly corrupted log clusters when using custom tab stops
The calculateTabWidth() can trigger shaping of the item, which can
cause the layout data to be reallocated, so we need to update the
local pointers to it, like we do when we explicitly invoke the
shaper.

[ChangeLog][Text] Fixed problems with text layout when using custom
tab stops.

Task-number: QTBUG-43126
Change-Id: Ifaeeeb4bfb1a55e6638b12b444f53d2679d3d1e6
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-12-15 21:02:12 +01:00
Jeremy Lainé
14d1097f45 ssl: store socket in setEmptyDefaultConfiguration
The setEmptyDefaultConfiguration test creates a socket and connects its
sslErrors signal to tst_QSslSocket's ignoreErrorSlot slot. This slot
expects the socket to have been stored in tst_QsslSocket's "socket"
member, which was not being done. This patch fixes this problem.

It does beg the question of whether having a "socket" member in the
tst_QSslSocket class is a good idea as it is error prone.

Change-Id: Ic59d1789c5f1ed240c3f0c37981f6ecc35572f0d
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-12-13 08:32:19 +01:00
Tor Arne Vestbø
dfccd78aa6 Ensure that GL::updateBrushTexture() activates and binds properly
Calling QOpenGL2GradientCache::getBuffer() will generate the texture the
first time, calling glBindTexture in the process. We did this without
first ensuring that the right texture unit was active, resulting in the
generated gradient texture binding onto the glyph cache mask unit.

We now provide a specialization of bindTexture for a QGradient, which
ensures that the right unit is active before calling getBuffer().

Unfortunately we have no way of knowing if the result of getBuffer()
was a texture that was already bound, or if we need to bind the result,
which means we have to do an unconditional bindTexture of the resulting
texture ID. This means double-bind for the initial texture generation,
but this was already an issue in the original code.

Task-number: QTBUG-43039
Task-number: QTBUG-41244
Change-Id: I20c9b795c8c14f8d58be2b60a284c5a060705ec0
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2014-12-13 01:49:24 +01:00
Alexander Volkov
53022e04bb Make the defaultSectionSize property of QHeaderView style dependent
Add new enum items PM_HeaderDefaultSectionSizeHorizontal and
PM_HeaderDefaultSectionSizeVertical to QStyle and get corresponding
values in QHeaderView. This way we get rid of some magic constants in
QHeaderView and we can have reasonable values for the default section
size for high-DPI displays.

[ChangeLog][QtWidgets][QHeaderView] Default section size is now style-dependent by default.

[ChangeLog][QtWidgets][QHeaderView] Added resetDefaultSectionSize().

Change-Id: I44e152c5cf0bec1e5d78e1e62f47a2d1f761dfbf
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2014-12-11 10:26:41 +01:00
Simon Hausmann
015002fec9 Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
	doc/global/template/style/online.css
	mkspecs/android-g++/qmake.conf

Change-Id: Ib39ea7bd42f5ae12e82a3bc59a66787a16bdfc61
2014-12-10 07:58:06 +01:00
Marc Mutz
cb93117d06 QChar: prepare relational operators for constexpr'ification
Make sure the relational operators are in a constexpr'able form
by removing the use of the const/non-const-overloaded unicode()
function, which in the relational operators is resolved to the
non-const version, which isn't constexpr'able.

Replaced with direct member access for op== and op< (required
making them friends) and reformulating the other operators in
terms of these two.

Since I managed to introduce a bug while doing this change,
add a simple test for QChar operators, too.

Change-Id: I69f3da849e71abc2a17152f797694950914adebc
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-12-10 01:26:51 +01:00
Jan Arve Saether
c9db6e52bc Fixed a bug where spans did not always work in layouts.
The problem was that the span we stored in the multiCellMap was the
"effective" span (i.e.  the given span subtracted with the number of
ignored rows it would span). Later we used that span to distribute its
size across all its cells.  However, since the span now could be smaller
that the given span, we could sometimes fail to distribute to the last
span(s).

[ChangeLog][QtWidgets][layouts] Fixed a bug where spans sometimes didn't
distribute themselves to the last cells they covered.

Change-Id: I31db3d850484dc8b70d62c5f02f680740578c661
Task-number: QTBUG-43099
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2014-12-09 16:58:58 +01:00
Jeremy Lainé
0a1d7f6151 ssl: merge and tighten sslErrors and peerVerifyError tests
The sslErrors and peerVerifyError test the same situation: connect to a
server which is using the fluke certificate, using the incorrect host name.
They connect respectively to qt-test-server:993 and the.server.ip.address:443.

The sslErrors is prone to backend-dependent failures concerning the order
in which SSL errors are received, just like the peerVerifyError test was
until recently.

This change merges these two tests into one, which is run against the same
two servers as previously. It also adds a check to ensure that sslErrors
and peerVerifyError emit the same SSL errors (regardless of order).

This also fixes the included headers for non-OpenSSL backends.

Change-Id: Ibd5f60d24f1682989378e87729389e4b8f9efac5
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-12-09 16:58:08 +01:00
Simon Hausmann
9ccd359be8 Attempt to make the positioning test of QWindow more reliable
The part of the test that verifies that setFramePosition moves the window
successfully appears to be very unreliable in the CI system. The "tested"
frame position is calculated to be at (40, 40) relative to the top left
of the available screen geometry, which can be non-zero due to task bars
and similar system ui elements. However that position appears to be
unreliable in the sense that the window manager doesn't seem to always
respect that. So instead let's try placing the window (by frame position)
in the center of the screen instead.

Change-Id: I96fe6c37e748fc18262632b5effe5a9e90dc0028
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2014-12-09 16:52:37 +01:00
Giuseppe D'Angelo
f96baeb75f QSortFilterProxyModel: honor the roles parameter of dataChanged
When the source model emits dataChanged, it may tell which roles
have been changed. That information was lost when using a
QSortFilterProxyModel -- the proxy simply dropped that argument
(meaning "all roles may have changed"). It's instead a good idea
to forward the roles argument, as it may minimize hits on the
proxy (on unchanged roles).

[ChangeLog][QtCore][QSortFilterProxyModel] QSortFilterProxyModel
now properly forwards the roles that have been changed when
the source model emits dataChanged().

Task-number: QTBUG-35440
Change-Id: Ifa5213866ba04dfd57d50b5fbd47638f2191eb8e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2014-12-07 20:51:08 +01:00
Jędrzej Nowacki
9cb85ada8b Fix memory leaks in tst_moc
Change-Id: Id17c4253e7e7a2e4ab7fd9b290481ca90914b782
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-12-07 12:39:19 +01:00
Jędrzej Nowacki
ac79a25aae Fix maximal literal string limitation in moc.
C++ standard advise to place 64k char limit for string literals, this
patch improves moc output so it is not affected anymore.

Task-number: QTBUG-36500
Change-Id: Iece630faaef45baebe8c7afe4fc51e0362c713de
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-12-07 12:39:07 +01:00
Jędrzej Nowacki
a2d7441b83 Fix QMetaProperty::write so it tries to register a property type.
We can not assume that the property type is always registered, because
QVariant argument may contain an instance of a different type.

Change-Id: I4fc9593b826e13c401dbdacec4d60db36edc7102
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-12-07 12:38:40 +01:00
Simon Hausmann
7644faa881 Merge remote-tracking branch 'origin/5.4.0' into 5.4
Change-Id: I0cd11cbe95693b78450ea81a0187760f4a6a8b5f
2014-12-05 11:53:33 +01:00
Friedemann Kleint
82d54a6593 Stabilize tst_QWindowContainer.
Fix window/widget leaks, observe available geometry.

Change-Id: I19784d34a62c6e05dbc403852364cfb5e4d12dd5
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2014-12-04 20:18:38 +01:00
Simon Hausmann
bd5743f1d8 Make tst_qwindow::positioning more reliable
Don't check for absolute counts of resize events but just check if we
were resized. Also use QTest::qWaitForWindowExposed instead of QTRY_COMPARE
and checking for QEvent::Expose.

Change-Id: Ie383493a8ce6d88cad50bd6375d432ad1578449c
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2014-12-04 12:00:43 +01:00
Friedemann Kleint
8e9d78e43e QMenuBar: fix extra indent on the right with a TopLeftCorner widget.
When setting a left corner widget on a QMenuBar, the first
action rectangle is offset by its width and thus the width
should not be added to the size hint. Use QSize::expandedTo()
instead.

Task-number: QTBUG-36010
Change-Id: I660e3facbd0aeb5fb84fac8923db3e0c7998309d
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2014-12-04 06:33:03 +01:00
Aaron McCarthy
9501fef5da Fix DBus signature generation for complex types.
When generating the DBus signature of a registered custom type the
marshaller appends the signatures of the map entries and array items
after the map/array causing an invalid DBus signature to be generated.
This happens because beginArray() and beginMap() output the full
signature of the data.

Fixed by suppressing changes to the signature within
beginArray()/endArray() and beginMap()/endMap() blocks.

Change-Id: Icaf23b2fe58a3e1f575b81e4a100f02684f68452
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-12-04 05:40:30 +01:00
Thiago Macieira
1eb7005850 Use the new warning enabling/disabling macros in qtbase
Change-Id: I91ff06644e8047c2ca483f9768b46c1372eb6171
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2014-12-03 18:09:17 +01:00
Thiago Macieira
cf475b91ae Implement proper C++ type numeric promotion for QVariant comparisons
Previously, QVariant would try to convert one operand to the other's
type, which would produce unexpected results: the results would depend
in the order of the operands and whether there was data loss in the
conversion. In addition, ordering comparisons were only done with signed
values, yielding other unexpected results, like
   QVariant(LLONG_MAX / 2) < QVariant(Q_UINT64_C(0)).

Instead, try to obey the C++ standard rules for type promotion in
expressions. Our code is a little simpler than the standard would seem
to require since we know some more details from the ABI.

[ChangeLog][Important Behavior Changes][QVariant] QVariant now obeys the
C++ type promotion rules when comparing numeric types (integrals, float
and double), including the fact that unsigned comparisons are preferred
for types of the same rank (that is, now QVariant(-1) > QVariant(0U)).

Task-number: QTBUG-42722
Change-Id: Ie7b19073dcb45485354710975e561bcdb1a753f1
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2014-12-03 18:09:00 +01:00
Giuseppe D'Angelo
d41834b953 QAbstractScrollArea: add a getter for the margins
Strange API asymmetry that needed to be fixed.

Task-number: QTBUG-8315

[ChangeLog][QtWidgets][QAbstractScrollArea] A getter for the viewport
margins has been added.

Change-Id: Ie1460b572206922031fc4effc2aa8261e25088b5
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2014-12-03 18:03:09 +01:00
Andy Shaw
2ca57e39e3 Respect the size hint signal for the column and row delegates
The sizeHintChanged() signal from the column and row delegates need to be
connected to the doItemsLayout() slot so that the view is updated when the
size hint changes.

Additionally doDelayedItemsLayout() is called to ensure that this is
up-to-date as the size hints may have changed when the new delegate was
set on the row or column.

Change-Id: I458293f05ce9ef40a03bdbcab1a6e7a10f648c89
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Kevin Puetz <PuetzKevinA@JohnDeere.com>
2014-12-03 13:31:07 +01:00
David Faure
bb4625f472 tst_QItemDelegate: simplify code, no behavior change
Remove duplication of the set of flags.
Remove "text" column which had a constant value.

Change-Id: I39dd541a545664fb3f992b32b8c64e4dd263a9c7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2014-12-02 14:41:26 +01:00
Friedemann Kleint
03c4b52e13 QLayout: Observe contents margin when positioning the menu bar.
Task-number: QTBUG-38152
Change-Id: I53ea6bce33057251265a7eca1651aeabca314ba9
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2014-12-02 08:36:59 +01:00
Friedemann Kleint
4958cadeda QMainWindow: Observe left contents margin when positioning status bar.
Task-number: QTBUG-38152
Change-Id: I4c762a113dbfe47472d1087aa34c0e327083ee16
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2014-12-02 08:36:54 +01:00
Thiago Macieira
a2da88712f Make QtDBus compile without libdbus-1 headers, if dlopening
Most of QtDBus already needs very little from libdus-1, so create an
extra header containing the minimum API we actually need.

One large advantage of this solution is that now QtDBus can always be
enabled, even if the system doesn't have libdbus-1 installed. This is
interesting on OS X, where libdbus-1 is often installed by Homebrew or
MacPorts, which may include extra libraries we don't want in our
packaging.

Change-Id: I1b397121ec12eeca333ef778cf8e1c7b64d6b223
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-12-01 20:03:33 +01:00
David Faure
504ab80f6d tst_qsortfilterproxymodel: remove unused member var
(clang warning)

Change-Id: Id751443e03be4f2bd1721cbe9d9a898d9619b29b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2014-11-28 09:09:02 +01:00
Frederik Gladhorn
ce6990c3e7 Merge remote-tracking branch 'origin/5.4' into dev
Change-Id: Id20053d261b4fbbcc0ac8ba49dd3ef2253fa4b95
2014-11-27 18:28:12 +01:00
Frederik Gladhorn
3de7382044 Merge remote-tracking branch 'origin/5.4.0' into 5.4
Conflicts:
	dist/changes-5.4.0

7231e1fbe2 went into 5.4 instead of the
5.4.0 branch, thus the conflict.

Change-Id: I70b8597ab52506490dcaf700427183950d42cbd1
2014-11-27 18:12:10 +01:00
David Faure
2d0b20ef92 QLineEdit: take text margins into account in minimumSizeHint().
sizeHint() did it exactly like this, but minimumSizeHint() didn't,
which made it too small. Didn't affect the actual size in most cases
since the vertical size policy is fixed, so sizeHint() is called instead.
But when writing a subclass, if one re-implements sizeHint() by
calling the QLineEdit's minimumSizeHint(), it would then be wrong,
when text margins are used.

Change-Id: I29ae8dcab00842b3b5ca534cdb250efc0b496f45
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2014-11-27 04:19:05 +01:00
Giuseppe D'Angelo
ffbfd8eda6 SSL: Add support for selecting which curves should be used by an elliptic cipher
[ChangeLog][QtNetwork][QtSSL] It is now possible to choose which elliptic
curves should be used by an elliptic curve cipher.

Change-Id: If5d0d58922768b6f1375836489180e576f5a015a
Done-with: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-11-26 22:07:56 +01:00
Alejandro Exojo
6ea6ee7a12 Adjust DBMSType to DbmsType to follow conventions
The enum was made public in f84b00c6d2, but this
makes it follow the convention to camel case acronyms too before it's too late
to change it.

Change-Id: Ibb81e9221cb73fe0502d0a26f2d73512dd142f08
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-11-26 10:47:32 +01:00
Tony Sarajärvi
aed71b6832 Blacklist one tst_qsslsocket test
Task-number: QTBUG-29941
Change-Id: Ieb3418a2d6d88ebd399964b5df20d9fe4d6ca37b
Reviewed-by: Simo Fält <simo.falt@digia.com>
2014-11-26 10:47:08 +01:00
Jørgen Lind
ddc7323999 XCB: send leave event on grab
When a popup is opened it grabs the input, but the leave event to the other
windows needs to be sent.

Remove the popupEnterLeave test as it did not test any code. The Popup
never gets any enter or leave events so it will succeed always succeed

Task-number: QTBUG-36862
Change-Id: I625c616eeb74b5168af7b751485e2a9a53b76cd3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-11-26 08:43:28 +01:00
Frederik Gladhorn
34aba4724f Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
	src/corelib/io/qiodevice.cpp
	src/plugins/bearer/linux_common/qofonoservice_linux.cpp
	src/plugins/bearer/linux_common/qofonoservice_linux_p.h
	src/plugins/platforms/android/qandroidplatformtheme.cpp
	src/tools/bootstrap/bootstrap.pro
	src/widgets/styles/qmacstyle_mac.mm

Change-Id: Ia02aab6c4598ce74e9c30bb4666d5e2ef000f99b
2014-11-24 13:39:13 +01:00
Alejandro Exojo
f88ab80c8a Use camel case in PKCS#12 function
This makes it follow the coding style, which says to camel case acronyms too,
and makes it consistent with the rest of the class.

Change-Id: I4a1b21de1815530e476fc5aa8a0d41c724fc8021
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-11-24 08:50:05 +01:00
David Faure
736ac19156 QAbstractProxyModel: fix canDropMimeData/dropMimeData implementations
The code in 4696e9dbaa was incorrect. It is perfectly valid to call
these methods with row=-1 column=1 parent=some_index, this is exactly
what happens in QListView and QTableView. Child row/column is only for
trees.

Move the coordinate mapping from QSortFilterProxyModel into a new
mapDropCoordinatesToSource internal method, used by QAbstractProxyModel.

Task-number: QTBUG-39549
Change-Id: I3312210473d84b639cbe4c01f70ea36437db3e91
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Stephen Kelly <steveire@gmail.com>
2014-11-24 08:05:43 +01:00
David Faure
dcbf704bc0 tst_qtableview: fix virtual-override clang warning
Change-Id: I40391890c988ce15d8fa65898976bf0fdc446992
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2014-11-24 08:05:34 +01:00
Thiago Macieira
749f4f0e55 Disable the tests that verify that the available space shrunk
Somehow, it doesn't shrink with btrfs, even if you write 1 MB of non-
null data. This does not seem to be a bug in QStorageInfo. strace
confirms that there is a second statvfs call happening.

Change-Id: I9ed99d27d25e191916278e6b8faeae132469fc63
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2014-11-22 20:02:45 +01:00
Jan-Marek Glogowski
a2f78ea0a1 Fix tst_QEventLoop::processEventsExcludeSocket test
The testcase always returns the expected result, independently of the
QEventLoop::ExcludeSocketNotifiers flag to processEvents.

In Qt4 the same test uses an intermediate QEventLoop and already runs
it before the QEventLoop::ExcludeSocketNotifiers:

  QEventLoop loop;
  // allow the TCP/IP stack time to loopback the data,
  //  so our socket is ready to read
  QTimer::singleShot(200, &loop, SLOT(quit()));
  loop.exec(QEventLoop::ExcludeSocketNotifiers);

This fixes and improves the test by connecting, processing and
checking the bytesWritten signal for the pending connection socket.

Change-Id: I1b1d2b7b83910c87ba3fe48e29ac9fd585ac62ad
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-11-21 18:51:17 +01:00
Tony Sarajärvi
d958a16bc1 Blacklist one test function in tst_QNetworkReply
This patch is cherry-picked from
c38f1f19b8 and
d29d727d72

Task-number: QTBUG-32435
Change-Id: I6dbbb668b96737a5791bc688949a00bc09f1357f
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2014-11-21 16:48:44 +01:00
Tony Sarajärvi
c9c40af130 Mark QSocks5SocketEngine tests blacklisted
This patch is cherry-picked from
63ae74f365 and
07f234d2a8

Task-number: QTBUG-42528
Change-Id: I5f86679e62a4be48ce25afa5a4987a2b6678a357
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2014-11-21 16:48:20 +01:00
Thiago Macieira
bb07737614 Fix the %{time} printing to *not* default to the process's time
The default should be the actual time of day. Showing the process's time
is the optional case. In the future, we'll provide a way to showing the
monotonic reference time ("boot") and we should improve the detection of
actual application runtime.

Change-Id: I41936d77ab9fad2073dc0ce1c97cabe57ec39f16
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-11-21 16:47:35 +01:00
Frederik Gladhorn
245acbf6e8 Merge remote-tracking branch 'origin/5.4.0' into 5.4
Change-Id: I95f235a66ce2e9b1fa435c0f911c6f7e811755f0
2014-11-21 13:44:26 +01:00
David Faure
eb466b636b Fix QAction::setFont crash on OSX, when font is unknown.
customMenuFont was null, so objects was an empty array, and
NSDictionary throws an exception when being called with arrays
of different sizes.

Task-number: QTBUG-42728
Change-Id: I8cdab449fd8c1d12b65c46dd5617a7f5e3e96c6e
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2014-11-21 00:42:55 +01:00
Friedemann Kleint
6c5d1dbd75 Fix widget leak in tst_qmainwindow.
Task-number: QTBUG-38152
Change-Id: I4cf94a4a8977019dcfc099966643b5b036cc1021
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2014-11-20 22:30:28 +01:00
Friedemann Kleint
94e40c7c78 Observe QLocale::RejectGroupSeparator in QInt/DoubleValidator.
Pass it as additional boolean parameter to QLocaleData::validateChars().

Task-number: QTBUG-42522
Change-Id: I4b2367f4e2fdcbd17e343d215edad57e6687697a
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2014-11-20 16:38:23 +01:00
Alex Trotsenko
6bded1695b Fix QString::section() behavior on negative and out-of-range indexes
Change-Id: I3bff6ba73b15ee810bb11b2902d11244c3205b2a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-11-20 15:37:18 +01:00
Tony Sarajärvi
07f234d2a8 Fix how qsocks5socketengine autotests are blacklisted
Change-Id: I6436491267b737fc00c33af7bd9491510c21b7c5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-11-20 14:58:52 +01:00
Tony Sarajärvi
d29d727d72 fix how qnetworkreply autotests are blacklisted
Change-Id: Id5b0ec07504020f246e57d3ad57ffd5ce0be61ab
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-11-20 14:58:49 +01:00
Paul Olav Tvete
71ed74e72e Allow empty string as intermediate match
QRegularExpressionValidator and QRegularExpression disagree on what a
partial match means.

[ChangeLog][QtGui][QRegularExpressionValidator] Allow empty string as
intermediate match

Change-Id: Ia6c55beb54870b1be5c88b6ef3eceebc8ca3f86b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2014-11-20 14:58:39 +01:00
Giuseppe D'Angelo
bec1854cc0 QSortFilterProxyModel: keep the sorting on unrelated changes
Whenever the source model of a QSortFilterProxyModel changes, and
the changes involve the sorted column, the implementation removes
the changed rows from the mapping, sorts them, and inserts them back;
in case of identical items, the rows are inserted at the end of the
block of equal rows.

The problem is that if the change doesn't actually happen on the roles
that are used for sorting, then we shuffle the rows, terribly confusing
the user. The typical case is a model with identical checkable rows:
(un)checking one row will move it at the end.

So, instead of trying to be smart with the removal/sort/insert sorted,
simply resort everything under the changed parent index. Since the
sorting used is stable, this keeps the items in the same positions.

Task-number: QTBUG-1548
Change-Id: Id0e61bd49da53b0a3e8aefa6b6893ac41179dc6f
Reviewed-by: David Faure <david.faure@kdab.com>
2014-11-20 14:58:26 +01:00
Thiago Macieira
849604e2f9 Fix asymmetry in QVariant::cmp when A converts to B but not the opposite
This would result in (a == b) != (b == a). The == operation should be
commutative as much as possible.

Now, there's still an asymmetry in that b is forced to a type and the
conversion may fail. QVariant should have an idea of what conversions
are "promotion" and which ones are "demotion" (subject to loss of data
and/or can fail), so it can do the promotion first

Task-number: QTBUG-42254
Change-Id: I9fa4496bbbf0f8719ff8456cc24247290beac608
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-11-20 05:46:40 +01:00
Thiago Macieira
8153386397 Enhance precision of the FP conversion to strings in QVariant
This now guarantees that doing a round-trip from an FP number to string
and back to number results in the same number. This change is required
because DBL_DIG and FLT_DIG don't have the meaning that we were
expecting them to, here: they mean the minimum number of digits of
precision in decimal (i.e., changing the last decimal will always cause
the FP number to change). We need the maximum number: there is one
change in the last decimal place that causes the FP number to change.

IEEE 754 single-precision has 24 binary digits and double precision has
53 binary digits in their mantissa. To convert that to decimal, multiply
by the number of decimal digits a binary digit represents (log2(10) =
0.3), then add one for the rounding and one more digit for the actual
precision we want. That is, for floats we now ask for 9 digits and for
double, 17 decimal digits.

Task-number: QTBUG-42574
Change-Id: Ic78beb60a218f75322f832d33d63fd84e7a65b65
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-11-20 05:46:18 +01:00
Jørgen Lind
9d8f51861e Enable tst_QGraphicsView on OSX
Change-Id: If1cec2ff90ff0a4bdcfdd0e21aa5c2118ce4e862
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2014-11-19 16:13:43 +01:00
Jørgen Lind
7ca909a119 Enable tst_qfiledialog2 on OSX
Change-Id: I7147d326b0f5bb218f4dbc013ed82efb4c1e1440
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2014-11-19 16:13:25 +01:00
Paul Olav Tvete
42b4dda39c Fix rubberband position for tabbed mdi windows
Place the rubberband over the tabs instead of where the hidden
subwindows happen to be.

[ChangeLog][QtWidgets][QMdiArea] Fix rubberband position for tabbed mdi windows

Task-number: QTBUG-42612
Change-Id: I41e81ab8b99ab9e0fa533fd4ed1b2a8141d19753
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2014-11-19 10:34:39 +01:00
Paul Olav Tvete
85a4aaa5ce Fix invalid qmake syntax
Task-number: QTBUG-42549
Change-Id: I57ba3150e3a3b915faf0356d8a3f89801eb4963e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2014-11-19 10:34:24 +01:00
Friedemann Kleint
6f66205bac Add Windows-specific notation for WebDAV to QUrl.
Convert a Windows-specific WebDAV specification
"//host@SSL/path" into URL's with scheme set to
"webdavs" and back to local file (Windows only).

Task-number: QTBUG-42346
Change-Id: I12663243848ea7b2d3f208743e837e9de14a93eb
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-11-17 21:47:29 +01:00
Friedemann Kleint
2fb3941198 QPanGestureRecognizer: Make the number of touch points a parameter.
Prepare for determining the suitable number of touch points
from the device type. For now, 2 points are used as
before, which can be overridden by setting the environment
variable QT_PAN_TOUCHPOINTS. Add member variable
to QPanGesturePrivate which is set on gesture creation and later
used for comparison.

Task-number: QTBUG-40461
Change-Id: I6d9e35ca752375bc6a54435482ca0925195b8142
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-11-17 14:38:15 +01:00
Sean Harmer
c5ecabb70c Send events when platform surfaces are created/about to be destroyed
These synchronously delivered events allow applications to correctly
and conveniently handle native platform surfaces being destroyed. This
is particularly useful when doing rendering on a non-gui thread as it
allows to shutdown rendering before the native surface gets destroyed
from under us.

Task-number: QTBUG-42476
Task-number: QTBUG-42483
Change-Id: I63f41bbdb32f281d0f3b8ec2537eb2b0361f3bb3
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-11-17 10:38:22 +01:00
Olivier Goffart
78e0e72eb5 Let QMetaType know which types are Q_GADGET
This is required so we can take a QVariant and detect that it contains a
Q_GADGET and then use method like QMetaType::metaObject and QMetaProperty::write
with the QVariant::data

Change-Id: I3603692e4e84426e10bf59949e3def3ea4947bec
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-11-16 13:37:58 +01:00
Eskil Abrahamsen Blomfeldt
1ffe39dfd1 Make it possible to disable font embedding
When font embedding is explicitly disabled, fall back to painter paths
as we would if the font prohibits embedding. Note that this flag was
never respected on any platform in any version of Qt, as far as I've
been able to tell, because the handling of it in the X11 print
engine was removed shortly after it was introduced in 2005.

[ChangeLog][Printing] Disabling font embedding is now possible using
the QPrinter::setFontEmbedding() function.

Task-number: QTBUG-41943
Change-Id: Ice5e893f9893c5243310ae7892bec7497dd55c4a
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-11-15 08:49:15 +01:00
Giuseppe D'Angelo
fd05f26d80 tst_qdatawidgetmapper: stop using module-wide includes
Change-Id: Ia0e170e2185a46685cb1c130a16b8a9d379b6e02
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2014-11-14 21:01:59 +01:00
Tony Sarajärvi
c38f1f19b8 Blacklist one test function in tst_QNetworkReply
Task-number: QTBUG-32435
Change-Id: I07b1888b33daa00864e1793c1d12b1dccf562664
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-11-14 10:32:29 +01:00
Thiago Macieira
adf1b30934 Make QVersionNumber private
We're not ready.

[ChangeLog][EDITORIAL] Remove all mentions of QVersionNumber.

Change-Id: I03ad95992982eb3177f982c1eeddb6a6bc29336c
Reviewed-by: Keith Gardner <kreios4004@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-11-13 20:04:44 +01:00
Jørgen Lind
1e0516fc69 Add C++11 if available for QVariant autotest
gcc 4.9 has the __has_include feature which enables the
TEST_FORWARD_LIST and includes the forward_list header. This in turn
checks that the c++11 flags are enabled, or throws an error.

Change-Id: I44aa58e47c2f9ba6f14cb5a68d24da4a76698e5f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-11-13 15:21:07 +01:00
Tony Sarajärvi
63ae74f365 Mark QSocks5SocketEngine tests blacklisted
Task-number: QTBUG-42528
Change-Id: I3ba17b9d0f604215e6be0ec7199b12bf009c8b55
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-11-13 11:59:14 +01:00
Samuel Rødal
f79d96b486 Fixed QtGui's GL paint engine getting out of sync when using QtOpenGL
We need to reset the active_engine belonging to QOpenGLContext whenever
we make the QtOpenGL paint engine active, to give the OpenGL paint
engine in QtGui a chance to sync its state if we've used the QtOpenGL
paint engine inbetween.

Change-Id: I445ce2f99bfbacf55650c881c4fdf07f2ff85069
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-11-11 19:24:34 +01:00
Samuel Rødal
a4428d480b Fix for current_fbo getting out of sync in QtOpenGL
When using QGLWidget in combination with QOpenGLFramebufferObject from
QtGui, instead of QGLFramebufferObject from QtOpenGL, the current_fbo
variable doesn't get updated when framebuffer object bindings change.

To ensure that the QGLWidget correctly releases the currently bound
framebuffer object when using a QPainter, we keep track of whether
QOpenGLFramebufferObject has modified the current FBO binding, and if
that's the case we need to read the OpenGL state directly instead of
relying on a cached value.

Change-Id: If7e0bd936e202cad07365b5ce641ee01d2251930
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-11-11 19:24:29 +01:00
Jędrzej Nowacki
0c9d1f99da Fix moc preprocessor
When tokenizing, after macro expansion, moc needs to concatenate
subsequent string literals, because parser do not check for such
expressions.

Change-Id: Icc4f01395a5a7b67368eb8341a45ee74ade7d7f5
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-11-11 14:11:40 +01:00
David Faure
e3240214e4 tst_qitemdelegate: make the test more robust
Change-Id: Ieb05d7a05d5d8f6f652a0351deba7208d0770dd6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2014-11-11 12:32:13 +01:00
Giuseppe D'Angelo
a8723871ee QFrame: add an autotest for visual appearance
Change-Id: I97c24902c9f8dfabd9ececbae868d42ea262653b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2014-11-11 10:33:25 +01:00
Friedemann Kleint
014785d853 tst_QTimer::singleShotToFunctors: Allocate static event loop on heap.
Fix warning:
QEventLoop: Cannot be used without QApplication
and occasional crashes on Windows.

Task-number: QTBUG-26406
Change-Id: Ia8b2a4e3d375d1e43f0e66fe64a39af5f9cf4d60
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Dario Freddi <dario.freddi@ispirata.com>
2014-11-11 06:28:11 +01:00
hjk
d3f3e1218c Add a inline QVector::append(const QVector &) overload
This is present in QList already and its lack is a nuisance when
switching from QList based code to QVector (which makes sense e.g.
if the item size exceeds sizeof(void*))

Also, albeit operator+=() and operator<<() exist, some people
simply prefer functions with real function names.

[ChangeLog][QtCore][QVector] Added QVector::append(const QVector &) overload

Change-Id: I9aae8223b086765625f2f3071fab5da0780f8a43
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-11-06 11:33:52 +01:00
Tor Arne Vestbø
85a7138114 Define Q_CC_CLANG to be the version of upstream Clang that's in use
We map the Apple Clang versions to upstream, so that we have one
define to compare against.

Fixes build break on iOS due to qbasicatomic.h not defining
QT_BASIC_ATOMIC_HAS_CONSTRUCTORS on Apple Clang versions, which
is needed after 1e9db9f5e1

Change-Id: I17493c0187c20abc5d22e71944d62bfd16afbad2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-11-05 07:30:32 +01:00
Jørgen Lind
dce13e4b7b Fix too many resizes and move events for native widgets
When the QWidgetWindow receives a resize or move event, it should check
with the widget if its crect already has this geometry. if not then send
the resize or move event

Ideally events should be sent whenever the QWidgetWindow receives them.
QTBUG-42383 is created for this problem

Task-number: QTBUG-29937
Task-number: QTBUG-38768
Task-number: QTBUG-30744
Change-Id: I1e9a5d25de29a98885edece927ba14d7a763eb01
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-11-04 19:07:28 +01:00
Giuseppe D'Angelo
29c4913b02 QFrame: introduce initStyleOption (and use it)
For some reason lost in time QFrame was missing that method. Of course
that led to duplicated code and to subtle sizing miscalculations.

Task-number: QTBUG-29330
Change-Id: I81163f5def6661e01cb2ecc49c1169449a3e3758
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-11-04 15:31:09 +01:00
David Faure
7afc6d6277 QFrame: add unit test
This test shows a behavior change of setFrameStyle(QFrame::WinPanel)
between 4.4 and 4.5.
Turns out that 4.4 defaulted to "Raised" only via a side effect of the
code, while 4.5 defaults to "Plain" which makes more sense since Plain
is the default anyway. So there is no actual bug to fix (the app code
really meant QFrame::WinPanel|QFrame::Raised anyway), but the unittest
is still good to have for the future.

Done-with: David Faure
Change-Id: Icf16382504b18357256bc601b1e865abac9f2b2a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-11-04 15:31:04 +01:00
Thiago Macieira
294c914eb6 Add rvalue-ref qualified {QString,QByteArray}::{simplified,trimmed}
Of the const overloads that return a QString or a QByteArray, this is
one that gains the most benefit. It happens often in constructs like:

    QByteArray s = x.readLine().trimmed();

After this change, 41 out of 103 calls to trimmed become rvalue in Qt
and 272 out of 441 in Qt Creator. For simplified, the numbers are 27 out
of 69 in Qt and 10 out of 19 in Qt Creator.

Other candidates are left, right, and mid, but there are exactly zero
uses of left, right and mid on an xvalue QString or QByteArray in Qt.

I'm being lazy and using qstring_compat.cpp to store the QByteArray
compat methods.

Change-Id: I4e410fc1adc4c761bb07cc3d43b348a65befa9f6
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-11-02 20:51:57 +01:00
Giuseppe D'Angelo
ee17adebd2 Implement QTableWidget/QListWidget::mimeData()
For some reasons lost in history, those methods simply ignore
the list of items passed to them, and always return NULL.
Of course, that's totally broken. Fix that by doing the same thing
that the respective (hidden) models did when calling mimeData().

Surprisingly enough, QTreeWidget has a proper implementation.

Task-number: QTBUG-25900
Change-Id: I99ca7b4d4f87f096fd9ff0b0cb4e58282aa9c26e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2014-10-31 14:06:25 +01:00
Kent Hansen
0678d7c43c Add QMetaType::type(QByteArray) function
QMetaType::type(const char *) requires that the string argument is
0-terminated. This new overload makes it possible to query the type
of a string with an explicit length.

In particular, QByteArrays constructed by QByteArray::fromRawData(),
for example from a substring of a normalized method signature (the
"int" part of "mySlot(int"), can now be queried without making a copy
of the string.

Also, Qt5 meta-objects represent type names as QByteArray literals,
which can be fed directly to this new QMetaType::type() overload (no
need to call strlen).

Change-Id: I60d35aa6bdc0f77e0997f98b0e30e12fd3d5e100
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-10-31 12:17:57 +01:00
Olivier Goffart
6700fb0bf0 Use Q_DECL_RELAXED_CONSTEXPR in QFlags
Change-Id: I91073f4bb71e554402fc13cbd0e9ba5b5b95bce0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-10-31 09:54:15 +01:00
Thiago Macieira
5368e44a86 Autotest: synchronize with the peer before emitting more signals
Several of the unit tests request that the peer emit more than one
signal, but only handle one. The rest of the signals stay queued in the
socket and will be delivered at the next test, causing it to fail often.

This doesn't happen in the tests with the bus. There, we don't receive
the extraneous signals due to AddMatch/ReceiveMatch on each signal
individually and the synchronous nature of the emission (the signals
have already been emitted by the next AddMatch and cannot match it).

Task-number: QTBUG-42145
Change-Id: I743a0553074972042fca46b76db5d9e7b3209620
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-10-31 03:57:24 +01:00
Jørgen Lind
f91b81ca39 Remove executable mode on qwidget_window.pro
Change-Id: Ibb522af33e8490719010af441cce712bdc7a71bf
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-10-31 02:23:56 +01:00
Olivier Goffart
8c77a7f77a Make Q_INVOKABLE work on Q_GADGET
Methods can be invoked with QMetaMethod::invokeOnGadget

Change-Id: Id734868bb530b02587daf0f62bce01798ade2ac2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-10-30 13:29:15 +01:00
Olivier Goffart
d9e8571f4d Be able to read and write properties to Q_GADGET
Change-Id: Ic12f465d31459748ca08ac8c457fd61a5773e2e2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-10-30 13:29:10 +01:00
Allan Sandfeld Jensen
ae981f224d Add conversion between QVariantHash and QJsonObject
Adds automatic conversion from QVariants with a QVariantHash to
QJsonValue and explicit methods for conversion between QVariantHash
and QJsonObject.

[ChangeLog][QtCore][QJsonObject] Added conversion to and from QVariantHash

Change-Id: I140ef881463acabaab2648e28209487d8ad18e0d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-10-30 12:14:42 +01:00
Frederik Gladhorn
d7ca800a87 Clean up ShortcutOverride handling
Instead of sending the event from random places, send it from
QWindowSystemInterface. This allows to send override events on OS X to
menus before doing other key processing and reduces the number of
ShortcutOverride events on all platforms to exactly one per key press
event.

Additional test by Friedemann Kleint.

Task-number: QTBUG-38986
Change-Id: I6981bb776aba586ebc7c3daa5fd7a0d84c25bc3e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-10-30 11:40:18 +01:00
Marc Mutz
11e09a440b tst_qvariant: automate testing of forward_list
...using the SD-6 __has_include macro.

Change-Id: I629e2ad1c8090aba9e86ab9febf6d09a504219f9
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-10-29 09:18:21 +01:00
Lars Knoll
38c2e3d104 Properly detect UTF-8 BOM markers in ini files
If we detect a utf8 BOM mark at the beginning of the .ini
file, skip the marker and set the iniCodec to utf8.

Task-number: QTBUG-23381
Change-Id: I1b37fc4f1638a48e4f3ee71ab165e2989bc592f1
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-10-29 08:58:31 +01:00
Olivier Goffart
27d79ce91b moc: do not error if the last token of a define is #
We do not need to emit a diagnostic at definition time.
The diagnostic will be emit at expansion time.

Fix error when parsing boost header:
/usr/include/boost/fusion/container/vector/vector.hpp:25: Error: '#' is not followed by a macro parameter

Task-number: QTBUG-42233
Change-Id: I27deab362341f17ca3b0160615bb1b0934c3d5c3
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-10-28 19:37:10 +01:00
Frederik Gladhorn
50bba2fbfb Fix tst_QAccessibility::abstractScrollAreaTest for OS X 10.9
OS X now has a setting (General->Show scroll bars) to use only transient scroll bars.

Task-number: QTBUG-41340
Change-Id: Iffe30e9d601c169d955a380002743bab518f41ea
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2014-10-28 12:56:39 +01:00
Friedemann Kleint
1abcc1cd3d Hardcode UTF-8 for "unicode" in QTextCodec::codecForHtml().
ICU would return a utf-16 (endian dependent) codec for unicode
which is very rarely what people want. In most cases, unicode is
encoded in utf8 these days, so return a utf8 codec for it.

Task-number: QTBUG-41998
Change-Id: I51ee758d520702b263a8b2011787eb1f3455ed96
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-10-28 12:17:13 +01:00
Frederik Gladhorn
af3bd5037a Merge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/dev 2014-10-28 10:32:06 +01:00
Frederik Gladhorn
2eb26c1709 Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
	src/gui/text/qfontdatabase.cpp

Change-Id: I6ac1f55faa22b8e7b591386fb67f0333d0ea443d
2014-10-27 13:00:36 +01:00
Allan Sandfeld Jensen
5adbb9cc57 Support Alpha8 and Grayscale8 natively in the OpenGL paint engine
Adds special shaders for the Alpha8 and Grayscale8 formats so that
they do not need to rely on the support of GL_ALPHA and GL_LUMINANCE
that has been removed from core in recent OpenGL versions.

Change-Id: Ie370379b458abf2a50e252bc5099aefc1b11fb1d
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-10-27 11:54:39 +01:00
Rainer Keller
9157087334 Rotate images according to Exif orientation
Task-number: QTBUG-37946
Change-Id: I181f88acdff0ef76aa02e968dc6afca1ed495f38
Reviewed-by: aavit <eirik.aavitsland@digia.com>
2014-10-27 10:30:02 +01:00
Kai Koehne
5bfe794aaa Remove trailing '\n' in qFormatLogMessage output
Do not automatically add a \n to all messages formatted by
qFormatLogMessage. Some backends require a final newline,
some don't, so it's best to only append it where it's actually needed.

The returned string will be null if the pattern is empty. This allows
to differentiate between the case that the pattern just didn't apply
(empty line is printed), and the case that qSetMessagePattern(QString())
have been called (nothing is printed).

Change-Id: I17fde997a4074f58f82de6dea129948155c322d6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2014-10-27 08:59:02 +01:00
hjk
49ddae28e0 Add a test for QFilePrivate::fileName offset on Linux
This extends the test suite introduced in 497f0af1f7 for
a known-to-be-good case.

Change-Id: Ib574ecfdb8e9d91985d6df8c092896581d1d06ff
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2014-10-25 11:49:12 +02:00
hjk
e859de3fb5 Add extra declarations to make rcc output pass -Wmissing-declarations
The previously produced code was valid C++.  Add the declaration
nevertheless to help people who want to use the switch in their
own code.

Task-number: QTBUG-42119
Change-Id: Ia47cf3930684474ff65e5cf37335d7d7f57a1d31
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-10-25 11:48:43 +02:00
Samuel Nevala
3f9dbc0ec8 Android: Keyboard doesn't hide from done button
QLineEdit commits and hides QInputMethod on enter key press. When
Qt::ImhMultiLine input method hint is set, virtual keyboard is not
hidden.

Task-number: QTBUG-37850
Change-Id: I018351caa18bd2116665771e5f024a57182a01b9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2014-10-25 07:19:35 +02:00
Alexander Volkov
3903aee91b Fix doc about the list of supported codecs
Replace "Apple Roman" by "Macintosh" which is registered by IANA:
http://tools.ietf.org/html/rfc1345.
Replace unsupported "GB18030-0" by "GB18030".
Remove "JIS X 0201" and "JIS X 0208" as they are supported as parts of
other Japanese encodings but not directly.
Add "HP-ROMAN8" which is supported by both Qt and ICU.
Also clean the codecs test.

Change-Id: Iaf8e8ff1900d3f92ea0e0df75c60fe1534de23ac
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-10-24 22:23:58 +02:00
Alexander Volkov
7645b64d89 Add support for "Apple Roman" encoding
Substitute this encoding by "macintosh" when Qt is built with ICU.
It is for compatibility with Qt 4.x.

Change-Id: I70c51cba7d473ac81e25862736cb71a2f6894055
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-10-24 22:23:50 +02:00
aavit
6841dd6ecc QGraphicsScene: stabilize stacking order of toplevel items
Removing and adding toplevel items could result in invalid stacking
order (not corresponding to insertion order).

Task-number: QTBUG-19316
Change-Id: Ia8646784a2181cfa936b101e2adaf7e7e73bb83d
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2014-10-24 22:02:18 +02:00
aavit
9911550fa7 Fix rubberband selection in rotated GraphicsView
Selection rectangle was incorrectly mapped to scene space when the
view was rotated. It became a rotated rectangle instead of the correct
polygon (rhombus).

Task-number: QTBUG-42008
Change-Id: Ib7b366bec7e1f83109e03c434268ad6897138f30
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2014-10-24 21:59:47 +02:00
John Layt
74a51d590f QPrinter - Fix DuplexMode on all platforms
Add support to get/set the DuplexMode on Windows and Mac, improve the
CUPS duplex handling, ensure support is the same on all platforms.

[ChangeLog][QtPrintSupport][QPrinter] Added duplex support for Windows
and OS X.

Task-number: QTBUG-11332
Change-Id: I9d61d63233d828c3b1fd6df54072c6049f3c6298
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-10-24 21:34:21 +02:00
Pierre Rossi
929509ea03 QStyleSheetStyle: Don't interfere with QFontDialog
The sample lineedit in Qt's own font dialog shouldn't have its font
affected by stylesheets.
Not only does this hampers the ability to preview the font, it actually
overrides the font selection as that one is taken directly from the
widget.

Task-number: QTBUG-41513
Change-Id: I11d0bef8c7bf7bdae4cc08b6b9276d0fc14a75fb
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2014-10-24 16:59:26 +02:00
Jędrzej Nowacki
8c4deff51c Fix QVariant associative container conversion from built-in types.
Task-number: QTBUG-41403
Change-Id: I9dab0f9450cac11678eb6d20abd2dd08e86e0900
Reviewed-by: Stephen Kelly <steveire@gmail.com>
2014-10-24 16:27:42 +02:00
Allan Sandfeld Jensen
3fd2d9eff8 Update QSsl::SecureProtocols to not include Sslv3
After the poodle vulnerability SSLv3 should like SSLv2 no longer be
considered safe, so when a user request a safe protocol we should
only allow TLS versions.

[ChangeLog][QtNetwork][QSsl] QSsl::SecureProtocols now also excludes SSLv3

Change-Id: If825f6beb599294b028d706903b39db6b20be519
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-10-24 12:46:26 +02:00
Eskil Abrahamsen Blomfeldt
c4430ed023 Correctly update QComboBox appearance on editable change
The updateDelegate() function checks isEditable() which in
turn checks if d->lineEdit != 0, so we need to make the
call after the lineEdit has actually been set/unset, otherwise
the change to the delegate will not come until the next time
you update the delegate.

[ChangeLog][QComboBox] Fixed updating appearance of popup menu
when changing the editable state of the combo box.

Change-Id: Ib32f36cabd53c2c30d6256484a1eae131419960a
Task-number: QTBUG-33537
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2014-10-24 08:51:18 +02:00
Paul Olav Tvete
2bfee10f3a QMainWindow: respect the maximum size of the central widget
Make sure the dock widgets get the available space when the
central widget cannot expand any more.

[ChangeLog][QtWidgets][QMainWindow] Dock widgets will now be resized
properly when the central widget has a fixed size.

Task-number: QTBUG-40410
Change-Id: Id06c07b79aa3102aa41212fa2c621f5fa426fe02
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2014-10-24 07:54:36 +02:00
hjk
497f0af1f7 Add some tools specific consistency tests
This upstreams parts of Qt Creator's tst_offset test to serve as
an early warning system by testing private implementation details
that are used in Qt Creator's data structure "pretty printing"
facility.

While the tested implementation details can be changed without
breaking binary or source compatibility, downstream tools like
Qt Creator depend on them.

If this test breaks, you are kindly asked to coordinate with the
downstream stakeholders to avoid tool breakage.

Change-Id: I1286efcec9bef105f80c2163a4f66f5c43f3a218
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2014-10-24 07:18:44 +02:00
Friedemann Kleint
88057e3407 QSwipeGestureRecognizer: Fix gesture cancel on direction change.
Task-number: QTBUG-12736
Change-Id: I6d8d09843b45df17cb9158070f63b3397c5b4c07
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2014-10-23 21:14:23 +02:00
Friedemann Kleint
68d83e82f8 Add autotest for QGestureRecognizer.
Task-number: QTBUG-12736
Task-number: QTBUG-15768
Task-number: QTBUG-40461
Change-Id: Ib6dfaa9336f615e17d41444f7aa686cb93d04fca
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2014-10-23 21:11:28 +02:00
Jan Arve Saether
bf200fc948 Adjust the layout if a QGraphicsWidget is explicitly hidden
Since layout items can now be hidden, this also makes sure we respect
the QSizePolicy::retainSizeWhenHidden

Task-number: QTBUG-20132
Change-Id: Iab59fc9b61d4ca1bb2208c479a027da6eb0283a9
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-10-23 07:17:50 +02:00
Friedemann Kleint
ed0245e145 Fix QWidget::mapTo/FromGlobal() when embedded in QGraphicsView.
Map the positions via QGraphicsScene and the first QGraphicsView
(as is done in existing code). Fall back to the previous code
path when no QGraphicsView exists, which is hit in the tests.

Change-Id: I0754765d05cded6bc1b64045f2513fef8afde337
Task-number: QTBUG-41135
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2014-10-23 06:33:10 +02:00
Morten Johan Sørvig
047f4c4d79 Further limit the sparse file testing on OS X
At 4GiB the CI test system still spends a considerable
amount of time testing this. Tune the size down to
16 MiB.

Change-Id: I417aa6829fcc734e5de4d7d34e503190f6b291e5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-10-22 23:00:41 +02:00
Jeongmin Kim
1ff6c575ce QNetworkDiskCache: Fix QNetworkDiskCache don't handle to set CookieHeader.
QNetworkDiskCache don't handle to set CookieHeader. so All Set-Cookie's value is invalid.
The root of cause is that metaDataChanged() don't work because of no slot for it.
Add the slot for it and renamed to _q_metaDataChanged.

Task-number: QTBUG-41514
Change-Id: I5cec017e59a1de69c6e89c0bc7209a73dcdc11da
Reviewed-by: Jeongmin Kim <jm86.kim@lge.com>
Reviewed-by: Jung Dong-Heon <clamp03@gmail.com>
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-10-22 09:20:10 +02:00
Lars Knoll
bd4a19963e Respect contents margins when calculating the size hint
Without this part of the calendar widget get cut off when put
in a layout and the contentsMargins are non zero.

Task-number: QTBUG-40352
Change-Id: I9ce90476c59c270d92e876a5dc81ea8ce325848c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2014-10-22 07:23:37 +02:00
Friedemann Kleint
ab556d6b32 Fix height of combo popup when the list view has non-zero spacing.
QListView::spacing() is the space around the item (layout margin),
so the effective spacing is twice as big.
This differs conceptionally from QTableView, which has a spacing of 1
and a line on top/bottom. Split up QComboBoxPrivateContainer::spacing()
into functions return spacing and top/bottom margins to reflect this.

Task-number: QTBUG-37865
Change-Id: I1ff812e7856e00a53f1119ef3304956cbb7cbfca
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2014-10-22 06:21:54 +02:00
Friedemann Kleint
6c7a348cf8 Set correct transient parent in q_createNativeChildrenAndSetParent().
Fix warning:
void QWindow::setTransientParent(QWindow*) ... must be a top level window.
which occurred for example when parenting a QMenu onto a native child
widget.

Task-number: QTBUG-41898
Change-Id: Icc25fb2108bd68b2d9c0e551949b90fc7a82d358
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-10-21 06:30:15 +02:00
Lorn Potter
151061ad4a update QtBearer NetworkManager backend API
Task-number: QTBUG-41747

Change-Id: Idb4afea0215b94957a11895c7db97a72ae680804
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2014-10-21 01:01:06 +02:00
Frederik Gladhorn
3361fcbc28 Merge remote-tracking branch 'origin/5.4' into dev
Change-Id: If7e51514ed6832750e3ad967e4d322ccf920d2bb
2014-10-20 19:12:25 +02:00
Tor Arne Vestbø
ae89aa330f logging: Fix qCleanupFuncinfo to not mangle Objective-C message names
Change-Id: I823566ba72668c611d225aa92c4d09a53cabe8fc
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-10-20 13:34:37 +02:00
Jørgen Lind
c231694949 Fix QOpenGLWindow tests when devicePixelRatio != 1
Change-Id: I83d71de8b9d735cd649a6c514e41a9ff23625005
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-10-20 10:11:25 +02:00
Marc Mutz
bcda685be9 tst_QPointer: fix memleak
Benign, but easy to avoid by using automatic storage.

Change-Id: I60a1a2e85d8c1b2d91f3f33973374afae8876340
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-10-19 13:18:23 +02:00
Marc Mutz
665966d243 tst_QState: fix memleaks
Benign, but easy to avoid by allocating objects on the stack.

Change-Id: I1933d0abb2ebd53bcf0402f392e7e3c201756b9e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-10-19 13:18:12 +02:00
Marc Mutz
0ebd05686d tst_QThreadPool: fix memleak
Benign, but easy to avoid by using the same pattern as in clear().

Change-Id: Ie382313343385f0709519b232a7d58dd8181b8de
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-10-19 13:18:07 +02:00
Marc Mutz
4cf9168630 tst_QSharedPointer: fix memleak
Benign, but easy to avoid by using automatic storage.

Change-Id: I4eefce9a7c902ceadebdd0aba1bbba7e5519cf24
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-10-19 13:18:02 +02:00
Marc Mutz
d78bbf8c81 tst_QMetaType: fix memleaks
Benign, but easy to avoid by distinguishing between
owning and non-owning smart pointers.

Change-Id: Idcd7ae550a8e4e00dfcd5570790e2ed985e2379a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-10-19 13:17:53 +02:00
Marc Mutz
14ea26f708 tst_QMimeData: test doesn't require QGuiApplication
Makes the test execute faster (not that it's slow in any way)
and more importantly gets rid of the QGuiApplication-induced
3rd-party library leaks reported by asan and/or valgrind.

Change-Id: I94b505f15b4db577a2807b0b81464e19ce7e7cab
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-10-19 13:17:46 +02:00
Marc Mutz
32dfbd6dbf Add qHash(QSslError) overload
qsslsocket_winrt.cpp defined it locally, which runs the risk of
clashes with a potential user-defined qHash(QSslError), so
make it public.

Also included both .error() and .certificate() in the hash, as
both of these are used to determine equality (the WinRT version
only used .error()).

[ChangeLog][QtNetwork][QSslError] Can now be used in QSet/QHash.

Change-Id: Ieb7995bed491ff011d4be9dad544248b56fd4f73
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-10-19 07:32:41 +02:00
Marc Mutz
e8bdc949fc Add qHash(QSslCertificate) overload
qsslsocket_winrt.cpp defined it locally, which runs the risk of
clashes with a potential user-defined qHash(QSslCertificate), so
make it public.

Also, the implementation in qsslsocket_winrt.cpp simply hashed
the handle(), which violates the principle that equal instances
must hash to the same value. Also, for some platforms, the
implementation returns nullptr unconditionally, which, while not
violating the above-mentioned principle, will make all users of
the hash have worst-case complexity.

To calculate a meaningful hash, therefore, the certificate needs
to be inspected deeper than just the handle.

For OpenSSL, we use X509::sha1_hash, which also X509_cmp uses
internally to determine inequality (it checks more stuff, but
if X059::sha1_hash is different, X509_cmp() returns non-zero,
which is sufficient for the purposes of qHash()). sha1_hash may
not be up-to-date, though, so we call X509_cmp to make it valid.
Ugh.

For WinRT/Qt, we use the DER encoding, as that is the native
storage format used in QSslCertificate. This is not equivalent
to the implementation used in qsslsocket_winrt.cpp before, but
since handle() == handle() => toDer() == toDer(), it should not
be a problem.

[ChangeLog][QtNetwork][QSslCertificate] Can now be used as a key in QSet/QHash.

Change-Id: I10858fe648c70fc9535af6913dd3b7f3b2cf0eba
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-10-19 07:32:37 +02:00
Gabriel de Dietrich
59ebcdc540 Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4 2014-10-18 13:24:33 +02:00
Marc Mutz
239b71d07d Fix use-after-delete bug in tst_QWidget::taskQTBUG_27643_enterEvents()
ASAN report:

  READ of size 8 at 0x606000011990 thread T0
    #0 0x505e3b in EnterTestMainDialog::eventFilter(QObject*, QEvent*) tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp:10294
    [...]

  0x606000011990 is located 48 bytes inside of 56-byte region [0x606000011960,0x606000011998)
  freed by thread T0 here:
    #0 0x2b8df3551c79 in operator delete(void*) ../../../../gcc/libsanitizer/asan/asan_new_delete.cc:92
    #1 0x418ab5 in EnterTestMainDialog::buttonPressed() tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp:10276

  previously allocated by thread T0 here:
    #0 0x2b8df3551739 in operator new(unsigned long) ../../../../gcc/libsanitizer/asan/asan_new_delete.cc:60
    #1 0x4188cf in EnterTestMainDialog::buttonPressed() tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp:10272

EnterTestMainDialog::eventFilter() checks for nullness of 'modal'
before accessing it, but buttonPressed() did not reset 'modal'
to nullptr after deletion.

Change-Id: I65562a29f8264a6996d7d615e06de1d1afb5af53
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-10-18 00:33:03 +02:00
Friedemann Kleint
0368b24a7f QSettings: Prevent assert when passing empty keys.
[ChangeLog][Important behavior changes][QSettings]
QSettings::value() now returns an invalid QVariant
when passing an empty key. The code path ran into
an assert, which was only noticeable in debug
builds.

Task-number: QTBUG-41812
Change-Id: I5cc32be3aa267a132e9d6639ecd6cb0bbafc15b0
Reviewed-by: Stéphane Fabry, Cutesoft <stephane.fabry@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-10-17 14:55:45 +02:00
Frederik Gladhorn
b55a688b61 Merge remote-tracking branch 'origin/5.3' into 5.4
Change-Id: Ic01820f2390e419a5b286643e7351e85ae032473
2014-10-14 13:54:50 +02:00
Eskil Abrahamsen Blomfeldt
4bf0660ae4 Make QStringRef::right() consistent with QString::right()
The implementation was inconsistent with QString::right(),
and did not return the N rightmost characters but actually did
the same as QString::mid(N) (returning the rightmost size - N
characters.)

Since this function is fairly recent (Qt 5.2), is documented to
behave the same as QString::right(), and since these APIs are
meant to be interchangeable, this needs to be fixed, even though
it changes behavior.

[ChangeLog][Important Behavior Changes] Changed QStringRef::right()
to be consistent with QString::right(). The function now returns
the N right-most characters, like the documentation already claimed.

Change-Id: I2d1cd6d958dfa9354aa09f16bd27b1ed209c2d11
Task-number: QTBUG-41858
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-10-14 11:32:55 +02:00
Maximilian Hrabowski
4cbb99c5e2 QAbstractItemView: fix CTRL+A select all behavior
The check for Qt::Key_A to handle selectAll was changed to directly
compare to QKeySequence::SelectAll as this will only match Ctrl. The
former implementation also triggered when e.g. Shift was pressed.
Added a check that selectAll is only called when selection is not
disabled, i.e. selectionMode=NoSelection.

Added a unit test for selectAll().

Task-number: QTBUG-26687
Change-Id: I721e7ab590b55d7d754b3b74ef01756fa5aa1315
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-10-13 13:53:28 +02:00
Eskil Abrahamsen Blomfeldt
74a20b77a6 Fix memory leak in QClipboard::setMimeData()
The setMimeData() function is documented to take ownership of
the object passed in, but in the case where the platform
plugin did not support the requested mode, we would simply
return without deleting the object nor telling the application,
so it would cause a potential memory leak. We need to honor the
contract, even when we fail to set the mime data.

Test was updated to avoid verifying the leak in cases where
the platform does not support all modes.

[ChangeLog][QtGui][Clipboard] Fixed a memory leak in setMimeData()
when the platform plugin did not support the requested mode.

Task-number: QTBUG-41852
Change-Id: I2112da1613199fe1b56724e7ccf097b9e912c117
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-10-10 13:37:59 +02:00
Tomasz Olszak
8ddaf5c741 Gcc 4.5.* build fix.
Q_COMPILER_DEFAULT_MEMBERS and Q_COMPILER_DELETE_MEMBERS are now set
starting from gcc 4.6. Pre-4.6 compilers implement a non-final snapshot
of N2346, hence default and delete functions are supported only if they
are public. Starting from 4.6, GCC handles final version - the access
modifier is not relevant. Compiler error:

  qsharedpointer_impl.h:717:31: error:
  'QEnableSharedFromThis<T>::QEnableSharedFromThis()' declared with non-public access cannot be defaulted in the class body

Change-Id: If1d3d4696f91912a09ca72bd4aa1fb07f491a0cb
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-10-10 13:20:30 +02:00
Friedemann Kleint
bf73ab490d Disable tst_qhostinfo on OS X.
Task-number: QTBUG-41847
Change-Id: Idfb4058a50a0baecce1b3e430629ec6b2867550b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-10-10 13:15:43 +02:00
Frederik Gladhorn
881ceeff42 Merge remote-tracking branch 'origin/5.4' into dev
Change-Id: I05fcd8dc66d9ad0dc76bb7f5bae05c9876bfba14
2014-10-09 17:56:52 +02:00
Alessandro Portale
106487387d Removing a few unneeded "? true : false"
Change-Id: Ib13f0ddd65fe78f5559f343f2fc30756b1d3ef76
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-10-09 09:43:26 +02:00
Marian Beermann
264fcd4eef Fix QDomDocument::importNode() crashing on null nodes
Task-number: QTBUG-12927
Change-Id: I597a149bb273fa132fdb34e3678ebc3069d6f516
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-10-07 23:08:18 +02:00
Jake Petroules
1cc079c29b Add Objective-C specific type converters to QDateTime
This patch adds the Objective-C NSDate/CDateRef converters to
QDateTime

[ChangeLog][QtCore][Objective-C] Added NSDate/CDateRef converters for
QDateTime

Task-number: QTBUG-37116
Change-Id: I937ea927083a2767b5b17f10a48bf453c9ff8b01
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-10-07 18:54:21 +02:00
Oswald Buddenhagen
f49d5b578c Merge remote-tracking branch 'origin/5.3' into 5.4
Change-Id: I132bb6cce68e9f8413200f7ee75586bd1cada38c
2014-10-06 11:59:47 +02:00
Peter Hartmann
0473d2bd34 QNetworkRequest: Add new enum to emit all uploadProgress signals
... so that a user can have more fine-grained uploadProgress signal
emissions if desired.

Change-Id: I9f77fd80c100dbe249beaf3057e6e8974680ec59
Reviewed-by: Markus Goetz <markus@woboq.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-10-04 14:41:55 +02:00
Friedemann Kleint
39b32f0874 Stabilize tst_qwizard.
- Ensure top level widgets are cleaned up.
- Place wizards beside each other for comparison.
- Use classic style on Windows to avoid interference by Vista style.

Change-Id: I223a40ea14eefe65dc2e9e8ddee44b0f0c806e3d
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
2014-10-03 19:07:22 +02:00
Friedemann Kleint
839ceb00b0 tst_QFiledialog::completer(): Avoid directories starting with 'c'.
Apparently, this causes problems with the completer due
to the fact that it matches the root drive "C:\" on Windows.

Task-number: QTBUG-41681
Change-Id: Iaf96675067e22e679371139a1a2fbf011a5edbdc
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
2014-10-03 19:01:43 +02:00
Paul Olav Tvete
c171a21ae4 Enable the qmdiarea test on X11
Task-number: QTBUG-25298
Change-Id: Iec7591e9e84951a1aea47590aaedaac877cd111e
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-10-03 12:27:16 +02:00
Friedemann Kleint
54814bbd8f Refactor tst_QFiledialog::completer().
- Streamline code and remove code that has no effect.
- Create temporary directory and files only when it is actually
  required (empty start path).
- Remove try/catch as it is not commonly used in Qt autotests.
  Its original purpose was apparently to ensure temporary file
  cleanup, but that should now work since smart pointers are used
  for temporary files and directories.
- Introduce variable for case sensitivity.

Task-number: QTBUG-41681
Change-Id: Ie5f621c30fc461b880292b853e0660b8fba316eb
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-10-03 09:03:04 +02:00
Gabriel de Dietrich
8ee9774e67 Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4 2014-10-01 16:21:12 +02:00
Kai Koehne
d78fb442d7 Logging: Disable tracking of debug source info for release builds
Tracking the file, line, function means the information has to be stored
in the binaries, enlarging the size. It also might be a surprise to some
commercial customers that their internal file & function names are
'leaked'. Therefore we enable it for debug builds only.

[ChangeLog][QtCore][Logging] File, line, function information are not
recorded anymore for logging statements in release builds. Set
QT_MESSAGELOGCONTEXT explicitly to enable recording in all configurations.

Change-Id: I454bdb42bcf5b5a8de6507f29f2a61109dca9b91
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2014-10-01 16:06:27 +02:00
Allan Sandfeld Jensen
0175ad4d3f Fix regression in metric calculation of text with mnemonics
Even when we do not intend to display the text, we still need to go
through the processing of mnemonics to remove them from the text.

Instead of capping the max underlines to 0, the TextDontPrint option now
just saves adding the underline formats.

Task-number: QTBUG-41593
Change-Id: I67790650dbed0092de2c63e5d5a9349dc02d5846
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Robert Loehning <robert.loehning@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-10-01 15:30:43 +02:00
Friedemann Kleint
289b4ed705 QMdiArea: Fix positioning of cascaded sub windows.
Take PM_FocusFrameVMargin into account.

Task-number: QTBUG-35146
Change-Id: I1499790537ddf9fbb912ab764b7d049ee11af95d
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2014-09-30 10:32:52 +02:00
Eskil Abrahamsen Blomfeldt
27bc4c4ce5 QPlainTextEdit: Fix crash on complex undo w/full width selection
Say you have a document of two blocks of text.

When you select a block of text in the document and then replace this
with a new empty block (by pressing enter) and then subsequently
undo this action, the following three steps are performed as a
chain of undo commands:

1. Remove the empty block at the beginning of the document
2. Insert a new empty block at the beginning of the document
3. Insert the text back into the first block

Since a block is removed and inserted in the same go, both blocks
require a relayout, since the accumulated change spans both blocks.
However, in QPlainTextDocumentLayout we would only look at the max
of either removed chars or added chars. This would match the text
length of the first block at this point, so we would only relayout
that block. However, since we are also removing characters, the
actual accumulated change to the document is larger. We should
relayout any block touched by the sum of the added and removed
character counts.

Missing this, the paint event would later query
block.layout()->lineForTextPosition(0) which would give an invalid
line despite the fact that the block.length() > 0. This caused
a crash in the paint event when the full width selection was
turned on.

Note that the logic here was only recently updated to include the
removed characters at all in the logic, by the SHA1:
2983cb9531.

[ChangeLog][QPlainTextEdit] Fixed a crash when using full width
selections and issuing a complex undo command chain which removes
and inserts an empty block in one go.

Task-number: QTBUG-36415
Change-Id: Iafe8a69e455e0c713a48714f10f0cace69c84f51
Reviewed-by: Axel Rasmussen <axel.rasmussen1@gmail.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-09-30 10:21:39 +02:00
Oswald Buddenhagen
189dc655bb Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
	src/corelib/tools/qbytearray.cpp
	src/gui/image/qimage.cpp
	src/gui/image/qppmhandler.cpp
	src/gui/kernel/qguiapplication.cpp
	src/gui/painting/qpaintengine_raster.cpp

Change-Id: I7c1a8e7ebdfd7f7ae767fdb932823498a7660765
2014-09-29 14:08:49 +02:00
Gabriel de Dietrich
8ab25620d3 Merge remote-tracking branch 'origin/5.3' into 5.4
Conflicts:
	src/network/socket/qnativesocketengine_unix.cpp
	src/widgets/kernel/qwidget_qpa.cpp

Change-Id: I6f1aa320d5ca66cd92d601a95885aeaab0abb191
2014-09-29 13:38:11 +02:00
Thiago Macieira
0c32af08a6 Fix handling of IPv6 addresses in QUrl::fromUserInput
IPv6 addresses can start with ":", for which QDir::isAbsolute() would
always return true (QResourceFileEngine::isRelativePath() returns
constant false) and would trip the calculation for local files.

Similarly, IPv6 addresses can start with strings that look like Windows
drives: "a:", "b:", "c:", "d:", "e:" and "f:" (though not today, as
those address blocks are unassigned). Since a valid IPv6 address will
definitely require at least one more colon and Windows file names cannot
contain ':', there's no ambiguity: a valid IPv6 address is never a valid
file on Windows.

This resolves the ambiguity in favor of IPv6 for Unix filenames (which
can contain a colon) and in case of an URL containing scheme, relative
path and no authority ("dead:beef::" for example could have been parsed
as scheme() == "dead" and path() == "beef::").

Task-number: QTBUG-41089
Change-Id: Id9119af1acf8a75a786519af3b48b4ca3dbf3719
Reviewed-by: David Faure <david.faure@kdab.com>
2014-09-28 01:28:29 +02:00
Marc Mutz
55fbf1db19 Widgets: remove references to QStyleOptionFrameV<n>
They're gone since Qt 5.0 and only exist as typedefs for QStyleOptionFrame.

Change-Id: Icff45cbd3a47db8618a7f7a80f7252651969237c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-26 00:39:48 +02:00
Marc Mutz
10e5bcf9d0 tst_QSslError: cleanup unused functions
Change-Id: I4db7399e533805e1dddaa76d5a609d2006a97da6
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2014-09-26 00:39:37 +02:00
Markus Goetz
097b641c3e QNAM: Fix previous HTTP upload CPU fix
My previous fix for CPU load issues between HTTP thread
and user thread  was fragile if the upload QIODevice
emitted readyRead() multiple times.

[ChangeLog][QtNetwork][QNetworkAccessManager] Fix behavior of upload QIODevice
that generate data on readyRead() for HTTP PUT/POST

Change-Id: Idb1c2d5a382a704d8cc08fe03c55c883bfc95aa7
Reviewed-by: Christian Kamm <kamm@incasoftware.de>
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-09-25 17:10:54 +02:00
Oliver Wolff
eedefa28bd Refactored qt_normalizePathSegments
There were several use cases that did not work with the old
implementation and it was not really readable.

Task-number: QTBUG-3472
Task-number: QTBUG-40067
Task-number: QTBUG-23892
Change-Id: I1e038792dc54cdc6f8d9bb59d80b11dd3c56fac6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-09-25 16:16:59 +02:00
Kai Koehne
568c26227d Silence moc warnings about 'argument mismatch'
The moc preprocessor is not necessarily fully compatible with the native
compiler preprocessor, which can lead to annoying warnings.

This fixes a problem particularly with the boost headers that rely on
MSVC only preprocessor features (to work around other MSVC preprocessor
deficiencies).

Task-number: QTBUG-29331
Change-Id: If884452969b512a746c81e235d31636b39c45b27
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-09-25 15:42:40 +02:00
Friedemann Kleint
4b03b18548 Generate Show/Hide events for widgets when minimized state changes.
Fixes a regression against Qt 4, where Show/Hide events were received
when the minimized state changed.

It is restricted to QWidget so as not to introduce additional events
to QWindow (which already has signal visibilityChanged()) and cause
unexpected side effects in QQuickWindow.

Task-number: QTBUG-41312
Change-Id: Ib165a5daf7a7e5d8231ef8a94b70e8a2a3253057
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-24 23:07:15 +02:00
Matt Broadstone
f84b00c6d2 Expose QSqlDriverPrivate dbmsType in public QSqlDriver api
dbmsType was previously kept as a private variable in QSqlDriverPrivate,
however it's particularly useful for QODBC users.

[ChangeLog][QtSql][QSqlDriver] Add support for determining DBMS type from SQL driver.

Change-Id: If1c221520da9ac4ccef85a02db078679d76eac92
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2014-09-24 14:44:49 +02:00
Matti Paaso
974c210835 Update license headers and add new license files
- Renamed LICENSE.LGPL to LICENSE.LGPLv21
- Added LICENSE.LGPLv3
- Removed LICENSE.GPL

Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
2014-09-24 12:26:19 +02:00
Eike Ziller
3ea0020d3b Abstract proxy model: Add missing delegation of supportedDragActions
Change-Id: I4d2519aaa46d3ca075330c6680dd3672249cbefe
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-09-24 10:37:59 +02:00
Frederik Gladhorn
c96426f19f Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4 2014-09-24 12:04:52 +02:00
Marc Mutz
1ce6e432b6 QVersionNumber: correctly fail for numerically very large segments
The result of qstrtoull() was unconditionally truncated to an int,
resulting in wrong values being appended to the segments vector
when the numerical segment value was above INT_MAX.

Prevent this by first checking the return value of qstrtoull
as a qulonglong for values larger than INT_MAX and stopping
processing in that case. That means that segments that
numerically overflow an int are now considered part of the
suffix.

Also added tests for the case where a segment value is larger
than ULLONG_MAX. That was already working correctly.

Change-Id: Ia4b89021dcfe6bfae27c8d89bb678ec5e0e3b847
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-23 20:42:01 +02:00
Thiago Macieira
d554fa6fdc Add unit tests for cleaning up nested functions
I think supporting them now is too complex for the Qt code. We would
probably need to rewrite the parser using a tokenizer so we can find the
right name of the function. Just skipping backwards breaks the support
for returning function pointers and PMFs.

Change-Id: I78636437ecd46d77e6b9b013b2f2668cca1b6cd6
Reviewed-by: David Faure <david.faure@kdab.com>
2014-09-23 17:44:22 +02:00
Friedemann Kleint
a1a678078e Fix MSVC source code encoding warnings in tst_qtjson.
tst_qtjson.cpp(2711) : warning C4566: character represented by universal-character-name '\u2090' cannot be represented in the current code page (1252)
tst_qtjson.cpp(2712) : warning C4566: character represented by universal-character-name '\u2090' cannot be represented in the current code page (1252)
tst_qtjson.cpp(2713) : warning C4566: character represented by universal-character-name '\u2090' cannot be represented in the current code page (1252)

Task-number: QTBUG-41100
Change-Id: I193dc48236bdd3857657a5684178630f0e1dab6d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-09-23 17:04:15 +02:00
Alex Trotsenko
48a4a67e8d Fix QAbstractSocket::readData() behavior on buffered socket
Remove an useless check which spontaneously allow direct reads from the
socket engine.

Change-Id: Ia3d2a572d6f1563d613fe2f00d0d6849df259827
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-23 16:55:42 +02:00