Commit Graph

2779 Commits

Author SHA1 Message Date
Jan Arne Petersen
a386194f99 Fix QDBusServer with more than one connection
Create a new QDBusConnectionPrivate for every new connection in
qDBusNewConnection instead of creating a single QDBusConnectionPrivate
in the QDBusServer constructor which gets assigned the latest connected
DBusConnection in qDBusNewConnection (and loses track on all previous
DBusConnections).

Also extend tst_QDBusConnection::registerObjectPeer() test with multiple
connections to the server.

Task-Number: 24921
Change-Id: I4341e8d48d464f3fe0a314a6ab14f848545d65a0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-14 01:02:06 +02:00
Thiago Macieira
81b00670f2 Use QElapsedTimer instead of QTime to measure elapsed time
QElaspedTimer is a lot more efficient.

Change-Id: I66d9514108f800a45181d8960b01a5e7d3fa9e80
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-13 22:40:34 +02:00
Thiago Macieira
53a7778b90 Increase the fuzziness of the QSemaphore test to 50 ms
The test tries to acquire a semaphore that isn't ready, so it will
timeout. The test is working properly.

The only problem is that 10 ms is too strict. For a wide variety of
reasons, especially since the Qt CI system runs multiple tests in
parallel, the program may not run again in that 10 ms window.

Change-Id: Ic0f684895f73646db5f1cc783fe9ef75fb1ab02b
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-13 22:40:27 +02:00
Markku Heikkila
d1d4647b74 Fixed: QFileInfo::lastModified() returning wrong value.
Fixed so that empty QDateTime is returned for non existing file.
Fixed also created() and lastRead() to return empty QDateTime for
non existing file.

QFileSystemEngine::fillMetaData() returned true for non existing
files. This was also corrected.

Task-number: QTBUG-25811

Change-Id: I523eb99e4405b4b813b2950f85cc646239181d07
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Christian Stromme <christian.stromme@nokia.com>
2012-09-13 19:33:08 +02:00
Caroline Chao
cecc2c6851 Test: Redo remove QSKIP from printsupport tests
Redoing 5704cbc462

This can't work, because the define comes from qconfig.h, not qmake.

Skipping initTestCase and cleanupTestCase when QT_NO_PRINTER is
defined.

Change-Id: I2527c018294b7518a4692f2c93da933848640b5d
Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
2012-09-13 19:33:08 +02:00
Rafael Roquetto
4a588c27e8 Blackberry: fix tst_QFileInfo::isWritable()
This test checks the access permissions for '/etc/passwd', however the
filesystem on Blackberry is always read-only

Change-Id: I9299531397d4467287541b04184540ad6e2eae72
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2012-09-13 16:52:51 +02:00
Stephen Kelly
d7a15fbfd9 Fix crash when invalidating a QSortFilterProxyModel
Task-number: QTBUG-27122

Change-Id: Ibca46b88442f4f92422d9b3182e4bbf25716a07f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-09-13 16:20:11 +02:00
Eskil Abrahamsen Blomfeldt
e640ebacb9 Fix regression in QTextDocument::toHtml() with font pixel size
Introduced by 2e0003eda4. We were
missing a attributesEmitted=true which caused the output from
toHtml() to sometimes be invalid when using pixel sizes to
specify the font size.

Task-number: QTBUG-25778
Change-Id: Ied61fcaef425a590d71c0b52292ac676cb88ba52
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Jiang Jiang <gzjjgod@gmail.com>
2012-09-12 16:05:12 +02:00
Caroline Chao
b88534c2d4 Test: Update QSKIP for tst_QGLThread on Mac
Task-number: QTBUG-22361
Change-Id: I6182a37dc38294011fd3b3934317f22c7297a4ca
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-09-12 11:01:25 +02:00
Caroline Chao
5704cbc462 Test: remove QSKIP from printsupport tests
Exclude printsupport tests from the build when QT_NO_PRINTER is
defined.

Change-Id: Iedae91666a599f4b77250abc8aac14c256fde34e
Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-09-12 10:14:10 +02:00
Eskil Abrahamsen Blomfeldt
97b4c5a574 Stabilize qprinter test
The CreationDate entry in the two PDF files can potentially
be different depending on when the test is run. We ignore the
line for this entry when comparing the two results.

Task-number: QTBUG-27171
Change-Id: I8978678295217edd537edb0d2c25260813aa3d93
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2012-09-12 10:14:10 +02:00
João Abecasis
975ebdc4ab Don't manipulate immutable data
QArrayData can point to data it does not own (cf. fromRawData()), which
shouldn't be modified. Not even upon destruction, as this data can live
in Read-Only memory or be otherwise shared outside the QArrayData realm.

Change-Id: I8bdf3050a17802fb003b77d5f543fe31769a7710
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andreas Hartmetz <ahartmetz@gmail.com>
2012-09-11 23:54:57 +02:00
Friedemann Kleint
f957370206 Close popups when switching applications on Windows.
Bring back code from 4.8 (Note that ALT-TAB is not received
as key event).

Task-number: QTBUG-27146
Change-Id: I6dd2e9c88fdc4c89d26dfaa8ab47deb2be451f25
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-09-11 12:09:47 +02:00
Pekka Vuorela
e06999bd62 Remove deprecated inputItem and inputWindow from QInputMethod
Interfaces introduced and deprecated during Qt5 development.

Change-Id: I804a02df8c4a03ed6558f4a86375f97d09513d5c
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-11 09:35:28 +02:00
Eskil Abrahamsen Blomfeldt
014ae2ad04 Avoid duplicate setPen() in PDF when reusing QPrinter
The simplePen property was not reset when reusing the QPrinter,
thus we would output two identical setPen() commands in the PDF
making the autotest that compares the results fail.

Task-number: QTBUG-27171
Change-Id: I601042ec59e45ef72a56f230f6112a91a259b4a5
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-11 09:35:28 +02:00
Oswald Buddenhagen
0e78e50802 port qmake to qt creator's qmake language evaluator
this is a monster commit which does the following things:
- import the evaluator as-is from qt creator into qmake/library/
  - integrate it into qmake's makefiles
  - overwrite proitems.h with actual special types
- remove the parts of Option which are redundant with QMakeGlobals
- make QMakeProperty a singleton owned by Option::globals. the dynamic
  handling so far made no sense.
- make QMakeProject a subclass of QMakeEvaluator, with relatively few
  extensions

the changes to existing qmake code outside project.* and option.* are
minor. implementing the changes gradually would mean changing a lot of
code which will be just replaced in the next commit, so i'm not wasting
my time on it.

Change-Id: I9746650423b8c5b3fbd8c3979a73228982a46195
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-09-11 00:13:01 +02:00
Sergio Ahumada
faaa866961 test: Remove QSKIP from tst_uic::stdOut()
This test actually passes on Windows, so removing the QSKIP

Task-number: QTBUG-26730
Change-Id: Ife1b5bd0ffa20c433070a1875dde8b6a226c331a
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
2012-09-10 23:58:46 +02:00
Sergio Ahumada
6c3ee80589 test: Remove QSKIP from tst_QLocale::windowsDefaultLocale()
This test actually passes on Windows, so removing the QSKIP

Task-number: QTBUG-24543
Change-Id: Ic2666665f2882392aec92a665f51d6c5dd3355f8
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-09-10 19:20:52 +02:00
Simon Hausmann
0c0c04b405 Fix semantics of the src dir in the include search paths with MinGW
This issue originates from https://bugs.webkit.org/show_bug.cgi?id=95736

Suppose we have
    main.cpp
    somedirectory/someheader.h -- which has #include "anotherheader.h"
    anotherheader.h

With unix generator, the directory where main.cpp is located is included,
unless no_include_pwd is set. Hence the look-up of anotherheader.h from
within someheader.h will work.

With MSVC this works because MSVC looks "in the directories of any
previously opened include files in the reverse order in which they were
opened." (from http://msdn.microsoft.com/en-us/library/36k2cdd4.aspx)

Unfortunately the build breaks with MinGW, because it lacks support for
including the source directory in the include search path just like the
unix generator does.

This patch adds the same functionality to the MinGW generator as well as
an auto-test.

Change-Id: Iea8bb06e34862c51b8fd4eca2ee26668e24a319a
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Reviewed-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-09-10 14:09:45 +02:00
Kevin Funk
e78e7d325b Fix build of tests/ on Windows CE
Remove some subprojects that have missing dependencies or use API that is
non-available on Windows CE.

Change-Id: Iad7118b95a691a433c3f798d56a6a069e5e41917
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-09-10 14:09:45 +02:00
Leonard Lee
b41bd2b08d Remove old troll test servers' references.
Replaced with qt-project.org test domain.
The connectToMultiIP auto test is still disabled due to lack of test infrastructure.

Task-number: QTBUG-23294

Change-Id: Icf01aabb0ae503291abdda4e8f773f8e0a08931a
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-10 09:37:59 +02:00
Marc Mutz
ecf7f0d954 Use QStringList::join(QChar) overload where applicable [QtDBus]
This is an automated change performing the following replacements:
                    join\("(.)"\) -> join('\1')
  join\(QLatin1String\("(.)"\)\)  -> join(QLatin1Char('\1'))
  join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1'))

Change-Id: I807b0e88ac71a0cb367fb4170cca8f2cb0ad43f3
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-09-10 00:27:13 +02:00
Sergio Ahumada
4d3a53305f test: QFtp tests require `private_tests' set
Also fixing some includes and re-enabling the test

Change-Id: I4a061e106c2e55db39b8000729737a93e3d7714a
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-09-09 08:51:05 +02:00
Marc Mutz
1f8d570d5f Use QStringList::join(QChar) overload where applicable [QtNetwork]
This is an automated change performing the following replacements:
                    join\("(.)"\) -> join('\1')
  join\(QLatin1String\("(.)"\)\)  -> join(QLatin1Char('\1'))
  join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1'))

Change-Id: I5b75877ba192fa1357e67fee70dff7c0475991e8
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-09-07 18:41:22 +02:00
Marc Mutz
781b642671 Use QStringList::join(QChar) overload where applicable [QtWidgets]
This is an automated change performing the following replacements:
                    join\("(.)"\) -> join('\1')
  join\(QLatin1String\("(.)"\)\)  -> join(QLatin1Char('\1'))
  join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1'))

Change-Id: Ia30048e0c40967dc86a4e4ad26ac02ab67519096
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-09-07 18:41:22 +02:00
Julien Brianceau
5b1bc864a9 QtNetwork: bypass proxy for local connections
According to Qt doc, "Network proxy is not used if the address used in
connectToHost(), bind() or listen() is equivalent to
QHostAddress::LocalHost or QHostAddress::LocalHostIPv6. This is not the
case in current implementation.

Change-Id: I6b8a40c1e8bd8aad9504d8f939b87eda6e93337c
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-09-07 15:44:31 +02:00
Thiago Macieira
9c29beb9ea Add a way to benchmark sem_t on Unix too
It's closer to what we do with in QMutex than pthread_mutex_lock.

Change-Id: I86498a800b69b684bf096912e911bc5bca219727
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-09-07 15:39:31 +02:00
Caroline Chao
72ea9e1e94 Test: Replace QSKIP by XFAIL
For tst_QtConcurrentThreadEngine::threadCount

Change-Id: I14b904a26900a01d5d04245ad60d9752f5645e68
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-09-07 15:39:31 +02:00
Caroline Chao
f9b9a71c99 Test: Remove QSKIP for tst_QXmlSimpleReader::inputFromSocket
The test is now passing. Tested with intel compiler and vs2008.

Task-number: QTBUG-22285

Change-Id: I728919833d9bcbf71bef68c06baef92667ff074b
Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
2012-09-07 15:39:31 +02:00
Sean Harmer
51d40d7e9b Make gui/math3d classes use float rather than qreal
This corrects the mismatch between using floats for internal storage
and qreal in the API of QVector*D which leads to lots of implicit
casts between double and float.

This change also stops users from being surprised by the loss of
precision when using these classes on desktop platforms and removes
the need for the private constructors taking a dummy int as the final
argument.

The QMatrix4x4 and QQuaternion classes have been changed to use float
for their internal storage since these are meant to be used in
conjunction with the QVector*D classes. This is to prevent unexpected
loss of precision and to improve performance.

The on-disk format has also been changed from double to float thereby
reducing the storage required when streaming vectors and matrices. This
is potentially a large saving when working with complex 3D meshes etc.

This also has a significant performance improvement when passing
matrices to QOpenGLShaderProgram (and QGLShaderProgram) as we no
longer have to iterate and convert the data to floats. This is
an operation that could easily be needed many times per frame.

This change also opens the door for further optimisations of these
classes to be implemented by using SIMD intrinsics.

This needs to be applied in conjunction with

https://codereview.qt-project.org/#change,33548

Task-number: QTBUG-21035
Task-number: QTBUG-20661
Change-Id: I9321b06040ffb93ae1cbd72fd2013267ac901b2e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-07 13:27:38 +02:00
Friedemann Kleint
59774b5d64 Add example to test widget grab.
Compiles against Qt 4.8 and Qt 5.

Change-Id: Ic246aeb38171361a8338f38f9b92e5cf3b54b368
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-09-07 12:01:56 +02:00
Friedemann Kleint
20563c1334 Stabilize test of QSpinBox.
The test shows spurious failures in editingFinished() on some Mac
platforms (QTest::qWaitForWindowActive(testFocusWidget)).
This is apparently caused by the widget testFocusWidget (member
variable) interfering with the other tests widgets.
As it is used in one test only, instantiate it on the stack there.

Change-Id: I688cd21a2668d072660658302cf59197abe0b4d8
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-09-07 12:01:47 +02:00
Friedemann Kleint
75cd2dec71 Revert "Implement automatic mouse grabbing on mouse button press."
This reverts commit 6b5bbc531b.

Autograbbing mouse shouldn't be done in crossplatform code, as
X11 does this automatically. Windows needs platform specific
solution.

Task-number: QTBUG-26962
Task-number: QTBUG-27039
Task-number: QTBUG-23699

Change-Id: I911df92c4a34deb50b729f50681497046657948b
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-09-07 12:01:38 +02:00
Mitch Curtis
9039031479 Fix QDateEdit displaying day as a number for short and long day formats
When 2 (February) is entered as the month for (e.g.) 31/Jan/2000 (which
is following the format: "dd/MMM/yyyy"), the day is corrected to 29 but
displayed as its numerical value instead of its short (or long) name.

Task-number: QTBUG-27036 QTBUG-19091
Change-Id: I558ee13b224707d22b26c2ec2c045f96118bd5a1
Reviewed-by: Mitch Curtis <mitch.curtis@nokia.com>
Reviewed-by: aavit <qt_aavit@ovi.com>
2012-09-05 21:06:51 +02:00
Mitch Curtis
2b562b7564 Fix 3 digit day being displayed by QDateEdit.
When a QDateEdit has its display format set to "yyyy/MM/dd", its day
set to 31 and its month set to 2, it will display 291 as the day until
the cursor is moved or the focus changed. This is because
QDateTimeParser::parse calls sectionSize() for the day section, which
will sometimes return an incorrect size. There are also other display
formats affected by this bug (e.g. long day names).

For example, (in the context of sectionSize()) when text is
"2000/01/31" and displayText() is "2000/2/31", there is a difference
between displayText() and text - text is the previous value and
displayText() is the new value. The size difference is always due to
leading zeroes.

This patch makes QDateTimeParser keep track of the quantity of zeroes
added to each section and then factors this value into the result of
sectionSize() if there is a size difference between text and
displayText().

Task-number: QTBUG-26847
Change-Id: I3823cc41167ec920f742cb6a20d39fc5f433c915
Reviewed-by: Mitch Curtis <mitch.curtis@nokia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
Reviewed-by: aavit <qt_aavit@ovi.com>
2012-09-05 21:06:39 +02:00
Sergio Ahumada
56d5c909af Use true and false in preference to TRUE and FALSE
The TRUE and FALSE macros are obsolete and should be replaced with
true and false (all lower case) respectively.

Change-Id: Iee352e8173500683e6319be0abbf5bacf29016e0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-05 03:03:05 +02:00
Sergio Ahumada
10ed50002c test: Check for null string comparison
Do not compare a QString to QString(). Instead use the .isEmpty() method.

Change-Id: I8bb5e64563bf173abe7288bb9e35375bee1fe445
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-05 03:03:02 +02:00
Milian Wolff
0102f34f1e Optimize QTextLayout/QTextEngine usage outside of QTextDocument.
When QTextLayout is used in a QTextDocument, many code paths use
special caches and thus greatly outperform the raw QTextLayout version
that operates directly on a QString.

This patch brings some of these optimizations also to the raw version.
We now also use a QFormatCollection in such cases and enable the
functionality of QTextEngine::indexAdditionalFormats() and
QTextEngine::resolveAdditionalFormats(). Thanks to that, we can greatly
speed up QTextEngine::format(), which now uses an amort O(1) hash table
lookup instead of a O(N) linear search.

The added benchmark shows a gain in the order of one magnitude:

./tst_bench_QText formattedLayout:long-many

before applying the patch:
378.19 msecs per iteration (total: 37,820, iterations: 100)
after applying the patch:
25.80 msecs per iteration (total: 2,580, iterations: 100)

Note: This change is source-incompatible for applications using the private
QTextEngine API.

Task-number: QTBUG-8389
Change-Id: Ifcf7a8902a394428979ea06a6d955f886ee739c7
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-05 03:02:59 +02:00
Rafael Roquetto
3d4fc578bd Auto test for 'qmake -project' use case.
Change-Id: Ifb6d64828ba1cb42fd64299438b7eec302112edf
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-09-04 10:30:33 +02:00
Stephen Kelly
5a1fa8860c Generate includes for Qt containers used as auto-metatypes.
Otherwise the containers might be forward declared in the moc file,
and when the moc file is compiled in a standalone translation unit,
the full definition of it would not be available. This results in
odd compile errors, so instead generate the includes if required.

Change-Id: Ie01c5a5d45314daad0b00dec03b3e1e18cdbae64
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Krause <volker.krause@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-09-03 20:05:04 +02:00
Marc Mutz
cb8424b381 Use QStringList::join(QChar) overload where applicable [QtSql]
This is an automated change performing the following replacements:
                    join\("(.)"\) -> join('\1')
  join\(QLatin1String\("(.)"\)\)  -> join(QLatin1Char('\1'))
  join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1'))

Change-Id: Ie395d82d17710683968d006d22de313ef49dc6e5
Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-09-03 19:35:25 +02:00
Marc Mutz
68e04c3ac1 QStringList::join: add an overload taking a single QChar
This overload avoids the needless heap allocation that the traditional
overload incurs due to the implicit QChar -> QString conversion
involved there.

In order to share the implementation between the two overloads,
QStringList_join now takes the separator as a (Char*,int) tuple
instead of as a QString.

Change-Id: I92961f13a3f19099de2a6e2df9f4789a12fc83a0
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-03 13:41:55 +02:00
Stephen Kelly
dcf4d152b5 Change SChar to metatype id 40.
This fills the gap left by QWidgetStar, making the sequence
between FirstCoreType and LastCoreType contiguous, which some
benchmarks assume to be true anyway.

Change-Id: I2d5d202b6246a9065fdf77f325a4a04279dbe4b7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-03 11:05:49 +02:00
Volker Krause
8c1cb66712 Fix moc generating invalid code for slots with reference types as argument.
We can't have T& declared/registered as a metatype (wont compile), but
using it as type for a slot argument is possible. With the recent
introduction of metatype auto-registration we have to make sure that moc
doesn't attempt to auto-register those. Simple types are handled correctly
already, this fixes containers and smart pointers.

Change-Id: Id96857c57d6ebf158a67e9d527c89dc195473b1b
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-09-02 23:41:42 +02:00
J-P Nurmi
60783291ff auto tests: updated for new QStyle pure virtuals
QStyle::standardIconImplementation() & layoutSpacingImplementation()
are removed, and standardIcon() & layoutSpacing() made pure virtual.

Change-Id: If8ab6cfef0b639b7973be22dd630ba3e6f39a225
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
2012-08-31 18:56:35 +02:00
Sergio Ahumada
531b96f42e test: Mark tst_QFile::writeLargeDataBlock() unstable failure as XFAIL
The test has one unstable failure on Windows, so mark this with QEXPECT_FAIL

Task-number: QTBUG-26906
Change-Id: I2f6c63ddefecacd224d93f83e6951e961a02a051
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-08-31 18:56:35 +02:00
Jeremy Lainé
28881c0c91 Make QGraphicsView respect scrollbar policies
When calculating the maximum height / width which a QGraphicsView can display,
make sure we only take the scrollbars' dimensions into account if their policy
is set to Qt::ScrollBarAsNeeded:

- if the policy is set to Qt::ScrollBarAlwaysOff, the scrollbar will not be
  displayed at all

- if the policy is set to Qt::ScrollBarAlwaysOn, the scrollbar's dimensions
have already been substracted from the available space by
QAbstractScrollArea::maximumViewportSize()

Task-number: QTBUG-14711
Change-Id: If5d24b41dbe7b089abca2bf61ccbd370d4de79a1
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-08-31 16:29:43 +02:00
Friedemann Kleint
1e34d3525f Fix updating of drag icons.
Try to find a target widget that accepts drops; ignore the event
if none can be found. Split the handleDrag*() functions
to reduce indentation.

Add an autotest.

Task-number: QTBUG-22987
Change-Id: I516ac5f0c002caaf83c52ac16f821246e565230f
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-08-31 16:10:25 +02:00
João Abecasis
ed4939eaac Improve performance of QArrayData::Grow autotest
Doing element-wise insertions for the full range of the test made
testing under valgrind extremely slow. When a reallocation is detected
we now resize() the container close to capacity(), while verifying this
doesn't unnecessarily re-allocate either.

Change-Id: Idf7015cf390e366fe444e7ca14c904a2d54ff48b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-30 13:51:22 +02:00
Mark Brand
c194b7f345 QSqlQueryModel: fix nested beginResetModel/endResetModel
Follow-up to 83c9ebbd66.

Consider the case where calls to the reset methods on the same object
are nested as in the following sequence:

  1. beginResetModel()
  2. beginResetModel()
  3. endResetModel()
  4. endResetModel()

In such cases, only the outermost calls, i.e., 1) and 4), should emit
signals.

After 83c9ebbd66, 1) and 3) emitted the
signals, which is wrong. This is corrected by keeping track of the
nesting level.

Such sequences can come about when a base class calls the begin/end
methods between the calls made by the subclass.
QSqlTableModel::select() is an example of this.

Test included.

Change-Id: Ia62b45cb1abaab00a32bb8357de4a958bcff83e5
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-08-30 13:51:22 +02:00