Commit Graph

4065 Commits

Author SHA1 Message Date
Thiago Macieira
b4ce49287f Make QBuffer::bytesAvailable() work
We don't need to keep an internal QBuffer position, we can just use the
one from QIODevice::pos(). It will keep track of goings ahead and
backwards for us, plus it will make the default bytesAvailable() work
out-of-the-box too.

This error was reported on IRC.

Change-Id: I8559e8ee56edaa01ca8732c1f1012082ebe3a3f2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2013-04-16 19:45:11 +02:00
Darryl L. Miles
5f9d58848a Json writer, support larger signed integers upto 2^53
Previously only 32bit signed integers were ensured to be supported by
JsonValue type via API but it is expected that a larger integer range
should be supported by a JSON implementation.

This commit brings the Qt implementation into parity with NodeJS
JSON.stringify() in respect of the JavaScript Number type.

Change-Id: If91153cb3b13ecc14c50da97055b35ce42f341e7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-04-12 22:33:23 +02:00
Darryl L. Miles
6348de8737 Json writer, emit full precision for floating point Number types
Previously Qt JSON writer would only emit 6 digits of precision as this
is the default with the formatter.

However with testing against NodeJS JSON.stringify() this behavior is
inconsistent with the defacto standard JSON implementation and conveys
a loss of precision.

Change-Id: Ie1845a6e0ee0b4c05f63ec0062f372e891855f0b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-04-12 22:33:19 +02:00
Darryl L. Miles
e2d614b6a9 Json writer, only emit floating point finite numbers, ignore INF/NaN
My interpretation of RFC4627, Section 2.4 "Numbers" of:
  Numeric values that cannot be represented as sequences of digits
   (such as Infinity and NaN) are not permitted.

I have also verified this matter with NodeJS JSON.stringify() that
emitting a null is consistent behavior with a JSON implementation
written in JavaScript.

Previously Qt would emit:
{
 plusInfinity: inf,
 minusInfinity: -inf,
 notANumber: nan
}

Which maybe turned into a string values of "inf", "-inf", "nan" by
the receiving parser.  Now it returns the JSON null value just like
NodeJS JSON.stringify().

Change-Id: I9f9c17f12b2606280806c47a9d90465c4ba5f786
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-04-12 22:33:13 +02:00
Frederik Gladhorn
aa3754d105 Merge remote-tracking branch 'origin/stable' into dev
Change-Id: Iee73c93067c5822d8dd51a8692e6da9df4ba49f5
2013-04-12 12:53:13 +02:00
unknown
7d56edebc9 QDateTime - Fix auto tests on Windows before 1980
Auto tests using CET expect there to be no Daylight Time before 1980,
but Windows does apply Daylight Time.  Fix expected test results to
match.

Task-number: QTBUG-30420

Change-Id: I7080598fa0a20c1cd5680782606ab983e714e546
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-04-12 11:46:01 +02:00
John Layt
839a9c11de QPagedPaintDevice: Fix setPageSize() to set correct metrics
Use the correct metrics for the requested PageSize instead of always
defaulting to A4.

Task-number: QTBUG-30494
Change-Id: Ia3978afe3f7cc9b1ded1065416e5c3def44e7a05
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-04-12 11:46:01 +02:00
Debao Zhang
6a50270013 tst_qtranslator: Remove QT_DISABLE_DEPRECATED_BEFORE=0
Change-Id: Iefd8ce56b7102b5a6a656df7dbea2cd344bb9b5d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-04-12 07:20:05 +02:00
Debao Zhang
5c2a8899e1 tst_qcoreapplication: Remove QT_DISABLE_DEPRECATED_BEFORE=0
Change-Id: I6d5098ff57293171b5ddd3a58c53718cbbc8e4bf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-04-12 07:19:53 +02:00
Debao Zhang
4bb76df7f7 tst_qdataurl: Remove QT_DISABLE_DEPRECATED_BEFORE=0
Change-Id: I6f2e45bbc6d31cac4d9b8c735650f7985865109c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-04-12 07:19:45 +02:00
Konstantin Ritt
b3dae6848d Fix leaking of QFontEngineData
QFontCache now references QFontEngineData-s it maintains,
so that QFont instances not freed prior to calling ~QFontCache()
would destroy QFontEngineData on their own.

Task-number: QTBUG-25434

Change-Id: Ia7679d64de436841f09ac7be62ceb570e50cce5b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: jian liang <jianliang79@gmail.com>
2013-04-12 04:23:35 +02:00
Fabian Bumberger
e9760f1559 Fix the check if mouse events should be synthesized from touch events
In QGuiApplication only Qt::AA_SynthesizeMouseForUnhandledTouchEvents
is taken into account when synthesizing mouse from touch events, in
QApplication only the PlatformIntegration syle hint
QPlatformIntegration::SynthesizeMouseFromTouchEvents.

With this patch both attributes are checked. Furthermore the check was
moved out of translateTouchToMouse in QApplication in order not to
influence the result which is returned to the user, when mouse events
are not be synthesized.

Change-Id: I87ac7299f0a9fbf0a083eff9c547f0dbfab75dfb
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2013-04-11 16:09:19 +02:00
Friedemann Kleint
26da8c34bb Stabilize tst_qcombobox.
- Remove member variable testWidget and instantiate on the stack
  to ensure tests do not interfere.
- Move widgets away from taskbar areas.
- Fix windows geometry warnings by making small windows frameless.
- Fix wrong target widget for key click in
  keyBoardNavigationWithMouse().

Task-number: QTBUG-30573
Change-Id: I6d9fad0f212814a67367baf446750e9bed0ebdb2
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-04-11 06:52:07 +02:00
Sergio Ahumada
90297a64f2 Merge branch 'stable' into dev
Change-Id: Icff019d74ae04c628a80f66aa478e4db40fae464
2013-04-10 15:42:22 +02:00
Andy Shaw
f5dc5225f6 When doing a PageDown or PageUp it should show the next set of cells
Before it would skip out a row depending on the size of the tableview.
Now it will show the next set of cells for the direction it is going in.

Change-Id: I02926d0b2187ffafffb63f7fff43c233b4d7d6af
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-04-09 22:38:32 +02:00
Stephen Kelly
b242ab7b10 Add missing wait for window shown.
Change-Id: I746a12dfa1b87a0d1393341ca3d641f73bcaee0a
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-04-09 19:30:14 +02:00
Volker Krause
96e3c2bcbf Don't bypass overwritten [set]data() methods in the proxy.
By calling itemData() of the source model directly, the result cannot
contain data provided by the proxy model itself. The base class
implementation however will call data() on the proxy instead.

Change-Id: Ib0ef5f5621457adbfa4bd896a756dfcb98d0ae54
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-04-08 14:17:27 +02:00
Frederik Gladhorn
8307ab784e Make QTextCursor accessibility boundary finder available
This allows re-using the function in QtQuick.
In addition TextBoundaryType is moved to QAccessible
and QAccessible2 as namespace ceases to exist.

Change-Id: I184bc2c181a22ca51ac4db4e5a080dc26d4acfe0
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-04-08 11:35:44 +02:00
Stephen Kelly
722798a359 Don't call virtual methods after the source model is destroyed.
Calling clear_mapping causes the persistent indexes to be queried, and
mapped using map_to_source, so that they can be restored later. That
is not the appropriate response to the source model being deleted
because there won't be anything to restore.

Simply clear the stored mapping information instead so that the source model
actually exists when mapToSource is called by the framework.

Change-Id: I99692ee7aa9c6714aec45c68fe4a2d62be189d60
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-04-05 16:26:06 +02:00
Stephen Kelly
30d01db3a5 Test that the CMake files create appropriate version variables.
Change-Id: I1d8061302fbb8494b5ae31e20a644745fe969f10
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Brad King <brad.king@kitware.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-04-05 14:20:39 +02:00
Friedemann Kleint
54bd1102ad Stabilize tst_qcompleter.
- Use qWaitForWindowActive in task178797_activatedOnReturn().
- Remove hardcoded timeouts, use qWaitForWindowActive/Exposed.
- Instantiate widgets on stack or use QScopedPointer to ensure
  cleanup.
- Move widgets to a central location, avoiding taskbar areas.

Change-Id: I98991b70067dddab9aa69b1681fa80398ec8b1f6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-04-05 11:28:47 +02:00
Andy Shaw
693a399acb Fix sql tests in respect to Oracle databases
Oracle has a limitation of 30 characters for a tablename so the main
change is to account for this, which meant changing all the usages of
qTableName(). Some other fixes are included that ensure the tests are
working correctly as far as Oracle is concerned.

Change-Id: I8ad8a5a33e6a70fcad235f6a7e82e91687b74fee
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-04-05 11:13:28 +02:00
David Faure
b3a505dc92 QSaveFile: allow saving to a writable file in a non-writable directory
The only way to make this possible is to disable the
atomic-rename-from-temp-file behavior. This is not done by default,
but only if the application allows this to happen.
https://bugs.kde.org/show_bug.cgi?id=312415

Change-Id: I71ce54ae1f7f50ab5e8379f04c0ede74ebe3136d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-04-05 11:04:35 +02:00
Peter Hartmann
f4714459a8 QTcpSocket bind() auto test: return instead of QSKIP
... because SkipSingle was removed in Qt5, and a QSKIP would result in
the SSL tests not being executed.
This can be reverted once QTBUG-29972 is fixed.

Change-Id: I3663ee52f00c3f4391ce78cf63bd444656d79cb3
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2013-04-05 10:56:43 +02:00
Frederik Gladhorn
4b069486cb Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-04-04 14:45:28 +02:00
Jan Arve Saether
9d7ae6dfbe Fixed a bug where the MaximumSizeHint of a layout with spans was wrong
This was spotted while tracking down a similar bug related to spans.
This now also eliminates the Q_EXPECT_FAILs in
heightForWidthWithSpanning(), since it now finally works.

The problem was only for the maximum size, since the size of an ignored
row/column was min: 0, pref: 0, max: FLT_MAX (the default constructed
values for a QGridLayoutBox).

Change-Id: Ibb33c26ede40ed02edd26f596ba6133d59c9962f
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2013-04-04 14:23:04 +02:00
Jan Arve Saether
4f072e2d3d Fixed a bug where spans across empty cells got broken.
If a row/column is only used only because of the spanning of an item,
the cell should be treated as it didn't exist. We keep track of this
with the "ignore" bit array.

The old code would always start from the row/column at position 1.
In the attached testcase this made the effectiveRowSpan become larger
than actually needed.

Task-number: QTBUG-30255

Change-Id: Ief0e7018ee8e5ee36272ce075a43312ffeac7b91
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2013-04-03 14:52:25 +02:00
Frederik Gladhorn
814f713f01 Merge remote-tracking branch 'origin/stable' into dev
Change-Id: Id96d4076610366a7cc66c8d8382ca25c33eaa71d
2013-04-03 14:40:26 +02:00
Marc Mutz
76e0223619 Add qPopulationCount() function, extracted from QBitArray
This functionality is used in multiple places in Qt itself, so it makes
sense to have a global function for this. This also allows to map this
onto specialized assembler instructions, should an architecture provide
them, later on.

Also added comprehensive tests, using a 4-bit lookup-table implementation
as a reference.

Change-Id: I8c4ea72cce54506ebb9fbe61141dbb5f1b7a660f
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-04-03 11:38:35 +02:00
BogDan Vatra
448c3e85dd Fix Qt tests for Android.
Change-Id: I53856056a00684a9a37596a74b79f46d3b47331f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-04-03 10:15:40 +02:00
Thorbjørn Lund Martsum
01b4b7f917 GraphicsView - add Q_DECL_OVERRIDE to the manual rubber band test
This adds Q_DECL_OVERRIDE to the virtual functions in the test.

Change-Id: If1b7646c9a6f50c6efe2d03d253bd8e0b4c09716
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Laszlo Papp <lpapp@kde.org>
2013-04-03 07:00:12 +02:00
Andy Shaw
406c8ef6e6 Move the dbmstype to QSqlDriverPrivate so it can be used for all drivers
By moving it to QSqlDriverPrivate we make it easier to check what
database is actually connected which is particularly useful for the
autotests.

Change-Id: I54d1c2c998919c1d54efb1b6ac9303070ece54aa
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-04-02 19:02:26 +02:00
Frederik Gladhorn
b2ec0da956 Cache QAccessibleInterfaces.
Since there already is a one-to-one relationship
between QObject and QAccessibleInterface it makes
little sense to create and destroy the interfaces
on each call to queryAccessibleInterface.

Add a cache and keep created interfaces around for
the lifetime of the corresponding QObject.

This changes the memory management rules: accessible
interfaces must no longer be deleted. If you get an
QAccessibleIntrface pointer that pointer will stay
valid as long as the corresponding QObject is not
deleted.

This also re-enables accessibility for Mac.

We limit the range of the IDs so that they are
useable for Windows directly.
That means we can get rid of the event cache there.

This is based on: Iebf2f374916fc70a9dd29e95f45a6444b85f6cee

Change-Id: I9fe6531812c0dbc5b41101ac05830a6dd75e13a3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-04-02 14:32:25 +02:00
Peter Hartmann
9efd40bd77 QNetworkAccessManager: track online / accessible state without session
In particular, set online state right upon construction of the
QNetworkAccessManager instance. Therefor, QNAM needs an instance of a
QNetworkConfigurationManager internally.
Before, this would only work properly if a network session was created.
Now, networkAccessible() returns the correct status.

Change-Id: I7ff9ccfd18ad376a131fc5977843b55bf185fba0
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2013-04-02 10:46:23 +02:00
Giuseppe D'Angelo
bb5552a229 Upgrade the bundled PCRE to 8.32
Changelog: http://pcre.org/changelog.txt

Amongst other things, the Unicode tables were upgraded to 6.2.0
and case folding support was added, which also fixes a QString
autotest (marked as XFAIL).

Qt still requires 8.30, not 8.32.

Change-Id: I4056c1dc1d949d33443bb8ca280de4c8c363ac74
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-04-01 21:33:29 +02:00
Stephen Kelly
f84cb43eda Add automatic metatype handling for common standard library containers.
Change-Id: I7fc6db6ea71026066d3e3fa4bfd5ecd5c96ad067
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-04-01 13:49:57 +02:00
Konstantin Ritt
f0af3ed4e5 Update QLocale data to CLDRv23
Say hello to Interlingua and Mongolian once again.

Change-Id: I735fbc5793f34620be1f6932a251224b9ded02e3
Reviewed-by: Denis Dzyubenko <denis@ddenis.info>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-04-01 12:03:55 +02:00
Konstantin Ritt
bc4dcb6994 QLocale: Report textDirection() by looking to the locale script
Change-Id: Ic562b0301271ba414d5d3ff75a308d84bd288f56
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-30 08:23:04 +01:00
David Faure
f052cefc2f tst_qthread: fix race on "bool visited"
Change-Id: I438bad9a4f8afb76272c8d8f08461a6d2c9a0b18
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-03-29 15:16:47 +01:00
Morten Johan Sørvig
eb5d8d2fc3 Update the high-dpi manual test.
- Organize the test images into different sizes.
- Add a button and icon drawing test.
- Don't show all tests by default.

Change-Id: I95eff846b8c5159085f53b413dea7212c1ea5071
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2013-03-29 09:47:32 +01:00
Debao Zhang
c59f1aea65 QtSql tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
Change-Id: I93169244b51f8b993f97f7595e0bc7006ae04e3a
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-03-28 14:42:15 +01:00
Debao Zhang
ba3418ae75 QtWidgets tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
Change-Id: I1264784d6984edc70bf07e58ed763e1d1b001d7d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-28 02:02:14 +01:00
Debao Zhang
f6e739d9e3 QtWidgets tests: Replace qFindChild{ren} with QObject::findChild{ren}
Change-Id: I79a26387bcce0d7f79f4f9f70293e97dae52f949
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-27 19:34:22 +01:00
Frederik Gladhorn
8b4888afb2 Test with random qobject instead of widget twice
Change-Id: Ibece0f65dafa7fc59486c5a4c1467c93636b93c1
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-03-27 17:16:37 +01:00
Stephen Kelly
ec37cdbc80 Populate includes, defines and pic flags in target interfaces.
Used by features in CMake 2.8.11.

This matches the features in FindQt4 in that version of CMake,
namely that the IMPORTED targets contain the appropriate
INTERFACE_INCLUDE_DIRECTORIES and INTERFACE_COMPILE_DEFINITIONS
and that the qtmain.lib static library is automatically linked to
on Windows by executables. Additionally, the
INTERFACE_POSITION_INDEPENDENT_CODE property is set appropriately
if Qt requires users to use position independent code.

Change-Id: Ide341f43fcaf7d722a7bdf1a12b1071c7e548ccc
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-27 14:54:49 +01:00
Debao Zhang
1fb3d56efb QtWidgets tests: Don't use the deprecated QTest::qWaitForWindowShown()
Change-Id: I2dd5a54f9485591ca2dab65f7a352ef453c185e2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-27 06:01:11 +01:00
Debao Zhang
90d74f8602 QtWidgets tests: Don't call the empty function QApplication::syncX()
Change-Id: I2c732afd43586209cf5a2b72caac53e34abb9090
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-27 06:01:11 +01:00
Debao Zhang
f57a3c0ba3 tst_qgraphicseffectsource: Don't use the deprecated QGraphicsItem::children()
Change-Id: I0cc0c5284a675fb1c7f960e9790baa89c56112b1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-27 06:01:11 +01:00
Debao Zhang
bca0ee7115 QtXml tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
Change-Id: Ifb9363fb6d397a91501fc906454e172731d4c06d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-27 03:54:48 +01:00
Debao Zhang
dd4220b6e6 QtGui tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
Change-Id: I48c83fa0c5eccd86a5242fc8ed51ac6d7623f7f3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-27 03:54:42 +01:00
Debao Zhang
670aae7d8d QtConcurrent tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
Change-Id: Ia0c4751b891ae81a66b072bc504b555d81625172
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-27 03:54:25 +01:00
Debao Zhang
495f7cafdb QtTest tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
Change-Id: Id67ab0ea3be47d3b365aa01a354829b8745b7250
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-27 03:54:20 +01:00
Morten Johan Sørvig
b2c73c73cd Cocoa: Correct enter/leave event handling.
Make top-level windows generate enter/leave events
for sub-windows. Keep track of the current "under mouse"
window in mouseMoved and send EnterLeave events when
it changes.

mouseEntered/mouseExited handles enters and leaves
from the top-level window.

Add tests/manual/cocoa/nativewidgets.

Task-number: QTBUG-27550
Task-number: QTBUG-29751

Change-Id: If4b9f9e0f39d9fb05fdab45a100ffdcf107965ad
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2013-03-26 19:21:38 +01:00
Peter Hartmann
b96e8ff1d2 QNetworkInterface auto test: do not abort without session
... but only if the QNetworkConfiguration manager requires one.

Change-Id: I1c69c43438f1df9080d207c8598a42201f759c5b
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2013-03-26 10:18:02 +01:00
Debao Zhang
d0ad02a766 tst_qtreeview: Use QRect::intersected instead of QRect::intersect
Change-Id: I4579929473a408b73f3ad9014ea30ce5a602259c
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-26 10:18:02 +01:00
Eskil Abrahamsen Blomfeldt
83c9d22d44 Remove dependency on QPlatformSupport in fontdatabase test
If you include a static library in the test, all symbols will
be duplicated, and this can cause nasty crashes because global
static data is also duplicated. This happened on Linux because
of a global static cache in the font engine where the two instances
of it would get out of sync, and we would reference invalid
data.

To test QPlatformSupport features, a QPlatformSupport test which
does not load any platform plugin (or uses its own platform plugin
which does not load QPlatformSupport) is needed. For now, I will
just revert adding the test, since it is broken and was added
as part of supporting Windows CE:
   f2fabf77f9.

Change-Id: I6c002d1e0880ee8e031a68eee80e781fe0c62af4
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2013-03-25 19:21:40 +01:00
David Faure
a6e5ccbe22 QMdi: Don't emit subWindowActivated during StyleChange handling.
The handling of StyleChange de-maximizes the child window temporarily,
which was emitting subWindowActivated.
This would crash lokalize, because deactivating a window means deleting
the widgets associated with it, and style-change handling is done in
QApplication by looping over QApplication::allWidgets, which would then
contain dangling pointers.

Full valgrind log at https://bugs.kde.org/show_bug.cgi?id=271494#c7

Change-Id: Ifb24032cde2cd470dcae7cd553ec5ab45a919dd6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-25 10:37:37 +01:00
Mitch Curtis
a3304489e8 Ensure QTemporaryFile can create files when an identical dir exists.
When QTemporaryFile attempts to create a new file in
createFileFromTemplate, it fails if the filename exists and is a
directory. Windows returns error code 5 (ERROR_ACCESS_DENIED) in this
case - rather than ERROR_FILE_EXISTS - which is not handled.

This patch handles ERROR_ACCESS_DENIED in addition to the already
handled ERROR_FILE_EXISTS, meaning that QTemporaryFile will continue
to look for unique names when a directory with the same name exists.

Task-number: QTBUG-30058

Change-Id: I42339887d7f5483e3dc6a03a9da15111c350da8f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-03-23 14:42:45 +01:00
Frederik Gladhorn
6d9541ae96 Do not update accessibility for invalid interfaces
Change-Id: I8dc29ea51393406e529c76f25bf2f8cf426e26cf
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-03-23 11:43:39 +01:00
Friedemann Kleint
37842c2fdb Compile most manual tests with Qt 4.
Replace <QtWidgets> includes by class includes, remove tests
that do not compile.

Change-Id: I52837e8c567dc8ac365c7d43c37beb9a368f6f72
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-03-22 19:52:26 +01:00
Frederik Gladhorn
4e07286a30 Only instantiate QAccessibleWidget after trying inherited classes
The plugin should try each class name from the meta object
in succession instead of giving up right away and just using
QWidget.

This improves the handling of the itemviews and makes many sub-classes
of QWidget outside of Qt work.

Change-Id: Id81017c648fe229c3eb85d6d9ae6696d5f16a1ef
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-03-22 17:11:17 +01:00
Samuel Rødal
2ab9b747fc Merge remote-tracking branch 'gerrit/release' into stable
Conflicts:
	configure
	mkspecs/features/qt_module_headers.prf
	mkspecs/features/qt_tool.prf
	src/angle/angle.pro
	src/tools/bootstrap/bootstrap.pro
	tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp

Change-Id: Ide5759fe419a50f1c944211a48f7c66f662684e0
2013-03-21 08:49:01 +01:00
Sergio Ahumada
e5a11fbb32 Merge "Merge branch 'dev' into stable" into refs/staging/stable 2013-03-20 23:30:31 +01:00
Israel Lins
0646d1131b ODBC: fixed consistence of return of QODBCResult::exec()
The QODBCResult::exec() returns false when query is an delete
with no data do delete caused by SQLExecute function returning
SQL_NO_DATA, but the false return means error on execution.

Task-number:  QTBUG-10569
Change-Id: I6c7ebadcf62ab404b60c7bcccdab6a10bf16a923
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-03-20 23:30:23 +01:00
Samuel Rødal
678320788e Skip unstable tst_QSslSocket test case.
The connection to qt-project.org seems to be the one that causes this
particular test case to fail.

Task-number: QTBUG-29941
Change-Id: Ie5e430646997e86e3acb04132cd90a1773a091da
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2013-03-20 16:11:40 +01:00
Oswald Buddenhagen
76c0be34cd Merge branch 'dev' into stable
This starts Qt 5.1 release cycle

Conflicts:
	src/gui/text/qfontdatabase.cpp
	src/gui/text/qharfbuzz_copy_p.h
	src/widgets/kernel/qapplication.cpp
	src/widgets/kernel/qcoreapplication.cpp

Change-Id: I72fbf83ab3c2206aeea1b089428b0fc2a89bd62b
2013-03-20 13:49:28 +01:00
J-P Nurmi
5fd509c4d7 Tests: stabilize tst_QDockWidget on small screens
The test has been recently failing in CI. The problem was easy to
reproduce in a virtual machine by resizing the window of the virtual
machine small enough. This change makes sure that the requested size
hint is significantly smaller than the desktop size, to avoid the
window manager stepping in and limiting the window size.

Change-Id: Id8ce63b2b88cbed964e0330633c5d2e1dc33598c
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
(cherry picked from commit 36e6632fa3)
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2013-03-20 09:58:06 +01:00
Samuel Rødal
677313fc0b Attempt to prevent tst_QWidget::scroll() from failing in CI.
Skip the test on X11 where it's consistently failing in CI but not when
trying to reproduce locally. Also attempt to make test slightly more
robust on other platforms (it's already #ifndef'd for Q_OS_MAC).

Task-number: QTBUG-30271
Change-Id: I6743eb99549abbd945e380a3a54ce8620000298a
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-03-20 09:58:03 +01:00
Konstantin Ritt
36cb3f3f65 Fix the font engines leaking
1. when there were some engines with ref > 1 in the cache, prior to calling
   QFontDatabase::{add,remove}ApplicationFont()/removeAllApplicationFonts()
   (QFontCache::clear() has never decreased engine's cache_count);
2. when the QFontEngineData's engine is not in cache i.e. the Box or Test font engine
   (~QFontEngineData() didn't free engines it keeps).

Instead of using the font engine's (external) "cache_count" counter,
QFontCache now references a given font engine every time it is inserted to
the cache and dereferences exactly that number of times in clear().

Change-Id: I87677ebd24c1f4a81a53526f2e726e596b043c61
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-03-20 07:02:29 +01:00
Olivier Goffart
bc98bba2f3 Support connection to functor with multiple operator()
When variadic templates and decltype are supported, detect the best
overload of operator() to call.
Currently, the code takes the type of the operator(), which requires that
the functor only has one, and that it has no template parameter.

This feature is required if we want to connect to c++1y generic lambda
(N3418)

Change-Id: Ifa957da6955ea39ab804b58f320da9f98ff47d63
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-03-19 23:16:38 +01:00
Stephen Kelly
bc1fb206bb Run CMake dbus tests if dbus is expected to be available.
Instead of first finding it and then testing that we can find it.

Change-Id: I1a1090693520b1d6adadef93839f25d277947e76
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-19 11:26:41 +01:00
Thiago Macieira
537679cb12 Fix wildcard signal disconnection in QDBusAbstractInterface
This has been broken forever, just like generic signal
disconnection. It didn't use to show up before because in Qt 4,
QObject's destructor would not call disconnectNotify().

Just like in the previous commit, we need to verify whether the signal
was disconnected from the last receiver. A wildcard disconnect might
be disconnecting only from a specific receiver.

Task-number: QTBUG-29498
Change-Id: I0790128ea878fdf3ac563c99d96c6aa7d270e9a3
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-03-19 07:03:25 +01:00
Thiago Macieira
d2a98df9bc Make sure that signal disconnects don't disconnect too much
There has been a latent bug forever in QtDBus that would make a signal
disconnect actually disconnect too much. The reason is that
disconnectNotify() is called every time a signal is disconnected from
a receiver, but that doesn't mean it was the last connection.

This test checks whether disconnecting from voidSignal() to our test
receiver will also disconnect from exitLoop(). If it does, we'll get a
timeout. I could have implemented it with two receivers, but in the
buggy case, it would always fail first in the timeout verification.

Change-Id: I5766d8a38594eb25e65b304913251303660fad41
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-03-19 07:03:17 +01:00
David Faure
a1bc48422f tst_qlockfile: increase delay on Windows.
OpenProcess + WaitForSingleObject is supposed to fail after the process exits,
but this seems to take some time until Windows notices.

Change-Id: I942a9b4a458c23fc4ac33b28386e28821128e991
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-19 06:29:13 +01:00
J-P Nurmi
0554341d9f Tests: stabilize tst_qwidget::scroll on small screens
The test has been recently failing in CI. The problem was easy to
reproduce in a virtual machine by resizing the window of the virtual
machine small enough. This change makes sure that the requested size
hint is significantly smaller than the desktop size, to avoid the
window manager stepping in and limiting the window size.

Change-Id: Ie319892747bee60ea6f11e27b6c1bfb4731ef587
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2013-03-18 22:32:15 +01:00
J-P Nurmi
36e6632fa3 Tests: stabilize tst_QDockWidget on small screens
The test has been recently failing in CI. The problem was easy to
reproduce in a virtual machine by resizing the window of the virtual
machine small enough. This change makes sure that the requested size
hint is significantly smaller than the desktop size, to avoid the
window manager stepping in and limiting the window size.

Change-Id: Id8ce63b2b88cbed964e0330633c5d2e1dc33598c
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2013-03-18 22:32:15 +01:00
Stephen Kelly
4111a676f1 Make the qtbase cmake tests work without the Widgets module.
Task-number: QTBUG-28540

Change-Id: I916d104c8aba551ee9a5b34da3fd85dcb26bbf64
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-18 20:17:10 +01:00
Laszlo Papp
4905c0754b Add convenience distance methods to QVector2D
Change-Id: I8ecdda35912a95e69c2f8dd98ce9c41c77b222d2
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-03-18 08:36:03 +01:00
Olivier Goffart
b8d08c0e9a Fix tst_moc when variadic macros are enabled
moc do not see Q_COMPILER_VARIADIC_MACROS as defined (because it does
not know the builtins defines)

So it would never parse those macro, and never generate the signals or
slot.

Always let moc parse the variadic macro, and put non-macro function in
the header so the generated code would compile on every compiler

Change-Id: Ie9504539ee737c81e831b217f8d623fe810d9e35
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-03-17 10:57:49 +01:00
Axel Waggershauser
b11317a643 Whitespace cleanup: remove trailing whitespace
Remove all trailing whitespace from the following list of files:
*.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README
excluding 3rdparty, test-data and auto generated code.

Note A): the only non 3rdparty c++-files that still
have trailing whitespace after this change are:
* src/corelib/codecs/cp949codetbl_p.h
* src/corelib/codecs/qjpunicode.cpp
* src/corelib/codecs/qbig5codec.cpp
* src/corelib/xml/qxmlstream_p.h
* src/tools/qdoc/qmlparser/qqmljsgrammar.cpp
* src/tools/uic/ui4.cpp
* tests/auto/other/qtokenautomaton/tokenizers/*
* tests/benchmarks/corelib/tools/qstring/data.cpp
* util/lexgen/tokenizer.cpp

Note B): in about 30 files some overlapping 'leading tab' and
'TAB character in non-leading whitespace' issues have been fixed
to make the sanity bot happy. Plus some general ws-fixes here
and there as asked for during review.

Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-03-16 20:22:50 +01:00
David Faure
72367a94a7 tst_qlogging: fix test when QT_MESSAGE_PATTERN is already set
Change-Id: I608ac9920e04eb636c8d2e9cee38c6f0cd189f1f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-03-16 00:12:47 +01:00
Thiago Macieira
6c48b9ad87 Remove bogus portion of unit test
In Qt 4, QSignalSpy didn't *really* connect to the signal it was
spying on. See the "we need to connect the signal somewhere in order
for D-Bus to enable the rules" comments.

In Qt 5, it connects, which rendered this section of the test bogus:
since the signal is still connected, the QSignalSpy will notice that
fact and will not be empty. This is passing due to a false
positive. The upcoming fix breaks it, so we need to remove it.

Change-Id: Ic8fbf7d0e941403e97149f5bc392334a52c66ab1
Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com>
2013-03-15 21:37:51 +01:00
Laszlo Papp
d8bef6bb2e Add a minor convenience for calculating the distance to a point
Change-Id: I312727bf6858ead6c30fe20bf3abc5afc73a3a14
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2013-03-15 18:37:51 +01:00
Stephen Kelly
d87c5db10a Make cmake tests not depend on QtWidgets where not needed.
Change-Id: Ib6347360d678bbe54445ebb0680ad66d77a7f3c7
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-15 10:04:30 +01:00
Stephen Kelly
d0ea65b5cb Clean up cmake test regarding dependencies.
There is no need to list the dependencies of the Widgets module.

Change-Id: I9469d4f352685f7122a258f1a44bd017fdc5b3a7
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-15 10:04:23 +01:00
Stephen Kelly
ff84d2258f Don't fail on tst_QSslSocket::setReadBufferSize_task_250027
It is flakey and often blocks integration.

Task-number: QTBUG-29730

Change-Id: I8acfc243ec6a6782b7f7d78fc27827f3fdc1ce52
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-15 10:04:03 +01:00
Friedemann Kleint
b0573e4f41 Add missing .pro-file for qpainfo-test.
Change-Id: I75fb11698d3ae305751da59af03c1853add7122e
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-03-14 19:49:38 +01:00
Fabian Bumberger
09fc0d60e8 Fix qmath autotest for arm
Change the data type of PI from qreal to double, because qreal is defined as float and not as double on arm.
The testcase however expects PI to be a double value.

Change-Id: I003481071ecb2c1f54e6dcee9b450da2f1654969
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Laszlo Papp <lpapp@kde.org>
2013-03-14 19:49:38 +01:00
Frederik Gladhorn
d1d0df8fb6 Make qaccessible2.h internal.
This should have been done right from the start,
instead we only made the documentation internal.

Also remove the classes from the BIC data.

Change-Id: I238a7a7cc5d26980b23931c78e7e5a4477d46920
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-03-14 19:49:38 +01:00
Stephen Kelly
0ec541c9ad Test the OpenGLExtensions cmake module.
Change-Id: I3cc71e035fd1c34e05ecb470f897a72a39f42ca4
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2013-03-14 16:38:57 +01:00
Samuel Rødal
c7191d3e21 Fixed artifacts when drawing same line with different clips.
Expanding on the change fixing QTBUG-24762 with the realization that any
line needs to be drawn in a consistent way regardless of system or
painter clip, not just dashed lines.

Task-number: QTBUG-25036
Change-Id: Ief7ef19cc92c52e7d792500a581a072ba032767e
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-03-14 12:37:20 +01:00
Stephen Kelly
2a388e503f Merge "Merge remote-tracking branch 'origin/release' into stable" into refs/staging/stable 2013-03-13 23:35:18 +01:00
Axel Waggershauser
3c2748afd5 Improve warning messages (and readability) of connectSlotsByName()
While adding a test case for the new behavior, two issues
with the connectSlotsByName implementation came up:

  1. for auto-connected slots that don't exactly match a signal,
     a 'compatible' one is searched. There might be more than
     one of those. The implementation randomly picks any.
  2. The "No matching signal for %s" warning gets printed even for
     slots that can never be connected via connectSlotsMyName
     anyway (e.g. "on_something"). This is inconsistent.

This fixed both: an explicit warning is printed if more than one
'compatible' signal is found and the "No matching signal for %s"
warning is only printed if the slot adheres to the full
"on_child_signal()" naming convention.

In the process I added comments and changed the code slightly to
make it more readable and explicitly hint at non-obvious behavior.

Change-Id: Icc8e3b9936188d2da8dfff9f0373c8e5c776eb14
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-13 18:40:26 +01:00
Friedemann Kleint
696281bf08 Add qpainfo manual test.
Print out available information from QLibraryInfo, QStandardPaths,
QSysInfo, QPlatformIntegration, QStyleHints, QPlatformTheme
and QScreen.

Change-Id: Ia0bdc6174a1748c539acee18ba16a27a48d58ee5
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-03-13 18:40:26 +01:00
Israel Lins
36b6d4afc9 ODBC: fix loss of milliseconds when binding QDateTime
Caused by operator precedence error.

Follow-up to commit b8b79a0f37

Task-number: QTBUG-2192
Change-Id: I17decd18c469b48a0bc938ae05c16cced8042219
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-03-13 17:27:57 +01:00
Marko Kangas
18be0749eb Fix for Sql query aliases with dots
Task-number: QTBUG-14904

Change-Id: I98a02d4bbf28522cd5c2f65ea606b6b26977e8e6
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-03-13 17:27:36 +01:00
Friedemann Kleint
cc58912acd Stabilize tst_qscroller on Windows.
Change-Id: I2331f140e19ed6a2f78e48c91c653f483d8f3347
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2013-03-13 17:17:54 +01:00
Stephen Kelly
91cd2009bd Generate a Qt5ConfigVersion.cmake file.
This allows finding a minimum particular version of Qt 5.

Change-Id: I96112f1be90f397ec60a2b233989ac0e0380bef9
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-13 16:07:09 +01:00
Jan Arve Saether
75614792fa Fixed bug in QTimeLine::setPaused(false)
The problem was that the elapsed timer was not restarted,
causing the currentTime() not being adjusted for the time
it was paused.

Task-number: QTBUG-30108

Change-Id: Ib9b2c5a0dea52762109e0b25f1068dd7c88e15ba
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-03-13 14:51:05 +01:00
Friedemann Kleint
f75b7e78a3 Manual file test: Add permission and compile with Qt 4.8.
Change-Id: I604b3107d3e049af5cd14ae5bf5bd6785330eac7
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-03-13 14:46:26 +01:00
Konstantin Ritt
0194fa135b Hide Harfbuzz from the outer world
Don't export, don't generate private headers, don't mention HB in API.

Change-Id: I048ebd178bf4afaf9fda710a00933b95274cf910
Reviewed-by: Josh Faust <jfaust@suitabletech.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-03-13 14:46:26 +01:00
Stephen Kelly
d89fe1c7b3 Test that the ConfigVersion.cmake files work.
Invoking find_package with a version but without the version
file present results in an error.

Change-Id: I29d662081ad5dbd7b2259abeec06affda97cbb6a
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-13 09:48:58 +01:00
Stephen Kelly
8cdcff460d Clean up the CMake dbus module test.
The DBus module is aware of its QtCore dependency, and it doesn't need
to be found explicitly. This test probably dates from when that was not
the case.

Change-Id: I3c78997660efed14d84b062d38d8c68dd4f7ae56
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-13 09:48:26 +01:00
Friedemann Kleint
74494ea29e Fix building of the manual tests.
Adapt to API-changes, exclude network/SSL-tests for Windows.

Change-Id: I80d5ef1bd81e149a2f04fa7644376a8a88b1f7b9
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-03-13 06:23:27 +01:00
Konstantin Ritt
f69c9059d6 Replace HB types used in API with Qt analogs
hb_uint32 <-> quint32
HB_Glyph <-> glyph_t
HB_Fixed <-> QFixed, HB_FixedPoint <-> QFixedPoint
HB_GlyphAttributes <-> QGlyphAttributes

Change-Id: I4338ec4ce9a9c20ea591606ab10e6ef4f19931b8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-03-12 18:13:37 +01:00
Friedemann Kleint
b047f48612 Do not list desktop widgets and desktop screen widgets as top-levels.
Change-Id: Iea4905d802213848594d2ad0266696e5edb884f8
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-03-12 18:13:37 +01:00
Paul Olav Tvete
08343e41a0 Skip unstable autotest
tst_QSharedMemory::simpleProcessProducerConsumer is on the top list of
unstable autotests. Disabling it for now.

Task-number: QTBUG-25655
Change-Id: Ib297b3382b736794bab6cdb668103bef74a55d8c
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-03-12 18:13:37 +01:00
Tor Arne Vestbø
bb2d95ce43 Skip more QScroller tests on Mac, they are all flakey
Task-number: QTBUG-29950
Change-Id: Ieda94dbcab3d75678597544a029c5ca6d2dc8226
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-12 18:13:37 +01:00
El Mehdi Fekari
d7c2227651 Add an auto test for Irish locale
Change-Id: I2458cb580553ea02461869220fbd5dfb0f8fcb2c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-03-12 18:13:37 +01:00
Caroline Chao
a410273fab Fix wrong initial position
If the widget is larger than the screen,
its title bar top left corner will be shown
inside the screen.

Task-number: QTBUG-30142

Change-Id: Id93773874be3616b3ef4b9bee6e1bb751c541d7b
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2013-03-12 15:59:21 +01:00
Mitch Curtis
c1771a78ed Correct QString's warnings involving QRegularExpression.
Replaces "QRegularExpresssion" with "QRegularExpression" and adds some
auto tests for the warning itself.

Task-number: QTBUG-30054

Change-Id: Iba333a4388795eccca809fb430c295f503794263
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-03-12 11:43:01 +01:00
Mitch Curtis
6bc691dde5 Revert 6497649730 and clarify docs.
It introduced a regression by requiring that a p/P was also present:

QTime time = QTime::currentTime();
qDebug() << time.toString("h:mm:ss a");
// Outputs "10:05:42 am" in Qt 4.8.
// Outputs "10:05:42 a" with 6497649730.

This patch also clarifies the QTime::toString(QString) documentation.

Change-Id: I4d73a959c2ca76304f03a4ce9717b540ad4e8811
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2013-03-12 11:43:01 +01:00
Friedemann Kleint
62fe32b37c Fix warning about unused function result in tst_qnetworkproxyfactory.
Change-Id: I1f996c208e05e456d374726c91a5f52ed64f784c
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-12 09:16:42 +01:00
Friedemann Kleint
eccef8c936 Fix warnings about overloaded virtuals in tests (CLANG).
Change-Id: I2f96073c4aaf4b11221b98cc6c7031b253a3b45c
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-03-12 09:16:42 +01:00
Tor Arne Vestbø
77f7a8ef4c Skip tst_QScroller::scroll(), it's flakey and blocking CI
Task-number: QTBUG-30133
Change-Id: I2d91d92e49480b904dec9807d4763c461e809bd2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-03-12 09:16:42 +01:00
Paul Olav Tvete
9226a754fd Android: disable unsupported autotests
We do not currently have shared memory or system semaphore support
on Android.

Change-Id: I8e8f3fc6ff8d6de0333002c3e1b31cf070416dbd
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-03-12 09:16:42 +01:00
Paul Olav Tvete
a90c635d10 Android compile fix
Android is not a proper Linux, and in particular it does not have
pthread_yield().

Change-Id: Ibf94cfacdc24d0c3baaef002c64f9f50c72c01d2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-03-12 09:16:42 +01:00
Paul Olav Tvete
271d4af3ac Compile fix when fileno does not return int
This broke the build on Android where fileno returns a short.

Change-Id: Ic8d32380078faeedcd22e785a912fede28251156
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-03-12 09:16:42 +01:00
Frederik Gladhorn
72e5124b85 Merge remote-tracking branch 'origin/release' into stable
Conflicts:
	tests/auto/opengl/qgl/tst_qgl.cpp

Change-Id: I3c601351c984c1f4b00478d3c47ac9eeb021e892
2013-03-08 16:11:33 +01:00
Axel Waggershauser
6b68be9587 Let QMetaObject::connectSlotsByName(o) also check for signals of o
QMetaObject::connectSlotsByName(QObject* o) creates a list of all
children to look for signals that match slots of o. This changeset
simply adds the object o itself to that list.

The motivation is to finally fix the long standing QtCreator bug
QTCREATORBUG-6494. Where executing 'Go to slot...' and choosing
'accepted()' for a simple QDialog named 'MyDialog' will add a
on_MyDialog_accepted() slot to MyDialog. That slot never gets
connected. More details may be found in the linked QTBUG-7595.

Task-number: QTBUG-7595
Task-number: QTCREATORBUG-6494

Change-Id: I35f52761791af697eabb569adb5faee6fae50638
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-07 08:37:26 +01:00
Alberto Mardegan
079e3b4f3e Add manual tests for X11 embedding
Since we currently implement only half of the XEMBED protocol (we lack
the container part), we use a simple XEMBED container built with Gtk+
and PyObject. Using an interpreted language as Python helps us avoiding
a build dependency on Gtk+.

Change-Id: Ibc6282371c6f767e481c8a8ba2b5ca9cdd0d8b82
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-03-07 08:37:26 +01:00
Thorbjørn Martsum
3222db0937 QVector - removeLast optimize
In case somebody uses QVector as a stack, it is not fair to have
takeLast, removeLast and pop_back to do way too much work.

This is still very slow compared to std::vector::pop_back
(mostly due implicit sharing), however it is more than a
factor faster than before.

Change-Id: I636872675e80c8ca0c8ebc94b04f587a2dcd6d8d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-07 08:37:26 +01:00
Friedemann Kleint
583349de03 Stabilize tst_qclipboard.
If the process terminates while QApplication::processEvents()
runs, the subsequent waitForFinished() returns false and the test
fails.

Task-number: QTBUG-29951
Change-Id: I41f461358920ad430951613dd919885f68ae212c
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-03-07 07:10:35 +01:00
Thorbjørn Martsum
ab52e72292 QVector - add functions takeFirst and takeLast
This patch adds takeFirst and takeLast which are functions
that QList also has.

Change-Id: I761f90b529774edc8fa96e07c6fcf76226123b20
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-07 06:13:06 +01:00
Thorbjørn Martsum
510660080d QVector - add remove functions
This patch adds the functions removeFirst() and removeLast().
Functions that QList has.

Beside making these functions, pop_back and pop_front are
redirected to these rather than calling erase.

Change-Id: Ifc5f8a78e33f436f06f21095a920ec5d4311fd6f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-07 06:12:59 +01:00
Samuel Rødal
a12f6ba302 Fixed dashes being rendered differently depending on system clip.
We need to clip lines to the unclipped device rect in the case of
dashing, since otherwise the dashes will be shifted and rendered
differently when partial repaints are done.

Task-number: QTBUG-24762
Change-Id: I3599b54baa552acc20bf8cc2e12f846b45f6019e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-03-07 02:54:08 +01:00
Samuel Rødal
7128bcbbd5 Attempt to stabilize tst_qgl::graphicsViewClipping().
Make sure the graphics view is exposed and has been painted before
trying to grab the framebuffer.

Task-number: QTBUG-29943
Change-Id: I2945cb78b58265864744a0d5fc99fb430306b578
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-03-07 00:45:04 +01:00
Kevin Ottens
2d1f3d7c51 Add methods to convert lists of QKeySequence to/from strings
QKeySequence provides conversion to and from strings. But a similar
convenience was missing for QList<QKeySequence>. It would come in handy
when you want for instance to save/restore the shortcuts of a QAction.

Change-Id: I9e4f2001c58a595392a5019a57c564992c39bf88
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-03-06 21:50:28 +01:00
Axel Waggershauser
6d0a685fc6 Simplify further extension of tst_QObject::connectSlotsByName
I changed the existing test-case code to make it more scalable
in terms of adding more connectSlotsByName related tests. The
old "manual list of ints"-method was really not developer friendly.

This is a preparation for a subsequent modification of
connectSlotsByName behavior.

Change-Id: Ib760e52631ce4b5ae2a3ebdb4854849ff6c93bfe
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-03-06 21:50:28 +01:00
Friedemann Kleint
04285d94e8 Fix warning about float truncation in tst_qdatastream.
Change-Id: I8e6af7e6534272d1385020212ad7348d9d74b38d
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-03-06 21:50:28 +01:00
Friedemann Kleint
a6d339fd18 Fix loop condition in tst_qhash (CLANG).
Change-Id: Ic841abdf45cd2543500b3dc4030bea5f6fd88174
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-03-06 21:50:28 +01:00
Friedemann Kleint
90a277bce3 Fix warning about tautological comparison in tst_qstandarditem (CLANG).
Change-Id: I87e3705b8e03ca84c90783b29f95ad19e5f33b74
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-03-06 21:50:28 +01:00
Friedemann Kleint
d8e767e928 Fix warnings about unused field variables (CLANG).
Change-Id: I488ad18eb0389d1e9b8b695b7a02eca47bee687e
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-03-06 21:50:28 +01:00
Jan Arve Saether
aa2d10750a Fixed QTreeWidgetIterator to work with sorted QTreeWidget
We cannot access children directly, since that won't ensure that
the pending sort is executed. However, the functions we need are
there already and actually makes the code nicer.

Task-number: QTBUG-29903

Change-Id: I6899284275dd79b991896a5f08486b58d95f819d
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2013-03-06 19:13:28 +01:00
Thorbjørn Martsum
f0533ba8c2 QMap - add multiInsert with hint
This provides a fast multiInsert in QMap (and a fast insert in
QMultiMap) when providing a correct hint.

Change-Id: I3c864c3a7842765fe63f8ecb4b54d0e8c9fd22d7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-06 18:56:30 +01:00
Thorbjørn Lund Martsum
ca6a4258d0 QMap - add insert overload that provide a hint
This adds a fast insert on QMap when providing a correct hint.

Change-Id: I256bba342932c1d4f24c6e65074e1bf47b519537
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-03-06 18:56:17 +01:00
Samuel Rødal
711773776e Fixed potential access violation in QPixmap::copy() for <32 bit pixmaps.
QImage is supposed to maintain the invariant that each scan-line begins
on a 4-byte boundary, so we need to verify that this is the case before
using the optimized path of short-cutting QImage::copy() by referencing
the source image's bits directly.

Task-number: QTBUG-14766
Change-Id: I0a178aeb2f34cc64f98deae9470b55b5c53fcb06
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-03-06 15:00:35 +01:00
Frederik Gladhorn
49a2ec05b4 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/plugins/platforms/qnx/qqnxscreen.cpp
	src/plugins/platforms/windows/qwindowsdialoghelpers.cpp

Change-Id: Ib64f21c077b54f2291d19187590bfe869b98477a
2013-03-06 14:38:07 +01:00
Morten Johan Sørvig
7ee4ab1463 Cocoa: Improve expose event handling.
Send expose events on window and view show/hide
notifications. Implement QCocoaWindow::isExposed.

Close all windows on quit. This allows sending (de-)expose
events for those windows while the event loop is running.

Remove the flushWindowSystemEvents call in setVisible.
This function is called from application code. Flushing
window system events here is wrong since it can lead
to events being processed in the middle of the user
code call stack. flushWindowSystemEvents should only
be called as a result of (native) window system activity.

Skip one of the tst_qtooltip tests which becomes unstable/
fails in the CI system as a result of this change.

Task-number: QTBUG-29583
Change-Id: I3fb8b3f77e2b2e19dfeafba5d7dfcef602891d37
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-03-06 11:43:22 +01:00
Frederik Gladhorn
b861063873 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-03-06 00:11:52 +01:00
Fabian Bumberger
4f60ff6ad3 Do not build qsharedmemory and qsystemsemaphore autotests on QNX
QSharedMemory and QSystemSemaphore are not available on QNX so the autotests can not be built.
Change-Id: Ibfb405f951d21342d64bf215cedc203a8cefe070
Reviewed-by: Wolfgang Bremer <wbremer@rim.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-05 21:56:52 +01:00
Tor Arne Vestbø
d28073d9eb Distinguish between 'mac' and 'macx' qmake scopes
The former applies both on Mac OS X and iOS, but 'macx' is specific to
Mac OS X.

ios.conf and macx.conf now share most of their settings in the common
mac.conf. We set the default QMAKE_MAC_SDK before loading mac.conf, so
that any overrides in the device config will apply afterwards. This
means configure's mkspec parsing will be able to read the QMAKE_MAC_SDK.

Change-Id: I0c7e26a6a0103e19b23ef152aa9e4ab461cee632
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-03-05 20:59:45 +01:00
Thiago Macieira
950b35cf97 Clear the current thread data for the main thread
This avoids crashes accessing deleted memory when creating a QObject
after the last QObject had been deleted, like a qDebug() in global
destructors.

==41000== Invalid read of size 4
==41000==    at 0x5F01ED5: bool QBasicAtomicOps<4>::ref<int>(int&) (qatomic_x86.h:208)
==41000==    by 0x5F01309: QBasicAtomicInteger<int>::ref() (qbasicatomic.h:147)
==41000==    by 0x5F24051: QThreadData::ref() (qthread.cpp:100)
==41000==    by 0x614A984: QObject::QObject(QObject*) (qobject.cpp:681)
==41000==  Address 0x6ee73f0 is 0 bytes inside a block of size 152 free'd
==41000==    at 0x4A0736C: operator delete(void*) (vg_replace_malloc.c:480)
==41000==    by 0x5F240BF: QThreadData::deref() (qthread.cpp:109)
==41000==    by 0x6113F6B: QCoreApplicationData::~QCoreApplicationData() (qcoreapplication.cpp:268)

The comment right above the change in qthread.cpp looks eerily similar
to the problem I'm trying to fix. However, the actual change that
introduced the change is not in the Qt public history, so we can't
know for sure what the problem was then.

Change-Id: I0dba895b041fe6cf81e6f8939ca85035cd00aad1
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-03-05 20:58:00 +01:00
Corentin Jabot
866a5d0c28 Make QProcess startable with open()
Add setProgram() and setArguments() methods to the QProcess api.
Add a convenient start(QIODevice::OpenMode) method.
Move the implementation of QProcess::start() to QProcess::open()
unifying the QProcess api with other QIODevice subclasses.

Change-Id: Id1af57da05f750fe8d526d391589c05ee8037bca
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-05 18:39:35 +01:00
Friedemann Kleint
2759761824 Manual dialog test: Add a page for QWizard.
Task-number: QTBUG-29904

Change-Id: I47df03b0d724ccd156a2854602c41e8f1f2a1d5b
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2013-03-05 18:39:35 +01:00
Frederik Gladhorn
5e8ae03578 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	configure
	qmake/generators/mac/pbuilder_pbx.cpp
	src/corelib/kernel/qtimerinfo_unix.cpp
	src/plugins/platforms/cocoa/qcocoabackingstore.mm
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/windows/qwindowswindow.cpp
	src/plugins/platforms/xcb/qglxintegration.cpp

Change-Id: I8d125fe498f5304874e6976b53f588d3e98a66ac
2013-03-05 13:42:11 +01:00
Laszlo Papp
80af204297 Return -1 as the API documents it for socket issues
Task-number: QTBUG-30024
Change-Id: I51498e6d74ab139134abfb94f35647e995319ee8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-05 12:19:08 +01:00
Paul Olav Tvete
f2dc9f1dc2 Add missing license header
Change-Id: I0a1c453ff87beb7c900c6b1e76432bcd908a999d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-03-05 08:31:23 +01:00
Paul Olav Tvete
97fcf3bc98 Introducing the Qt Android port
Based on the Necessitas project by Bogdan Vatra.
Contributors to the Qt5 project:

BogDan Vatra <bogdan@kde.org>
Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
hjk <hjk121@nokiamail.com>
Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Paul Olav Tvete <paul.tvete@digia.com>
Robin Burchell <robin+qt@viroteck.net>
Samuel Rødal <samuel.rodal@digia.com>
Yoann Lopes <yoann.lopes@digia.com>

The full history of the Qt5 port can be found in refs/old-heads/android,
SHA-1 249ca9ca2c7d876b91b31df9434dde47f9065d0d

Change-Id: Iff1a7b2dbb707c986f2639e65e39ed8f22430120
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-03-05 08:31:23 +01:00
David Faure
1b582d64eb Long live QLockFile
Locking between processes, implemented with open(O_EXCL) on Unix
and CreateFile(CREATE_NEW) on Windows.

Supports detecting stale lock files and deleting them.
Advisory locking is used to prevent deletion of files that are still in use.

Change-Id: Id00ee2a4e77a29483d869037c7047c59cb909339
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-05 06:26:33 +01:00
Alberto Mardegan
e3f36e7290 Make tst_qwidget more stable
This change fixes a failure of tst_qwidget under XFCE (Ubuntu 13.04).

Change-Id: Ic63e85a97ac6e44ce8c281a80ef4e83feecd9185
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-03-04 14:54:57 +01:00
Thiago Macieira
ccdec0b7a6 Remove excess brace added by accident
Added in 53dc49ffc8.

io.pro:44: Excess closing brace.

Change-Id: Ia3810a5a2668d96ab4604831e8ca5b49c7562956
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2013-03-04 14:54:57 +01:00
J-P Nurmi
14dab5b2d7 Add QProxyStyle(QString key) constructor for convenience
The QStyle implementations are becoming private, so the following
slightly verbose pattern seems to be now repeated a lot:

    new QProxyStyle(QStyleFactory::create("windows"))

This change adds an alternative, more convenient constructor for
this particular use case:

    new QProxyStyle("windows")

Change-Id: I97ded597a0fd3225a6354ebea0abb367237430af
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2013-03-04 14:54:57 +01:00
Olivier Goffart
7e5d1c1c2f moc: Support the '$' character as an identifier
Both gcc and clang allow the use of '$' in their identifiers as an
extension. moc should not throw a parse error if there is one in the
file. Instead, consider '$' as valid in identifiers.

Task-number: QTBUG-22720
Change-Id: I8be3a52429c0db5b7e8308b8f4fe475d3d3994bf
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-03-02 12:58:18 +01:00
Olivier Goffart
b0e58a9008 Fix compilation of moc generated file with MEMBER properties
If the object has only MEMBER properties, without any other property
specifying READ, the generated will fail to compile with this error:

tst_moc.moc: In member function ‘virtual int ClassWithOneMember::qt_metacall(QMetaObject::Call, int, void**)’:
tst_moc.moc:3810:42: error: ‘_v’ was not declared in this scope

That's because the '_v' is only declared if 'needTempVarForGet' is set,
and it should be set when we have a MEMBER property.

Change-Id: I829fad3faf69654b5a3fd540857df19f4a9449d4
Reviewed-by: Gerhard Gappmeier <gerhard.gappmeier@ascolab.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-03-02 12:58:18 +01:00
Peter Hartmann
b20d15b58b QUrl: update top level domains that may contain non-ASCII characters
Most notably, .com and .net now may contain non-ASCII characters.
list has been generated from
http://www.mozilla.org/projects/security/tld-idn-policy-list.html

Change-Id: Idc3191dc782bc4173ccb19b4bc81f4f061ca7999
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-02 10:13:27 +01:00
Thorbjørn Martsum
d711f98bfb Clean up manual test to QGraphicsView (rubberband)
This cleans a bit up in the manual test by
a) Removing a weird reference alloration (and replace . with ->)
b) rename for variable from v (which was also the view name) to n.
c) remove a big item in the scene rect that is irrelevant to the test

Change-Id: I49cb319bcc2f4bceef0c96ca86b571b0240a9a92
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2013-03-01 22:10:25 +01:00
David Faure
f2e8a81227 QMimeDatabase: pass MatchMode down, to fix MatchContent.
Task-number: QTBUG-29702
Change-Id: I2f1538adbf8e7a5edfc4276585bf4ef04ce69874
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-01 13:05:11 +01:00
Jędrzej Nowacki
c474f40452 Add QDBusReply::error() const.
The accessor was missing.

Task-number: QTBUG-29917
Change-Id: Ie6759a1120bc9ed6550c271df35f276e15b4eb79
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-01 09:39:23 +01:00
Jędrzej Nowacki
0effb75153 Enable QGlobalStatic autotest.
Change-Id: Icda82dacbc749247153df1edb75629b959030ee9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-28 23:43:50 +01:00
Thiago Macieira
50d3a2917e Fix Q_GLOBAL_STATIC support for exceptions
The problem was that the HolderBase destructor was getting called after
the contained type's constructor threw an exception, as is required by
RAII semantics (the base was fully initialized, so it had to be
destroyed). That was required because we want to return a non-null
pointer from operator() during destruction and return null after
destruction, to keep compatibility with Qt 4.

The solution is to only set the guard to Destroyed only if it is already
at value Initialized. This way, if the HolderBase destructor is run as
part of the stack unwinding, it knows that the construction did not
complete.

Change-Id: I9849b43ed7112bf9e70861b48a56a924c286617e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-02-28 23:43:46 +01:00
Olivier Goffart
ab59a7ef09 Add private API to connect to slots in QObjectPrivate
Change-Id: I16ffbf91ff4c6e9fca6fe7984800d2c24e70701b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-28 19:22:05 +01:00
Olivier Goffart
123ce761c0 QT_MESSAGE_OUTPUT: add support for condition depending on the type
The motivation is to enable coloration the way KDE currently does.
It can now  be achieved with a QT_MESSAGE_OUTPUT set to
"%{appname}(%{category}) \033[31m%{if-debug}\033[34m%{endif}%{function}\033[0m: %{message}"

I was thinking about supporting directly color using something like
%{begin-category-color} that would be smart and detect if we are running
on a terminal, but it would be less flexible in the way the colors van
be configured.

Changelog: QT_MESSAGE_OUTPUT can contain conditionals based on the type
of the message

Change-Id: Icd8de04734a94a3afcbf542a5b78b290a1914960
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-02-27 22:29:43 +01:00
Friedemann Kleint
7867f03f8a Stabilize tst_qprogressbar.
- Wait for shown to ensure events are processed.
- Move away from screen corners/potential task bar areas.

Change-Id: I2c3aa9b675c6b33ca0da67ee99cc6f76c502098a
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-27 20:17:19 +01:00
Paul Olav Tvete
1199136bd3 Fix test script
This script was completely broken, and seems to have been abandoned.

Change-Id: If307f001237609ccb054c0a469213290294161c9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-02-27 18:02:22 +01:00
David Faure
e433553c1b tst_qfile: remove unused variable
Change-Id: I3c827b8a372158815cf234a548a85cf6165c189e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-27 16:00:08 +01:00
Friedemann Kleint
cd1e245877 QStandardPaths: Use forward slash consistently.
Task-number: QTBUG-29249

Change-Id: I027f9ae18544dc47e1378214244487c8a5ae704c
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-27 09:24:33 +01:00
Samuel Rødal
b56caf5f4e Introduced QWindow::setMask() to expose existing platform functionality.
Task-number: QTBUG-28555
Change-Id: I2c649b6d9e9dc69be246cb7658b3edbe9682b1bf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-02-27 09:11:18 +01:00
Thiago Macieira
cafb02911a Make sure that the reference count for plugins is kept correctly
For systems where the Unix signature checker isn't enabled (read: Mac
and Windows), QPluginLoader must actually load the plugin to query for
the metadata. On Mac it even tried to keep the library loaded to avoid
unloading and reloading again when the user calls load().

However, that plus the fact that it was calling load_sys() (on Mac)
meant that it would bypass the reference count checking. And on all
Unix, if a library-that-wasnt-a-plugin was already loaded by way of a
QLibrary, it would have an effect of unloading said library.

So remove the "caching" of the library. We should instead invest time to
write a proper Mach-O binary decoder.

Task-number: QTBUG-29776
Change-Id: Iebbddabe60047aafedeced21f26a170f59656757
Reviewed-by: Liang Qi <liang.qi@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2013-02-27 07:09:18 +01:00
Thiago Macieira
790fe22c52 Autotest: check that the plugin was actually unloaded in QPluginLoader
Change-Id: I66d26da4e86add244d37ff670ad79ff2aff17ca1
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2013-02-27 07:09:13 +01:00
Konstantin Ritt
996db96d5e Fix QString::toUcs4() returns incorrectly resized QVector
...when the string contains surrogate code points.

Task-number: QTBUG-25536

Change-Id: I07251fee641c14f33175678768ddbe551dbe2bb1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-27 03:13:30 +01:00
Friedemann Kleint
176383f3ec tst_qfileinfo: Fix invalid preprocessor directive.
Introduced by 5ec342fefd .

Change-Id: I28f9e093567ef1abf3898146e7183a90888262ad
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-26 19:24:36 +01:00
Thorbjørn Lund Martsum
717a0a9d04 QGraphicsView - emit signal when rubber band changes.
The rubberBandRect function is nice to have, but this patch
makes it easier to track the rubber band by emiting a signal
on change.

That makes it easier (and less clumsy/hacky) to show information
related to the rubber band.

Change-Id: If65eb85d743a1804be3fdb823a821423411e9745
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-26 13:31:45 +01:00
Thorbjørn Lund Martsum
c56f73cc1e QGraphicsView - add function to get RubberBand rect
In many situations it is handy to know the rubberband rect.
There are many situations where we want to show something
related to the rubberband.

Regardless how that is done the rubberband area is needed.
(Not having this is a flaw that can force people to do make
a customized rubberband just to get this information)

Change-Id: Ia854db4c0022b6a97b150af2b4bb78fd5e974991
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-26 13:31:45 +01:00
Stephen Kelly
f136701bc5 Use the base implementation of QAbstractItemModel::sibling in QSIM.
QStandardItemModel doesn't really benefit from a reimplementation of
sibling, and the current implementation is buggy.

Task-number: 29540
Change-Id: Icf8dca29b6e1394a378db5bf6abd884f2d7fd9b9
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-02-26 00:03:26 +01:00
Fabian Bumberger
faefc09e93 Fix qfile autotest on qnx
This fixes the compilation of the qfile autotest on qnx.

Change-Id: Iab099e8b754a4341152e338ff6e3d22a83c625e3
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
2013-02-25 17:34:40 +01:00
Shawn Rutledge
fa5bd4ed98 Added transient window manual test
Change-Id: I05e657488bb05e1aa6343270946512c8793f1e68
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-25 15:00:24 +01:00
Shawn Rutledge
153d613353 Transient QWindows centered; default-constructed geometry
Default-constructed geometry does not mean put the window at 0,0,
and it does not mean center the window on the screen: it means
let the window manager position the window.  If the window is
explicitly positioned at 0,0 though, that is a higher priority
than the transient hint; without this change, the transientFor property
had no effect.  On X11, transient means use center "gravity" to
make the transient window exactly centered.  But the user can still
override the geometry of a transient window, as with any window.
On OSX and Windows, neither transient window functionality nor smart
initial positioning are provided, so a window with no position set
will be centered on the screen, and a transient window will be put
at the center of its transientParent.

Change-Id: I4f5e37480eef5d105e45ffd60362a57f13ec55f5
Task-number: QTBUG-26903
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-02-24 20:41:05 +01:00
Keith Gardner
3b5600f6ee QStringRef: Added toInt(), toUInt(), etc... functions to QStringRef.
Added the following functions to QStringRef: toShort, toUShort, toInt,
toUInt, toLong, toULong, toLongLong, toULongLong, toFloat, and toDouble.
These functions use the corresponding functions found in QLocale.
Updated tst_qstringref.cpp to exercise the new functionality.

Change-Id: I38668a0cc7da0c101a62613fd16cb5a98286617f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-22 21:23:33 +01:00
Stephen Kelly
7477d50fce Populate the cmake variables only one time.
Since we're only including the Extras file one time, invoking set() for
the include dirs again will overwrite the addition of include dirs in
the extras file.

We only need to populate these variables if not set anyway, so do that.

Change-Id: I04dad0674778e79c8c12c18231b8ce6c92edf881
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-02-21 22:41:05 +01:00
Olivier Goffart
b05f19f232 moc: Fix infinite recursion in macro substitution
When performing macro argument substitution, one should keep the set of
macro to exclude, else we can enter an infinite recursion.

Testcase:
 #define M1(A) A
 #define M2 M1(M2)

Task-number: QTBUG-29759
Change-Id: I564bbfed65e1c8599592eaf12c6d67285d2fd9ce
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-02-21 16:55:41 +01:00
Olivier Goffart
03b2512598 Fix QMetaType of const references
This fixes QMetaType detection of const reference arguments in signals
while connecting using the new syntax and Qt::QueuedConnection

const references should have the same QMetaType as non references.
That means we need to remove the const reference while getting the
QMetaType.

Change-Id: I9b2688da7fb9ae985aec0d8fa62a1165357ffe71
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-02-21 14:54:00 +01:00
Albert Astals Cid
70f6652ebd Forward the 3rd parameter of dataChanged
Change-Id: I94f893bf65cd150c3cb1099c91cb13882bcca79a
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-02-21 00:58:32 +01:00
Frederik Gladhorn
dcb710dd87 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	mkspecs/features/unix/separate_debug_info.prf
	src/gui/kernel/qwindow_p.h
	src/plugins/platforms/cocoa/qcocoacursor.mm
	tests/auto/tools/moc/tst_moc.cpp

Change-Id: Ieb57834c00f961a747ffe51e6eb9fc9612cebccf
2013-02-20 22:08:29 +01:00
Jędrzej Nowacki
dacc222d5a Fix QVector detaching in one thread while another destroys it.
The patch adds handling for a case when a QVector is shared between two
threads. In such scenario detaching in one thread could collide with
destruction in the other one, causing a memory leak or assert in debug
mode.

Task-number: QTBUG-29134
Change-Id: Idbff250d9cfc6cf83174954ea91dbf41f8ea4aa4
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-20 15:22:55 +01:00
Jędrzej Nowacki
d3a4230757 Make QVector instances counter thread safe
Change-Id: I7c7aa1eb0f8e91c43023882a3734e908be4ba4fe
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-20 15:22:55 +01:00
Friedemann Kleint
4606ea5395 QProgressBar: Use localized numbers and percent sign.
Task-number: QTBUG-28751

Change-Id: I56aca3e0ee9c579297110c69d2d832c7a57f1ae7
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Karim Pinter <karim.pinter@digia.com>
2013-02-20 08:15:26 +01:00
Tor Arne Vestbø
443380d97f Don't run qmake test that requires macx makespec on non Mac OS platforms
And update test to use the clang makespec now that it's the default.

Change-Id: Ifdd34c4220ad76f60b91fd6ef39d189f0f6525f9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-02-20 00:46:50 +01:00
Richard Moore
5ebc8d3663 Add an encrypted() signal to QNetworkAccessManager and QNetworkReply.
Add an encrypted signal to QNAM and QNetworkReply to allow applications
to perform additional checks on the certificate chain beyond those done
as part of the standard SSL validation. This allows things like
certificate change notification to be implemented for QNAM as they can
be for QSSLSocket currently.

Change-Id: I693e3e6fec8b7040379b7e7f1f819550e6b2617f
Reviewed-by: Peter Hartmann <phartmann@rim.com>
2013-02-19 21:37:32 +01:00
Richard Moore
7898080ca7 Add support for intermediate certificates to server sockets.
Add intermediate certificates to our server sockets, and to our client
certs.

Change-Id: Ib5aa575473f9e84f337bebe35099506dd7d7e2ba
Task-Number: QTBUG-19825
Task-Number: QTBUG-13281
Reviewed-by: Peter Hartmann <phartmann@rim.com>
2013-02-19 21:37:24 +01:00
Richard Moore
4a07519877 Store the local certificate in a QList.
Instead of storing a single QSslCertificate for a the local cert, store
a list of them. This will allow us to handle server sockets that use a
certificate that is not issued directly from the CA root in future.

Change-Id: I9a36b9a99daa9c0bdd17f61b4ce1a7da746f2e96
Reviewed-by: Peter Hartmann <phartmann@rim.com>
2013-02-19 21:37:14 +01:00
Jan Arve Saether
18f9eb797b QStackedLayout: Fix crash when focus widget is destroyed in hide()
We also have to make sure that when moving back to a page
that has a focusWidget(), the focus should go to the focusWidget()

Task-number: QTBUG-18242

Change-Id: Ibfa7d6361c1a456480b2f1584a88ef4c4f405709
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-19 21:07:14 +01:00
Jan Arve Saether
64106705e7 Clean whitespace
Change-Id: Iec1950a0f4053cd71633162f0cb50efc9d4d493f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-19 21:06:53 +01:00
Tor Arne Vestbø
eb09f9b82c moc: Error out when detecting unterminated macro usage
Exhausting the symbol list while looking for the
final right parenthesis means it is missing.

Task-number: QTBUG-29308
Change-Id: Iccf5897b0f5eb719699fd12d6c8e4a16ff189d9b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-02-19 20:51:44 +01:00
Oliver Wolff
5dbd42a62e Check for network module when building according benchmarks
Change-Id: I5e4cb3ef6fdb5de772d13029c11170d0f0eb3ee5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-19 19:21:08 +01:00
Oliver Wolff
bf04283b4e Removed unneeded printsupport dependency from qpainter autotest
Change-Id: I906726a3d77572b9e054adbc68c4755dd663ad87
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-19 19:21:03 +01:00
Oliver Wolff
1a6bea1ceb Check for printsupport module when building according auto tests
Change-Id: I9bade7b31c75331190960cb14dee6840e3582c50
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-19 19:20:58 +01:00
Oliver Wolff
53dc49ffc8 Check for network module when building according auto tests
Change-Id: I68013bf8e07be8d202b3253f997d4f4db05335a4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-19 19:20:53 +01:00
Peter Hartmann
165926c3ae SSL session sharing auto test: Retrieve smaller file for testing
The "mediumfile" is actually 9.6 MB large, and makes the test slow and
even fail on mobile platforms.

Change-Id: I694d9d38e4d09c8e90a03c1141320fe2a757fdd9
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-02-19 10:35:06 +01:00
Pasi Petäjäjärvi
5ec342fefd Fix QFileInfo autotest for VxWorks.
No users/groups/symlinks on VxWorks.

Change-Id: I524a568202db2478b070b16a63ae425224c3aaa0
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-19 10:35:06 +01:00
Pasi Petäjäjärvi
7e8cc3b3ba Fix QFile autotest for VxWorks
No users/file permissions. Open function in VxWorks DKM
requires always three parameters.

Change-Id: I93fb075d82aa57e210e224bfe4ede40def82c275
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-19 10:35:06 +01:00
Pasi Petäjäjärvi
10d077fa19 Fix QSettings autotest for VxWorks
No users/groups on VxWorks.

Change-Id: I88912c93fa59dc7c00bdbb973fc34ecd631b3316
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-19 10:35:06 +01:00
Morten Johan Sørvig
73d32873cf Cocoa: Add QMdiSubWindow size grip back.
Change all Q_WS_MAC -> Q_OS_MAC in qmdisubwindow.cpp

Remove QEXPECT_FAIL from tst_qmdisubwindow.cpp.

Task-number: QTBUG-29434, QTBUG-25297
Change-Id: I299b87ab994e2d5ba93d5bbae48de0df1ac1c9d6
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-02-19 08:53:55 +01:00
Tor Arne Vestbø
3988ad95f7 moc: Error out when detecting unterminated macro usage
Exhausting the symbol list while looking for the
final right parenthesis means it is missing.

Task-number: QTBUG-29308
Change-Id: Iccf5897b0f5eb719699fd12d6c8e4a16ff189d9b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-02-19 07:55:39 +01:00
Keith Gardner
cfc09b6564 QLocale: Added QStringRef overloads to toInt(), toUInt(), etc...
Added the following function overloads to QLocale: toShort, toUShort,
toInt, toUInt, toLong, toULong, toLongLong, toULongLong, toFloat, and
toDouble.

Change-Id: I8cd90ca08b88338b08a73a72492f4c91c4f46ea4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-18 22:24:54 +01:00
Frederik Gladhorn
f4900d340a Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/widgets/styles/qmacstyle_mac.mm

Change-Id: If8326db9e7da3cbf45dbf7475fdff9915c7723b1
2013-02-18 16:14:52 +01:00
Yoann Lopes
c7a51f1858 Added QOffscreenSurface class.
Inherits QSurface and allows to use OpenGL from an arbitrary thread.
Platform plugins can implement QPlatformOffscreenSurface, otherwise an
invisible QWindow is used by QOffscreenSurface.
This patch includes an implementation of QOffscreenSurface for XCB
and EglFS platform plugins using pbuffers.

Change-Id: I57b4fc1db417331f34826dcfa754b7698782fde4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-18 13:42:22 +01:00
Tor Arne Vestbø
0768920dbd Remove ifdefs for supporting Mac OS <= 10.5
Qt5 requires Mac OS 10.6, so we can remove checks such as
if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6

Change-Id: Iea21727a277291148704ecf9677ed0b68c24920f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-18 00:31:54 +01:00
Giuseppe D'Angelo
e88011357e Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-02-17 20:31:38 +01:00
Tor Arne Vestbø
2df8884bc6 Skip tst_QSslSocket::setReadBufferSize_task_250027()
It's flakey and is blocking integration. Tracked in QTBUG-29730.

Change-Id: Ia5b8f952314bf2e1aa6dbb5c5c0a97e32e68d0f6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2013-02-17 20:31:31 +01:00
Tor Arne Vestbø
159f42222d Remove duplicated code for handling OpenGL extensions in QtOpenGL
We now re-use QOpenGLExtensions/Functions from QtGui in the same way
as QtGui uses these classes. There is still some duplicated logic
in qglfunctions.cpp, but this code now at least uses the shared
QOpenGLExtensionMatcher class.

Change-Id: Ie04008c43d430ae805e6ec1c45e7e363deeb3b8f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2013-02-17 20:31:30 +01:00
Peter Hartmann
08f8027a0e SSL benchmarks: add benchmark for uploading data
All Web service APIs like Facebook, Twitter etc. use SSL for
uploading pictures etc., so it is good to have a benchmark
for that.

Task-number: QTBUG-28764
Change-Id: I590f76ac8b6575509f1635c18c35f9fe652fa8f8
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-02-16 09:28:24 +01:00
Friedemann Kleint
c4314f7aeb Filedialog test: Do not set directory if empty.
Make it possible to test the saving/restoring of directories
which is done by default.

Task-number: QTBUG-28855
Change-Id: Id16010b6aea9cd78b9bebdbe1b148eb7f5141f8b
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2013-02-16 09:04:27 +01:00
Israel Lins
776c488b6f QSqlResult: fix parsing of bound SQL statements
Parsing for bound SQL parameters now handles identifier quoting using
double quotes (") and square brackets ([]).

The following has only 1 bound value but previously 2 were detected:
SELECT 1 AS "A?b[?']]]de?ghi", ?

Task-number: QTBUG-27159
Change-Id: Icfd02187e1126ff3b5ed11df8d4e599f574e61bf
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-15 15:47:58 +01:00
El Mehdi Fekari
c2bdca2d54 QLocale: add autotest for tamil's AM/PM text
Change-Id: I67e572f16fcabd5833549286be20172e7f2a2337
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-02-15 15:46:57 +01:00
Frederik Gladhorn
e65cd6f379 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/concurrent/doc/qtconcurrent.qdocconf
	src/corelib/doc/qtcore.qdocconf
	src/corelib/global/qglobal.h
	src/dbus/doc/qtdbus.qdocconf
	src/dbus/qdbusmessage.h
	src/gui/doc/qtgui.qdocconf
	src/gui/image/qimagereader.cpp
	src/network/doc/qtnetwork.qdocconf
	src/opengl/doc/qtopengl.qdocconf
	src/opengl/qgl.h
	src/plugins/platforms/windows/qwindowswindow.cpp
	src/printsupport/doc/qtprintsupport.qdocconf
	src/sql/doc/qtsql.qdocconf
	src/testlib/doc/qttestlib.qdocconf
	src/tools/qdoc/doc/config/qt-cpp-ignore.qdocconf
	src/widgets/doc/qtwidgets.qdocconf
	src/xml/doc/qtxml.qdocconf

Change-Id: Ie9a1fa2cc44bec22a0b942e817a1095ca3414629
2013-02-14 14:24:57 +01:00
Samuel Rødal
733430636d Fixed crashes when using QImage in combination with QCoreApplication.
As long as fonts weren't used we supported using QImage in combination
with QCoreApplication in 4.x, and there's no reason we can't continue
doing so.

Task-number: QTBUG-29643
Change-Id: I2cf351d3c93f1c175bbf624e45024d39ab913111
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2013-02-14 10:55:33 +01:00
Samuel Rødal
17e8286fef Fixed mouse double click events not bubbling up to parent widgets.
The bug was caused by changes b371f3f943
and 3bb9024952, which removed the event
forwarding that QWidget::mouseDoubleClickEvent() used to do without
making sure to call ignore() on the event like
QWidget::mousePressEvent() does.

Task-number: QTBUG-29680
Change-Id: I98af8052ad3dd1dea15d07a710aa9212ef5e4a68
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-14 10:55:33 +01:00
Frederik Gladhorn
e432d53883 Only compile SSL tests when openssl is available.
Change-Id: I79fc705f30fb84e86bd7d674d90fbbe2d1a124ba
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-02-13 23:56:41 +01:00
Stephen Kelly
cc7239da8d Make it possible to use QPointer<const T>
This is possible with QWeakPointer, so allow it for migrating
code too.

In the process, replace the QPointerBase with a member variable for
simplicity. The functionality of the QPointerBase is replaced
by a TypeSelector template.

Change-Id: I3b4c77bdeda2b863cc33e84a3da8a25bae928c8c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-02-13 15:15:56 +01:00
Stephen Kelly
0fb979fe23 Remove QPointerBase bic check.
QPointerBase is not public or exported and it is to be removed
in Qt 5.1.

Change-Id: I060c6b2ebcde8dedde85dc21404fc393150d452c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-02-13 15:06:53 +01:00
El Mehdi Fekari
640374d052 QLocale: add autotests for Japanese and Czech locales
Change-Id: Id4351ab49bfbdf91b65ccb5153c5d01f53acdf72
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-02-12 22:47:14 +01:00
Giuseppe D'Angelo
d57731b0d7 QRegularExpression: print a warning if (?J) is used in a pattern
(?J) inside a pattern string can be used to allow or disallow duplicated
capturing group names in the pattern string itself.
Although PCRE supports duplicated names, in Qt we don't yet.

Change-Id: I21cd0c41273cd7ef42870ced3a0fad6ba7035cbc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-12 22:40:21 +01:00
Friedemann Kleint
9a74bbf34f Fix developer-build of qsslsocket_onDemandCertificates_member.
Do not include qsslsocket_p.h unless SSL is present.

Change-Id: I7e56b7758729907892d85f97d5a9d3ccaf7a3314
Reviewed-by: Peter Hartmann <phartmann@rim.com>
2013-02-12 17:56:10 +01:00
Samuel Rødal
62d25e4d4f Fixed QPixmapCache associating path with wrong QPixmap.
QPixmap::load() would not detach, so multiple paths could get associated
with the same QPixmap, causing the wrong pixmap to be shown.

Task-number: QTBUG-29639
Change-Id: I064dd6a9611b5996853bec9fb20b6224a0adcf62
Reviewed-by: aavit <eirik.aavitsland@digia.com>
2013-02-12 15:21:57 +01:00
Samuel Rødal
23b11e792c Added QWindow::Visibility convenience API to QWindow.
This finally makes it possible to make windows fullscreen etc from
QML by doing "visibility: Window.FullScreen". I don't see any reason
from not having the API at the QWindow-level instead of at the
QQuickWindow-level since this way it can benefit other use cases too.

Change-Id: If27344306eb563bc2ccd83296a46b1f2862e2db1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-02-12 15:02:53 +01:00
Mark Brand
60c1f9f274 QSqlQuery tests: fix create table failures
Change-Id: Id20517cc68d03ac008650374fadd96cd6626d3fe
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-12 12:42:54 +01:00
Mark Brand
46b7c91c81 QSqlQuery tests: fix bool test for postgresql
Change-Id: I60634f89841cbc81058588e435c6482c6c0efed6
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-12 10:56:00 +01:00
Mark Brand
f01caaf64a QSqlQuery tests: fix mysql problems
Change-Id: I82f4e6c8801c7a936b80ad72c229f915e6d2a4de
Reviewed-by: Israel Lins Albuquerque <israelins85@yahoo.com.br>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-12 10:54:51 +01:00
Mitch Curtis
4aa86461eb Ensure QDateTime can handle QDate's full range of julian dates.
Currently, using QDate::maxJd() in tests will fail. This patch changes
some ints to qint64s to prevent overflows where necessary.

Change-Id: I61ebf8f233411a7544689fd5bfa9c3abee54e933
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-12 07:29:36 +01:00
Mitch Curtis
86115848b5 Correctly detect HTML 5 charset attribute in QTextCodec::codecForHtml()
QTextCodec::codecForHtml currently fails to detect the charset for this
HTML:

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=9,chrome=1">
    <title>Test</title>
    </head>

This patch makes the detection of charsets more flexible, allowing for
the use of the HTML 5 charset attribute as well more terminator characters
("'", and ">").

I also added a *_data function for the unit tests.

Task-number: QTBUG-5451

Change-Id: I69fe4a04582f0d845cbbe9140a86a950fb7dc861
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Denis Dzyubenko <denis@ddenis.info>
2013-02-12 01:31:26 +01:00
Friedemann Kleint
d180560e14 Fix QWindow::setFramePosition() to keep the size.
Change-Id: I14551e0d0573c2e8d86d76eadab4df9f3c8ed5e4
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-11 15:17:07 +01:00
Sze Howe Koh
26817211d2 Fix module name format in displayed code
Follow the conventions at
http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation

QtDBus       -> Qt D-Bus
QtMultimedia -> Qt Multimedia
QtWidgets    -> Qt Widgets

Change-Id: I96a1523b37e294b10b203782074943c6ec55e34a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-11 01:43:21 +01:00
David Faure
b61cff8d6e qprocess autotests don't need QtGui
(this isn't true of -all- corelib/ autotests though, e.g. tst_qdatastream
uses QBitmap)

Change-Id: I314fda5d85d45cb5eece8da74156989b83cf0299
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-09 18:44:41 +01:00
Richard Moore
20bde28448 Add support for SHA3 to QCryptographicHash.
This commit adds SHA3 support to QCryptographicHash. Two implementations
are provided, one optimised for 32 bit and one for 64 bits. The code has
been written to make it easy to add further implementations, for example
ones using NEON instructions on ARM.

Change-Id: I3be9c45bbd4fcc2771d697e7f7ae74e48a831e8f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-02-09 15:58:09 +01:00
Peter Hartmann
916f0ff663 QUrl effective TLDs: update table and split into chunks of 64K
The table is there to know which domains are allowed to set cookies
and which are not. There are more than 2000 new entries since the
list has last been generated.
The split to 64K chunks was made because this is the hard limit for
strings in Visual Studio.

Change-Id: I511aec062af673555e9a69442c055f75bdcd1606
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-09 10:12:44 +01:00
Mark Brand
93ed02e3b1 fix QSqlTableModel:revert() for OnFieldChange
revert() should operate in OnFieldChange edit strategy just as
submit() does. The reason in Qt 4 for excluding OnFieldChange
was that there was no opportunity to revert. The model was
refreshed, causing all changes to be lost. In Qt 5 a failed
edit remains in the cache until user action, which could be
to revert.

Change-Id: Ide021c4f83a53834b7ed81f2abfa3aa49317704d
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-09 01:39:54 +01:00
Samuel Rødal
bfa1584162 Added version() and setVersion() convenience API to QSurfaceFormat.
This lets you write code like format.version() >= qMakePair(3, 2), and
format.setVersion(4, 2) instead of format.setMajorVersion(4);
format.setMinorVersion(2);

Change-Id: Ib052091cc12865ea0d5db52e468ed6cd28f14840
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-02-08 20:00:00 +01:00
BogDan Vatra
934afb5c57 Fix loading of SSL certificate of DER files.
DER certificates should not be opened as text files, so we
only pass the QIODevice::Text flag when the format is
QSsl::Pem.

Change-Id: I4bad98023c397b967d5beeec0aaa6c414e06fd9c
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-02-08 17:37:51 +01:00
David Faure
574e5cf9c5 Add qunsetenv(), next to qputenv() and friends.
The existing tst_qgetputenv shows that qputenv with an empty value
doesn't lead to the same result on Windows and on Unix, and there was
no way to fully delete an env var on Unix (which is needed for some
env vars where not-set and empty are different, such as TZ,
see `man tzset`).
This is also why qglobal has qEnvironmentVariableIsSet() vs
qEnvironmentVariableIsEmpty(), on the getter side.

Qt4's ifdefs around unsetenv in qapplication_x11.cpp show that this is
needed within Qt too (although this particular startup notification code
has to be re-imported into Qt5 still).

Change-Id: I631c8cddbcf933d4b9008f11aefc59f5a3c7c866
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-07 01:22:40 +01:00
J-P Nurmi
ee317360e3 QColorDialog manual test: add initial color selection
Change-Id: I956404af728ef0d70977f6c69b1059b3656edd91
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-07 01:22:40 +01:00
J-P Nurmi
0de3ea6554 Dialog testing tool: add missing enableDeleteModalDialogButton() calls
Change-Id: I012dc8c7c07fced69f8b7eda7a1686af1e11033f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-07 01:22:40 +01:00
Peter Hartmann
b5652df775 SSL: Implement session sharing and use it from QNetworkAccessManager
This improves performance since a network round trip can be avoided.

Change-Id: I1aaff7e48ef9638cb137de0f43942c3a4dd2884a
Initial-patch-by: Markus Goetz <markus@woboq.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-02-06 23:24:44 +01:00
Jan Arve Saether
20204fe58b Do not crash if the child index is out of range.
Task-number: QTBUG-29077

Change-Id: I934101cdc121e9ef99de2e9eeaef154dd4cae0d8
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-02-06 12:00:07 +01:00
Samuel Rødal
af84313c62 Fixed crash in image reader when reading certain BMP files.
If the high bit in a mask is set, for instance if the mask is
0xff000000, and we shift it to the right by 24 positions, since the mask
was not declared as unsigned we ended up with a mask value of
0xffffffff. We then add 1 to this value and divide by the result,
causing a division by zero crash.

The masks need to be declared unsigned to prevent sign bit extension
when shifting right.

Task-number: QTBUG-29194
Change-Id: I79260344cebfbdd3ea86416a9c734dca76517999
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-02-06 09:59:56 +01:00
Mark Brand
c3ae1c76f3 QSqlTableModel: support refreshing inserted rows with auto columns
Previously, selectRow() did not work after INSERTing a new row into a
table with an automatically populated column. It did not work because
the model did not know the primary values for the new row. Newly
inserted rows were therefore not refreshed in OnFieldChange and
OnRowChange edit strategies.

This change provides support for the typical simple case where a single
column is populated by the database and can be retrieved with
QSqlQuery::lastInsertId().

Task-Number: QTBUG-29102
Change-Id: Ibf0f0ac8661185bde57034ddf40c2178bece4778
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Lukas Geyer <lgeyer@gmx.at>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-06 07:57:47 +01:00
Mark Brand
33c212b7d2 QSqlTableModel::setData(): fix non-change detection
Commit 10ff9de91b introduced the
optimization of ignoring non-changes, but it overshot the mark.
It neglected to consider that QVariant's equality operator does not
compare the null flag. It also failed to consider that setData() has
a useful side effect of setting the generated flag in a column of a
pending INSERT. This is important when the application actually wants
a NULL to be inserted into the column.

Task-number: QTBUG-29217
Change-Id: I1368f7acc21eebfeb5a8d23746fc38f6f30fd395
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-06 07:57:28 +01:00
Mark Brand
a694b9f8d2 fix QSqlTableModel::headerData() for empty query with inserted row
QSqlQueryModel::headerData() relied on virtual indexInQuery() to
detect whether the requested column at row 0 mapped to an index in
the query. This failed when row 0 was a pending insert managed by
QSqlTableModel, and therefore not in the query.

The only thing that matters here is the column.

Task-number: QTBUG-29108
Change-Id: I3e0ae85ba223e444781ec8033386d394bb44f0e8
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-06 07:57:13 +01:00
J-P Nurmi
5809471ac7 Manual test for QFontDialog
Change-Id: I2bcdd30990e88af45c8d4b2756fcdd48fc2a47d7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-05 14:42:50 +01:00
Laszlo Papp
6c6960015e Add qDegreesToRadians and qRadiansToDegrees math functions
Change-Id: I6e9fd76f2d2860f46531a72349b46193b8eeaaa7
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-05 14:40:14 +01:00
Giuseppe D'Angelo
53f9e77140 QRegularExpression: add method for extracting the capturing group names
It may be useful to know which named capturing groups are defined
in an regular expression, and for each of them, what's the
corresponding index. This commit adds the needed method
to QRegularExpression.

Note that extracting the information doesn't happen while holding
the mutex in the private -- pcre_fullinfo just reads information
from the compiled pattern, so that's thread-safe.

Task-number: QTBUG-29079
Change-Id: I50c00ee860f06427c2e6ea10417d5c0733cc8303
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-02-05 13:46:25 +01:00
Marcel Krems
513971eecd QSqlError test: Fix isValid()-check for constructed QSqlError.
Change-Id: I4dc1f537226139ceca017cc36abadd2fba4ce35b
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-04 14:44:19 +01:00
Thorbjørn Lund Martsum
08a632ac1a QTreeView::expandToDepth - add missing emit of expanded and collapsed
Just like other functions this function should emit expanded and
collapsed.

A part of fixing
Task-number: QTBUG-8176

Change-Id: I6d801f61e6f0cb8836634cc52f0be2b610f6c728
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-02-02 08:10:55 +01:00
Sergio Ahumada
d011f64524 tests: Fix some more old references and links to Nokia
Task-number: QTBUG-28156
Change-Id: Ifb768b167203c901c5e42ce58c9aaf3db2739320
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-02-01 15:27:37 +01:00
Friedemann Kleint
40eaa72319 Do not run tst_qfilesystemmodel for MinGW.
Task-number: QTBUG-29403

Change-Id: I91c938d9a6510ae91e54cd53e2d9df0a56b68d50
Reviewed-by: Simo Fält <simo.falt@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-02-01 09:18:42 +01:00
Friedemann Kleint
8138a09e05 Replace SRCDIR-define by QFINDTESTDATA in tst_moc.
Remove srcify() function, which was warned about as unused
on Windows.

Change-Id: I731d3b6f058d4246e39dcf9a137619ae5087d751
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-01-31 22:14:27 +01:00
Thorbjørn Lund Martsum
3260aec38e QTreeView - emit collapsed in collapseAll()
When we call call collapase we emit collapsed. Therefore it should
also be emitted on collapseAll()

This partly solves:
Task-number: QTBUG-8176

Change-Id: I20c1388fcbbb60d12debb4a0b3b0d9fed41e2563
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-01-31 13:12:40 +01:00
Thorbjørn Lund Martsum
80fa4b6c8e QTreeView - emit expanded on expandAll
When we call QTreeView::expand expanded is emitted.
For the same reason we should emit expanded on expandAll()

This partly solves:
Task-number: QTBUG-8176

Change-Id: Ie85e724eec50980c68f626ec47dec5c1e08cc085
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-01-31 13:12:32 +01:00
Morten Johan Sørvig
a9458a1755 Clean up logical dpi for QImage.
Revert to the pre highdpi-patch behaviour.

Before, both physical and logical DPI would be based
on the dpmx/dpmy variables, which could be changed
with setDotsPerMeter(). The highdpi patch introduced
separate ldpmx/ldpmy variables, which were not
changed by setDotsPerMeter().

This broke when loading images: setDotsPerMeter
would be called but the logical dpi would not change.

Remove ldpmx/ldpmy. Keep scaling the physical dpi
by the devicePixelRatio, which will be set to 1 by
default.

Task-number: QTBUG-29187
Change-Id: I0d6f5f3b8efae5fb1adc0a50b22a5da78324a282
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-31 10:39:38 +01:00
Nils Jeisecke
ffea8e98f7 Update roleNames in QAbstractProxyModel if sourceModel resets.
If a sourceModel resets, it's roleNames might have changed. This
is most likely the case if sourceModel itself is also a proxy model
of which the sourceModel was changed.

Task-number: QTBUG-28982
Change-Id: I102788f2c9bf97b4002b350673f9219e32e7a052
Reviewed-by: Nils Jeisecke <jeisecke@saltation.de>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-01-30 15:17:05 +01:00
Friedemann Kleint
07843b1b12 Fix warning about incorrect format in tst_qlocale.
type is unsigned long, should be %lu. Replace by stream.

Change-Id: Ib0346b54a4494910b4a5927d0de45840ca53fbda
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-01-30 13:00:02 +01:00
J-P Nurmi
b7eaf2efdf Manual test for QColorDialog
Change-Id: I4eab3ecfbe5b6e7d663fe92d49af173fd179ba6e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-01-30 10:47:05 +01:00
Stephen Kelly
8eae3a923a Provide the resetInternalData slot to cleanly reset data in proxy subclasses.
This was part of Qt 4.8, but Qt 5.0 was branched before that, so
the commit was lost.

Change-Id: I2a2ab3c75a0943ac734d588ebd74bc158dd6aaaf
Reviewed-by: Nils Jeisecke <jeisecke@saltation.de>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-30 10:44:32 +01:00
Sze Howe Koh
52a317092e Doc: Fix references to Qt Test
QtTestLib and QTestLib don't exist. The proper name is "QtTest" (code)
or "Qt Test" (English)

http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation
http://lists.qt-project.org/pipermail/interest/2012-December/005221.html

Files paths in qttestlib.qdocconf can't be changed easily however, as it
breaks things. So, they're left as they are.

Change-Id: Ifbc44ea858c453bedad8cd7723f847e67fc7a85a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-01-30 01:35:06 +01:00
Sergio Ahumada
f27b1b8795 test: Add bic data for linux-gcc-amd64
Task-number: QTQAINFRA-321
Change-Id: I449d51088d3e5bfc6f92f036d498a2ef6f7a46b2
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-29 23:34:24 +01:00
Keith Gardner
159e17bc5b QStringRef: Added a trimmed() function.
Change-Id: I67c5d10f29f420e0aea95cf32b5d3c17c141899c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-01-29 22:28:17 +01:00
Peter Hartmann
7d757fc8fe QSslSocket tests: use qt-project.org as test server instd of codereview
Change-Id: I1f3a860bf1ab24c30001059b7bcbb19fba7cbc1d
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-01-29 13:00:38 +01:00
Frederik Gladhorn
3eb588078e Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-01-29 11:33:35 +01:00
Stephen Kelly
d315e01218 Add the Qt::ItemNeverHasChildren flag and use it in QTreeView.
It can be used to determine whether expand() should really expand.

Change-Id: If79d8c295a4ca1356e60051682b227524a065126
Reviewed-by: David Faure (KDE) <faure@kde.org>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2013-01-29 09:28:43 +01:00
Friedemann Kleint
00ad768f10 Do not execute tst_qfilesystemmodel in parallel.
It may interfere with other file system tests.

Task-number: QTBUG-29014
Change-Id: I32dd7428993b0da1a2f70ec3e581050012a4ff32
Reviewed-by: Simo Fält <simo.falt@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-01-29 07:30:45 +01:00
Thiago Macieira
edd2d9bd0a Make the null pointer dereference a volatile one
This is to ensure that the compiler won't optimise it out of existence.
Clang says it will do it:

testProcessCrash/main.cpp:50:5: warning: indirection of non-volatile null pointer will be deleted, not trap [-Wnull-dereference]
    *(char*)0 = 0;
    ^~~~~~~~~

Change-Id: Iac7771046442f869e205e8789fffdd6443d58e67
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-29 01:47:01 +01:00
Sergio Ahumada
07e3bcdc10 Remove QT_{BEGIN,END}_HEADER macro usage
The macro was made empty in ba3dc5f3b5
and is no longer necessary or used.

Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html
Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-01-29 01:06:04 +01:00
Thiago Macieira
2a3d690a19 Forward-port tests on invalid port numbers from Qt 4
These tests were added to Qt 4 on commit
a17fc85b51a6bdcfa33dcff183d2b7efd667fb92

Task-number: QTBUG-28985
Change-Id: I3cf595384f14272197dcfb85943213c8f8ddeba0
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2013-01-28 21:07:41 +01:00
Sze Howe Koh
7bb43454b8 Fix minor typos in docs, printed messages & comments
Missing apostrophes

Change-Id: I3ef5e9d494fb7a37f8e6075f24cd3a274e572c23
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-01-28 18:12:41 +01:00
Peter Kümmel
70a9caf4de QVarLengthArray: add squeeze function
Add function to move back data to the stack.

Change-Id: Ic78a368459bce68629e29602e4eeae2e1afe398b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-28 16:52:40 +01:00
Friedemann Kleint
ff31462e73 Fix MinGW-Warnings in tst_qwinoverlappedionotifier.
Change-Id: I66c4e274c8b686d8a69476ad10751008f256e5a2
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-28 16:19:21 +01:00
Friedemann Kleint
2b3ed64951 Fix warning about redefinition of _WIN32_WINNT.
This is redefined by qt_windows.h

Change-Id: I6a8cb06c93c4055b166f1a214cba981d61680b9c
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-28 16:19:17 +01:00
Pasi Petäjäjärvi
f3fc2078b8 Check existence of QProcess feature before using it on Qt autotests.
VxWorks does not have QProcess support.

Change-Id: I917b769f967e9d71ec5025aae788f3e237b07aeb
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
(cherry picked from commit 416e73a0fc)
2013-01-28 16:06:15 +01:00
Frederik Gladhorn
02ba93dd3d Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I12b4d8b99bdccae53b1a978cd6eb8f4ac6fb3c76
2013-01-28 11:10:29 +01:00
Friedemann Kleint
322055b9c9 tst_qfilesystemmodel: Avoid commonly used folders.
Use the test's temporary directory instead of
QDir::temp() and the documents folder
instead of QDir::home(). Split out unrelated test
from data-driven sort test.

Task-number: QTBUG-29014

Change-Id: I229f0b1c0f1e43b56d19ebd43fd7cc64a85b1222
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-28 09:41:39 +01:00
Friedemann Kleint
74c3a2f4f4 Fix warning about redefinition of M_PI in tst_qwmatrix.
Change-Id: Ib5e5fe0f087448b07adfa02984524cbb10c78395
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-01-28 09:41:39 +01:00
Friedemann Kleint
e334fb6493 Fix warning about unhandled enumeration values in tst_sqldriver.
Change-Id: I4e750982aab861abbbbabe980a663f8b118cdf54
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-01-28 09:41:39 +01:00
Mitch Curtis
5c5c9c26d2 Don't emit activated on clicking disabled itemview item.
A itemview item with its flags set to Qt::NoItemFlags is considered
disabled, and therefore should not cause the activated signal
to be emitted.

Task-number: QTBUG-20490
Change-Id: If824505c46f4fcadb9265ad6d1e9337f0cee32cf
Reviewed-by: David Faure (KDE) <faure@kde.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-01-26 21:22:22 +01:00
Jean-Paul Delimat
4bb5566632 Add toJson() formatting argument to QJsonDocument interface
The writer delegate used by QJsonDocument to produce a Json QByteArray
supports generating a human readable Json (with spaces and carriage
returns that reflect the Json structure) and a less human readable (no
spaces nor carriage returns) but more compact Json.

The method toJson() was extended with a format argument to support
the compact Json generation.

Task-number: QTBUG-28815
Change-Id: I8d13849ab9ab6ed7c645011260251dc14a8629d2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Debao Zhang <hello@debao.me>
2013-01-26 03:09:27 +01:00
Laszlo Papp
e335fb7254 Add static dotProduct methods to the QPoint(F) classes
Change-Id: I66ac9433b74341a83569a60038ea2f7a025e81b1
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-26 00:09:14 +01:00
Sze Howe Koh
63569a68d2 Doc: Fix module name format
Follow the conventions at
http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation

QtCore         -> Qt Core
QtDBus         -> Qt D-Bus
QtDesigner     -> Qt Designer
QtGui          -> Qt GUI
QtImageFormats -> Qt Image Formats
QtNetwork      -> Qt Network
QtPrintSupport -> Qt Print Support
QtScript       -> Qt Script
QtSql          -> Qt SQL
QtSvg          -> Qt SVG
QtTest         -> Qt Test
QtWebKit       -> Qt WebKit
QtWidgets      -> Qt Widgets
QtXml          -> Qt XML

QtConcurrent   -> Qt Concurrent (partial)
QtQuick        -> Qt Quick      (partial)

Also, distinguish between "module" and "library"

Change-Id: Icb8aa695ae60b0e45920b0c8fce4dc763a12b0cd
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-01-25 17:27:44 +01:00
Gunnar Sletta
64134181db Introducing QWidget::createWindowContainer()
A QWidget that can embed a QWindow. This can be used
to embed a QWindow/QOpenGLContext based window or a
full QQuickView.

Change-Id: I8415b5ae38562fc00b46150fa70b56fd9b19a80c
Reviewed-by: Jørgen Lind <jorgen.lind@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-01-25 14:11:07 +01:00
Frederik Gladhorn
9a5ab30d52 Improve QAccessibleApplication
Add more testing.
This uncovers that currently the QDesktopScreenWidget
shows up as child of the app. Fixed by not creating
QAccessibleInterfaces for QDesktopScreenWidget.

Also don't crash in indexOfChild when called with 0.

Change-Id: I9fb1e47e8f1f33189e6125f56f274a7b94ecd0dd
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-01-25 11:58:23 +01:00
Pasi Petäjäjärvi
05b4000e01 Fixed checking HOME variable return value using isEmpty()
Return value of the QFile::decodeName(qgetenv("HOME")); is never null
if HOME environment variable is not set. So need to check the return
value using isEmpty() instead.

Task-number: QTBUG-28912
Change-Id: Ic57b1978d63e99b056cde35ca8cb9d2a07ff8ce8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-25 08:51:09 +01:00
Stephen Kelly
314e5ce5ee Add an umbrella cmake config file for Qt 5.
Change-Id: I96b6e96539a84a5919992afbaee757fa080b7ae0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-01-24 20:37:34 +01:00
Frederik Gladhorn
d0c360fd88 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-01-24 18:34:11 +01:00
Friedemann Kleint
9c6a91d07b Manual file dialog test: Add showModal().
Modal dialogs can now tested by just showing or running exec().
Remove connection of accept() from applySettings().

Change-Id: I5e3c0e6405ce5682f39d10a9c06b9d61be10ed3f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-24 16:28:16 +01:00
Frederik Gladhorn
627d9cbd3c Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/plugins/platforms/windows/qwindowsdialoghelpers.cpp

Change-Id: I4ca87d44129fa5c1d8541cd58b8d62bc69080688
2013-01-24 16:02:55 +01:00
Frederik Gladhorn
4730742f69 Stabilize tst_qabstractslider
When simulating hight load, this test failed 4 times out of 80 runs
on my machine.
With this patch I could no longer reproduce the failure.

Change-Id: I42748de0200b9094c8facf0e33f3794002ec1d01
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-24 15:16:19 +01:00
Tor Arne Vestbø
fed2d237b7 Extend lance-tests for text/statictext to check flipped/negative scale
Change-Id: I0504a6676f1acaa13ea1826e945d1faa51dd4e48
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: aavit <eirik.aavitsland@digia.com>
2013-01-24 13:45:01 +01:00
Roman Pasechnik
45be71bf7d Added initializer list constructors for Qt associative containers.
Affected: QSet, QMap, QMultiMap, QHash, QMultiHash.

Task-number: QTBUG-25679
Change-Id: I01f3ecfbca805f4c053a75232188bd2a77fdb1f2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-24 11:38:54 +01:00
Andreas Aardal Hanssen
6476d6728e Make sure QGraphicsItem notifies changes to focusScopeItem.
A glitch in QGraphicsItem's logic made it update the focusScopeItem
pointer, but fail to notify the change to QDeclarativeItem through the
d_ptr->focusScopeItemChange() virtual function, hindering
QDeclarativeItem from emitting focusChanged() correctly for focus
scopes that do not have focus.

Two lines were moved, and a comment updated to reflect the reason
why the "return" is needed at this point. It's clear that the
calls to focusScopeItemChange() are unrelated to the return.

Task-number: QTBUG-29260
Change-Id: I12ba9161b16d34c3689401a92c86d2047989f7bd
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Reviewed-by: Alan Alpert <aalpert@rim.com>
2013-01-24 02:20:34 +01:00
Frederik Gladhorn
7df08a8b63 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-01-23 22:12:54 +01:00
Peter Hartmann
ce35c0db0d QSslConfiguration: toggle on demand loading of root certs properly
make sure we keep track of when we can load root certs and when we
cannot (we cannot when the developer set the certs explicitly). This is
implemented the same way for QSslSocket already, and needs to be
duplicated because we have 2 methods for setting CA certificates: one in
QSslSocket and one in QSslConfiguration.
In addition, adapt the auto test which checks whether setting a default
QSslConfiguration works: There is no way to set on demand loading
through the API, so it should be enabled by default.

Task-number: QTBUG-29103
Change-Id: I5146128aaa385dfcc0ad1e0ef81a92d9350ec5f2
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-01-23 19:36:07 +01:00
Allan Sandfeld Jensen
06e4b1cff4 QImage plugins should report supported mime types
Introduces the methods QImageReader::supportedMimeTypes and
QImageWriter::supportedMimeTypes which corresponds to the similar
supportedImageFormats methods, except they return lists of MIME types.

Task-number: QTBUG-28177
Change-Id: Ibb0e264a12eaf972a8bfd6bd891dcd9f89efd085
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-23 17:19:22 +01:00
Mehdi Fekari
786a6466e8 Add autotests for Indonisian and Catalan locales
Change-Id: Idbf14ee6f0cd83acfdc407408794aac7ad91c054
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-23 13:01:34 +01:00
Friedemann Kleint
3df0a41a7f Fix qstring-literals test for MinGW.
The test is compiled since QT_UNICODE_LITERAL is always defined
on Windows and ref.isStatic()) then fails since C++ 11 is not
enabled.

Task-number: QTBUG-29014
Change-Id: I357574a493c5191f1463e7ee5851d7db0e569315
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-23 12:41:35 +01:00
Gunnar Sletta
2692db542e Implement focus handling of child windows for cocoa.
Change-Id: I1e05ef39aa67f8febdd27215d8ad05d26ece7caa
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-01-23 12:41:35 +01:00
Frederik Gladhorn
586fabb3b5 Disable only accessibility bridge without dbus on linux
Keeping accessibility and only disabling the bridge will
enable more builds to work.

Warning about disabling accessibility disabled is needed
because in QStyle it is used to discover semantics about widgets
(if a toolbutton is in a toolbar).

Change-Id: Iae4e6ab63479743bdd70cba4b1954ec7cf3f88e9
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-01-23 10:56:34 +01:00
Pasi Petäjäjärvi
416e73a0fc Check existence of QProcess feature before using it on Qt autotests.
VxWorks does not have QProcess support.

Change-Id: I20ed479125097d468a1aa50afb18c3749f0fbb98
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-01-23 10:38:59 +01:00
Thiago Macieira
3c6bb0ed8b Make the QtDBus object tree keep a count of active children
The new member variable activeChildren shall contain the number of
direct children that are active. This number differs from
children.count() because the vector may contain empty entries that
haven't been garbage-collected yet (obj == NULL and activeChildren ==
0).

When this count drops to zero, we know we can simply erase the vector of
children.

Change-Id: Ia20604d3fac852ea4a6e8862d934fbb936fa5e18
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-01-23 07:54:00 +01:00
Frederik Gladhorn
c608ec8254 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/corelib/io/qsavefile_p.h
	src/corelib/tools/qregularexpression.cpp
	src/gui/util/qvalidator.cpp
	src/gui/util/qvalidator.h

Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
2013-01-22 18:40:13 +01:00
Thiago Macieira
f7eff72517 Add a new Q_GLOBAL_STATIC implementation
Unlike the previous implementation, this implementation is locked:
only one initialisation is ever run at the same time. It is
exception-safe, meaning that a throwing constructor will restart the
process.

Also, start using the thread-safe behaviour that GCC has offered for a
long time and C++11 requires.

Change-Id: I20db44f57d258923df64c0051358fd0d9a5ccd51
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: David Faure (KDE) <faure@kde.org>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-22 17:15:58 +01:00
Friedemann Kleint
326a5e0bca Fix testlib-selftest for MinGW.
Fix float format and exclude crashing sub-binary.

Task-number: QTBUG-29014
Change-Id: I404f971edeb128263122a194f23e2806d6fd3bd0
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-01-22 17:15:58 +01:00
Tor Arne Vestbø
f5c6a5d06b Don't build lance as application bundle on Mac OS
Change-Id: I23732b4ec0dc45d9d3a2cc5f21dad2cb33af5830
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-22 14:56:47 +01:00
Frederik Gladhorn
15a3243556 Accessibility Linux: Make dbus registration async
Change-Id: I74043be04f4ee17089353304fdc007a7f22cdea0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-01-22 14:11:14 +01:00
David Faure
e01b163404 QTestLib: improve output when comparing lists fails.
Only QStringList was handled before, now any QList is handled.
A specialization for QStringList is still needed though, due to the way
template matching works.

Example with QList<int>. Before:
FAIL!  : tst_QTextCodec::threadSafety() Compared values are not the same
   Loc: [../tst_qtextcodec.cpp(2057)]

After:
FAIL!  : tst_QTextCodec::threadSafety() Compared lists differ at index 0.
   Actual   (res2.toList()): '0'
   Expected (mibList): '3'
   Loc: [../tst_qtextcodec.cpp(2057)]

Change-Id: If0fdec3236ddb78a679ee549aba569ef5571c395
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-01-22 13:29:33 +01:00
Friedemann Kleint
c73dc44606 Fix cleanup of temporary files in test of QFileInfo.
Change-Id: I0d21fc05a7d816acab5f7284f905bf971a5c04da
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-01-22 13:29:25 +01:00
Friedemann Kleint
267e2bbee4 MinGW: Disable tests in tst_qstring that use unsupported formats.
Task-number: QTBUG-29014

Change-Id: I7dc879c456da8dabe02a2bce07e8628d176ca9d1
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-01-22 13:29:14 +01:00
Jan Arve Saether
e17dddfd3b Make hierarchy of actions in menubars more consistent.
There is an assumption that the interface returned from iface->parent()
would have iface as one of its children (thus,
parent->indexOfChild(iface)
should always return an integer != -1, indicating that it is a child.

This is a good assumption, otherwise an hierarchy would be presented
differently depending on how it is traversed.

However, a QMenu created like this:
QMenu *menu = new QMenu("weird parent", mainWindow);
mainWindow->menuBar()->addMenu(menu);

will have a different ancestor sequence than a menu created like this:

mainWindow->menuBar()->addMenu("ok parent");

This is because it will walk up the QObject hierarchy.

This patch tries to deal with that by looking at which widgets the
action of the menu is associated with before determining which should
be the accessible parent.

Change-Id: I00dad8a94463f772d7b1f5d66fdb36b2e8d3aea2
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-01-21 18:57:27 +01:00
Jan Arve Saether
fb4aef9c70 Accessibility: Test for do not crash if the column count is 0
This tests the fix submitted in bb5e11b56d

Task-number: QTBUG-28611

Change-Id: I7b15aa6b46be3607bd7079294d8e7d18bd507d1c
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-01-21 15:28:28 +01:00
Friedemann Kleint
04773fe72e Reduce invocations of QFINDTESTDATA in tst_qfileinfo.
Introduce variables for the paths used in the test and
check in initTestCase().

Change-Id: Ie801266e30cd860e5bdf079c1182fe385f9598c7
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-01-21 12:15:01 +01:00
Friedemann Kleint
52e14e05fa Fix temporary file leak in tst_qfileinfo.
Change-Id: I0d679638d5a9564f612ae5e70717f164b74aefb0
Reviewed-by: David Faure (KDE) <faure@kde.org>
2013-01-21 12:14:53 +01:00
Gerhard Gappmeier
9bbebb9144 Add support for defining properties from member variables.
This associates properties with member variables and
avoids writing getter and setter methods manually.
The metaCall() method directly accesses the member variable,
so additional method calls can be avoided.
The metaCall() setter code also supports NOTIFY signals,
which means the according signal is emitted when the property
gets written.

Task-number: QTBUG-16852

Change-Id: I88a1f237ea53a1e9cf65fc9ef2e207718eb8b6c3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-01-19 17:36:55 +01:00
Peter Hartmann
5bc5be22e8 QNetworkReply auto test: also test uploading data via HTTPS
... and not only HTTP.

Change-Id: I1190e07fdacd9bdfb218c8932e0e5e2c0c6fc6ab
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-01-18 17:58:48 +01:00
Friedemann Kleint
aacf4d0263 Fix a crash when minimizing a QQuickWindow.
Send empty expose event and flush queue when minimizing.

Task-number: QTBUG-28439
Task-number: QTBUG-26424

Change-Id: I2e921a86660f946ced7af735cdf197fb666e2934
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-18 15:42:59 +01:00
Friedemann Kleint
ced523af7a Fix crashes in tst_qthreadpool on Windows.
Qt 4.8 shows frequent crashes in runMultiple apparently caused
by the QMutex construction in the free functions by different
threads. Use a common QMutex class member instead.

Change-Id: I851d4e2d3637a7b4f404ed843f5360c10caa21f5
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-18 14:16:52 +01:00
Sergio Ahumada
48e0c4df23 Update copyright year in Digia's license headers
Change-Id: Ic804938fc352291d011800d21e549c10acac66fb
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-18 09:07:35 +01:00
David Faure
00e0923e60 Output std error from qmake/make when the test fails.
This is intended to make it easier to understand what's happening when
this test is flaky during CI.

Change-Id: I13163c244cb99414d90b5f71c365a4ff2216bc83
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-17 17:39:29 +01:00
David Faure
ff8362d65e QSaveFile autotest: restore permissions using RAII
So that the QTemporaryDir can happen even on error.

Change-Id: I728d49eac8bd65e1919fd314a95387949e134de0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-17 17:39:22 +01:00
David Faure
2d5fe45379 QSaveFile: test the case of an existing, but readonly, target file.
Change-Id: I296d9c2598b8c72e2fd3e6ec80a615364b7eddeb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-17 17:39:16 +01:00
David Faure
e993df8771 Add class QSaveFile.
This QIODevice uses a temporary file for writing, so that in case of
write errors, the writing operation is canceled, without losing any
existing file. It also avoids having a partially-written file visible
by other processes, at the final destination.

Change-Id: I9482df45751cb890b1b6f1382ec2eea3eb980627
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-17 17:39:11 +01:00
Peter Hartmann
170bf2a59a QDateTime auto test: stabilize currentDateTimeUtc2 test
... by trying more often to get dates close enough to each other.

Change-Id: I370f7cd61bbb84fbb77ea96ff9fd82c1a6f1f76a
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-01-17 12:57:43 +01:00
Frederik Gladhorn
e3a10e15ff Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-01-16 23:51:11 +01:00
Friedemann Kleint
34572dadc6 Dialog testing tool: Control life cycle of non-modal file dialogs.
Keep the non-modal file dialog around and delete only on request,
such that one can simulate repeated invocations of show() on
the same dialog for testing native dialogs.

Change-Id: I80d0f1dfafbc02a31be192098121654a01025174
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2013-01-16 17:06:12 +01:00
Sergio Ahumada
eb87a0f409 tst_bic: Add linux-gcc-ia32 bic data for QtXml
Change-Id: I43670f41f41f465e5684362de64c355b68a1dbf7
Reviewed-by: Janne Anttila <janne.anttila@digia.com>
2013-01-16 08:25:28 +01:00
Frederik Gladhorn
7075e29199 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/widgets/styles/qstyleanimation.cpp

Change-Id: Iae570895be6544de80f9c1ec309d1a08c59daff8
2013-01-16 01:22:45 +01:00
Frederik Gladhorn
122ee7a367 Merge "Merge remote-tracking branch 'gerrit/release' into stable" into refs/staging/stable 2013-01-15 19:47:44 +01:00
Frederik Gladhorn
270a51b775 Merge remote-tracking branch 'gerrit/release' into stable
Change-Id: Ieb104d0e390218a063082c93bc9c7e412af2166d
2013-01-15 18:14:13 +01:00
Friedemann Kleint
d3dc0f2122 Fix renaming of files that differ only in case.
This currently fails on case-insensitive file
systems since the check for existence then triggered
and indicated "file already exists".

Check on the file id (inode or file id) whether
the target file is really a different file for a
case-changing rename.

Task-number: QTBUG-3570

Change-Id: I1b2d40850692e02142ee23d2c753428de00aedc6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-15 16:36:20 +01:00
Friedemann Kleint
bb5e11b56d Fix crash in tst_qaccessibility.
Release the table item below the table test instead of releasing
the text item twice.

Change-Id: I74d283d50a39b9a4570b73a8297ed3dbb2de2271
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-01-15 15:48:41 +01:00
David Faure
d147285d64 Add Q_COREAPP_STARTUP_FUNCTION macro.
This is necessary for initializing things in a library, which require
a QCoreApplication instance (unlike Q_CONSTRUCTOR_FUNCTION, which runs
before that). Example use cases: KCrash (segv handler), and KCheckAccelerators
(debugging tool triggered by magic key combination).

Change-Id: I5f4c4699dd4d21aea72b007989ba57467e86ed10
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-15 14:58:35 +01:00
Thiago Macieira
856f209fb6 Change all shmget calls to user-only memory
Drop the read and write permissions for group and other users in the
system.

Change-Id: I8fc753f09126651af3fb82df3049050f0b14e876
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-01-15 04:34:27 +01:00
David Faure
6b9545a980 QUrl: methods for converting QStringList <-> QList<QUrl>
This is a very common thing to do, e.g. in order to send urls via DBus.

Change-Id: I277902460ee1ad6780446e862e86b3c2eb8c5315
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-14 23:44:15 +01:00
David Faure
327b2ba3b7 Add class QDebugStateSaver for writing QDebug operators correctly
Had to move QTextStreamPrivate to a private header, to be able to use
its new internal Params struct from qdebug.cpp

Change-Id: If28e25f27bbd04b1825a5eb3e2ef83ecad72e7b2
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-14 23:44:15 +01:00
Ruslan Nigmatullin
d4adcfb8cc Added QMessageAuthenticationCode
QMessageAuthenticationCode is HMAC implementation based on
QCryptographicHash abilities. HMAC is often used in OAuth and similar
authentication protocols.

Change-Id: Ifc73947ad06c36a1b770315b7e89ba5c01c5e79e
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-14 23:44:15 +01:00
Orgad Shaneh
b6963f109a QMenu: Fix nested popup when keyboard shortcut is used
Task-number: QTBUG-20403

Change-Id: I2a5fe00dd16e9dc1ec0d742a8f48083fc2954996
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
2013-01-14 16:28:21 +01:00
Thiago Macieira
dc131e3a53 Make QDBusPendingReply behave like QDBusReply when dealing with errors
QDBusReply allows one to extract a QVariant and the type reply from an
error reply and getting a default-constructed value. This is useful when
a valid reply can never contain the default-constructed value (0, false,
empty strings, empty arrays, etc.), so it simplifies error checking.

More importantly, qdbusxml2cpp was changed a while ago from generating
QDBusReply to generating QDBusPendingReply, so we need to have the same
behavior.

Task-number: QTBUG-29046
Change-Id: Ia873b9fd4311c0d4e94f0ef623ba405c20bc0e8c
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-01-14 13:03:50 +01:00
Thiago Macieira
60fc88a09c Resolve some race conditions on tst_QSharedMemory
This test runs fine almost all of the time on systems with 1
processor, which were the norm when the test was written and are still
the way that the Qt Continuous Integration system works as of
today. But it falls flatly on multi-processor systems.

The root of the problem is that QSystemSemaphore recreates the
semaphore if it disappears underneath it. However, the recreation
process is not thread-safe at all: if two threads race to recreate it,
weird things might happen. strace on Linux shows that a thread got
stuck trying to acquire the semaphore:

  <... nanosleep resumed> NULL) = 0
  stat("/tmp/qipc_systemsem_market5c9f73af73334ffe350c60ec076e5744db0ecda3", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
  stat("/tmp/qipc_systemsem_market5c9f73af73334ffe350c60ec076e5744db0ecda3", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
  semget(0x51001388, 1, IPC_CREAT|IPC_EXCL|0600) = -1 EEXIST (File exists)
  semget(0x51001388, 1, IPC_CREAT|0600) = 114786308
  semop(114786308, {{0, -1, SEM_UNDO}}, 1 <unfinished ...>

This problem does not happen if the creation and destruction of the
QSharedMemory (which uses QSystemSemaphore) does not race with other
threads or processes attaching and detaching. For the threads test
it's easy. For the processes, we use stdin and stdout as a
communication channel.

Change-Id: Ie11b135431d4abfc59234654848b67f622eb03c9
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-01-14 11:35:17 +01:00
Giuseppe D'Angelo
9110d4f1ed QString::contains overload that returns the match results
This convenience overload allows one to write

    QRegularExpression re1, re2, ...;
    QRegularExpressionMatch match;
    QString subject;

    if (subject.contains(re1, &match)) {
        // ...
    } else if (subject.contains(re2, &match)) {
        // ...
    } // ..

One can then inspect the results of a successful match in each block
(as well as extracting the captured substrings, etc.).

Change-Id: I0fb8be8b577656e8db994198f8105c26c4fe67b0
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-14 10:26:59 +01:00
Giuseppe D'Angelo
65fba49d63 Introduce default ctors for QRegularExpressionMatch(Iterator)
This allows to put them in containers, and to enable subsequent
features for QString.

Change-Id: I3b3fe695ffe6930331ed9f670738376722e0fc36
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-14 10:25:39 +01:00
Sergio Ahumada
4bd4c811f2 tst_bic: Add bic data for QtConcurrent and QtPrintSupport
Task-number: QTQAINFRA-321
Change-Id: I2699a13c3d8a7df9b12049e0337501a4e24d2d64
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Janne Anttila <janne.anttila@digia.com>
2013-01-14 09:18:43 +01:00
José Millán Soto
08bc730b41 Implement QAccessibleActionInterface in QAccessibleTableCell
Implemented QAccessibleActionInterface in QAccessibleTableCell to allow
selecting and unselecting table cells, as there was no way of selecting
or deselecting a simple cell using accessible tools.

tst_qaccessibility.cpp was modified to test the new methods.

Change-Id: I7bdfe0b363a9813d4a7c62e96b6c924b163f2121
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-01-11 21:24:23 +01:00
Michael Brasser
f156e578d7 Ensure raster pixmap cache key is the same as that of pixmap.toImage()
This is done to support texture uploads in an image provider. It ensures
we can load the texture using QImage in the image provider, and when
it is later painted as a pixmap, the cacheKey will be identical
(assuming no format conversion was required).

Change-Id: I54229511ed91ce5430cc478af5aff0d96685a2da
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-11 21:24:23 +01:00
Shane Kearns
7e91b5a2bc Fix incorrectly disabled autotest
One of the IPv6 autotests was always disabled instead of being disabled
only when the system has no IPv6 support.

Change-Id: I34dffbeae6ba85a706bfeb0cc4750a4514b73a65
Reviewed-by: Peter Hartmann <phartmann@rim.com>
2013-01-11 14:01:10 +01:00
Jędrzej Nowacki
63c68cadec Enable tst_qwidgetsvariant test
The test for a magic reason was not build by default.

Change-Id: I21c7fc959d76d6faac0091495f965f3da6d415b1
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-01-11 12:02:21 +01:00
Mehdi Fekari
7ff47c7bfa Add an autotest for Canadian locale(dateFormat)
Change-Id: I68a91a418c418e113ecfe66769a7b3bc46de380c
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2013-01-10 15:52:55 +01:00
Stephen Kelly
ccbff3fce5 Clean up some metatype declarations and registrations
Change-Id: I0826f6502cc45279f29f248f5f28f4fc9e6c8b4e
Reviewed-by: David Faure <david.faure@kdab.com>
2013-01-09 18:19:12 +01:00
Sergio Ahumada
63f24f6ba8 Merge branch 'stable' into dev
Change-Id: I7f0dab6bdb1f3cc1d3e6c30166ff6db9dfae37e9
2013-01-09 11:49:47 +01:00
Sergio Ahumada
bbb9abf7fb tst_bic: Remove 'timex' class from linux-gcc-{amd64,ia32}
'timex' is not a Qt class, so there is no need to check it.

Change-Id: Ic77b3518e5a7eaf2c2bc7dcd98d1f9aebf4b655d
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2013-01-09 09:11:46 +01:00
Oliver Wolff
083d2c8bb8 Removed hardcoded values from tst_qgraphicsview::scrollBarRanges
Instead of testing the "windows" and "motif" styles, that test should
actually test the scrollBarRanges for all available styles. To be able
to do that, the magic numbers 16 (width/height of scrollbars) and 4
(spacing for the faux motif style) were replaced and instead of setting
the explicit values in the data the "number of scrollbars/spacings to
add/remove" is saved in a struct and the value of these (depending
on the style) is obtained in the test run.

This change does not also cause the fusion style to also be tested but
also fixes this test for Windows 7 and 8 (Aero) where the scrollbar
width/height is not 16 but 17.

Task-number: QTBUG-28611
Task-number: QTBUG-29002
Change-Id: I5d103018fde81cee6e6e89cd414426768b2dc8e7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-01-09 08:59:26 +01:00
Sergio Ahumada
d8a3bcc6c4 test: Add bic data for linux-gcc-ia32
Task-number: QTQAINFRA-321
Change-Id: I990f0c525fbd0b0b3818b0f7d86ed99438821baa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-08 19:50:18 +01:00
Friedemann Kleint
54fd35b134 Fix warnings about not being able to set Window geometry on Windows.
Fully decorated windows cannot be smaller than 160x30 (Large fonts).
Enlarge Windows or remove Window frame  to get rid of decorations.

Task-number: QTBUG-28611
Change-Id: Idb6ee94fb8d0760d5f97042b3084557f11e9fdf9
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-08 13:54:04 +01:00
Michael Brüning
41acb58f23 Add auto test for HTTP cache fix for QTBUG-28035.
Adds an auto test that verifies that the replies to POST and PUT
requests are not cached even though they contain a max-age header and
that subsequent GET requests are reloaded from the server.

Change-Id: I188ae1200cb5551e164722c0f479719be8d11bfb
Reviewed-by: Peter Hartmann <phartmann@rim.com>
2013-01-08 11:13:27 +01:00
Jędrzej Nowacki
ae2359d49e Merge "Merge branch 'stable' into dev" into refs/staging/dev 2013-01-07 18:07:29 +01:00
Giuseppe D'Angelo
998899cf3a Introduce QRegularExpression::NoMatch match type
This match type doesn't do any match at all; it's only necessary to
properly introduce default constructors for QRegularExpressionMatch
and QRegularExpressionMatchIterator (since they return the match type
that created them).

Change-Id: Ibfe92459c7fdd23129cf3afe073cd443c461ddeb
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-07 16:11:19 +01:00
Friedemann Kleint
bc5a2336ab Provide operators for QMargins.
Provide addition/subtraction for QMargins as well as
multiplication and division for int/qreal similar
to QPoint. Add unary minus.

Change-Id: If4eb831cfd610b34b5ca361619b1636031811d0a
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-01-07 16:11:19 +01:00
Friedemann Kleint
6ecc3e76e8 Add API dealing with QMargins to QRect.
- Addition of a QMargin to a QRect.
- Removal of a QMargin from a QRect.
- Remove implementation from Windows platform plugin.

Change-Id: Iae54bc13e94a7ece48853b1d3f3de2bfc154d2dd
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2013-01-07 16:11:19 +01:00
Giuseppe D'Angelo
41ec7c32ac Improve QRegularExpression autotests
Check that the regular expression, the match type and the match options
returned by QRegularExpression/QRegularExpressionIterator are the
same ones passed to match / globalMatch.

Change-Id: Ibd282379bb60b53d614b1d56a7e08b3d6c236da6
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2013-01-07 16:11:19 +01:00
Frederik Gladhorn
cdf13ce286 Merge branch 'stable' into dev
Conflicts:
	tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp

Change-Id: I6b8d505fc22f052c307ca27f58f7d16f98965f47
2013-01-07 15:18:16 +01:00
Stephen Kelly
21d607c81a Automatically register method types in QSignalSpy.
Change-Id: I3655291dca6dbd3d8d09ee835b85983caa911b64
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-07 12:06:00 +01:00
Giuseppe D'Angelo
2d8910cbed Introduce QRegularExpressionValidator
QRegularExpression counterpart for QRegExpValidator.

Change-Id: Ib391e73dd49e32aeb9b48e6f2217b67a17a83a11
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-07 12:04:53 +01:00
Sergio Ahumada
a8321f21fb Add bic data for tst_bic
- Add initial set of amd64 data
 - Add QtWidgets to global.cfg

Task-number: QTQAINFRA-321
Change-Id: I9bffaa00ac01976546629988ac69965383eb2efd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-01-06 19:16:02 +01:00
Mehdi Fekari
33f603c4a3 Update qlocale autotest
Add additional tests for the updates in the Qt4.8 qlocale data (CLDRv2.0) already existing in Qt5 locale data (CLDRv22.1):

- The NumberingSystem for some Indic and Slovak locales.
- The Month/Day name in Irish/Gaelic locale.
- The AM/PM Text in Turkish locale.

Change-Id: Iaea4f13ec79f94ab937b97f8ae60eb8d8f217c4b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-06 14:29:48 +01:00
Stephen Kelly
cf22e8ea4e Tests: Remove declaration of built-in and automatic metatypes.
These types are either built-in or 'automatically declared' and so
don't need to be explicitly declared as metatypes.

Change-Id: Ifd116dee32a450ff89a9a1011e26b434765d6e95
Reviewed-by: David Faure <david.faure@kdab.com>
2013-01-06 11:23:45 +01:00
Stephen Kelly
ba82958af9 Widgets: Remove declaration of built-in and automatic metatypes.
These types are either built-in or 'automatically declared' and so
don't need to be explicitly declared as metatypes.

Change-Id: Ibe8e2ec867afb4051a3c7eef806d9cd86945928b
Reviewed-by: David Faure <david.faure@kdab.com>
2013-01-04 18:44:31 +01:00
Stephen Kelly
cc69dff01b Gui: Remove declaration of built-in and automatic metatypes.
These types are either built-in or 'automatically declared' and so
don't need to be explicitly declared as metatypes.

Change-Id: I95b8b4b674e85b2b3c374931f6231d60f35be984
Reviewed-by: David Faure <david.faure@kdab.com>
2013-01-04 18:39:08 +01:00
Stephen Kelly
79f1afc23c Core: Remove declaration of built-in and automatic metatypes.
These types are either built-in or 'automatically declared' and so
don't need to be explicitly declared as metatypes.

Change-Id: I54523eb854619917123d8816d3cd6c3a1f5b4c55
Reviewed-by: David Faure <david.faure@kdab.com>
2013-01-04 18:39:05 +01:00
Thiago Macieira
a094bf5a89 Don't increase the reference count if dynamic_cast failed
If the dynamic_cast failed in QSharedPointer::dynamicCast or
qSharedPointerDynamicCast, we should avoid creating the QSharedPointer
that shares the weak and strong reference counts. In Qt 5, this does
not imply a leak since the original pointer is stored internally for
deletion. In Qt 4 it implies a leak under certain circumstances, which
this change fixes.

Task-number: QTBUG-28924
Change-Id: Id2de140de4cf676461e14b201ad250c53666b79d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-01-04 17:30:19 +01:00
Peter Hartmann
bf5e7fb265 SSL certificates: blacklist mis-issued Turktrust certificates
Those certificates have erroneously set the CA attribute to true,
meaning everybody in possesion of their keys can issue certificates on
their own.

Task-number: QTBUG-28937

Change-Id: Iff351e590ad3e6ab802e6fa1d65a9a9a9f7683de
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2013-01-04 15:19:17 +01:00
Jan Arve Saether
07e69c7896 Make textEditTest pass on Windows 8
We make it pass by relaxing the comparison of the characterRect....

Change-Id: I900e0601d9e1e568c12a3952cf42657743345013
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-01-04 13:20:06 +01:00
Jan Arve Saether
32f7db7686 Fix autotest of textEditTest to use currentFont() instead of font()
Change-Id: I5c9b2ad494a7daf9b07804f77c4692d49e774261
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-01-04 13:20:06 +01:00
Stephen Kelly
ad330f327e DBus: Remove declaration of built-in and automatic metatypes.
These types are either built-in or 'automatically declared' and so
don't need to be explicitly declared as metatypes.

In some cases, the type is required to be registered with the typedef
name, so those Q_DECLARE_METATYPE uses remain for now. In a future
patch we can also remove those and the typedefs themselves.

Change-Id: I5721955c86f566ae09024203954840f817bd3088
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-04 13:20:06 +01:00
Jon Severinsson
cf2a75e41b Fix QGuiApplication::keyboardModifiers() and QGuiApplication::mouseButtons()
Previous commit b2363a935c fixed keyboardModifiers() after QPA event
processing, but broke QTestLib, which expects spontaneous input events
sent to qApp->notify() to update keyboardModifiers() and mouseButtons().
The commit also did not fix mouseButtons() after QPA event processing,
and missed keyboardModifiers() after QPA Tablet event processing.

This commit fixes all these shortcommings in b2363a935c.

Includes test case by David Faure <faure@kde.org>

Task-Number: QTBUG-26887
Change-Id: I8518b06c4ce86ea7b35120e3353a45ea2a81d356
Reviewed-by: David Faure (KDE) <faure@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-04 13:20:06 +01:00
Frederik Gladhorn
ca2f44680c Merge branch 'stable' into dev
Conflicts:
	examples/widgets/painting/shared/shared.pri
	src/corelib/tools/qharfbuzz_p.h
	src/corelib/tools/qunicodetools.cpp
	src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp
	src/plugins/platforms/windows/qwindowsfontdatabase.cpp

Change-Id: Ibc9860abf570e5ce8b052fb88feb73ec35e64bd3
2013-01-04 11:12:05 +01:00
Jan Arve Saether
cf5264fd67 Cleanup verifyHierarchy. Remove dead code and add indexOfChild test
Change-Id: I4f423cf2f08b657329b7fb5e225e7b8b3f17e4af
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-01-03 20:18:06 +01:00
Stephen Kelly
ee7dbf97bb Benchmarks: Remove declaration of built-in and automatic metatypes.
These types are either built-in or 'automatically declared' and so
don't need to be explicitly declared as metatypes.

Change-Id: Iba4b7f8ff7a1c7974d144b955cbf064e43b36ec7
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-03 18:19:28 +01:00
Stephen Kelly
330ad41b7d Network: Remove declaration of built-in and automatic metatypes.
These types are either built-in or 'automatically declared' and so
don't need to be explicitly declared as metatypes.

Change-Id: Ifdce72af844901665c4ebab11507216ba5f00fc1
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-03 18:19:28 +01:00
Peter Kümmel
8e3d4f5e87 Don't read from deleted member variable
QNetworkProxy::setApplicationProxy deletes factory set by
QNetworkProxyFactory::setApplicationProxyFactory.

Change-Id: Iaafd62d1cdb2045d69c7359cacc513056216826c
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2013-01-03 18:19:28 +01:00
Eskil Abrahamsen Blomfeldt
248ccb2889 Fix possible crash in QTextDocument
With trailing spaces in some cases, we would not get the
"no justification at end of paragraph" special case, and continue
in the code, getting the unexpected case where line_length becomes
< 0 which would lead to memory corruption because we were writing
outside our buffers. I added an assert to catch this type of bug
earlier, and I added the trailing spaces to the test for the end
of the paragraph.

The test case added is one example which would crash.

Task-number: QTBUG-27354
Change-Id: Id720a6fa55dbc709ce04dd5321e55687bf960d75
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-03 16:15:37 +01:00
Stephen Kelly
4319f698c8 Remove metatype registration of built-in types.
As they are built-in, they are effectively registered at compile-time
already.

Change-Id: I7ae6ba16088eab5d19213fa7b07c2a7760988a86
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-03 16:15:37 +01:00
Sergio Ahumada
83188c6499 test: Change trolltech.com:443 to qt-project.org:443
trolltech.com seems to be shut down already

Change-Id: Ic90ce01aeb51b6f154b9bbf4762c365a398c9e3d
Reviewed-by: Simo Fält <simo.falt@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-01-03 11:32:17 +01:00
Thorbjørn Lund Martsum
28a21d98ef QAbstractItemView - allow deselect in single selection mode.
This patch allows single selection to be cleared with the normal
control modifier. This affects e.g QTreeView and QListView.

Task-number: QTBUG-8836
Change-Id: I7fd50b987acc3552b36657409568192763257536
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-01-02 16:09:14 +01:00
hjk
03a666760c Speed up and fix QByteArray::setNum()
Going through QLocale and QString is not really needed.

This also makes the result of the conversion of negative numbers
in bases other than 10 independent of the architecture and
implements the documented behavior of treating them as
unsigned types.

Change-Id: Ibc231dc5241deb5cbadd9796484a8b5f79c29410
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-12-30 10:44:44 +01:00
hjk
4eac2c4728 Add test for QByteArray::setNum
Change-Id: I66f3954433bf50fb23fdaeef804838d993e965b5
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-12-28 15:09:19 +01:00
Thiago Macieira
3adbcb58d5 Fix QMutex::tryLock with negative values
The Linux futex implementation had a Q_ASSERT for positive values, but
the documentation says that negative values should be interpreted as
infinite (equal to lock()).

Test that too.

Change-Id: I2f96a502d672732781e88e49797756ca9a809121
Reviewed-by: David Faure (KDE) <faure@kde.org>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-12-23 20:34:46 +01:00
Thiago Macieira
7ee9551b62 Add support for multiple arguments to QSharedPointer::create()
Requires C++11 rvalue references and variadic templates so we can
implement perfect forwarding.

Change-Id: I62e47d1ffd0c61e8386f9f246aa79031b7430b46
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-12-23 17:51:45 +01:00
David Faure
8b2728ec38 QUrl::fromUserInput: fix for urls without a host.
QUrl::fromUserInput("http://") was invalid, which doesn't make sense
since QUrl("http://") is valid. Same for "smb:" which is actually
even more a valid URL from a user's point of view.

Change-Id: I371ac393d61b49499edf5adbbc2a90b426fe9e5d
Reviewed-by: Marco Martin <mart@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-12-23 10:50:28 +01:00
Andy Shaw
69627730ea Fix QSqlQuery test in relation to PSQL support
Some things needed to be corrected for testing with PSQL, this was
checked against the the PostgreSQL documentation to confirm that the
exepected behaviour is correct.

Change-Id: I45a6b343e9eb920fcae2a62910ecc956abcac0f0
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-12-22 14:43:28 +01:00
Thiago Macieira
e1a1e80d46 Make sure that the strict parser is also operating on setXxx
These cases weren't handled before.

The validateComponent function is copied from QUrlPrivate::parse, with
the added modification that it now needs to check the gen-delims for
the userinfo.

Change-Id: I055167b977199fa86b56a3a7259a7445585129c6
Reviewed-by: David Faure (KDE) <faure@kde.org>
2012-12-21 20:54:51 +01:00
Oswald Buddenhagen
586adeabe4 add and use qtHaveModule() function
this is much more elegant than the so far propagated !isEmpty(QT.foo.name).
also replace feature-specific tests (no-gui and no-widgets) and the
obsolete contains(QT_CONFIG, foo) syntax.

Change-Id: Ia4b3c8febcabf9eeca67b1f9173a523820b1038b
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Tasuku Suzuki <stasuku@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2012-12-21 19:05:02 +01:00
Sergio Ahumada
7706c31eaa Fix some typos
Change-Id: I4e8d9bd8ea66ec810e4f1fbfd8ddbf25c4b3d980
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2012-12-21 19:05:02 +01:00
Konstantin Ritt
9b0fab6b62 Update Qt internals to use QChar::Script
...and remove the outdated QUnicodeTables::Script enum.
QFontEngineData now has one extra slot that never used
(engines[QChar::Script_Inherited]). engines[QChar::Script_Unknown],
if accessed, would be set with a Box engine instance, and could be used
as a minor optimization some time later.

In order to preserve the existing behavior, we map all scripts up to Latin to Common.

Change-Id: Ide4182a0f8447b4bf25713ecc3fe8097b8fed040
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2012-12-21 19:01:35 +01:00
Friedemann Kleint
04a5a74685 Add a manual test for QFile.
Add a command line program allowing to test rename, copy, etc.

Task-number: QTBUG-28246

Change-Id: Ie9667f03b65a874475700ec9ecd91ca2ed32ed97
Reviewed-by: David Faure (KDE) <faure@kde.org>
2012-12-21 15:08:35 +01:00
J-P Nurmi
71fdc0d8a6 Tests: stabilize tst_QAbstractScrollArea::setScrollBars2()
Use QWidget::isVisibleTo(parent) instead of isVisible(), just like
QAbstractScrollArea::replaceScrollBar() does. This removes the need
of using QCoreApplication::processEvents() to deliver the actual
hide event just for testing if the scrollbar was requested to be
hidden as it should.

Change-Id: Ie9a816e7b871d280a4b3d9d76adb10601915bd56
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-12-20 21:16:53 +01:00
David Faure
92243bc346 tst_QDBusXmlParser: more reliable solution for setting the seed
As recommended by Giuseppe, don't rely on the env var, but use the
internal but exported seed atomic int. This way, the compiler will
detect breakages, rather than runtime.

Change-Id: Iec2bc88c53532d3463d2dc5c73631fc9bc34747b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-12-20 21:16:53 +01:00
aavit
a3a4114f53 Fixes: out of bounds memory access in QImage autotest
A pointer to the data of one qimage is used, with an offset, in a copy.
In the mono case, that could lead to overflow: the last row would
of the copy would stretch 1 byte beyond the end of the allocated
area. Fix by reducing the height of the copy, so that it keeps
within the allocated memory.

Task-number: QTBUG-28322

Change-Id: I09abfc83f738f8af000fc50f8c94f63dba3a6cfe
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2012-12-20 16:48:36 +01:00
Peter Hartmann
fbdea2c993 QUrl auto tests: make sure setAuthority is consistent with setHost
... with respect to empty and null strings.

Change-Id: Ic107d5bcc8b659497a567b75a7244caceba5a715
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-12-20 16:48:36 +01:00
Konstantin Ritt
f7639c0a6d Add QChar::Script enum
...where the values are not aliased to Common script.

The old QUnicodeTables::Script enum was retained for compatibility reasons
until Qt internals are updated to use QChar::script().
Using QChar::Script instead of QUnicodeTables::Script would improve both
the text analysis (itemization, boundary finding) and the text shaping quality.
This also a required step for switching to Hurfbuzz-NG.

/* This adds 6668 more .rodata bytes */

Change-Id: I5aa3d12c550528d0052542436990f8d0779ea8e5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2012-12-20 14:48:32 +01:00
Thiago Macieira
f2dbf6a819 Disable the JSC portion of the test unless we have a system PCRE
CONFIG += pcre is enabled if we're using the Qt PCRE, which isn't
compiled for 8-bit. If it isn't set, then we have a system PCRE.

Change-Id: I29d043b9d3f4d3223dcbb41eadc9f859e710eb88
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2012-12-20 03:32:48 +01:00
Peter Hartmann
cc79ed5c6a QUrl auto tests: ensure toEncoded() and toString() match wrt. empty auth
Task-number: QTBUG-8701

Change-Id: I55780a910a0d0996488475f5ce49a240f6223df0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-12-20 01:42:05 +01:00
Friedemann Kleint
a0584f678b tst_qaccessibility: Fix warnings about window geometry on Windows.
Make windows frameless so that size constraints for
decorated windows do not interfere.

Task-number: QTBUG-28696
Change-Id: Ic4410d8a6e8166bdfe013ed2362173f8e02d4b29
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2012-12-19 16:36:14 +01:00
Sergio Ahumada
5efcd5a6c3 Change ftp.qt.nokia.com -> ftp.qt-project.org
Task-number: QTBUG-28156
Change-Id: I0060144f0336791933205355b125251ccba73b3e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-12-18 23:13:35 +01:00
José Millán Soto
4b7be05058 Change behaviour of selectRow, selectColumn, unselectRow, unselectColumn
According to the comments of selectRow and selectColumn, the expected
behaviour of this method was to select a row or a column and unselect
any cell that were previously selected. However the actual behavior
was to select only one cell and not deselect any cell.

Moreover, according to the specification there's no simple way of
selecting multiple rows or columns as when one of the methods is
called for selecting one row or column the others should be
unselected.

The specification was changed not to require the rest of the cells
to be deselected, although they might be deselected if the
selectionMode requires that in order for the new row/column to be
selected.

The implementation of these methods was changed in QAccessibleTable
and QAccessibleTree to select the whole row/column and take into
acount selectionMode and selectionBehavior.

tst_qaccessibility.cpp was modified to test the new behaviour of
the methods.

Change-Id: I29635d014792169302435e81704e02c16f951238
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2012-12-18 14:06:23 +01:00
Friedemann Kleint
3e3451f429 QMdiArea: Increase minimum size for Windows 8/Large fonts.
Task-number: QTBUG-28611

Change-Id: I115a5fa6726ac99c2bbff4ec65d3f8856b2530df
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2012-12-18 12:50:58 +01:00
Friedemann Kleint
34e60228d4 Fix QStyle-test for Windows Aero / 8.
Increase tolerance  on Windows for the Aero style.

Set small top level widgets frameless to avoid warnings
about minimum size of decorated windows on Windows.

Task-number: QTBUG-28611
Change-Id: Ia4aec0cf0763da9955577054cb8cf81337fac134
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2012-12-18 10:53:57 +01:00
Friedemann Kleint
87dedd9b2d tst_qstyle: Fix compiler warning about unused variables.
Change-Id: Ida6a45be577cc1e21a2ba2b45f57b1e96c944fb2
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2012-12-17 22:24:45 +01:00
Friedemann Kleint
d5d79f3c7f Use frameless widgets in tst_qgridlayout.
Avoid failures caused by minimum window widths on Windows Areo/8.

Task-number: QTBUG-28611
Change-Id: I9affcce84ab804a45fa1a12fb93ad0136e6ae877
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2012-12-17 22:24:38 +01:00
Giuseppe D'Angelo
cc89509f83 Delete the QSlotObject when disconnect()ing
When disconnect()ing through a QMetaObject::Connection,  if the
QObjectPrivate::Connection contains a slot object, deref it, so
that it will be destroyed before the next run of cleanConnectionList.

Previously, a copy of the functor passed to connect() was kept until
QObjectPrivate::cleanConnectionLists was called (by adding a new signal,
or the sender was destroyed), even after a successful call to
disconnect(). That is, we were keeping that copy allocated without
any good reason.

Change-Id: Ie6074ea797df1611cb995dec07c5b5a742360833
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-12-17 19:50:33 +01:00
Giuseppe D'Angelo
c4f433d581 Reset the QMetaObject::Connection dptr when disconnect()ing
The QObjectPrivate::Connection refcount was not decreased
when disconnect()ing, therefore it was kept alive by the
owning QMetaObject::Connection object.

This removes a leak in case the QMetaObject::Connection
survives the sender object, after a successful disconnect().

Change-Id: Ie2ea59b269a0e589ae23c1457df7533be77c0797
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-12-17 19:50:31 +01:00
Giuseppe D'Angelo
058c029b1e Remove useless QVERIFY(true)
More QVERIFY()s were added in the meanwhile to the test function,
so we can drop this one.

Change-Id: If6f137f45ba606b61d6a7004556a667ed316b61f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-12-17 19:50:27 +01:00
Andreas Aardal Hanssen
533105cadf Deactivating an inactive panel no longer causes unwanted deactivation.
QGraphicsItem::setActive() is by design not guarded against calls that
do not change the current activation state of the item (e.g., calling
setActive(true) on an active item or calling setActive(false) on an
inactive item). This is to ensure that it's possible to set explicit
activation state on items, either before they are added to a scene, or
while the scene itself is inactive.

Before this fix, calling setActive(false) on a panel item that is not
currently active would by accident clear activation from any other
panel that might have focus. After this fix, activation is only cleared
if the item setActive() was called on itself is the active panel, or
is the panel that will regain activation once the scene is reactivated.

Task-number: QTBUG-28544
Change-Id: Ic4752f1e4400f9a0660bc968834747610212bb52
Reviewed-by: Bjørn Erik Nilsen <post@bjoernen.com>
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
2012-12-17 19:37:34 +01:00
Andreas Aardal Hanssen
af8a6cdd87 Add new signal: QGraphicsScene::focusItemChanged().
This signal is emitted by QGraphicsScene whenever focus changes in the
scene (i.e., when an item gains or loses input focus, or when focus
passes from one item to another). You can connect to this signal if you
need to keep track of when other items gain input focus. It is
particularily useful for implementing virtual keyboards, input methods,
and cursor items.

Task-number: QTBUG-10570
Change-Id: I9cbbd9a2d15d6f568e1597c2c33ec049eb70f793
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
2012-12-17 19:37:16 +01:00
Oswald Buddenhagen
2ac3f92296 clean up example project files, mostly wrt QT+=widgets
move QT+=widgets (and printsupport) statements before the install
statements, and de-duplicate some cases.
also move some TARGET assignments to a more conventional place.

Change-Id: I6140d8611680f66c24490e5894e4eb90cae95635
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-12-17 14:08:17 +01:00
Oswald Buddenhagen
599a58170d remove obsolete DEPENDPATH assignments
qmake now add CONFIG+=depend_includepath by default, making manual
DEPENDPATH setup unnecessary.

Change-Id: Ie57cf05c369e21b5b9e099b6ce9be4f75da1508f
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-12-17 14:08:17 +01:00
Oswald Buddenhagen
09331062bb remove some unnecessary CONFIG additions
qt is already added by spec_pre.prf, warn_on and depend_includepath by
default_pre.prf.

Change-Id: Ic00e0ba496d698ed9659c476f2ca99fc0f86a093
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-12-17 14:08:17 +01:00
Peter Kümmel
a42ad77ec9 Fix possible crash in tst_QThread::quitLock() test
Don't read member variable of deleted Job object.

Change-Id: I71a6565c4932427e9cbab744c2e472b62ea98ca2
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-12-17 14:08:17 +01:00
Morten Johan Sørvig
8fa464ffa6 Compile.
Update painting code with retina support.

Change-Id: Iebdfaaaaf98ed69f4ecb3cef5ca96b4e4ddb09dd
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2012-12-17 11:57:02 +01:00
Andreas Aardal Hanssen
ed15e4eb07 Fix focusproxy-relayed crash in QGraphicsItem destructor.
Makes tst_qgraphicsitem::tst_focusProxyDeletion not crash.

valgrind reported the error when running tst_qgraphicsitem. The crash
was very real; when deleting an item that has another item as a focus
proxy, the proxy still had a reference to the deleted item's focusProxy
pointer. I'm not a huge fan of whitebox testing but thought this crash
justifies a modification of the test to make it fail, instead of just
passing silently with a warning only given by valgrind and friends.

FTR the reason the test doesn't crash hard is that the memory is freed
but not reused within the scope of the test. So the access to the
pointer d_ptr->focusProxy succeeds, it just accesses memory that might
as well have been reclaimed. But this is quite undefined...

Task-number: QTBUG-28321
Change-Id: I2624631f5e5c2a8aa8bd4efe1fc128eba6c61f56
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2012-12-17 11:57:02 +01:00
Andreas Aardal Hanssen
d6f2d8dcb6 Make sure panels always gain focus when activated or tab is pressed.
This changes behavior, but I would argue it's a good change. If you
create a panel and activate it (e.g., by simply showing it or reparenting
it onto an already-visible item), you expect the panel to gain focus /
which is sort of the whole point of activating it. Prior to this change,
you had to have explicitly called setFocus() on one of the panel's
children, which would give that item subfocus, for that item to auto-
gain focus when the panel was activated. This change makes it more
automatic. If the panel itself or any of the widgets in its focus chain
can gain focus, they will gain focus when the panel is activated.

So the new logic is - if the panel already has a focus item, so if
someone explicitly set subfocus on an item before the panel is shown,
that item gets focus. Otherwise, if the panel itself can gain focus
(e.g., someone makes a line edit / text edit panel), it gains focus
when activated. Otherwise, we search the focus chain until we find
the first item that can gain focus. This last case is the file dialog
case, where the dialog itself can't gain focus but typically the
first item in the focus chain is the primary focus widget, such as
the search field or the directory list view.

The change also fixes this for the first Tab. If you clear focus on
a panel, the user expects to be able to press Tab to regain focus.
Prior to this change that didn't happen. Now, the panel or the first
in the focus chain that can get focus gets focus on first tab.

Task-number: QTBUG-28194
Change-Id: Id7ec1741d0d5eb4ea845469909c8d684e14017f1
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2012-12-17 08:58:04 +01:00
José Millán Soto
6e713cf03d Call QAccessible::updateAccessibility when caret moves in QTextEdit
Change-Id: I3b9e5d8e67b4928558b642a4d23aa60ae9dfde60
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2012-12-16 14:49:05 +01:00
Liang Qi
139f416237 Remove the timestamp info in genarated files
For moc, rcc and uic, then it's friendly for tools like ccache.
ccache is using md5 to check file modification, but the different
timestamp info will cause different md5 for same meaningful
contents, it will disabled ccache.

Updated the autotest for uic and rcc.

Task-number: QTBUG-26589
Change-Id: I9f1dcf6cd826ad9603af6e183757bcd748c32bd1
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-12-15 11:32:38 +01:00
Samuel Rødal
52619ae778 Fixed invalid memory read in SSSE3 image blending code.
We need to do bounds comparison on the actual offset we're going to use
with _mm_load_si128 to read 16 bytes from memory (even though we won't
use the trailing bytes in the end).

Task-number: QTBUG-28324
Change-Id: Id0d6094da796ca67338d8ad225fa6b2f309bbe6e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-12-14 17:12:44 +01:00
Kai Koehne
d6717eb0fb SQL: Fix autotests for MinGW
Change-Id: Ib05a120db16f65d9833663445c028971d4de3d29
Reviewed-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-12-14 17:12:44 +01:00
Friedemann Kleint
0e4c41b7a3 Remove MSVC2012-optimization for the QMetaType-test.
As otherwise compilation takes hours.

Task-number: QTBUG-28611
Change-Id: I0ad73bf6ea4d7d4594e902c101bf52969daca341
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2012-12-14 15:06:22 +01:00
Jonathan Liu
9f88e9a0a8 Add missing uuid lib for qaccessibility test
IID_IAccessible requires linking with the uuid lib.

Change-Id: Ic34d5c9bdb6168df7d2447c8aebf1bc519e5f7cd
Reviewed-by: Janne Anttila <janne.anttila@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2012-12-14 13:06:53 +01:00
David Faure
aa434bc908 tst_QDBusXmlParser: make XML attribute order deterministic
Avoid QHash randomization so that the order of the XML attributes is stable
This was causing intermittent failures.

Change-Id: I4cc0dba4b0c2ec36601f3b06fb17ff80005cc9fb
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2012-12-14 11:02:47 +01:00
David Faure
92bd9aecfb Fix empty window title regression, add application display name to window title
This increases consistency a lot: all windows and dialogs from a Qt
application will show the app display name in the caption, on Windows and X11.
This helps identifying which app a dialog belongs to, which is especially
useful when the dialog is very generic and shows up unexpectedly.

For compatibility reasons, the app name is added to the caption only
if setApplicationDisplayName() was called -- or if the caption would be
completely empty. The standard Qt4 case (setWindowTitle + no display name)
is unchanged.

Change-Id: Ib284c62c1f4c0bc923e5bc2d10247d95e9aa76c1
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-12-14 08:56:02 +01:00
Eskil Abrahamsen Blomfeldt
02032fb229 Mark QAbstractTextDocumentLayout test as insignificant
This test fails on some setups and a pending critical change
causes the existing bug to trigger in CI. To avoid blocking
other changes because of this bug, it's been marked as
insignificant until such a time when it can be fixed.

Change-Id: Ide41f7b1c76209f9c05f95f996b2364d5dea5e67
Reviewed-by: Liang Qi <liang.qi@digia.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2012-12-14 06:37:41 +01:00
Denis Dzyubenko
6b5b5d4e53 Added missing detach() to QJsonObject::take()
We also need to detach() the taken value in case the compaction triggers and
modifies the underlaying data.

Change-Id: Idcdeba4236b8e208d107d41be2decbdfc5721300
Reviewed-by: Bjørn Erik Nilsen <post@bjoernen.com>
Reviewed-by: Denis Dzyubenko <denis@ddenis.info>
2012-12-13 23:58:51 +01:00
Eskil Abrahamsen Blomfeldt
04f25ac46c Mark QGlyphRun and QStaticText tests as insignificant on Linux
These tests have been failing on certain setups for a while,
but some new critical changes causes the failure to trigger
on the CI system as well. We mark them as insignificant until
they can be fixed.

Change-Id: I467e7030c55d6f23515275b4062c17068d2b688c
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2012-12-13 20:19:00 +01:00
Marc Mutz
6f08748ec8 tst_QDialogButtonBox: fix typos
Change-Id: Iaf1b0ec47894cce7c5be702b2fad3106249cffd2
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2012-12-13 10:19:20 +01:00
Friedemann Kleint
bf178c77dd QMenu: Do not set snapToMouse if a caused-widget exists.
When clicking at the bottom-right corner of a menu in a menu
bar, it appears at the wrong position. Add test and stabilize
RTL-tests by making sure the layout direction is cleared should
they fail.

Task-number: QTBUG-28031
Task-number: QTBUG-2596
Change-Id: Ibc5ae916388753908e9f3ee98e8859faaa0c8723
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-12-12 21:55:30 +01:00
Frederik Gladhorn
22c234a34e Accessible: Improve value interface
The stepSize property was missing in Qt 4 and is
a sensible addition to the value interface.

Change-Id: I7571800d50ee7e4194c09c4db40300809a1ce45a
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2012-12-12 15:30:53 +01:00
Friedemann Kleint
303ff1bb12 test: Skip tst_QMdiArea::nativeSubWindows() on Windows/ANGLE.
Task-number: QTBUG-28545

Change-Id: Ifa698b9efe38654c8f8fbcc184db5d176df7ba47
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2012-12-12 10:57:08 +01:00
Thorbjørn Lund Martsum
9cf56b3e09 QGraphicsView - fix rubberband to expand on wheel event
In SHA 51914375b6 the rubberband
selection was fixed, so it followed the scene-point on mousemove.

However wheelEvent could move the view - but avoid update of the
rubberband (that would not be updated until next mouse-move).

This patch fixes that (and generally improves rubberband behavior)
since QGraphicsViewPrivate::mouseMoveEventHandler is called by
replayLastMouseEvent, which is called from various places,
where we need to update the rubberband (e.g scrollContentsBy).

Change-Id: I1b78c27edaaecea797a2319086d7a11d437d2bd3
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-12-11 13:37:57 +01:00
Oswald Buddenhagen
e0d72efbe7 remove bizarre jsc source reference
it compiles just fine without it.
if this was meant to inject a newer version of JSC than what is in
QtScript, it can be redone without creating a bizarre hybrid.

Change-Id: I61fe60bfa6a9bdb6423e8a7135250e332a5835ec
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-12-11 13:37:57 +01:00
Oswald Buddenhagen
6694d39131 centralize headersclean test
so other modules can actually re-use the code without referencing qtbase
sources.

Change-Id: Id66f07b476e539273dd32455e7642a17d7e5d0ef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-12-11 13:37:57 +01:00
Oswald Buddenhagen
6dd9cc8aa8 don't use testlib for headersclean test
this is a compile-only test, and it's not even marked as a testcase in
the autotest system.

Change-Id: I9b48ddad3c8e3e953d0e6fcfa010bab73289bc6f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-12-11 13:37:57 +01:00
Marc Mutz
98b77f9faa QMetaType: remember whether a type was registered with Q_DECLARE_METATYPE
There are two ways to register a type: using Q_DECLARE_METATYPE(T) and
using qRegisterMetaType<T>("T"). Doing one thing in one translation
unit and another thing in another TU constitutes an ODR violation,
because the value of QMetaTypeId<T>::Defined will differ in the two
TUs.

By adding the information whether a type was declared with
Q_DECLARE_METATYPE to the typeFlags(), such a use will trigger
the existing binary-incompatibility failure that checks for
equality of the incoming type flags with the stored ones (if any).

I had to encode the type as a defaulted function argument in order
to avoid the linker merging instantiations of the function templates
and therefore rendering the detection moot.

Change-Id: I82017caf300458b411cc8ac2f6653536fac64117
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-12-11 11:12:08 +01:00
Sergio Ahumada
8c2a51b586 test: Remove CONFIG += testcase from manual tests
Manual tests are not supposed to be run by "make check"

Change-Id: I0539b94f5286e89ddad2edf487d4b0d82fc2f374
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Simo Fält <simo.falt@digia.com>
2012-12-11 10:37:59 +01:00
Kevin Ottens
5b3e7c8dfa Generate the introspection string during parsing
Commit 0696071316 moved away from QDom but
also lost the ability to fill the introspection field of the created
QDBusIntrospection::Interface instances. This commit now generate the
string again as we proceed with the QXmlStreamReader based parsing.

Task-number: QTBUG-26668
Change-Id: I8f406e1f4e9d3e667a8557db69da36cac369ba4f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-12-11 07:41:49 +01:00
Caroline Chao
a5bca21096 SQL: Change in QSqlResultPrivate::positionalToNamedBinding()
With the change cff46983a, prepared queries can now store a
named paramater to be used more than once.

When using ?, thus positional binding, there is no named
parameter, thus there is no need to store it.

When prepare is called from a query with ?, it currently
causes an error when the feature QSqlDriver::NamedPlaceholders
is true. Because holders values are called while holders is
actually empty.

QSqlDriver::NamedPlaceholders is true for QOCI plugin only
but the problem is independant of the plugin used.

Adding a test case with a test driver to make the test runnable
without Oracle installed.

Change-Id: I6d7491f7e09a7b62d2d4d216b40fedd67e927e27
Reviewed-by: Matt Newell <newellm@blur.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-12-10 21:23:35 +01:00
Stephen Kelly
5809485dbe Move a Q_DECLARE_METATYPE higher up in the file.
Having it low in the file causes ODR violations.

Change-Id: I6267c7c1b043e77b251a88cb8940a9f063160891
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-12-10 20:22:09 +01:00
Andreas Aardal Hanssen
4a9c3b2433 Repair QGraphicsWidget focus chain when used with ItemIsPanel.
Add handling of the focus chain to QGraphicsItem::setFlags(), so that
the focus chain is repaired (panels pop out of the chain and non-panels
merge back in) when the ItemIsPanel flag is toggled. Add handling focus
chain to QGraphicsWidgetPrivate::fixFocusChainBeforeReparenting for
panels.

Before this fix, you must enable the ItemIsPanel flag before adding
the item as a child to a parent panel, and you lose focus when using
the tab key to focus around a panel after it has been reparented into
another panel.

Task-number: QTBUG-28187
Change-Id: I1d0d81a90697eaf715a8a337c8bf6c2159329e68
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-12-07 09:11:59 +01:00
Samuel Rødal
7da7bbcd87 Removed requestOrientation() API from QWindow.
There are no proper implementations of this API, and as it stands it
only acts to confuse anyone who stumbles across it. It will be better to
revisit the full cross platform orientation API story for 5.1.

Change-Id: Iff7054a32c6e5e4ad0cc0493a5e4ecc35a6ec4f3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2012-12-06 20:37:13 +01:00
Peter Kümmel
24013d8a87 Don't pass invalid strings to strcmp()
The address behind a string doesn't point to a string.

Change-Id: Ic54f652ae781fea278f60cc49d219c1c610ba29f
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2012-12-06 16:45:52 +01:00
David Faure
418890e074 QPluginLoader: fix loading of plugins with a relative file name
This makes QT_PLUGIN_PATH / QCoreApplication::libraryPaths() actually work,
as a search path for plugins, when apps look for a specific plugin by name.

To make it possible to write portable code (unlike the current QPluginLoader
unittest), let QPluginLoader figure out the extension, too.

Change-Id: I895d597d7cb05ded268734bc5f313f32d8d12cb9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-12-04 18:38:41 +01:00
Stephen Kelly
348c5bd19a Fix some typos in QProcess and QSslSocket unit tests.
The QSslSocket one is both wrong and redundant as there is a
Q_DECLARE_METATYPE for it already.

Change-Id: I63d065abfb3d0e3d82a8b1f29a6752b7676db847
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2012-12-04 14:41:43 +01:00
Oswald Buddenhagen
4873c4151e remove pointless QT.<module>.sources references
there is no point to use this for in-module references.
cleaning it out in an attempt to purge the constants entirely.

Change-Id: I1da4d70e3778257dd43eda0bdfc71eaec1124732
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-12-04 13:58:29 +01:00
Oswald Buddenhagen
c343795b48 remove pointless zlib includes
Change-Id: I352f6f9626c012c39ac97163ac83b3e24a9e9c7a
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-12-04 13:58:03 +01:00
Oswald Buddenhagen
5ea41a2efa properly syncqt-ize harfbuzz headers
we were already installing them into QtCore/private, so turn them into
proper private headers to start with. this cleans up our project files.

Change-Id: I0795f79e03b60b5854de9e4dc339e9b5a5e6fd87
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-12-04 13:57:55 +01:00
Oswald Buddenhagen
9c4b3dfcaf qregexp benchmark needs exceptions
Change-Id: I3833345a09e49899c256b4410783b6a08111c4a0
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-12-04 13:57:41 +01:00
Andrew den Exter
ab97a44b6a Clear focus of GraphicsItem focus scopes and their children.
A focus scope has effective focus if one of its children is the focus item,
clearFocus() should remove effective focus from an item and its children
not just from the focus item.

Task-number: QTBUG-28328
Change-Id: I62a292eff000151e50b2f5221e22f326a380fc3a
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
2012-12-04 01:50:02 +01:00
Friedemann Kleint
1b908e13e6 Compile windowflags/windowgeometry manual tests against 4.8.
Change-Id: I3611fe752168729f3605e0f451d487ca3e10d09d
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
2012-12-03 12:00:18 +01:00
Sergio Ahumada
0df026de86 Stop using the name "Trolltech" in QSettings
Also change Trolltech for QtProject in other places

Task-number: QTBUG-23269
Change-Id: Ie4e344f23cab77c575562d18b481b3369ce30491
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-12-03 03:47:08 +01:00
Marc Mutz
716d33d2a7 [QTBUG-27420] Make Q{Box,Grid,Form}Layout::takeAt() unparent a nested layout
QStackedLayout doesn't have support for QLayout, only QWidget, so
the issue doesn't arise there.

Reported-by: Johannes Schaub
Task-number: QTBUG-27420

Change-Id: I71f8d10a036918c16d8f8c9197a2ec61cd76cf01
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-12-02 00:23:14 +01:00
Peter Kümmel
1211b956de Fix wrong string length
Change-Id: Ic10aed6fc59d2518583caf78848711bdc97b4665
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-12-01 17:16:54 +01:00
Friedemann Kleint
43ee10518a Improve auto-test of QFile.
Execute the test in a temporary directory, purge remaining files
except the special readonly-files in cleanup().
Avoid repeated invocation of QFINDTESTDATA() by assigning to
member variables.
Do more checks in rename(), check on contents of file.
Generally, use more QVERIFY2, print error messages.

Task-number: QTBUG-3570
Change-Id: Ibd0e11a361208a716ea3efbcca76adeda70e061a
Reviewed-by: David Faure (KDE) <faure@kde.org>
2012-12-01 13:51:52 +01:00
Morten Johan Sørvig
5e61bbe586 Basic high-dpi "retina" support for Qt 5.
Bring Qt 5 on par with Qt 4, prepare for more comprehensive
support later on.

Introduce device independent pixels (dips), device pixels,
and devicePixelRatio. Add high-dpi support to QPainter,
QGLWidget, the cocoa platform plugin, mac and fusion styles.

Dips are similar to CSS pixels, Apple points and
Android density-independent pixels. Device pixels
are pixels in the backing store/physical pixels on screen.
devicePixelRatio is the ratio between them, which is
1.0 on standard displays and 2.0 on "retina" displays.

New API:
QImage::devicePixelRatio() and setDevicePixelRatio()
QPixmap::devicePixelRatio() and setDevicePixelRatio()
QWindow::devicePixelRatio()
QScreen::devicePixelRatio()
QGuiApplicaiton::devicePixelRatio()

Change-Id: If98c3ca9bfdf0e1bdbcf7574cd5b912c9ff63856
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2012-12-01 08:33:20 +01:00
Shawn Rutledge
c8dc41bacd QWidget windows have fullscreen button by default; manual test for it
It's again possible for QWindows and widget windows to go into
fullscreen mode on the Mac.

Change-Id: I7b304a135838394ef0392f89be4f225f2949fad3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-12-01 08:32:26 +01:00
Thorbjørn Lund Martsum
51914375b6 QGraphicsView - fix rubberband to stay right on scroll
We should consider the scene-position when we are expanding
moving a rubberband. If the user does some auto-scroll
(Qt should support that itself, but that is another matter)
then the rubberband should not keep the (old) local position
to calculate the rubberband extension, but instead use the
scene-position that was actually clicked.

Change-Id: I04a2df6a1edae8b3587e1ac2104c7fe4ccfb7762
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-12-01 08:28:43 +01:00
Samuel Rødal
6385a182f0 Added explicit threading API to QtOpenGL.
Since QtOpenGL/QGLContext is implemented in terms of
QtGui/QOpenGLContext which has stricter requirements about how it's
supposed to be used, we need to apply these requirements to QGLContext
as well.

This change adds QGLContext::moveToThread(QThread *) and documents it as
a necessity for making a context current on another thread.

Also introduces QGLPixelbuffer::context() to access the QGLContext of a
pixelbuffer, and made QGLWidget::context() return a non-const
QGLContext, since there's no good reason why it shouldn't, and it leads
to less const_cast clutter.

We could have introduced a backdoor in QOpenGLContext instead, making it
loosen its requirements, but that would have made it harder / impossible
to fully support threaded OpenGL in all the platforms.

Task-number: QTBUG-22560
Change-Id: Ibb6f65f342e7c963e80cc42ab5664c5f1cab30b0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2012-11-30 18:28:04 +01:00
Olivier Goffart
d8e6be1603 Fix connecting to a functor with 3 arguments
Task-number: QTBUG-28285

Change-Id: I07bd870c093482035728aa783d0ecbc8aa8670d2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-11-30 01:23:48 +01:00
J-P Nurmi
a0d379bc9a Style auto tests: kill QWindowsStyle dependencies
Change-Id: I135fe2b0aae81c73c1cca6272f71db07ecb3fa6b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-11-28 20:54:39 +01:00
J-P Nurmi
50a22d8418 tst_QLayout: use QStyleFactory instead of QWindowsStyle
QWindowsStyle is soon to become an internal class.

Change-Id: I25ac344d349d07db94e2fbc9ef943e09c399f913
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2012-11-28 13:13:51 +01:00
J-P Nurmi
f308c296c5 tst_QWidget: use QStyleFactory instead of QWindowsStyle
QWindowsStyle is soon to become an internal class.

Change-Id: I75424d6fc2f36fb0faace86c960d78a4ba305658
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2012-11-28 13:13:41 +01:00
J-P Nurmi
a3fe4c6337 GV auto tests: kill QWindowsStyle dependencies
Change-Id: I6236b7ca23897c5075bef21f5e62fe01f4cfc611
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-11-27 23:10:09 +01:00
Samuel Rødal
7a7102ad07 Fixed abbreviations in QWindow::framePos() and QWindow::setFramePos().
As 672e7c875e did changing pos() to
position() and setPos() to setPosition().

Luckily there's not much code that uses these.

Change-Id: I1e1982f00412a22bd376e667a5e8c30b6149f9b5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-11-27 15:24:31 +01:00
Andreas Aardal Hanssen
bfb569b6e7 Ensure subfocus is not reset to 0 when hiding a panel.
When hiding any widget that is not a panel, it is correct to clear
subfocus. In case clearFocus() has been called, the result is that
focusItem() / focusWidget() points to 0, which is correct. Upon
reactivation, nothing gains input focus. When changing focus, the
following setSubFocus() call will ensure subfocus points to the new
widget.

When hiding a panel, however, it's essential that subfocus within
that panel is not cleared, otherwise, when re-showing the panel,
nothing will have focus, whereas the expected behavior is that focus
is restored to the last item that had focus, i.e., the focusItem()
a.k.a. subfocus widget.

Task-number: QTBUG-22256
Change-Id: I84d849a505764e074e1369fef923cef1ad5c0b1e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-11-26 21:23:15 +01:00
hjk
c527dd44be Examples: Install to $$[QT_INSTALL_EXAMPLES]/$submodule/$example
This makes the structure of the examples after an 'make install'
similar to the one in a 'developer build'.

Change-Id: I9120bd741fab332e64e30adc01cefe87e5633454
Reviewed-by: Martin Smith <martin.smith@digia.com>
2012-11-26 14:35:23 +01:00
Konstantin Ritt
b34c48d95b qmake: Test recursive function calls
Change-Id: If7d659728d30b2e5c52082ab999bc00de3733972
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2012-11-26 14:30:09 +01:00
J-P Nurmi
12702d2b12 tst_QSharedPointer: update application types
QCoreApplication::Type enum was removed in 553e21. This change updates
the (un)tested application types to match the application types
available in Qt 5.

Change-Id: I8631987a9ff31dc81baa013619cfc18616b851d1
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-11-26 14:16:44 +01:00
J-P Nurmi
8e7135c894 tst_QGridLayout: use QProxyStyle instead of QWindowsStyle
QWindowsStyle is soon to become an internal class.

Change-Id: If163aae6910c0b082a9bcca1ebbab66660cc005f
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-11-26 14:16:44 +01:00
J-P Nurmi
7caaab5262 tst_QFormLayout: use QProxyStyle instead of QWindowsStyle
QWindowsStyle is soon to become an internal class.

Change-Id: Ie28d4ea074938b17827aa803a2298f881946f7e5
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-11-26 14:16:44 +01:00
J-P Nurmi
f1a743c165 tst_QBoxLayout: use QProxyStyle instead of QWindowsStyle
QWindowsStyle is soon to become an internal class.

Change-Id: I287c771a841ba96e445f0a0df96ea035be25ac74
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-11-26 14:16:44 +01:00
J-P Nurmi
f61a335589 tst_QMenuBar: use QProxyStyle instead of QWindowsStyle
QWindowsStyle is soon to become an internal class.

Change-Id: I422e7d67fadbb169d19285aab0a8ba0f3d668697
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-11-26 14:16:44 +01:00
J-P Nurmi
5ad4e14fb1 tst_QComboBox: use QProxyStyle instead of QWindowsStyle
QWindowsStyle is soon to become an internal class.

Change-Id: Ic76ecc20ff600a7d401b44c8dc4d93198c06becc
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-11-26 14:16:44 +01:00
Friedemann Kleint
eefec0e0be Fix keyboard grab in QWidgetWindow.
Task-number: QTBUG-28070
Change-Id: I6f55a2dd906ee896071137a5d47fb97c9a571b5f
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
2012-11-26 11:00:07 +01:00
Thorbjørn Lund Martsum
8d4544f00d QHeaderView: - avoid cursor move on setDefaultSectionSize
If we are reacting on the sectionResized signal and we call
setDefaultSectionSize we should ensure that we are not moving
the mouse-cursor.

This is an improvement of f8f6acb05c

Change-Id: I1adee7821bc8fcc9633f692bfd515f2c458b12c8
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-11-25 08:29:39 +01:00
Konstantin Ritt
9b85b81bc8 QLocale: Fix matchingLocales() behavior if script or country is not Any*
Since the documentation doesn't mention the search should be done by language only,
consider the current behavior incorrect.
As of now, it is possible to get a list of locales by Country or Script as well.

Also fix countriesForLanguage() to be in-sync with matchingLocales().

Change-Id: I6a09ca459120143565fa6099d2b823df1fed7c25
Reviewed-by: Denis Dzyubenko <denis@ddenis.info>
2012-11-25 04:06:51 +01:00
Jędrzej Nowacki
cf1e315e28 Fix QVariant streaming in Qt3 compatibility mode.
Task-number: QTBUG-27700
Change-Id: I0408293e43c3330dbc4746198a19709e795f552a
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-11-24 14:55:30 +01:00
J-P Nurmi
0bfc5b898d tst_QDateTimeEdit: remove redundant include
Change-Id: I3aeb90723b41b35e221b86b1767ed1ac45a9fe0c
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-11-24 10:34:02 +01:00
J-P Nurmi
9b431d1253 tst_QToolButton: remove redundant include
Change-Id: Ie55a530a89b85a4f3369ee3205221fb01fa1773e
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-11-24 10:33:54 +01:00
Konstantin Ritt
3c0ac52081 QLocale: Fix toCurrencyString() didn't respect group separator option
Change-Id: Icda43d71d600d77fe1ed4fcde1ef4478ef29c1d5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Denis Dzyubenko <denis@ddenis.info>
2012-11-23 22:58:59 +01:00
J-P Nurmi
86bbe5a43a Cleanup tst_QApplication
Remove redundant includes, remove references to deprecated
QApplication::GuiServer (passing that has no effect anymore), and use
QStyleFactory instead of referencing QWindowStyle directly (about to
become an internal class).

Change-Id: I08f94993a55ce6039c7694d8f7019cbd53594edc
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-11-23 20:40:02 +01:00
Frederik Gladhorn
e4e8578c35 Make skipping of test consistent.
On Mac every function was skipped individually,
on the other platforms it was marked as
insignificant.

See also QTBUG-22560 and QTBUG-22361

Change-Id: Ie9b9c617006d5a8c19d042b8be89e449c5ac70bc
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2012-11-23 18:50:40 +01:00
Mitch Curtis
a87ce448ed Prevent "number of sections exceeded" when compiling qmetatype tests.
When compiling qmetatype auto tests with msvc2008 64-bit, I receive:

qmetatype.h(383) : fatal error C1128: number of sections exceeded
object file format limit : compile with /bigobj

This patch follows that advice and adds /bigobj to QMAKE_CXXFLAGS.

Change-Id: I05b3cf9dfdb6a93649c692e2df22365d200e6f2f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2012-11-23 17:04:00 +01:00
Friedemann Kleint
1022c3ce9d Do not detect directories ending in ".lnk" as link files.
Task-number: QTBUG-21863

Change-Id: I70b661fa5fcaba1293a80c971c506798826f5b23
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-11-23 17:04:00 +01:00
Lars Knoll
aea68c93ae Proper macro replacment and branch evaluation
Correclty replace macros according to the C++ standard.
Use the correct replacement method also to evaluate

With this moc correctly processes boost headers.

Task-number: QTBUG-27546

Change-Id: I001b3054c5fcdc34d46cfa53d1387bd19436f361
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-11-23 17:04:00 +01:00
Lars Knoll
43619db05d Emit destroyed() signal before children get deleted
Make sure we always emit the destroyed() signal before
we delete our children. This wasn't working correctly
for QWidget based classes, as the QWidget destructor
deletes all children itself.

Task-number: QTBUG-24672
Change-Id: Iecdff3489196271177edfeba1c4a2c5800e255af
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-11-23 17:04:00 +01:00
Thorbjørn Lund Martsum
2e78d7ac30 QHeaderView - Fix auto-scroll on manual move on sections
This patch fixes the manual move of sections when auto scroll is on.
It is done in QAbstractItemView::doAutoScroll by letting the
qheaderView use its parents scrollbars if they are childs of a
QTableView or QTreeView.

Task-number: QTBUG-993
Task-number: QTBUG-1103

Change-Id: I70d999d9a07c3566e42d01cc5ebb47a69a83d9d4
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-11-23 17:04:00 +01:00
Friedemann Kleint
1b8dcec81a Make widgetgrab manual test compile with 4.8 and 5.
Task-number: QTBUG-27333
Task-number: QTBUG-27550

Change-Id: Iceb2ded9deff1d375bf02b88e214da20901bfa0e
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2012-11-23 17:04:00 +01:00
J-P Nurmi
27aa41cbba Made QMacStyle internal
We will take this opportynity to remove various QStyle specializations
from the public API in Qt5. This gives us much more freedom, for
example changing the inheritance hierarchy, pluginizing etc. without
worrying about BC.

=> Use QStyleFactory and/or QProxyStyle instead of creating an instance
or inheriting QMacStyle directly.

Change-Id: I44a2f5ee3fe08ecc837b593a2a2737eb90e8c267
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2012-11-23 15:18:15 +01:00
J-P Nurmi
d25572cc7b tst_qlistview: remove redundant include
Change-Id: If33518159feb202fa041ac2809817dff5616249f
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-11-23 15:15:27 +01:00