Commit Graph

3224 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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