We generally assume that for every mouse press we also get a mouse
release eventually. The event filter installed by QBasicDrag broke this
assumption as it didn't take care of filtering mouse press and mouse
release events symmetrically. We cannot immediately pass on the release
event as that would mean a release event is generated from a press
event (via the blocking drag call), which breaks assumptions in other
places.
Change-Id: If7e48c7dc0ef5265bed4f9a9366a7606ec875d93
Task-number: QTBUG-46361
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
QDateTime values with a UTC offset are not correctly serialized with
QDataStream::Qt_4_0. So use a newer QDataStream format for this type and
mark it with "@DateTime" instead of "@Variant".
Task-number: QTBUG-46551
Change-Id: I211c89e8cd0211c949ec993e6ffd5192d0eebbb3
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Left and right were swapped which caused invalid selection ranges to be
emitted through selectionChanged.
Task-number: QTBUG-48402
Change-Id: I18692c2b50c49ab39065f9b360b37b7615227ee9
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Use case insensitive comparison and static invocation
of QGuiApplication::platformName().
Change-Id: I8c197c7b4f0669f71c019fbcee09a0f03dfab399
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
The arguments for the width and precision parameters, that is. There's
no reason to crash if a user sets e.g. a precision of -2.
Task-number: QTBUG-46838
Change-Id: I4afc004a1b8aa1306fd996360b16117b2b643640
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
qtextstream.cpp:2825: warning: Can't link to 'left()'
qtextstream.cpp:2825: warning: Can't link to 'right()'
qtextstream.cpp:2797: warning: Can't link to 'right()'
qtextstream.cpp:2797: warning: Can't link to 'center()'
qtextstream.cpp:2811: warning: Can't link to 'left()'
qtextstream.cpp:2811: warning: Can't link to 'center()'
Change-Id: I613354ca8137030c9f121cb976fe3bc35e1a415b
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
The explanation is in the code comment. Ever since QDBusConnections
began being processed in a separate thread, we were relying on the fact
that the main thread didn't begin processing its event queue until the
second event got posted (the event loop only exits after it has finished
processing all pending events). We had a race between the main thread
starting its processing, at which point it decides which is the last
event it will process, and the QDBusConnectionManager thread posting the
second event.
This is very fragile code, since it depends on the behavior of
QDBusConnectionPrivate (how it stores the signal relays in a hash) and
that of QHash with duplicate keys. This only works because the hash
key between the two connections is the same (it's only dependent on the
method name and interface name). If we ever begin using something that
isn't the same between "control" and "p", then with QHash's randomness,
we'll be racy again.
Change-Id: I42e7ef1a481840699a8dffff1406c3a4674ec3a6
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
The test assumed that an event loop can be tested for emptiness
multiple times, which is wrong because an event can be delivered any
time.
Change-Id: Ic44245321eeed2091b640ada2c83d205b83a1cc2
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
This test when running on Windows has a race condition since in qthread_win.cpp the
finished signal is emitted before everything is cleaned up.
Change-Id: I3c03d9a245e297e8f79b2be2c34398bf7bac9bae
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
The methods are supported on Windows Phone since 8.1 so that the
simplified Windows Phone code isn't needed any more.
Task-number: QTBUG-48140
Change-Id: I21c488fe1a1322e85bbe088fb47e81893fd12d40
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
The current behavior has been observed to irritate a lot of users, for
instance in the Qt online installer and the Boot2Qt flashing wizard.
Change-Id: Icd7b819a0cbc9fd04b86b4777c5b9e829045d6df
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Map this to ignoresMouseEvents on NSWindow.
Task-number: QTBUG-45498
Change-Id: I86e518bbf805647d9f12b1af1747355ef55cc167
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
According to MSDN, a maximum icon size is 256 pixels.
http://blogs.msdn.com/b/oldnewthing/archive/2010/10/18/10077133.aspx
Change-Id: Id87c89a20c9cba6ef041b49f93f84c5e9c3eb79f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
We only need to merge the rectangles into a region if we are painting
a non-opaque a primitive with alpha.
Performance measurements QT_print_speed_bug.zip:
Excluding patch: 244686 ms
Including patch: 5070 ms
This is an improvement of 48x (for debug build)
Task-number: QTBUG-48334
Change-Id: I03684c6e7d8a5fb039ea6477ed1a860f09e1b08c
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
This ensures that the values and signals reported by QInputDeviceManager
for touch devices always have corresponding entries in the list returned
by QTouchDevice::devices().
It also adds proper QTouchDevice unregistration when the underlying
input device gets removed by the evdevtouch QPA plugin.
Change-Id: I7bdf2f7435c775d15bddce8ba1e731afdc1d948a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Most processors have carry flags which they set on addition overflow, so
it's a good idea to access them whenever possible. Most of them also
have widening multiply instructions that can be used to detect overflow
of the non-widening version.
Tested to compile on:
Architecture Compiler
x86 GCC 4.9, GCC 5*, Clang 3.6*, ICC 16 beta
x86-64 GCC 4.9, GCC 5*, Clang 3.6*, ICC 16 beta
x86-64 ILP32 GCC 4.9, GCC 5*, Clang 3.6*
IA-64 LP64 GCC 4.8
ARMv7-A GCC 4.9, Clang 3.6*
AArch64 Clang 3.6*
MIPS GCC 4.9, Clang 3.6*
MIPS64 GCC 4.9, Clang 3.6*
PowerPC GCC 4.9, Clang 3.6*
PowerPC 64 GCC 4.9, Clang 3.6*
SPARC Clang 3.6*
SPARCv9 Clang 3.6*
[*] supports the intrinsics
If the compiler does not offer a way to detect an overflow, we do it by
hand. For unsigned additions, that's easy, since the C++ language
specifies the behavior of the overflow. That's also the reason why this
code is implemented only for unsigned integers.
For the multiplication, if the compiler does not support widening
multiplications, we do it with a division instead. This is necessary for
GCC < 4.5 and compilers not compatible with GCC or MSVC.
Change-Id: I049a653beeb5454c9539ffff13e637de0f1338c1
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If you don't deleteLater and more won't work
Change-Id: I47cbb24f8e22a7f269a0297410e4163878819f82
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When disabling the graphics adapter, things start failing
with context lost and then bad_alloc and bad_access failures
when creating contexts/window surfaces.
Swap buffers now handles context loss. This makes it possible
for Qt Quick to act when the graphics adapter goes away.
Similarly, the window surface creation failure EGL_BAD_ACCESS
is treated the same way as context loss.
Note that this will not really help the main issue, because
rendering is not possible without a GPU (reinit attempts will
fail either at context creation or window surface creation),
but proper logging and context loss reporting improves the
situation somewhat.
Also unify and prettyify the warning and debug prints.
This makes it easier to understand what is going on.
Change-Id: Iec3a9b54f1134e78e87eefcf938525283ec9412a
Task-number: QTBUG-48095
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
- Set QtProject as organization.
- Remove unneeded member variables.
- Use member initialization in the constructor.
- Use new connection syntax in createActions()
to assemble the menu there, removing the createMenus()
function.
- Introduce a QSharedPointer to ensure settings are deleted.
Previously, the settings were parented on the tree widget,
which is a hack of sorts.
- Fix OS X macros.
Change-Id: Ibbc6bfb03eb5c7eda077b1a3aa3f1707667f7f13
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Close the window instead of closing the widget. This will
run the QWidget close implementation followed by the
QWindow close implementation.
Change-Id: Iaba3cf0359410def858363a02fceaeddb7095aaa
Task-number: QTBUG-43344
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Call the QWindow close event handler when processing
close events in QWidgetWindow.
Change-Id: I2b8691735962f6a222a30a847bb18cc6c86b55d4
Task-number: QTBUG-43344
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
We need a method to check image format of .ico with QImageReader loader.
That is very useful to filter out low resolution icons.
Change-Id: I2dfe3aa49cbc1e05836be846ae3da30786b98ff4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
The timeZone() function used to assert when called on such an object
(or, for a release build, return an invalid time zone).
Change-Id: I6ae8316b2ad76f1f868e2498f7ce8aa3fcabf4a6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This memory allocation was introduced in
314c83c0c2. With a compiler without thread
safe statics support mutex.cpp use a function named freelist() to create
the global QFreeList object. it will be created when the first time it was
accessed, but will never be released. This patch use Q_DESTRUCTOR_FUNCTION
to delete this object.
Task-number: QTBUG-48359
Change-Id: I4e4716930930aa98630101a1f96de6a7672af9cb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is happening in code I don't usually test (32-bit, non-ICU, etc.)
KeccakF-1600-opt32.c:481:22: error: cast from type 'const unsigned char*' to type 'UINT32* {aka unsigned int*}' casts away qualifiers [-Werror=cast-qual]
KeccakF-1600-opt32.c:217:62: note: in definition of macro 'extractLanes'
Change-Id: I42e7ef1a481840699a8dffff140209823301a07a
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
The C++ standard says it must, but some badly-configured toolchains seem
to be lacking support.
In particular, for some 32-bit platforms without native support for
them, GCC implements 64-bit atomics via out-of-line functions in
libatomic. If that library is missing... well, then std::atomic 64-bit
doesn't work and we mustn't try to use it.
This was found when trying to compile Qt 5.6 for MIPS 32-bit:
Linking library libQt5Core.so.5.6.0
.obj/qsimd.o: In function `std::__atomic_base<unsigned long long>::load(std::memory_order) const':
/opt/poky/1.7/sysroots/mips32r2-poky-linux/usr/include/c++/4.9.1/bits/atomic_base.h:500: undefined reference to `__atomic_load_8'
.obj/qsimd.o: In function `std::__atomic_base<unsigned long long>::store(unsigned long long, std::memory_order)':
/opt/poky/1.7/sysroots/mips32r2-poky-linux/usr/include/c++/4.9.1/bits/atomic_base.h:478: undefined reference to `__atomic_store_8'
Yocto bug report: https://bugzilla.yoctoproject.org/show_bug.cgi?id=8274
Change-Id: I42e7ef1a481840699a8dffff140224d6614e5c36
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
sessionId and sessionKey generation on Windows was lost in the
transition of Qt 4 to Qt 5. During the reimplementation of the
QSessionManagement feature, that part has been missed. This patch fixes
that.
Based on Qt 4
[ChangeLog][QtGui][Windows] Fixed a regression where both
sessionId/sessionKey were empty
Task-number: QTBUG-47690
Change-Id: I17b5fbee9d0979d292d30b94b3a2cc3107fc54fd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Currently the shader code is not accessible from the examples
documentation page. This patch fixes this by adding .glsl to the file
extensions list for examples
Change-Id: Iafe327d1bd99b78641a89863f9dbaf8112651c45
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
The example code uses QDesktopServices::storageLocation which has been
replaced by QStandardPaths. This patch fixes this.
Change-Id: Ifff25fcb9d85b37ef8247cb4cd9c4c1c8d368780
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
This table has values precomputed based on every single glyph in
the font, not just the subset we use as a fallback, which should
improve both performance and correctness.
The fallback codepath of computing the minimum values based on a
subset of the characters in the font is left in, as we still need
that for bitmap fonts, and some font tables that have invalid
values.
Change-Id: I71aac1e09c9f9de80446b023ba15a9e2afe7d226
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Without piping the output to /dev/null, we'd get the following:
sh: dbus-send: command not found
And if dbus support is only limited to runtime support, we don't
treat it as a fatal error and only notice the user.
Change-Id: Ia7750a074b8d563bf9694fa8fa628b4017e8bb68
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When working with QGraphicsView/QGraphicsScene, touch events are sent to
QGraphicsView's viewport() event handler, which then dispatches it to the
corresponding QGraphicsItem, if any. In the case of QGraphicsProxyWidget, we
need to forward these touch events to the encapsulated QWidget, otherwise it
will never receive them (i.e. the event chain for touch events terminates at
QGraphicsProxyWidget).
This also enables QWidgets associated with QGraphicsProxyWidget to grab
gestures.
Task-id: QTBUG-45737
Change-Id: Ia441d3576afb6c97376be6f2ff073901e6e928a5
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
There can be a race condition where another channel connects
and gets the sslErrors() from the socket first. Then the
QSslConfiguration from the wrong socket (the default
channel 0's socket) was used.
Task-number: QTBUG-18722
Change-Id: Ibbfa48c27f181563745daf540fa792a57cc09682
Reviewed-by: Richard J. Moore <rich@kde.org>
It is still unclear how to act on those
messages. We are already doing this for
other Compiz messages -_COMPIZ_DECOR_*.
Change-Id: I45f76b5f56ee1b07eb4c7398cc85b5d7bed86c4c
Task-number: QTBUG-46954
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Commit d1cd75e81a introduced the usage of
the SO_REUSEPORT socket flag on Unix systems if available. However, on
Linux systems this socket option behaves differently from the previously
used SO_REUSEADDR socket option. This patch disables the use of the
SO_REUSEPORT option to fix rebinding problems on Linux. The option was
introduced to improve support on OS X and other BSDs. It is not
necessary on Linux.
[ChangeLog][QtNetwork][QUdpSocket] Fixed a bug that caused the
QAbstractSocket::ShareAddress option not to work on Linux.
Change-Id: Ice04b8b9e78400dce193e2c1d73b67e33edf8840
Reviewed-by: Richard J. Moore <rich@kde.org>
Default to primary screen and handle situations where the screen
is null consistently. Remove unused QWindowsScreen::screenOf() method.
Task-number: QTBUG-48288
Change-Id: I91b3c2331521d9d3be8ac77606ee820cd35ebb0f
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Remove QWindowsContext::instance() method and use
QPlatformIntegration::inputContext() with proper check instead.
Extract static method to disable Windows IME on a window
by associating a null context from QWindowsInputContext
and use that to disable the IME if another context is
in use.
Amends change b46fe39d94.
Change-Id: Icaad99d390cea5559167602ffbf994660d4717a5
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
The derived classes (QSpinBox, QDoubleSpinBox, QDateTimeEdit, QTimeEdit)
set various input method hints on the spin box in the init() methods
of their private classes which did not have any effect since
QAbstractSpinBox::inputMethodQuery() was implemented to return the
hints of the embedded QLineEdit only. Change it so that hints set
on the QAbstractSpinBox are also considered.
Change-Id: I76b7c4d3e0869589c110cf3a0b2c3f94201db5d5
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
The current version of the mouse motion event compression
algorithm does not work with certain configurations -
situations where we get one XCB_GE_GENERIC event between
every XCB_MOTION_NOTIFY event.
The new implementation tries to be less fragile. The
previous approach checked "is *the next* event the same
type as the current event", the new check asks "have
we buffered more events of the same type as the current
event". We buffer events of the same type only when the
main thread is unresponsive.
This patch adds event compression for XI_TouchUpdate in
addition to the fix for motion even compression.
Change-Id: Ie215eb5969e2060e463ebe48e3d3007390a30deb
Task-number: QTBUG-40889
Task-number: QTBUG-47069
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
The standard http://www.newplanetsoftware.com/xdnd/ says:
"The only place where the proxy window should be used is when
checking XdndAware and in the calls to XSendEvent()".
Change-Id: I62e504ba52ec7ec2a941c53a84889bb3eb4b4cc1
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
In some cases it's not possible to use QT_HASH_SEED, specially when
we need to set the environment variable from inside the application,
as dynamically loaded libraries or plugins may create static QHash
instances. That would set qt_qhash_seed to a value different from
-1 and skip the env var value.
For those cases, and when we still want to set qt_qhash_seed, we
provide a way to enforce its value.
Auto-tests accessing qt_qhash_seed directly have been updated
accordingly. Usage in qdoc, uic and rcc has been left as is
for the time being.
Change-Id: I3b35b4fa0223c83b1348a6508641905a2a63266f
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Some code may rely on the primary screen geometry for example.
Task-number: QTBUG-47002
Change-Id: I42fc1ccf0c1d91beb5d8e9691ac6ec4e7400e567
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
Returning a dangling pointer is no good. Do what QOffscreenSurface does:
just null it out.
Task-number: QTBUG-42803
Change-Id: I01a6db9ae8974a1c78157ebc67097c8dac3a6b6e
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Change 071098b08b changed QWidget::render
to work with all paint devices. Before that change, QWidget::grab would
effectively call QWidgetPrivate::render(), since the QWidget::render
overload was just a direct call to the private class implementation.
This change fixes the regression by calling QWidgetPrivate::render()
directly from QWidget::grab().
Task-number: QTBUG-43968
Change-Id: I1aa2fa91c722374612b6cfa76fd0891d168ecac9
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Consider a debug_and_release build of a static library.
Set DESTDIR to different values for debug/release.
Let TARGET be the same for debug/release.
Now qmake would generate code in Unix Makefiles like this:
rm mylib.a
ar mylib.a ...objects...
rm debug/mylib.a
mv mylib.a debug/mylib.a
and for release analogous. This clashes when building in parallel.
This patch resolves this conflict by reducing the commands to:
rm debug/mylib.a
ar debug/mylib.a ...objects...
We believe that every ar implementation that's in use for Qt
is able to operate on files in subdirectories.
[ChangeLog][Important Behavior Changes][qmake][Unix] QMAKE_POST_LINK
steps of static libraries are now required to operate on $(TARGET) in
$(DESTDIR) instead of $$OUT_PWD. This matches the Windows backends.
Task-number: QTBUG-48287
Change-Id: I192f488ed74c56bc32862426d9e9d4237d9b8135
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
The test is moved from tst_qtreeview to tst_qtreewidget as it tests
qtreewidget class.
C++ usage is fixed, there was an illegal C cast that was causing crashes
Change-Id: I80e90a9b531e87f9b133186b6f48be42f54901b5
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>