Commit Graph

20542 Commits

Author SHA1 Message Date
Laszlo Agocs
5d5de7a97f QOpenGLWidget: Play nice with empty paintGL
Applications that do not override paintGL() (may happen in some test code)
will not perform any GL rendering, not even clearing. This is fine, but
to be safe we need to do a clear right after creating the FBO in order to
prevent showing garbage.

Task-number: QTBUG-38327
Change-Id: If062901bb18724f961e41856085470e37b49abbe
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-18 17:45:05 +02:00
lasconic
4aba2d07d2 Use metrics returned by GetGlyphOutline in GGO_METRICS mode
GetGlyphOutline Windows API returns wrong values when used with an
OpenType PS font and in GGO_NATIVE mode. It causes problem when
exporting to PDF. The fix changes the GetGlyphOutline call to use
GGO_METRICS instead.

Task-number: QTBUG-12799
Change-Id: I47d6d16b6e7819b51bc444420ada4a47d5f24f4e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-09-18 17:44:37 +02:00
Adam Majer
1fa3627423 Remove reference to removed qatomic_sparc.h
qatomic_sparc.h was removed previously as part of general cleanup of
old atomic code for Qt 5.3. Unfortunately SPARC include reference was
not removed resulting in build failure on that platform.

Task-number: QTBUG-41384
Change-Id: Ic6e31b32324b0e5dd3700a6a21515a8eea5668bd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-18 15:58:13 +02:00
Eskil Abrahamsen Blomfeldt
a614bc6e39 Cocoa: Always add Arial Unicode MS to fallback list
The fallbacks on the platform should ideally contain all fonts that
support the script passed in, but this would require populating the
font database and checking the unicode ranges for all fonts, so it
would cause a significant performance hit on Mac. What we do here
instead is just return a set of default fonts as the fallbacks
and disregard the requested script.

The consequence of this is that some special unicode codepoints were
not supported on Mac, because we weren't working with a full fallback
list.

To rectify this without breaking performance, we always add Arial
Unicode MS to the end of the fallback list as a final fallback.
This should always be present on the system and has a wide support
of different scripts.

[ChangeLog][OS X][Fonts] Fixed missing glyph box shown in place of some
uncommon Unicode code points.

Change-Id: I4fc8576bfddc8a73204aca2b16437d42c524bc79
Task-number: QTBUG-40986
Task-number: QTBUG-40549
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-09-18 13:42:32 +02:00
Laszlo Agocs
1e41e9b77d Add a note about winId() to QOpenGLWidget docs
Task-number: QTBUG-40765
Change-Id: I0dbb010bb96c6b41c67392b8846782a354481e5e
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-09-18 10:06:49 +02:00
Laszlo Agocs
f72895361d Add a multiwindow manual test using QOpenGLWindow
This is a very useful tool to test the behavior of a given platform
when it comes to rendering on three contexts to three window surfaces
from the gui thread and calling swapBuffers for each.

Change-Id: If3abd055d0dee7cfb24098484326aa24261556bc
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-18 10:06:18 +02:00
Laszlo Agocs
add7c0aadd Propagate swap interval from QOpenGLWidget to the tlw
Otherwise it is impossible to set a swap interval different
than the one set by QSurfaceFormat::setDefaultFormat().

Both windows and xcb will pick up the updated interval from the
window on the next frame.

Change-Id: I55a59f83a62d3adcea687adf28639646b576ed58
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-09-18 10:05:55 +02:00
Giuseppe D'Angelo
6fd5870df0 Deprecate the QStyleOptionProgressBar::orientation member
Its contents are already inside the "state" member.
Fixes a "TODO" for Qt 5 (bumping it to Qt 6, where we will be
able to break API).

[ChangeLog][QtWidgets][Styles] The usage of the
QStyleOptionProgressBar::orientation member has been deprecated.

Task-number: QTBUG-25121
Change-Id: Ie531bb2f2733b15a213e83c9706468e2bf829359
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-18 09:57:28 +02:00
Marc Mutz
40d59496fb QCommonStyle: cache the xpm QPixmaps
The QPixmap(const char* const*) ctor featured prominently in the callgrind
trace of tst_qmdi*, with 23% of total time spent there in tst_qmdiarea
before the change.

Cache the results in the QPixmapCache. That's probably a good idea for all
standardPixmap()s, but none other feature prominently in any of the
widgets/widgets auto-tests, so there's no immediate need to do something
about it.

After the change, less than 3.5% of the total time is spent on parsing
XPMs.

Change-Id: Idfb6ffe0d0f7a4a1f71a7c26fc9ab0f42bdbd7a8
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-18 09:46:48 +02:00
Alex Blasche
935e6a2b33 Make qtconcurrent map example compile on exotic compilers
Task-number: QTBUG-9015
Change-Id: I1019765312c8d55728023642601199506269be6d
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2014-09-18 08:16:00 +02:00
Mitch Curtis
f222d520cd Add missing period to QHeaderView documentation.
Change-Id: Ibf3fdb4e1c149b2dbee7bf3043cec9d3e167381d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-18 07:11:36 +02:00
Mitch Curtis
8eb3d724a9 Improve documentation regarding moving item view columns.
The only way I was able to find information on this was through bug
reports.

Change-Id: Iac59a82fab9c216495860ad3b1efad1125130002
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-18 07:11:17 +02:00
Allan Sandfeld Jensen
9b556afc5a Fix menu mnemonic inside ligatures
The code to draw underlines on specific characters in widget menu could
not handle ligatures. Instead of using special code to handle this case
this patch changes the mnemonic underlines to use normal format-ranges
making the text engine deal with splitting ligatures as necessary.

Task-number: QTBUG-20960
Change-Id: I6159110eae7aa8c819af16ba4a393d758871e2e0
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-09-18 00:13:28 +02:00
Dyami Caliri
82dbea55a7 OS X: Add scan code mappings for Escape, Return and function keys.
In OS X, certain keyboard layouts (such as Japanese) do not produce
unicode character conversions for Escape and other keys. In these cases
the code uses a fallback scan code check to map the key. The scan code
mapping had the function keys, but there are several other important
keys it can map.

Task-number: QTBUG-41090
Change-Id: I624793c9bb28ae8c98b54539c277943905cac7e2
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-09-17 22:35:16 +02:00
Jan Arve Saether
d0be032e5c Fix accessibilitylinux autotest failure
Each test function is responsible for removing the children it added to
m_window, since m_window is reused for each testcase.

Due to this, the test

 QCOMPARE(children.length(), 2);

failed, (it was 3).

Change-Id: Idbd13214d2e841450800df0542fbdbcfaac85ce1
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-09-17 22:05:24 +02:00
Frederik Gladhorn
a72d34d26e Merge remote-tracking branch 'origin/5.3.2' into 5.3
Change-Id: Iae36a5178c0411d4d36508e0725e132af390157a
2014-09-17 20:57:50 +02:00
Maks Naumov
1394962ceb Remove pointless check in QImageData::create()
"height <= 0" already verified above.

Change-Id: Ia2ab90a4cd5533f7b5101686876c2c2cc3e275ac
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-17 20:38:15 +02:00
Allan Sandfeld Jensen
d84a6eab51 Add Grayscale8 and Alpha8 formats to QImage and drawing
Extend the QImage format with two 8-bit grayscale and alpha formats.
These formats have the advantage over Indexed8 that they have simpler
conversion and can be rendered to by the raster engine.

[ChangeLog][QtGui][QImage] Added support grayscale and alpha 8-bit
formats which can also be rendered to.

Change-Id: I4343c80a92a3dda196aa38d0c3ea251b094fc274
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-17 14:48:48 +02:00
Rainer Keller
fcc6b6daff Remove qtdemo from gitignore
QtDemo was removed with a commit in qtdoc.

Change-Id: I1803e041e7da57641148a37691ffdc6ae6c85ad9
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-09-17 12:38:55 +02:00
Joerg Bornemann
21f5d22f6f make it possible to suppress warnings of the vcxproj generator
When the user adds a compiler option that qmake doesn't understand, a
warning message is printed. One can suppress these warnings now by
adding CONFIG+=suppress_vcproj_warnings to the project file.

Task-number: QTBUG-37520
Change-Id: Ieb7ad2c900329e76636047dff85824ea0456f608
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-09-17 12:22:21 +02:00
Mika Salmela
1fb43025f2 Fix cancel operation for example "Application"
On the save dialog the cancel option is detected now from exec()
method.

Change-Id: I977626b83fe770ddc148b57551becd04e5fd9dd5
Task-number: QTBUG-41020
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-09-17 12:03:14 +02:00
Oswald Buddenhagen
b462314520 copy qml files only once in debug-and-release builds
the condition is copied 1:1 from the BUNDLE_DATA logic in qt_module.prf.

Task-number: QTBUG-41267
Change-Id: Ia80a9a29319f70017e090855cf8d35a77b9e727f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-09-17 11:40:04 +02:00
Jan Arve Saether
bce19cb906 Fusion Style: Workaround to get combo box item style from QtQuick Ctrls
This is to align the behaviour with how QGtkStyles behavior is.

Change-Id: Ic85d96cf4a4ab30974b25936de6d5b98e65dd2f3
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-09-17 11:34:55 +02:00
Erik Verbruggen
e409eafe23 OSX: emit aboutToShow signal for top-level dock menu.
Qt sets a QCocoaMenuDelegate on every menu it creates in order to emit
the (OSX specific) aboutToShow signal. However, there are a few cases
where OSX will copy a menu without copying the delegate. One of those
cases is the dock: the result of -[NSApplication applicationDockMenu:]
is used to create a new menu, to which a few more items are copied.
This copy is then send back to the dock.

This patch invokes the delegate's -menuWillOpen: method when
-[NSApplication applicationDockMenu:] is called. Note that sub-menus
won't receive the call-back, because the dock doesn't tell the
application what happens after returning from applicationDockMenu:.

Task-number: QTBUG-39604
Change-Id: I0e06df371a3d77342ae4b7148041214e5c4579d7
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-09-16 22:42:50 +02:00
Giuseppe D'Angelo
bb3d2ca9f1 QToolButton: properly reset the size hint when a menu is set on it
QToolButton::sizeHint() takes into account the presence of a menu.
However, setMenu() doesn't retrigger a size hint recalculation. Hence,
(un)setting a menu on an already sized tool button won't properly
reset the size hint. Since the calculated size hint is cached,
delete the cached value and call updateGeometry to cause a
recalculation.

Task-number: QTBUG-38949
Change-Id: I6e79e5e70e31afdfd129282b3668875eca86f51d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-16 22:42:47 +02:00
Eike Ziller
055622ed48 OS X: Fix positioning of popup menus in case of native NSWindows
The code transformed the coordinates from the view to the window's
content view, and since that content view is flipped in the pure
Qt world (content view == QNSView), it manually flipped the
coordinates to transform from that to window coordinates.

Instead just directly transform the view coordinates to window
coordinates using standard Cocoa methods, which then works with
any kind of content view and NSWindow configuration.

Task-number: QTBUG-40958
Change-Id: Idddd327fe9cff3309606379d0e04ee8b4bd5eece
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-09-16 22:42:43 +02:00
Alexander Volkov
80ca159b47 Fix saving handle width in QSplitter::saveState()
QSplitter::handleWidth() returns either a style dependent value if
d->handleWidth is negative or the value of d->handleWidth itself.
So to preserve this choice after calling saveState()/restoreState()
we should save and restore the value of d->handleWidth rather than a
result of handleWidth() which is non-negative.

Change-Id: Idc11f8063d34b6c4a5f9b0a0032868679766dfb9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-16 20:35:31 +02:00
Alexander Volkov
eb6507039f Allow overriding standardIcon() in a proxy style
[ChangeLog][QtWidgets][Styles] Allow overriding standardIcon() in a proxy style

Change-Id: I3c7983a7e51a8b220a0ca8ead2b4d7b87a77d71b
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-16 20:35:21 +02:00
Louai Al-Khanji
4f25bdd21a EGLFS KMS Hooks: Get rid of flashing
Change-Id: I590572ceb0f64d3e6a1d687874d549e84f20f60a
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-16 15:43:23 +02:00
Louai Al-Khanji
fabef06f33 EGLFS KMS Hooks: Add HW cursor support
Change-Id: I9cd62f3cbcc4ab844f05c43e775512b72d4ff159
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-16 15:43:18 +02:00
Jocelyn Turcotte
18b0aaab77 Fix QT_LINUX_ACCESSIBILITY_ALWAYS_ON
The current behavior was that accessibility is enabled if the variable
is _not_ set, which causes accessibility to be enabled all the time even
if a screen reader isn't present.

Change-Id: I73286622fb5abe1cedce420e760306ab7f200e69
Reviewed-by: Adam Majer <adamm@zombino.com>
Reviewed-by: Tomasz Olszak <olszak.tomasz@gmail.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-09-16 14:34:44 +02:00
Mitch Curtis
6ecc1e8006 Respect Qt::FontRole for QComboBox items.
Change-Id: I810ae2d77109a36b457f07e4a7b0489c954279e8
Task-number: QTBUG-41131
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-09-16 14:33:33 +02:00
Michael Brüning
16b72baf2e Fix Windows ICU build break in QCollator after commit c17563ec.
It used LCID without including qt_windows.h while QT_USE_ICU was
defined.

Change-Id: I3d4cf0e6bd0e299729d23d9a36c5a87adde774c9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-09-16 14:12:32 +02:00
Alexander Volkov
a9d029974e Change the state of only the left mouse button when sending fake mouse events
Mouse events synthesized from touch events affect only the left mouse button.
So preserve the state of other buttons.

Change-Id: I628d41089db39f0c983aa95f311a842111b8c39c
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-16 14:02:32 +02:00
Mitch Curtis
05605b774e Rephrase sentence in QIntValidator documentation.
Change-Id: I53b4e4615ad23a603bc724b896de5fd1644cdab0
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2014-09-16 13:28:52 +02:00
hjk
f14470fa00 Add some minimal size checking for dynamically loaded resources
This covers the case in the bug report, but not much more.

Task-number: QTBUG-21254
Change-Id: Ie191a39ceddd7e58a0d8baf7d01f2a08c70162e5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-09-16 13:04:59 +02:00
Robin Burchell
b4da15a5ef QDateTimePrivate: Add a note about wasted space
And a comment to fix it when the tooling situation improves.

Change-Id: I79781da18a36d4e11cede8477f90f216e08bffe2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-09-16 12:25:25 +02:00
Jørgen Lind
0ed68f3f58 Refactor the sloppy submenu logic
And enable the style to control the behavior of the sloppy submenus

[ChangeLog][QtWidgets][QMenu] QMenu now pick up how "sloppy" submenus
behave from the style

Task-number: QTBUG-20094
Change-Id: Ib1a9770d9b63028033cc360ae236471449d00267
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-09-16 12:03:20 +02:00
Louai Al-Khanji
fb44d3838a EGLFS: Do not assume all hooks will want to create a QEGLPlatformCursor
Change-Id: I05502c27d697524fb4c4d4ccc3aec0e59589fe24
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-16 10:35:35 +02:00
Louai Al-Khanji
e22fcc8c06 Add presentBuffer method to EGLFS KMS hooks.
Change-Id: Ia7e4aec30ced249ab8a9feb59401d02f250193a0
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-16 10:35:29 +02:00
Louai Al-Khanji
0e02f16cea Add presentBuffer method to EGLFS hooks.
Change-Id: Iab5674fe9407d3ab447ef6c16577b24fa60d42aa
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-09-16 10:35:25 +02:00
Maks Naumov
ee324e4ed5 QRegion: Reorganise members to reduce padding in QRegionPrivate
On 64-bit platforms: 56 -> 48 bytes.
On 32-bit platforms it's still the same size (44 bytes).

Change-Id: Ia4831753258ef12aa983757523bb76979e6fc4b0
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-16 05:48:46 +02:00
Giuseppe D'Angelo
b2b9fdfda0 QSizeGrip: use a QPointer to the tracked TLW
And not a normal pointer. The problem is that in certain scenarios,
if the TLW containing a QSizeGrip changes and the old TLW gets
immediately destroyed, then the mechanism which updates the tracked
TLW is run too late, and ends up accessing a dangling pointer.
Therefore, we need to protect that pointer via a smart pointer.

Task-number: QTBUG-22867
Change-Id: Icfb051132bacde604f660ac7a98bc0a9d1022c68
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-15 20:50:50 +02:00
Laszlo Agocs
75ae4dacbc Fix high dpi support in QOpenGLWindow
Change-Id: I0be29fb25d854e09ae961cade0c8490586788394
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-15 18:57:54 +02:00
Laszlo Agocs
bde9387dba Do not drop the context when sharing globally
There is no point in recreating the QOpenGLWidget's
context when it shares with all top-levels'
shareContext().

Change-Id: I659a8ef6563de0cc1e833198af4dfb8c705e40d8
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-15 18:57:48 +02:00
Laszlo Agocs
75834c2232 Fix drag and drop with createWindowContainer
Forward dnd events to the QWindow, exactly like QQuickWidget would do.
This of course requires setting setAcceptDrops(true) on the container widget.

Task-number: QTBUG-39213
Change-Id: I8ea49e630b071dc0aacd53f798d9b46b03502365
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-09-15 18:57:35 +02:00
Daniel Teske
46ebcb6176 Speed up QStringList::removeDuplicates by ~2x
QSet::contains needs to hash the string, which is unnecessary, since we
can just check if the size of the set changed.

Change-Id: I2c7a42bae6cdf351533d5a582a42079658fa7729
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-09-15 17:44:52 +02:00
Robin Burchell
46b2c74eaf QFontDatabase: Micro-optimize getFontWeight.
Translation is an expensive thing, and probably quite uncommon - so don't
penalise any common cases by checking for it until we're quite sure they have
failed.

In addition, we avoid repeated string construction when translating (caching the
result) and avoid repeated case-insensitive comparison by toLowering the string
data.

This change either speeds up most runtime cases that were unfairly penalised
(such as "light") by 50-70% or doesn't impact the runtime speed at all (or,
results were within the margin-of-error).

Of course, calling with translated content will be a bit slower now, but the
slowness of the translations should more than dwarf the real change there.

Change-Id: If24685dfd553e4aed07fbf07678b2585e22b0a3a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-09-15 17:21:11 +02:00
Kai Koehne
0fa0608f70 Logging: Remove use of _declspec(thread)
thread-local variables are known to be broken on Windows XP if the
library is loaded dynamically. This has been fixed since Windows Vista,
but to avoid any elaborate runtime checking of the OS version we're just
removing the logic alltogether for MSVC / Windows.

Task-number: QTBUG-41008
Change-Id: I64ee95270d142294c975a5890d6e1b62a833b6ef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-15 15:58:40 +02:00
Oliver Wolff
d4d752e241 QWindowsWindow: Fixed warning text
Change-Id: I80019f705edcf3b5f974af72ef86b45546582210
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-09-15 15:58:36 +02:00