Commit Graph

22981 Commits

Author SHA1 Message Date
Debao Zhang
b798b53db7 Don't remove mnemonics and parentheses under non-Mac system.
SHA: 8e3aacf61b is a mac only patch, but
some code introduced by which is not wrapped with Q_OS_MAC. So add
the missing Q_OS_MAC here.

Change-Id: I748d46b977740e6116dab5659ad1e47d23262a0f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-03-26 06:10:05 +00:00
Tor Arne Vestbø
28295915bc iOS: Implement basic QPlatformOffscreenSurface subclass
Offscreen surface support was added in fb3577039c, as the platform
supports FBOs, but we need to return a subclass of QPlatformOffscreenSurface
that returns true for isValid() and a valid surfaceFormat().

Task-number: QTBUG-39759
Change-Id: If6aa9ee1672984bb93a01a5323af8d93b3b0f2b8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-03-25 19:43:24 +00:00
Laszlo Agocs
909e2b17cb Add a section about QOpenGLWidget alternatives
QOpenGLWindow with createWindowContainer() can be an option
for desktop-only apps in some special cases. Document this.

Task-number: QTBUG-45192
Change-Id: I7c59b7d04d6c0fe58ffe93ac72b204103bef2f4c
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-03-25 13:10:57 +00:00
Laszlo Agocs
0764407040 Avoid crashing in the vao when not supported
The stored context pointer has to be reset to null in
destroy() even when no VAO was created (vao is null).

Otherwise destroying the context that was stored in the VAO
will not lead to resetting the stored pointer, and a subsequent
destruction of the VAO object will try to dereference it.

Task-number: QTBUG-44562
Change-Id: I438bb3954d4bbd8b8d8704f6087479804f0073a7
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2015-03-25 13:10:49 +00:00
Paul Olav Tvete
dc62f15d79 Resize backingstore properly on devicePixelRatio changes
Task-number: QTBUG-45076
Change-Id: Ib2f2408abf7bd0b6d1c8a05fbbdc665e77ea6392
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-03-25 12:17:14 +00:00
Paul Olav Tvete
667f3abc50 Proper geometry conversion for devicePixelRatio > 1
Rounding the bottom right corner position means that the size
can change when the window moves. For windows we need
to round the size up in order to have a stable geometry.

Task-number: QTBUG-45076
Change-Id: I9a85a5915bfec55b0a7295be137b6fbfd7b53095
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-03-25 12:17:06 +00:00
Andy Shaw
2e4a107e7e Ensure that CSS rules are inherited from the parent tags
When CSS is set in a head tag then it was not being inherited by the child
tags when the CSS specification indicates that the properties are in fact
inherited. This ensures that those properties are inherited and the non
inheritable ones are unchanged.

A test is added to cover the different situations with inheritance and a
fix is done for the QTextDocumentFragment test which was passing despite
having incorrect defaults.

Task-number: QTBUG-28770
Task-number: QTBUG-34153
Change-Id: I55966240845a885852a04ecb82c61926dea9f800
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-03-25 11:55:47 +00:00
Alexander Volkov
738c07542a Don't replay mouse press event which closes a popup on X11
Add a new style hint to QPlatformIntegration: ReplayMousePressOutsidePopup.
Return false for it in the xcb plugin.

This commit restores the behavior which was in Qt 4.

Task-number: QTBUG-34814
Change-Id: I19fee762395a51475cc67b52b368c70679ca736b
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-03-25 11:33:45 +00:00
Richard Moe Gustavsen
722f9f9477 iOS: support SH_ComboBox_UseNativePopup in fusion style
Change-Id: I24ef41249042cd658ecba01b0024d08965673b41
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2015-03-25 11:15:02 +00:00
Richard Moe Gustavsen
713e5e2914 QComboBox: use native popup on iOS
Enable native popup on iOS as well as OS X

Change-Id: If99180a017768d9c94241adf2282ee9b3f69cbc1
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2015-03-25 11:14:59 +00:00
Richard Moe Gustavsen
a776a03e75 QComboBox: change showNativePopup to be non-blocking
QPlatformMenu::showPopup() is supposed to be non-blocking.
So ensure that we don't start cleaning up the menu items directly
after the call in showNativePopup, but wait until we need to reload
the items, or the combobox is destroyed.

Change-Id: Ie4c9b6425cec44861af38e517fc5ef226e0903c7
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2015-03-25 11:14:53 +00:00
Eric Lemanissier
b814d05101 Add mingw GCC Version to qconfig.pri
This change adds missing variables in mkspecs/qconfig.pri about gcc
compiler version when using mingw: QT_GCC_{MAJOR,MINOR,PATCH}_VERSION
This is needed in case CONFIG += c++14 is used.

Task-number: QTBUG-44142
Change-Id: I34c27f9154bb745a8ee75c777a0acbdbc5bda5a9
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-03-25 11:13:19 +00:00
Morten Johan Sørvig
b0c58c2bb4 Add tests for detach on setDevicePixelRatio()
Change-Id: I414ff0b794e0202a7f8c931b59b973cb1e7dc148

Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2015-03-24 11:22:36 +00:00
Martin Smith
1341161998 qdoc: Duplicate QML types in the "All QML Types" list are distinguished
We have two State types in the All QML Types list. One is in QtQuick
and the other is in QtQml, but they are both just listed as "State"
with no way to tell which is which. Now they look like this:

State: QtQml
State: QtQuick

Change-Id: I48bb3deda10a61f565d1aed1910360fea4fb7891
Task-number: QTBUG-45141
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-03-25 10:59:25 +00:00
Martin Smith
040e201ba2 qdoc: Remove obsolete stuff from the qdoc manual
Remove the \service and \mainclass commands, and the ditamap stuff.
Also remove all reverences to these commands from qdoc itself.

Change-Id: I8d150acdd56d40e6a4198a021e50f5fe3f3b1194
Task-number: QTBUG-45143
Reviewed-by: Martin Smith <martin.smith@digia.com>
2015-03-25 10:59:16 +00:00
Laszlo Agocs
b1a9787f01 libinput: Reorganize touch frame handler
Avoid showing unnecessary "TouchFrame without registered device"
warnings. That should be reserved only for not having a device ready.
The touch point list's emptyiness is a different story - there we
should stop silently as that is not an error.

Change-Id: Icdb8b352351b70a7e1af2d3a1de3001dfb751aae
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-03-25 10:53:22 +00:00
Stephen Kelly
0809a922a0 Make QAbstractProxyModel API invokable.
With reasoning similar to commit v5.5.0-alpha1~123 (Make some
QAbstractItemModel API invokable, 2015-02-25)

Change-Id: If0bf3a756ab1031f906c5bf9c823aafae4c3873c
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Reviewed-by: Stephen Kelly <steveire@gmail.com>
2015-03-25 10:41:18 +00:00
Stephen Kelly
93305f3af3 QAbstractItemModel: Make the match() method Q_INVOKABLE
With reasoning similar to commit v5.5.0-alpha1~123 (Make some
QAbstractItemModel API invokable, 2015-02-25)

Change-Id: I77c72f7bb856a1eee966b45950384fe03a8eaac6
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
2015-03-25 10:41:10 +00:00
Tobias Hunger
3f314e1607 Doc: Update URLs
Gitorious is closing down, so point to code.qt.io instead.

Change-Id: Ibc453f05e59cf227a7a7086201b008cf7b576a26
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-03-25 10:33:37 +00:00
Friedemann Kleint
c6ff750686 Improve debug formatting of key and mouse events.
Use the debug operator for enums and flags to format keys and
modifiers.

Change-Id: Id748e4b2202797efcbf3a616d111399929ada8b1
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-03-25 10:31:16 +00:00
Marc Mutz
dec7e3ebb7 QDateTimePrivate: replace out parameters with return-by-value in getDateTime()
Compilers don't like out parameters.

Effects on Linux GCC 4.9 stripped release builds:
 text   -584B
 data    +-0B
 relocs  +-0

Change-Id: Ie00c89b9edaced3a6adeb2707734c8f5238e67c1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-25 10:18:51 +00:00
Marc Mutz
2450a66001 QDateTime: prevent aggressive inlining
The function getDateFromJulianDay() is simple arithmetic, but still
~400 bytes in executable size.

Yet GCC inlines this everywhere I looked, which makes some sense,
as different users of the class only use parts of the return
value and the optimizer has a field day removing all that dead
code.

However, that function has only one conditional, so presumably it
executes at full pipeline speed and it doesn't matter that it
calculates too much in some cases. More important is to use the
I-cache more conservatively.

That's what not inlining the function achieves.

The function returns its result in registers and doesn't spill
registers when called (at least on AMD64), so the effect on
runtime should be negligible.

Effects on Linux GCC 4.9 stripped release builds:
 text  -1536B
 data    +-0B
 relocs  +-0

Change-Id: Ia16838102d29ad67ee5efdc8b7b0a26f2f921df1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-25 10:18:44 +00:00
Marc Mutz
aab749487f QTime: optimize toString()
Instead of using a QString::arg() cascade, which creates tons of
temporaries, use good 'ol sprintf().

Effects on Linux GCC 4.9 stripped release builds:
 text   -308B
 data    +-0B
 relocs  +-0

Change-Id: I348577491d1399b5040f7ed9e9f6b111a9528e5d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-25 10:18:35 +00:00
Marc Mutz
1e824bb9c4 Micro-optimize QDate::{long,short}{Day,Month}Name()
Save one return statement per function. I don't see why the compiler
can't fuse these itself, but apparently it cannot, since this
transformation saves 72B in text size.

Change-Id: I3a661456554bf451ed53110ad546946ff7b84ec5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-25 10:18:30 +00:00
Marc Mutz
613449a58d QDate: don't spend code size covering the impossible case
All other similar functions in QDate just return an empty string
in case none of the switch labels would trigger (which would now
cause a compiler warning, after removing the default case label),
so do that here, too.

Saves 44B in text size.

Change-Id: I80ee4975082706adcd15fe89511d08c67e149324
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-25 10:18:25 +00:00
Marc Mutz
0b77e1b611 QDate: remove some useless default case labels
They're pure whitespace, since in each case there is a fallback
after the switch, anyway, and their presence prevents compiler
warnings about unhandled enumeration values in switch statements,
which is nice-to-have, when adding to the enum, eventually.

No change in executable code size.

Change-Id: I77aecaeff990601f957ec9ee827eff5ead25aaa1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-25 10:18:19 +00:00
Robert Griebl
c885efb3cd Skip non-exported slots early when creating a XML interface description.
This will prevent unnecessary warnings about unknown types for signals
or slots that are not even exported to the D-Bus.

Change-Id: Iecda5beca5ebe6665a193245fe1c2578156f6abe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-25 10:11:51 +00:00
Robert Griebl
91feefd7d9 Export the symbols of libdbus-1 when loading it at runtime.
This allows applications that need additional symbols from the library to
easily obtain them without needing to replicate the library open logic
from qdbus_symbols.cpp.

Change-Id: Ic65ef6684637fbcd1c9f4fe1dc7a57f0624b61a8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-25 10:11:43 +00:00
Frederik Gladhorn
0bd06bd9bd Fix building test qpluginloader/machtest against installed qtbase
When building the test while qtbase has been installed and the
build dir was removed, the include paths were not found in
frameworks builds.

Change-Id: I32d9e61176a5e19c86095580ddad6914f25ff952
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-03-25 10:03:38 +00:00
Tor Arne Vestbø
6bcef040d8 Revert "iOS: Prefer debug-simulator as default test target"
Likely culprit for issues in the CI when building iOS tests.

This reverts commit 9a7564edee.

Change-Id: I02ac77a305b5863c9533c97ba06aaafe8f176a22
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-03-25 09:55:40 +00:00
Joerg Bornemann
fc0ac0f4c1 revisit dumpcpp rule
Instead of calling "dumpcpp -donothing", well, do nothing.

Change-Id: Ifa8da9691de0d5ebade51067b8112da95d87ff44
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-03-25 09:54:59 +00:00
Friedemann Kleint
e1ce8dca16 Fix build of the manual dialog test with Qt 4.
Change-Id: If2b0ae9842ebc2795168d2c50934b8a87006544b
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2015-03-25 09:51:28 +00:00
Boris Dušek
f5883eb906 Accessibility Linux: Fix text attributes
Orca expects text attributes with different names (and sometimes also
different values) than IAccessible2 ones (which Qt uses). So adapt the names
and values accordingly.

[ChangeLog][Accessibility] We now report text attributes correctly on Linux,
so ORCA+F now works properly in QTextEdit and other text controls.

Change-Id: Iad6d38168b309669c00069a6167f4f54cbd64cf0
Task-number: QTBUG-44479
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-03-25 09:48:54 +00:00
Boris Dušek
76c94be4e7 OS X Accessibility: Make checkboxes etc. checkable with VoiceOver
NSAccessibility has no explicit analog for
QAccessibleActionInterface::toggleAction(), checking checkboxes/radio
buttons is handled by NSAccessibilityPressAction. So ensure exposing
the action properly on OS X so that VoiceOver users can check/uncheck
checkboxes, select radio buttons etc.

Change-Id: Idc8b048de2313a3e875a929516baf3dded9c68cc
Task-number: QTBUG-44852
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-03-25 09:48:43 +00:00
Boris Dušek
c37f2e8e45 Add string range tests to qaccessibilitymac
Change-Id: I099502d4948194d934ace1fabc5e3ce14f663eb9
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-03-25 09:48:35 +00:00
Boris Dušek
da3dbc45f3 Refactoring of qaccessibilitymac test
In order to support testing values of more accessibility attributes
and parameterized attributed, we provided some "infrastructure" to be
able to query them with minimal effort. We also reworked current 6
supported attributes to use this new way.

Change-Id: Id0ceb59aa0fe063c9aedad27cffcc3aef0899d7f
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-03-25 09:48:27 +00:00
Boris Dušek
93bb16384a 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: Ie2a4dfc714504b7923cdaf8ff875c438aeccddee
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-03-25 09:48:14 +00:00
Boris Dušek
310b5e73f0 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: I4ee43701a30ce9bff1db2f2d0422227496c3df4c
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-03-25 09:48:06 +00:00
Boris Dušek
551f39bac5 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: I843c5b29f8048196ec3405b6717655e77b567dbb
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-03-25 09:47:52 +00:00
Boris Dušek
898ca6ff76 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: I38807a9b3b511478a1742c4422a97c1cb3395a02
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-03-25 09:47:40 +00:00
Boris Dušek
b465edbcab Support all underline types in accessibility
Change-Id: I9eccc66624f5d789cc8778d4376338207beb4a14
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2015-03-25 09:47:17 +00:00
Morten Johan Sørvig
72854081b2 Add tests for detach on setDevicePixelRatio()
Change-Id: I414ff0b794e0202a7f8c931b59b973cb1e7dc148

Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2015-03-24 11:22:36 +00:00
Erik Verbruggen
1e8f50a8d0 OSX: add another missing AutoReleasePool.
No leaks no cry.

Change-Id: Id44993f037447dd84e1ccd4d985877e7f57bb979
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2015-03-23 09:32:06 +00:00
Laszlo Agocs
cafd54d34b Use glFinish() in QOpenGLWidget unless glFlush() is known to be enough
The driver used on the Odroid-XU3 does not like doing just glFlush()
before accessing the texture in another context. There is no guarantee
that glFlush() is enough to sync access to resources between contexts, so
start using glFinish() as the default, except on common desktop hw + iOS
where flush is enough and presumably more efficient.

To unify the code pathes, remove the separate flushes and do it only
once, before the backingstore compositor indicates that it is about to
access the textures. This should improve performance a bit, esp. when
doing multisampling since we flush only once then.

A helper function is added to the internal QOpenGLExtensions because
it is highly likely that QQuickWidget will need the same.

Task-number: QTBUG-45106
Change-Id: Ifb405c5723f29f2f6c04df8e15fb70280681755e
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2015-03-23 09:26:42 +00:00
Laszlo Agocs
09f631d787 eglfs: Unblank on startup
Like linuxfb does.

Change-Id: Icba224d710f241d9246450c7d112ce181b992d0e
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
2015-03-23 09:26:38 +00:00
Laszlo Agocs
39636e38fe eglfs: Disable the blinking cursor
Make eglfs and linuxfb use the same code via QFbVtHandler.

Task-number: QTBUG-45106
Change-Id: I876bbf5f13bab6d4a81f616c01f15f9c98edf5fc
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
2015-03-23 09:26:34 +00:00
Pasi Petäjäjärvi
ddf6ac03cb Do not search test binary if QProcess is not supported.
Without QProcess support we do not run test which initTestCase is
trying to find.

Change-Id: Icecaad90f61a019489e372517a6d62372155bd46
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-03-23 08:38:58 +00:00
Kai Koehne
be3d4ebcbf QVarLengthArray: Do not require operator!= for element comparison
The documentation claims that operator== is needed, not operator!=.
While at it, we can also replace the loop with std::equal, which
might even allow STL implementations to choose a hand-optimized
version of the algorithm for C++ builtin types ...

Change-Id: I988b326d6af3b767526952e303468e18ff6594f9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-03-23 08:13:46 +00:00
Kai Koehne
d3659bf88b QVarLengthArray: Add initializer_list constructor
Implement an initializer_list constructor, which was probably
just forgotten so far. Technically this is a SC incompatible change,
since

  QVarLengthArray<int> array = {10};

will now create an array with one element 10, instead of an empty array
with a reserved size of 10. Anyhow, keeping the inconsistency with the
STL / other Qt containers here would certainly do more harm than good
in the long run.

Task-number: QTBUG-45047
Change-Id: I4675880f93e141181250939942fa32300916b0e3
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-03-23 08:13:42 +00:00
Morten Johan Sørvig
5c379f3ff0 QGLWidget: make renderText() work in high-dpi mode
Keep the win_x/y position in device independent
pixels. Call glViewport with the device pixel size.

Change-Id: I96fa038b1a0a3e18cb7f467b65def09cb89692a3
Task-number: QTBUG-38778
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-03-23 08:05:30 +00:00