Commit Graph

4832 Commits

Author SHA1 Message Date
Thiago Macieira
1d111091b5 Make QTextStream use group separators in floating-point numbers
Like for integers, this is activated only on QLocales other than C.

[ChangeLog][QtCore][QTextStream] QTextStream now uses group separators
when writing floating-point numbers when the locale is not the C locale.
The old behavior can be restored by setting QLocale::OmitGroupSeparator
on the locale.

Change-Id: Ie451b91017746c3a9b11b6211b2ddd09cd295cd2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2014-07-05 19:06:14 +02:00
Allan Sandfeld Jensen
8a031696a1 Make QOpenGLTextureCache::bindTexture upload efficiently
Currently QOpenGLTextureCache::bindTexture always convert any uploaded
image to RGBA8888 before uploading. This is quite inefficient when
OpenGL natively supports uploading formats in the original format.

This patch adds support for uploading a few native QImage formats. This
also get the performance of QOpenGLTextureCache::bindTexture on par with
QGLContext::bindTexture.

The texture brush used by QOpenGLPaintEngine is also converted to QImage,
since bindTexture will convert it to QImage anyway, and going over QPixmap
may cause an unnecessary conversion.

[ChangeLog][QtGui][QOpenGLTextureCache] Support uploading common QImage
formats directly to OpenGL when supported.

Change-Id: I828a763126441a98e4547c32ef52dddf7c129a32
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-07-04 16:09:27 +02:00
Frederik Gladhorn
14a80bd4df Merge "Merge remote-tracking branch 'origin/5.3' into dev" into refs/staging/dev 2014-07-04 18:46:06 +02:00
Allan Sandfeld Jensen
3acd4b546d QImage support for RGB30 formats
Adds basic support for 10-bit per color channel formats to QImage
and the XCB plugin. This will make it possible to paint to and from
these formats, but only at 8-bit per color channel accuracy.

This also fixes Qt5 applications on X11 with native 30bit depth.

[ChangeLog][QtGui][QImage] Added support for 10-bit per color channel image formats.

Task-number: QTBUG-25998
Change-Id: I93ccd3c74bfbb0bd94b352476e5fe58a94119e1f
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-07-04 14:03:46 +02:00
Frederik Gladhorn
f01c5cdb8d Update copyright to 2014 for accessibility
Change-Id: I4210456122bf8a6d3730f017f3ce6dd1a1bcb3f5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-07-04 08:59:21 +02:00
Frederik Gladhorn
01f1e10695 Accessibility Linux: Implement set focus action
This is used by Orca for geometric navigation (aka flat review) to move
the focus around. It is also generally sensible to be able to
programatically move the focus around. This way of moving the focus
is redundant with the action interface's focus action.

Task-number: QTBUG-40048
Change-Id: I1b61ea843f6bfc3dc00007772e0e5102555ca752
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-07-04 08:58:42 +02:00
Jędrzej Nowacki
9c79f6dfb3 Add initializer list support in QJsonArray
It allows to create a QJsonArray instance in C++ by using
a similar expression to JSON. For example:

QJsonArray a = {1, 2, 4};

[ChangeLog][QtCore][QtJson] QJsonArray now supports
C++11 initializer lists.

Task-number: QTBUG-26606
Change-Id: Icc352e518d9649d24176c89e7113d200d5c50b0d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-07-04 08:24:05 +02:00
Frederik Gladhorn
39a290af6c Merge remote-tracking branch 'origin/5.3' into dev
Conflicts:
	src/gui/accessible/qaccessiblecache_mac.mm
	src/gui/accessible/qaccessiblecache_p.h
	src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h
	src/plugins/platforms/cocoa/qcocoawindow.h
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/widgets/kernel/qwidget_qpa.cpp

Manually moved change in qwidget_qpa.cpp to qwidget.cpp
    (cd07830e3b)

Change-Id: Ia51f471f9b53de2f3b07d77ea89db9303ac8961d
2014-07-03 23:56:45 +02:00
Friedemann Kleint
9150563940 Windows clipboard: Deny CF_DIB support for images with alpha.
Support CF_DIBV5 for these images so that transparency is preserved.

Task-number: QTBUG-11463
Change-Id: I51881ae8bfbd05b92abd309766f4da9a7ea26c2d
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-07-03 22:43:17 +02:00
João Abecasis
7021188778 Add tests for assignment operator
Change-Id: I3265cb75c4d785faaf1efc183d8c1293dfff9165
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-07-03 10:42:45 +02:00
Friedemann Kleint
0831cb26f4 Ensure that QTemporaryFile clears all file mappings.
Factor out code to clear all mappings into
QFSFileEnginePrivate::unmapAll() and call that
from QTemporaryFile.

Task-number: QTBUG-39976
Change-Id: Ic1ceeba0ba4451866f1081fee430e5c458c0819d
Reviewed-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-07-03 06:34:51 +02:00
Aleix Pol
5f50416620 Make it possible to know when a screen is being removed
So far, we had to listen to the QObject::destroyed signal from the QScreen
class to figure out whether a screen was removed. Often, this is already
too late, given that most of the QWindows have been moved by then and we
don't get to react before the windows are being set to the primary screen.

This patch introduces a new signal that will notify about a screen removal
before the screen is started to be destroyed, so that the application gets
to decide what to do with the screens before Qt decides to move things around.

[ChangeLog][QtGui][QGuiApplication] Added QGuiApplication::screenRemoved
signal to inform that a screen has been removed, before Qt reacts to it.

Change-Id: I99304179f4d345cae581a87baac6cff7b8773dea
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-07-02 23:14:19 +02:00
Laszlo Agocs
0541516907 Use the standard functions in GLES3 builds in VAOs
There is no guarantee that the OES extension is present and the standard
functions are not required to be dynamically resolvable on ES.

By performing the ARB-style lookup for the suffixless function names we
can also support ES3 compatible contexts on desktop GL.

This also fixes the problem of picking up the APPLE extension functions
instead of ARB when both are available. vaoFuncsType was set to ARB correctly
but the helper has to take the preference of ARB into account too.

Task-number: QTBUG-38168
Change-Id: If7402320e8f96891017674f3c43bc57c4b5d29f3
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2014-07-02 19:53:20 +02:00
Adam Majer
c714695304 Add support for initializer_list construction in QFlags
[ChangeLog][QtCore][QFlags] Added initializer_list constructor

Task-number: QTBUG-39786
Change-Id: I36967c67b489c2a893fb031954f46f5243aba2c4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-07-02 14:49:45 +02:00
Morten Johan Sørvig
b942cf0f3b Make tst_QLocale::macDefaultLocale() more robust
The assumption that we can test "en_US" and expect
it to behave a certain way is flawed in that most
of the formatting settings are independently
configurable by the end user.

Make the test more robust while attempting to preserve
as much testing as possible:

Make the decimalPoint/groupSeparator tests check for
a range of possible values. Check that they are not
the same.

Remove the date formatting tests and the firstDayOfWeek()
== Sunday test.

Make the time zone test accept a non zero extended
time zone. ("GMT+2" in addition to "GMT+02".)

Change-Id: Ie1f89793eb785f526c5f6fafbb6726ef8c6cb016
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-07-02 12:55:47 +02:00
Bernd Weimer
8377384e3a Fix some tst_qwidget test cases
Fixed qwidget test cases for platforms that show windows full screen by
default and that don't support WindowMasks. Incorporated QNX/BlackBerry
peculiarities.

Change-Id: I349ecab5cef35c7d9751aa547465f685d620164a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
2014-07-02 10:29:44 +02:00
Morten Johan Sørvig
ddeb907442 Skip unstable autotests in QtBase.
The combination of these unstable tests makes it very
hard to get changes through the CI system due to the
unrelated test failures.

Skip the following test functions:
tst_QIODevice::unget QTBUG-39983 (Mac)
tst_QThreadPool:expiryTimeoutRace QTBUG-3786 (Windows)
tst_QLocalSocket::processConnection QTBUG-39986 (Mac)
tst_QTcpServer::adressReusable QTBUG-39985 (Linux)

Change-Id: I96559bea0d437fd25966b6ccac1ece1490e06241
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-07-02 09:28:34 +02:00
J-P Nurmi
82d906a20d QGuiApplication::paletteChanged(const QPalette &palette) [signal]
This allows QQuickSystemPalette to listen to palette changes without
installing an expensive event filter on the application object.

Change-Id: I8b693e047d993c444e393d7a714a5709692c3560
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2014-07-02 00:44:18 +02:00
David Faure
9ee27005ee qDebug: fix data race in qt_message_print
The setting of (static) messageHandler to qDefaultMessageHandler if null
was happening in multiple threads simultaneously, so it needs synchronization.

Used an atomic pointer in case qInstallMessageHandler is called from a thread,
but more importantly, initialized the static vars right away.

Improve auto test to ensure that qInstallMessageHandler(0) still sets the
default message handler.

Change-Id: I70335af38c1d28a1cdba1df8a79c6006f227422e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-07-01 20:23:31 +02:00
Frederik Gladhorn
e6a94778d0 Merge "Merge remote-tracking branch 'origin/5.3' into dev" into refs/staging/dev 2014-07-01 18:41:14 +02:00
Frederik Gladhorn
a09a8d509a Merge remote-tracking branch 'origin/5.3' into dev
Conflicts:
	mkspecs/qnx-x86-qcc/qplatformdefs.h
	src/corelib/global/qglobal.h
	src/network/socket/qnativesocketengine_winrt.cpp
	src/plugins/platforms/android/androidjniaccessibility.cpp
	src/plugins/platforms/windows/qwindowswindow.cpp

Manually adjusted:
	mkspecs/qnx-armle-v7-qcc/qplatformdefs.h
	to include 9ce697f2d5

Thanks goes to Sergio for the qnx mkspecs adjustments.

Change-Id: I53b1fd6bc5bc884e5ee2c2b84975f58171a1cb8e
2014-07-01 16:25:19 +02:00
Frederik Gladhorn
2e038d681c Accessibility: Password QLineEdit should use * as text replacement
Change-Id: Ie07e86f1b6dff3096cab462f918994efa07b2a87
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2014-07-01 08:27:16 +02:00
Friedemann Kleint
813462a0ce tst_qcollator: Exclude failing test cases for non-ICU/Windows.
Change-Id: I17912ddb34337216805259dab9d90eb2c9ac64cc
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-06-30 15:02:06 +02:00
Eskil Abrahamsen Blomfeldt
8638895f6b Android: Fix compilation of qtcpsocket test
No pthread_yield() in the Android NDK.

Change-Id: I5ff77c55f30c172ee7fefb1129bdf475b318449e
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-06-30 11:40:24 +02:00
Eskil Abrahamsen Blomfeldt
190bb186ae Android: Fix compilation of qhostaddress test
The sockaddr_in struct is defined in netinet/in.h header.

Change-Id: I67a3421094c96a5e948968a26723ec8c21f85c93
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-06-30 08:59:45 +02:00
Eskil Abrahamsen Blomfeldt
a57f3ee9bb Android: Fix compilation of qpluginloader test
The almostplugin has an unresolved symbol, and on Android
we compile with -no-undefined.

Change-Id: Ia631193890dfe8e7ac8e58087475164222d876fc
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-06-30 08:59:35 +02:00
Roman Pasechnik
90a68926f3 Add QEnableSharedFromThis class
It enables you to get a valid QSharedPointer instance to 'this',
when all you have is 'this'.

Task-number: QTBUG-7287
Change-Id: I3ed1c9c4d6b110fe02302312cc3c4a75e9d95a0c
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-06-29 23:20:10 +02:00
Friedemann Kleint
40f5a4d5f8 Windows: Fix setting of geometries in minimized state.
Use SetWindowPlacement() to set the normal position when applicable
as is done in Qt 4.

Task-number: QTBUG-39544
Change-Id: Ia158b968ea15361d9937619f07b56eb8a0312a13
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-06-27 11:29:44 +02:00
Takumi Asaki
71c6fdf871 Introduce qUtf8Printable() macro to qglobal.h
This macro is equivalent to arg.toUtf8().constData().
It is usable for "%s" arguments of qDebug(), qWarning(), qFatal(),
qCritical().

Change-Id: I2d9956e6651271e1e2183dce9c835511cf923bf3
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-06-27 08:28:50 +02:00
Thiago Macieira
eab7ec586d Expand the compiler test with C++11 and C++14 compiler tests
This allows us to quickly test if a compiler actually supports what it
claims to support.

Change-Id: Ia32212a11774aa7947ddffae30837c53665374f3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-06-27 08:27:03 +02:00
Frederik Gladhorn
a58ec950f0 Accessibility: improve text attribute ranges
Improve consistency and use QTextDocument functions to find ranges
instead of coming up with our own scheme. This is important since
QCursor's char format depends on block positions.

Change-Id: I94eb137882dc6b5f7b01fa7693b4a536cc48d02a
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
2014-06-26 17:37:08 +02:00
Jorgen Lind
c750d8408e Fix crash when inserting the same instance widget more than once
Task-number: QTBUG-39324
Change-Id: Ib1e0e107cd411311344aa5d85c3ca4c34211448b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-06-26 10:17:36 +02:00
BogDan Vatra
6302d6eef7 Export QStateMachine running property.
It is needed to control a QStateMachine object from QML.

Change-Id: I19271d97718af2d688c477647d6341f70fdef3ea
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2014-06-26 09:32:15 +02:00
Allan Sandfeld Jensen
b6ba4ac00d Unduplicate the implementations of next power of two
Qtbase contains four identical implementations of next power of two,
these should be shared and the implementation made available to other
qt modules, as it is also used many places outside of qtbase.

[ChangeLog][QtCore][QtMath] Introduced qNextPowerOfTwo methods.

Change-Id: Id23fbe5ad6bae647b30d5a4212c0330e48a50278
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-06-26 00:47:51 +02:00
Allan Sandfeld Jensen
a1fc11ca65 Introduce std::string conversion to QByteArray
Add conversion methods similar to those in QString to QByteArray. This
is often more useful than the QString version since std::string like
QByteArray are byte arrays.

[ChangeLog][QtCore][QByteArray] Added convenience methods to convert
directly to and from std::string.

Change-Id: I92c29d4bb1d9e06a667dd9cdd936970e2d272006
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-06-25 16:51:53 +02:00
Andrew Knight
b46e48f1b7 winrt: Use native threading
Instead of using std::thread, use the WinRT ThreadPool to manage
threads. This allows for setting the scheduling priority, and provides
a path to enable XAML integration (which requires Qt run on a background
thread).

QThread::terminate() is still unsupported, and only the winmain thread
can be adopted due to the behavior of the thread pool when creating
tasks from the GUI thread. The associated tests are now skipped, and
all other QThread tests pass.

Task-number: QTBUG-31397
Change-Id: Ib512a328412e1dffecdc836bc39de3ccd37afa13
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-06-25 16:34:39 +02:00
Friedemann Kleint
4696e9dbaa QAbstractProxyModel: Forward drop-related API.
Forward canDropMimeData() and dropMimeData() to the source model.

[ChangeLog][QtCore][QAbstractProxyModel] QAbstractProxyModel now
forwards the drop-related API.

Task-number: QTBUG-39549
Change-Id: Ib81fcec862586e4ecfb99b9e0f4eb1a16eace762
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2014-06-25 16:31:03 +02:00
J-P Nurmi
b69d537d7f QGuiApplication::layoutDirectionChanged(Qt::LayoutDirection) [signal]
This allows QQuickApplication to listen to layout direction changes
without installing an expensive event filter on the application object.

Change-Id: I2d7d8906acecbc092657c4bd918bbdc9aad9744c
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-06-25 12:37:13 +02:00
Alex Trotsenko
7cc893b216 Fix QRingBuffer::readPointerAtPosition()
Fix condition to allow return a valid pointer when head != 0.

Change-Id: I5215f7dfc44924016c2d9b67ab2d9935b5164d7a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-06-24 18:48:33 +02:00
Peter Hartmann
100ed2e91e network internals: do not try to cache a deleted entry
We were keeping a dangling pointer to a non-existent QIODevice around
which would lead to a crash.

Task-number: QTBUG-17400
Change-Id: Ie374cbb94bb45c9b0fbef46287b3317f60154123
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-06-24 15:07:03 +02:00
Laszlo Agocs
a5f3df04af Simplify mirroring code and add tests for non-aliged 1 bit images
Change-Id: I309714bc52de87c702194a4a82803d383f6ac3b3
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-06-23 17:12:13 +02:00
Mitch Curtis
ffdba0459b Correct grammar of missing Q_OBJECT macro warning.
Change-Id: Ifb84220285e38ce6940595035ca9fe012c350b79
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-06-23 11:19:07 +02:00
Friedemann Kleint
37312d2950 tst_qicon: Resolve all files using QFINDTESTDATA().
The local files in availableSizes() were not resolved.
Introduce member variables for the file names, resolve them
in the constructor and add initTestCase() to verify.

Task-number: QTBUG-39287
Change-Id: If841e904700fe76b6c9265124ccba7764911fdc9
Reviewed-by: aavit <eirik.aavitsland@digia.com>
2014-06-22 09:41:06 +02:00
David Faure
884b381576 Fix data race on QLoggingCategory when using qDebug from multiple threads
setEnabled() would race with isEnabled()/isDebugEnabled()/etc.

Change-Id: I2004cba81d5417a634b97f5c2f98d3a4ab71770d
Reviewed-by: David Faure <david.faure@kdab.com>
2014-06-20 21:54:04 +02:00
Mitch Curtis
daa56f1b4e Suggest candidates when non-existent method passed to invokeMethod().
QMetaObject::invokeMethod: No such method Object::someMethod(SomeType)

becomes:

QMetaObject::invokeMethod: No such method Object::someMethod(SomeType)
Candidates are:
    someMethod(SomeOtherType)
    someMethod(YetAnotherType)

Change-Id: I3566bca64423e2f8150d0d544fb4e35a5262b19e
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-06-20 21:51:51 +02:00
Frederik Gladhorn
f3e86a8cc8 Accessibility Linux: Fix methods returning rects as iiii for AT-SPI
According to the spec rects get returned with iiii but we were directly
serializing QRect resulting in (iiii) as signature.
This would trip up Orca when trying to use flat review in text edits.

Task-number: QTBUG-39702
Change-Id: I8d6769688586e678d27cc4341de5176a91f057fc
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-06-20 17:45:25 +02:00
Allan Sandfeld Jensen
70dd563046 Correct QImage::fill(uint) on RGBA8888 formats
QImage::fill(uint) was incorrectly performing ARGB->RGBA conversion when
called on RGBA8888 formated images.

This patch moves the color conversion to QImage::fill(QColor) where it
belongs so that fill(uint) can behave consistent with documentation and
how it treats other formats.

The fill(uint) method had no automated tests, and this patch adds one.

[ChangeLog][QtGui][QImage] QImage::fill(uint) now fills the given pixel
value unconverted when used on RGBA8888 image, making it consistent with
the documentation and treatment of all other image formats.

Change-Id: I00a9d810c61d350dbdd7c4b9ad09e5ce11896b6d
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-06-20 16:08:28 +02:00
Andy Shaw
47b3ecf3f4 Remove the widget from the stylesheet cache before polishing
If the widget exists in the style rules cache before it polishes for the
first time then it should be removed from styleSheetCache too so that the
latest set stylesheet is used for the polishing.

Task-number: QTBUG-39427
Change-Id: Ic1e7988afe530f16ea9996bae56543ed554d6be9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-06-20 07:10:21 +02:00
Friedemann Kleint
3fd184b663 Use QModelIndex to get the data from underlying model
Change-Id: Ibeb70079afd566c78289168540296b926f36d1af
Initial-patch-by: Irfan Omair <irfan.omair@gmail.com>
Task-number: QTBUG-27597
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2014-06-19 17:23:30 +02:00
Stephen Kelly
4e7baaaa91 Metatype: Specialize IteratorOwner for vector<bool>
Change-Id: I542af3a77b0a139e137a5a736b74042a8c25eb95
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-06-16 07:44:02 +02:00