Commit Graph

21599 Commits

Author SHA1 Message Date
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
Laszlo Agocs
13ec068ce2 Compile in evdev code to linuxfb
Make it compatible with eglfs. The behavior is the same: By default
mouse, keyboard and touch will all be initialized and, when having
libudev support, discovered automatically. The environment variables
QT_QPA_FB_DISABLE_INPUT and QT_QPA_FB_TSLIB can be used to used to
disable the built-in input handlers and to force tslib instead of
evdev, respectively.

This allows embedded systems and applications to easily fall back
from eglfs to linuxfb on devices that are not rendering via OpenGL.

Dynamic hiding/showing of the mouse cursor is to be done separately,
here we provide the necessary device discovery hooks only.

[ChangeLog][QtGui] The linuxfb platform plugin's input device handling
is now compatible with eglfs. The evdev keyboard, mouse and touch code
is compiled in by default.

Change-Id: I44bc661c53ae78c39b0f30486a475b4e639ab2d6
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@theqtcompany.com>
Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
2015-01-05 15:55:02 +01:00
Giuseppe D'Angelo
8a4099a0aa QIsciiCodec: add an assert to silence Coverity
Coverity (not rightfully) complains that the code is using "iscii",
a uchar obtained by looking up into a table, as an index into the
"uni_to_iscii_pairs" array. Since the array is only 18 elements
long, there's the theoretic risk of accessing it past its end.

However, the lookup of "iscii" never returns values that may
actually go out of bounds. Coverity may be smart enough
to see the values that "iscii" can get and not raise the warning,
but since it does, make the code more robust and add an assert.

Task-number: QTBUG-43642
Change-Id: Id75ca105758b343102ca94137d0379c10e55581a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2015-01-05 15:51:01 +01:00
Giuseppe D'Angelo
bc7243d583 QColorDialog: fix a crash on small displays
On a small display leftLay is left initialized to a null pointer,
therefore don't try to dereference it.

Task-number: QTBUG-43643
Change-Id: I9d22dac88a3a853ce154a6f64b35fc113abd9262
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-01-05 15:50:55 +01:00
Richard J. Moore
73fcae8716 Add missing qdatastream.h includes.
Change-Id: I726041ec5e92d371bc5afb9b7f8cb854bfd41451
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-05 13:13:09 +01:00
Marc Mutz
1049b36fc2 QFlags: plaster API with Q_DECL_NOTHROW
Yes, this is necessary. The noexcept operator looks for noexcept tagging,
not at the contents of the function to determine whether to return true.

The more conditionally-noexcept functions are used, the more important it
becomes that low-level classes are correctly marked noexcept. In that, it
is like constexpr.

Change-Id: Ia1aebf9b8d73fd8164c10dfca27a710934ba79a8
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2015-01-05 13:05:00 +01:00
Marc Mutz
6ac7e2f710 QCursor: add move ctor
QCursor already dealt with d == nullptr, so this is trivial.

Change-Id: Ib2c6a3f0dc8b93035ffe3059cdce925463706e10
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2015-01-05 13:03:20 +01:00
Milian Wolff
cd82be5c17 Use QStringLiteral to prevent runtime string conversions.
Change-Id: I0b2f06f9f09868051e84af80b2c61b5ada99af69
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2015-01-05 13:02:58 +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
Giuseppe D'Angelo
aeceb5e383 QColorDialog: merge two consecutive ifs with the same test
Change-Id: I931bf8f61f95c879522daabf4fc9d6f5801a307b
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-01-05 11:02:08 +01:00
Andy Shaw
f444b25ac1 Add a platform function to enable setting the touch flags on Windows
This makes it possible for the flags that RegisterTouchWindow takes to be
specified after the window has been created.

Task-number: QTBUG-41433
Change-Id: I166143875ef54ab6a249cffb31d017845a694a01
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2015-01-05 07:49:15 +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
c61f8df404 QtTest: call toString() as a normal function
toString() is both a function template and a set of overloaded
functions (for const char* and const void*). So don't explicitly
specify the function template arguments (they're deduced from the
arguments anyway). This enables overloading toString() as well as
specializing the template.

[ChangeLog][QtTest][Important Behavior Changes] toString() can now be
overloaded (instead of just specialized) for custom types, and is now
reliably found through argument-dependent lookup (ADL).

Change-Id: Ic4a622d236ad7f0e4142835353f1b98bf2dc6d4c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-04 09:43:04 +01:00
ala
876c2164f4 Document -plugins argument in qmltest usage help
Change-Id: Ia624fcefe77a456424bcaa00b106ef7f69abb6b9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2015-01-03 22:24:32 +01:00
Thiago Macieira
cd407e1bc6 Fix undefined behavior found by GCC 5
GCC said:
qtldurl.cpp:51:50: error: loop exit may only be reached after undefined behavior [-Werror=aggressive-loop-optimizations]
qtldurl.cpp:51:48: note: possible undefined statement is here
     while (tldIndices[index] >= tldChunks[chunk] && chunk < tldChunkCount) {
                                                ^

That's because we check whether chunk is still valid (less than
tldChunkCount) after we've dereferenced tldChunks[chunk]. That is, we've
already read tldChunk[2].

Change-Id: I79b6a1ea9a2454813d6cce7596fc2bb6d972d097
Reviewed-by: David Faure <david.faure@kdab.com>
2015-01-02 14:58:10 +01:00
Simon Hausmann
26b0ff7bad Remove unnecessary dependency
Platformsupport doesn't need network in order to compile and link.

Change-Id: Ifda2db9c39d89619ff21cbcd21dc5bf97fe58f55
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2015-01-02 13:19:08 +01:00
Martin Smith
cb3f520047 qdoc: Update qdoc manual
This update explains how to use the optional 'square bracket' argument
for the link command (\l), the new single execution mode for qdoc, and
how to generate and use the QA pages.

Change-Id: I7232e05677c6ea97636cdb4fb20bd9708c83f311
Task-number: QTBUG-35495
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-01-02 10:55:46 +01:00
Rafael Roquetto
8951b628fa QNX: Fix build.
Commit 99357e32a0 introduces a change that
causes <cstddef> to be included instead of <stddef.h> under QNX. That causes
symbols such as size_t to be placed on the std namespace only - QNX does not
put those in the global namespace, since it is not really required by the
standard, and therefore the build fails.

Merry Xmas!

Change-Id: I70c6976203a9d7beadd0076e122e2ac633a4ba69
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-12-31 18:21:51 +01:00
Pino Toscano
ca59365656 Enable ELF .interp section on Hurd
The toolchain is basically the same as on Linux, so we can get the
program interpreter and print the build information when Qt5Core.so
is run.

Change-Id: I02a910e691622e24e882015716c5f74dd5a20c4a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-12-30 20:22:08 +01:00
Pino Toscano
7ec14ae0b2 Complete MIPS atomic support on pre-MIPS32 architectures
Extend the support for pre-MIPS32 architectures (done mostly in
60b6b28c21) also to orderedMemoryFence.

Change-Id: I50b9091c16166b8434a07988053c1f901d528237
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-12-30 20:21:56 +01:00
Robin Burchell
442eee3cda QStack: Add a simple benchmark.
This covers the only real additions over QVector: push and pop. Really, there
isn't too much specific to benchmark here, but we're interested in one specific
case: that of pushing and popping a single item repeatedly.

With the current QVector behavior, this causes constant deallocation, which
makes it morbidly slow. This behavior will be reviewed in a subsequent commit.

Results (not that anyone really cares) for me:
    PASS   : tst_QStack::qstack_push()
    RESULT : tst_QStack::qstack_push():
         1.9 msecs per iteration (total: 61, iterations: 32)
    PASS   : tst_QStack::qstack_pop()
    RESULT : tst_QStack::qstack_pop():
         8.2 msecs per iteration (total: 66, iterations: 8)
    PASS   : tst_QStack::qstack_pushpopone()
    RESULT : tst_QStack::qstack_pushpopone():
         80 msecs per iteration (total: 80, iterations: 1)

Change-Id: I3530888abbfcfcef39318d6be6d5b07306a4704e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-12-30 19:25:58 +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
Simon Hausmann
4295203dd6 Merge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/dev 2014-12-30 09:35:39 +01:00
Pino Toscano
8f0e84bec5 small improvements to the hurd-g++ mkspec
- remove the X11R6 paths, since they were gone for years, and their
  lack may cause build issues with CMake config files
- add empty QMAKE_*_XCB variables, as done in the common linux.conf
- add to QMAKE_PLATFORM, not just reset it (just done in other mkspecs)
- borrow QMAKE_LFLAGS_GCSECTIONS from the common linux.conf

Change-Id: I94e05032f8195bbda73dffe1da02eec7ac679045
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-12-29 17:53:58 +01:00
Erik Larsson
9a3674302c Fix crash when running QtWayland compositor on xcb-egl.
When running the compositor on xcb the compositor backend will call
nativeResourceForWindow with EglDisplay as resource. When this is done
the window->handle() will be null and result in a crash. By returning
just the eglDisplay() when the window->handle() is null solves the
problem and also makes the compositor work.

Change-Id: I72f4341402facc8c44a41151c4f76d6447bd8070
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2014-12-29 17:53:17 +01:00
Konstantin Ritt
b0b2b9c8f7 Set the minimum required FreeType version to 2.1.10
...and get rid of workarounds for older versions,
which also makes the code more readable.

Change-Id: I087110c5f60cd664dad241776e1a0df901989c75
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-12-29 17:32:05 +01:00
Konstantin Ritt
7e05a400df Minor improvement to Qt-HB bridging code
Replace C-style cast with static_cast for casts from void*.

Change-Id: I4d6c602037e70afe2746a179a31fea4c5043c3d5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-12-29 17:32:03 +01:00
Konstantin Ritt
020f5c01d2 Report font tables are R/O blobs
There is no point in modifying font tables, so mark them RO for clarity.

Change-Id: I8ddbda9ace9c5a0eeabc0c5e5f64558060b5ee69
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-12-29 17:32:01 +01:00
Konstantin Ritt
6eb57b2f5f [Docs] Don't propose using deprecated QFont:: rawName()/setRawName()
Change-Id: I333417b1340a56d782316c2c3628f63a504153ab
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-12-29 17:31:58 +01:00
Milian Wolff
2f2382ee1d Return true for QSqlQuery::isNull on non-existent fields.
This fixes the tst_QSqlQuery::isNull test case when run against a
MySQL database driver.

Change-Id: I8248ba956472bae97a64247594055e6f02840557
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2014-12-29 17:03:17 +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
2302d386c7 Include qobjectdefs.h for Q_GADGET
Change-Id: Ie1bf2393757978775596a542732c62e3f3014f82
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-12-29 09:08:00 +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
Thiago Macieira
62e7518421 Report QHostAddress::Any explicitly in qDebug()
With toString(), it was printing "0.0.0.0", which is the same as
QHostAddress::AnyIPv4, making it difficult to tell the two apart.

Change-Id: I4668ec3337c25ddfdc2fa3bbacc83b9d34316b1f
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-12-28 15:56:24 +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
Marc Mutz
646612e0f9 QSizePolicy: add Q_FLAGS(ControlTypes)
There's no reason not to have it, and it allows better debug output.

[ChangeLog][QtWidgets][QSizePolicy] QSizePolicy::ControlTypes is now
introspectable through QSizePolicy's meta object.

Change-Id: Ia274c708f31e735e4605bd4769aa65a9b78d690f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-12-26 20:22:06 +01:00
Marc Mutz
d8c0ba8d41 qtest.h: actually include qtest_widgets.h
Was including qtest_gui.h instead, for QT_WIDGETS_LIB.

Not a problem in practice, since qtest_widgets.h doesn't
currently add anything on top of qtest_gui.h. But that will
change soon.

Change-Id: I942870cddc7b1ccfda262e2fe26834594336dd0b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-12-26 20:21:51 +01:00
Sérgio Martins
9a0c4fc479 Fix win32-g++ build due to -Werror
qwindowsprintdevice.cpp:182:85: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
         && DeviceCapabilities((LPWSTR)m_id.utf16(), NULL, DC_PAPERSIZE, NULL, NULL) == paperCount

MinGW DeviceCapabilities is returning an int, although microsoft documents it as returning DWORD.

Change-Id: I3acd76dde0b8b83f8a785ec84e3413115c847cb2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-12-26 01:50:57 +01:00
Giuseppe D'Angelo
59d8310b05 QWidget: use a static assert for a compile-time check
Change-Id: I48ec9afc7e5b01e833f66b7e893237d3c68ad048
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-12-25 15:08:01 +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
Giuseppe D'Angelo
11b282d581 Glib config test: fix compiler warnings
Remove warnings: "assigned but not used" and "uninitialized usage".

Change-Id: I247e1de020e78c35787b8e1e30421174ac232fd5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-12-24 22:33:24 +01:00
Roger Maclean
dec81ad2da QNX: Revert the change to give higher precision timers.
The previous change (SHA 82c2118c) to provide better
than 1ms accuracy for timers on QNX is not safe.

According to the docs, ClockCycles is not guaranteed to
return consistent information if called from different
CPUs.  While this can be addressed by locking the thread
to a single CPU, you wouldn't want to do that here.

On some systems (e.g. BB10) the behavior  is extremely bad
since ClockCycles only has 32 bits of precision.  This
results in overflows in the calculations making short
timers run very slowly (16ms timers were around 1s).  Also
ClockCycles wraps in under three minutes causing even
more problems.

I've talked to the kernel developers and there is currently
nothing that will give you better than 1ms accuracy.  An
individual program could use ClockCycles to calculate more
accurate times if they want.

It's not clear to me what benefit one would get with
increased accuracy.  Unless I've missed something, these
times are only used to calculate timeouts for calls such as
select.  These timeouts will themselves have the same
resolution as clock_gettime provides so the increased
accuracy would appear to be for naught.

Change-Id: Ia38b154ca41949becbd0b8558a9ff4ddd5e01a43
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2014-12-24 20:35:09 +01:00
Konstantin Ritt
462be988b6 [QFont] Don't build datastream helpers with QT_NO_DATASTREAM
Change-Id: Id70491c07f5cf13d5f78ec0fc94ffd2b3134ff20
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-12-24 19:57:12 +01:00
Konstantin Ritt
e9dbaa328e Fix potential memory access violation issues
LOGFONT docs clearly states `lfFaceName` member is a null-terminated
string of length not longer than LF_FACESIZE, including trailing null.

This patch covers two cases at once:
1. If family name is longer than LF_FACESIZE - 1, it would be truncated
   and terminated with null, to prevent memory access beyond
   the LOGFONT instance.
2. If family name is a fromRawData QString, we don't assume it is
   null-terminated either and guarantee trailing null ourselves.

Change-Id: I8f607efc7d0901537a4179e36cc51df94203f08d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2014-12-24 15:05:24 +01:00