The former applies both on Mac OS X and iOS, but 'macx' is specific to
Mac OS X.
ios.conf and macx.conf now share most of their settings in the common
mac.conf. We set the default QMAKE_MAC_SDK before loading mac.conf, so
that any overrides in the device config will apply afterwards. This
means configure's mkspec parsing will be able to read the QMAKE_MAC_SDK.
Change-Id: I0c7e26a6a0103e19b23ef152aa9e4ab461cee632
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
This avoids crashes accessing deleted memory when creating a QObject
after the last QObject had been deleted, like a qDebug() in global
destructors.
==41000== Invalid read of size 4
==41000== at 0x5F01ED5: bool QBasicAtomicOps<4>::ref<int>(int&) (qatomic_x86.h:208)
==41000== by 0x5F01309: QBasicAtomicInteger<int>::ref() (qbasicatomic.h:147)
==41000== by 0x5F24051: QThreadData::ref() (qthread.cpp:100)
==41000== by 0x614A984: QObject::QObject(QObject*) (qobject.cpp:681)
==41000== Address 0x6ee73f0 is 0 bytes inside a block of size 152 free'd
==41000== at 0x4A0736C: operator delete(void*) (vg_replace_malloc.c:480)
==41000== by 0x5F240BF: QThreadData::deref() (qthread.cpp:109)
==41000== by 0x6113F6B: QCoreApplicationData::~QCoreApplicationData() (qcoreapplication.cpp:268)
The comment right above the change in qthread.cpp looks eerily similar
to the problem I'm trying to fix. However, the actual change that
introduced the change is not in the Qt public history, so we can't
know for sure what the problem was then.
Change-Id: I0dba895b041fe6cf81e6f8939ca85035cd00aad1
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This fixes QMetaType detection of const reference arguments in signals
while connecting using the new syntax and Qt::QueuedConnection
const references should have the same QMetaType as non references.
That means we need to remove the const reference while getting the
QMetaType.
Change-Id: I9b2688da7fb9ae985aec0d8fa62a1165357ffe71
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
This is possible with QWeakPointer, so allow it for migrating
code too.
In the process, replace the QPointerBase with a member variable for
simplicity. The functionality of the QPointerBase is replaced
by a TypeSelector template.
Change-Id: I3b4c77bdeda2b863cc33e84a3da8a25bae928c8c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
VxWorks does not have QProcess support.
Change-Id: I917b769f967e9d71ec5025aae788f3e237b07aeb
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
(cherry picked from commit 416e73a0fc)
Unlike the previous implementation, this implementation is locked:
only one initialisation is ever run at the same time. It is
exception-safe, meaning that a throwing constructor will restart the
process.
Also, start using the thread-safe behaviour that GCC has offered for a
long time and C++11 requires.
Change-Id: I20db44f57d258923df64c0051358fd0d9a5ccd51
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: David Faure (KDE) <faure@kde.org>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Drop the read and write permissions for group and other users in the
system.
Change-Id: I8fc753f09126651af3fb82df3049050f0b14e876
Reviewed-by: Richard J. Moore <rich@kde.org>
This test runs fine almost all of the time on systems with 1
processor, which were the norm when the test was written and are still
the way that the Qt Continuous Integration system works as of
today. But it falls flatly on multi-processor systems.
The root of the problem is that QSystemSemaphore recreates the
semaphore if it disappears underneath it. However, the recreation
process is not thread-safe at all: if two threads race to recreate it,
weird things might happen. strace on Linux shows that a thread got
stuck trying to acquire the semaphore:
<... nanosleep resumed> NULL) = 0
stat("/tmp/qipc_systemsem_market5c9f73af73334ffe350c60ec076e5744db0ecda3", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
stat("/tmp/qipc_systemsem_market5c9f73af73334ffe350c60ec076e5744db0ecda3", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
semget(0x51001388, 1, IPC_CREAT|IPC_EXCL|0600) = -1 EEXIST (File exists)
semget(0x51001388, 1, IPC_CREAT|0600) = 114786308
semop(114786308, {{0, -1, SEM_UNDO}}, 1 <unfinished ...>
This problem does not happen if the creation and destruction of the
QSharedMemory (which uses QSystemSemaphore) does not race with other
threads or processes attaching and detaching. For the threads test
it's easy. For the processes, we use stdin and stdout as a
communication channel.
Change-Id: Ie11b135431d4abfc59234654848b67f622eb03c9
Reviewed-by: Richard J. Moore <rich@kde.org>
These types are either built-in or 'automatically declared' and so
don't need to be explicitly declared as metatypes.
Change-Id: I54523eb854619917123d8816d3cd6c3a1f5b4c55
Reviewed-by: David Faure <david.faure@kdab.com>
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>
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>
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>
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>
When compiling qmetatype auto tests with msvc2008 64-bit, I receive:
qmetatype.h(383) : fatal error C1128: number of sections exceeded
object file format limit : compile with /bigobj
This patch follows that advice and adds /bigobj to QMAKE_CXXFLAGS.
Change-Id: I05b3cf9dfdb6a93649c692e2df22365d200e6f2f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Macros should call QSKIP instead of creating a semi-empty function body.
Change-Id: I389701f618fe9bf0a40aa26f161620389a80e407
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
As the script dependency for that autotest is not really needed it should
be moved to qtbase.
Task-number: QTBUG-27706
Change-Id: Ieda8b2182a20a77f53a0be9878e82e3236c79c2b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
As CI runs autotests using the "check" target the approach using
DESTDIR = ../ does not work for the test. Instead the binaries are just
moved one directory up and QFINDTESTDATA is used to find the path of the
helper binary.
Change-Id: If1ed2b60821f1de4ac62f238c8af5e09cf0f444a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Before, the functor slot (or lambda expression) had to have the same amount
of arguments as the signal.
This shown to be a big problem to be able to connect to signals that had
a QPrivateSlot.
This implementation use the type of the operator() of the functor to
know how many arguments we have.
As a bonus, we also can check the arguments in a static assert.
The test comes from https://codereview.qt-project.org/#change,38703
But this patch also works without variadic template
If the compiler does not support decltype, we workaround the lack of it
by using another level of indirection.
Change-Id: I9850b43e8caf77356a2ec3f4c0b0ed532d96029e
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Pointer to const member function have a different signature, and hence
need their own traits code.
Change-Id: Ie4b2434a412f412444fb07ef1388a37cab105ecd
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
As the script dependency for that autotest is not really needed it should
be moved to qtbase.
Task-number: QTBUG-27705
Change-Id: I4ce0d34aca97cadd79b157b0f7c90c406bed4295
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
There are more opportunities in QtCore and the rest of Qt to make signals
private instead of public. This is a test-dart to see if there is any
reason not to do this.
It would be nice to make QObject::destroyed private, but as it has a
default argument it would be source incompatible to anyone connecting
to the SIGNAL(destroyed()) instead of SIGNAL(destroyed(QObject*)).
Currently the function-pointer-based connect syntax does not accept
a functor (or lambda) with a different number of arguments than the
signal. Olivier says a fix for that might come in 5.1, but for now
the qfiledialog2 test is changed to not use that anymore.
Also, the function pointer for a private signal can not be assigned to
a local variable, so the qmetamethod test is changed to not do so
anymore.
Change-Id: Iaf776b822f9ba364f2c184df0c6b23811da56e44
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Normalise all signal/slot signatures in tests/*/corelib,
except in tst_QObject, where they might be test data.
Change-Id: Id4e101f285b1676bb583b0afae06d235e599e24b
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Instead omit the whole test when Q_OS_UNIX is not defined.
Change-Id: If0ee3345c25f6b1baa38845edfd08ec26a45d6f2
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Instead omit the whole test when Q_OS_WIN is defined since
the test is invalid on this platform.
Change-Id: Idb77df96b0c2a223cddbfffb4e24c6d1f5d33dfb
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Change copyrights and license headers from Nokia to Digia
Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
The TRUE and FALSE macros are obsolete and should be replaced with
true and false (all lower case) respectively.
Change-Id: Iee352e8173500683e6319be0abbf5bacf29016e0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This fills the gap left by QWidgetStar, making the sequence
between FirstCoreType and LastCoreType contiguous, which some
benchmarks assume to be true anyway.
Change-Id: I2d5d202b6246a9065fdf77f325a4a04279dbe4b7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This allows us to remove the odd hacks to get the static metaobject
for the QWidget* metatype.
The QWidget* is still an automatic metatype thanks to the QObject
partial template specialization. It is registered as a metatype
at runtime automatically in qwidgetsvariant.cpp.
Change-Id: Ie01b69eadf2cbe87af1a86c3284550f60dcf9e94
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Qt 5.0 beta requires changing the default to the 5.0 API, disabling
the deprecated code. However, tests should test (and often do) the
compatibility API too, so turn it back on.
Task-number: QTBUG-25053
Change-Id: I8129c3ef3cb58541c95a32d083850d9e7f768927
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This test was using some QSpinBox instances to generate signals for
testing. Use our own QtTestObject to generate the signals instead.
Change-Id: I3714955ae040d541c3b613a478945c38a18be18d
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
When containing a QObject (or sub-class) pointer and trying to convert
to a QObject pointer canConvert() did dereference the pointer without
checking for it being null.
Change-Id: Ie274e54f2f817f2b6c5df64504f8af6359b8f38d
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>