Commit Graph

26913 Commits

Author SHA1 Message Date
Andy Shaw
3904950af4 If the font is not being found then get the English name regardless
In a case of having a non English system locale, then the face and name of
the font may be localized but will not match up what is in the registry.
Therefore we need to try with the English name if is possible that there
is one, so in the case of when registerAlias is false we should try to get
the English name if necessary.

Change-Id: Id1064b6f5263677320374dbddfad852f30f041c5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2016-02-05 13:20:05 +00:00
Nico Vertriest
918b8d4e9e Doc: corrected minor link issues
Task-number: QTBUG-43810
Change-Id: I98eafe0c7ed55f309640e8495c83ffcef355aa08
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
2016-02-05 13:01:16 +00:00
Friedemann Kleint
73c062d605 Windows QPA: Remove dead code as detected by Clang.
Task-number: QTBUG-50804
Change-Id: Id87ca4ac98eb17b1e743a10080554da38d609588
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-02-05 08:16:56 +00:00
Andy Shaw
798e0064e9 Fix crash introduced by 75b705fec8
This fixes the crash introduced by
75b705fec8. The drag only needs to be ended
on the hide if it is actually in the middle of dragging. This enables the
case of dragging the dock widget out with the mouse to continue to work.

Task-number: QTBUG-50890
Change-Id: I72309dd40ee670319f2ff607ae201c46f8de4652
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-05 08:15:34 +00:00
Friedemann Kleint
1c7e1d99b7 Windows QPA: Add missing override declarations.
Task-number: QTBUG-50804
Change-Id: I27017b0d0fd44cf746d180fdb126d1e6593e7d7b
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-02-05 08:13:33 +00:00
Louai Al-Khanji
58bd015ddf QProcess: Remove dead code
These functions appear to have been dead code always - even in the
earliest Qt4 releases!

Change-Id: Ie2a458092b45113782284cf8ed3aa11a018b60d4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-02-05 06:59:05 +00:00
Louai Al-Khanji
3b73ee0fb5 Remove qt_safe_select and qt_select_msecs
Change-Id: If46228dc750554b65acd23e48410ec541fc33714
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-02-05 06:58:42 +00:00
Louai Al-Khanji
417586875f QLocalSocket: Use poll instead of select on Unix
Change-Id: I5399623d284ccd804bd1638da143ccdb973af9e2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-02-04 22:35:19 +00:00
Louai Al-Khanji
180b60cc89 QFusionStyle: Fix subtle groove painting
While investigating an unrelated rendering bug I noticed that the call
to drawRect here is essentially dead code. However, the original intent
seems to have been to draw a very subtle shadow within the scrollbar
groove, so let's re-enable it. Subjectively, it does add a nice touch,
especially with higher dpi screens.

Change-Id: Iebffe69ecf9c26be617f7e85bd95f85ed7b0fafe
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Reviewed-by: Jens Bache-Wiig <jensbw@gmail.com>
2016-02-04 22:34:54 +00:00
Louai Al-Khanji
bb747268ed Clean up new poll code slightly
Change-Id: I046126ff69a77a50e79efb1b6ebb0fffef67ac8e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-02-04 22:34:38 +00:00
Louai Al-Khanji
e9802a1073 tst_qeventloop: replace select with poll
Change-Id: Ib2b71696e24249b0b13bb925a7bb627ef09f2dff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-02-04 22:33:51 +00:00
BogDan Vatra
4bf741066d Android: Add runOnAndroidThreadSync
This is a convenient function which waits (timoutMS) for the runnable to be executed.

Change-Id: I2c0f262d3795c29961e8182b7ffc35a2c6f8a1f6
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2016-02-04 17:53:40 +00:00
BogDan Vatra
7696ff89c9 Android: Fix crash, don't add null visible menus to pendingContextMenus
Regression introduced in e3689949ba

Change-Id: I9d3e37733d933e037f04d3a6efaf05607e16d9c5
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2016-02-04 16:04:33 +00:00
Anton Kudryavtsev
69ab280315 qmake: optimize container usage in the json handling.
Iterate only once over QJsonObject, create key list by
existing loop instead of create by QJsonObject::keys(),
which contains internal loop.
In common case if loop's statement is lightweight,
then effect of optimization is significant, and vice versa.
Also make addJsonArray() and addJsonObject() functions
more homogeneous.

Use reserve to optimize memory allocation.

Change-Id: Id122cd1becfd34bb06640876b1c79e1d396d2a6b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-02-04 15:11:05 +00:00
Anton Kudryavtsev
4748acbf1e qmake: use QString::replace() overloaded with QLatin1String
instead of QStringLiteral, QString, const char*.

Results: reduce .rodata, prevent re-creation of QString.

Change-Id: Ie2e3089974c42e6733457bbe58521bccd1da3a53
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-02-04 15:10:49 +00:00
Frederik Gladhorn
4a251da5bb Accessibility OS X: Improve password handling
Set the right sub role (NSAccessibilitySecureTextFieldSubrole) and
return the bullet point character for the text contents. This alignes
the behavior with native widgets.

Change-Id: I7305e08dca61097dd8c050aed64c792c06de0a4d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2016-02-04 11:42:53 +00:00
Friedemann Kleint
1568074a60 Windows QPA/Accessibility: Fix Clang warnings about comparing different enums.
accessible\iaccessible2.cpp(1708,40) :  warning: comparison of two values with different enumeration types ('IA2Role' and 'QAccessible::Role') [-Wenum-compare]
Q_STATIC_ASSERT(IA2_ROLE_COLOR_CHOOSER == QAccessible::ColorChooser);

Task-number: QTBUG-50804
Change-Id: I25a1f00fdbd687ff23f875542a6aa0cc0cab3d23
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2016-02-04 10:21:51 +00:00
Edward Welbourne
f432d64019 Make findAmPm actually return the relevant enum, instead of int.
The enum needed a name to make that possible, of course.
The one overt int return -1 needed to be made explicitly Neither, too.

Change-Id: I3930bf03a7ee5e1619a1c74f9ca54faf6a6c5b2f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-02-04 09:14:02 +00:00
Edward Welbourne
a054349be3 Removed redundant and distracting test from conditional.
If argumentTypes is NULL then it is indeed not equal to the address of
a local static variable, so there is no need to follow the NULL-check
with a check that it's not equal to that non-NULL address.

Change-Id: I62362db747c0620b2195f7997368f026f535d57c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-02-04 10:37:33 +00:00
Friedemann Kleint
debfed863a Direct2D: Spell out ~QWindowsDirect2DPaintDevice.
Fixes warning about deleting the incomplete type
QWindowsDirect2DPaintDevicePrivate.

Task-number: QTBUG-50860
Change-Id: I11edb49e6e3996963913155e307fd5f3944bffd2
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
2016-02-04 08:29:30 +00:00
Andy Shaw
75b705fec8 End the drag if the dockwidget is being hidden
When the window flags are changed for the widget then it is possible to
minimize the dockwidget via the titlebar. This will cause it to be ready
to start a drag internally but since the dockwidget never gets a mouse
release event it doesn't end it. Therefore it ends up being in an invalid
state later on when restored, so the endDrag() needs to happen in the hide
event to ensure this is not an issue later on.

Change-Id: Ia84bee96b9eed49896869e6a15d4de6d01964264
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-04 08:14:39 +00:00
Friedemann Kleint
0026688285 QWizard/Windows: Add missing override.
Task-number: QTBUG-50804
Change-Id: Ia1c73b40d96ddea01e440e0e3e010ff3fcb88793
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2016-02-04 07:56:51 +00:00
Laszlo Agocs
16d0d1c942 egldevice: Add a way to force mode setting
Normally setting the mode again and again on each application startup
is not desirable as it takes time and considerably affects the application
startup experience.

However, in some cases (like shutting down the X server) the output
gets powered down and there seems to be no way to detect this. Here
setting the mode again becomes necessary. Until there is a better
solution, add an environment variable QT_QPA_EGLFS_ALWAYS_SET_MODE
which, upon a non-zero value, leads to always calling drmModeSetCrtc.

The issue is not specific to Qt, the same is visible with the NV examples
as they try to minimize redundant mode set calls in the same manner.

Change-Id: If2b5e3fda74e077a747dd03cee65c936560a5026
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
2016-02-04 07:46:18 +00:00
Tobias Koenig
20a2ba6d74 Add qstrntod as qstrtod overload, which takes a len parameter
Add qstrntod as an overload for qstrtod, which takes a len parameter,
so one can pass character arrays which are not null-terminated.

Change-Id: I8c1c6c3627043c1d6ec6eb712efa3abc9e5e9e00
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2016-02-03 22:19:06 +00:00
Dmitry Shachnev
f83816ec4f dbusmenu: Fix return type for QDBusMenuAdaptor::EventGroup method
Change-Id: If7454eeaafb31737f023e7359b2a1c513dd5772f
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-02-03 18:43:56 +00:00
Dmitry Shachnev
68f97cdf5f dbusmenu: Add missing methods for getting QDBusPlatformMenu properties
Similar to the existing methods for QDBusPlatformMenuItem. These methods
will be needed for implementing the D-Bus platform menu bar.

Change-Id: Iae3a5892b71fa9a7c72c323ee4b3ab2afd7d4d76
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-02-03 18:43:55 +00:00
Alex Trotsenko
29af35f352 Simplify QAbstractSocket::readData()
It needed refactoring after prior changes (bf6897edb0,
1ce203d05a, 48a4a67e8d).

Change-Id: I06ee3f4f70db2a71acfc8e9c1da5b4ad7524179d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-02-03 16:08:52 +00:00
Sérgio Martins
5b75a16e8f Don't use Q_GLOBAL_STATIC for trivial type QLocaleData
Change-Id: I9435295a753d7dabea202fde876786d876a295fa
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-02-03 15:53:11 +00:00
Nico Vertriest
3b0c75316c Doc: Replaced Trolltech logo with Qt logo
Task-number: QTBUG-37505
Change-Id: If59039b2f7e60ffea3e8c7803d38e528acf35383
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
2016-02-03 12:37:37 +00:00
Louai Al-Khanji
24642df23c QProcess: Use poll instead of select on Unix platforms
Change-Id: I3386ef228ce95209f6f221e18293d991b24a7b2e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-02-03 10:25:21 +00:00
Alexander Volkov
40e4949674 xcb: Take into account the orientation of touch points
Add support for ABS_MT_ORIENTATION value. Linux kernel multi-touch
protocol allows it to be in a wide range:
https://www.kernel.org/doc/Documentation/input/multi-touch-protocol.txt,
but we need only to know whether the touch point rect is rotated
by 90 degress. So adjust the angle to the closest axis.

Change-Id: Ie20725dc4bef509e2f9b19571efc69502d00c019
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-02-03 07:44:14 +00:00
Louai Al-Khanji
a0f9ee5dca Unix platforms: Use qt_safe_poll in QLocalServer
Change-Id: If9f0c1a0089b16729c20c0e05feca58a514d3e25
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-02-03 03:04:40 +00:00
Louai Al-Khanji
d28bb50b25 Unix platforms: Use poll in native socket engine instead of select
Change-Id: I10fde9f446ee17c921ce9cf356a27daac396321d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-02-03 03:04:37 +00:00
Tor Arne Vestbø
10bf53ae19 Don't include <qtest.h> from qtestblacklist.cpp
It's only supposed to be included by clients of the library, and
confuses qmake's dependency resolution into thinking the header-only
features such as qtestkeyboard.h and qtestmouse.h are dependencies
of this source file.

Change-Id: I5fe73b752c1c491ee0088bced77f997696d96c62
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-02-02 23:29:52 +00:00
Allan Sandfeld Jensen
6ec7d7658d Fix rounding error in fetchTransformedBilinear
To calculate the real count we need to use the actual fixed point
increment and can not use the floating point value increment wass based
on since it might round differently.

Includes auto-test by Gabriel de Dietrich.

Task-number: QTBUG-50153
Change-Id: Ia973088f361c90370fa20bac14a4b8f373b5d234
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-02 22:47:10 +00:00
Edward Welbourne
72b57a5dfa Disintermediate QDateTimeParser::SectionNode operations.
The name, format and maxChange of a Section depend only on the
section, not on the details of the currently parsed text it matches;
so we don't need the parser object's list of all sections to work them
out.  Move these methods to the SectionNode and act directly on that
instead of going via the section list.

Make the name take a Section enum instead of an int.
Likewise, make stateName take a State enum instead of an int.

Change-Id: Ie340d042ab95aec517013c4dcc30901d40305c78
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-02-02 16:28:48 +00:00
Edward Welbourne
a965d505a0 Make interleaving of QDateTimeParser::Section values evident.
The actual section members grew up to the internal value, leading to
interleaving of subsequently-added values.  Change existing enum
values to make this go away (class is private, so no BC constraint
forbids this).

Change-Id: If266b557817eae19d375519bf38268f0f2a0d372
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-02-02 16:28:40 +00:00
Edward Welbourne
2564de7b1e Deconfuse some heavy use of the preprocessor.
One #if...#endif started in one function's body and ended in
another's, which is worth remarking on in comments at both ends.

A later #if...#else... opened blocks in both halves, that were closed
just after their #endif, leading to simplistic brace-matching failure;
so move that closing brace to inside both halves, so each half is
brace-balanced and the function, as a whole, brace-balances simply.

Commented on each #endif that was distant from its #if.

Change-Id: I74d97b6dc4b291ec05053d299077a61cecf41ca1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-02-02 16:28:24 +00:00
Edward Welbourne
3d64f898d1 Correct usage of Apple-related #if-ery.
As requested by sanity-bot.

Change-Id: I8f6793a26f5cf600d4e6225ca219496cfbb25799
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-02-02 16:28:18 +00:00
Edward Welbourne
bb1924c345 Pass -silent to lrelease to avoid cruft in test logs.
Change-Id: I7cf2808187f97b6319f7561fe06ddef476fa9aa0
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-02-02 16:28:07 +00:00
Edward Welbourne
04def3a878 Don't clutter up the source tree with .qm files generated by testing.
Generate the qundo*.qm files for tst_QUndo*::commandTextFormat() in
the current directory (out of source, for a shadow build) rather than
alongside the qundo*.ts from which they're derived (in the source
tree); and remove them once loaded, if that succeeds.  (On failure, we
might even want to look at them.)

Task-number: QTBUG-49081
Change-Id: I666985fa3ceb8c25c917b617d6d39141eddebb76
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-02-02 16:27:55 +00:00
Dmitry Shachnev
f5ea4baa0d dbusmenu: Add support for shortcuts
To do that, split out and export a QKeySequencePrivate::keyName() function
that returns the key text representation without the modifiers.

The implementation is compatible with libdbusmenu-qt.

Change-Id: Ibc3190a3949813a1610728cf89574027e5d2778d
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-02-02 16:27:38 +00:00
Błażej Szczygieł
751e2ce44f Clean up tst_qwidgetwindow
Rename TestWidget to PaintTestWidget, because this class tests only
whether paint event occurs.

Remove unused variables.

Remove reset() method, because there is no need to reset only one
variable in class method.

Change-Id: I8f442c73598e3431baf2b0433fefc157d3f10ea6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2016-02-02 15:18:19 +00:00
Liang Qi
d3e6e732c7 Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
	config.tests/unix/compile.test
	src/plugins/platforms/cocoa/qcocoahelpers.mm
	src/tools/qlalr/cppgenerator.cpp

Change-Id: I0103ca076a9aca7118b2fd99f0fdaf81055998c3
2016-02-02 15:57:44 +01:00
Marc Mutz
fdfd63053a QtBase: avoid uses of Java-style iterators [QHash, QMap]
Java-style iterators are slower than STL-style ones, so
they should not be used in library code.

Replaced them with C++11 range-for, STL iterators or, in
one case, qDeleteAll().

In one case, avoid a double hash lookup by using erase(it)
instead of remove(it.key()), which we can now do without
detaching, due to the new erase() taking const_iterator.

Change-Id: I96174657fed70f76120b2c9d8190b4e70d5d8179
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-02 10:20:00 +00:00
Frederik Gladhorn
ba8d343002 Remove warning about being unable to instantiate accessibility interface
This warning was a good idea when the plugins were needed to give a hint
where to start debugging. Now the a11y plugins were merged into
qtwidgets/qtquick, so there is no more need for this warning which may
pop up on custom widgets e.g. inheriting QWindow.

Task-number: QTBUG-50215
Change-Id: Ic5efbb3dfbd07a7139884126a2604b54c99005e4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2016-02-02 08:20:35 +00:00
Andy Shaw
0c019d7bd2 QDockWidget: Restore using setGeometry since the geometry is used for the state
This solves an instance where restoreState() was used when the
dockwidget was already floating and the saved state was also for
a floating dockwidget.

Change-Id: I1fe764ae2a6b0351ae26e33ffec682ad37c944d7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-02 07:43:13 +00:00
Dmitry Shachnev
b84c61b088 Stop Q_AUTOTEST_EXPORTing QKeyBinding and QKeySequencePrivate
The QKeySequence test no longer uses private members (since commit
725bdc3fd2), so that is no longer needed.

Also, remove the unused include from the test.

Change-Id: I4d252bb3efd7282f74c44e48444c23ab51d48ea5
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-02-02 05:57:08 +00:00
Tor Arne Vestbø
d10bfff89a Revert "QWindow::destroy(): only reset QGuiApp::focus_window and friends as a last resort"
This reverts commit 4c71db7567.

It's too risky for 5.6, we should let it cook in dev for a while
and backport when ready.

Change-Id: I91e677e65d967f29c84a254cd3dffc8bb847b263
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-02-02 02:12:26 +00:00
Anton Kudryavtsev
1d3503b8f3 qmake: use reserve to optimize memory allocation.
Change-Id: I6ace338512c24fd9dc11c767a28f0a63454076fa
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-02-01 20:57:59 +00:00