Commit Graph

22632 Commits

Author SHA1 Message Date
Timur Pocheptsov
653bdcca8e Cocoa integration - do not report invalid coordinates
setStyleMask with NSBorderlessWindow will call (indirectly) windowDidResize (window.delegate's
method)  and view's updateGeometry. At this point view.window can be nil (Cocoa
is re-parenting the content view (?). If this is the case, do not set
this updated geometry on a QWindow/platform window
(since window is nil, self.window.frame is returned as {{0, 0} {0, 0}} by Cocoa).

Found by tst_QWidget::setGeometry.

Change-Id: Ic3cc0d944b5a8a5095c7fd0fdf2df7c9ea602b2a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2015-03-06 13:17:00 +00:00
David Faure
74117b5100 QCommandLineParser: add parsing mode for options after arguments
The new mode, ParseAsPositionalArguments, allows to interpret
"application argument --opt" as having two positional arguments,
"argument" and "--opt".
This mode is useful for executables that aim to launch other executables
(e.g. wrappers, debugging tools, etc.) or who support internal commands
followed by options for the command. "argument" is the name of the command,
and all options occurring after it can be collected and parsed by another
command line parser, possibly in another executable.

[ChangeLog][QtCore][QCommandLineParser] Add parsing mode for options
after arguments, to allow treating them as more arguments.

Change-Id: I48d5fcf90f2f59deda8422538b8ebf2680fae828
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-06 09:09:31 +00:00
Venugopal Shivashankar
aabbb87f4a qdoc: Switched to QList from QMap for subprojects list
QMap sorts the subproject entries by default, which doesn't seem
logical for the qch use case. The subprojects should be listed in the
order they are defined in the qdocconf. Moreover, the no. of
subproject entries in the map is often less than 4, at least for qt.
So there is no performance gain in using QMap for this scenario.

QList just serves the purpose of storing the subprojects in a list
before they are written to the qhp file.

Change-Id: I841934289e09e8e232859353a3dfa15c491dba2e
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
2015-03-06 09:07:35 +00:00
Boris Dušek
d4789294a4 Support "writing-mode" accessibility text attribute
Change-Id: Ib682b6f7828cfd42050bcb9c846fd8aeb7fdd05f
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-03-05 15:18:13 +00:00
Boris Dušek
8944d2dcbb Fix QAccessibleTextWidget::characterRect for off-cursor positions
Current code retrieved the character format at position where the cursor
currently was, irrespective of the position actually passed to the
characterRect function. This is now fixed and we retrieve the character
format for the QTextFragment containing the specified offset.

This fixes display of visual bounds around text by screen reader in some
cases. E.g. on OS X, when searching text using VoiceOver, VoiceOver
first queries the visual bounds of the found text (and thus also
characterRect), and only then it moves cursor position to the found
text. If before the change of position the cursor was on some text with
different metrics (i.e. a bigger font), the visual bounds for the found
text reflected those metrics, not the metrics of the actual found text
for which the bounds were drawn. This resulted in smaller/bigger
rectangles around the found text than was actually correct.

Change-Id: If23b4b8492ec77f0f073fc5c25628b67b483724e
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-03-05 15:05:12 +00:00
Boris Dušek
e19a43be90 Fix QAccessibleTextWidget::characterRect for complex lines
Current implementation of QAccessibleTextWidget::characterRect returned rect
with correct vertical position only when the font point size did not vary
inside the line. This commit makes it work for lines where point size changes
by taking text ascent and descent into account.

Change-Id: I9684b4872566ddfa86dc7a2e9c803a1be0138000
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-03-05 15:05:01 +00:00
Boris Dušek
1cdb117001 Fix accessibility character rect tests
textEditTest in qaccessibility test was using QTextEdit::setCurrentFont
on second pass, but that did not change the font used for text in any way.
I don't know what was the purpose. So I changed it into something that
made sense to me and actually tests text with a different font on second pass.

Also fixed characterRect function in tests to use correct font/format.

Change-Id: I3663e02abda381be1401e298c15b51cd0fb75939
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-03-05 15:04:52 +00:00
Frederik Gladhorn
b1c43b072f Fix tst_qaccessibility::textEditTest for some screen resolutions
On a high resolution display the test will potentially create a text
edit that introduces line breaks and these make it fail then.

Change-Id: Ie82cc4b4139fe0f51ddca219c5c911957fa715b7
Reviewed-by: Boris Dušek <me@dusek.me>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-03-05 15:03:50 +00:00
Florian Bruhin
c4c895d2dd Remove unneeded check in QNetworkReplyImpl::abort.
QNetworkReplyImpl::abort immediately returns at the beginning of the function
when the state is already finished, and the state does not get changed by the
code in between - so this condition will always be true.

Change-Id: Ia98df7cbecf471c7236b5e17caddd1301b647d2b
Reviewed-by: Peter Hartmann <peter-qt@hartmann.tk>
2015-03-05 10:57:32 +00:00
Stephan Binner
983bdc0713 XcbSystemTrayTracker: fix uninitialized value
Change-Id: I5798652408cde3ef6628a4b546c2ebecde1e3081
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-03-05 06:32:20 +00:00
Oswald Buddenhagen
38b5e9f8ba Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: Idd21ab419588ee8b893649e3227d41c46a32e519
2015-03-04 16:49:00 +01:00
Oswald Buddenhagen
8ac63a3323 Merge remote-tracking branch 'origin/5.4' into 5.5
Change-Id: I556be99cc7ad3fc6f7177542b7444269616a7478
2015-03-04 13:44:29 +01:00
Eirik Aavitsland
88550543f8 Painting: Avoid endless loop for certain bezier curves
If the coordinates were too close (at the limit of the number
accuracy), the splitting algorithm in QBezier::shifted() would never
finish. Ref. testcase in bugreport.

Task-number: QTBUG-44674
Change-Id: I2a575cdc6284504ef5e3eb2b749857576fe433c3
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-03-04 09:18:24 +00:00
Thiago Macieira
96e9b41e25 tst_QNetworkDiskCache: Stop using actual web servers
www.example.com is a reserved domain (RFC 6761), but IANA is running a
web server there. As for www.foo.com, that also exists, is a real
website and is often content-filtered in corporations (it triggers a
firewall warning for me -- "You attempted to visit a site that is in
violation of Intel acceptable use guidelines").

So use a localhost instead, since we don't actually need to connect to
the servers to do the work. And since we don't need to connect, I chose
port 4 as it's extremely unlikely someone is running an HTTP server
there (/etc/services lists it as unassigned).

Change-Id: Ia0aac2f09e9245339951ffff13c82439c6d5f945
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-03-04 09:17:10 +00:00
Allan Sandfeld Jensen
59f168c5e5 Optimize fallback RGB888 to RGB32 conversion
Improves the conversion from RGB888 to RGB32 on platforms without SIMD
versions. This includes the fallback used on non-neon ARM devices.

Besides image conversion the routine is also used for decoding JPEG.

On x86 this version is within 0.7x of the speed of the SSSE3 version.

Change-Id: Id131994d7c3c4f879d89e80f9d6c435bb5535ed7
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-03-03 13:38:17 +00:00
Olivier Goffart
bfb92c03e0 Document Q_ENUM and Q_FLAG
[ChangeLog][QtCore] Q_ENUMS and Q_FLAGS have been deprecated, and replaced
by Q_ENUM and Q_FLAG macros. These two new macros automatically register the
enum with the Qt metatype system, allowing automatic conversion to or from
string in QVariant, or to show the strings by QDebug operators. They also
enable the new QMetaEnum::fromType function.

Change-Id: I80cccd7ad3fc46b11aee2fe50681a8126debf972
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-03-03 13:31:44 +00:00
Shawn Rutledge
b134327475 QTabletEvent manual test: use built-in QDebug operator
There's no need to decode the event details here anymore, and anyway
this had a bug: it always said the device is unknown.

Change-Id: If99dddbe2136d95e818f4fe526f62650cbd7c1ca
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-03-03 13:30:54 +00:00
Shawn Rutledge
3b6d2575ae QEvent types: use Q_ENUM qDebug support instead of custom formatters
Change-Id: I10886de57b3ba24dddfcd4b78e1a32c470ac1889
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-03-03 13:30:45 +00:00
Shawn Rutledge
877032bfdf autotests: fix the build in case of QT_NO_WHEELEVENT
Wheel event tests aren't possible if there's no wheel event.

Change-Id: Ibe380c01fbf6cebfd2f43c6ecb52863134ea3c01
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-03-03 13:30:39 +00:00
Shawn Rutledge
34a58b0eb7 avoid sending QPinchGestures based on unreasonable pinch deltas
On some devices there can be spurious events indicating that the two
touchpoints are very close together, so that the ratio of present
line length to previous line length can be very large, and the angle
delta can be random.  But in the normal scenario, there will be a lot
of events, in which the touch point movements are small.  So if the
line length ratio is unreasonable, it's safe to ignore one event and
wait for the next.

Task-number: QTBUG-44665
Change-Id: Ibb7fe560b6a3f7db72d73aad3468c61f24a95d13
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-03-03 13:30:32 +00:00
Shawn Rutledge
a9515cd02f doc: imagegestures example: document the pinch handler
The swipe handler is simple, and also doesn't currently work on every
platform.  But the pinch handler is the one that needs explanation,
because the difference between incremental and absolute values of the
rotation and scale properties is tricky.

Change-Id: Ie3c7f4941d4a17734c9a920a8dd978f86fb03c4b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-03-03 13:30:25 +00:00
Oswald Buddenhagen
c0a5e8c9d7 Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
	src/plugins/platforms/xcb/qxcbscreen.cpp

Change-Id: Ie42931791a849b34b63d814d2eb5ac653986d868
2015-03-03 13:37:38 +01:00
Dmitry Shachnev
30e3a2beb1 Remove unneeded exec permission from icomoon fonts
Change-Id: I47f111b4fa1278889689c28da762fabe94b95015
Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-03-02 10:39:24 +00:00
Oswald Buddenhagen
2b5982aac8 Merge remote-tracking branch 'origin/5.4' into 5.5
Change-Id: I95b3a87c5068c6b8068b30a35655b4c2419e7f9e
2015-03-02 09:23:07 +01:00
Joni Poikelin
fc3733cba4 Fix drawing of background for multipage QTextTable cells
Task-number: QTBUG-31330
Change-Id: I0103919ee2864b7cd8bed41e6d6fe4ac5b84142e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-03-02 06:07:18 +00:00
Thiago Macieira
f9c70128bb Revert "Update the DNS and name-resolver tests to the official zone"
This reverts commit 24c52bd44b and makes
the Qt unit tests requiring DNS zones to use the temporary test zone in
macieira.org (Thiago's domain).

Change-Id: Ia0aac2f09e9245339951ffff13c6d3752c83b773
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
2015-03-01 18:45:56 +00:00
Topi Reinio
4fd8513475 qdoc: Improve handling of current working directory
When qdoc reads (potentially nested) documentation files, it sets
the current working directory to the path of the currently read
file to make relative paths work for include statements and
config variables. This works as long as there's only one top-level
.qdocconf file.

This change fixes problems with handling the CWD to enable
relative paths also when we have multiple top-level .qdocconf
files, as is the case when running qdoc in single-exec mode.

Change-Id: I03a7ec5af93d54070ea29f90ea2ba29c57028781
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
2015-02-27 11:41:05 +00:00
Liang Jian
5f2f38854f Register font's english name as alias when populating font database
Register font's english name as alias in the callback of
EnumFontFamiliesEx() at the time
QWindowsFontDatabase::populateFontDatabase() is being called. This will
help us to resolve english font family name to its corresponding localized
alias once windows font database has been populated. It will also fix an
assertion in Chinese Windows.

Task-number: QTBUG-44647
Change-Id: I265d93c16a1677a7f31ff56d60c24f6e90666419
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-02-27 09:29:53 +00:00
Sergio Ahumada
e78643dc0a Replace old qt-project.org wiki with wiki.qt.io
Change-Id: If6c05a5b1f60e97c64f3d6b64041a84c3af82964
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-02-27 09:27:13 +00:00
Samuli Piippo
efe3f631f2 Add mfloat-abi to linker flags for ARM devices
Cross compilers from latest yocto (dizzy) are no longer built with
default value for mfloat-abi, which means it needs to be given for
both compiler and linker to produce correct binaries. Otherwise
linker will selected dynamic linker as /lib/ld-linux.so.3, instead
of /lib/ld-linux-armhf.so.3 when compiling for hard-float.

Change-Id: I2fe116b1a90a0fbd078a4e8757abd4bc64a7b56e
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-02-27 08:12:30 +00:00
Shawn Rutledge
2e63f7bf92 xcb: Don't log mouse moves by default
It produces too much log output, so now it must be enabled by both
defining Q_XCB_DEBUG and enabling the qt.qpa.input category.

Change-Id: Id2eb7545a7cd07dadd70da31a1f17c2999feec0d
Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-02-27 06:54:47 +00:00
Friedemann Kleint
175b12beba Prevent static functions of Q[Gui]Application from crashing if there is no instance.
Add tests.

Task-number: QTBUG-44499
Change-Id: I160b089ad3f23ab71a87519e50f8a2ef5d2a4a6f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-02-27 06:02:44 +00:00
Eskil Abrahamsen Blomfeldt
4e966497ce Android: Fix compilation for x86
Bionic on x86 does not have an implementation of ffs(),
for some reason. The declaration is available in
strings.h, but causes a linker error. The toolchain has
a builtin version though, which can be used instead.

Change-Id: Iaf4c27542c1aabe88713842303251db44ae6ba86
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-02-27 05:54:36 +00:00
Allan Sandfeld Jensen
3f858a0772 Remove some uses of the private Q_PI constant
The patch removes several uses of the private Q_PI constant and removes
the qmath_p.h from the includes. A few places are optimized to multiply
with reciprocals instead of dividing by Q_PI.

Change-Id: I097af6a929e0609d6935563064e81c856005f4bc
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-02-26 20:31:20 +00:00
Andy Shaw
a782369071 Delete the file that we will move to not the new file before moving
In the case of Windows Embedded Compact we need to delete the destination
file before doing the move if DeleteAndRenameFile has failed since
MoveFile will fail if the destination file exists.

Change-Id: I29d04c147bf8b6b5de850fd7da7bb3dc6a827f1d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-02-26 20:16:05 +00:00
Konstantin Ritt
4ed795df24 Use C++ <cmath> instead of <math.h> in math3d autotests
Change-Id: I2e13ec190ec42ac7732ce9ed3ca5567f637beb1e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2015-02-26 20:15:04 +00:00
Konstantin Ritt
d07166af64 Fix QMatrix4x4::lookAt() in case of null direction
If direction is null, any valid orientation fits, so that the resulting
matrix must be valid.

Change-Id: Ie8060f44801822ee337b25f75fb275bd02223fe8
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2015-02-26 20:15:00 +00:00
Andy Shaw
4054f8a5ad Specific the correct mibEnum value for the 'macintosh' codec
Change-Id: Ib57dd3c98a2ae3994898d7ea40baa0fed482c99a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-02-26 17:30:14 +00:00
Allan Sandfeld Jensen
ad2d4e8386 Remove unused private definitions and function
Remove two definitions and one function not used anywhere in the Qt
source code.

Change-Id: I275e7c7a2d52dd4ac90cc9e6c782cbdfc14791f3
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-02-26 13:54:52 +00:00
Topi Reinio
01d5c77389 qdoc: Fix generation of Doxygen tag files
This change addresses two issues that affect generating .tags files
in QDoc:
    - Paths written to the .tags file are now always relative to output
      subdirectory, i.e. the same folder where the file is created in.
    - Opening the file for writing no longer fails silently. If the
      'tagfile' configuration variable specifies no path, or the path
      does not exist, the file is written to the output directory by
      default.

Change-Id: I23ac529dbfa67575ae96da1c3123ea487cd664f5
Task-number: QTBUG-44366
(cherry picked from commit 5113fdeb7d)
Reviewed-by: Martin Smith <martin.smith@digia.com>
2015-02-26 13:46:33 +00:00
Alex Richardson
3146dadb42 Allow passing absolute paths without file extension to QPluginLoader
Previously QPluginLoader("/foo/bar/plugin").fileName() would return an
empty string even if /foo/bar/plugin.so existed, now we correctly find
that file.

Change-Id: Ibf6ba329e92956de45f695be65773caacf14050a
Reviewed-by: David Faure <david.faure@kdab.com>
2015-02-26 13:31:47 +00:00
Martin Smith
99120ca3cf qdoc: Correct parsing of the using clause
qdoc could only parse the using clause where the 'using'
keyword was followed by 'namespace'. Now it can parse
using clauses with or without 'namespace'.

Change-Id: Ic4aad025c00b3bda2bc1cbd52d0ba8dbbad653e5
Task-number: QTBUG-44553
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-02-26 13:24:13 +00:00
Christian Strømme
c8d64cbcc6 Android: Add scoped local ref. handler.
Adds an internal class for handling local jni references. When calling
raw jni functions the returned object is usually a local reference, to
avoid overflowing the local reference table we need to free any local
ref. as soon as we're done with them. The class QJNIScopedLocalRef,
a QScopedPointer, makes this process a lot easier.

Change-Id: I093e5671f0dcd254d5c2c7985c8c0f625d5592a4
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-02-26 13:02:27 +00:00
Topi Reinio
ba5f93956b Doc: Update online documentation template
- Online CSS tweaks: Max-width, font-sizes,
      font-weights to improve readability, other
      minor fixes
    - Remove duplicate include statement and unnecessary
      definitions for online template

Change-Id: I713bddd0e175235668c4d9790d0df58b4131d19f
Reviewed-by: Martin Smith <martin.smith@digia.com>
2015-02-26 12:26:15 +00:00
Topi Reinio
04e313d708 Doc: Update Copyright information in template/footer
This change updates the copyright information as it appears
in the footer for both offline and online documentation
templates.

   - Update copyright year to 2015
   - Update copyright holder to The Qt Company Ltd

Change-Id: I82fef6067dee42ec9db561aef9c3c506beafb3c6
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
2015-02-26 12:26:01 +00:00
Friedemann Kleint
cd46d94906 Output registered enums in qDebug operator for QFlags.
Change-Id: Ia424df234fbd333782c10f0a4422875bb1bfc1f5
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-02-26 12:16:51 +00:00
Erik Verbruggen
9608629d7e OSX: fix leaks due to missing NSAutoreleasePool
env OBJC_DEBUG_MISSING_POOLS=YES qtcreator

Change-Id: Ibbe5f42af5b94a439be3f0dd0f2b6e34bb1afd3f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2015-02-26 12:11:33 +00:00
Konstantin Ritt
b7d4e4ffeb Optimize quaternion to rotation matrix convertion
Rearrange operands to get rid of 50% of multiplications
(i.e. `2 * (x * x + z * z)` -> `(x + x) * x + (z + z) * z`).

Change-Id: Ib5279425ead999fc571b4964ac1681b6e22f9a7e
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2015-02-26 11:02:59 +00:00
Konstantin Ritt
e628c80dc3 [QQuaternion] Add operator* that rotates a vector with a quaternion
Same as quaternion.rotatedVector(vec).
Expression like `vec = quat * vec` quite common in the 3D world.

Change-Id: I0edd5a5f80537bd149f03f682b3de15c54463e23
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2015-02-26 11:02:47 +00:00
Konstantin Ritt
1872857ca7 [QQuaternion] Fix naming of the new methods
According to the Qt naming policy, methods that return value(s) via
the mutable parameter(s) should have "get" prefix to mention that.

[ChangeLog][QtGui][QQuaternion] Added methods to convert a quaternion
to/from Euler angles and to/from rotation matrix.

Change-Id: I95704e1f4623dc4ca54cd237ea203539fb60d452
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2015-02-26 11:02:38 +00:00