Commit Graph

3576 Commits

Author SHA1 Message Date
Joerg Bornemann
81a825ea9b fix QMutex warning in tst_QLocalSocket::threadedConnection
Change-Id: I5728af1944e44bd976e51d4f0c0a923deacbeea0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2011-12-15 15:39:24 +01:00
Thorbjørn Lund Martsum
3bb0c88de8 QHeaderView - no big update work if updates are disabled
There is no reason to find out where to update the headerview
if updates aren't enabled.  Another approch I considered to skip the
whole calculation and just call update. I seriosly doubt that this
calculation and update of a particular QHeaderView rect will normally(*)
be faster than just updating everything.

However to be safe I have done the conservative fix.

(*) Normally but with many/fragmented spans in the headerview.

Change-Id: Ia812a747ee825653db0345cdc34f9d2f7155ea01
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2011-12-15 15:39:24 +01:00
Robin Burchell
f9516e4c8e Split timer handling out of QEventDispatcherUnix.
This makes it easier to see the guts of the unix event dispatcher, and to
experiment with it.

Change-Id: I715bb68c4de6798e10bc55304a128b88e0249c63
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-12-15 13:33:31 +01:00
Bradley T. Hughes
317ee62d44 Remove unused ownObjectName field from QObjectData
This field isn't used at all in qtbase, nor in any of the qt5
submodules.

Change-Id: If57d389935593f797818506a220c6a3cc04b6078
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-15 13:33:04 +01:00
Bradley T. Hughes
2561ab5841 Remove QT_JAMBI_BUILD code
Change-Id: Ic9231b11293af4352f11cf075893175f0c9a471f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-15 13:28:09 +01:00
Bradley T. Hughes
0501c9d8f1 Correct sizeof(QObjectData) after out-of-order cherry-picks by Gerrit
Commits a6ae75f92a and
6f0f9f6928 were cherry-picked in the wrong
order (despite the dependencies shown in Gerrit), causing the
QObjectData::unused bitfield to be too large.

Change-Id: I65acaa8b507f7f6f2c5735f45bd0ad8343abea54
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-12-15 08:17:49 +01:00
Jason McDonald
a925226d44 Remove Qt5 comment from qsignalspy.h.
The removed comment refers to a task in a bug tracker that no longer
exists.  The comment also mentions making (part of) testlib use Qt's
regular binary compatibility mechanisms, which is desirable in the long
term but not in scope for Qt 5.

Change-Id: I6f23a9a2c8a84e30afe2aeb5c53ea93c25ba6f11
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-15 08:15:13 +01:00
Jason McDonald
95cb93dc59 Fix incorrect function name in assertion.
Change-Id: I3eb8e7afe3f7ca514dd4839e603612b56c7d8082
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-15 08:15:08 +01:00
Jason McDonald
a3109c8b0b Remove QTest::qt_snprintf() from testlib API.
This was an internal function that used to act like qsnprintf() but also
filtered unprintable characters out of the test output.  The filtering
has been moved somewhere more appropriate and this function is no longer
used by testlib.

Unfortunately, the function was exposed in the public API due to its
former use in the implementation of a public macro.

In the unlikely event that any code outside testlib calls this function,
the call should be replaced by calling qsnprintf(), which comes from the
QtCore/QByteArray header.

Change-Id: Iddc17b4361d16ebddd19346ae7d1064951dd7738
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-12-15 08:02:36 +01:00
Giuseppe D'Angelo
be6b29f001 Fix typos in QObject::(dis)connect warnings
For some strange reason "Object::method ..." was printed, without
the leading Q.

Change-Id: I10b99e8aa8730e4020d15b3e04a01004bade76c3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-12-15 05:48:27 +01:00
Kurt Korbatits
d936fe0858 Fix qimagereader, qmovie and qmake unittest to work in shadow build.
Changed to use QFINDTESTDATA and TESTDATA.

Change-Id: I8684bc191cf8ffb8b531456e32047d582ebc018c
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-15 05:48:27 +01:00
Friedemann Kleint
2163f05942 Application-test: Fix location of sub-executables.
Use QFINDTESTDATA to set the working directory
and change the profiles accordingly (as in
the qprocess-test).

Change-Id: I332038728c64214f73ced448e1466ad96c11b3b3
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-15 03:56:16 +01:00
Jason McDonald
dc98d58562 Improve QTest::keyClick documentation.
Make it clear that the delay is applied before each key-click is
simulated.

Change-Id: Id100f1f2db1a5b1651c3046905719d7eb06ec1a0
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-15 01:57:57 +01:00
Jason McDonald
5b413852dd Update documentation of QTEST_MAIN macro.
Update the docs to describe the behaviour that resulted from moving the
traditional Qt widgets into a separate library from the rest of GUI
classes.

Change-Id: Ibd0ef05cc871b8f5a6700e421aa41bdf64c1210b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-15 01:57:53 +01:00
Jason McDonald
c45f9c7761 Improve QCOMPARE for QStringList
After establishing that both lists are the same size, there is no need
to calculate the minimum of the list sizes.  Also, use sizeof() instead
of hard-coded values when calling qsnprintf().

Change-Id: I2396cf3f941770229e1cef6422aeddbe549c51fc
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-15 01:57:48 +01:00
Friedemann Kleint
f54916697a QThread-test: Fix test on Windows (timer inaccuracy).
- Tolerate WaitTime - 1 (799ms when expecting 800ms).
- Remove commented-out code.

Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>

Change-Id: Ibe246d47ab7667692386b0f9333150c195948282
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-12-14 23:26:15 +01:00
Bradley T. Hughes
c4e36728bc Disable warnings when building mkv8snapshot
Like in commit 5341cf7831, do not enable
warnings when building V8 code.

Change-Id: I447db52d546b50aea1c3afc88db7ce6923a5e310
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2011-12-14 23:26:15 +01:00
Morten Sorvig
f950a0f0c0 Make QCocoaWindow independent of NSWindow.
QCocoaWindow now gets resize events from QNSViev
and does not require a NSWindow. QWindow instances
can now be inserted in NSView hierarchies. This is
useful for Qt-as-a-plugin use cases and is needed to
implement QMacNativeWidget for Qt 5.

Change-Id: Ia95ea9c22a15a3e62d1e6543466cff07390c70a2
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-12-14 23:26:15 +01:00
Morten Johan Sorvig
f295ef1a4b Cocoa: Add window debug output
Add logging for setGeometry/setVisible/propagateSizeHints.

Change-Id: I3590caed586d36f789dd67b1951e8152f923a407
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-12-14 23:26:15 +01:00
Friedemann Kleint
3b2d99a5c8 QIBusPlatformInputContext: Fix a crash in tst_qinputpanel::update.
Change-Id: If50c442958b6f25f17325f7792bb3f882e4b13e7
Reviewed-by: Pekka Vuorela <pekka.ta.vuorela@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2011-12-14 23:26:15 +01:00
Friedemann Kleint
56c4ddfdf6 QPlatformDialogHelpers: Reduce dependency on QDialog.
For each QDialog-derived class, introduce a Q[X]Options class
containing the options of the dialog. An instance is shared
between the QDialog (or dialog desktop component) and the
helper.

Change-Id: Ibabf508a4b9eaea25615638a47a4c1b8f93c019e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-12-14 21:49:33 +01:00
Thorbjørn Lund Martsum
f86007175d QHeaderView::ResizeToContents slow hide fix
I have been a bit confused about what QHeaderView::ResizeToContents
does good. It only sizes depending of the visible part.

However in hide it goes crazy and checks calculates size hints
for every row. At first I considered to solve it in QTableView.
It could be made to calculate the maximum height of the maximum
screen - however I decided not to touch it since I was not
certain that it wouldn't have any unexpected side effects.

Therefore I instead made this patch which is more simple and seems
to be safer. The logic is that when a QHeaderView is hidden we actually
only want to recalculate sizes if the headerview has a visible parent.

Task-number: QTBUG-14234

Change-Id: I186ab6afa95aed43022f2bb7c36e3fd008355d9b
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2011-12-14 18:18:59 +01:00
Aaron Kennedy
eeade8bf9c Update V8 to match current patchset
Change-Id: Ib3a093129b1f8bbe66fc870af8871dea3f58c081
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
2011-12-14 15:39:43 +01:00
Aurindam Jana
cd44813bae Update V8
Update V8 with fix for Issue 1853
(http://code.google.com/p/v8/issues/detail?id=1853)

Change-Id: I10f652228ab1421b280b433eb2a59aeb83a7699f
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
2011-12-14 13:19:03 +01:00
Laszlo Agocs
3064c1bc8c Remove redundant touch processing in QtGui and widgets.
The duplicated hash tables in QGuiApplicationPrivate and
QApplicationPrivate are now unified into one single hash table in
QGuiApplicationPrivate. This also reduced the number of lookups.

The extra processing needed to keep the touch points' first/lastPos
values in sync is now done only once, in QGuiApplication. This
eliminates the performance penalty (for widget-based apps) that was
introduced during the QPA migration.

As an added bonus the patch adds support for touch events arriving
simultaenously from multiple devices. This was broken before: As there
is no guarantee that two devices/drivers will not send touch points
with the same ID, using structures with only the ID as key is
wrong. The proper key is composed of the device ID (that is, a
QTouchDevice pointer) and the touch point ID.

The exported internal function qt_translateRawTouchEvent() has been
removed. This function cannot work properly in the QPA world: It
injected touches into the widget subsystem (QApplication) only which
is wrong, and would result in half-filled touch events due to not
routing the injected data through QGuiApplication. Autotests using
this function are migrated to
QWindowSystemInterface::handleTouchEvent().

Change-Id: I7632781d77f9e0ac4626fd7c9933511c94492156
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-12-14 13:17:19 +01:00
Bradley T. Hughes
14d9a2b06c Remove QAlphaPaintEngine::drawImage()
It was not a proper reimplementation of QPaintEngine::drawImage(), which
takes 4 arguments, not 3 as declared in QAlphaPaintEngine. Remove the
code, since it is not being called.

Change-Id: Ia125a9c7e8a2e05ec2ca11b859c01ccbf4d55af5
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-12-14 09:27:04 +01:00
Jason McDonald
2395a3c897 Remove incorrect information from QCOMPARE documentation.
The documentation stated that QStringList objects would be compared
starting from the end of the lists.  The implementation in qtest.h
actually starts at the beginning of the list, and always has done since
qtestlib became part of Qt.

Change-Id: I056f584564d46402ba23fc6a89c801cb5c3c6262
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-14 09:27:04 +01:00
Morten Johan Sorvig
876b2d06f7 Cocoa: Use new 10.7 mouse wheel API.
Silence "deprecated" warnings. Use the old API
on 10.6.

Change-Id: I0cfa3a083108618023b491589a85ddfc268f990b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-12-14 09:27:04 +01:00
Robin Burchell
239df503ba Remove -graphicssystem (and -runtimegraphicssystem) options from configure.
In a Qt 5 world, these have no relevance, so remove them.

Task-number: QTBUG-23022
Change-Id: I2f52c7aa1fcb8234046dd95b4d702791d20514fa
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-12-14 09:27:04 +01:00
Kurt Korbatits
0c9b050f91 Fix testlib selftests on shadow build.
Changed to use QT_INSTALL_TESTS to install subtests.

Change-Id: I4a2a7bd2d3e7d6da34dbb922bf377bee98cdedb0
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-12-14 07:15:46 +01:00
Friedemann Kleint
ab272fff56 QObject-test: Reorganize subprocess.
On Windows, the signalbug.exe could not be launched since it is
not next to tst_qobject.exe, which is in one of the
'release', 'debug' subfolders.

Introduce a subdirectory structure similar to that of
the QProcess test and use QFINDTESTDATA to locate it.

Change-Id: Ie8f2ede8cb76f22a908cb77517a74076be11fbb7
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-14 07:07:09 +01:00
Jason McDonald
d939dd8791 Improve QStringList test in cmptest selftest.
The old test only verified the behaviour of QCOMPARE when comparing
lists that were different.  Add data rows for comparing empty lists and
non-empty lists that are equal.

Note that testlib currently does not report passing data rows (only
failing rows and completely passing test functions), so the new data
rows do not cause any change in the expected test output.

Change-Id: I137650ce0ca6250cee36bd9cb74b01f8abd4e89c
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-14 02:40:31 +01:00
Jason McDonald
4a233f9a90 Give names to data rows in cmptest selftest.
Change-Id: Ia362f0651c8d32602fa13d6639fb8386fe8d9e0b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-14 02:40:26 +01:00
Jason McDonald
9bc546e492 Add testlib selftest for QStringList comparison.
The (disabled) alive selftest contained a test for the QStringList
specialization of the QTest::qCompare template.  This test is unrelated
to the rest of the alive selftest, so move it to the cmptest selftest,
where QCOMPARE is tested.

Change-Id: Ic6f0e491dd3b3ce8b4ca1d49666a099815575eaa
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-14 02:40:17 +01:00
Michael Brasser
a9ad8886fe Fix possible jump in animation timer.
When starting new animations with existing animations running, ensure
we force an update to the timer first, so that the new animations can't
mistakenly start with a very large delta.

This fixes tst_qdeclarativeanimations::alwaysRunToEndRestartBug failure
on slow machines.

Change-Id: Ida4e5dcf0ff792e6bfe0d244b6e969d04d0b20fa
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2011-12-14 02:16:40 +01:00
Jędrzej Nowacki
3ed0a23323 Add specialization for QTypeInfo<void>
QTypeInfo uses sizeof which is illegal operation for void type.

Change-Id: Idf43551bdfafbb76e32f4f2785af5f4291981e73
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-12-13 16:36:33 +01:00
Debao Zhang
7694599ef9 Fix Memory leak related to Content Menu
From Qt4.7 on, the contextmenu of
QTextEdit/QPlainTextEdit/QLineEdit/QLabel/QMainWindow etc using
QMenu::popup() instead of QMenu::exec(), but the
setAttribute(Qt::WA_DeleteOnClose) does not work, as QMenu::close()
isn't called when the menus disapper. And this causes a memory leak.

This is a side effect of b7af368e86874d71ffc9071c9ef009814d6a3467

Task-number: QTBUG-22817
Task-number: QTBUG-19592
Change-Id: I4c2c3edb3f63ce914b7b57cd0fbcec20488c8315
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2011-12-13 16:36:33 +01:00
Bradley T. Hughes
d308797d00 Finish removing virtual child integers
Finish the work started by commit
beb72b2fbf. This silences warnings found
by -Woverloaded-virtual.

Change-Id: Ic6f5e77e324463ade8349f23f272b41b509d87e4
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2011-12-13 14:54:09 +01:00
Johannes Zellner
8757aaaf2f Fix debug output in eglfs with QEGL_EXTRA_DEBUG enabled
Change-Id: I615a953b52184d01c5b1b78d1cff283f94c458d9
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-12-13 13:58:56 +01:00
Kim Motoyoshi Kalland
d52fd497f6 Improved performance of large text when parts are outside view.
Avoid generating paths for the parts of the text that are outside
the viewport in the raster paint engine.

Task-number: QTBUG-22687
Change-Id: I06159bc4c1aa82a07606f4b2f0336cb25dfd56d2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2011-12-13 11:11:58 +01:00
Bradley Smith
0553ab9127 Fix QPA xlib plugin handling of setParent(0).
Dereference of the parent argument did not check for nullptr. For
example, the hellogl example would crash. Now if the parent
argument is null, the screen's root window is used.

Change-Id: Ib06181c9ab9794d577722f1c1dd5ee92e4edaee5
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2011-12-13 11:11:58 +01:00
Friedemann Kleint
abb1c066e5 QImageReader-test: Make more verbose, use QTemporaryDir.
- Add some QVERIFY to check for isNull().
- Use QTemporaryDir to avoid spurious failures in the format
  extension-ignore test (cannot copy to '/tmp/black.jpg').

Change-Id: Ia57ea4daa6b8686d1111c9c27a47666265fa9781
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-13 09:33:49 +01:00
Sarah Smith
0786716ce5 Fix failing unit tests.
The test that was failing was the readFromDevice one - where the
extension is not known.

Looks as though image detection is required in a positive way, that is
it is not enough to say I think I can read this file, and then fail if
the format is "corrupt", you must be certain that the file was intended
to be that format.

In the case of TGA the original format has no magic byte header, and no
consistent way to check if it really is a TGA file.  With 2.0 the footer
was added at the end, so that can be checked for confirming the file is
TGA.  However rejecting files which do not have this means that old TGA
files will not be read.

On a quick survey TGA files that have been used in applications so far
all seem to be 2.0 TrueVision, so for now, lets just reject earlier
files and see how it goes.

Also add reading the tga test file to the readFromDevice test.

(cherry picked from commit 665bc3951709f0d726cb82501a5bca684f3347a5)
Change-Id: I665bc3951709f0d726cb82501a5bca684f3347a5
Reviewed-by: Sarah Jane Smith <sarah.j.smith@nokia.com>
2011-12-13 09:33:49 +01:00
Friedemann Kleint
1a5f5d0056 QClipboard-test: Fix test
- Use QFINDTESTDATA to locate sub-executables
- Remove dependency on QtWidgets, use QGuiApplication everywhere.
- Improve error handling when running sub-executables, prevent
  hangs (Windows)

Change-Id: If8e3be82f855c8be6bdbfc9f9728e8490ed181f3
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-13 09:33:49 +01:00
Kurt Korbatits
3c189d9b74 Fix qfile unit test failing on shadow build.
Updated three instances were not using QFINDTESTDATA.

Change-Id: Ibd0f6734791fc5d98ebeb65ac3bd80aa1c076414
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-12-13 07:41:27 +01:00
Jason McDonald
d702da7482 Add missing assertion to QAbstractTestLogger.
If passed an empty string, QAbstractTestLogger::outputString() would
crash, so add a QTEST_ASSERT to make the cause of any crashes more
obvious.

Change-Id: I00afe2e73120b87e211f858402d441f345dddd08
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-13 07:41:27 +01:00
Rohan McGovern
9f592dbd60 testlib: fixed actual, expected order in QTest::compare_helper
These two parameters were written in the opposite order in the
function's declaration and definition.  Harmless to the compiler,
but confusing to developers and reviewers.

Change-Id: I1d4cb0a41b465b5f918daa76756677fe0cfe0a59
Reviewed-by: Jason McDonald
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-12-13 05:19:08 +01:00
Michael Brasser
5d00ae3b69 Stop animation driver in the appropriate place.
Calling stop from restartAnimationTimer was incorrect (it was initially
added as a fix after the introduction of QAnimationDriver, but this is
a better location for the fix).

Change-Id: I2507096b846ada061e36a9ece6aa814d801ddd53
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2011-12-13 02:24:03 +01:00
Michael Brasser
30a4d9bc99 Only call profiler callback once per animation tick.
Change-Id: I369afdf34ded2c6327ce36cdb80fab51bf89a1b5
Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
2011-12-13 02:23:55 +01:00
Michael Brasser
08d378d933 Cleanup pause timer handling in QUnifiedTimer.
The animationTimer is now only used for pauses, so can be renamed to
pauseTimer, and directly queried for whether it is active.

Change-Id: I3d9319b6ee76158e875ab43657126a0aa0a1cf2e
Reviewed-by: Leonardo Sobral Cunha <leo.cunha@nokia.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2011-12-13 02:23:47 +01:00