Commit Graph

17738 Commits

Author SHA1 Message Date
Joerg Bornemann
10a5a0d777 Doc: fix documentation of QProgressDialog::open
The slot is connected to the canceled() signal and not to the
accepted() signal since the introduction of the open method.

Task-number: QTBUG-37210
Change-Id: I0604c612f6054611a69876d53908bb58ec048b09
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-03-04 11:42:51 +01:00
Erik Verbruggen
f59083636b Win32: define _HAS_EXCEPTIONS as 0 when exceptions are off.
When this macro is not defined, a number of inline methods in the MSVC
stl will throw exceptions. This in turn generates a warning when
exceptions are not enabled on the compiler command-line.

Change-Id: I5a57ec544bda0c75f04fdea9412b03107f9ff531
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-03-04 11:40:24 +01:00
Friedemann Kleint
e531b46bed Turn off compiler optimization in tst_qtendian for MSVC2008.
This causes frequent compiler errors on Windows CE.

tests\auto\corelib\global\qtendian\tst_qtendian.cpp(140) : fatal error C1001: An internal error has occurred in the compiler.
(compiler file 'd:\orcas\compiler\utc\src\P2\main.c[0xCCCCCCCC:0xCCCCCCCC]', line 243)

Task-number: QTBUG-37194

Change-Id: I2adbc1e3b1896fbe86780aa26a15e918333a09f2
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-03-04 11:29:30 +01:00
Gabriel de Dietrich
e7874563e4 Windows Vista Style: Don't draw menubar item background for QQ Controls
In QtQuick Controls, we draw the full menubar background and the menubar
items on top. Unless in a particular state, there's no need to draw the
background or it may overlap with the menubar edge.

Change-Id: Ia35a73274cc10b3b5a3f55573c92919f99555db0
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2014-03-04 11:29:30 +01:00
Gabriel de Dietrich
28c9c2ea50 Cocoa: Keep child NSWindow alive while it grabs the mouse
Otherwise, Cocoa loses sight on which window to send the
dragging mouse event. If the window is kept alive (but hidden)
Cocoa will send the events to it, and we can forward them to
the actual QWindow.

This is the expected use-case:

  1. Start dragging a QWindow and change its flags.
  2. This triggers a call to QCocoaWindow::recreateWindow(),
     which will get rid of the old NSWindow and create a new
     one (the QNSView is moved to the new NSWindow).
  3. When we stop dragging, the NSWindow is finally destroyed.

QNSView Pointer References Remarks:

In QNSView, m_window points to the QWindow which remains unchanged
until deleted. Similarly m_platformWindow remains valid until
deleted, in which case we delete the QNSView, the NSWindow and its
helper (see QCocoaWindow destructor).

This fixes undocking QToolBars when they are a child NSWindow.

Task-number: QTBUG-33082
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Change-Id: I6fc53292cd96586cfdf401481c5442d759f1fae5
Reviewed-by: Liang Qi <liang.qi@digia.com>
2014-03-04 11:29:30 +01:00
Gabriel de Dietrich
018d1ca5f3 Cocoa: Use helper class for event handling in native windows
QNSWindow and QNSPanel duplicate some code when it comes to event
handling, which can be refactored. Also, it's currently not
possible to keep an NSWindow derived instance temporarily alive
as QCocoaWindow is not designed to keep track of more than one
NSWindow. Finally, we can reduce the size of (and eventually remove)
the QCocoaWindowCategory which polutes the NSWindow namespace.

We move QNSWindow and QNSPanel specific API into QNSWindowProtocol,
and define QCocoaNSWindow as NSWindow extended by that protocol.
This gives us a type we can refer to any of the native windows
QCocoaWindow instanciates.

We introduce QNSWindowHelper which gathers the common code between
QNSWindow and QNSPanel. This is a one-to-one mapping that keeps a
weak (non-retaining) reference to the NSWindow and a weak reference
to the QCocoaWindow. It has the same life span as its associated
NSWindow.

Task-number: QTBUG-33082
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Change-Id: I38d001bf13f64a1ba4f1439291c5103c3f755183
Reviewed-by: Liang Qi <liang.qi@digia.com>
2014-03-04 11:29:30 +01:00
Allan Sandfeld Jensen
ce909a138a SPDY must handle destoyed QNetworkReply
A QNetworkReply may be deleted before it is closed by the protocol.
Since QSpdyProtocolHandler tracks pointers to QNetworkReplies it must
keep track of their destruction as well to avoid links to deleted
objects.

This fixes the last issue with SPDY access of Google Mail in QtWebKit.

Change-Id: I2c56dc080fdcb249b6ed9189fef84cbbc1220cbd
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-03-04 11:29:30 +01:00
Thiago Macieira
a83498299a Remove the header precompilation for QtXml and QtOpenGLExtensions
Respectively, those modules have 2 and 1 source files. Precompilation costs
more than the benefit of using precompiled headers.

Change-Id: I15ababd9ba7cce2e1510454da49010456ff0597a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-03-04 04:36:00 +01:00
Allan Sandfeld Jensen
bcf5ea28c1 Remove deleted QNetworkReplies from SPDY queues
We already remove QNetworkReply from most queues, but we also need
to remove it from the SPDY queue. Otherwise we might end up trying
to send an already deleted message.

Change-Id: Ib39bf8f26315b66179755a6f66dbd657576cbbe3
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-03-04 04:35:37 +01:00
Thiago Macieira
e7f685002b Atomics: implement fetchAndSub on top of fetchAndAdd
Instead of looping unnecessarily on top of testAndSet.

Task-number: QTBUG-37031
Change-Id: I8120f8405eb76dccc9066749cee0a92b0f2da20e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-03-04 04:34:36 +01:00
Thiago Macieira
380de7f8e7 Fix use uninitialized, detected by GCC 4.8
If the widget \a field is not present on this form, getWidgetPosition
might not fill in the role variable. GCC is correct.

qformlayout.cpp:1690:19: error: ‘role’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

Change-Id: Ia67991a71e8f1ceacb9d6370c7028c454ef630c6
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-03-04 04:34:15 +01:00
Sergio Ahumada
7e872de76e Fix some typos
Change-Id: I7dbe938bff5ac3ab50a0197f94bdb2f6c22fbd16
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2014-03-03 18:24:29 +01:00
Konstantin Ritt
2b15c9c256 Introduce a generic QFontEngine::canRender() implementation
...which uses the recently introduced glyphIndex() method;
get rid of re-implementations that did almost the same.

Change-Id: I6d32d2cee6a31f57de6aee05ed8d120d4a1f4e9c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-03 11:11:27 +01:00
Konstantin Ritt
af74201edb Introduce QFontEngine::glyphIndex(uint)
...an optimized drop-in replacement for the code like this:
`stringToCMap(&uc, 1, &g, &numGlyphs, QFontEngine::GlyphIndicesOnly)`
(aka "get the glyph index for exactly one Unicode character").

Change-Id: I22babf49f7cf28892d27533a5ac51ad449779f75
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-03 11:11:24 +01:00
Konstantin Ritt
78d115f8f2 Unify QFontEngine*::stringToCMap() behavior
Ensure the params are valid and make QCoreTextFontEngine::stringToCMap()
handle the unsufficient buffer case exactly like the other engines does.

Change-Id: I078af37da917cf2bac709b12aa827ed4128e5f30
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-03 11:11:20 +01:00
Konstantin Ritt
3567d62ed3 Get rid of unused variable
Change-Id: Ie90914c2110d32e573108a355a44dd459097a755
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-03 11:11:15 +01:00
Konstantin Ritt
5a7bf123ea Fix QFontEngineQPA::recalcAdvances() in case of missing glyph
Modifying the glyph indexes array in recalcAdvances() could lead
to undefined behavior.

Change-Id: Ibbb6642f381a5fe01b285dc8d2001c167dc66f46
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-03 11:11:09 +01:00
Konstantin Ritt
fd498ad1c0 Make QGlyphLayout consume one byte less per glyph
Change-Id: Iddcc2e1f284dcf13ae98b57ea2d5854e57c83530
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-03 11:10:56 +01:00
Konstantin Ritt
25e34dadab Hide the justification algorithm implementation details
The justification "classes" stored in the glyph attributes
are actually a justification priorities suitable for a particular
language (script). The external API only uses the justification
metrics array calculated on top of these priorities.

Change-Id: I5b0a39e35954084c63a798b632fd6108f9ae7608
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-03 11:10:50 +01:00
Konstantin Ritt
ead6cc40df Fix retreiving the 'head' table in QPAGenerator
The 'head' table is usually of 54 bytes length. Passing the buffer of
4 bytes capacity for the 'head' table is expected to return false,
thus skipping the FontRevision tag in QPAGenerator::writeHeader().

Change-Id: I02c0b13f3cbf13579a845fe78fcbc8a437ae22bf
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-02 23:26:51 +01:00
Konstantin Ritt
4c7082162d Unify QFontEngine::getSfntTableData() behavior on all platforms
Being a most significant method in the font API,
getSfntTableData() must behave in exactly the same way on all platforms.
Briefly, it must return true if the table exists in the font,
despite the other params, and always stores the table data length
in 'length' param, thus reporting the amount of bytes actually
needed to store the table data in a buffer.

Change-Id: I7a15465020c1ea818ea46a05ea3b9b7e1cd60d14
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-02 23:26:49 +01:00
Paul Olav Tvete
5cd7390ba9 QQuickWidget show/hide/raise fix
Make sure the alphamask in the backingstore is updated whenever the
state of a QQuickWidget/QOpenGLWidget child changes.

Task-number: QTBUG-37062
Change-Id: Iffa80fc8993499a15bc9e773a162a3f98b81ae03
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-03-01 09:04:10 +01:00
Paul Olav Tvete
d307785381 Android: avoid crash with toplevel QGLWidget
Task-number: QTBUG-37096

Change-Id: I14db37a78314782d7b5897db946283bd0063e348
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-03-01 09:03:55 +01:00
Bernd Weimer
e2d21a0483 QNX: Report if GL context is shared
This fixes the tst_qopengl sharedResourceCleanup auto test

Change-Id: I0ac6f45797f656b637254f01c2cb8073436b45b2
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2014-02-28 22:57:26 +01:00
Friedemann Kleint
58b928aca8 Windows: Fix return value of WM_QUERYENDSESSION for bogus messages.
LRESULT should be non-zero if the application can quit,
and it is always handled. Improves
97d8e3b200 .

Task-number: QTBUG-35986

Change-Id: I0ad95bc20a5d9e2a52c76bdcdfa986595f6a08d8
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-02-28 22:57:26 +01:00
Friedemann Kleint
fdd8a1b42c Add source to debug output of QMouseEvent.
Change-Id: Ibf55a2697ca0ac85624097299be92c1055dcb8aa
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-02-28 22:57:26 +01:00
Jorgen Lind
d4a4ef9e38 Make bool arguments to QWidgetBackingStore::markDirty enums
This is so we get some typesafty when refactoring, and I think it makes
the code more readable

Change-Id: Ia7531950d5f780dc98f4eb435c1e0050d76cdb5f
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-02-28 22:57:26 +01:00
Allan Sandfeld Jensen
4bf27a24c0 Do not upload on closed SPDY streams
We should never upload on a SPDY stream in a closed or half-closed
state. To avoid it we need to stop listening for readyRead on the
upload device, and ignore WINDOW_UPDATE on completed streams.

This fixes SPDY access of facebook.com.

Change-Id: Icad45ffc109b2c14b921f1571e114b70a30f40a9
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-02-28 22:57:26 +01:00
Mat Sutcliffe
0de55b6c9f Honor the value of the PlatformToolset environment variable.
The Windows SDK 7.1 command prompt sets this value to "WindowsSDK7.1"
through its SetEnv.cmd batch script. The MSVC Express Editions do not
include a 64bit compiler toolchain, but the Windows SDK does, so this
change makes it easier to build qmake projects for x86_64 when using
the Express Editions, by running qmake from the SDK command prompt.
See also:
  http://msdn.microsoft.com/en-us/library/9yb4317s%28v=vs.100%29.aspx
  http://msdn.microsoft.com/en-us/library/ff660764%28v=vs.100%29.aspx

Task-number: QTBUG-31185
Change-Id: I49d3e159ed67f64490a3d57c5471d540d76ae13f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-02-28 18:02:14 +01:00
Laszlo Agocs
5119bbc642 Add core profile versions of the glyph cache shaders
The last step to make QOpenGLTextureGlyphCache working with
OpenGL core profiles.

[ChangeLog] Native (that is, not distance field based) text
rendering is now functional on OpenGL 3.2+ core profiles too.

Task-number: QTBUG-36993
Change-Id: Ic6c0db4806cea623ca7a19ab77b0329155824877
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2014-02-28 18:00:44 +01:00
Laszlo Agocs
1219dbe543 Add an example for creating OpenGL contexts
Besides serving as an example for performing OpenGL rendering inside
a window container in a way that it works across all GL versions,
this is an extremely useful tool for developers and users alike
since it allows quick and easy checking of what sort of context a
particular driver returns for a particular QSurfaceFormat.

NB! Depending on the OpenGL driver, some surprises can be expected.
The handling of core/compatibility profiles, the fwdcompat bit,
the supported GLSL versions, etc. tend to be somewhat different
across the different OpenGL implementations.

Task-number: QTBUG-37071
Change-Id: Iae4328e66cd0bb19f74a77fefef93ea5a3221e31
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2014-02-28 18:00:39 +01:00
Marc Mutz
4051914641 QPalette: optimize move assignment operator
Instead of assigning the various bit-fields manually, use the quint32
union field, which is already present to avoid slow bit-field operations
in the member-swap function.

Verifed that the generated assembly for move-assignment is
significantly better than before on GCC.

Change-Id: If4e0ef678bf3a496c6eb369ad3f639f5a9bc79fc
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-02-28 17:59:51 +01:00
Sergio Ahumada
24040ca43c SPDY: Fix compiler warning about unused variable
Change-Id: Ib3dcd8616ab8167de31a01b3e6f0188d384ff244
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-02-28 17:59:37 +01:00
Sergio Ahumada
e8ed514e35 tests: Remove superfluous gui additions to QT
by default QT contains both core and gui already

Change-Id: I6f5b551104e40a024468e7cb62e302134e9472ec
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-02-28 17:59:29 +01:00
Allan Sandfeld Jensen
474bf7b187 Protect against malicious SPDY messages
Add handling of invalid stream-ids and buffer overflow in header
parsing.

Change-Id: I712af189d72612639d25890a8861a8f4fe084ce3
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-02-28 17:57:13 +01:00
Adam Reichold
0d0fb04d50 Make QTreeView::expand/collapse check for ineffectual invocations
Added checks if item is already expanded/collapsed to
QTreeView::expand/collapse since the following computations
can be quite expensive. (This is useful when saving/restoring a
lot of item expansion state e.g. after a model reset.)

Task-number: QTBUG-35939
Change-Id: I82c4489f9fe0b8ac61994652a60312e34c46f628
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2014-02-28 07:47:16 +01:00
Sergio Ahumada
e5870b61c6 tst_qnumeric: Mark some tests as XFAIL on BlackBerry 10
These tests seem to fail because denormalized numbers are not
supported on QNX yet, so marking them as expected failures.

 - floatDistance(denormal)
 - floatDistance_double(denormal)

Task-number: QTBUG-37094
Change-Id: I79dbc78da6e9bef8466264fd2cab4af0ee8b868f
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
2014-02-28 07:46:31 +01:00
Sergio Ahumada
82e699cab0 tst_qtjson: Mark some test as XFAIL on BlackBerry 10
These tests seem to fail because denormalized numbers are not
supported on QNX yet, so marking them as expected failures.

 - testNumbers_2()
 - toJsonLargeNumericValues()
 - parseNumbers()

Task-number: QTBUG-37066
Change-Id: Ifec95b936fb70253395dee4d1ca18e85870486a3
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
2014-02-28 07:46:31 +01:00
Allan Sandfeld Jensen
1e29bf5b07 Do not assume nice behavior in error handling
SPDY is currently assuming it will only receive RST_STREAM messages on
active steams. This is however not always a safe assumption.

Task-number: QTBUG-37100
Change-Id: Ied89a68a209891992ad72daa513066efc1d7c421
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-02-28 03:17:11 +01:00
Oswald Buddenhagen
f8c5dd9857 automate handling of generated headers some more
let the syncqt + qt_module_header.prf pair handle generation of
forwarding headers.

in qtbase this is ineffective to some degree, as the need to create
QtCore's forwarding headers early for QtBootstrap requires qtbase.pro
already doing the real work, but at least we get the verification that
nothing breaks.
Other Modules (TM) will need the full functionality.

Change-Id: Ifd3dfa05c4c8a91698a365160edb6dabc84e553f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-02-28 03:17:11 +01:00
Oswald Buddenhagen
13455344d7 move generation of qconfig.h forwarding headers to qtbase.pro
less platform-specific code. the qfeatures.h generation is already here.

Change-Id: Ied69fb431eed5816fbff63b33be431ee913c2bc8
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-02-28 03:17:11 +01:00
Oswald Buddenhagen
46feffea1b de-duplicate header install source calculation
Change-Id: I7c26d70fdfceac6d3c562e704cc725fad80c4f59
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-02-28 03:17:11 +01:00
Oswald Buddenhagen
e8b2ff63ec remove duplicated nested condition
Change-Id: I433773dbf21a7a7625d4f763b3cebe75c746aa1f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-02-28 03:17:11 +01:00
Oswald Buddenhagen
40babf8b4a un-pluralize code
since ever we've thrown out the phonon hack, each header is synced to
only one location (CamelCase headers notwithstanding).

Change-Id: Idfef33db9410908aefe309bc7a3edeae5fc5a671
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-02-28 03:17:11 +01:00
Oswald Buddenhagen
6571aaf1c4 merge %explicitheaders into %classnames
no need to have two mechanisms for the same thing.

the values of %classnames can be comma-separated lists now, so one
header can have multiple classes assigned. conversely, if an extracted
class name reverse-maps to a different file name, it is omitted.

Change-Id: Ia0a35d64764b6376f33b77bbfe59e1df70a3cf1a
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-02-28 03:17:11 +01:00
Oswald Buddenhagen
3d50a09645 remove vestiges of uic class map code
amends ad52be1ac.

Change-Id: I2bfb10908217708c4f046d0d315dadd1b626da12
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-02-28 03:17:11 +01:00
Thiago Macieira
c8cde619a5 Fix ARM atomics for 8- and 16-bit types
This has apparently never worked for any negative value. That's because
the compiler sign-extends the incoming expectedValue to fill the 32-bit
register, instead of zero-extending it, and it also expects any returned
values to also be sign-extended.

Task-number: QTBUG-37031
Change-Id: I836eddba7b1acc56bb0ac1d41de7001d06255b9b
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-02-27 22:46:00 +01:00
Simon Hausmann
d2cb81f8d9 Add missing notify signal for the QWindow::title property
Similary to QWidget's windowTitleChanged, QWindow should also have a
windowTitleChanges signal that's emitted when the title changed and declared
as notify signal for the title property, so that QML bindings can be written
against it.

Change-Id: I6f107c6f0b43d6a959bc2ef96492e1f3e4c28bfe
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-02-27 18:27:42 +01:00
Frederik Gladhorn
01a1f87368 Merge "Merge remote-tracking branch 'origin/release' into stable" into refs/staging/stable 2014-02-27 18:27:18 +01:00
Friedemann Kleint
81698e5484 Widgets: Pass on mouse event source when translating mouse events.
Change-Id: I70dacc2f96552e08dd71d5cbd63fb4cf9916c11f
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-02-27 13:28:41 +01:00