Commit Graph

4863 Commits

Author SHA1 Message Date
Jędrzej Nowacki
c587e5a4da Improve QString::arg test
The function gives a warning if an argument doesn't exist.

Change-Id: I6a4bbbaf2fd241ced06dc71edfe4ef69732606d1
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2014-07-10 13:14:51 +02:00
Jędrzej Nowacki
3746eedeab Update QVariant tests
Remove old message handler hack as we have a new and better api to
ignore warning messages.

Change-Id: Id967b2672fe3e3638db9977500118a19c2afb730
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-07-10 13:14:40 +02:00
Frederik Gladhorn
776ddcab2c Merge "Merge remote-tracking branch 'origin/5.3' into dev" into refs/staging/dev 2014-07-10 13:13:55 +02:00
Frederik Gladhorn
f035786021 Merge remote-tracking branch 'origin/5.3' into dev
Change-Id: Ia12ffdb27ecdf25c2a2bdb0eed1945387502108a
2014-07-10 10:11:11 +02:00
Eskil Abrahamsen Blomfeldt
1dd9a0af4f Fix fallbacks for adapted common script
When the platform plugin gives us specific fallbacks for a
specific script, we need to respect this, and load the correct
font family regardless of which writing systems it supports.

This is especially important since the common script is adapted
to match surrounding, proper scripts, so characters such as
digits next to e.g. Hebrew text will be marked as Hebrew. On
stock Android, there is a single Hebrew font, and this would
previously be put in all fallback slots for Hebrew regardless of
what fallback fonts were dictated by the platform plugin. Since
this font does not support the digits, they would show up as boxes.

[ChangeLog][Android] Fixed common characters like digits and
punctuation showing as boxes when positioned next to non-latin
scripts.

Task-number: QTBUG-39377
Change-Id: I1555e208a8ddc587c0bbdbfff1600cafdd9442e9
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-07-10 10:01:49 +02:00
Kai Koehne
6d166c8822 Add QDebug::noquote() stream modifier
Allow the user to disable the quoting of QString, QByteArray,
QStringLiteral by passing a "noquote()" stream modifier.

This requires another flag to be added to QDebug::Stream. To
keep BC we're using the QMessageLogContext::version field
to differentiate between QDebug streams created by earlier
versions.

Task-number: QTBUG-37146
Change-Id: I9b215eabfcfd754af16ea87f3ef928d698e37d77
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-07-10 09:27:44 +02:00
Ivan Komissarov
84c5e4866f Added autoHide property to QTabBar
This property is used to automatically hide tab bar if it has only one
tab.

Originally-by: Denis Kovalskiy <denimnumber1@gmail.com>
Change-Id: I6967f760010fa55bad6a5986c29abe7ccf625cf8
Reviewed-by: David Faure <david.faure@kdab.com>
2014-07-10 08:29:10 +02:00
Friedemann Kleint
72024fd50c Reduce repetitive invocations of QFINDTESTDATA.
Store the file names in variables instead.

Task-number: QTBUG-38890
Change-Id: I65f28bb62674f14aa099e935a9d7a4e9e6e90ba9
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-07-10 07:07:30 +02:00
Peter Hartmann
916c9d469b QSslCertificate: blacklist NIC certificates from India
Those intermediate certificates were used to issue "unauthorized"
certificates according to
http://googleonlinesecurity.blogspot.de/2014/07/maintaining-digital-certificate-security.html
, and are by default trusted on Windows, so to be safe we blacklist
them here.

Change-Id: I9891c5bee2dd82c22eb0f45e9b04abd25efeb596
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-07-09 21:30:11 +02:00
Friedemann Kleint
cdf9aed630 tst_qdir: Move QFINDTESTDATA() from init() to constructor.
Check result in initTestData().

Previously, QFINDTESTDATA() was repeatedly invoked in init(). The
data-driven cd() test then failed when invoked stand-alone since
cd_data(), which relies on the data path, is executed before init().

Task-number: QTBUG-40067
Change-Id: I91039247e8dcaedd92fa990f1b5f82bc54b17c60
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-07-09 10:59:42 +02:00
Eskil Abrahamsen Blomfeldt
b56a42be14 REG: Fix nbsp in QTextLayout
At some point since Qt 4.8, the nbsp character has acquired
the whitespace attribute, causing it to be treated exactly
like an ordinary space. To account for this, we add an extra
check in the layout code to avoid breaking on non-breaking
spaces even if they have the whiteSpace flag set.

This is a temporary fix for the regression. The line breaking
algorithm needs to be refactored and support Unicode tr14
properly, which it currently doesn't.

[ChangeLog][Text] Fixed lines breaking on non-breaking spaces.

Task-number: QTBUG-39832
Change-Id: Ibd7e1a11ce4b82c611ecda1542c8638a67bf3cae
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-07-08 08:35:02 +02:00
Laszlo Agocs
e7056a8969 Add context adoption support for WGL
This is trickier than the GLX and EGL implementations due to the
way pixel formats, windows and contexts work. Apart from some
restrictions, it should be fully functional nonetheless.

Add also some proper documentation.

Change-Id: Ia6e3eb1ab2701e439b8621b9092c2b0934ff2151
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-07-07 12:55:16 +02:00
Olivier Goffart
d49f7168ab QObject: don't hold mutex when copying arguments in a QueuedConnection
QMetaType::create can call user code and we should not keep mutex held as
this may cause dead lock.

Make sure the tst_qobjectrace actually emit some signal so the test check
there is no race if the receiver object is destroyed while
the mutex is unlocked.

Task-number: QTBUG-39990
Change-Id: I56ca1ae7a11cd7b33c1a68727370972862e11c2f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-07-07 08:45:56 +02:00
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
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
Fabian Bumberger
e83c52a997 QNX: Fix QMdiWindow autotests
In "setOpaqueResizeAndMove" this patch makes sure that the content of a subwindow
actually fits into the window, otherwise the resize does not work properly.
The content is dpi dependent and thus the pixel size of it increases with the display
dpi value.
Furthermore when moving the QMdiSubwindow this patch makes sure that we actually grab
the window's header and not one of it's tool buttons (minimize, maximize, close).

Change-Id: I88314994957c5883f57c09c9240a3b83f1ee42ed
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
2014-06-25 14:43:13 +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
Sergio Ahumada
5721c0811a Merge remote-tracking branch 'origin/stable' into 5.3
Change-Id: Icd073d40ce10ab4733b997036815795dd3fbaac1
2014-06-14 18:11:52 +02:00
Friedemann Kleint
9c80a3be4b Revert "Suppress move/resize events if they are the result of call to move()/resize()."
This reverts commit a1c5198387.

The idea of detecting non-spontaneous events by comparing
against the widget's crect has problems when sequences
of programmatic resizes occur. In  addition, QWindowSystemInterface's
queueing of events is problematic for this.

Task-number: QTBUG-39611
Task-number: QTBUG-32590
Change-Id: I4674d8d5d5d432d938f7226b5790543335665c1f
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2014-06-13 13:32:45 +02:00
Holger Hans Peter Freyther
afbc2c75e3 json: Add defaultValue to QJsonValueRef toInt/toBool/toDouble/toString
Currently QJsonValue and QJsonValueRef behave differently in
regard to the default values leading to confusion compile errors
depending on which of the two types one is actually using. Before
this change it was possible to write:

QJsonValue value = jsonObject["item"];
QString name = value.toString(QStringLiteral("default"));

but not:

QString name = jsonObject["item"].toString(QStringLiteral("default"));

Change-Id: Id1185acf339aa3a91e97848e85d068f84552df71
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-06-13 12:58:38 +02:00
Thiago Macieira
3ccfc351fd QProcess: Handle spurious socket notifications for stdout and stderr
On Unix systems where the GUI event dispatcher uses a notification
system for socket notifiers that is out of band compared to select(),
it's possible for the QSocketNotifier to activate after the pipe has
been read from. When that happened, the ioctl(2) call with FIONREAD
might return 0 bytes available, which we interpreted to mean EOF.

Instead of doing that, always try to read at least one byte and examine
the returned byte count from read(2). If it returns 0, that's a real
EOF; if it returns -1 EWOULDBLOCK, we simply ignore the situation.

That's the case on OS X: the Cocoa event dispatcher uses CFSocket to get
notifications and those use kevent (and, apparently, an auxiliary
thread) instead of an in-thread select() or poll(). That means the event
loop would activate the QSocketNotifier even though there is nothing to
be read.

Task-number: QTBUG-39488
Change-Id: I1a58b5b1db7a47034fb36a78a005ebff96290efb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-06-12 17:54:11 +02:00
Lars Knoll
81ba16cad9 Fix case insensitive comparisons using QCollator
In ICU the strength parameter decides whether a comparison is
case sensitive or not.

Fix mac comparison code. It can't have worked before.

Added some basic automated testing for QCollator.

Change-Id: I2646c464fd22ccd3a93c461fa3dba4bd1d4c7b4b
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-06-12 10:26:07 +02:00
Sergio Ahumada
490e79e39e Merge "Merge remote-tracking branch 'origin/stable' into 5.3" into refs/staging/5.3 2014-06-11 23:06:01 +02:00
David Faure
a6d7e09e89 QWidget: fix documentation for isEnabledTo(0)
It is NOT always the same as isEnabled().
Added a unittest to prove it.

Change-Id: I7717126835923e8c091249bfcdf81767c44fb5f7
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2014-06-11 23:06:01 +02:00
David Faure
11aaff3a57 Add missing detach() in QPixmap::convertFromImage()
Task-number: QTBUG-18519
Change-Id: I5d929cf6eda3f34130314edac95487fb00a95db5
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-06-11 23:06:01 +02:00
David Faure
ebe4aaadb2 tst_qtcpsocket: fix comment, the slot goes to 512
Change-Id: Ia0c5b29d6e02c9fda0b1da4a2779f1cbe9b1d747
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-06-09 10:39:44 +02:00
J-P Nurmi
d9a7ad80f7 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2014-06-07 00:40:44 +02:00
Morten Johan Sørvig
7eba6d039d Cocoa: Re-implement QCocoaScreen::topLevelAt()
The previous implementation used [NSApp orderedWindows]
which does not return NSPanel subclasses, which is
used by Qt dialogs and pops.

Use [NSWidow windowNumberAtPoint:belowWindowWithWindowNumber]
instead, which hit-tests on all window types. This
can potentially include windows from other processes
and non-Qt windows which needs to be filtered out.

Add EXPECT_FAIL to tst_MacGui::nonModalOrder. The
correct topLevelAt() implementation now exposes that
this test is failing.

Task-number: QTBUG-39322
Change-Id: I81afa3da964e08fe682802220d8fe81e9284205e
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-06-06 23:39:12 +02:00
Mitch Curtis
a18e3a3cef Fix key navigation through cells with spans in QTableView.
When navigating with the directional keys or tab/backtab, there are
certain situations where the cell that is edited is incorrect.
For example, consider the table below.

 '^' represents the starting cell and the direction of navigation.
 'c' represents the index that is arrived at as the currentIndex prior to this patch as
reported by view.selectionModel()->currentIndex().
 'x' is the cell that should be edited:

+---+---+---+---+
|   |   | e |   |
+---+---+---+---+
|   | x     |   |
+---+       +---+
|   |     c |   |
+---+---+---+---+
|   |   | ^ |   |
+---+---+---+---+

Before this patch, the cell that will actually be edited is c, rather
than x, so after editing the cell and pressing enter, the previous
contents of the cell will still be shown.

With this patch, currentIndex() will be changed after every call to
cursorMove(). Navigation into and out of cells is not affected because
the visualCursor member in the QTableViewPrivate tracks the keyboard
navigation entry point. If after the up navigation into the span, the
user presses up, the cell entered is 'e', not the cell above 'x'.

Task-number: QTBUG-29239

[ChangeLog][QtWidgets][QTableView][QTableWidget] currentIndex() now
reflects the top left cell when in a span.

Change-Id: I3dc3db46ebba340102860fc4ad98fcaf91484983
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2014-06-06 15:50:58 +02:00
hjk
5395180fcb Make RCC handle bigger binaries
Traditionally, RCC in "C mode" was meant to bundle small resources into
a binary, like help texts or an occasional icon. RCC produces a .cpp
file containing the actual data in a char array which is then passed
to the compiler and linker as a normal source file. Larger resources
should be compiled in RCC's binary mode and loaded at run time.

Current Qt Quick use tries to deploy large hunks of data in "C mode",
causing heavy compiler/system load.

This patch works around the issue by splitting the process into
three parts:

1. Create a C++ skeleton, as usual, but use a placeholder array
   with "easily compilable" (mostly NULs) data instead.
2. Compile the skeleton file.
3. Replace the placeholder data with the real binary data.

time (qmake5 ; make clean ; make) takes 1.3 s real time for a
100 MB resource here, and there is still room for improving patching
performance if really needed.

Change-Id: I10a1645fd86a95a7d5663c89e19b05cb3b43ed1b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-06-06 15:41:00 +02:00
Friedemann Kleint
a1c5198387 Suppress move/resize events if they are the result of call to move()/resize().
QWidget::resize() or QWidget::move() set the new size/position values
and send events. The spontaneous events generated by the platform
should be ignored in that case.

Task-number: QTBUG-30744
Task-number: QTBUG-38768
Task-number: QTBUG-32590
Change-Id: I9c0ae38842ed76a8a88ca64fdc9bbe106b2766b7
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2014-06-06 06:30:44 +02:00
J-P Nurmi
0fcce50af0 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	mkspecs/features/qt.prf
	src/plugins/platforms/xcb/qxcbwindow.h
	src/tools/qdoc/qdocindexfiles.cpp
	src/widgets/kernel/qwidget_qpa.cpp

Change-Id: I214f57b03bc2ff86cf3b7dfe2966168af93a5a67
2014-06-05 22:26:44 +02:00
Robin Burchell
9e01483cdf Make the ICO image handler capable of reading CUR files too.
This simple patch was an unfortunate victim of the Gitorious to
Gerrit transition. (https://qt.gitorious.org/qt/qt/merge_requests/1179)

As noted in the Gitorious review, a small bug in readHeader is also fixed: ||
instead of &&.

Done-with: Pali Rohár
Task-number: QTBUG-12684
Change-Id: I1fe16359b9b68c10e518904c6a5c58b00fb7379b
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
2014-06-05 19:10:58 +02:00
Lars Knoll
7df8b1ada4 Properly escape bytearray data outside the ascii range when using a codec
Some codecs can't handle the range outside ascii properly and would then
fail to read the data back in correctly.

Task-number: QTBUG-15543
Change-Id: I4c02921e787a939eeec0c7a11603b5896d756aef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-06-04 23:06:16 +02:00
Friedemann Kleint
a149d2f73e Do not clear default button in QMessageBox::setDetailedText().
Store the value of QMessageBoxPrivate::autoAddOkButton
temporarily when automatically adding the "Show Details..."
button.

Task-number: QTBUG-39334
Change-Id: I173c83893548ee83b3d8ea2743f87686c32657e7
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-06-04 14:43:02 +02:00
Olivier Goffart
523440a15f QSaveFile: error out in open when the file is a directory
Change-Id: Ifb1697fedf6dd28fe317282c8b4824f34ec61981
Reviewed-by: David Faure <david.faure@kdab.com>
2014-06-04 12:25:02 +02:00
Bernd Weimer
ce6c0d2e61 QNX: Fix tst_qfilesystemwatcher
If QNX does not have inotify there is no native engine.

Change-Id: I042efd0b59f916f9e0b55bbe5c7f3fe7bb6914c8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
2014-06-03 17:25:36 +02:00
Frederik Gladhorn
bb794270ec Accessibility: Fix select state usage
The selectable/selected states refer to items in a list and similar,
do not interpret them as text selection states.
Without this change NVDA for example announces text edits as selected
which makes no sense and which it doesn't do for native text items.

Change-Id: Ib1d109523bd4cc2b9b40ace8a8c3d7d3a7f9f25c
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-05-31 17:12:58 +02:00
Olivier Goffart
7e5e7eeaa1 QSaveFile: follow symbolic links
[ChangeLog][QtCore][QSaveFile] Now follows symbolic links while writing to
a link instead of replacing the link with the contents.

Change-Id: I5afd519cb9f96ae68fa4c23c33a18de75671a301
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2014-05-30 19:36:38 +02:00
Jan Kundrát
267ba8b63e QAbstractProxyModel::sibling: treat row/column as offsets within the proxy
Qt5 allows QAIM subclasses to reimplement the sibling() method. Unfortunately,
the default QAbstractProxyModel's reimplementation differs in behavior to what
the Qt4 version was doing. In particular, the Qt4 version used to use the row
and column as positions within the proxy model, while the Qt5 version mistakenly
does this at the level of source model. This is arguably broken; the caller asks
for a sibling of the proxy index, not for a sibling within the proxy model.

This change makes the QAPM::sibling work explicitly in the same way as the Qt4
code behaved.

The reimplementation of QAbstractProxyModel::sibling was introduced in
9dfba89c28. It was subsequently fixed with commit
999109866d not to return indexes from the source
model, but the logic was still different from the Qt4 version.

[ChangeLog][QtCore][QAbstractProxyModel] Fixed QAbstractProxyModel::sibling to
work in the same manner as the Qt4 code used to behave. Previously, Qt5's
implementation would treat the row and column as positions in the source model
instead of a position in the proxy itself.

Followup-to 9dfba89c28 and
999109866d
Change-Id: Ia25027b2ad9e4777ba28de2d2226d48f8cccf587
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2014-05-29 11:11:02 +02:00
Eskil Abrahamsen Blomfeldt
909b0de5d1 Windows: Fix another crash when creating QRawFont from invalid data
The sanity check added in d16508a285
didn't actually catch the case where the invalid data is large
enough to contain the offset table and table directory. Added sanity
checks to all the code that accesses the font data now, so this
should fix crashes with partial data as well as invalid data.

Task-number: QTBUG-37190
Change-Id: Ie43f10d8cf0b09007783b9b1c4d91bfed8c6b0f0
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-05-28 16:52:04 +02:00
Friedemann Kleint
3478ec2949 Move native subwidgets in QWidget::scroll().
Task-number: QTBUG-38999
Change-Id: Ie22dcf61895bbfc575eaae4d1929516a8749de39
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-05-28 16:52:04 +02:00
Dario Freddi
e2df05f120 QTimer: add convenience singleShot methods for functors
This brings QTimer::singleShot on par with QObject::connect in
terms of the new Qt5 syntax. With this patch, it is now possible
to connect singleShot to a member pointer, a static function
pointer and a functor (with or without a context object).

The short code path for 0 msec is not yet implemented - it will
require further modifications to QMetaObject before it will be.

An additional SFINAE on the new singleShot overloads had to be
implemented to prevent tricking the compiler into believing
const char * might be a function pointer.

[ChangeLog][QtCore][QTimer] Implemented new style connect syntax,
including functors, in QTimer::singleShot

Task-number: QTBUG-26406
Change-Id: I31b2fa2c8369648030ec80b12e3ae10b92eb28b4
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-05-28 11:45:48 +02:00
aavit
72a424f512 Fix test script: let actual font used match the font description
Change-Id: Ia6bd1fc7f2e4a069fb29927f18994843e0db7dd0
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-05-27 13:01:45 +02:00
Friedemann Kleint
787c0d76a2 Replace hard-coded qWait() by QTRY_COMPARE/VERIFY in widget tests.
Task-number: QTBUG-38890
Change-Id: I9a729430fcd30b782c100bb76d5e287a3b4c1238
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2014-05-26 15:06:12 +02:00
Andy Shaw
5d48eb8bbc Cocoa: Make sure modal windows get correct geometry on show
beginModalSessionForWindow will center the window and ignore
the set geometry. So to workaround this it checks the new value
against the old one and moves it back if need be.

Change-Id: I38bc74c04138992f2e0570fca666414025aeeba8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-05-26 11:16:38 +02:00
Tony Sarajärvi
9f4881297d Mark tst_qfiledialog2 as insignificant due to failing tests
Task-number: QTBUG-39183
Change-Id: I6663d0e4c49e904ffe5d5fdc990073abd4188d9d
Reviewed-by: Simo Fält <simo.falt@digia.com>
2014-05-23 07:05:41 +02:00
Friedemann Kleint
a591c27282 Stabilize and speed up tst_QGraphicsItem::cursor().
Use QTRY_COMPARE instead of hard-coded timeouts, ensure window is
shown.

Change-Id: I4f23144ee14150c4fba9c6fbd8c4ee2da472cc75
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2014-05-22 21:44:01 +02:00
Simon Hausmann
508b95899d Merge remote-tracking branch 'origin/stable' into dev
Change-Id: Ia36e93771066d8abcf8123dbe2362c5c9d9260fc
2014-05-22 07:46:17 +02:00
Axel Rasmussen
2983cb9531 Fix broken QPlainTextDocumentLayout after removing chars
This fixes an issue where, if characters were removed from several
blocks in a single edit, the document layout would end up being
corrupted since the document layout manager wouldn't re-layout the
proper number of text blocks.

Task-number: QTBUG-30051
Change-Id: Idf3a6f567120e6a5dbebf1f65f685d374219328a
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
2014-05-21 17:30:11 +02:00
Christoph Schleifenbaum
ff31090d07 Cocoa: Do not process ampersands in menus twice.
When syncing between QAction and native NSMenuItems, the ampersands
(mnemonics) were removed twice. This lead to double ampersands being
removed instead of replace with single ones.

Task-number: QTBUG-37933
Change-Id: If1d9cd247b467472647b22b38460b44b03f13d82
Reviewed-by: Liang Qi <liang.qi@digia.com>
2014-05-21 13:59:18 +02:00
Peter Hartmann
c045cb950b Socks5 socket engine test: Disable UDP over Socks test
... because it fails on the new network test server. The Socks5 tests
in QUdpSocket have already been disabled by commit
aa3eaf9d2e .

Task-number: QTBUG-35490
Change-Id: Ib062adb422ff6e5538f14d15a266d79c3bb53956
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
2014-05-21 10:25:36 +02:00
Richard Moe Gustavsen
77982c4823 qscopedvaluerollback: add convenience constructor
It's a common need to assign a variable to something when entering a
code block, and then revert it upon exit. qscopedvaluerollback can
be used for this. But as a convenience, this patch adds an
extra constructor so that you can "protect" and set a variable
in one go instead of using two lines.

Change-Id: If4b89d3a5ba32ef2304bda058b1b6050932612ed
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-21 02:15:10 +02:00
Denis Shienkov
aefa611f0c QWinOverlappedIoNotifier: Add an extended waitForAnyNotified() method
The existing waitForNotified method has the design limitation that it
doesn't allow the tracking of multiple I/O operations on a single
file handle.

Therefore we introduce an additional method waitForAnyNotified that
returns a pointer to the triggered OVERLAPPED object.

Change-Id: I536ed7f6828daa2b0ce03f2d662eeb10aa89ca99
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-05-21 02:15:10 +02:00
Tor Arne Vestbø
9d1f059fc5 qpa: Rename qwidgetwindow_qpa_p.h to qwidgetwindow_p.h
Change-Id: I24835b86194653e89c0bacefd22ddbff06b6e97b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-05-20 00:20:02 +02:00
Bernd Weimer
1ea0d59c4a Skip tst_QLockFile::noPermissions
QLockFile "noPermissions" test is not applicable with root
privileges.

Change-Id: I5779da524f24d0f1b9ef519d654856a6200da6bf
Reviewed-by: David Faure <david.faure@kdab.com>
2014-05-19 19:33:15 +02:00
Bernd Weimer
b8f96418ed Skip some qsavefile auto tests
Some of the QSaveFile tests are not applicable with root privileges.

Change-Id: I1a22906c0b14acf144f1849719152dfe9d79f426
Reviewed-by: David Faure <david.faure@kdab.com>
2014-05-19 19:33:15 +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
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
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
Frederik Gladhorn
94f9c9678a Merge "Merge remote-tracking branch 'origin/release' into stable" into refs/staging/stable 2014-05-16 14:14:25 +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
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
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
Bernd Weimer
1b2614477f Fix accessibility auto test
Prevent crash on platforms that don't support accessibility by skipping
tests.

Change-Id: I42ba44df3200e0abd62797c76a5c538fb1d2757c
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-05-14 20:10:03 +02:00
Friedemann Kleint
70cd276db0 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2014-05-14 18:43:38 +02:00
Frederik Gladhorn
cb3348dec9 Merge remote-tracking branch 'origin/release' into stable
Change-Id: If1abbe7810ea43ae750db91066f9f579c79b2289
2014-05-14 12:37:34 +02:00
Richard J. Moore
1a8788d966 Move the PKCS#12 support from QSslSocket to QSslCertificate.
Discussed with Peter and agreed that it's a slightly better fit there.

Change-Id: If8db777336e2273670a23d75d8542b30c07e0d7b
Reviewed-by: Daniel Molkentin <daniel@molkentin.de>
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-05-14 11:08:01 +02:00
Eskil Abrahamsen Blomfeldt
d16508a285 Fix crash when loading invalid font data in QRawFont
When passing invalid data to QRawFont, we need to fail gracefully
and mark the font as invalid, instead of crashing. This crashed
because of different missing sanity checks in the Windows
and FontConfig font databases.

[ChangeLog][Text] Fixed crash when trying to load a font from
invalid data.

Task-number: QTBUG-37190
Change-Id: I62c81217ec7d873350b575c9d4ae8e6f0a939540
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-05-14 09:13:38 +02:00
Bernd Weimer
4f83102df0 QNX: Make QDateTime "daylightTransitions" auto test pass
Change-Id: I8c68d15806c6ec39e98dddda86823d9b4e3a3169
Reviewed-by: John Layt <jlayt@kde.org>
2014-05-14 09:12:39 +02:00
Bernd Weimer
87152d3c89 QNX: Fix tst_qfileinfo
Change-Id: Ia97a0c661d675e4f5ba800c32f8368583d58ee20
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-05-14 09:12:16 +02:00
Frederik Gladhorn
3d4aeb7919 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/gui/kernel/qguiapplication.cpp

Change-Id: Ibe75603dc8a51769db6550ea3f07bc8d19b0be85
2014-05-13 22:19:10 +02:00
Frederik Gladhorn
ff334fd574 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2014-05-13 16:08:01 +02:00
Jędrzej Nowacki
ec4c93a852 Remove unsused local variables from tst_collections
Change-Id: I4ca1862d29432ca83b90024664b548ea0eef26c0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-13 16:08:01 +02:00
Jędrzej Nowacki
ac660a0f8b Fix gcc warning in tst_collections.
warning: typedef 'Foo' locally defined but not used [-Wunused-local-typedefs]

Change-Id: Ifb1213414feb3aa5a5e46dac163e51ccd4925498
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-13 16:08:01 +02:00
Jędrzej Nowacki
36d5f80d97 Move tst_collections test to corelib/tools.
There is no reason to have the test separated from other tools tests.

Change-Id: Ie5b19961c383f5e4bc1ad4452cba7b92153fc303
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-13 16:08:01 +02:00
Frederik Gladhorn
b5552bab40 Merge remote-tracking branch 'origin/stable' into dev
Manually changed enum to LibGL in
    src/plugins/platforms/xcb/qglxintegration.cpp

Change-Id: If34ee6cce3d1d51fb4bb1fdfa59c30389ea0d207
2014-05-13 14:21:22 +02:00
Thiago Macieira
b23e72a772 Fix stateful handling of invalid UTF-8 straddling buffer borders
When a UTF-8 sequences is too short, QUtf8Functions::fromUtf8 returns
EndOfString. If the decoder is stateful, we must save the state and then
restart it when more data is supplied.

The new stateful decoder (8dd47e34b9)
mishandled the Error case by advancing the src pointer by a negative
number, thus causing a buffer overflow (the issue of the task).

And it also did not handle the len == 0 case properly, though neither
did the older decoder.

Task-number: QTBUG-38939
Change-Id: Ie03d7c55a04e51ee838ccdb3a01e5b989d8e67aa
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-05-13 12:37:19 +02:00
Richard J. Moore
50e8e95385 Add support for loading PKCS#12 bundles.
Add support for loading certificates and keys from PKCS#12 bundles
(also known as pfx files).

Task-number: QTBUG-1565

[ChangeLog][QtNetwork][QSslSocket] Support for loading PKCS#12
bundles was added. These are often used to transport keys and
certificates conveniently, particularly when making use of
client certificates.

Change-Id: Idaeb2cb4dac4b19881a5c99c7c0a7eea00c2b207
Reviewed-by: Daniel Molkentin <daniel@molkentin.de>
2014-05-11 23:50:03 +02:00
Thiago Macieira
f2a40fa071 Don't assume QLocale::codecForLocale always returns non-null
It may return null during program exit, due to QCoreGlobalData global
static already having been destroyed. If that's the case, QTextStream
needs to fall back to Latin 1, like QString::toLocal8Bit and
fromLocal8Bit already do.

Task-number: QTBUG-38316
Change-Id: I5949c8dec15b60f4a13b5d9307ed6abfc799fe20
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-05-11 05:13:49 +02:00
Friedemann Kleint
f528fff973 tst_QWidget::windowMoveResize(): Fix QEXPECT_FAIL / QTRY_COMPARE .
QEXPECT_FAIL followed by QTRY_COMPARE considerably slows down
tests due to the check timing out.

Task-number: QTBUG-38890
Change-Id: I7f90f2627fc6ce149d159a6d13355ca1a8181d54
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-05-09 18:49:41 +02:00
Thiago Macieira
e0e86d5651 Fix dangling pointer dereferencing
That long call chain is screaming "here, I'm dereferencing dangling
pointers! Valgrind me!" but 2006 Thiago didn't see them...

Change-Id: I44de5aea113d05edec2227e9db6be8cec9303be9
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-05-09 03:39:34 +02:00
Thiago Macieira
a982243b97 Autotest: make sure the helper programs in QtDBus aren't bundles
The main test won't find them if they are.

Change-Id: Iae3ffe4c0289a0c88d46c1bd2e414c20def89ab4
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-05-09 03:39:33 +02:00
Daniel Seither
d69c6bc81f QDateTime: Add more tests for parsing/writing timezone offsets
The tests for toString/fromString previously didn't run tests
for timezones with hh:mm where mm != 00.

Change-Id: I74da99c5b6890f46ce06446084a8129b4cbc7a02
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: John Layt <jlayt@kde.org>
2014-05-08 21:28:45 +02:00
Frederik Gladhorn
9cfdd66b64 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2014-05-08 20:31:31 +02:00
Jan Arve Saether
1677826916 Don't repeat Tab names in the QTabBar
Task-number: QTBUG-38503
Change-Id: I1f7e599b46526a8c4b8e0f3534be9c717727a4aa
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-05-08 16:51:24 +02:00
Friedemann Kleint
c82668d39d Speed up tst_QXmlSimpleReader.
Increase the chunk size of the server and remove hard-coded
interval when waiting for the server to listen.
Unmodified, the test takes 170s on Windows.

Change-Id: I65bdc93ff78e1b4fb429fcafd0fdc5e80bb281f9
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-05-08 16:06:11 +02:00
Friedemann Kleint
7a2547164d Fix tst_QStyleSheetStyle::toolTip().
Use the correct palette and enforce Fusion style to prevent
the Vista style from clobbering the tooltip palette in polish().

Task-number: QTBUG-38183
Change-Id: Id19d548f818d801c4914a343e08207195c343888
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-05-08 09:36:21 +02:00
Friedemann Kleint
ca17c06294 Revive tst_qstylesheetstyle on Desktop platforms.
Task-number: QTBUG-21468
Change-Id: I37f741d9709b17ad31b01078e10538f0f6bff01a
Reviewed-by: Liang Qi <liang.qi@digia.com>
2014-05-08 09:36:11 +02:00
Keith Gardner
43f52f93b5 Updated corelib's unit tests to use QSignalSpy's functor constructor
The intent is to provide compile time validation of signals and to help
detect signal overloading in the future.

Change-Id: I9d5d46ed4b70c5d0cd407deb5928b1e76d37e007
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-05-08 04:22:54 +02:00
Frederik Gladhorn
1326cd15f7 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	mkspecs/qnx-x86-qcc/qplatformdefs.h
	src/corelib/global/qglobal.h
	src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
	src/opengl/qgl.cpp
	src/opengl/qglpixelbuffer.cpp
	src/opengl/qglshaderprogram.cpp
	tests/auto/opengl/qglthreads/tst_qglthreads.cpp

Change-Id: Iaba137884d3526a139000ca26fee02bb27b5cdb5
2014-05-06 16:50:03 +02:00
Friedemann Kleint
85aef2dd4b Fix visual index lookup in QTreeViewPrivate::adjustViewOptionsForIndex().
Determine the visual index by looking up the column of the QModelIndex
in the logicalIndices array instead of looping.

Task-number: QTBUG-37813
Change-Id: I5c3c73c67537877b03cdc2c36a52041d99f7f49d
Reviewed-by: David Faure <david.faure@kdab.com>
2014-05-06 16:35:56 +02:00
Friedemann Kleint
d915432c23 QFileDialog: Return empty QUrl from the static get..FileUrl() functions.
Task-number: QTBUG-38672
Change-Id: Idf554cd93d1a79db7c82f3165bd128fb31ead3e5
Reviewed-by: David Faure <david.faure@kdab.com>
2014-05-06 16:35:56 +02:00
Richard J. Moore
9b1746c499 Add autotest for the QSslCertificate QIODevice constructor.
Change-Id: I92fa083665509932b75ff1037904a6f78a950fd6
Reviewed-by: Jeremy Lainé <jeremy.laine@m4x.org>
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-05-06 16:35:56 +02:00
Richard J. Moore
1d6695451f Add an autotest the QSslCertificate::version() method works.
Change-Id: Ife5b7206fd3d7af57cfca3c0f28f56bb53ede7a7
Reviewed-by: Jeremy Lainé <jeremy.laine@m4x.org>
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-05-06 16:35:56 +02:00
Frederik Gladhorn
3b8d140558 Accessibility: Do not report popup for QLineEdit
Nothing else seems to report this state and on windows
for example it results in NVDA reading subMenu which makes
little sense.
Task-number: QTBUG-38500
Change-Id: I64820d9f2ea9174034f01da42cb2266a19c19465
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-05-06 16:35:56 +02:00
Liang Qi
feca69e89f Revert "Ignore tst_QStyleSheetStyle::hoverColors() failures on Mac OS X"
This test doesn't fail on Mac any more.

This reverts commit 36493a7a41.

Task-number: QTBUG-23685
Change-Id: Ib7c56494b07de9839b3287758fe228f799bc343c
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-05-06 07:38:24 +02:00
Thiago Macieira
fe70367fe0 Include the duplicated attribute name in the error message
Task-number: QTBUG-36467
Change-Id: Ic2610bd7c8df12fce4ec2ce14bd96f4595bd38af
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2014-05-06 01:20:19 +02:00
David Faure
31ce6f50c6 Add QUrl::fromUserInput overload with a cwd argument.
Useful for any application that can take URLs on the command-line, so that
full paths and relative paths can also be accepted.

Change-Id: I8a2c50f36d60bdc49c065b3065972fd5d45fa12a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-06 01:20:17 +02:00
Giuseppe D'Angelo
260f24228b QRegularExpression: add ways to force an immediate optimization
The fact that we kick in a pattern study and possibly a JIT compilation
after an undocumented number of usages is suboptimal, for a number
or reasons: users may want to JIT compile a pattern immediately,
and at the same time they may not want a random delay in the program
(due to the pattern getting optimized at a random usage).

So: add an optimize() call to force an immediate pattern optimization,
and a pattern option to force an optimization on the first usage.

Change-Id: I95efdecfd31f11ca7cceb9c05037df613601a11c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-05-06 00:10:55 +02:00
Frederik Gladhorn
9922dafb23 Use sched_yield instead of pthread_yield
sched_yield is standardized and on linux pthread_yield is implemented as sched_yield.
Building Qt for Android on OS X doesn't compile with the pthread version.

Change-Id: I1913afa83769805291e987f55b8f452299a43dce
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2014-05-05 22:40:49 +02:00
Frederik Gladhorn
e6286ca289 Merge remote-tracking branch 'origin/release' into stable
Manually fixed up: isES -> isOpenGLES
src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp

Change-Id: I57d2ef26c3d4a7b40ace09f4e8560b7686650ea5
2014-05-03 00:56:41 +02:00
Fabian Bumberger
721543e464 QNX: Fix QLineEdit autotest
Change-Id: I84c386a146dd484db844fa93165b28e19e4cefd7
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
2014-05-02 17:36:45 +02:00
Fabian Bumberger
637b6e1097 Ignore the fullscreen state of a QMdiSubWindow
On some platforms all windows are by default forced into fullscreen mode when show() is executed.
In QMdiSubWindow we cannot handle the fullscreen state and should ignore it. Otherwise
the window will be forced in "normal" state and ignore any previously
executed geometry changes.

Change-Id: I09ce6507a1eac6a0adb3405ca3f423642d30f801
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
2014-05-02 17:36:45 +02:00
David Faure
532b94e98f Add support for -qwindowicon command line argument.
[ChangeLog][QtGui][QGuiApplication] Add support for -icon command line
argument on X11, add -qwindowicon on all platforms.

Change-Id: Iacc602466699bf634d8b34aab7ed73c83fd9844f
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-05-02 10:03:31 +02:00
Frederik Gladhorn
ccc6efb6e9 Merge remote-tracking branch 'origin/release' into stable
This merge adds the opengl rename.

Change-Id: I84ea0b6abee9780ebb2cf3f64ab9e3fdf2acab3e
2014-05-01 13:08:42 +02:00
Eskil Abrahamsen Blomfeldt
7eae50a52d Fix assert on justification of QTextLine with only spaces
In the justification code, we unconditionally subtracted one
from the line_length, but then compared the result to 0 afterwards,
so we did not support when the line_length is 0 initially, which
can happen if it only consists of spaces (in which case
trailingSpaces will be non-zero and line_length will be zero.)
The fix is to bail out for both strings of length 1 and length 0.

[ChangeLog][Text] Fixed an assert when justifying a QTextLine
which only contains spaces.

Task-number: QTBUG-38520
Change-Id: Ib04993f47eb2f9f7fc49c4a5400f18f9682a72f2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-04-30 18:23:33 +02:00
Simon Hausmann
12eb3b51c4 Fix incorrect repaints with plain text edit
The plain text edit's smart repaint logic in
QPlainTextDocumentLayout::documentChanged assumes that during a change inside
just one block, the block is in the state before the edit and a call to
layoutBlock() is going to bring it up-to-date. Then only a comparison of the
bounding rect - before and after - is going to allow for smart repaints.

The assumption of the layout being in the same state as before the edit got
broken by commit cc57a2e90f, which introduced
code to use a QTextCursor within a slot connected to QTextDocument's
contentsChange signal. The usage of the QTextCursor there ends up updating the
layout of the block ahead of time, breaking the assumption and therefore the
optimization, in the sense that during changes in the preedit that cause a
change of height / line count, the old bounding rect in
QPlainTextDocumentLayout::documentChanged and the new bounding rect will be the
same. This causes a repaint of only the edited block, missing repaints of the
following blocks, even though the line count effectively changed.

So what's causing QTextCursor to mess with the layout is the attempt of
updating the vertical movement x property. This patch inhibits the update,
marking it as dirty for initialization later. This means that slots connected
to this low-level signal cannot rely on the cursor's visual x position, but
that doesn't seem useful anyway and isn't required for commit
cc57a2e90f.

Task-number: QTBUG-38536
Change-Id: I5fae12d646a4b2d2cc22b9f2d021e5dc8cfdda94
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-04-30 18:23:23 +02:00
Friedemann Kleint
7e14e69fd5 Stabilize tst_QAbstractItemView::task250754_fontChange().
Increase window size when verifying that the scrollbar disappears
when using a small font on Windows 8.1

Change-Id: I7d4520bc5882d8ccd59db3f5bff7e9d6d68a4827
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-04-30 16:53:55 +02:00
Daniel Molkentin
ae7bbe3400 Provide new API: QSslCertificate::isSelfSigned()
Change-Id: I382a017a0b865b849667301aff8b2f87b676ecc6
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-04-30 01:30:08 +02:00
parihaaraka
f1eefd6cf9 Fix PSQL column's metadata
Fixed libpq's PQfmod() interpretation inside QPSQLResult::record()

Task-number: QTBUG-12477
Change-Id: I0e4c94ca1b06fd6a8e5b5702235cdd6d9736f8bf
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2014-04-29 14:42:26 +02:00
Friedemann Kleint
f3bc9f5c5c Add locations AppDataLocation, AppLocalDataLocation to QStandardPaths.
On Windows, DataLocation currently returns the value obtained by
passing CSIDL_COMMON_APPDATA to SHGetSpecialFolderPath(). This is
the local non-roaming path. For actually storing settings, the roaming
path should be used (CSIDL_APPDATA). Introduce new AppDataLocation to
return that path and AppLocalDataLocation for the local path and deprecate
DataLocation.

[ChangeLog][QtCore][QStandardPaths] QStandardPaths now has new
enumeration values AppDataLocation, AppLocalDataLocation to be able
to differentiate between roaming and local paths on the Windows
operating system. DataLocation is deprecated in favor of AppDataLocation.

Task-number: QTBUG-38483
Change-Id: Ib1de8c7031a863ed5eac10c747de6f7ff1a090c7
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2014-04-29 12:28:16 +02:00
Friedemann Kleint
9f6a0300a5 Observe case insensitive file systems in QFileDialog::selectFile().
When stripping the root path from a file name that cannot be found
in the model, use case sensitive comparison depending on
file system.

Task-number: QTBUG-38162
Change-Id: I28e28973fca2da35a5768fdd00cc258b9669a15a
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-04-29 03:27:26 +02:00
Frederik Gladhorn
386292837b Add press action to QAccessibleCombobox
VoiceOver expects press to open the combobox.

Task-number: QTBUG-37922
Change-Id: Iee7b7974db097e4e2444202c703bd587e1576fe0
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-04-28 22:25:50 +02:00
Laszlo Agocs
33d0a8d753 Remove direct OpenGL calls from QtOpenGL
Task-number: QTBUG-36483
Change-Id: I96dea5649c0a49a11cd2ff31da659cd2067e769d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-04-28 18:19:34 +02:00
Friedemann Kleint
d7d12bc1eb Fix crash when accessing QFileDialog::selectedFiles() before widgets exist.
Discovered while investigating:

Task-number: QTBUG-38414
Change-Id: I764195254ba4b54c86079c6e8ef750d6249960d9
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-04-28 13:47:40 +02:00
Israel Lins Albuquerque
3e6e70bddd [QSqlQuery] misbehavior of seek in special query positions
When QSqlQuery::at() == QSql::BeforeFirstRow and seek(1, true) (seek to
next record) is called the expected result is go to first row.
When QSqlQuery::at() == QSql::AfterLastRow and seek(-1, true) (seek to
previous record) is called the expected result is go to last row.

But in all cases the first and last are skipped.

Change-Id: I584138b3d397ce1c790bf89688ee92289a99611c
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2014-04-26 20:22:42 +02:00
Peter Hartmann
8369f6d3ea QTcpSocket auto test: Temporarily disable Socks5 tests
... because they are too unstable. We can check whether they are more
stable once the new network tests server is in place.

Task-number: QTBUG-38385
Change-Id: I5ced7cc1f89290812aa88f174a41965fd2ef7252
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-04-25 10:55:31 +02:00
Frederik Gladhorn
dda9b5325f Add missing #ifndef QT_NO_SSL
Change-Id: I2912dcca77270582f6e989b8b3fb72b82f6f70d6
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-04-25 10:55:31 +02:00
Jani Heikkinen
16501e32eb Merge "Merge remote-tracking branch 'origin/release' into stable" into refs/staging/stable 2014-04-25 10:55:31 +02:00
Laszlo Agocs
f9d323279a Rename new QOpenGLContext APIs
isES() becomes isOpenGLES(). The library type enums are changed
DesktopGL -> LibGL and GLES2 -> LibGLES. This removes the now
unnecessary version number, the confusing "desktop" term and provides
better readability.

The old function/values are kept until the related qtdeclarative
changes are integrated.

Task-number: QTBUG-38564
Change-Id: Ibb0a1209985f1ce4bb9451f9b7b093c2b68a6505
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2014-04-25 10:07:45 +02:00
Friedemann Kleint
61ce16d25c Stabilize tst_qfilesystemmodel::rowsInserted() on Windows.
Introduce QTRY_COMPARE to let the sorting finish instead
of a hard-coded time-out.

Task-number: QTBUG-29403
Change-Id: I813bf6bcfe7110f49a5b95db589ed8a3f559db89
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-04-25 06:58:27 +02:00
Friedemann Kleint
403a9d97d6 Stabilize tst_qfilesystemwatcher::watchFileAndItsDirectory().
Use QTRY_COMPARE for dirChangedSpy, remove all unneeded
remove()/setPermission() calls (originating from the time
the test did not use QTemporaryFile), add more QVERIFY()
and messages for the other operations.

Task-number: QTBUG-30943
Change-Id: Ib3b78b1c6922539fd5e9238aa017fcdb554aacc8
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2014-04-25 06:58:27 +02:00
Friedemann Kleint
d8cd99992f Stabilize tst_qfiledialog.
selectFile(): Ensure dialog is destroyed before the temporary file
to prevent leak.

selectFiles(): Introduce scopes to prevent co-existence of 2
instances of QFileDialog, which causes warnings from file watchers
and occasional crashes in accessibility.

Discovered while investigating:

Task-number: QTBUG-38414
Change-Id: I94d2bb3e05538416286641cb08a88d8b3837a8a6
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-04-25 06:58:27 +02:00
Olivier Goffart
89ecac4607 QSqlError: Mark deprecated functiond with QT_DEPRECATED
And move the default argument from the deprecated constructor to
the new one

Also make sure that the error number is consistent across the
two constructor

Change-Id: I3721266b39ab493f0add35b2d1f892b2f6094992
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-04-25 06:37:06 +02:00
Thiago Macieira
ec74461e9d Ensure we try the UTF-8 conversions with longer strings
The SSE2-based conversion only kicks in with strings with 8 characters
or more in length.

Change-Id: Ic1daad0845571be03547553cc001d83550f0c89c
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-04-25 01:27:33 +02:00
Thiago Macieira
9a07ea69d6 Again to fix compilation after b0afad8f0b
Commit 125bb81bef wasn't enough. Let's
just make it simpler and use a regular function.

Change-Id: I9627dedaa87873b4b138224afd182e4fd9a55265
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-04-25 01:27:19 +02:00
Thiago Macieira
e57b521d95 Deprecate setSharable in Qt containers
The ability to set a container to be unsharable has very little use and
it costs us an extra conditional for every refcount up and possibly
down.

This change is a no-op for current Qt 5. It shuffles a few things around
just so Qt can compile if you define QT_NO_UNSHARABLE_CONTAINERS. That
is done to ease the fixing of the code in Qt 6 and to make my life
easier: I'll keep that defined in my local Qt build so I can catch any
misuses of this deprecated API.

The newly deprecated methods are not marked QT_DEPRECATED because the
bootstrapped tools wouldn't build -- they're built with QT_NO_DEPRECATED
defined, which causes build errors.

[ChangeLog][QtCore] The setSharable() and isSharable() functions in Qt
containers has been deprecated and will be removed in Qt 6. New
applications should not use this feature, while old applications that
may be using this (undocumented) feature should port away from it.

Discussed-on: http://lists.qt-project.org/pipermail/development/2014-February/015724.html
Change-Id: I789771743dcaed6a43eccd99382f8b3ffa61e479
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-04-24 10:49:10 +02:00
Thiago Macieira
f56ef579ba Restore handling of BOMs in QString::fromUtf8
8dd47e34b9 removed the handling of the
BOMs but did not document it. This brings the behavior back and adds a
unit test so we don't break it again.

Discussed-on: http://lists.qt-project.org/pipermail/development/2014-April/016532.html
Change-Id: Ifb7a9a6e5a494622f46b8ab435e1d168b862d952
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-04-24 10:47:49 +02:00
Thiago Macieira
02a9f065c5 Autotest: fix use of dangling pointer
The "data" pointer became technically dangling after line 1866 did
    copy = data;
as copy was the last reference to the original data. That made the
pointer address available to be reused by the system malloc(), which
sometimes happened, causing the unit test to fail.

Discussed-on: http://lists.qt-project.org/pipermail/development/2014-April/016588.html
Change-Id: Ifa6a27bd53a6e60392b77a6609f2d47148695211
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-04-24 10:37:21 +02:00
Laszlo Agocs
af1e32426c Add public and QPA APIs for adapting existing OpenGL contexts
For now only xcb on GLX is supported. Other platforms will follow later.

Add also some missing documentation for the platform OpenGL context factory
functions.

[ChangeLog] QOpenGLContext is now able to adopt existing native contexts.

Task-number: QTBUG-37552
Change-Id: I5dd959f102df178f646b2df5989203b5dc6de376
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-04-24 09:10:29 +02:00
Keith Gardner
6fc7d76e73 QSignalSpy: Added template function pointer constructor
Added the function pointer constructor to QSignalSpy to take advantage
of the new connect syntax.

Change-Id: I94218a096c677cdba73e1b2cfa8b9c09bc28145f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2014-04-23 22:26:00 +02:00
Jorgen Lind
eb88aaa3a2 Introducing QPixelFormat
Its purpose in life will be to describe pixel formats

[ChangeLog][QtGui] Added QPixelFormat class

Change-Id: I74d8f974606520efb3935110ff3d6ddb5ea805a8
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-04-23 21:43:50 +02:00
Jędrzej Nowacki
33fae8b147 Build fix for auto-registration of Container<void*>
IteratorOwner pointer specialization was failing for void* because of
an invalid function overload.

Change-Id: I80355ddd2b871c1fa2fa5bf5a4ed8bc7768fc3c9
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2014-04-23 21:40:36 +02:00
Jani Heikkinen
54c1e5ed22 Merge remote-tracking branch 'origin/release' into stable
Change-Id: Id13b4a3803664692f32f9d57549be8a0c4a08567
2014-04-23 12:42:48 +03:00
Laszlo Agocs
4dbef58c3d Restore Qt 4 behavior in default double click handler
Revert 3bb9024952. That fix was an attempt
to handle the issue that has been fixed in 5.3 by
9063edef79 and should have been reverted
when the new approach, that restores Qt 4 behavior for widgets, was
introduced.

Task-number: QTBUG-38242
Task-number: QTBUG-36423
Change-Id: I8f8a82da22605fac90543492e9b2cd2b568544e7
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-04-17 10:59:13 +02:00
Jorgen Lind
50b8506eac XCB: fix that modal dialogs can go behind other process windows
Task-number: QTBUG-35302
Change-Id: I1ad7a66e530710d5338a15057254360dae676451
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-04-16 09:30:32 +02:00
Volker Krause
d953d9a4c3 Add a more reliable replacement for qt_add/removeObject().
These hooks only worked reliably with LD_PRELOAD on Linux/GCC, on other
platforms they depended on what exactly the compiler optimizer is doing
as well as some nasty assembler rewriting to actually access them. The
new system uses a simple array of function pointers that can be set to
custom hooks by tools that need this (based on ideas from Andre Poenitz).

This also covers qt_startup_hook (similar problem), and the Qt version
number that Andre had asked for.

Change-Id: I2c3e7950fd49b1b1d04176be34c2fff3293981b0
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-04-15 17:50:20 +02:00
Jędrzej Nowacki
78a1c46a86 Mark each QT_MOC_LITERAL usage with a comment
The comment shows to which string a QT_MOC_LITERAL is pointing.

Change-Id: Ia389d750b1b1c21e2242bad6beceea4f9298ff8e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-04-15 14:55:20 +02:00
Friedemann Kleint
ff2dbe609e Fix crash when deleting top level windows embedded into QGraphicsProxyWidget.
Clear proxyWidget pointer in slot
QGraphicsProxyWidgetPrivate::_q_removeWidgetSlot().

Task-number: QTBUG-29684
Task-number: QTBUG-33213
Change-Id: Ibdbd52aa810ca908e3d98daa00954345e7a93a48
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2014-04-14 22:25:08 +02:00
Fabian Bumberger
c3bd4d08b0 QNX: Skip QGLBuffer autotest
see QTBUG-38275

Change-Id: If9a329b07f83ace77b05336d16534032310e0f82
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-04-14 20:03:30 +02:00
Fabian Bumberger
4a169ac015 QNX: Fix QDockWidget autotest
Show translates to showFullScreen on some platforms. This patch
replaces show with showNormal in the "task248604_infiniteResize" test.
On BlackBerry the test is skipped because all top level windows are forced
fullscreen by the platform.

Change-Id: Ia974c3fcbd0c71c107f4cc3f8405b8ef79ffb5b7
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-04-14 20:03:30 +02:00
Fabian Bumberger
3cc84f210a BlackBerry: Fix QDoubleSpinBox autotests
Change-Id: I380e983294c4467ad79f0835c05387a0ee155eb5
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-04-14 20:03:30 +02:00
Fabian Bumberger
56da768c59 QNX: Fix QComboBox autotest
Change-Id: I9fe4da6e02921c0474bf7ef31a2ba14e751584bf
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-04-14 20:03:30 +02:00
Fabian Bumberger
571c16555b QNX: Fix QMdiArea autotests
Change-Id: I1c4b0bbe4984182c217ee97957e2f21f43caf116
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
2014-04-14 16:47:51 +02:00
Fabian Bumberger
bf2fa58c02 QNX: Fix QGuiApplication autotests
On QNX a window can only be activated if it has either a egl surface
or a raster backingstore.

Change-Id: If075093e39f1553eb8b25e35f7d372b1b15aa8af
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-04-14 16:47:51 +02:00
Fabian Bumberger
9cae7b5ee2 QNX: Fix QWizard autotest
In "task177022_setFixedSize" show was replaced with showNormal because on QNX
and some other platforms show translates to a showFullScreen.
For BlackBerry the test is skipped because the first top level window
is always forced into fullscreen mode.

Change-Id: I9df37c6bc47b47cbad4a1623b3eafa723abc6714
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-04-14 16:47:51 +02:00
Fabian Bumberger
ff34070709 QNX: Fix QTreeView autotest
The style is dpi dependent. I.e. on high dpi displays the pixel size of
sections and rows of a QTreeView will be larger.

Change-Id: I7477bfdd641d4db67973cafef5147f026f72c111
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-04-14 16:47:51 +02:00
Konstantin Ritt
0ec07b68ad Improve the Unicode script itemization implementation
Make it closer to the Unicode specs (UAX#24):
* Common now inherits the preceding character's script, if any;
* In a combining character sequence, if the base character is
  of Common script, the entire sequence is treated like if it were
  of the first non-Inherited, non-Common script in the sequence.
See http://www.unicode.org/reports/tr24/tr24-21.html for more details.

[ChangeLog][QtGui] Fixed regression in arabic text rendering.

Task-number: QTBUG-28813
Task-number: QTBUG-29930 (related)
Task-number: QTBUG-35836
Change-Id: Id85761965b08ca94c674d5f3613fe58b82b2ce9c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Ahmed Saidi <justroftest@gmail.com>
2014-04-14 06:43:57 +02:00
Konstantin Ritt
ef77c16cb0 Make HarfBuzz-NG the default shaper on Mac
For AAT shaping support, we need either the pre-QPA shaping trick
or the new HarfBuzz on Mac; prefer the latter.
Disable some test cases aimed to test the HB-old behavior; enable ones
that should guarantee shaping-unaware behavior.

[ChangeLog][OS X] Use CoreText text shaping engine for support of
complex scripts. If required, the shaping engine used in previous
versions can be preferred by configuring Qt with -no-harfbuzz.
Alternatively, the QT_HARFBUZZ environment variable could be set to "old".

Task-number: QTBUG-18980 (relates)
Task-number: QTBUG-38246
Change-Id: Iee6fe4f5bc047e77259182b8585385c5febd02b3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-04-14 06:43:54 +02:00
Marc Mutz
4c1e15548a Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2014-04-11 23:01:43 +02:00
Marc Mutz
d5b7b4e41c QStringList: add op= overloads for QList<QString>
QStringList = QList<QString> already compiled, but was interpreted as
QStringList = QStringList(QList<QString>), which involves the QList
copy ctor. Adding the overload saves that copy.

Cannot use a using declaration here, since the return type is different.

Change-Id: I9f4feb2f97480d2d6a3b6fa7c71b5d511b623601
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-04-11 22:54:40 +02:00
Frederik Gladhorn
98d3e40fb7 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	mkspecs/qnx-armv7le-qcc/qplatformdefs.h
	src/printsupport/kernel/qcups.cpp
	src/widgets/styles/qstyle.h
	tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp

Change-Id: Ia41e13051169a6d4a8a1267548e7d47b859bb267
2014-04-11 14:36:55 +02:00
J-P Nurmi
b2a6c9ec3e Fix tst_QListWidget::task217070_scrollbarsAdjusted()
QMacStyle::styleHint(SH_ScrollBar_Transient) wants either a style
object or the widget argument in order to return correct values.

Change-Id: I2fdef0820334fa66e076a4734eb2a30c722c841c
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2014-04-09 20:53:06 +02:00
Fabian Bumberger
cf439ae331 QNX: Fix QCompleter autotest
The tests expect a home folder which usually is not present on QNX

Change-Id: I44f548a95f14414c0db6f752fd115696069a7b90
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-04-09 20:53:06 +02:00
Richard J. Moore
814a1c7b2b Support for DH and ECDH key exchange for QSslSocket servers
Despite supporting DH and ECDH key exchange as a client, Qt did not provide
any default parameters which prevented them being used as a server. A
future change should allow the user to control the parameters used, but
these defaults should be okay for most users.

[ChangeLog][Important Behavior Changes] Support for DH and ECDH key exchange
cipher suites when acting as an SSL server has been made possible. This
change means the you can now implement servers that offer forward-secrecy
using Qt.

Task-number: QTBUG-20666
Change-Id: I469163900e4313da9d2d0c3e1e5e47ef46320b17
Reviewed-by: Daniel Molkentin <daniel@molkentin.de>
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-04-09 20:53:06 +02:00
Friedemann Kleint
1a6410f91f Change QVERIFY in tst_qnetworkreply to warning.
FAIL!  : tst_QNetworkReply::ioPostToHttpUploadProgress() 'args.at(0).toLongLong() != sourceFile.size()' returned FALSE. ()

Task-number: QTBUG-37449
Task-number: QTBUG-24226
Change-Id: Idcc0ceac0332705b1e3a073d40fa8098bea2c9f3
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-04-09 20:53:06 +02:00
Fabian Bumberger
b490116f82 QNX: Fix QHeaderView autotest
Some margines and sizeHints are DPI dependent on QNX and BlackBerry.
This patch skips two test that expect the section size to be of a
certain pixel size.

Change-Id: I7869f77fc2b623e091f53e420d1a4fdb3ec30724
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-04-09 20:53:06 +02:00
J-P Nurmi
82934f11e0 Stabilize tst_QListWidget
Replace weird QEventLoop hacks by sending all posted deferred delete
events.

Change-Id: I6da743f2b3fb6ef5dfc960dd3d752973cd511037
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-04-09 10:47:06 +02:00
Simo Fält
1d58ec346a Android: Add some ci usage features to Android testrunner
Added new options:
- silent to suppress the noice from ext tools, making it easier to
parse failed test cases.
- ci, to check test insignificance. Requires QMake::Project cpan
module if used.

Also added printing out results after each test as well as full
summary after test run is complete.

Task-number: QTQAINFRA-641
Change-Id: Ie5f02710a939f7526e0dd39979a0cd97ed19f55b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-04-09 10:46:40 +02:00
Frederik Gladhorn
ccdfe354a6 Accessibility Mac: Cache Accessible Elements and Notify about changes
The big change is that we now keep the id objects representing accessibles
around so that they are persistent for ATs.
This improves performance of Mac accessibility significantly.

This is required for notifications which are now sent so that many things work much better,
for example the VoiceOver focus follows the keyboard focus.

The parent element in QCocoaAccessibleElement was removed, we can
dynamically access it more reliably.

Change-Id: I686d212f40d28b392dcc22f16f3c3430f08bdc98
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-04-09 10:46:02 +02:00
Friedemann Kleint
7d012552b0 Add diagnostic output to tst_QtConcurrentIterateKernel.
Add messages to comparisons and expect failure of blockSize()
on Windows.

Task-number: QTBUG-37822

Change-Id: Ie71d35a3d1ba0e52c93d5ba3fd7e92465b170d49
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-04-09 10:43:32 +02:00
Marc Mutz
c7dd6006b9 QPageLayout: provide op!=
For consistency.

Change-Id: I20fb70999785e2c1947f033d63367a2f6746990a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: John Layt <jlayt@kde.org>
2014-04-08 22:07:01 +02:00
Marc Mutz
22afdaa2da QPageSize: provide op!=
For consistency.

Change-Id: I4375a6f8c2514479a7479c735d397bf8a9876db1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: John Layt <jlayt@kde.org>
2014-04-08 22:06:38 +02:00
Bernd Weimer
f6dce4c858 QNX: Fix QGraphicsView autotests
On BlackBerry first window is always shown full screen. However, many
tests rely on a specific window size. A dummy full screen window is
created so subsequent windows have correct size.

Change-Id: Id8bd0212b6eca677953e78505459e3cd69bc6328
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
2014-04-08 09:50:24 +02:00
Marc Mutz
d9077669a1 tst_QTreeView: fix use of uninited variable
Valgrind complained:

==13941== Conditional jump or move depends on uninitialised value(s)
==13941==    at 0x4206FC: tst_QTreeView::styleOptionViewItem()::MyDelegate::paint(QPainter*, QStyleOptionViewItem const&, QModelIndex const&) const (tst_qtreeview.cpp:3062)
[...]

Change-Id: I76da01c191415ba0a00b4b85312f2fe08e4ee2d2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-04-07 23:41:30 +02:00
Peter Hartmann
9c2ecf89eb network: finish all pending replies upon error
... and not only one. This was a problem e.g. when there were several
requests to the same host and the host was not reachable; only one
reply would get an error signal in case we suppressed other errors in
"happy eyeballs" host lookup style.

Task-number: QTBUG-36890

Change-Id: I1b5757498bd644b0d773cf6c43e4950620949c5c
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-04-07 17:57:42 +02:00
Marc Mutz
509428decc Stabilize QListWidget test
Shot in the dark, as usual.

Change-Id: I272392e6d865f6b32047c3a0ebad70c0f007ba58
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-04-07 12:11:14 +02:00
Frederik Gladhorn
cc57a2e90f Accessibility text updates for QTextEdit
For Mac this makes QTextEdit work nicely with VoiceOver.

Task-number: QTBUG-37204

Change-Id: I1326d24ca6a932ad667ee395f62881b6ec64e892
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-04-05 21:48:31 +02:00
Thiago Macieira
f1540a2966 Fix capacity reservation for shared QByteArray
We can squeeze, but not by discarding elements. Make sure the size of
the object stays intact after changing the reserved capacity.

I've also added unit tests for other containers, just to be sure.

Task-number: QTBUG-37750
Change-Id: I5135b095943b7589423c51cebcb52af792468e61
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-04-05 05:23:07 +02:00
Oswald Buddenhagen
a4ec90175c purge vestiges of opengl es 1 support
amends 0d5170256c.

Change-Id: Ifa178d38f602bb7c66ef13334673ff47e332af5b
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-04-04 19:32:21 +02:00
Thiago Macieira
964ac38fb0 Don't read before the beginning of the string
The code did discard the the data, so it wasn't affecting the comparison
result (tests added anyway), but it could cause crashes if the pointer
to the beginning of the data in the first 8 bytes of a page.

Change-Id: I618e68de329b65de34ef8c934934c3e631cc6c9f
Reported-By: Erik Verbruggen
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-04-04 19:32:21 +02:00
Konstantin Ritt
8c0919a286 Remove QtWidgets dependency from tst_QComplexText
It doesn't depends on windget for quite a long time already.

Change-Id: I251e2e0d52028d17a61c892308d099f344728e79
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-04-04 19:32:21 +02:00
Konstantin Ritt
c603a29550 Remove spurious #ifdef from tst_QComplexText
That #ifdef is placed before any include, so it has no effect.

Change-Id: I4bbf967bda720d287b363847669c5c7a22807bc4
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-04-04 19:32:21 +02:00
Konstantin Ritt
330f6e3598 QTextLayout: Fix cursor movement from invalid position
Actually guarantee cursor doesn't move in this case for both logical
and visual modes (just what the documentation says we already do ;)

Change-Id: Iabdca7aa1d205672386a0095e3487e585611cdb5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-04-04 19:32:21 +02:00
Konstantin Ritt
0b5911f376 QTextLayout: Fix visual cursor movement in some cases
To guarantee proper positioning at the end of the last line in a
bidirectional text we have to insert the eol position into the
insertion points vector, accordingly to the visual ordering.
Detection of the last *logical* item in a *visual* line is unrelaed
to the text direction, it is simply `iterator.item == iterator.lastItem`.

[ChangeLog][QtGui][QTextLayout] Fixed visual cursor movement
in bidirectional text.

Task-number: QTBUG-18060 (partially related)
Change-Id: I53b6ab889ef580ab0560b620b808b1e09efc0fbd
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Ahmed Saidi <justroftest@gmail.com>
2014-04-04 19:32:21 +02:00
Fabian Bumberger
bf05df9a23 BlackBerry: Fix QListView autotest
Change-Id: Id4967911d82cff86214665cc9ca3dbbefa69da11
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-04-04 19:32:21 +02:00
Fabian Bumberger
f3eb59e3fc Fix QTreeWidget autotest
Change-Id: I94b4d9d2f0ef013691faedc4cd12050aa49e98f2
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-04-04 19:32:21 +02:00
Friedemann Kleint
9a4beb4d36 Improve handling of temporary directories in SQL tests.
Initialize directory delayed in shared code and add checks to verify
that it is valid. Close attached / cloned databases to prevent locks
on files and leaking temporary directories caused by SQLite:

QTemporaryDir: Unable to remove "...\Temp\tst_qsqldatabase-P1XkOA" most likely due to the presence of read-only files.
QTemporaryDir: Unable to remove "...\Temp\tst_qsqltablemodel-P1XkOA" most likely due to the presence of read-only files.
QWARN  : tst_QSql::concurrentAccess() QTemporaryDir: Unable to remove "...\Temp\tst_qsql-l0VAKJ" most likely due to the presence of read-only files.

Change-Id: If85bbaed04bb1a32e427d642be332996d967f796
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-04-04 16:55:01 +02:00
aavit
758b9adccf Fix lance opengl painting test
Change b94493e revealed that in the lance script rendering, at the
surface_end command, cleaning up the fbo stuff and enabling the
ordinary painting again was done in the wrong order.

Change-Id: I358dafeffe95b25303fc2a8dc1d61384b2ca64fb
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-04-04 10:55:44 +02:00
Fabian Bumberger
11b8794456 Fix QTextEdit autotest
Change-Id: I2178f1bb09f334ac518ede8f08c5b9268ea0c505
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-04-04 10:40:25 +02:00
Fabian Bumberger
5947fda8fd QNX: Fix QAbstractItemView autotest
One problem was that tests expect the top-level window to have a certain size,
which is not possible on BlackBerry. Another problem was that certain elements have a
dpi dependent size which the task250754_fontChange test did not consider.

Change-Id: I465ebe234a74d6150cdcbb7fc7e458a62155e0d0
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-04-04 10:39:21 +02:00
Sergio Ahumada
d743443c04 BlackBerry: Fix tst_qdialog::show{Maximized,Minimized} tests
Using show() might result in showFullScreen() on some platforms,
so let's use setVisible(true) which has the same effect and seems
to be a more crossplatform solution.

Change-Id: I712584ace2adbe73b99e620a1ae5e88ff328fffb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
2014-04-04 10:38:33 +02:00
Marc Mutz
b1d6af35a4 QWeakPointer: add member-swap
[ChangeLog][QtCore][QWeakPointer] Added member-swap function.

Change-Id: Ide3672dc74a9d8153e5f930290d938e8c23993b5
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-04-03 22:36:06 +02:00
Marc Mutz
e3a8e242ad QWeakPointer: add lock() for std::weak_ptr compatibility
[ChangeLog][QtCore][QWeakPointer] Added lock() method for std::weak_ptr compatibility.

Change-Id: I0851d91c51f5a4f04a855a1d8082234ce38396b4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-04-03 22:35:57 +02:00
Jędrzej Nowacki
ef2a2a9c03 Optimize QColor::setNamedColor
This patch removes two memory allocations from the algorithm.

Change-Id: I9366f9c5ce02fb1cae8adfbd8dff36c7f23af2a7
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-04-03 22:35:48 +02:00
Fabian Bumberger
e39f30a0d2 Fix QTabBar autotest for high DPI displays
Change-Id: Ic50d7fb9eb3568f16dd1422c380a4ae7bb288a51
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-04-03 11:07:07 +02:00
Fabian Bumberger
cc5bd47163 Fix the QGridLayout autotest
One issue was that the text of a QPushButton would stretch the widget if the
platform font is to big. The other issue was that the autotest did not expect
that show might translate to a showFullScreen on some platforms.

Change-Id: I3a9903979d766d04c402fda309d0492cfa506ed6
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-04-03 11:07:07 +02:00
Fabian Bumberger
24656de7e6 Fix QPushButton autotest
In the sizeHint test the show command was replaced by showNormal.
This fixes the test an all platforms where show translates to
showFullScreen.

Change-Id: I307790a6987c61a57679094b26818383815036a0
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-04-03 11:07:07 +02:00
Kai Koehne
b11adb825c Logging: Be also more strict with value of logging rule
Only accept lower-case "true" and "false", as documented.

The old check didn't match either the documentation, nor the QSettings/
QVariant behavior (where, for a boolean value, any lower-cased content
that not empty, "0" or "false" is considered true).

Change-Id: I317d29c16a27f862001b9dff02e8298df8acf5a6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2014-04-03 11:07:07 +02:00
Mitch Curtis
78f6d144d6 Serialize QPicture using the latest QDataStream version.
The QDataStream version with which QPicture was previously serialized
with was hard-coded to 11 (Qt 4.5). This prevents features of
serializable types used by QPicture from being serialized if they
were added after Qt 4.5; namely features of QFont like
HintingPreference.

[ChangeLog][QtGui][QPicture] QPicture now serializes its data properly
by also accounting for QDataStream versions greater than Qt 4.5.

Task-number: QTBUG-20578

Change-Id: Idd27682b187f4d4a3695c52bbf68e84853c024a8
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-04-02 15:18:11 +02:00
Jędrzej Nowacki
3b18ea3cb8 Re-add missing test to kernel.pro
Patch 9a08483d76 introduced a regression,
tst_qmetatype test was not meant to be removed.

Change-Id: I5456ffbbd9d9f8e461f828c6183e46dabf67952b
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-04-02 03:07:12 +02:00
Fabian Bumberger
2c36469a16 QNX: Fix OpenGL autotest
On QNX grabbing the frame buffer returns the content of the back buffer.
In order to execute the OpenGL tests properly a swapBuffers is executed before
in order to be able to retrieve the content of the front buffer.

The patch also documents this platform behavior.

Change-Id: I7a501818ec6eea061f2f54f95854f68cb72e0534
Reviewed-by: James McDonnell <jmcdonnell@qnx.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2014-04-01 23:35:21 +02:00
Iikka Eklund
0ab63b035a Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I2a6eb9dd7724931bc89f28bcc156e77c4e26d069
2014-04-01 11:44:27 +03:00
J-P Nurmi
0cb2c760c2 Item views: respect selection mode when closing an editor
Task-number: QTBUG-31411
Change-Id: I1a52eb739e0bc2afa7227f006461916df8ecaf48
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2014-04-01 05:27:00 +02:00
J-P Nurmi
cc08fc7bfd Item views: respect focus policy when closing an editor
Task-number: QTBUG-31411
Change-Id: Ib0a72755c35a553653ea014672d59979a550b7ae
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2014-04-01 05:26:50 +02:00
Marc Mutz
08b8f9d087 tst_QStringList: add more checks for removeDuplicates
Check whether a detach happened, and also check that non-consecutive duplicates
are properly removed.

Change-Id: Iac7a3d8fe5ed5a69a9a0b55ddbf95308f11122c2
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-03-31 22:54:14 +02:00
Marc Mutz
47d2d19cf6 QStringList: add op<< overload for QList<QString>
QStringList << QList<QString> already compiled, but was interpreted as
QStringList << QStringList(QList<QString>), which involves the QList
copy ctor. Adding the overload saves that copy.

Cannot use a using declaration here, since the return type is different.

Change-Id: I119cc98e7e2df24549a1abb158543b729edc30ef
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-03-31 22:54:14 +02:00
Dimitar Asenov
3270b4490b Add a new optimization flag to QGraphicsItem.
The new flag ItemContainsChildrenInShape is similar to the existing
flag ItemClipsChildrenToShape. Setting the new flag makes QGraphicsScene
assume that children are drawn within the shape of the current item
but this is not enforced by clipping. When an application manually
ensures this clipping boundary, setting the new flag removes the
overhead of enforcing the clip with ItemClipsChildrenToShape, while
still allowing other routines to behave more optimially by assuming
children are within the shape of the current item.

[ChangeLog][QtWidgets][QGraphicsItem] Added the
ItemContainsChildrenInShape flag that enables using optimizations
of ItemClipsChildrenToShape without the overhead of enforcing the clip.

Change-Id: I5496fe1ca331b77fd51e0df8a3ace2b8e939eaf2
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2014-03-31 22:54:14 +02:00
Friedemann Kleint
ebd8530cbc Make tst_qopengl more verbose.
Add more checks, compare size of converted images.

Task-number: QTBUG-31611

Change-Id: I995071f4be097c08aa2917be03fd7196882ae2c2
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-03-31 19:50:37 +02:00
Mitch Curtis
4f50be8d18 Properly serialize QFont.
Some data was never serialized (styleName, hintingPreference) and
some was incorrectly serialized (styleStrategy). This change also adds
auto tests for every applicable QDataStream version.

[ChangeLog][QtGui][QFont] QFont now serializes its data properly,
without any data loss.

Task-number: QTBUG-22814
Task-number: QTBUG-22946

Change-Id: I34e61b10662b7ad6c57054dacc7e1f522f5b5c5d
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-03-31 17:45:47 +02:00
Mitch Curtis
bd822bedfe Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2014-03-31 17:45:37 +02:00
Samuel Gaist
35a11d6fce OS X QSettings auto test/writing check update
This patch aims to provide an updated test that follows changes started
in 10.7: new rule is that only root can access SystemScope settings. It
also disables the sync() workaround code path which is at least not
executed during the tst_QSettings execution and returns wrong value to
the test.

From Apple's documentation:
"Note that modification of some preferences domains (those not
belonging to the “Current User”) requires root privileges (or Admin
privileges prior to OS X v10.6)—see Authorization Services Programming
Guide for information on how to gain suitable privileges"

https://developer.apple.com/library/mac/documentation/CoreFoundation/Reference/CFPreferencesUtils/Reference/reference.html

[ChangeLog][QtCore][QSettings] QSettings now returns the correct value
for isWritable() when using SystemScope settings.

Task-number: QTBUG-9824
Task-number: QTBUG-21062
Task-number: QTBUG-22745

Change-Id: Ib6a1490ec596b99d189ec4de9a0f28ecfd684172
Reviewed-by: Liang Qi <liang.qi@digia.com>
2014-03-31 12:12:21 +02:00
Marc Mutz
de10bf4955 QEvent: document and check when registerEventTypes() returns -1
In tst_QEvent, add a check that exhausts the available event type ids and verifies
that registerEventTypes() returns -1 in that case, as documented.

I haven't found a way to test the other case in which -1 is returned.

Since this test operates on a global write-only registry the new test case needs
to keep track of whether the earlier test cases have run successfully. If they
didn't, skip this test case.

Change-Id: I68ea9d17d10dcec22175994aba269dd09c9adf43
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-03-29 12:40:05 +01:00
Marc Mutz
ecdeaa4369 tst_QEvent: add another test-case for registerEventType()
A test for a hint > QEvent::MaxUser was missing.

Added.

Change-Id: I00c1c45f6673f35d4203df15b4ffc35f57273e46
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-03-29 12:36:27 +01:00
Israel Lins Albuquerque
075c876f9a [QtSql]QIBASE]add support for prepared queries in numRowsAffected
Prepared queries need to be handled as procedures.

Change-Id: I4b4d7743fe45c416ca83ceb942aa48d79731f2f8
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2014-03-29 08:46:00 +01:00
Friedemann Kleint
0fadbc7ed9 tst_qaccessibility: Introduce QTRY_VERIFY to menuTest().
Fixes failures on Windows 8.1.

Task-number: QTBUG-37822
Change-Id: I30460f430e2249555c4e857237e27aa9b03dfa1b
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-03-28 22:52:19 +01:00
Friedemann Kleint
27fa02e29d tst_qgraphicsproxywidget: Fix hang in actionsContextMenu().
Change the test widget to use a non-single-shot timer
to hide the menu once it has become visible.
The test shows hangs on Windows 8.1 CI nodes.

Task-number: QTBUG-37822
Change-Id: I8fc782e53256616119920aef714f89f25863b39f
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-03-28 22:52:19 +01:00
Friedemann Kleint
b980df3f3c Stabilize tst_qtoolbutton for Windows 8.1.
Ensure triggered() and task176137_autoRepeatOfAction()
are using an active main window. Change click timer in
triggered() to repeat until the menu is visible and
add a timer to close the widget and bail out if the
simulated click fails to close the menu.

Task-number: QTBUG-37822
Change-Id: If675660d02335bffd5caa89796914924dad1a909
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-03-28 22:52:19 +01:00
Leonard Lee
685f8fe550 Do not rely on the list of standard font sizes for QFontDialog.
QFontDialog should always show the correct size, even if the size
is not available in the list of standard font sizes. Native font
dialogs across common platforms show the correct size at all times.

Inside init() function, the size list requires proper initialization
since the initial value of size is zero.

Task-number: QTBUG-10317
Change-Id: Idc9e922ac95f797ac98bbf6c885e52828c4c48fd
Reviewed-by: Liang Qi <liang.qi@digia.com>
2014-03-28 22:52:19 +01:00
Lars Knoll
c4d8734c50 Avoid out of bounds memory reads when scaling images
The calculation of the width/height required for the
scaling algorithm was prone to floating point rounding
issues, where the lower value got rounded down, the higher
one rounded up. This could lead to a situation where we
iterated over one more line/pixel in the line than we have
in the source image.

Correct this by passing the dimension of the source image into
the function and bounds checking the values before iterating.

Task-number: QTBUG-35927
Change-Id: If44b2235a479224660d508a0504fec40d724763a
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-03-28 22:52:19 +01:00
Sergio Ahumada
d688b7c07c Deprecate QFont::setRawName() and QFont::rawName()
We don't support xlfd fonts anymore and indeed QFont::setRawName()
is an empty method.

[Changelog][QtGui] QFont::setRawName() and QFont::rawName() are
deprecated.

Change-Id: Ic52d42a9bc200ba8b246dd4e28c77f84e086dad5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-03-27 22:02:39 +01:00
Erik Verbruggen
dd453adbe7 Mac: make FSEvents-based QFileSystemWatcherEngine more robust.
- Record the last event ID with every callback. This event ID is passed
to FSEventStreamCreate when restarting the stream, so the watcher will
receive all events that occurred since invalidating the previous stream.

- Never start with kFSEventStreamEventIdSinceNow, because this will
generate a (bogus) soft-assert in FSEventStreamFlushSync in CarbonCore
when no event occurred since stream creation. The last globally
generated event ID is used instead to simulate the "now".

- Do not dispose and recreate the stream in the callback, but use a
queued signal-slot connection to schedule this on thread that owns the
watcher.

Change-Id: I02f5a845d9e27f9853ed97925ab9c7a5bc0dede1
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-03-27 17:51:21 +01:00
Friedemann Kleint
9a9feab102 Check for administrative rights in tst_qsettings.
Introduce function checking whether the system settings in
native format can be written to. If not, default to user scope or
skip the respective tests instead of failing.

Task-number: QTBUG-37822
Change-Id: I330aff9b79bb22254216f022af807e010bc8e8ba
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-03-27 17:51:21 +01:00
Eskil Abrahamsen Blomfeldt
76eefbe8af Android: Fix missing data from some autotests
After a test ended, we would instantly try to fetch its output,
but at this point, it might still not be available through the
adb interface, probably due to some cache synchronization in the
file system? Adding an arbitrary three second pause between
finishing the test and requesting the file fixes this. If the
error pops up later again, we could do something more robust,
like going in a loop for X seconds until the file has been fetched.
Especially if detecting task finish was successful.

Task-number: QTBUG-37444
Change-Id: I5442e1e0181f489b0626834a390e46c15bc0b371
Reviewed-by: Simo Fält <simo.falt@digia.com>
2014-03-27 15:17:24 +01:00
Fabian Bumberger
74cade1ee4 Fix application font removal when using FontConfig
This patch fixes an issue when a font that was added with
QFontDatabase::addApplicationFont can not be removed any more.
The reason for that is that QFontconfigDatabase::addApplicationFont
adds the font to the FontConfig application set from where it
cannot be removed any more and is picked up every time the font database
is repopulated (e.g. after a call to QFontDatabase::removeApplicationFont).

This also fixes the QFontDatabase autotest which unfortunately does
not fail on linux, because it tries to add "FreeMono" (which in most
cases is already there as a system font). So this patch removes FreeMono
and adds LED_REAL as test font.

Change-Id: I70fc823075923aa426da1eb3e052affcc416e399
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-03-27 14:41:53 +01:00
Fabian Bumberger
7ca958eb61 QNX: Fix QWindow autotest
On QNX a actual platform window is not created unless the window is explicitly
postet (raster) or a swapBuffers (opengl) is executed.

Change-Id: Ia06b97ea1a477d59e78d74d895c5d6ba6dd86edf
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-03-27 14:41:28 +01:00
Frederik Gladhorn
f16d690a2f Accessibility Mac: Fix handling of top level widget
This simplifies how we handle QNSView for accessibility purposes.
Instead of trying to half-merge the top level widget
(window->accessibleRoot) into the view, just have the view
always return it as child.
This makes the accessibility implementation for QNSView simpler
and makes applications that show a top level widget such as a button
possible. (We would return accessibility ignored for the button before).

As a side effect finding the active focus and hit-testing should be more reliable as
well.
Task-number: QTBUG-37794

Change-Id: Ib52037f88da8887a0bdc77204b0f3daddfe7709d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-03-27 14:37:16 +01:00
Laszlo Agocs
ad1c088a2a Fix the QOpenGL autotest's offscreen surface handling
Be more robust.

Change-Id: I0e37612681140530c81cfd0082cca61f0f21958c
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-03-27 14:29:39 +01:00
Sergio Ahumada
eab7efd1ee Stabilize tst_QProcess::softExitInSlots()
This test takes more than 5000ms to finish some times, so waiting
for 10000ms should be enough to make it more stable on all
platforms.

  ../tst_qprocess.cpp:1072 :: [gui app]
  QTestLib: This test case check ("proc.waitedForFinished") failed because the requested timeout (5000 ms) was too short, 6150 ms would have been sufficient this time.

Change-Id: I266ad0e65bf3c84e73b7ca6543dc15335dad4c99
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
2014-03-27 08:21:23 +01:00
Sergio Ahumada
5ee07bf691 Mark some tests as XFAIL on QNX
Extending this to stock QNX as well since it is not
BlackBerry 10 specific.

  - tst_QNumeric::floatDistance()
  - tst_QNumeric::floatDistance_double()
  - tst_QtJson::testNumbers_2()
  - tst_QtJson::toJsonLargeNumericValues()
  - tst_QtJson::parseNumbers()

Task-number: QTBUG-37066
Change-Id: If0e5d4fbefac5e8a0efed8ef8b1b7655ff6e7766
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
2014-03-27 08:21:14 +01:00
Lars Knoll
5279134935 Reuse one QCollator instance for QString::localeAwareCompare
Constructing a QCollator is somewhat expensive, and made
localeAwareCompare really slow. As QCollator (at least with
the ICU implementation) is not thread safe, use one collator
per thread. This speeds up collation of a long list of strings
by a factor of 250 for the test case in the bug below.

Task-number: QTBUG-36149
Change-Id: I645cdc3546347d1dcc7a03b7563b628c7f756944
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-03-27 07:31:01 +01:00
Friedemann Kleint
5b00bb39f2 Polish tst_qsslsocket a bit.
Output the SSL library version, output socket error string on connection
failure consistently, silence numerous warnings about QIODevice not
being open in tst_QSslSocket::constructing.

Change-Id: Ia23d42de5b2daca55b2f6f50af025d61e99c52a0
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-03-26 07:22:35 +01:00
Marc Mutz
84c10500b1 QVector: add removeOne(), removeAll() for QList compatibility
Eases migration from QList to QVector.

[ChangeLog][QtCore][QVector] Added removeOne(), removeAll() for
QList compatibility.

Change-Id: I4211afb2e077c187d0a39f0ac4528f0c66721fb3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-03-26 00:21:22 +01:00
Marc Mutz
9157a1f97a QVector: add more insert() tests
Add more insert() tests, since the existing ones only covered
the index-based insert() variant and only movable types.

Change-Id: Ifce7a67be0bef45f926f13521873a1d77430e1e3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-03-26 00:21:15 +01:00
Konstantin Ritt
48679a3748 Fix tst_QTextScriptEngine failures on some platforms
The text shaping process has been unified for all platforms.

Task-number: QTBUG-23064
Task-number: QTBUG-24565
Task-number: QTBUG-26495

Change-Id: Ida4c4be85f1a72c04399d2e6760fa36b33a0464e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-24 21:37:31 +01:00
Frederik Gladhorn
3b5c0bc078 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/gui/image/qjpeghandler.cpp

Change-Id: I9db3acea7d5c82f5da679c8eaeb29431136665f0
2014-03-24 16:10:15 +01:00
Shawn Rutledge
efcfa0b252 QGuiApplication: send TouchCancel when touch is interrupted by popup
QQuickWindow depends on maintaining state of known touch points
between events, so it needs to be notified when it will not be
receiving the corresponding release event for one or more.
This temporary fix needs to be reverted when we have a proper
event forwarding solution.

Task-number: QTBUG-37371

Change-Id: I5dc40af6feac425be8103c1586f8ebe3a6aad20d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-03-21 21:08:27 +01:00
Fabian Bumberger
70624ed9d6 QNX: Fix QGraphicsItem autotest
Change-Id: I85b0938e6ebeb9f24e24b51a594c01b74167a177
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
2014-03-21 17:55:55 +01:00
Jens Bache-Wiig
23595107cd Respect scrollbar position setting on Mac
This was a regression from Qt 4.7.

[ChangeLog][Widgets][QScrollArea] Respect scrollbar setting for
click-position on Mac.

Task-number: QTBUG-36314
Change-Id: I8bdb1aec9b308b0907f5db29d3519998bc843c18
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2014-03-20 19:01:53 +01:00
Peter Hartmann
d9f5200fb8 network: add support for NTLM Session Security
tested manually with internal proxy.

Patch-by: Jonathan Lauvernier <Jonathan.Lauvernier@gmail.com>

Change-Id: Ief5b4579b3444ce70eb99637edf771d37d3971fb
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-03-20 19:01:53 +01:00
Kai Koehne
ba4d154737 Logging: Remove PatternFlag::Invalid from QLoggingRule
The flag is not orthogonal to the rest, and e.g. checking with

   flags & Invalid

will fail. Rather make it explicit by comparing with 0.

Change-Id: I428d5e71f5ecd05f61d543aaa78532548ef93d5a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-03-20 19:01:53 +01:00
Laszlo Agocs
8adca56674 Resurrect advanced bindTexture() features in QtOpenGL
During the Qt 4 -> 5 migration the setting of the extension flags
in QOpenGLFunctions/Extensions suffered a regression: flags like
GenerateMipmap were never set. This led to the unfortunate sitation
that features that were tied to these flags, like compressed texture
support or mipmap generation, got disabled.

This is now corrected by checking for the extensions like Qt 4 did.

Task-number: QTBUG-37588
Change-Id: I4a7beb1b435af11e05f5304aa04df2ec63b34c18
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-03-20 14:11:33 +01:00
Kai Koehne
503d761c08 Print when logging rule is invalid.
Print a warning when an invalid logging rule is parsed.

Change-Id: I3bf9a6df4053d36b3803652b2faa86168d5222bc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-03-20 13:45:35 +01:00
Frederik Gladhorn
b8c96f2eb9 Accessibility: Improve QTextEdit
EditableTextInterface was implemented but not reported to the
accessibility bridges.
Newlines in QTextEdit when using QCursor::selectedText are returned as
unicode paragraphs, replace them by newlines.

[ChangeLog][QtWidgets][Accessibility] Fixed QTextEdit not reporting
newlines to accessibility frameworks and add editable text interface.

Change-Id: Iac21e70f5468a16f8abf242ae148290dbab3f8e4
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-03-20 12:49:33 +01:00
Tobias Koenig
1f6e461533 Fix positional binding values order in QSqlQuery
Adapt the stringification code, that is used to produce the
keys for QSqlQuery::boundValues() return value, to keep the
right order of the binding values.

Task-number: QTBUG-12186
Change-Id: Ic11a455bfd9ffd1418b1b021ce5cf78cae9b4504
[ChangeLog][QtSql] Fixed the order of values with positional binding in a QSqlQuery
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2014-03-20 10:36:34 +01:00
Friedemann Kleint
48773be981 Do not run tst_qcolumnview in parallel
Task-number: QTBUG-36395

Change-Id: Id1f5cfeca3f18d6d7d1f2354211e15d349dd7b8f
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2014-03-19 19:51:20 +01:00
J-P Nurmi
3a4b8cbc3d Fix tst_QColumnView::scrollTo()
The test relies on active focus, so activate the test window in
the beginning of the test to avoid undesired focus widget changes
by QApplication::setActiveWindow() during the test.

Task-number: QTBUG-36395
Change-Id: I6febec7d552224b1754aaf57520ed6d435d29563
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-03-19 19:50:50 +01:00
Frederik Gladhorn
634b9b1e5c Do not run tst_qabstractitemview in parallel
This test waits for window activation and gets disturbed by mouse
movements.
The test duration is not long enough to justify the flakyness (around 10
seconds on my laptop).

Change-Id: I985044f954c09442220db3ca318045c04ef6bb77
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-03-19 01:02:03 +01:00
Dimitar Asenov
9891c5051f Add a new optimization property to QGraphicsScene
The minimumRenderSize is a qreal value that is used as a lower bound to
determine what items are visible when a scene is rendered. If an item's
view-transformed width or height are less than minimumRenderSize then
this item is considered to insignificantly affect the final result and
is not drawn. If the item clips its children to its shape they are
automatically not drawn. This greatly reduces the drawing overhead
for scenes with many items rendered in a zoomed out view.

[ChangeLog][QtWidgets][QGraphicsScene] Added the minimumRenderSize
property which can be used to speed up rendering by not painting
items, smaller than a give size.

Change-Id: Ie208234707dffb4d2fc620fc5d1514e0c144d9a8
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2014-03-18 19:29:16 +01:00
Jani Heikkinen
23b47a8d4e Merge "Merge remote-tracking branch 'origin/release' into stable" into refs/staging/stable 2014-03-17 13:48:12 +01:00
John Layt
2c175d3748 QPrinter - Expect failure of QPrinter page size test
The page size test can get confused when two printer papers have the
same size, but the code being tested is actaully correct.  Put a temp
QEXPECT_FAIL on the test and some debug statements so we can see why it
fails and fix the test as required.

Change-Id: I160ba2ed7344500d89bdcb9bb416863713fef84b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-17 13:46:29 +01:00
John Layt
833a43d56c QtPrintSupport - Fix QT_NO_PRINTER build
Fix the QT_NO_PRINTER build for issues that have accumulated over last
few months, and in the new changes already approved.

Change-Id: I9aed21dee861837fd1a68a96692c873a4f5be293
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-17 13:46:26 +01:00
John Layt
1ffd79bfb7 QPrinter - Fix winPageSize() on Mac and Linux
Using QPageSize internally provides the Windows ID on all platforms so
remove the conditional compile on the QPrinter api and add support to
the print engines.

Change-Id: I31e23d5090a9b6ceb087c29dead050b0ee1855a5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-17 13:46:13 +01:00
John Layt
dbc50e06df QPrinter - Use QPageSize and QPageLayout
Use QPageSize and QPageMargins to get/set values in the print engines,
add api to directly set the values, and rewrite the docs to make the
paper-based api obsolete instead of the page-based api.

Add new PPK keys to pass QPageSize, QPageMargins and QPageLayout to the
print engines to ensure no level of detail is lost, e.g. for custom
sizes passed to QPrinter.

[ChangeLog][QtPrintSupport][QPrinter] QPrinter can now use QPageSize
and QPageLayout in the public api to control the page layout for a
print job.

Change-Id: Iee39a4042bcd6141d29b0a82b49066d7a7a78120
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-17 13:46:10 +01:00
John Layt
ab42391cd0 QPrintEngine - Switch Windows to QPlatformPrintDevice
Change the Windows QPrintEngine implementation to use the
QPlatformPrintDevice to obtain device information, and use QPageSize to
obtain page size conversions.  A following change will use QPageLayout
to store that page size.

Change-Id: I990943e2b62ab6dab2c4d4a292c7ed7261beadf2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-17 13:46:04 +01:00
John Layt
9e29fab38d QPdfWriter - Use QPageSize and QPageLayout
Add support to QPdfWriter for QPageSize, QPageLayout, and resolution.

[ChangeLog][QtGui][QPdfWriter] The QPdfWriter now supports setting
the PDF orientation, layout and resolution by using QPageSize and
QPageLayout.

Change-Id: I9c269f997ec540dac1989f355c6a2e7488947966
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-17 13:45:52 +01:00
John Layt
b0428926ce QPrinterInfo - Switch to QPlatformPrintDevice
Change the QPrinterInfo implementation to use QPlatformPrintDevice as
the backend.  Remove all the old QPrinterInfo related code from the
QPA plugin.  Add public api to QPrinterInfo to support some features
from QPlatformPrintDevice.

[ChangeLog][QtPrintSupport][QPrinterInfo] Added new public api for
isRemote(), state(), defaultPageSize(), supportedPageSizes(),
supportsCustomPageSizes(), minimumPhysicalPageSize(),
maximumPhysicalPageSize(), supportedResolutions(),
availablePrinterNames(), and defaultPrinterName(). The use of
availablePrinters() is discouraged due to performance concerns.

Task-number: QTBUG-35248

Change-Id: Ic38323a930549ad67bf04a1a6bb43d623dfe6a33
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-17 13:45:44 +01:00
John Layt
f50d46e5eb QPlatformPrintDevice - New QPA base class
Add a new QPA class to abstract Print Devices.  Each platform instance
will encapsulate all required details about a print device instead of
the code being distributed throughout the print engine and print
plugin.

Change-Id: I7f6a537ad55a6e7f599d83f461b1e2ee62b15094
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-17 13:45:31 +01:00
John Layt
5eeed00f4d QPageLayout - Add new QPageLayout class
New QPageLayout to encapsulate page layout details including page size,
orientation and margins.  Scale may be added later.

Subsequent changes will use this class in the paged paint devices,
paint engines, print engines, and print plugins to replace multiple
inconsistent local implementations.

[ChangeLog][QtGui] Added class QPageLayout to support handling page
layouts including the page size, orientation and margins.

Change-Id: Ife1ddd6c2a8d1516542be2eb37425111f41cd5c7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2014-03-17 13:45:27 +01:00
John Layt
87d802465b QPageSize - Add new QPageSize class
New QPageSize class to encapsulate paper sizes and names to ensure all
sizes and conversions are consistent and match the Postscript standard
sizes.

Subsequent changes will use this class in the paged paint devices,
paint engines, print engines, and print plugins to replace multiple
inconsistent local implementations.

[ChangeLog][QtGui][QPageSize] Added new QPageSize class to implement
Adobe Postscript PPD standard page sizes. This class supports the
standard page sizes, names and keys from the PPD standard, and provides
convenient size and rect conversion methods.

Change-Id: Ie2c8be0c3df0d29ac5da4cd9877ad41d0982633c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-03-17 13:45:19 +01:00
John Layt
ad0163d088 QPrinter - Add page metric tests
Add more page metrics tests to expose the many bugs and inconsistencies
in the page layout handling.  No platform or pdf backend passes all
these tests so they are skipped for now, but following commits will use
the tests to ensure the re-write of the page layout handling fixes the
many problems in a consistent way for all backends.

Change-Id: Ic5b16aa08dfe2bd9a9191662fd2bbe6b913e15c9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2014-03-17 13:45:14 +01:00
Jędrzej Nowacki
ac178eae4e Fix Q_DECLARE_METATYPE macro
The macro should stringify value of the given token not the token
itself.

Task-number: QTBUG-37547
Change-Id: I90f4fa613bd13d5a581828ab13f620b40dfd3593
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-03-17 13:05:07 +01:00
Frederik Gladhorn
a2850e54d5 Merge remote-tracking branch 'origin/release' into stable
Conflicts:
	src/gui/painting/qdrawhelper.cpp
	src/gui/painting/qdrawhelper_avx.cpp
	src/gui/painting/qdrawhelper_x86_p.h

Change-Id: I09352d05119f6fd000319074a2705b38361b2c90
2014-03-17 12:29:11 +01:00
Friedemann Kleint
037bc9b638 Add verbose messages to tst_qnetworkreply.
Task-number: QTBUG-37449

Change-Id: Ib3802ddd51b908a68d8c893ce49010aeeb117db8
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-03-15 10:45:17 +01:00
J-P Nurmi
49b14f7a8b Remove the _qt_filedialog_xxx hooks
These internal and obsolete hooks are no longer used. The correct way
to provide platform dialogs in Qt 5.x is to implement a platform theme
plugin, as was done for GTK+ 2.x.

Change-Id: I3f1474fbf760130106b3c47173eaedd2f1a919bf
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2014-03-15 10:44:47 +01:00
Andrew Knight
42afaa992a d3dcompiler_qt: Remove control file semantics
This simplifies the compiler control semantics by always using the
packaged compiler if it is available. With no packaged compiler, the
service is assumed to be running if the directory structure is present.
Use of a packaged library can be overridden by setting the environment
variable QT_D3DCOMPILER_DISABLE_DLL to 1.

When the runtime compiler is used, the source will no longer be
logged, and the compilation output will no longer be cached.

Change-Id: Ib07f517e7043d7785bdfa9da55abd34df518eeed
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-03-14 22:40:24 +01:00
Janne Anttila
391c2c12ab Introduce GENERATED_TESTDATA variable and fix qresourceengine test.
testcase.prf cannot be loaded from pro file for various reasons,
see qtbase commit history for details.

Moved runtime testdata logic from pro file to testdata.prf, and
thus made is reusable in other test cases as well.

Change-Id: I500d08dc4951e4eda862071e4ddd3e0f6de8c3d2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-03-14 22:39:58 +01:00
Friedemann Kleint
08f0dbd13c Fix spurious XPASS in tst_QGraphicsAnchorLayout.
Seen on Windows:

XPASS  : tst_QGraphicsAnchorLayout::stability() QCOMPARE(sameAsPreviousArrangement, true) returned TRUE unexpectedly.
tst_qgraphicsanchorlayout.cpp(1399) : failure location

Move check into loop with descriptive message on fail, do not error
out if it actually passes. This now typically prints:

XFAIL  : tst_QGraphicsAnchorLayout::stability() The layout has several solutions, but which solution it picks is not stable ( QRectF(30,0 0x10) != QRectF(30,0 10x10) , iteration 3 , item 4 )

Change-Id: Iae8553dbbcedeb70d5d672e3cefbd1f06a63d27d
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-03-14 22:39:19 +01:00
David Faure
c4650779c4 Fix tst_qthreadpool under high load.
The tasks might not have run yet at the time of the QCOMPARE, so we need
to acquire on the semaphore in order to ensure that this is the case,
just like in the previous testcase.

Change-Id: I1da72bb07c2f53760b3bf912fc26aaf10ed18d48
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-03-14 22:38:49 +01:00
Janne Anttila
4b8aee7ca0 Fix qchar testdata installation.
NormalizationTest.txt does not exist in the project root, but under 'data'
directory. TESTDATA is converted to INSTALLS rules in testcase.prf.
INSTALLS rules generated in testcase.prf does not set 'no_check_exist'
CONFIG variable. Thus qmake will not install NormalizationTest.txt since
it cannot find it from defined location.

Even TESTDATA has been incorrectly defined, NormalizationTest.txt
has been found in majority of the platforms thanks to QFINDTESTDATA
flexibility. However it causes problems on sand-boxed platforms such
as WinRT.

Fixed by defining the relative path to NormalizationTest.txt in TESTDATA
so that qmake can find the file when processing INSTALLS variable.

Change-Id: Id9a28db2a00b17d2c0136e6ff32f421b21137898
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Liang Qi <liang.qi@digia.com>
2014-03-14 18:19:00 +01:00
Bernd Weimer
4d09a54b75 QNX: Make qrawfont auto test pass
FreeType engine on QNX has the same weakness as on Windows, so some
tests are expected to fail.

Change-Id: Icd8fcafae425246ca25ad8e029bf8d6fdc7bd250
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2014-03-14 15:42:59 +01:00
David Fries
e6cb06a835 correct send vs sent grammar
Correct the tense of send vs sent in comments and documentation.

Change-Id: I1c5ce9a7b1e49b8b0e8dcfde7d732e4c69acf73a
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-03-14 15:27:03 +01:00
Janne Anttila
f79202805e Disable UNC tests on WinRT.
Based on file system implementation for WinRT, the UNC paths are not
supported on WinRT, so lets disable corresponding tests as well.

Change-Id: Ib45ae618f39d5da39a822160096599b30204cf71
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-03-14 15:26:49 +01:00
Morten Johan Sørvig
7bd7699e17 Add sizeLessWindow test case.
Verify that QOpenGLContext works with QWindows that
do not have an explicit size set.

Task-number: QTBUG-35342

Change-Id: I91be7beb0062c5825fc58273c701c396b6423256
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-03-14 15:26:41 +01:00
Janne Anttila
71b5aa1a2a Removed unnecessary TESTDATA statement from qmessageauthenticationcode.
QMessageAuthenticationCode autotest does not have data folder for
TESTDATA. It seems that pro file is copy/pasted from another one which
actually have data. Removed the unnecessary statement since it caused
problems for https://codereview.qt-project.org/77981.

Change-Id: Ide753e5692bd2f469217760173a9b60f2f646770
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Liang Qi <liang.qi@digia.com>
2014-03-14 15:26:21 +01:00
Shawn Rutledge
2258d8f9d0 Disable splashScreenModality test: dialog is going under splash screen
That's a bug, but this test causes CI problems until it's fixed.

Task-number: QTBUG-35169
Change-Id: I27b3a61437312d2217743670fa14510d9340d8c1
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Reviewed-by: Simo Fält <simo.falt@digia.com>
2014-03-14 15:26:10 +01:00
Marc Mutz
18d781af74 tst_QSharedPointer: add more tests for forward-declared payloads
It is not sufficient that QSharedPointer<ForwardDeclared>'s default ctor
and dtor compile. Copy/move assignment/construction and swapping should work, too.

Arguably, there are more functions that should compile with just a forward-declared
payload, but this is a start.

Change-Id: I75470e3d4ba949c3e735c4078cbc123d53ec3007
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-03-14 13:34:37 +01:00
David Faure
14bd7a5881 Add QDebug operator for QMimeType.
Task-number: QTBUG-35686
Change-Id: I72be7cf9374f86e8cb3e6946129bbfec8fec9616
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-03-13 17:59:55 +01:00
David Faure
91c9cae720 QDebugStateSaver: call maybeSpace() in destructor.
tst_qdebug didn't test adding something else after the MyLine object,
so I didn't realize that a space was missing there. All debug operators
should end with maybeSpace(), but with the settings of the caller, so this
requires restoring the settings before calling it. To make it convenient
for all << operators, the destructor of QDebugStateSaver takes care of that.

Change-Id: I18ab78d99d7ee3be951082b5b5d34718ee60e21d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-03-13 17:59:50 +01:00
David Faure
73d761ffe5 Add ReadOnlyChange event to widgets that support setReadOnly(bool).
This is useful for widget styles to react when widgets are set
read-only, e.g. to update their palette accordingly.

[ChangeLog][QtWidgets] All widgets with a setReadOnly method now
send a ReadOnlyChange event (e.g. for app-specific palette changes)

Change-Id: I74719a3e1b7d034d9bfc94305f846f42aae935bd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-03-13 17:59:44 +01:00
Sergio Ahumada
27016b89ae Merge remote-tracking branch 'origin/stable' into dev
Change-Id: Idec54e19963e8d88c711cb179cffc81596323899
2014-03-13 15:57:11 +01:00
Kai Koehne
ef43967fcd Logging: Let user configure rules via QT_LOGGING_RULES
Check also for rules set in an environment variable QT_LOGGING_RULES.
This makes it even more convenient to set rules e.g. for just one run of an
application, without having to create a logging configuration file. It
is also more in place with the current way we enable/disable debugging
of parts of Qt via environment variables.

Change-Id: I4d05976f2b6c12bca472552ffa22345475cd01de
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Tomasz Olszak <olszak.tomasz@gmail.com>
2014-03-13 13:26:51 +01:00
Kai Koehne
19693362e7 Use QStringRef for parsing of logging rules
Use QStringRef to speed up the parsing of the left side of logging rules.

Change-Id: Idd4d75496e3865d092f2802c45928a414c14c615
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-03-13 13:26:36 +01:00
Kai Koehne
2350c7e35c Make parsing of categories in logging rules more strict
Do not accept rules with wildcards in the middle.

Change-Id: If6fa71629c46bc4127aa8bd475643bc0e8a9f57c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-03-13 13:26:26 +01:00
Kai Koehne
b3871dc804 Make parsing of categories in logging rules consistent.
The documentation says that the left side of a logging rule has the syntax

<category>[.<type>]

with optional wildcard '*' as the first or the last character (or at
both positions.

However, so far we didn't allow

qt.*.debug

But what we did allow is implicit dropping of trailing '.', e.g.

qt.* matched also 'qt'

Fix these by splitting up the '.type' in advance, and then do string
matching only on the 'real' category names.

Change-Id: Iab50ad0fc673464e870f5ab8dfb3245d829b3107
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-03-13 13:26:14 +01:00
Kai Koehne
f6d0c67d30 QDebug: Allow text stream formatting for 64 bit numbers
Use the QTextStream stream operator for formatting 64 bit numbers,
just like we do for other numbers, too. This ensures all numbers in
a QDebug stream e.g. respect the hex and showbase modifiers.

The original reason for formatting qin64, quint64 with QString::number
is unclear (pre-dates the original qt4 git import). Maybe QTextStream
did lack proper support for 64 bit numbers back then.

Task-number: QTBUG-36841
Change-Id: I049516c2a8394c9c1a708f86c3d950418a20a957
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-03-13 13:26:02 +01:00
Sergio Ahumada
9f87c3663d tests: Mark tst_qdbus* tests as insignificant on OS X
D-Bus libraries were recently added to OS X 10.7 making these
tests to be executed for first time.

Task-number: QTBUG-37469
Change-Id: Ia7a74a45b18d4a645307f7fb7666236c5e009e5f
Reviewed-by: Simo Fält <simo.falt@digia.com>
2014-03-13 13:25:49 +01:00
Friedemann Kleint
eb0032687f Stabilize tst_qnetworkreply on Windows.
Do not close connection in slot bytesWritten() since that can
cause clients to fail with "Connection Closed". Instead, use
deleteLater() to close properly and prevent leaking the sockets.

FAIL!  : tst_QNetworkReply::qtbug28035browserDoesNotLoadQtProjectOrgCorrectly() 'waitForFinish(reply) == Success' returned FALSE. ( QUrl( "http://localhost:58240" )  failed: # 2 "Connection closed" )
..\tst_qnetworkreply.cpp(7067) : failure location

Task-number: QTBUG-37449

Change-Id: Ib92cb62fae523370b2fb45e1ccfa217559732bc8
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-03-13 13:25:35 +01:00
Simo Fält
e5785d6322 Fix network tests relying on troll.no
Replacing old troll.no domain with qt-project.org domain. Using troll.no
doesn't work anymore.

Change-Id: Ic6fa71b044d1adbdc66c875b47bfdc256a2afc8e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-03-13 13:25:26 +01:00
Friedemann Kleint
9c5e441394 Skip the test 'abort' of tst_qftp.
The test takes too long and fails:

FAIL!  : tst_QFtp::abort(WithoutProxy:get_fluke01) '(int)newData_ba.size() == bytesDone' returned FALSE. ()
tst_qftp.cpp(1886) : failure location
FAIL!  : tst_QFtp::abort(WithoutProxy:get_fluke01) Network operation timed out
tst_qftp.cpp(1392) : failure location
FAIL!  : tst_QFtp::abort(WithoutProxy:put_fluke01) 'bytesDone != bytesTotal' returned FALSE. ()
tst_qftp.cpp(1406) : failure location
FAIL!  : tst_QFtp::abort(WithSocks5Proxy:get_fluke01) '(int)newData_ba.size() == bytesDone' returned FALSE. ()
tst_qftp.cpp(1886) : failure location
FAIL!  : tst_QFtp::abort(WithSocks5Proxy:get_fluke01) Network operation timed out
tst_qftp.cpp(1392) : failure location
FAIL!  : tst_QFtp::abort(WithoutProxyWithSession:get_fluke01) '(int)newData_ba.size() == bytesDone' returned FALSE. ()
tst_qftp.cpp(1886) : failure location
FAIL!  : tst_QFtp::abort(WithoutProxyWithSession:get_fluke01) Network operation timed out
tst_qftp.cpp(1392) : failure location
FAIL!  : tst_QFtp::abort(WithoutProxyWithSession:put_fluke01) 'bytesDone != bytesTotal' returned FALSE. ()
tst_qftp.cpp(1406) : failure location
FAIL!  : tst_QFtp::abort(WithSocks5ProxyAndSession:get_fluke01) '(int)newData_ba.size() == bytesDone' returned FALSE. ()
tst_qftp.cpp(1886) : failure location
FAIL!  : tst_QFtp::abort(WithSocks5ProxyAndSession:get_fluke01) Network operation timed out
tst_qftp.cpp(1392) : failure location
Totals: 327 passed, 10 failed, 4 skipped
QtQA::App::TestRunner: warning: test duration (398 seconds) is dangerously close to maximum permitted time (450 seconds)
QtQA::App::TestRunner: warning: Either modify the test to reduce its runtime, or use a higher timeout.
QtQA::App::TestRunner: test failed, running again to see if it is flaky...

Change-Id: I122641f174927c6b3668df05c79f88e38b88042f
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-03-10 20:41:43 +01:00
Friedemann Kleint
e9a93e888d Increase timeout in tst_NetworkSelfTest.
Try to fix frequently failing test:

FAIL!  : tst_NetworkSelfTest::ftpProxyServer() Failed to receive data in step 32: timeout
tst_networkselftest.cpp(230) : failure location

on Windows. Introduce timeout constant, add message.

Change-Id: I709f0b34cd1cfe5d3c64cf61ccb7907bd616bc54
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-03-10 20:41:35 +01:00
Thiago Macieira
d1e2235553 Revert the QByteArrayList addition to Qt 5.3
This reverts commits f12b0f9a38
("QByteArrayList: optimize op+"),
f96f2fe367 ("Enable QByteArrayList
tests"), and 4f23f0530a ("new
QByteArrayList class").

This class is coming back in Qt 5.4.

[ChangeLog][CHANGELOG FIX] Remove the line about QByteArrayList being
added.

Change-Id: I890ab2b34a9b3e575512eb306d0f241143a867cf
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-03-08 00:21:53 +01:00
Samuel Gaist
be81c58845 Add Objective-C specific type converters to QByteArray
This patch adds the Objective-C NSData/CDataRef converters to
QByteArray

This will replace the current converters offered in QMacExtras

[ChangeLog][QtCore][Objective-C] Added NSData/CDataRef converters for
QByteArray

Change-Id: I7a0f14bee4271798db345f3c5efd26ac671a3ea4
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-03-08 00:21:53 +01:00
Friedemann Kleint
898f7ea1ec Sanitize tst_qftp.
- Replace SRCDIR define by QFINDTESTDATA
- Replace QVERIFY by QCOMPARE where applicable
- Introduce QVERIFY2 with message for comparisons

Change-Id: Ib5a6b0f09428587281e1b9521e4d8a8117c1afdb
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-03-06 17:22:55 +01:00
Jędrzej Nowacki
9a08483d76 Try to speedup tst_qmetatype.cpp compilation with clang.
The test instantiates enormous amounts of templates in one compilation
unit. All clang versions, that I tested, suffers from performance issues
while compiling the test, the cost depends on the version. The most
affected are shipped by Apple.

Task-number: QTBUG-37237

Change-Id: I0959c1a4a6faee448ae1dae5c1e70ee06cefbd9c
Reviewed-by: Simo Fält <simo.falt@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-03-06 17:22:55 +01:00
Jędrzej Nowacki
564297d7c4 Reduce clang compilation time of tst_qmetatype by ~50%
We do not need to check all possible basic type combinations in
the autoregistration test.

Change-Id: Ibfb97a93d9d1862e669d843988976690bbc83c74
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-03-06 17:22:55 +01:00
Jędrzej Nowacki
b0d8beb858 Simplify tst_QMetaType::automaticTemplateRegistration
Redundant and unused variadic macro arguments were removed. For macros
with known count of arguments, named arguments are preferred.
Common code was moved out from macros so it is not generated over and
over.

Change-Id: Ib5106555d0d3c6cadfbdbdbd614831240b6d762f
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2014-03-06 17:22:55 +01:00
Friedemann Kleint
37f5935a89 tst_QGLThreads: Fix errors about makeCurrent() in different thread.
QFATAL : tst_QGLThreads::textureUploadInThread() Cannot make QOpenGLContext current in a different thread
QFATAL : tst_QGLThreads::painterOnPboInThread() Cannot make QOpenGLContext current in a different thread

Task-number: QTBUG-28264

Change-Id: I281cf0593e01b43456410a9a53746bbb15f34f24
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-03-06 17:22:55 +01:00
Friedemann Kleint
3d73e11ccc Increase CI timeout for cmake tests.
Change-Id: I1711f99f9e46f1d195684e3c3a714b00618dca2e
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2014-03-06 17:22:55 +01:00
Oliver Wolff
7aa1a7f1c1 spdy autotest: Fixed build with QT_NO_NETWORKPROXY
Task-number: QTBUG-37171
Change-Id: I835764978cf75592d46a20fa5f644f6accec43f5
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-03-06 12:21:14 +01:00
Oliver Wolff
62742d037f spdy autotest: Fix build with QT_NO_OPENSSL
Task-number: QTBUG-37171
Change-Id: I76df40d53e1310c16f559f91c244c6162e35475e
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-03-06 12:21:14 +01:00
Sze Howe Koh
b83dc929ec Complete QJsonValue::fromVariant()
- QVariant can store (U)Int, (U)LongLong, Float and Double numbers.
  Previously, QJsonValue::fromVariant() converted Floats into Strings
  while converting the others to Doubles.
- Add unit tests for QJsonValue::fromVariant()

[ChangeLog][QtCore][JSON] QJsonValue::fromVariant() will now convert
single-precision Floats into Doubles instead of Strings

Change-Id: I457adbe29c37ada611d1c6d711c42866d63d4024
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-03-06 12:21:14 +01:00
Tor Arne Vestbø
9d79c3458c Disable the qmetatype test on Clang + ARM, it's causing OOM during build
And takes a very long time to build if it doesn't run out of memory.

Task-number: QTBUG-37237
Change-Id: I8c7fae4d2d99ad59c6d6306da2df554a05955446
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-03-04 15:59:05 +01:00
Andy Shaw
f07841bc7c Revert path() behavior to not expand a current path on a drive
In the original change - cfb44c6528 - when
querying for the path of a file that did not contain a slash after the
drive indicator it would get the current path and return that as the path
that the file resided on.

However this meant that it would take the current path at that time which
may not be the actual path that was expected. So it was decided that
it should revert back to the original behavior which was to just return
the drive letter followed by the colon which would thus indicate still
that it represented whatever the current path was on that drive.

Change-Id: Ic57ae9227882a66e9a4c4d6537d7f2cae829165a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-03-04 15:59:05 +01:00
Laszlo Agocs
4b2f35d04c Dynamic GL: remove exporting symbols
Remove the opengl proxy for now. Later it will either be moved into
a separate library or replaced by a QOpenGLFunctions-based approach.

This means that the -opengl dynamic configuration is not usable
for the time being. The rest of the enablers remain in place.

The convenience function QOpenGLFunctions::isES() is now moved to
QOpenGLContext and is changed to check the renderable type. This is
extremely useful since besides supporting dynamic GL it solves also
the problem of GL_ARB_ES2_compatibility (i.e. it triggers the real ES
path when creating an ES-compatible context with a desktop OpenGL
implementation).

Task-number: QTBUG-36483
Task-number: QTBUG-37172
Change-Id: I045be3fc16e9043e1528cf48e6bf0903da4fa7ca
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-03-04 15:59:05 +01:00
Sze Howe Koh
fe2ce05d23 Remove duplicated tests
tst_QtJson::testValueSimple() tested bool and double values twice

Change-Id: Ie6e58aab729c6ee20cb53d3b85746a05f7571f5e
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-03-04 15:59:05 +01:00
Chris Colbert
6060dab13a Fix issue where revealed widget children do not receive paint event.
When a child of a widget is spontaneously revealed due to a call to
the parent 'resize' method, the child will not receive a paint event
if it has the WA_StaticContents and WA_OpaquePaintEvent flags set.

This is caused by the backing store being pre-emptively resized by the
call to setGeometry_sys, which causes QWidgetBackingStore::sync to skip
the block which handles the static contents.

There doesn't appear to be any reason to preemptively resize the backing
store, since it is always resized as-needed during the the 'sync' method.
This change-set removes the code which preemptively resizes the backing
store.

Task-number: QTBUG-35282
Change-Id: Ie9942854ca5322dfe0f98ed8100810161576be80
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-03-04 15:59:05 +01:00
Friedemann Kleint
b22ef59663 Remove use of templates in tst_qatomicinteger.
MSVC 2008 is confused by TypeInStruct being a template, resulting in

\tst_qatomicinteger.cpp(189) : error C2027: use of undefined type 'QStaticAssertFailure<Test>'
        with
        [
            Test=false
        ]

for int (and thus for all unsupported types). This appears to be a real
Heisenbug-nature compiler bug as it can also be fixed by adding
qDebug() << Q_ALIGNOF(TypeInStruct<T>)
before the static assert.

Task-number: QTBUG-37195

Change-Id: Ib2b60f3c1ffeb0b8bdeb1fb0c659655ce4ab10d8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-03-04 15:59:05 +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
Marc Mutz
db8167c224 QPen: add move constructor
After this change, the relation between copy/move constructor calls in QtGui is
something like 40/16.

A moved-from QPen can only be copied, assigned-to or else destroyed. This required
adding a nullptr check to the copy ctor and the dtor and rewriting copy assignment
(which used non-nullptr-safe qAtomicAssign) in terms of copy construction and
swapping.

Extensive tests included. They are implemented such that they work in C++98 as well
as C++11 mode, but they naturally test move semantics only in a C++11 build.

Change-Id: If68f37c10b8eeefb2478cbae386cd2e38b4f6e19
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-02-28 21:27:41 +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
Simon Hausmann
846cc4c75c Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/network/access/qhttpthreaddelegate.cpp

Change-Id: Ia15372687c93cd585967b006c0baaac3a5f29e91
2014-02-28 13:14:15 +01:00