The main problem with using QWeakPointer to track QObjects is that it
has API to convert to QSharedPointer, which is undefined behavior. There
is no need to overload the meaning of QWeakPointer with QObject
tracking.
QPointer is more suitable and should be used instead. Because QPointer
is implemented in terms of QWeakPointer, we need to add some overloads
which are not deprecated.
Change-Id: If0333e4800c9fd277629cc69185c9ca3e4e7e81d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This way the target will be created and have its properties
populated only one time.
I tried wrapping the whole file in an 'include guard', but that
broke the unit test in tests/auto/cmake/pass1 (and
the qt5_use_module function), because the function causes the
variables in the Config file to not exist outside of the
scope (eg for include directories), and yet, Qt5${Module}_FOUND is
still true even when the find_package was previously called in a
function, so it is not found and processed again.
The change in Qt5CoreConfigExtras.cmake does not need to be guarded
as it is only ever included from Qt5CoreConfig.
Change-Id: Iaa016563db5eb61294360ac9e003c9c923393d8c
Reviewed-by: Brad King <brad.king@kitware.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Avoid painting bugs in case the DC covers only a part of the
window and QBackingStore does a full flush.
Task-number: QTBUG-26039
Change-Id: Ic918d9898ac824690273ac59bcb1e7e546cc698a
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This fixes breakage in the Raspberry Pi spec introduced in:
https://codereview.qt-project.org/#change,27536
due to incorrect depth assumptions regarding included files.
Change-Id: I802b828f1755f299939fed192dd3ca9bf1a83002
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Change-Id: Ibe7cb1ca9cdcedd3f09dd4f865907e3f0fa6aef3
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Change-Id: Idfe4a5bd9c9638a1f9ae52a7b1def3f869286587
Reviewed-by: Kevin Ottens <kevin.ottens.qnx@kdab.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
With Happy Eyeballs we will connect one IPv4 and one IPv6 channel and
pick the network layer depending on which connects first. When the
first channel is connected we can close the other one.
Before this we let the other connection finish connecting and then
closed it. This will close the other one as soon as the first one
is connected.
Change-Id: Ib2ab3f949704fd39dc0584bd31b9bcaf75ce35f7
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Suggested by Oswald Buddenhagen. This function is about the (main)
UI language, not about other locale features like number formatting etc.
It not in the public API anymore in Qt 5.0 so it can be renamed.
Change-Id: I2a23892c67e5813de4c0e57330749568777e9ee6
Reviewed-by: Oswald Buddenhagen
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Because QSystemLocale::fallbackLocale() is about UI languages,
it makes sense to check LANGUAGE as well if appropriate.
Adapt tst_qlocale.cpp accordingly.
Suggested by Oswald Buddenhagen.
Change-Id: Ib2c9674081809e3251be4e34456b05210eebc010
Reviewed-by: Oswald Buddenhagen
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
commit b9790a04ee
(https://codereview.qt-project.org/24304) introduced the problem that
the country gets initialized from LC_NUMERIC and the language from
LC_MESSAGES. For example, if LC_NUMERIC=ru_RU and LC_MESSAGE=fr_FR,
then QLocale::system().name() returns "fr_RU". It is not nice to mix
the values of two LC_ variables there. Therefore, revert this change
and use LC_MESSAGES instead of LC_NUMERIC in
QSystemLocale::fallbackLocale(). This was also suggested in the
changelog of b9790a04 and it looks like a better way to fix the
problem.
Change-Id: I8fa6fec2b33e9f1f5a31c4b288503a658dad6d30
Reviewed-by: Denis Dzyubenko
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Even though they target embedded devices, the touch and tablet plugins
are very often used on desktop, under X, for development and
experimenting. However the X.org drivers like to grab the input
devices, resulting in getting no events when reading
directly. Inspired by evtest, we show a warning from now on in this
case so the user has a clue what's going on.
Change-Id: I19474f1fcc5163f2601e7000aaee0cce54f99367
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
postDelayedEvent() and cancelDelayedEvent() are marked as thread-safe
in the documentation. Unfortunately, they didn't actually work when
called from another thread; they just produced some warnings:
QObject::startTimer: timers cannot be started from another thread
QObject::killTimer: timers cannot be stopped from another thread
As the warnings indicate, the issue was that postDelayedEvent()
(cancelDelayedEvent()) unconditionally called QObject::startTimer()
(stopTimer()), i.e. without considering which thread the function
was called from.
If the function is called from a different thread, the actual
starting/stopping of the associated timer is now done from the
correct thread, by asynchronously calling a private slot on the
state machine.
This also means that the raw timer id can no longer be used as the
id of the delayed event, since a valid event id must be returned
before the timer has started. The state machine now manages those
ids itself (using a QFreeList, just like startTimer() and
killTimer() do), and also keeps a mapping from timer id to event
id once the timer has been started. This is inherently more complex
than before, but at least the API should work as advertised/intended
now.
Task-number: QTBUG-17975
Change-Id: I3a866d01dca23174c8841112af50b87141df0943
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Instead of virtual functions which would have broken binary
compatibility, virtual_hook() was used to implement the virtual
functionality. Now, since the step to Qt 5.0 allows breaking
binary compatibility, we take the opporunity to simplify the code
using real virtual functions.
SetNumericalPrecision --> setNumericalPrecisionPolicy()
NextResult --> nextResult()
DetachFromResultSet --> detachFromResultSet()
BatchOperation --> execBatch()
Task-number: QTBUG-25252
Change-Id: Idd3a870f876d8b8a7457559d5f31ec2073786a75
Reviewed-by: Bill King <bill.king@nokia.com>
Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
tst_QWindow::positioning() still fails on Mac OS X, and it does so in
several places. Skip this test for now as it causes isActive() to fail
as well. With positioning() QSKIP()ed, all the other test functions
pass:
Totals: 19 passed, 0 failed, 1 skipped
********* Finished testing of tst_QWindow *********
Task-number: QTBUG-23059
Change-Id: I58d036120c0121f515813cd20955ab3b82f81fe1
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Commit 2a1b50d67c introduced a dependency
on evdev for eglfs which QNX does not provide. QNX also has a dedicated
QPA plugin so the eglfs plugin is not needed there.
It is not possible to use the -device configure defaults approach as
it is not cross-platform.
Change-Id: I2d151f16cf1a9576a0b0b528f0e9c17834c66e91
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
When switching the active window within the same application, Cocoa
sends us an NSWindowDidResignKeyNotification for the old activated
window, then an NSWindowDidBecomeKeyNotificationfor the newly activated
window. Our handling of this would first set Qt's active window to zero,
then immediately reset it afterwards. Avoid this by checking the key
window when handling the deactivation event, and don't set the active
window to zero if a new window has become active.
Task-number: QTBUG-24322
Change-Id: I8719fc501049eeaaebb75e9ea03261b2209458b6
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
It might be too expensive to always have an accelerometer sensor
running, so introduce API so that the application has to explictly ask
to get the orientation updates it's interested in.
Change-Id: Ib7dc5ad8807718409f744ebef53f4476aa05175d
Reviewed-by: Ian Monroe <ian.monroe@nokia.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Reviewed-by: Kevin Ottens <kevin.ottens.qnx@kdab.com>
The call to displayRect works on 10.7 but does not
update the pixels on screen on 10.8. Many Qt windows
do not update properly.
This is a workaround found by trail and error
without fully understanding the underlying issue.
I would like to have this in place until we can
determine the cause of the bug.
Change-Id: I1ecee745f42a93ded4f651cc8ad51963f250e78d
Reviewed-by: Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
QPlatformIntegrationFactory can be used to load a platform plugin dynamically.
It can be useful for an external platform plugin that want to define some
behaviour on it's own and use the default plugin for the rest. We are going
to implement such a plugin in WebKit for the test infrastructure to tweak
the platform backends in order to provide more platform independent layout
test results.
Change-Id: Iaaabe1cbc173a03132d83474faa7858aead4cae0
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
The function returns mutable iterator on the object that can later be passed to
e.g. erase(), hence it should detach() to be consistent with
QJsonObject::begin() which also detaches.
Change-Id: Id79e8e012fd5469e06b68fbc9eecb7c6848ce9c1
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
QFile::encodeName() does this for us + simplifies the code a bit
Change-Id: Id2ca2615e20408229dd021c26587fefd60365352
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
On Mac, clicking on a submenu entry triggers QMenu::triggered(QAction*)
signal, which is unexpected, and also closes the submenu, which does
not match platform behavior. This happens because native submenu items
have an action set, so fix it by not setting the action.
Task-number: QTBUG-16738
Task-number: QTBUG-10706
Change-Id: I6819999e5af35e6acab1aec035d5d85445189f11
Reviewed-by: James Turner <james.turner@kdab.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
The new plugin format allows us to avoid loading the plugins in
all cases. Remove the old format, as we could get bad behavior
with the old format if Qt would try to dlopen a Qt 4.x plugin.
Change-Id: I2193e6874d6cca3c0b12298c2b9beb4105a42fd5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Moved the plugin overview from qtdoc to qtbase. Updated
the docs to describe the new plugin mechanism.
Change-Id: I1b92d5099aeaa3a166c1f7698176d811d47c3392
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>