Change the data type of PI from qreal to double, because qreal is defined as float and not as double on arm.
The testcase however expects PI to be a double value.
Change-Id: I003481071ecb2c1f54e6dcee9b450da2f1654969
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Laszlo Papp <lpapp@kde.org>
While adding a test case for the new behavior, two issues
with the connectSlotsByName implementation came up:
1. for auto-connected slots that don't exactly match a signal,
a 'compatible' one is searched. There might be more than
one of those. The implementation randomly picks any.
2. The "No matching signal for %s" warning gets printed even for
slots that can never be connected via connectSlotsMyName
anyway (e.g. "on_something"). This is inconsistent.
This fixed both: an explicit warning is printed if more than one
'compatible' signal is found and the "No matching signal for %s"
warning is only printed if the slot adheres to the full
"on_child_signal()" naming convention.
In the process I added comments and changed the code slightly to
make it more readable and explicitly hint at non-obvious behavior.
Change-Id: Icc8e3b9936188d2da8dfff9f0373c8e5c776eb14
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
The problem was that the elapsed timer was not restarted,
causing the currentTime() not being adjusted for the time
it was paused.
Task-number: QTBUG-30108
Change-Id: Ib9b2c5a0dea52762109e0b25f1068dd7c88e15ba
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
tst_QSharedMemory::simpleProcessProducerConsumer is on the top list of
unstable autotests. Disabling it for now.
Task-number: QTBUG-25655
Change-Id: Ib297b3382b736794bab6cdb668103bef74a55d8c
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
We do not currently have shared memory or system semaphore support
on Android.
Change-Id: I8e8f3fc6ff8d6de0333002c3e1b31cf070416dbd
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Android is not a proper Linux, and in particular it does not have
pthread_yield().
Change-Id: Ibf94cfacdc24d0c3baaef002c64f9f50c72c01d2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
This broke the build on Android where fileno returns a short.
Change-Id: Ic8d32380078faeedcd22e785a912fede28251156
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
QMetaObject::connectSlotsByName(QObject* o) creates a list of all
children to look for signals that match slots of o. This changeset
simply adds the object o itself to that list.
The motivation is to finally fix the long standing QtCreator bug
QTCREATORBUG-6494. Where executing 'Go to slot...' and choosing
'accepted()' for a simple QDialog named 'MyDialog' will add a
on_MyDialog_accepted() slot to MyDialog. That slot never gets
connected. More details may be found in the linked QTBUG-7595.
Task-number: QTBUG-7595
Task-number: QTCREATORBUG-6494
Change-Id: I35f52761791af697eabb569adb5faee6fae50638
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
In case somebody uses QVector as a stack, it is not fair to have
takeLast, removeLast and pop_back to do way too much work.
This is still very slow compared to std::vector::pop_back
(mostly due implicit sharing), however it is more than a
factor faster than before.
Change-Id: I636872675e80c8ca0c8ebc94b04f587a2dcd6d8d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This patch adds takeFirst and takeLast which are functions
that QList also has.
Change-Id: I761f90b529774edc8fa96e07c6fcf76226123b20
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This patch adds the functions removeFirst() and removeLast().
Functions that QList has.
Beside making these functions, pop_back and pop_front are
redirected to these rather than calling erase.
Change-Id: Ifc5f8a78e33f436f06f21095a920ec5d4311fd6f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
I changed the existing test-case code to make it more scalable
in terms of adding more connectSlotsByName related tests. The
old "manual list of ints"-method was really not developer friendly.
This is a preparation for a subsequent modification of
connectSlotsByName behavior.
Change-Id: Ib760e52631ce4b5ae2a3ebdb4854849ff6c93bfe
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This provides a fast multiInsert in QMap (and a fast insert in
QMultiMap) when providing a correct hint.
Change-Id: I3c864c3a7842765fe63f8ecb4b54d0e8c9fd22d7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This adds a fast insert on QMap when providing a correct hint.
Change-Id: I256bba342932c1d4f24c6e65074e1bf47b519537
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
QSharedMemory and QSystemSemaphore are not available on QNX so the autotests can not be built.
Change-Id: Ibfb405f951d21342d64bf215cedc203a8cefe070
Reviewed-by: Wolfgang Bremer <wbremer@rim.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
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>
Add setProgram() and setArguments() methods to the QProcess api.
Add a convenient start(QIODevice::OpenMode) method.
Move the implementation of QProcess::start() to QProcess::open()
unifying the QProcess api with other QIODevice subclasses.
Change-Id: Id1af57da05f750fe8d526d391589c05ee8037bca
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Locking between processes, implemented with open(O_EXCL) on Unix
and CreateFile(CREATE_NEW) on Windows.
Supports detecting stale lock files and deleting them.
Advisory locking is used to prevent deletion of files that are still in use.
Change-Id: Id00ee2a4e77a29483d869037c7047c59cb909339
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Most notably, .com and .net now may contain non-ASCII characters.
list has been generated from
http://www.mozilla.org/projects/security/tld-idn-policy-list.html
Change-Id: Idc3191dc782bc4173ccb19b4bc81f4f061ca7999
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The problem was that the HolderBase destructor was getting called after
the contained type's constructor threw an exception, as is required by
RAII semantics (the base was fully initialized, so it had to be
destroyed). That was required because we want to return a non-null
pointer from operator() during destruction and return null after
destruction, to keep compatibility with Qt 4.
The solution is to only set the guard to Destroyed only if it is already
at value Initialized. This way, if the HolderBase destructor is run as
part of the stack unwinding, it knows that the construction did not
complete.
Change-Id: I9849b43ed7112bf9e70861b48a56a924c286617e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
The motivation is to enable coloration the way KDE currently does.
It can now be achieved with a QT_MESSAGE_OUTPUT set to
"%{appname}(%{category}) \033[31m%{if-debug}\033[34m%{endif}%{function}\033[0m: %{message}"
I was thinking about supporting directly color using something like
%{begin-category-color} that would be smart and detect if we are running
on a terminal, but it would be less flexible in the way the colors van
be configured.
Changelog: QT_MESSAGE_OUTPUT can contain conditionals based on the type
of the message
Change-Id: Icd8de04734a94a3afcbf542a5b78b290a1914960
Reviewed-by: David Faure (KDE) <faure@kde.org>
For systems where the Unix signature checker isn't enabled (read: Mac
and Windows), QPluginLoader must actually load the plugin to query for
the metadata. On Mac it even tried to keep the library loaded to avoid
unloading and reloading again when the user calls load().
However, that plus the fact that it was calling load_sys() (on Mac)
meant that it would bypass the reference count checking. And on all
Unix, if a library-that-wasnt-a-plugin was already loaded by way of a
QLibrary, it would have an effect of unloading said library.
So remove the "caching" of the library. We should instead invest time to
write a proper Mach-O binary decoder.
Task-number: QTBUG-29776
Change-Id: Iebbddabe60047aafedeced21f26a170f59656757
Reviewed-by: Liang Qi <liang.qi@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
This fixes the compilation of the qfile autotest on qnx.
Change-Id: Iab099e8b754a4341152e338ff6e3d22a83c625e3
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Added the following functions to QStringRef: toShort, toUShort, toInt,
toUInt, toLong, toULong, toLongLong, toULongLong, toFloat, and toDouble.
These functions use the corresponding functions found in QLocale.
Updated tst_qstringref.cpp to exercise the new functionality.
Change-Id: I38668a0cc7da0c101a62613fd16cb5a98286617f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.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>
The patch adds handling for a case when a QVector is shared between two
threads. In such scenario detaching in one thread could collide with
destruction in the other one, causing a memory leak or assert in debug
mode.
Task-number: QTBUG-29134
Change-Id: Idbff250d9cfc6cf83174954ea91dbf41f8ea4aa4
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
No users/file permissions. Open function in VxWorks DKM
requires always three parameters.
Change-Id: I93fb075d82aa57e210e224bfe4ede40def82c275
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>