... and plaster API with nothrow (well, one function).
Change-Id: I36fd64c6fda5390954c82bba307c720d3b3215df
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The conditions aren't exclusive, but complementary.
This change removes one check for defined(Q_CC_INTEL) because it was
disabled before and requires testing before we confirm it to be correct.
Change-Id: I33dc971f005a4848bb8ffffd14748cde4dd23333
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Section 30.4.1.3 [thread.timedmutex.requirements] has 16 paragraphs and
2 subsections.
Change-Id: I9093948278414644a416fffd1473fec7fdd2716c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The names of some screen properties have changed in 7.0.
For 6.6, map the 7.0 names to 6.6 names.
Change-Id: Iaf9d297fdd6a0329a84150f2b9a27665d89cc1ec
Reviewed-by: Dan Cape <dcape@qnx.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
It was backwards so the screen context was being flushed on every screen
interaction when the parameter was _not_ specified. During mouse/touch
movement, the number of flushes can be so great that it negatively
impacts performance.
Change-Id: I4dfe9c33c8ce31237db1d78db1cb8e04c00c4dd3
Reviewed-by: Dan Cape <dcape@qnx.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
This macro expands into a static_assert and can be used to
trigger a compile error if a certain feature is not available
when trying to compile some code.
This is especially useful to protect against accidental inclusion
of headers that implement functionality related to a feature.
Change-Id: I456c55b989ce5f35f3af0e13c1886a85c23dfe29
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This API was introduced by Android v23 and is used in connection with
the new permission request system. From Android v23 onwards, some
permissions such as Location permissions cannot only be granted via
Android's Manifest files. An additional runtime check/request system
was introduced which forces applications to prompt the user
the first time a privileged function is called. Such user prompt
responses
are returned to the current application via the
Activity.onRequestPermissionsResult(..) callback.
This change add Qt API to nicely check & request permissions. For now
this is private
API which can be used to fix permission problems in other Qt
compontents. Later Qt versions will introduce a public API to
QtAndroidExtras.
[ChangeLog][QtCore][Android] Introduced a mechanism to forward
permission related callbacks on Activity objects to interested parties.
Task-number: QTBUG-55035
Task-number: QTBUG-50759
Change-Id: I64ee748d741b39e35c4713ed9fdd15dd1d96dc56
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
The const QString &format variants of these methods lack adequate
control over the locale used; the Qt::DateFormat variants give only
limited control over the format string. So reference the QLocale
methods that provide the general case, in the docs of each. Also made
the \sa cross-referencing among these methods a little more coherent.
Task-number: QTBUG-55632
Change-Id: Icd0c8548045e74879e941ba089c3bdea78f14e34
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Fix inspired by Qt 4 sources. When we get drop events that are not
coming from the same application, it's unlikely that the keyboard
modifiers are in a sensible state (the usual XCB events are not sent
during drag and drop), so set the keyboard modifier state explicitly.
Task-number: QTBUG-49645
Change-Id: I9360f2b7ffeaa5243a4dfe7ccf96df134c5d2156
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Yes, yes, this is just a configure test, but why do something stupid
in the code and then have to shut up Coverity manually?
Fix by making it a global, which means it will be zero-initialized
(I didn't want to do the obvious = 0, as that could protentially
create a "0 used as nullptr" warning at some point in the future.
Coverity-Id: 59485
Change-Id: I49ecd28be983a0e42b420d20da0db34a872c6f44
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It's probably benign, but it causes Corverity to complain,
so always init all fields of QComposeCacheFileHeader.
Format the code so it can easily be ported to uniform init
later on.
Coverity-Id: 93043
Change-Id: Ifa1ccc3fa58dc813306917f216772fd24d4930c9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Q_CC_GNU is (__GNUC__ * 100 + __GNUC_MINOR__), so 510 is 5.10 not
5.1.0. The first GCC 5 release has support for -Wsuggest-override, so
it should really be 501.
Change-Id: I7b264af087cd4562ce8720c99b70116d7654ea5f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This function sends D-Bus messages directly (in huntAndEmit), so it
should only be called from the QDBusConnectionManager thread. Somehow, I
missed this in the Qt 5.6 refactoring of QtDBus.
Being called in the wrong thread means that there's a visible behavior
change compared to Qt 5.5: if the user code sent a method call or method
return/error and then emitted a signal, we'd have two threads racing to
send the D-Bus messages. This was observed in Telepathy-Qt code: certain
signals arrived before a method return, even though they were clearly
emitted by a queued QMetaObject::invokeMethod.
In addition to that, we have has an internal problem (though not
observed): the libdbus-1 timer and socket callbacks would be called in
the wrong thread and we no longer have protection against that.
Unit testing not possible since this is a race condition.
Change-Id: I9e96ecd4f6aa4ff0ae08fffd1471d002142613d6
Reviewed-by: Gustavo Pichorim Boiko <gustavo.boiko@canonical.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
It's a namespace containing only private things, but some of those get
used in some QtDBus tools. By adding a macro that expands to nothing,
findclasslist.pl will notice the namespace and add it to the ELF version
script.
Task-number: QTBUG-55897
Change-Id: I371f5b01e24a4d56b304fffd1472748cde56f0c3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
the code got factored out to an own toolchain.prf file, which is
load()ed from default_pre.prf, so no change at first.
however, on mac, we shadow toolchain.prf, and make it load() sdk.prf
first.
a side effect of this is that project files may not override
QMAKE_MAC_SDK any more, which seems to be no big loss. it is still
possible to override the sdk on the configure command line (but note
that this only ever worked for the target sdk).
it has also become harder to disable the use of an sdk altogether:
putting CONFIG-=sdk into a project file or the qmake command line has no
effect now. instead, it's possible to put it into .qmake.{conf,cache}.
to make it simpler again, it's conceivable to finally add qmake -pre,
which would allow setting variables before default_pre.prf is executed.
Change-Id: I149e0540c00745fe8119fffd146283bb214f22ec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The ASAN talk at QtCon was pointing out a out of
bound read in a vector.
Let's try to do something about it.
If the lazy initialization of compose table fails,
the first character handling still tries to actually
access it. Later characters are properly handled
in the caller.
Reported-by: Hanno Böck
Change-Id: Ieac3e95361abd0fcd06c555bcd00ca1c4d8f1931
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Since 5.7.0 this is not just a macOS feature. It's also not necessarily
limited to Ubuntu Unity, since the specification is open, and there's
work in progress to implement it on KDE.
Also fixed a couple of typos.
Task-number: QTBUG-54793
Change-Id: Idbc68ddafff4dea30649e634ca29f10703f60d3b
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
The pressure indicator is not handled for touch on the Hololens causing
touch heuristic to fail and not identify the press event.
Change-Id: I2aba95fde8aa9abfa3838cad6b3466ff8bc41811
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Although we cannot really show anything but application modal
dialogs on iOS, falling back to using non-native dialogs for
window modal seems unnecessary strict; In practice you will
never have a work flow on iOS where you have several windows
visible, and at the same time, need to show a dialog that
blocks only one of them.
This patch will lift the restriction, and handle window modal
as application modal on iOS.
Task-number: QTBUG-55909
Change-Id: I581c1a47724ee2bfc2e041672c82c25ed34b2b2d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
In case temporary system tray icon is saved to /tmp, scale it according
to current devicePixelRatio() instead of using hardcoded 22x22.
Change-Id: I2adf2151da3241f4600f8645e323346daabcec4b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Delete references from menu to its containing item, and vice versa.
Fixes https://launchpad.net/bugs/1620937
Task-number: QTBUG-55966
Change-Id: I58f0f0a90184bee4b0466c28d91c670a34fa65a5
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This fixes a bug where notificationClosed() and actionInvoked() slots
were called more than once, from previous alive notifier instances.
Change-Id: I4cb4dfc27ee129bc5282fbd8e0961959d0765112
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Instead of trying to keep that variable in sync with platformMenuBar
state, just check whether platformMenuBar exists instead.
Now QMenuBar::isNativeMenuBar() is more reliable, and will not return
true if the QPA plugin provides no platform menu bar.
Also, remove useless restrictions for code using isNativeMenuBar().
That method is available on all platforms for a long time, not only on
macOS or WinCE.
This makes sure local menus do not appear if global menus are available,
and setVisible(true) is called.
Change-Id: I7a5944c64376b4714a38ad981089df8a151c3403
Task-number: QTBUG-54793
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
If the sloppy menu popups - send the leave event to the last active
menu (except Cocoa), because only currect active menu gets enter/leave
events (currently Cocoa is an exception).
Check that the menu really has a mouse before hiding the sloppy menu -
don't rely on enter events.
This patch removes some unnecessary synthetic mouse enter/leave events
from QMenu which causes event duplications with different mouse cursor
position.
Refactor sloppy menu timer handling - start or restart timers on mouse
move events. Enter/leave events are not reliable.
Fixes:
- better enter/leave events handling for native widget actions,
- reduce duplicated enter/leave events for menu actions,
- better handle torn off sloppy menus.
Partially reverts: 0ed68f3f58
Amends: 57ecd5aeeb
Task-number: QTBUG-53068
Change-Id: I7ad56ac1619db124915d373fab82d0512d44c90e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This prevents getting "QWidget::showEvent()" when hiding minimized
widget on some WMs like Marco or Xfwm4.
If QWindow is minimized and it gets the new "XCB_WM_STATE_WITHDRAWN"
event from XCB, then don't change the QWindow state.
Task-number: QTBUG-55942
Change-Id: I90cfc2bf55e507864ad8f26c8f569ea562c27314
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
The move constructor as well as member-swap were dealing with the
'unused' field as if it would be usable. But as the comment in the
default ctor suggests, the field can never be used in Qt 5, due to
the inline dtor.
So, don't bother with the field. Doing so only triggers checkers
such as Coverity.
Also mark the field for removal in Qt 6.
Coverity-Id: 154503
Coverity-Id: 154510
Change-Id: If42c5ed66d1133e651de7477f3313b3989b64bc9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Found by UBSan:
qstring.h:1160:44: runtime error: null pointer passed as argument 1, which is declared to never be null
qstring.h:1160:44: runtime error: null pointer passed as argument 2, which is declared to never be null
Fix by avoiding the memcmp() calls if there's a chance that they
might be called with nullptr.
While at it, also implement !=, >, <=, >= in terms of ==, <,
and add a test, because this particular UB was not fingered by
any of the QtCore test cases, but by a Qt3D one.
Change-Id: I413792dcc8431ef14f0c79f26e89a3e9fab69465
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
I actually doubt it's Linux-specific (more like all Unix), but the
changes are in files called "linuxaccessibility".
Change-Id: I9093948278414644a416fffd14744ae826b83303
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Change-Id: Ie1d6d7f3adf61b482b8e797849dbb2b3053fe720
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
qstyleoption_cast should use Q_NULLPTR to represent a null pointer.
Task-number: QTBUG-45291
Change-Id: I85078ceb435b310daf63db2ed771be2f36cf3e4f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This one selftest is currently blocking OS X 10.11
from entering the CI. It can't be reproduced when
run manually.
Task-number: QTBUG-55155
Change-Id: I4553ef2d7813b29f5dc8577976c4482686346504
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
This has undesired effects when converting a QSqlRecord to JSON.
A char(0) e.g. has special semantics that are undesired when
reading a Tinyint column.
I don't think that returning bool for the special case of a
Tinyint(1) is required. This also did not happen before, and
is also not happening when not using a prepared statement.
Instead, a plain int/uint QVariant is returned.
This patch extends tst_QSqlQuery::integralTypesMysql to also
cover reading and writing booleans from/to a MySQL table column
of type Tinyint(1). Additionally, the reading is now also done
with a prepared statement and we also check the raw variant
value.
The broken behavior fixed by this patch was introduced by me in
commit 194403a348.
Change-Id: I028a3abd83fdd2b42d98d478950d205e5b6bbeb5
Task-number: QTBUG-53397
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Child widgets should get the show/hide event when the TLW changes its
state, because child widgets are also visible or invisible. This
restores the Qt4 behavior (fixes the Qt4->Qt5 regression).
Restoring/minimizing the TLW now sends the spontaneous show/hide event.
Show events are now handled also in the expose event handler in the
QWidgetWindow class, because the show event must occur before the
expose event to avoid possible flicker e.g. the OpenGL content. This
can happen e.g. on XCB platform. If the "WindowStateChange" event occur
before the expose event (e.g. Windows platform) then the code in expose
event handler will be ignored to prevent event duplications.
Added autotest.
Task-number: QTBUG-50589
Change-Id: Ie9a9329b1f29bff876de28d5948d0d5fb6bc1f05
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
When you would start to drag a tab, and then drag it in the other
direction along the point where you started the drag, the tab would fail
to follow the mouse for a distance twice the "startDragDistance", before
jumping to the mouse again.
Fixed this by only taking into account the "startDragDistance" when
checking whether a drag is started, and to rely on the "dragInProgress"
variable otherwise.
Change-Id: I5dd4ebd8340fef7e870f087be68c5097b49728cb
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The iOS 10 SDK have introduced a protocol CAAnimationDelegate, which is
required for CAAnimation delegates. So we let our delegate implement it.
Since the SDK is not out yet, we need to support both version 9 and 10
for now.
Change-Id: I2624d8150c39439540a6554cba4921e3b9a2f0cf
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Source (.cpp and .h) files should not be executable.
Change-Id: I021d8733185d73d071fcaf3df7e529862a490b63
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Regression introduced in c32ef0a725
The expansion vector can be empty, in that case it is not allowed to
call constLast()
Task-number: QTBUG-55853
Change-Id: I47aa8eb7507ee91662215df42b4a66eebaa32bb5
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
If no filename is stored in the faceId() of the
font engine, then the PDF engine will bail out and embed
each glyph separately instead of embedding the font. This
would cause PDFs to be huge and unsearchable when high-dpi
was active, since we will automatically default to the
DirectWrite engine in this case.
[ChangeLog][QtGui][Windows] Fixed embedding fonts in PDF when
dpi scaling is active or when the hinting preference was
none or vertical hinting.
Task-number: QTBUG-54740
Change-Id: I20630595f51660109c5a12c52076738a04036520
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Partially revert 7fc2864dc5.
Entries should be kept until Qt 6 for source compatibility.
Task-number: QTBUG-55973
Change-Id: I09346fcd9227224f878f5ee064152e85f075ae09
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>