Tests for widgets should select the
QWidget * version of overloaded QTestLib
functions rather than the QWindow * version.
Change-Id: I8b540b630758c0e7ba7ed88aba45d624c83ff378
Reviewed-on: http://codereview.qt-project.org/4977
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Matthew Cattell <matthew.cattell@nokia.com>
Each destination and the format of output to write there is specified by
adding "-o filename,format" to the command-line. The special filename
"-" indicates that the log output is written to the standard output
stream, though standard output can be used as a destination at most
once.
The old-style testlib output options are still supported, but can only
be used to specify one logging destination, as before.
If no logging options are given on the command-line, a plain text log
will go to the console, as before.
To log to the console in plain text and to the file "test_output" in
xunit format, one would invoke a test in the following way:
tst_foo -o test_output,xunitxml -o -,txt
This commit also enhances the selftests to test with multiple loggers,
but negative tests (e.g. bad combinations of command-line options) are
left for future task QTBUG-21567.
Task-number: QTBUG-20615
Change-Id: If91e752bc7001657e15e427aba9d25ab0a29a0b0
Reviewed-on: http://codereview.qt-project.org/4125
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Modify the selftest to be able to run each subtest with a list of one or
more test loggers. The addition of tests that use this capability will
be part of a subsequent commit.
Task-number: QTBUG-20615
Change-Id: Iac3efe8220e8245aa7e5589348d2c86b8034dd28
Reviewed-on: http://codereview.qt-project.org/5292
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Fix menu duplication bug: make QCocoaMenu::addAction
do nothing before the native menu has ben created.
Change-Id: Ifca192421f2073264de9f5faeb053008ecb8532e
Reviewed-on: http://codereview.qt-project.org/5135
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
To allow optimizations in the scene graph, we export the private
QTextImageHandler class and add a function which will fetch
a given image when required, or return the cached image in the
document resources.
Task-number: QTBUG-20917
Change-Id: If45e51b0d9a267bc198623165e7a2cc1fb2b961f
Reviewed-on: http://codereview.qt-project.org/5227
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Group the widgets-specific ("legacy") api under as
few ifdefs as possible. (The diff can look confusing;
rest assured that this change "only" moves entire
functions around in the files.)
Change-Id: I27bdec7d1c96d0b040dc22a8fed17e4e47766276
Reviewed-on: http://codereview.qt-project.org/5290
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Matthew Cattell <matthew.cattell@nokia.com>
Make sure we move the drag pixmap when required,
and readd some commented out code from Qt 4.x.
Change-Id: Ib4302b394f4ac7b966d0146267651b9c3860c62b
Reviewed-on: http://codereview.qt-project.org/5262
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Re-add the support for drag pixmaps to qdnd.
Use the new WindowTransparentForMouseEvents
flag for the window that shows the drag pixmap.
Change-Id: I4b594085c161475988b9be0ffdc02c75fcc37f66
Reviewed-on: http://codereview.qt-project.org/5261
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Add a flag for output only windows that are
transparent for mouse events and implement it
for the xcb backend.
Change-Id: I24afdb6b27de34bcdf0c061a5a4987ac2880e4ae
Reviewed-on: http://codereview.qt-project.org/5260
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
We need to create the XWindow here to
avoid crashes, when resizing the backing store
before creating the window.
Change-Id: Ib8d9efca3552e5a91f5f63a9262449080ae301e5
Reviewed-on: http://codereview.qt-project.org/5259
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
When the platform window is created, it is the
authorative source for geometry information.
It would however be better if we could completely
avoid duplicated places for the geometry data.
Change-Id: Id90b24b9c40acb57f3d11b8b927292c06bac335e
Reviewed-on: http://codereview.qt-project.org/5258
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Also use QList::at instead of operator[].
Fixes: QTBUG-21403
Reviewed-by: Gabi
(cherry picked from commit 6997b836f445908cf53c1c96a69e3eb7ba535706)
Change-Id: I5d9de189e931b2b55fbd7baab0baad94adae352b
Reviewed-on: http://codereview.qt-project.org/4782
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
Commit 37d76a6798
made testlib depend on gui and widgets. It shouldn't.
Changing the includes was enough.
It's the application (e.g. autotest) that uses the
gui/widgets features that should link against gui/widgets.
Change-Id: If80d30a7eca2cac78cb5c6e5d29c82a06fb9f1dd
Reviewed-on: http://codereview.qt-project.org/5095
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jo Asplin <jo.asplin@nokia.com>
Reviewed-by: Matthew Cattell <matthew.cattell@nokia.com>
There's api in testlib that should only be available
if the application links against widgets.
Change-Id: I22e382c6710690866ed8ffed81bae27b548dc830
Reviewed-on: http://codereview.qt-project.org/5094
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jo Asplin <jo.asplin@nokia.com>
Reviewed-by: Matthew Cattell <matthew.cattell@nokia.com>
The multiexec test runs the same test object five times. If the -o
option is given, the output file is overwritten by each run of the test
object, meaning that tst_selftest only sees 1/5 of the test output in a
file compared with what it sees on the console. This makes it
impossible to use the expected output file to verify the test for both
console and file output. This issue is noted in QTBUG-21561.
Change-Id: I00031a2ea43a7ef78e8317473a089306ec062d8e
Reviewed-on: http://codereview.qt-project.org/5270
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
The warnings selftest verifies that qtestlib correctly handles output
sent via qDebug() and friends. The test had a number of printf calls
that were used to tell the user what output they should expect to see
next, but by bypassing testlib's logging, these made the testlog differ
depending on whether the test log was directed to the console or a file.
The printf calls are no longer needed, as any regressions in qDebug will
be detected by tst_selftests, which compares the output of the warnings
test with a reference copy of the expected output.
Change-Id: I8c3a3237463141fa494c50ca02062760cb583090
Reviewed-on: http://codereview.qt-project.org/5200
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
This is in preparation of removing testlib's
dependency on QtGui and QtWidgets.
Autotests that need QtWidgets api must
explicitly include it (since the types are no
longer provided by the QtGui master header).
Change-Id: Ifd15f72e2c553fba0c399c921957c4e955bb590d
Reviewed-on: http://codereview.qt-project.org/5191
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jo Asplin <jo.asplin@nokia.com>
Reviewed-by: Matthew Cattell <matthew.cattell@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
As previously with QInputContext, now supporting filterEvent()
interface. Usage only on XCB so far.
Change-Id: I8e5972626552bda32318fe060017d0217bb79a94
Reviewed-on: http://codereview.qt-project.org/5240
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
QtDeclarative doesn't link against QtOpenGL anymore.
This line was implicitly causing the QtWidgets library
to get linked in as well.
Change-Id: I56e6e9db52eec7fc924506bfeb4b7931ea04e616
Reviewed-on: http://codereview.qt-project.org/5204
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
The actual touch point is supposed to be in the center of the rectangle,
and since the rectangle is 1x1 it means we have to subtract 0.5 from x
and y.
Change-Id: Ica4aba26dbe61328c8e7cbdcf8b02c96e2f41a40
Reviewed-on: http://codereview.qt-project.org/5256
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Bjørn Erik Nilsen <bjorn.nilsen@nokia.com>
... and use [NSEvent mouseLocation] as global mouse position rather than
relying on QCursor::pos() (which is buggy at the moment).
Change-Id: Ieb8000089d0d824bed89abd8b2add9e28273f227
Reviewed-on: http://codereview.qt-project.org/5254
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Bjørn Erik Nilsen <bjorn.nilsen@nokia.com>
QTouchEvent::TouchPoint assumes the rect() is in local coordinates,
whereas QWindowSystemInterface::TouchPoint uses screen coordinates.
We must therefore use QWindowSystemInterface::TouchPoint::area as the
screenRect() rather that the rect() and then use the screen coordinate
to calculate the local coordinate by using mapFromGlobal.
Change-Id: If7a52f5668c3938f46bdd38a5ea82b5313d6b626
Reviewed-on: http://codereview.qt-project.org/5253
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Bjørn Erik Nilsen <bjorn.nilsen@nokia.com>
The raster engine and the capabilities were leaked, use the
QScopedPointer to prevent that from happening.
Change-Id: I31ba0117280b48ad942fbb638fb151ccb7b34385
Merge-request: 59
Reviewed-on: http://codereview.qt-project.org/5242
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Use the QScopedPointer to prevent memory leaks, right now
the code appears to be sound but make it more clear that
calling ::setBlittable will destroy the old one.
Change-Id: Idc71add7cfd429ff5b9d0ea9908d9fff1e7ce74d
Merge-request: 59
Reviewed-on: http://codereview.qt-project.org/5243
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Task-number: QTBUG-21162 - Letters get truncated when font size=72 and set to Italic
Reviewed-by: Eskil
(cherry picked from commit cd43d6386de6e66379fa23c1ea4ec06141167c86)
Change-Id: Ic05f775975d5f21e0274e7b2c3a4903d6a4ae41f
Reviewed-on: http://codereview.qt-project.org/5203
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Avoids rounding issues with very large coordinates.
Task-number: QTBUG-21262 - QRasterPaintEngine & QFontEngineFT - fonts corrupted when scrolling to the bottom of long texts
Reviewed-by: Eskil
Signed-off-by: Aleksandar Stojiljkovic <aleksandar.stojiljkovic@nokia.com>
(cherry picked from commit 43e013e2048e8193e2d31276cac6348a9f6ce340)
Change-Id: I5810a1a60f2bbdba4889a6b5e493b183018f3976
Reviewed-on: http://codereview.qt-project.org/5202
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Since FreeType has internal caching, it has had a special
code path in the raster engine which avoided using Qt's glyph
cache, as that would be redundant. However, when compiling
with QPA, we want the same behavior without being able to
access the QFontEngineFT class. To achieve this, I've made
a new abstraction and added it to QFontEngine which allows
the FT engine to provide direct pointers into the alpha maps
stored by FT. This requires a locking/unlocking mechanism.
Yes, the QFontEngine::alphaMap* API is slowly becoming a horrible
mess, but due to time constraints, the task of refactoring these
functions into a more flexible API needs to wait. I've added a
TODO comment for this.
Change-Id: I08237403c2967f8fb952258178676f33a87c0353
Reviewed-on: http://codereview.qt-project.org/5155
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Make the test use qDebug instead of printf, so that the reference test
output is the same regardless of whether the log goes to the console or
a file.
Also rename the test class, as it was evidently cut-n-pasted from the
subtest selftest without being renamed.
Change-Id: I8df1f0989f2e8c33c1f829ba8110fd740ff70f63
Reviewed-on: http://codereview.qt-project.org/5184
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
This test was attempting to verify two completely unrelated things, so
this commit splits it into two tests.
Also, printf calls are replaced by qDebug so that the test does not
bypass the testlib loggers.
Change-Id: I1a202af38ce2c69690a32d93405ba604ec6cabee
Reviewed-on: http://codereview.qt-project.org/5178
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
This test is not useful for finding bugs in qtestlib's logging code,
because it bypasses the qtestlib loggers and doesn't play nice with
tst_selftest. Neither is this test very useful for finding bugs in
QTest::qWait(), as the test only proves the qWait() terminates, not that
it waits accurately, or even that it waits at all.
Change-Id: Ia5dd7cbaf3a6fbb4e94e54ed155263580e495694
Reviewed-on: http://codereview.qt-project.org/5173
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
The problem is that the libQtPlatformSupport.prl file
will otherwise add these as link dependencies, making any
platform plugin link against these.
Change-Id: Ief71726e86990bb44b12cf86e78b844a1a23ae3c
Reviewed-on: http://codereview.qt-project.org/5098
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
QApplication::pickMouseReceiver() does the appropriate mapping if the
receiver changes.
Change-Id: Ieead2dea55e6119fae695af7fa12ab5cb2ef6dac
Reviewed-on: http://codereview.qt-project.org/5148
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Mac only support multitouch points, hence width/height 1. Also add
comment about performance related to multitouch events.
Change-Id: I307261492366e361e17f9edf446f456c07c87a22
Reviewed-on: http://codereview.qt-project.org/5162
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Bjørn Erik Nilsen <bjorn.nilsen@nokia.com>
In 20009ed797 I introduced a new
approach to synthesized oblique. However, while the embolden
function in FT alters the glyph metrics accordingly, the
oblique function does not, so the glyphs would be clipped to the
original, unslanted metrics. So I've implemented the same matrix
in the loadGlyph() function and we now apply this to the metrics
manually. This will only work as long as the underlying algorithm
doesn't change significantly.
Task-number: QTBUG-21202
Change-Id: Ic20b2a0fdeac5ce833e95fd06efa12b3b70feee5
Reviewed-on: http://codereview.qt-project.org/5156
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>