The overload is used in Qt Creator
(see src/libs/extensionsystem/pluginmanager.cpp).
The use case here is an application whose internal
QObjects can be tested by passing a command line parameter.
For this use case, it is inconvenient to have to allocate
memory and create a char argv[]- array.
This reverts commit ad80d42f8e.
Change-Id: I2a2f91e2840100fd62743f6d03b33005d67b18f8
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
This option does nothing -- the only function that checks if the option
has been set is never called. This appears to have been the case ever
since testlib was imported into the Qt repository in October 2005.
Change-Id: I837aa957e2d8bd47c3d1c551f1b94d4374daa25e
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
After the previous commit, QTest::qt_snprintf() is equivalent to
qsnprintf(), so just use that instead.
Change-Id: I89ad6e3749ba5efb1926b0b618a904e8baca9f52
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Remove the part of the definition that applies to gcc versions <= 2.x
as these versions are not supported by Qt5.
Change-Id: Icee6b51ffe78fa30fd7193ef96b6ce0484b8fcae
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Previously, unprintable characters were filtered out of test output
while the output strings were being formatted by either qt_snprintf() or
qt_asprintf(). Any strings not formatted by one of those functions
weren't filtered at all, and any strings passed more than once would be
filtered more than once.
This commit separates the filtering of output strings from their
formatting, leaving the filtering until just before the strings are
written to the output stream. For now, the filtering is done by a
protected method of QAbstractTestLogger, but this could easily be
changed to a virtual method in future to allow different filtering
for loggers with different output character sets.
Change-Id: Ia4bb49cd10d37c84af75d2cf58325d27f0e16d99
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
QWeakPointer is superior and preferred.
Remove QMetaObject::addGuard(), QMetaObject::changeGuard(),
QMetaObject::removeGuard(), and QObjectPrivate::clearGuards().
Implement QPointer using QWeakPointer<T> instead. This changes the
behavior of QPointer in 2 ways:
- During destruction of a QWidget. Previously, the destructor of QWidget
would reset all QPointers so that they would return zero when destroying
children. Update tst_QPointer to account for this change.
- When constructing a QSharedPointer to take ownership of an object
after a QPointer is already tracking the object. Previously, the shared
pointer construction would not be affected by the QPointer, but now
that QPointer is implemented using QWeakPoiner, constructing the
QSharedPointer will cause an abort(). Fix tst_QSharedPointer by
removing the use of QPointer in the objectCast() test.
These behavior changes are documented in the QPointer class
documentation and in the changes file.
Change-Id: I92d0276219c076ece7bcb60f6e1b9120ce4f5747
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
The union in QObjectPrivate of declarativeData and
currentChildBeingDeleted shouldn't use wasDeleted to determining the
meaning of the unioned pointer. Instead, add
QObjectData::isDeletingChildren, set that in
QObjectPrivate::deleteChildren(), and only use the
currentChildBeingDeleted member when the parent's isDeletingChildren is
set.
This solves aborts seen in autotests when widgets are deleting window
children. The abort comes from QWeakPointer on the parent in the child's
close event handler (the abort checks that wasDeleted is not set).
Change-Id: I1a58449159d4a5312aad8ba12e559d05d6c43d93
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
The name of an enum was slightly misspelled in the API docs, so lets
make sure its now copy-paste friendly.
Change-Id: I5da5230ab29743b63bf238a379891c98ac9d5039
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Thomas Zander <zander@kde.org>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QWidget *widget() is replaced with QObject *target().
Change-Id: Ib2c860480764410cf1527662e89f352ff688b32a
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Requiring platform and generic plug-ins to pass TouchBegin,
TouchUpdate, or TouchEnd is unnecessary. The type can be easily
deduced from the touch point states. In fact handleTouchEvent already
collected the combined point states, it was just not utilized until
now.
Change-Id: Icf3c787fefdebc51609a763bc4286c18a0b6aac2
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
QPlatformCursor::pos() is a const function, the reimplementation should
be as well.
Change-Id: I7e37e41086e3b329dc31ebc060fcb0915771d884
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
- Check path/fileName is empty upon failure, variable was unused
- Use /home instead of /, as / is writable by admins on Mac
Change-Id: I705471fda8b73843e98b30eb52aa0a73634ec075
Reviewed-by: David Faure <faure@kde.org>
The capability flags indicate which information is valid in the touch
points. Previously there was no way to tell if e.g. the value returned
by pressure() is actually the value provided by the driver/device or
it is just something bogus due to pressure not being supported.
The points' flags return information about the individual touch
points. One use case is to differentiate between touches made by
finger and pen.
Velocity, if available, is now also exposed.
Each touch point can now contain an additional list of "raw"
positions. These points are not reported individually but are taken
into account in some way by the underlying device and drivers to
generate the final, "accurate" touch point. In case the underlying
drivers expose these additional positions, they are made available in
the lists returned by the touch points' rawScreenPosition().
The raw positions are only available in screen coordinates to prevent
wasting time with mapping from global positions in applications that
do not use this data. Instead, apps can query the QWindow to which the
touch event was sent via QTouchEvent::window() and can call
mapFromGlobal() manually if they need local raw positions.
The capability and device type information is now held in a new
QTouchDevice class. Each touch event will contain only a pointer to
one of the global QTouchDevice instances. On top of type and
capability, the new class also contains a name which can be used to
differentiate between multiple touch input devices (i.e. to tell from
which one a given QTouchEvent originates from).
The introduction of QTouchDevice has three implications: The
QTouchEvent constructor and QWindowSystemInterface::handleTouchEvent
need to be changed (to pass a QTouchDevice pointer instead of merely a
device type value), and each platform or generic plug-in is now
responsible for registering one or more devices using the new API
QWindowSystemInterface::registerTouchDevice.
Change-Id: Ic1468d3e43933d8b5691d75aa67c43e1bc7ffe3e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
QMessageBox was being used to test nested event loops. This has been
changed to use QEventLoop directly.
Also, there was an unnecessary use of QPushButton to trigger a test
case, which has been removed.
As a result, 3 test cases can be run on VXWORKS, and one more test case
on Windows that were previously skipped.
Change-Id: Ic65ed441cd37d242f89df3ef3b8638a1458d9cf3
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
tst_QTcpSocket::disconnectWhileLookingUp required the host lookup +
connect + disconnect procedure to complete in <50ms, which is not always
true.
When disconnecting (rather than aborting with close()), wait for the
disconnection to complete with a timeout of 5 seconds.
Task-number: QTBUG-21043
Change-Id: I3b59abf9a8eb2c6d99416e1a8ec6b528885b656e
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
The executable needs to be in the test directory
as it expects it sub-executables from there.
Breakage introduced by 3385fb91e1
Change-Id: Ic1f3db70851f65e2f12041c3a16cb8f0b7bdf35e
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
No need to crash here, just warn.
This will happen when asking a table for out of range indexes.
Change-Id: Ida83604bd587390a3b54fbed68f98dab8038c757
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Commit a72468e820c2922540737c053eef27d033c2e77b split the test into two
functions, but kept them combined in a single slot for QTest to invoke.
That being the case, we might as well have them as test functions of
their own right. Should work nicer with test failures, skips and such.
Change-Id: I62c1fc7777c08b3e87a5903632d73dc1e1d97e1a
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
- QPixmap::to/fromWinHICON/BITMAP() became free internal
functions (see b8d330904b)
- Improve QImage check function similar to
11732d133b
Change-Id: I80ff066964ce6c339a6b9bfa5a0e10421dca162a
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
- Use correct overload for QTranslator::translate()
- Fix LTR source text
- Use QDir::TempDir correctly (check for slash).
- Do not copy executable on Windows (which is locked), use
arbitrary data instead.
- Use Q_OS_MAC
Task-number: QTBUG-21402
Change-Id: I6ba1c7c764d4c847278eaff9a96c8cd312ac204d
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
In case a subprocess fails to start.
Change-Id: I1372c07de8f3580a8e7aadd6874da15bf273ac53
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Failing tests are marked with CONFIG+=insignificant_test.
tst_QTextLayout currently asserts, so it has been disabled to prevent
destabilization of the CI system.
Change-Id: I7bd836ee14085689c8a0f0ce8e3c80d81a55eb94
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
The last reference to this file was removed in commit a2337f79.
With the new QPA architecture there is no longer a reason why this
should be needed in qtbase.
Change-Id: I84765eca066fd6bdd1dabac32e866c58a39fe183
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
setSocketDescriptor fails because socket is in the wrong state.
This is timing dependent, if qt-test-server is still in the DNS cache
then the test failed.
- clear the DNS cache to avoid the host lookup state being skipped.
Change-Id: If159d514b1aa9b62a4834f6352d5e7b0a00a5724
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
Target names with spaces must be quoted.
Change-Id: I913ef386353fc75991c8db4e3205ab511fc1f1a9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
To follow the comments in the review by João Abecasis.
Change-Id: Ie566705d3b4071b8628d269246aadcde4866f34f
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Symbian-specific code was removed as a side effect of the merge.
Change-Id: I01d28b2aa2fef16ce3988382c2b2a0436c46227c
Reviewed-by: John Brooks <john.brooks@dereferenced.net>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
mkdtemp(10*X) replaces all 10 chars on Mac, while on linux it only
replaces the last 6. Adjusted the too-strict tests to allow for
both possibilities.
Change-Id: Ie6d57bd4947254ad7a39e75ac0e8881cebeaa428
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
This one was far to long lived and would delay
releases until application shutdown.
We might get more "no autoreleasepool in place"
warnings now, these should be fixed by adding local
auto release pools.
Change-Id: Ia7a46ab05fb1937154997d0c47b8899d2a0cef65
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@nokia.com>
- Do not run with empty environment. At least PATH
is required at least (Qt + MSVC/MinGW runtime)
- Account for MSVC's different formatting of double numbers.
Change-Id: Ic7b1cf4a16a88c5384347b2651b011ac13c92d70
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
This is needed in order to expose the enums to qml.
Do not inherit QAccessible.
Change-Id: I220a0ea3add2d790e4fa6e93ce3deda762859e1a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Some people like to build their Qt-based projects with -Wshadow
-Werror, and since qobject_impl.h is included from a public Qt
header, their build breaks.
Change-Id: I5d8a5ee1937092149a18c0ff66a723f5bfc9ffc3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The overload of QTest::qExec() that takes a QStringList is not used
anywhere in Qt's autotests, despite having been in the qtestlib API
since Qt 4.4.
This lack of use most likely derives from the fact that none of the
QTEST_MAIN macros use the overload, and more than 99% of Qt's tests
use those macros to avoid explicitly calling QTest::qExec().
Change-Id: I264b21d7fe1a9f2d565f748cf8bbe32414a73bb0
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
This malloc-replacement library is marked experimental and disabled by
default. It is also Unix-only.
On linux (GNU C library, actually) ptmalloc graduated to become the
native allocator, according to its webpage (http://www.malloc.de/en/),
making the need to have a copy here significantly lower.
Anyway, there is nothing preventing interested parties from adding this
library to their own setup and very little value in keeping it around in
qtbase.
Change-Id: I2b1c798ca38b59bb767b44d6e5190080ec6ecdf4
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
reduce-relocations will enable the -bsymbolic-functions
linker option when supported by the linker. This
reduces the amount of relocations required within
a shared library, by binding symbols locally where
possible.
Change-Id: I00ddc408df79097857d6b36f7fc1b0f510362fcc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>