Commit Graph

31015 Commits

Author SHA1 Message Date
David Faure
035e0eafa6 QUrl::fromUserInput: fix handling of files with a ':' in the name
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>
2017-03-20 12:55:36 +00:00
Eskil Abrahamsen Blomfeldt
391e3aeef4 Fix char format of preedit text in empty text block
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>
2017-03-20 10:10:26 +00:00
Michael Jabbour
ac74abdf50 PostgreSQL: fix datetime format when system locale doesn't use arabic numerals
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>
2017-03-18 19:37:35 +00:00
Marc Mutz
5c724a6087 QChar: fix ambiguous comparisons with 0, '\0', ... for good
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>
2017-03-17 20:28:32 +00:00
Thiago Macieira
4ee7425794 Work around Linux libc overflow in mmap64
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>
2017-03-17 20:24:57 +00:00
Thiago Macieira
cdaea16964 Protect better against timer ID replacement
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>
2017-03-17 20:24:04 +00:00
Marc Mutz
1b73d13975 tst_QMimeDatabase: increase update-mime-database timeout to 4mins
in the vain hope to get the CI unstuck again.

Change-Id: I1b01bb1d59a8850f68d1d80838f5606f4159bcbd
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2017-03-17 20:08:56 +00:00
Daiwei Li
dfb6850b91 Android: Bearer jar shouldn't be a dependency if disabled
Task-number: QTBUG-59264
Change-Id: I960d5bff902b06ca5dda447fd60002a756a11e51
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-03-17 19:25:43 +00:00
Peter Seiderer
e9a7739e77 eglfs: fix x11 header related compile failure
Add egl config and QT_EGL_NO_X11 define (as all other eglfs project
files do).

Task-number: QTBUG-59427
Change-Id: Ifbb11eae0fdf0e58c0b7feecb9a7914a889c8f77
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-03-17 11:43:46 +00:00
Thiago Macieira
f418d1b26a Remove a Q_GLOBAL_STATIC with QMutex in favor of QBasicAtomicInt
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>
2017-03-17 06:10:16 +00:00
Konstantin Ritt
b21069d6fa Android: Fix Accessibility items positioning with QHighDpi enabled
the View's position and metrics are in pixels, not points

Change-Id: I285d5378db98187f54019bff9b8a1cde05dc3b35
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-03-16 20:05:34 +00:00
Olivier Goffart
5cda0172e0 Fix crash in QWindowPrivate::applyCursor when screen is null
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>
2017-03-16 18:03:24 +00:00
Marc Mutz
e364384d9f QChar: fix docs of (uchar) ctor
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>
2017-03-16 07:53:25 +00:00
Gatis Paeglis
c75e3f70b4 xcb: cleanup QXcbWindow::relayFocusToModalWindow()
- 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>
2017-03-14 11:41:32 +00:00
Dan Cape
4f324d4655 Fix item keeping hover highlight even when mouse has left it
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>
2017-03-13 15:47:10 +00:00
Samuli Piippo
edf0be818c Use lowercase name for iphlpapi library
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>
2017-03-13 09:39:19 +00:00
Jake Petroules
c0da37a806 Fix QStandardPaths values on Apple Platforms containing URL encoding
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>
2017-03-11 02:10:10 +00:00
Olivier Goffart
b52b509ae4 QLockFile: Don't deadlock if the lock file has a mtime in the future
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>
2017-03-10 17:09:24 +00:00
Kevin Funk
137e6632c8 qlalr: Use forward slashes in #include directives
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>
2017-03-10 08:47:19 +00:00
Marc Mutz
5cc0de2e08 QAtomic: pass explicit failure memory order to std::atomic::compare_exchange_strong
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>
2017-03-10 08:24:41 +00:00
Edward Welbourne
9ed389bf15 Bugfix in QDateTimeParser's findTextEntry()
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>
2017-03-09 19:27:13 +00:00
Edward Welbourne
326f1fdb7d Simplify QDateTimeParser's shiny new findTextEntry()
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>
2017-03-09 19:27:06 +00:00
Andy Shaw
65bafcc29d Android: Enable the usage of QPrinter
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>
2017-03-09 11:04:03 +00:00
Thiago Macieira
7fd483f3de QDateTimeParser: Merge the code to parse names of months and weekdays
Simplifies everything and avoids bugfixes in one not propagating to the
other.

Change-Id: I95c9e502ccc74af3bcf0fffd14a69f0cde60cc8c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-03-08 16:44:54 +00:00
Kevin Funk
375bbcdd01 qlalr: Fix and re-run qlalr on its own sources
So the generated files are up-to-date again.

Generated with:
  qlalr --qt --no-lines --no-debug lalr.g

Change-Id: I3c4adb0083be7e66fed3db92c079493b574295aa
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-03-08 15:05:55 +00:00
Timur Pocheptsov
8b9d246225 QHttpNetworkConnection: fall back gracefully to HTTP/1.1
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>
2017-03-08 14:14:26 +00:00
Marc Mutz
9e7d769462 Use the same timeout value for all QTest::qWaitForWindow*() functions
Some were 5s, others 1s. Pick one (the higher).

Change-Id: I81929d4f49c2e41b4d4b75c3e2bf8ff75af868ad
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-03-08 07:19:45 +00:00
Thiago Macieira
3a1f4b186d Stop trying to discover the system timer resolution on Windows
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>
2017-03-08 05:52:47 +00:00
Samuel Gaist
2d81968c3b Example: migrate treemodelcompleter example to use QRegularExpression
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>
2017-03-07 23:11:31 +00:00
Samuel Gaist
9e933de7f2 Example: fix memory leak in relationnaltablemodel example
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>
2017-03-07 23:11:20 +00:00
Nikita Krupenko
895b4e6f89 Enable QStyleHints::useHoverEffects for KDE and other unix systems
By default, it enabled only for Gnome

Task-number: QTBUG-59298
Change-Id: Ib44f52b3175ed1904f24ec9e21f00ea3f3334287
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2017-03-07 15:22:17 +00:00
Thiago Macieira
e7295c959b Add -Wfloat-equal to Qt's header clean check
Task-number: QTBUG-57649
Change-Id: I15b62e0f9cec482fbb40fffd1490d802c54bf0fe
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-03-07 10:51:54 +00:00
Andy Shaw
7eb11df19e Don't call releaseKey a second time if the insertion fails
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>
2017-03-07 08:15:54 +00:00
Jake Petroules
c0af8cef2f Don't pass -headerpad_max_install_names when using Bitcode
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>
2017-03-07 01:05:16 +00:00
Oswald Buddenhagen
473248df14 put load(qt_plugin) at end of project file
amends a28364bc1.

Change-Id: I8e6044abcbfffde8688d87cd3aa722c0c362534c
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-03-06 18:43:26 +00:00
Olivier Goffart
6797570a59 Fix UB in QFutureInterface: invalid casts from ResultStoreBase to ResultStore<>
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>
2017-03-06 18:32:28 +00:00
Ulf Hermann
a170c974a5 Fix building of various examples and tools with -no-feature-process
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>
2017-03-06 14:16:13 +00:00
Ulf Hermann
c925400bde qmake: Check for QT_CONFIG(process) in qmakebuiltins
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>
2017-03-06 14:16:08 +00:00
Topi Reinio
8a1880029d Doc: Add macro for embedding YouTube videos
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>
2017-03-06 13:43:58 +00:00
Ulf Hermann
d6330a19b2 Use QT_CONFIG(library) instead of QT_NO_LIBRARY
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>
2017-03-06 11:27:20 +00:00
Marc Mutz
f31dbeb4c7 tst_QVersionNumber: fix Clang warning about superfluous move
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>
2017-03-06 11:13:17 +00:00
Thiago Macieira
37fd42459e forkfd: fix calling the old signal handler when there wasn't one
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>
2017-03-06 09:56:35 +00:00
Edward Welbourne
a1c27748d2 Make QLocale consistent about special handling of the C locale
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>
2017-03-06 09:51:49 +00:00
Oleg Yadrov
f2e103296f QMenu: make wide submenu appear on the same screen with its parent menu
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>
2017-03-04 05:37:30 +00:00
Oleg Yadrov
ad5565b643 Wide QMenu: fix size and position
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>
2017-03-04 00:43:50 +00:00
Oleg Yadrov
d46afc24c1 QMacStyle::sizeFromContents(CT_Menu): take proxy style into account
This is missed in 10d0f4cba9

Change-Id: If3566eb4b1f00f6882c290c83e10e51e1bf1d6d9
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-03-03 21:21:45 +00:00
Jake Petroules
840aa67146 Fix Bitcode handling for both makefile and Xcode generators
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>
2017-03-03 20:25:52 +00:00
Thiago Macieira
b736d2d7ce Remove the last remaining non-SSL use of QMutexPool in Qt
Task-number: QTBUG-59164
Change-Id: Idd5ceba1eba34cb78c46fffd14a734735991f4fb
Reviewed-by: David Faure <david.faure@kdab.com>
2017-03-03 15:29:57 +00:00
Stig Bjørlykke
62e6aa6195 QVector: Avoid implicit conversion warnings
This fixes compiling an application using QVector and -Wshorten-64-to-32
on a 64-bit system without getting this warning:

 ... 5.8/clang_64/lib/QtCore.framework/Headers/qvector.h:695:18:
 warning: implicit conversion loses integer precision: 'typename
 iterator_traits<QString *>::difference_type' (aka 'long') to 'int'
 [-Wshorten-64-to-32]
    int offset = std::distance(d->begin(), before);
        ~~~~~~   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 ... 5.8/clang_64/lib/QtCore.framework/Headers/qvector.h:731:35:
 warning: implicit conversion loses integer precision: 'long' to
 'const int' [-Wshorten-64-to-32]
    const int itemsToErase = aend - abegin;
              ~~~~~~~~~~~~   ~~~~~^~~~~~~~

 ... 5.8/clang_64/lib/QtCore.framework/Headers/qvector.h:740:39:
 warning: implicit conversion loses integer precision: 'long' to
 'const int' [-Wshorten-64-to-32]
    const int itemsUntouched = abegin - d->begin();
              ~~~~~~~~~~~~~~   ~~~~~~~^~~~~~~~~~~~

Change-Id: I52d85908f4aac20c7e9ac8063ac760ce52f85541
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-02 20:03:03 +00:00
Olivier Goffart
2b13ba0ca0 Fix UB in QWidgetItemV2::~QWidgetItemV2
We might get there because 'wid' is already partially deleted (called
from ~QObject). In that case, it is an undefined behavior to call a
QWidget member function on it. Use QObjectPrivate::get instead.

Change-Id: I6da314bf8385684d1332aa031a2d92012941303b
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-03-02 15:31:28 +00:00