Commit Graph

18778 Commits

Author SHA1 Message Date
Friedemann Kleint
043529c9dc Windows QPA: Remove dependency on swprintf_s() pulled in via _com_error::ErrorMessage().
Task-number: QTBUG-35617
Change-Id: I0ad926ac564612ebd0eb38f16b3e69cbcd48e62f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-05-19 15:52:58 +02:00
Stephen Kelly
ac10baa2a0 CMake: Don't FATAL_ERROR if GL libraries can not be found.
For Windows builds, the necessary libraries are not found
in the sdk if the wrong environment is used, which is quite
common.

Task-number: QTBUG-34940
Change-Id: I7d844649790cbfacab3154a717d318fd570c4149
Reviewed-by: Brad King <brad.king@kitware.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2014-05-19 15:52:58 +02:00
Frederik Gladhorn
6ef8eee8d4 Fix potential null pointer access
Change-Id: I7516ce88b38609ab9851419566141ba93a59aed3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-05-19 15:52:58 +02:00
Jędrzej Nowacki
1d7902a0ca Fix crash in QNetworkAccessManager.
Recreating QCoreApplication could cause a crash in QNetworkAccessManager
constructor. That was caused by an invalid shutdown detection introduced
in f273d6fbc0.

Task-number: QTBUG-36897
Change-Id: Ib5bba773a2a4fcde690a3a93680aef551aae3a5b
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-05-19 15:52:58 +02:00
Louai Al-Khanji
828656241b Direct2D QPA: Use correct buffer size constant
Change-Id: I2d8ec5faed959d6d642242b3e26ee0f185ee3d53
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-05-19 15:52:58 +02:00
Louai Al-Khanji
58caefa13e Direct2D QPA: Stroke using direct2d primitives
Use native direct2d stroking instead of falling back to
QPaintEngineEx::stroke which in turn calls the pure virtual
QPaintEngineEx::fill which is reimplemented in QWindowsDirect2DPaintEngine.

In some cases like arc stroking this is significantly faster (up to 3x in
my measurements) and results in better visual quality.

Change-Id: I1c86ff772ba591432ff6550c7c59704ace4f0e0f
Reviewed-by: Risto Avila <risto.avila@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-05-19 15:52:58 +02:00
Louai Al-Khanji
35766fbe47 Direct2D QPA: Fix version check
It turns out that the version we were testing against was more recent than
basic Windows 7 SP1 + Platform Update. The direct2d version that
combination produces without any other updates is 6.2.9200.16492, and it
is sufficient for us.

Change-Id: Ib9840647371e2bb5c71bf74486348444ed4b4c19
Reviewed-by: Risto Avila <risto.avila@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-05-19 15:52:58 +02:00
Gatis Paeglis
ba28ca60f6 Fix compilation on libxcb 1.5
libxkbcommon-x11 uses xcb_discard_reply() function which was
introduced in libxcb 1.6, this brakes the compilation in
src/3rdparty/xkbcommon/src/x11/util.c when linking with libxcb 1.5 :

linking ../../../../plugins/platforms/libqxcb.so
.obj/util.o: In function `adopt_atoms':
util.c:(.text+0x347): undefined reference to `xcb_discard_reply'
collect2: error: ld returned 1 exit status

We can use an alternative approach to discard uncollected replies
and in addition add a fix for out-of-bounds error [1]

[1] e3f751be66

Task-number: QTBUG-38952
Change-Id: Ide90f9a2e75fc79d2bab0b81adb282c8cc81c345
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-05-19 15:52:58 +02:00
Laszlo Agocs
af16f88e97 egl cursor: The sampler is a uniform not an attribute
Change-Id: Ibae21653040f1d8dff2d2c0b7c1b2812d9e14551
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-05-19 12:51:33 +02:00
Bernd Weimer
43d4fecde5 Fix auto test failure output on QNX
On QNX mbstowcs does not ignore last parameter (max) when first (dest)
is NULL. Set it to sufficiently large value to yield proper results on
QNX. Other platforms (standard libraries) will ignore this value anyway.

Change-Id: Ie4695254d45082e151a052bf16de684af3b1ba1e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-19 10:03:38 +02:00
Dyami Caliri
71006cf04c CoreWLan: wait for scan thread to finish
If the scan thread is running when QCoreWlanEngine is destroyed
it will access stale data and cause a crash.

Task-number: QTBUG-36000
Change-Id: I8cc9e39a3f7d4736da39e8b31f6963db35318f19
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-05-18 18:29:35 +02:00
Friedemann Kleint
6c5645578a Remove friends of QEvent.
Introduce function to set the spontaneous flag to
QCoreApplicationPrivate to solve a few cases.

Change-Id: I7c1f1f3644defe00deea9cecb244ca258afd5b94
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-18 13:53:15 +02:00
Thiago Macieira
bf3e80023a Stop using setSharable in the Java-style mutable iterators
First and foremost, the STL-style iterators don't do this. Those don't
provide a guarantee that the container won't get shared again while the
iterator is active.

Second, there's no protection against a second mutable iterator being
created and resetting the sharable flag back to true.

[ChangeLog][Important behavior changes] The mutable Java-style iterators
like QListMutableIterator and QHashMutableIterator no longer set the
parent container to unsharable mode. If you create a copy of the
container being iterated on after the iterator, any changes done with
the iterator might affect the copy too.

Discussed-on: http://lists.qt-project.org/pipermail/development/2014-February/015724.html
Change-Id: Iccfe411d5558c85ae459cff944215614c392388e
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-05-18 02:08:13 +02:00
David Faure
1aede2d7fc QPainter on QBitmap: make setBrush(NoBrush) work as expected.
It had no effect because of an explicit check for NoBrush.
However the default in QBitmap is (unfortunately) QBrush(color0), rather
than NoBrush, so the brush must be updated when calling setBrush(NoBrush).

I suppose the real issue is that lastBrush is default-constructed in
QRasterPaintEngine, rather than starting with the brush from QPainter,
which is QBrush(color0) for the case of the bitmap. But no reason to
special case NoBrush here anyway.

Task-Number: QTBUG-38781
Change-Id: I9996ac12bf628920cfaf0de9c886f637a336028b
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-05-17 08:59:08 +02:00
Jake Petroules
518d874bc8 QMacStyle: Always draw status bar in active state if the window is main.
On OS X, most controls are drawn active or inactive based on their
window's main state, NOT its key ("active" in Qt) state.

Change-Id: If447d0a537bc594978f7202e7888ceacb54ec8fa
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-05-17 02:07:36 +02:00
Konstantin Ritt
4689a9b3f0 Minor optimization for QTextLineItemIterator
Don't store unused values (pos_x and levels) and re-use
already calculated ones (itemStart, itemEnd, and itemLength).
Also const-ify some members to make the code a bit more clear.

Change-Id: Ied80ebf9e4e7e8a1d057e413a9bd24f84b8aaf92
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-05-16 21:42:45 +02:00
Gunnar Sletta
cfcbb957c7 Call tzset() before localtime_r() as the docs say.
Without it, one might run the risk of QDateTime::currentDateTime()
returning an invalid QDateTime the first time after changing timezone.

Change-Id: I3efb04d41e7fe4685f6cc5fb41b68424eb4b9eb8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-16 19:20:01 +02:00
Konstantin Ritt
7952cf7e27 Ensure we don't re-use webfonts where the "local" font has been requested
For webfonts, we can't rely on the fontDef (and hence the cache Key) alone,
since the resulting fontcache key might be strictly identical.
Instead we have to check if the cached engine doesn't belong to a webfont
when we're looking for a "local" font.

Change-Id: I2de11c8fdbef53362b66674d3429a042e1835757
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
2014-05-16 18:24:14 +02:00
Jędrzej Nowacki
39efc7c3e3 Optimize QVector::mid
Change-Id: Iff7d9ec85a095c6712e6045e7708bb88eac629e1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-05-16 18:24:14 +02:00
Friedemann Kleint
7c17b0ad2b Remove friend class QETWidget.
The class no longer exists in Qt 5.

Change-Id: Icd98c151f8e06910a3240d0bec6fff333a8ef3e3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-05-16 15:36:44 +02:00
Jorgen Lind
102cec7ec0 QOpenGLTextureBlitter fix allocating 4 times as much memory as needed
and copying a lot of garbage.

Change-Id: Idf1d23d06423a98ce503c9bcf9614b12dd1fb92a
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-05-16 14:39:00 +02:00
Frederik Gladhorn
1248eddd14 Accessibility Android: Fix states
Using the bit flags as parameters to the JNI functions would fail since
they'd always be cast to false instead of the c-style casts.

This fixes checkboxes reporting themselves as checkable and their check
state.

Task-number: QTBUG-38831
Change-Id: I30ab63ceabbec4cc2fbda9475e05523d915087fe
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-05-16 14:28:30 +02:00
Frederik Gladhorn
679cd99f3d Accessibility: Update ComboBox text on arrow keys
Use ValueChanged to notify of changes in the ComboBox.
On Linux we need to update name and then send selection-changed for
Orca.

Task-number: QTBUG-36814
Change-Id: Icdd34adddeac532476a6dd910d1e8bd33bcd590b
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-05-16 14:28:11 +02:00
Frederik Gladhorn
94f9c9678a Merge "Merge remote-tracking branch 'origin/release' into stable" into refs/staging/stable 2014-05-16 14:14:25 +02:00
Richard Moe Gustavsen
986309cbf0 cocoa: remove rtf converter from cocoa
There is now a modified rtf converter in qmacmime
that can also write rtf back to the pasteboard, and
that works on both OS X and iOS.
So we can therefore remove the one from the cocoa port.

Change-Id: Ieed04502752290d2f139f98cec69477ff1edbe4e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-05-16 14:10:36 +02:00
Richard Moe Gustavsen
6388163df8 qmacmime: rename and move QMacPasteboardMimePlainText to the cocoa plugin
com.apple.traditional-mac-plain-text is not in use on iOS
according to Apples UTType reference. So we enable it only
for OS X by moving it into the cocoa port.

The order in which we instanciate convertors matters when
the application is reading data from the pasteboard.
But since QMacPasteboardMimePlainText should come before the
other "text/plain" convertors on OS X, moving it to the cocoa
port is safe as those convertors are instanciated after
those in qmacmime.

Change-Id: I76b9b14e5ce78f34e0f1ecbfee71e48a27a4687b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-05-16 14:10:32 +02:00
Richard Moe Gustavsen
514697893f qmacmime: add support for public.rtf
Application like Safari on iOS posts rtf to the
pasteboard when copying html. With this converter added, you
can then paste rtf as html into Qt

Change-Id: I6b62bcc9cfc0b16a47d44bd8d74062226522526d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-05-16 14:10:24 +02:00
Bernd Weimer
fa3d264b0b QNX: Fix tst_selftest
GRAPHICS_ROOT and TZ environment variables are needed in child
processes in order to successfully run the auto test selftests.

Change-Id: I7befabd535b4c47b1e75acbe3d6158d0d9b811b3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-05-16 10:20:34 +02:00
Laszlo Agocs
72558e810d Avoid setting unnecessary parameters in QOpenGLWidget
QOpenGLFramebufferObject sets the texture parameters already, do
not set them again. Especially not GL_REPEAT, which is wrong and
breaks on devices that do not support REPEAT on NPOT textures.
What QOpenGLFramebufferObject does is just fine (it sets NEAREST/
NEAREST and CLAMP_TO_EDGE).

This is important for WebEngine where the QWidget-based web view
is using QOpenGLWidget.

Change-Id: I264d30118ce7adf50f68f2c7b9a5599a406b4362
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-05-16 10:04:06 +02:00
Sean Harmer
a295bb575f Expose multisample settings on QOpenGLTexture
Change-Id: I877f4139aed8bb03b798818a3fac00dab1523ce1
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-05-16 09:54:09 +02:00
Sean Harmer
ca15825ed4 Add viewport transform to QMatrix4x4
This allows to easily create a matrix that performs the transformation
used by OpenGL fixed function to go from normalized device coordinates
to window coordinates.

This comes in useful if you need to perform the NDC->window coordinate
conversion inside a shader.

Change-Id: I183b3545bfb3eb1e8b13fc3172911b46926fcbb7
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-05-16 09:53:58 +02:00
Jędrzej Nowacki
71fb3633e8 Unify all mid() functions in QtBase.
Up to now, Qt had at least 3 different implementations of the mid().
Only QString::mid implementation was not crashing on edge cases and
was protected against overflows, therefore I picked that one as the
base implementation, even if it has weird semantics for an invalid
input.

As a side effect QVector::mid was slightly optimized to not detach in
all cases (which follows current QList behavior). Documentation of
QVector::mid and QList::mid was updated to not mention "copy of data"
which could suggest that the mid() result is detached.

QStringRef::mid was fixed and now it follows general Qt behavior, by
returning a null value for a null input.

Change-Id: Ie9ff5d98372bd193d66508e6dd92b6ed1180ad9b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-16 09:51:38 +02:00
Tor Arne Vestbø
8f3a393e41 qpa: Merge qwidget_qpa.cpp into qwidget.cpp
Change-Id: I8424ec7290b366f4c76999a956fce1428fc56626
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-05-15 23:07:42 +02:00
Friedemann Kleint
b7275eee49 Remove unnecessary friend declarations from qevent.h.
Change-Id: Iec35b94f3898004850a076d4760d675248246ea7
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-05-15 22:58:56 +02:00
Friedemann Kleint
6a61a00ddb Windows: Use new clipboard API for listening to changes.
The currently used clipboard chain API has various problems with non-
responsive applications and requires checks for hung/debugged applications when
sending on notifications.

The new clipboard format listener API available from Windows Vista onwards
requires less code and does not have these problems, however the change
notifications now arrive asynchronously.

Change the tst_qclipboard  to be able to deal with asynchronous change
notifications.

Task-number: QTBUG-38670
Task-number: QTBUG-33492
Change-Id: I3c49e346a34310431c20f3051d12eaabf330a3ad
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-05-15 15:31:07 +02:00
Friedemann Kleint
f618dbdd04 Windows: Refactor cursor creation code.
Factor out a function creating bitmap cursors, streamline code.

Task-number: QTBUG-37862
Change-Id: Id9d4af34acb2cf15d8553d5e5a6390fae6014ff6
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-05-15 12:53:09 +02:00
Joerg Bornemann
e26ed09102 Revert "fix build for MSVC 2010"
The condition in WinUser.h is _WIN32_WINNT >= 0x0602.
The original #if was correct.

This reverts commit 42d162addf82aa2064600219b9b3224836f676ac

Change-Id: I7a3098ced143fba7b31b138cc7aaaf8f6920bef3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-05-15 12:41:45 +02:00
Alex Blasche
60d0b900d7 Force qdbusxml2cpp to use QStringLiteral rather than QLatin1String
Change-Id: I6db4c80a14466b51d73c2704e8fc2e2e8a8a6b02
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-15 10:08:59 +02:00
Friedemann Kleint
9b121e5579 Windows: Use WinAPI CommandLineToArgvW() to create argv from command line.
Split the Windows CE/Desktop Windows code paths in winmain.
Use CommandLineToArgvW() to obtain argv[] for Desktop Windows.

[ChangeLog][QtCore][Windows] Command line parsing on Windows
now uses the WinAPI function CommandLineToArgvW() to exactly
match the quoting of the command interpreter.

Task-number: QTBUG-35432
Task-number: QTBUG-23687
Change-Id: I6743e73649d953497642f7717d3731a83ffda2a2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-15 09:34:19 +02:00
J-P Nurmi
1a93c2df1d Disable compiler warnings for libqtharfbuzz-ng
This 3rdparty code produces a lot of warnings especially with clang.

Change-Id: I6f48410699e785d1b2e84b9a6d7b0ba8751179b0
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-15 09:18:20 +02:00
Tor Arne Vestbø
9dc254ad50 qpa: Merge qdesktopwidget_qpa.cpp into qdesktopwidget.cpp
Change-Id: I39316744b87d1fd588a99ab71edbd711ee8fae47
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-05-15 02:51:06 +02:00
Tor Arne Vestbø
768f59202d qpa: Merge qgl_qpa.cpp into qgl.cpp
Change-Id: I91cfd7daf7f1dd88659019ccc671ec0d9245067f
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-05-15 02:51:06 +02:00
Tor Arne Vestbø
a5ea74b98b qpa: Clean up and refactor qfontengine_qpa
QFontEngineQPA was really QFontEngineQPF2, and has been renamed. The
multi font engine in qfontengine_qpa.cpp was really a base implementation
of a multi font engine, used by other multi font engines, and has been
renamed and moved accordingly into qfontengine_p.h/cpp.

Change-Id: Iac7409c4dbf0fdc3ee993ce4f7dc96cb00a422e6
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-05-15 02:51:06 +02:00
Gunnar Sletta
cd910e9254 Don't crash when platform plugin sends us two close events.
Change-Id: Icfe2954908fad2abfb4195fc535aadd1e6302f76
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-05-15 02:51:06 +02:00
Giuseppe D'Angelo
1ae7c76b2a Do not build or link to PCRE if QRegularExpression is disabled
Per Oswald's suggestion, just don't touch PCRE if it's not needed.
This can save ~500kB between text and data in QtCore.

Change-Id: Ia10c819c7fff562dda84ab0b77194baffbc8904e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-05-15 02:51:06 +02:00
Giuseppe D'Angelo
4c14fa607f Fix QtTestlib build under QT_NO_REGULAREXPRESSION
Change-Id: I4458226e814641269062990f272a40ca577bc9db
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-15 02:51:06 +02:00
Giuseppe D'Angelo
77425eefec Make QColorDialog build under QT_NO_REGULAREXPRESSION
Since we can't set a validator on the HTML-color lineedit,
just make it readonly.

Change-Id: Ibeaacbea00867cdb6ef33b6667f7ee3539b7f929
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-15 02:51:06 +02:00
Frederik Gladhorn
2a9201c1e6 Fix error when reading newlines
Fix error 'operation priorities' identified by static analysis from
http://www.viva64.com/en/b/0251/

'!=' operator's priority is higher than that of the '='

Change-Id: I2668171acb506992e3a15b113682ac04ba309532
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-14 20:10:03 +02:00
Thiago Macieira
5b4c0da9d0 Move the hex digits out of _q_toHex
Avoids them being duplicated several times in QtCore

Change-Id: Idee0168ed9d452a572ad46e2a14d2d4d3c7d2f7e
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-05-14 20:10:03 +02:00
Jerome Pasion
8e5e9d7987 QDoc: Added "QML Type" to HTML titles of QML type pages.
-makes it more consistent with the C++ pages.
-easier to read for the search engines.

Change-Id: I172bdff04e0aa80ee58a903d112585992234d7d7
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2014-05-14 20:10:03 +02:00