The warning comes from the MS headers, not from the compiler.
Task-number: QTBUG-59576
Change-Id: Ie67d35dff21147e99ad9fffd14acd7fb628fa1d4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Task-number: QTBUG-59218
Change-Id: Ic839a36af1ecab39da0c3394c34181b6717e24e2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
QUrl::isRelative(str) would be false for such files, so first check for
file existence before doing any URL parsing.
Change-Id: I51b6229251ad94877ac408b2f8018456d3e10a36
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When a text block is empty, and we are adding preedit text to it,
we need to merge the format of the preedit text with the current
format of the cursor, otherwise we will use a default format and
then suddenly switch to the proper one when the text is committed.
The reason this becomes a bit complex is that there are no rules
preventing someone from using several ime attributes to specify
formats for isolated parts of the text, and no rules defining the
order of such attributes. So even if the common case is one
text format attribute for the entire string, we need to make sure
we also handle the other cases gracefully, e.g. when we are setting
different formats for different substrings and then providing these
out of order. To make sure we have these corner cases covered, we
also add a set of autotests.
[ChangeLog][Qt Widgets][TextEdit] Fixed initial char format of
input method text as it is in pre-edit mode.
Task-number: QTBUG-59196
Change-Id: I1e37928e3bd1395fec1b5591908d4c69b84eb618
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
psql driver was previously using QDateTime::toString() function which is locale-depndent.
Task-number: QTBUG-59524
Change-Id: I7f50f95b5c82e66476abfee24ad28b78b3257041
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Commit e0ea0f6178 optimized QChar <->
QString(Ref) comparisons by adding more overloads to avoid creating
QStrings from QChars just to compare them.
But these new overloads made existing comparisons to QChar ambiguous.
This was known at the time for QChar/int comparisons.
It has since turned out that also comparing to '\0' is ambiguous,
ie. not comparing to int or char per se is ambiguous, but comparing to
nullptr constants is, because QString(const char*) is just as good a
candidate as QChar(char)/QChar(int).
Since we allow QString/QChar comparisons, it seems logical to solve
the problem by adding QChar<->nullptr overloads.
[ChangeLog][QtCore][QChar] Disambiguated comparisons with nullptr
constants such as '\0', which 5.8.0 broke. As a consequence,
QChar<->int comparisons are no longer deprecated, as this was a failed
attempt at fixing the ambiguity.
Change-Id: I680dd509c2286e96894e13078899dbe3b2dd83bc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The mmap64 functions in all Linux libc fail to properly check that the
value fits in the system call parameter. I guess the developers just
said "16 PB are enough for everyone"...
Change-Id: Ic39b2c4fd9c84522a8fafffd14ac91567ce09c09
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Timer IDs have been reused since Qt 4.5 or thereabouts, so just checking
if the timer ID is in the timer dictionary is an incorrect check: our
timer may have been deleted and replaced by another with the same ID.
Instead of deleting the WinTimerInfo object, let's just mark it as
unregistered by setting timerId to -1 and cooperate in deleting at the
appropriate places. Since unregisterTimer skips deleting if inTimerEvent
is true, the appropriate places are everywhere that set inTimerEvent to
true.
Change-Id: I057e93314e41372ae7a5ff93c467767c8a6d92ea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
in the vain hope to get the CI unstuck again.
Change-Id: I1b01bb1d59a8850f68d1d80838f5606f4159bcbd
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Much simpler, no memory allocation, no locking.
Change-Id: Iae839f6a131a4f0784bffffd14a9e70c7b62d9a7
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
the View's position and metrics are in pixels, not points
Change-Id: I285d5378db98187f54019bff9b8a1cde05dc3b35
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
QWindow::setVisible calls QWindowPrivate::applyCursor without checking
if screen() returns null. This patch adds a check in QWindowPrivate::applyCursor
that the screen is not null. Now that it is tested there, no need to test
it from the other caller (setCursor)
This patch should not change behavior of setCursor at all, it should only
fix the crash when coming from setVisible
Task-number: QTBUG-59528
Change-Id: I06bbdb4e04c02ac840ba637242d1f2cfde5bdd62
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The constructor is not only disabled under QT_NO_CAST_FROM_ASCII,
but also under QT_RESTRICTED_CAST_FROM_ASCII.
Change-Id: I7bbaf2891913d5256dff7f80c49075ea3326155a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
- recursion is not needed for walking up the parent chain;
- use camel-case, modal_window -> modalWindow;
Change-Id: I4b7697f2388fd16f11be67ba475bd63ad249d89e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Made change to clear the hover index when the mouse leaves the widget.
This will ensure the component does not think the item still has the
mouse over it.
Task-number: QTBUG-46785
Change-Id: I34b7f0e171e9cf07ca23150af1b0e6e59a10a58a
Reviewed-by: David Faure <david.faure@kdab.com>
Cross-compilation on linux with mingw-w64 failed, since it provides
all libraries in lowercase name.
Change-Id: I8e82a4504d4ec9d3047af6b1d6a11945754f182d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This corrects an issue where the file system paths returned for some
QStandardPaths values on Apple Platforms would be URL encoded, for
example having %20 instead of an actual space character.
Task-number: QTBUG-59389
Change-Id: I771a44eb20b756842c324ac6fc9bdc475ce84826
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Stale Lock files in the future can happen in some situations. For exemple
two computers with different clocks access the same file system. It could
be that one of the timestamp is totaly off (several years into the future).
[ChangeLog][QtCore][QLockFile] Fixed a deadlock occurring if a corrupted
lock file's modification time is in the future.
Change-Id: I8dac98a0e898c76bcef67f8c195e126c996b6add
Reviewed-by: David Faure <david.faure@kdab.com>
Makes sure we don't use backslashes on Windows systems, which could lead
to the following warnings being emitted:
In file included from main.cpp:43:0:
repparser.h:2:10: warning: unknown escape sequence: '\.'
#line 57 "..\..\src\repparser\parser.g"
caused by lines like
#line 57 "..\..\src\\repparser\parser.g"
Change-Id: I6cfe0e39a2a58eb39f9d385ece30374bcfa09e05
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
GCC 4.8 seems to get the failure memory order wrong when using the
overload that only accepts one memory order and produces errors such
as:
bits/atomic_base.h:577:70: error: failure memory model cannot be stronger than success memory model for '__atomic_compare_exchange'
return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 0, __m1, __m2);
^
(as seen on Android).
Fix by explicitly passing the failure orders corresponding to the
success orders, as specified by the standard:
relaxed → relaxed
release → relaxed
acquire → acquire
acq_rel → acquire
(cf. http://en.cppreference.com/w/cpp/atomic/atomic/compare_exchange).
Task-number: QTBUG-59399
Change-Id: If046e735888cf331d2d6506d8d5ca9aa7402f9ad
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
If a later month-or-day were to have a name that's a prefix of an
earlier one's name, the code would have selected the longer name as
best match when the text matched is the shorter name, simply because
it found that one first. (Found, on Turkish Cuma(rtesi)? in Thiago's
recent new test, by reversing the loop that iterated the list.)
Make an exact match win and a match of a full name beat any prefix
match of the same length.
Change-Id: I8d954b83ccc25e4f47af2e558036d714685cef5e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Decouple from the callers' offset into a larger list; just search for
an entry in a list, let the caller deal with the offset. Also, defer
a .tolower() to save the need to allocate a copy of each list entry.
Change-Id: I748d5214c2cc6dc592fe2bd41e3f8150f71c335b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Since QPrinter can be used to write to PDF and this was working in
previous versions, there is no reason not to enable it here.
Task-number: QTBUG-58376
Change-Id: I5760b74881995679e8df657b7d770bba00a33551
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Simplifies everything and avoids bugfixes in one not propagating to the
other.
Change-Id: I95c9e502ccc74af3bcf0fffd14a69f0cde60cc8c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Both SPDY and HTTP/2 work with a single qhttpnetworkchannel (and this means one
socket per qhttpnetworkconnection). Normally, HTTP/1.1 connection is using up to 6
channels/sockets though. At the moment a failure to negotiate SPDY/HTTP/2 leaves us
with a downgraded HTTP/1.1 connection (with only one channel vs. default 6).
Since we initialize channels (and establish connections) in a 'lazy' manner
it's ok to pre-allocate all 6 channels and then either use 1 (if SPDY/HTTP/2
indeed was negotiated) or switch back to 6 in case of failure.
Change-Id: Ia6c3061463c4d634aaed05ce0dde47bfb5e24dd8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Some were 5s, others 1s. Pick one (the higher).
Change-Id: I81929d4f49c2e41b4d4b75c3e2bf8ff75af868ad
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Let's take the beginning of the description: WaitForSingleObjectEx can
be up to 16 milliseconds early. This is proven by the fact that there
are tests doing:
wait(waitTime);
QVERIFY(timer.elapsed() >= waitTime - systemTimersResolution);
and failing.
Task-number: QTBUG-59337
Change-Id: Iae839f6a131a4f0784bffffd14a9a79523d69d94
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Update the treemodelcompleter example to use the new QRegularExpression
class in place of the deprecated QRegExp.
Change-Id: I9fa91ca6e847603de37019e4ca86fc69a51a3772
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
The example creates a view on the heap but doesn't delete it on
application end. This patch uses a QScopedPointer to fix that.
Change-Id: I3b0c8589999d243c193bd02e1470c03eabfabe40
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
By default, it enabled only for Gnome
Task-number: QTBUG-59298
Change-Id: Ib44f52b3175ed1904f24ec9e21f00ea3f3334287
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
When the insertion into the cache fails then it will delete the entry
for us which already calls releaseKey(). So we should not call it a
second time.
Task-number: QTBUG-58259
Change-Id: I816c6f29ef97fe3a245f145c4faf1e0649f72dc5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
It is ignored (and is unnecessary to begin with) in that case,
and emits an annoying warning which this patch silences.
Change-Id: I6059969724b203d6e0e2eea81ad3e3e8f8d536d6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
ResultStore never actually exists, only ResutStoreBase does. So casting to
ResultStore<T> and calling its member functions is UB. Put the type dependent
function as template member functions within ResultStoreBase and so we don't
need QtPrivate::ResultStore anymore.
Same goes for the iterator.
Change-Id: I739b9d234ba2238977863df77fde3a4471a9abd2
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
We should not check for platforms, but rather for features. Also, if
dbus is available it doesn't automatically mean that QProcess is.
Change-Id: I27ef5863fcb107cca1aa47abba95b734962adc33
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
The code in question is obviously checking for support of QProcess, not
for general bootstrap mode. You can manually disable QProcess, in which
case it is still not available after bootstrapping is done.
Change-Id: Ia99810b8900621911a31912034358a01af4f18a0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This macro adds a \youtube <ID> command that embeds a YouTube link
into the documentation.
The video container scales to a specified percentage of the available
horizontal area. It assumes a source aspect ratio of 16:9, but looks
acceptable with other ratios.
For backends that do not support <iframe> (e.g. QTextBrowser), shows
a clickable video thumbnail that open the YouTube link in an external
browser window. Unfortunately, QTextBrowser cannot load images from
a remote URL, so we need to store a thumbnail image in the .qch file.
Change-Id: I3a3a0c5a20dd90e5cec6357ba70a23ee47dbe825
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
For the windows file system engine, we add an extra macro to use
library loading if configured to do so, but avoid it on WinRT, as
none of the symbols would be found.
We also QT_REQUIRE_CONFIG(library) in the library headers and
exclude the sources from the build if library loading is disabled.
This, in turn, makes it necessary to clean up some header inclusions.
Change-Id: I2b152cb5b47a2658996b6f4702b038536a5704ec
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Parameters passed by value, like local function variables, are subject
to NRVO/return-by-move already, so adding std::move, even disguised as
qMove(), makes Clang warn about a pessimizing move.
Change-Id: I7d59bfee4cf7ecddee0874ee489367044c702643
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
On some stupid systems, execve() may clear the handler but not clear
the SA_SIGINFO flag.
This change now requires that sa_handler and sa_sigaction be in a union
together. We can't operate otherwise.
Task-number: QTBUG-59246
Change-Id: I33850dcdb2ce4a47878efffd14a84b48a8f6b1e8
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
QLocale::matchingLocales() simply created each locale using the basic
data, without (unless the matching conditions stipulated Language C)
applying number-options hacks that it applies everywhere else, when
creating the C locale. Thus the C locale in its returned list (if it
wasn't the only entry) ended up with the default number options,
without omiting separators in numbers. Thus QLocale::c() didn't
actually appear as an entry in the list. Discovered while
investigating QTBUG-58947.
Added a dumb autotest that checks various ways of getting the C locale
do actually give us equal locale objects. Fixed matchingLocales() to
apply the same hack as is used elsewhere for the C locale.
Change-Id: I263f31da623052b63171f5b5a83c65802383df21
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
On a multi-display system wide submenu might either appear on wrong
screen or not appear at all (depending on the specific display
configuration).
Task-number: QTBUG-56917
Change-Id: I40013b0bee340a01ae1c08a5e074afa63da4dbfd
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
This patch fixes 2 issues related to wide menus:
1) Menu took on full screen height when menu width was larger than
screen width;
2) On a multi-display system wide menu might appear on wrong monitor
(not the one where show event was triggered).
The idea is we limit parent menu and all its submenus within the screen
where it was opened.
Note that this patch fixes only geometry-related issues and there are
also some style flaws which need to be addressed (for example, currently
the text does not elide if it doesn’t fit to the menu’s width).
Task-number: QTBUG-56917
Change-Id: I7e9ff4a48bf03060d76e34d33a13ad6cc890c133
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
This fixes an issue which caused certain iOS projects to fail to link
when building with Xcode, and also fixes an issue where projects were
only ever built with -fembed-bitcode instead of -fembed-bitcode-marker
for debug builds with the makefile generator.
Task-number: QTBUG-58754
Change-Id: Icf0c9f0d64dbc0b38d6c48bf635c5383a78bd6d5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>