Commit Graph

28057 Commits

Author SHA1 Message Date
Thiago Macieira
967c91e777 Make it an #error if we failed to detect the ARM architecture version
... or if it is less than ARMv5. The last ARMv4 Qt supported was Windows
CE 7, which was dropped for Qt 5.7 alongside MSVC 2008.

Change-Id: Ifc817705441a4aab9469ffff141dcfe491464efa
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2016-05-10 23:11:22 +00:00
Marc Mutz
df89dfee4f QEglFSKmsIntegration: use new QJsonObject::value(QLatin1String)
Allows to get rid of some QStringLiterals.

Change-Id: I546aace6876cf373b1cb67269fcc3d042dfd3aac
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-10 21:20:40 +00:00
Marc Mutz
e54c74e3f0 QImageWriter: use new QJsonObject::value(QLatin1String)
Allows to get rid of some QStringLiterals, reducing QtGui
text size by ~200b.

Change-Id: I0f3a84c1c8ee6771d8e1f2c6284d314b3fc0c28a
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-10 21:19:09 +00:00
Marc Mutz
f5aa65349c QFactoryLoader: use new QJsonObject::value(QLatin1String)
Allows to get rid of some QStringLiterals, reducing QtCore
text size by ~800b.

Change-Id: I8f7e57927163eaaf628e42020f83f053faea6bf8
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-10 21:18:52 +00:00
Marc Mutz
a5159cc50a QJsonObject: add some overloads taking QLatin1String
QXmlStreamReader also has QLatin1String overloads, which
greatly benefits parsers, since the vast majority of keys
in both JSON and XML are US-ASCII. This patch adds such an
overload to the JSON parser.

The value() function is all typical parsers need, so even
though many more QJsonObject functions taking QString could
benefit from the same treatment, value() is the single most
important one for read-only JSON access.

Add some more overloads, too, for functions that don't need
more internal scaffolding than value(). Requires adding a
dummy op[](QL1S) (forwarding to the QString overload) so as
not to make

  QJsonObject json;
  json[QLatin1String("key")]; // mutable

ambiguous between const op[](QL1S) and mutable op[](QString).

[ChangeLog][QtCore][QJsonObject] Added value(), op[] const,
find(), constFind(), contains() overloads taking QLatin1String.

Change-Id: I00883028956ad949ba5ba2b18dd8a6a25ad5085b
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-10 21:18:46 +00:00
Alexander Volkov
acf43c17b6 QFileSystemModel: create nodes with correct QFileInfos
Create parent nodes with the corresponding paths, not with
the absolute path of the child node. Otherwise we will get
incorrect QFileInfo at least in the following case:

    QFileSystemModel model;
    model.setRootPath("/usr/bin");
    QModelIndex idx = model.setRootPath("/usr");
    qDebug() << model.fileInfo(idx).absoluteFilePath();

Without the fix it prints "/usr/bin".

It's a regression triggered by 61cefb2f7a
(De-inline QFileSystemModel::fileInfo() and implement it efficiently).

Change-Id: I3b4e5f5b256711e27ad50824eaa8492dbc096808
Task-number: QTBUG-51586
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-10 20:51:15 +00:00
Timur Pocheptsov
ab3a8443fa QCocoaWindow - do not call resignKeyWindow
QCocoaWindow::setMouseGrabEnabled/setKeyboardGrabEnabled calls
resignKeyWindow. According to Apple's docs, we should _never_ call
this function (it's done by Cocoa automatically).
Calling this function leaves a window in weird state where it can
not become key again until you explicitly make another window key first.

Task-number: QTBUG-53050
Change-Id: I7a887659df8df11880328ffa2adc07c4a3af63e6
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-05-10 19:06:58 +00:00
Gabriel de Dietrich
ce37467acf Acknowledge QWidgetWindow::widget() may be null
We guard QWidgetWindow's widget with a QPointer to avoid
sending it events during destruction (which may result in
undefined behavior, since this originates from ~QObject and
we expect the object to behave as a QWidget). Therefore, we
need to harden all access to that widget since it can now
be null, specially during destruction.

As an example, QGestureManager may crash when we delete a
top-level widget. The crash stack trace is:

1  QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>>::data() const
2  QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>>::pointer qGetPtrHelper<QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>>>(QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>> const&)
3  QWidget::d_func()
4  QGestureManager::filterEvent(QWidget *, QEvent *)  <-- the widget ptr is null
5  QGestureManager::filterEvent(QObject *, QEvent *)
6  QApplication::notify(QObject *, QEvent *)
7  QCoreApplication::notifyInternal2(QObject *, QEvent *)
8  QCoreApplication::sendEvent(QObject *, QEvent *)
9  QWindow::destroy()
10 QWidgetPrivate::deleteTLSysExtra()
11 QWidgetPrivate::deleteExtra()
12 QWidgetPrivate::~QWidgetPrivate()
13 QWidgetPrivate::~QWidgetPrivate()
14 QWidgetPrivate::~QWidgetPrivate()
15 QScopedPointerDeleter<QObjectData>::cleanup(QObjectData *)
16 QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>>::~QScopedPointer()
17 QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>>::~QScopedPointer()
18 QObject::~QObject()
19 QWidget::~QWidget()

Task-number: QTBUG-53103
Change-Id: I1bb32648270c4f7791f668b8f0b639ddb4235703
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-05-10 18:32:49 +00:00
Gabriel de Dietrich
6a84a51611 QWidgetWindow: Guard reference to own widget
~QWidgetPrivate() may end up calling QWidgetPrivate::
deleteTLSysExtra() which, in turn, calls QWindow::destroy().
This sends an event to the window itself. This reaches
QWidgetWindow::event() which will forward the event to
the widget. However, the widget has just been deleted
since the sequence was initiated by ~QObject().

Task-number: QTBUG-53103
Change-Id: Ib511714a76bbc1e734d6f2800a983eb1459bbf0b
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-05-10 18:32:40 +00:00
Maurice Kalinowski
dbd81a0b9f winrt: Fix potential startup crash
Depending on the windowstate passed to QWinRTWindow constructor we might
act on the uiElement which has not been created yet. This happened
especially in release mode, probably due to timing.

Hence delay uiElement changes until we created it in the constructor and
can ensure it is valid.

Change-Id: I00daa9fcf8542a0535bbcb663a76d85c36e510e2
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-05-10 17:11:03 +00:00
Simon Hausmann
5e51b15066 Prospective MSVC 2013 build fix
MSVC 2013 does not like QStringLiteral between brackets.

Change-Id: Ic42f80b7a3abbb48df3d0e222bd5c868045a0ded
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-05-10 13:55:29 +00:00
Maurice Kalinowski
4c06592ad8 Fix build on WinRT
a63ca3fa10 caused a build breakage
for WinRT as GetModuleHandleEx does not exist on that platform.

Change-Id: I143d9cad5f32d98a4d86292dfa73f94a4acdf305
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-10 13:55:26 +00:00
Andy Shaw
5dc421ec87 Restore the missing -P option for lex handling
We don't know why it works, but we've been told that it fixes
some builds and we have no reason to think it will break others.

Task-number: QTBUG-52998
Change-Id: Iacaa1fb3c49e4d7aafd4167e591ff3724489872e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-05-10 13:16:37 +00:00
Oswald Buddenhagen
33c5df2887 decruft project files
the "generated by qt creator" header is not supposed to be checked in.

Change-Id: I7626c0bd16f83d81b3facd216a04e7d505942256
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-05-10 11:12:04 +00:00
Timur Pocheptsov
4e0b76d810 Cocoa integration - avoid dangling menuitem pointer
Since QCocoaMenu can live longer than its m_attachedItem pointer,
this pointer is becoming invalid after QCocoaMenuItem deleted
(and its 'm_native' was released).

Task-number: QTBUG-53251
Change-Id: I6d97b75b2c09e2443cd21415c5db94206d5d89ce
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2016-05-10 10:36:30 +00:00
Morten Johan Sørvig
7e539002ee Enable movedAndResizedAttributes test.
The test passes on OS X now.

Task-number: QTBUG-8941
Change-Id: I7b57dc30ede7c1ed0bcb8bacb458ea56f222d987
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-05-10 10:36:08 +00:00
Morten Johan Sørvig
95b8dfdb6f tst_qwidget: remove sheetOpacity test
Sheets are no longer transparent on newer OS X
versions.

Change-Id: Iaaed5aea9c9b130a5d991acd36717b76c3927cfb
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-05-10 10:26:51 +00:00
Morten Johan Sørvig
7f5e8a5e34 OS X: Remove unified toolbar test.
The Qt 5 unified toolbar implementation does not move
the toolbar to the “non-client” area. This test is
no longer relevant.

Change-Id: Ia32de2260f8ef400a0dc5acf3e5e3ff59083657a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-05-10 08:15:09 +00:00
Błażej Szczygieł
d6cbf9efb7 xcb: Properly unset mousePressWindow()
In some cases the mouse release event won't arrive, i.e. when window is
minimized on button press. Check for mouse buttons state on mouse move
event and properly unset the mousePressWindow to avoid blocking
enter/leave events in this case.

Amends: c511466d74

Change-Id: I543a75104f528df1bf644bace13f78a6af017455
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-05-09 21:46:29 +00:00
Alberto Mardegan
ab2cf73440 QXcbDrag: forward mouse release event to initiator window
The mouse release event which ends the drag and drop operation must be
forwarded to the window where the drag started, and not to the
QShapedPixmapWindow, which is not supposed to handle input events.

Task-number: QTBUG-52541
Change-Id: I24a7c7b331a06342ac28b420ff9467aa05fe00dd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-05-09 20:46:14 +00:00
Anton Kudryavtsev
2f595a0178 QUrl: enable (N)RVO for gcc
Change-Id: Ie0fba08ce55a3c60a5b1565986c4280f065c7b2f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-05-09 18:58:08 +00:00
Anton Kudryavtsev
7abb90a70a QDateTimeParser: proper construction of QString
... with known size and known char by corresponding ctor.

Don't use fill() for this case.

Change-Id: I475a0655132ecbb40b1eac919309597b2560e71b
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-05-09 18:57:57 +00:00
Thiago Macieira
50723bf3d0 Make sure the QDBusVirtualObject virtuals are called in the right thread
Change-Id: I42e7ef1a481840699a8dffff1409e30f191e822f
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2016-05-09 16:21:50 +00:00
Laszlo Agocs
844ea8beea linuxfb: Support transparency
Always clearing to opaque black makes it impossible to create
semi-transparent overlays with linuxfb. Instead, behave like other
platforms' backingstores: if the target image has an alpha channel,
clear to transparent instead and set the correct composition mode.

Task-number: QTBUG-52475
Change-Id: I2db4588e0112e200a3aa5eed49f806c37d7ca8b5
Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io>
2016-05-09 15:56:20 +00:00
James McDonnell
1e971f8555 Add FreeType libraries for Windows -system-freetype builds
Add a "CONFIG += qpa/basicunixfontdatase" to the -system-freetype block
so that the FreeType libraries are included in LIBS.

Task-number:  QTBUG-35767
Change-Id: I81e18e72e068d5ac240cba79bab880e50a033860
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-05-09 13:08:31 +00:00
Oswald Buddenhagen
45bec92e7a make qt-freetype use qt-zlib when present
from the perspective of freetype, this looks like a system zlib.

Change-Id: Idb961850b2a92d456cfa2b027bdc85ce5e4be771
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-09 12:52:13 +00:00
Oswald Buddenhagen
8edfc4e9b6 make zlib_dependency auto-add QtCore as a private dep
our zlib header includes qglobal.h, so we need the qtcore include dirs,
and qtcore is also where the actual code is compiled into.

Change-Id: I09f530a1b4e6160438215a6d7223c0771ce94f05
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-09 12:52:08 +00:00
Richard Moe Gustavsen
c906d7abb8 QWidgetTextControl: ensure we listen for changes to cursorFlashTimeChanged
Change 3cdc02d actually "reverted" the behavior of listening for
cursorFlashTimeChanged. The reason is that we sat "blinkingEnabled"
directly to true in the constructor instead of calling
"setCursorBlinking", which was responsible for setting up the
connection.

And as it turns out, after 3cdc02d, nobody is actually calling
"setBlinkingCursorEnabled" anymore. From the widgets
point of view, it should always blink when visible
(unless QPA sets cursorFlashTime to zero). So we can remove the whole
function, and set up the connection in "setVisible" instead.

Change-Id: I577a5fbbbd9c56331ac7f8bb38567a684ca8c1df
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2016-05-09 11:38:44 +00:00
Miikka Heikkinen
f643f6504b Fix ANGLE glGetUniform*v functions to work properly with arrays
glGetUniform*v functions are supposed to return just a single
array element, so returning the whole array is always incorrect.

Task-number: QTBUG-53072
Change-Id: I22f05d420082d4d9de06d975b3d0f5e64d3e0c41
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-05-09 11:15:07 +00:00
Määttä Antti
ed7845098f Fix threading issue in creating static opengl context
Add mutex lock for static opengl context creation.

Task-number: QTBUG-53202
Change-Id: Iba22339776ec8885efd82b13ae56f6781a426f4b
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-05-09 10:14:40 +00:00
Venugopal Shivashankar
09d1554599 Doc: Highlight Quick Controls 2 - Gallery example
Removed Qt Quick Controls 1 examples from the highlited
list, and also removed the webkit1 and webkit2-related tags.

Change-Id: I674dc00544bc70c50460a64690d1062835885fc0
Reviewed-by: Sami Makkonen <sami.makkonen@theqtcompany.com>
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-05-09 09:13:40 +00:00
Jędrzej Nowacki
45655cbe8d Be more specific what is in Core and what is not
!isComplex is quite good heuristic, but we know for sure which types
should be included.

Change-Id: I609d021b8a668e6c1945ed2b11d69f5a82b5e2bf
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-05-09 08:48:19 +00:00
Friedemann Kleint
9f6f06c319 tst_QMdiArea::subWindowActivated2(): Allow for several activated events.
On some X11 window managers, 2 events are received when
hiding/reshowing and activating the window, which became
apparent after 91f536dd71.

Change-Id: I66fdc4f69d87ac898b18d5dfddc957617bb8f916
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-09 08:40:00 +00:00
Liang Qi
566ccd3ca8 QNX: Force use of system zlib on Windows host
While we on Linux will do a compile test to check for a
system zlib, the test on a Windows host was less accurate, causing
us to compile in the zlib from 3rdparty/ here. This caused compilation
errors after updating the freetype font engine to support color fonts,
since the zlib in 3rdparty/ was included implicitly in the freetype
library, and since it depends on Qt headers, the compilation failed
in this context.

The hotfix is to force system zlib on QNX for Windows hosts, since
we know it is available in the NDK. Doing a proper build check is not
worth it right now, due to future plans for changing configure. We
will still break for an explicit -qt-zlib compilation, so the plan is
to fix this in an upcoming commit by separating libpng into
a library.

The hotfix just follows e6cb3b8c.

Task-number: QTBUG-53248
Change-Id: I07dd4356fae6397b3cc93fc1fa97bf35380e19df
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-09 08:11:04 +00:00
Marc Mutz
4a4b377cd0 QJsonValue: don't create a temporary QString on every toString() invocation
The vast majority of users call toString() without the optional
defaultValue. So do it like the toArray() and toObject() methods
and split toString() into two overloads, so the common case no
longer needs to pass a temporaray QString.

Saves ~1.4 and ~1KiB in QtCore and QtGui text size, resp., on
optimized GCC 6.0 Linux AMD64 builds, even though we added a new
function to QtCore, too.

Change-Id: Ibe02397ca49ce11fdb58f5c5fc69e909bf94c1c6
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-05-09 08:10:13 +00:00
Friedemann Kleint
c0425f39d1 Windows Accessibility: Use QWindowsAccessibility::windowHelper().
Amends changes ee51638187,
d7a3b61459.

Task-number: QTBUG-52943
Change-Id: Icdf9d99c327bdd38dfb084e6cf77b14cd5ce073b
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2016-05-09 07:52:26 +00:00
Thiago Macieira
0b1b06ffc0 Add a QMutex::isRecursive() const noexcept
This is source- and binary-compatible, including the marking of the
existing function as noexcept.

[ChangeLog][QtCore][QMutex] Made the isRecursive() method be a const
function so that it can be called in const QMutex objects too.

Change-Id: Ifea6e497f11a461db432ffff1448bead97c08f92
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-05-09 07:48:30 +00:00
Thiago Macieira
0453897f1e QStorageInfo: allow getting the info of pseudo filesystems too
They won't be listed in QStorageInfo::mountedVolumes, but we can now
obtain their info if you know their mountpoint. For example, on Linux:

 $ ./qstorageinfo /dev /proc /sys
 Filesystem (Type)            Size  Available BSize  Label            Mounted on
 devtmpfs (devtmpfs) RW    4029772    4029764  4096                   /dev
 proc (proc)         RW          0          0  4096                   /proc
 sysfs (sysfs)       RW          0          0  4096                   /sys

Change-Id: I3e15a26e0e424169ac2bffff1417ba2429d6d9f4
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-05-09 06:04:36 +00:00
Thiago Macieira
4aba3dbcb3 QStorageInfo: get the label properly if the mounted device is a symlink
This happens for me with LVM:

 $ ls -l /dev/mapper/system-root /dev/system/root /dev/disk/by-label/*
 lrwxrwxrwx 1 root root 10 Nov 17 22:45 /dev/disk/by-label/system -> ../../dm-1
 lrwxrwxrwx 1 root root  7 Nov 17 22:45 /dev/mapper/system-root -> ../dm-1
 lrwxrwxrwx 1 root root  7 Nov 17 22:45 /dev/system/root -> ../dm-1

The mounted device according to /etc/mtab (/proc/self/mounts) is
/dev/mapper/system-root.

Change-Id: I3e15a26e0e424169ac2bffff1417b96779d84246
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-05-09 06:04:31 +00:00
Thiago Macieira
d9f6b6d1f8 QStorageInfo: update the detection of pseudo filesystems
Allow tmpfs filesystems to be reported, as they're often usable by the
user, mounted in /tmp and in /run (the fs for $XDG_RUNTIME_DIR).

But disallow anything whose device is not a pathname. This catches most
of everything else that wasn't specifically tested for before, like
virtual fuse filesystems, like GVFS.

Change-Id: I3e15a26e0e424169ac2bffff1417b7cee0f8ec97
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-05-09 06:04:26 +00:00
Thiago Macieira
b168c6c824 QStorageInfo: fix matching of mountpoints to sibling directories
The path "/usrfoo" starts with "/usr", so if you tried to get
QStorageInfo("/usrfoo") when "/usr" is a mount point, you'd get the
wrong filesystem.

[ChangeLog][QtCore][QStorageInfo] Fixed a bug that caused QStorageInfo
to report information for the wrong filesystem if there is a mounted
filesystem at a path that is a prefix of the requested path (e.g., it
would report "/usr" filesystem for "/usrfoo").

Task-number: QTBUG-49498
Change-Id: I3e15a26e0e424169ac2bffff1417b7a27cd0132d
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-05-09 06:04:21 +00:00
Thiago Macieira
fe23db053a Add an autotest for the QtDBus message spy hook
There's exactly one application that needs this functionality (kded/
kiod), but we should test it too.

Change-Id: Icaa7fb2a490246bda156ffff143d210c6f5f207f
Reviewed-by: David Faure <david.faure@kdab.com>
2016-05-09 05:31:11 +00:00
Thiago Macieira
c619fc278d Fix moc warning detected by ICC
moc.cpp(385): error #187: use of "=" where "==" may have been intended

Change-Id: Ibb6ef27030762cbe4f7c7002581a0955f0f9086d
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-05-09 05:30:52 +00:00
Thiago Macieira
29076cf6cb Fix QBasicAtomicPointer::{load,store} to actually be relaxed
We were using direct loading and operator=, which for everything except
std::atomic was very relaxed. But std::atomic<T *> defines the direct
access to actually be the least relaxed possible, under the idea that if
you didn't know any better to use a member function, you probably need
the most protection.

So use Ops::load and Ops::store.

Change-Id: Id5480807d25e49e78b79ffff144a06a2e6398576
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-05-09 05:30:49 +00:00
Thiago Macieira
ad66dbe305 Disconnect signals from each QObject only once in QDBusConnectionPrivate
Because the moment we disconnect from the object's destroyed() signal,
it may get destroyed in another thread. If the same object appears more
than once in the object tree or in the signal hook table, we could be
accessing a dangling pointer.

Task-number: QTBUG-52988
Change-Id: Ifea6e497f11a461db432ffff14496f0f83889104
Reviewed-by: Weng Xuetian <wengxt@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-05-09 05:30:46 +00:00
Thiago Macieira
8de2986a42 tst_QDBusMarshall: make sure we compile on linked, old dbus
If we're linking to libdbus-1, qdbus_symbols_p.h #includes dbus/dbus.h,
which may be old and not #define the Unix FD macros. tst_QDBusMarshall
had the definition for one of the macros but not the other, so add the
missing second one.

Change-Id: Id69569111e7d4e619e22ffff144c35edcd6f348b
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2016-05-09 05:30:43 +00:00
Vyacheslav Grigoryev
558718ff44 QTableView: Fix selection for reordered or hidden rows/columns
The old code sometimes made incorrect selections when rows or columns were
hidden or moved. It used logical top left and bottom right indexes to create a
selection rectangle. However on moved or hidden cells a wrong rectangle was
made. This fix calculates a simple rectangle without hidden cells and makes use
of the row/column select functionality provided by the selection model, to make
the right selection.

[ChangeLog][QtWidgets][QTableView] Fixed a selection bug when rows or columns were hidden (QTBUG-50171)

Task-number: QTBUG-50171
Change-Id: Id186012af26da7b2051ff5eb1c13e6b7494cca77
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2016-05-09 05:14:38 +00:00
Thiago Macieira
75d65600f9 Work around ICC's bug in making std::atomic a literal type
ICC 15.x and 16.0 (beta, at least) are missing the "constexpr" and
"noexcept" keywords in the definition of the std::atomic
constructors. The lack of constexpr makes std::atomic a non-literal
type, which in turn makes QBasicAtomicInteger's constructor (which is
constexpr) fail to compile.

Reported as Intel issue 6000117277.

Change-Id: I4a88bcca48bf0ce51557d809ef32a4545edcafee
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-05-08 18:10:36 +00:00
Thiago Macieira
194a56ea79 QTest: Fix printing of values of Q_ENUMs
QMetaEnum::key(n) returns the n-th key, which is not necessarily the one
of value n. For the key of value n, we want QMetaEnum::valueToKey(n).

Change-Id: Ic90fe6b1cbe84978a02fffff141bf4a06074917a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-05-08 08:57:16 +00:00
Thiago Macieira
29efec2d8c Mark QThread::currentThreadId() as a pure function
It always returns the same information for each thread it is called
in. But since it's different per thread, we don't think it's
const. pthread_self() on Linux is marked const, though we think it
really ought to be pure. On other OSes, the annotation isn't present,
but the we can assume function is so.

Change-Id: Ifea6e497f11a461db432ffff1448c2b37d94d5f3
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-05-08 06:51:27 +00:00