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>
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>
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>
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>
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>
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>
For some strange reason "Object::method ..." was printed, without
the leading Q.
Change-Id: I10b99e8aa8730e4020d15b3e04a01004bade76c3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
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>
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>
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>
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>
Like in commit 5341cf7831, do not enable
warnings when building V8 code.
Change-Id: I447db52d546b50aea1c3afc88db7ce6923a5e310
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
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>
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>
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>
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>
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>
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>
Silence "deprecated" warnings. Use the old API
on 10.6.
Change-Id: I0cfa3a083108618023b491589a85ddfc268f990b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
Updated three instances were not using QFINDTESTDATA.
Change-Id: Ibd0f6734791fc5d98ebeb65ac3bd80aa1c076414
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
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>
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>
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>
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>