Commit Graph

29478 Commits

Author SHA1 Message Date
Alex Trotsenko
f063cb7f81 QAbstractSocket: replace a reference to outdated state in documentation
Change-Id: I4acaed88a46acae1ad117b0a95141b20d8744e12
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-08-25 12:49:13 +00:00
Ulf Hermann
de7f281d7a QLocale: Fix wrong assert
The endptr from reading the exponent of a 'g' form snprintf result
should not be past the end of the string we're reading from. It has
nothing to do with the 'e' sign.

Task-number: QTBUG-54482
Change-Id: I8bdee917b8d21fdc94c255548ad7e008431a07fa
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-25 12:45:50 +00:00
Allan Sandfeld Jensen
68c2bf1a1a Correct use of qt_div_255
qt_div_255 does a fast rounded division, the form of rounding is however
only valid for positive integers.

Correct one case where it was used incorrectly and add it one place
it would be valid, and adds a comment to the function.

We were using the optimization (x*a + y*(255-a))/255 ==
(x-y)*a/255 + y but that makes the division by 255 potentially
negative.

Change-Id: Ie53aa82b66ef801f5d43f8d2ec48880cb4972f69
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-08-25 12:12:14 +00:00
Mike Krus
882f344964 Pass no-pkg-config to qmake from config.test if appropriate
On macOS, even if pkg-config is present in the path, configure will by
default correctly ignore it and set no-pkg-config. However, this was not
propagated to qmake when invoked from config.test, so tests which rely on
that did not work.

This was leading to pkg-config (installed from homebrew) to be used in
the libpng test, so it succeeded. But the later Qt build would fail to
find png.h from homebrew, as it correctly ignores pkg-config.

Task-number: QTBUG-55011
Change-Id: Ic6fb866bea0551f528da56cb545174dcd9bacf0d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2016-08-25 12:09:13 +00:00
Thiago Macieira
1f7f73b86a compile.test: append any unknown arguments to the qmake command-line
This allows setting of variables, like FOO=bar.

Yes, it's intentional that there are no quotes.

Change-Id: Ib306f8f647014b399b87ffff13f1d9e6a10fa2f8
(cherry picked from commit e79200bf7f)
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2016-08-25 12:09:08 +00:00
Frederik Gladhorn
ddb2fd3f5e Fix the mysql configure test on RHEL 6.6
On RHEL 6.6, mysql_config --libs returns "-rdynamic" among other arguments.
The configure test (config.tests/unix/mysql) would end up passing that
to qmake. qmake responds with "***Unknown option -rdynamic ..."

Change-Id: Ib1300e62aec8a5d866359f3eaea88d9648c872b9
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
(cherry picked from commit d7e27e4d26)
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2016-08-25 12:09:03 +00:00
Oswald Buddenhagen
e41263b61a fix build with qt-xcb and another installed qt in a system location
amends fc1092cf, necessary because of (the earlier) a28364bc1.

Change-Id: I5c86bcb27854994e59228fd205c799396464554d
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-08-25 12:08:56 +00:00
Friedemann Kleint
4f3b5fab38 QWidgetPrivate::setWindowFlags(): Fix checking for changes in Qt::Window
Store the result of the comparison before the calling QWidget::setParent()
passing the flags which can modify q->data->window_flags.
Previously, this led to the condition triggering when a child window
was becoming top level, causing the geometry to be changed (notably for
fullscreen windows on Windows, where fullscreen is merely emulated).

Amends change 5e99b07a07.

Task-number: QTBUG-54906
Change-Id: I9369d7d9f886451cfdb933746a4572593ffa074a
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2016-08-25 12:05:55 +00:00
Oswald Buddenhagen
15c39dfe3d don't cache test result after pre-dep failure
there is no point in doing that, as we don't load it in that case
anyway. in fact, it would lead to caching a new result in every run.

Change-Id: Ia5cb27fa8a5d705d7f32a785b1e3b944f92d8929
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-25 11:59:54 +00:00
Oswald Buddenhagen
0f68ac2512 don't cache results of build_parts and skip_modules
as these tests do nothing but validating the command line, caching the
result is more confusing than anything else.

also make the tests silent, so they don't clutter an otherwise fully
cached configure run.

Change-Id: Ifc3d65278769b36a056650f077fd6274a7e192e7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-25 11:59:15 +00:00
Oswald Buddenhagen
b71d6ac713 ensure that no license queries are made in -redo mode
implement it in configure.exe and fix it in configure.sh.

Change-Id: I30764f4cba4bad0f23bfb40ce7a2ca614e1afd71
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-25 11:58:46 +00:00
Oswald Buddenhagen
c92f0d2049 make failure to apply -redo fatal
like it already is on unix.

Change-Id: Id55f8743ae0879fabe13c19ea214da74a35e43a6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-25 11:58:17 +00:00
Oswald Buddenhagen
1183e59dd9 remove pointless conditional from reloadCmdLine()
the function is (nowadays) only called when the condition is true.

Change-Id: I014f736c28c37b066a3f62e22f9002c025734386
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-25 11:57:52 +00:00
Oswald Buddenhagen
1967fc7f63 fix location of config.{opt,status} in top-level builds
write them to the top-level build dir, not the qtbase build dir.
the old files will be still used for a smooth migration.

Task-number: QTBUG-46974
Change-Id: I6eae678ffc7dfb921ecd9e9012e79e3b915ad3fa
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-25 11:57:45 +00:00
Oswald Buddenhagen
d76a756b03 clean up qconfig/qmodule.pri handling in configure
instead of saving the files away and restoring them afterwards, use the
new and shiny discard_from() function to throw away everything the files
might contain.

strictly speaking, this is not precise, as the pris may also use *=, -=,
and possibly other operations which cannot be trivially undone, but the
purpose is essentially to discard the special outputs of some features
which may affect subsequent tests, for which this is sufficient.

as a side effect, the failure to load qmodule.pri is not fatal any more
(like for qconfig.pri), to save the pointless effort of ensuring that it
exists.

Change-Id: I07625b60c4f2e27b21206b2c16d24ab111737395
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-25 11:56:45 +00:00
Oswald Buddenhagen
12bb328bb0 add discard_from() function
this function discards all values that come from a specific file. it
will be needed for configure bootstrapping, but is too obscure to
document it for general use.

Change-Id: I62c18aeb1847712e33d0599dbb0b90ffa1722438
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-25 11:56:07 +00:00
Oswald Buddenhagen
6a9f38a11d fix argument order in recursive qmake invocations
the inherited arguments may contain the '--' argument, which turns
additional arguments into configure arguments. the simplest fix for
that is injecting additional arguments at the front, not at the end.

Change-Id: I7cc00a42f0148e5ccbbeda2ad59fa8c63749f02d
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-25 11:55:32 +00:00
Oswald Buddenhagen
de39c3bcdd remove dead code relating to help output
amends mostly c027cffbe, but also pre-historic d32a03469 (2005).

Change-Id: I2a897556191cff761ea8440bc5b7e47077947d75
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-25 11:55:01 +00:00
Oswald Buddenhagen
d7a2852dd4 remove extra empty line before configure report
Change-Id: Id985e4738dda89e4d1af1ceccda33d830316e66a
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-25 11:54:41 +00:00
Oswald Buddenhagen
3277143f96 make include(,<into>) implementation a bit less convoluted
this goes at the cost of <into> without the subsequent dot not being
filtered before the result insertion any more. that's not expected to
be a problem, as it's not particularly useful to iterate the target
namespace without the dot in the first place.

Change-Id: Ib3497a60613b4c8c26676fe76b731239e427b8a7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-25 11:54:32 +00:00
Oswald Buddenhagen
f137957e08 optimize operator+ ProString vs. char*
we have all necessary overloads now.

Change-Id: Ic4472eba15d4234e968fcb9443d0f79011aa43fd
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-25 11:54:27 +00:00
Allan Sandfeld Jensen
eb19cf15a9 Fix reading of font names
Correct a boundary check so the last present name can be read, and
correct a typo that caused non-present names to read garbage.

Change-Id: Ia9d0d3af7431c1f5f02824e884efb5f6f454dc5d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-08-25 11:00:30 +00:00
Alexander Volkov
3f64156e91 QScreen manual test: show names of enum values
It's more user-friendly to show
    primaryOrientation LandscapeOrientation
instead of
    primaryOrientation 2

Change-Id: Ic1659b9253cd492bef347d6840cf3cf6e6d2c94f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-25 07:23:58 +00:00
Friedemann Kleint
1e6630b54c Fix crash when exiting while stacked modal dialogs are shown
Remove QWindow instance from QGuiApplicationPrivate::modalWindowList
in the destructor.

Task-number: QTBUG-54566
Change-Id: I1f07fb46a371f69f04907b20657f3b05571445bd
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2016-08-25 06:50:32 +00:00
Friedemann Kleint
d0012ad64c Windows style: Scale more native metrics per monitor
Fix a few places that were overlooked in
change 29c6e39086.

Most notably, fixes MDI subwindow titles disappearing
when moving windows between monitors.

Task-number: QTBUG-49374
Change-Id: Ie6ffabc4909064e649a3820d9aa952f3991ef06b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-08-25 06:50:22 +00:00
Marc Mutz
e83f6aaaa6 QMimeProvider: fix quadratic loop
Calling QMutableListIterator::remove() in a loop constitutes quadratic
behavior (O(N) function called O(N) times).

Fix by splitting the loop, simplifying it by sharing conditions, and
using std::remove_if(), which is linear.

Removes one more use of mutable Java iterators.

Change-Id: I88bde414777b50996e546bc8cb238619ea4fb645
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2016-08-25 04:14:24 +00:00
Lorn Potter
2aea77dbcb Fix UI freeze when using network-manager bearer plugin
This reduces the amount of dbus signals generated when many wifi AP's
are around

Task-number: QTBUG-54814
Change-Id: I4bdd5f0bfe173d6db63f3d975a98583c6c0fc5db
Reviewed-by: Richard J. Moore <rich@kde.org>
2016-08-24 23:39:10 +00:00
Marc Mutz
6a44c0ee75 QKeySequence: remove 239 unneeded relocations
Same change as in QColor (d38f86e50b).

  relocs: -239
  text:   -586B
  data:  -3840B

(optimized GCC 6.1 Linux AMD64 build).

Change-Id: I180e9b65736481dd4e82dc68ef6c3f7541e205cf
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-08-24 21:48:52 +00:00
Marc Mutz
6a35c6d491 QKeySequence: replace an array end marker by static size calculation
This improves code generation, since the compiler statically knows
the number of loop iterations. But it also fixes a compile-error
on Clang with a following change of the name field from char* to
char[].

Change-Id: I7ef18adf3cb9b34cd1b7235cb35cf26b7e349d92
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-08-24 21:48:35 +00:00
Tor Arne Vestbø
c1804bb5c1 multiwindow: Make it easier to test 1-N windows
Changes the --extrawindows option to --numwindows with a default of 3,
and layouts all windows in rows and columns so that they are all
exposed at startup.

Change-Id: I5e8d63a14b778bcddc2fee3bf7e78d6664532b5b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-24 20:56:28 +00:00
Tor Arne Vestbø
10fe509123 multiwindow: Use QCommandLineParser instead of parsing manually
Change-Id: I9d9e3ede6c8cce3aa1b42d0e98a0a5b19fefc73c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-24 20:56:22 +00:00
Tor Arne Vestbø
d856d0e146 Limit glyph caches per QFontEngine to four per context, not four in total
The limitation of four glyph caches per font engine was to prevent memory
spikes during rotation of text. But in an application with multiple top
level OpenGL windows, each with their own context, we'd end up trashing
the list of glyph caches during rendering, even if each window just drew
the same static text.

Having a shared context between the windows helped a bit, but had other
performance issues due to the globally shared state, so the better approach
is to limit the caches to four per context.

This brings the multiwindow manual test from a grinding 4fps on macOS
to a smooth 60fps for 20 concurrent windows.

Task-number: QTBUG-52372
Change-Id: I26edd5f6edb5c7818e14b2203af062df19ae7127
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-24 20:56:14 +00:00
Tor Arne Vestbø
59ee2584e2 Make QWindow backed QOffscreenSurfaces easier to identify
Change-Id: I2b4d9b752f4b356cb3b0019dcfd4aab2edc30e94
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-08-24 20:56:08 +00:00
Jake Petroules
acfc1cc362 Fix warning: 'UITextInputTextFontKey' is deprecated
first deprecated in iOS 8.0 - Use NSFontAttributeName instead

Change-Id: I763efc498644ac234a712ebcefd07111b4444c98
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2016-08-24 20:44:39 +00:00
Jake Petroules
8de6752496 Fix issue causing pch configure test to always fail
This fixes a regression introduced in
4a1bafcc4e.

Change-Id: Iafeec043c39af79cee8b53cf74dcd452c03a4826
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-08-24 20:36:05 +00:00
David Faure
3e453abc7d QMimeType: use default locale rather than system locale
This makes it possible for the application to control which language
is used by QMimeType::comment()

[ChangeLog][QtCore][QMimeType] QMimeType::comment() now uses the default locale
rather than system locale, so that applications can control which language
is being used.

Task-number: QTBUG-50776
Change-Id: I82623b7c488035a4164fadaf37ebcc79a9fd6173
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-08-24 20:30:13 +00:00
David Faure
35b871b2b6 QStyleSheetStyle: don't call pixelMetric when not needed
fixupBorder does nothing when bd is null, i.e. hasBorder() returns false.

Change-Id: Ic88e3a793f32bd4ad25830ddad9dbd8100348279
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-08-24 20:29:49 +00:00
Oswald Buddenhagen
2c5eb3e668 fix conditions relating to host_build in non-cross builds
when it comes to compiler flags (be it warnings or include paths), it
doesn't matter whether we building/using bootstrap libraries, but
whether we are actually cross-building.

amends c55bdc271f and d8be8110a.

Change-Id: Idf988107e9cccc486672c0ee70dc9bdf8eab9d8c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-24 15:28:50 +00:00
Richard Moe Gustavsen
86ebd92add iOS, mkspec: update UUID parsing to support Xcode 8 beta
"simctl list devices" has changed output format in
Xcode 8 beta to include additional information placed
inside parentheses for each device. And this confuses the
scripts we use to parse and find UUIDs.

Instead of making the inline scripts even longer and more
complex, this patch will factor most of it out to a separate
perl script that reads out device information on json format
and parses the UUID.

Change-Id: I3cd4dc276ecda030fda1932073c8bf1e0bc85deb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-08-24 13:05:09 +00:00
Tor Arne Vestbø
0f8c2ab3d8 multiwindow: Base fps on number of frames swapped, not timing of last frame
Change-Id: I582e4f35b2702ac3792c5641fa10f74a79351bed
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-08-24 12:39:12 +00:00
Tor Arne Vestbø
16a421aa83 Xcode: Don't enable document versioning debugging
It results in passing an option on the command line that e.g. the
QCommandLineParser doesn't understand.

Change-Id: Ied08c930fab479b6432f025dfe861bdf22c513e6
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2016-08-24 12:35:45 +00:00
Eskil Abrahamsen Blomfeldt
660c34077e DirectWrite: Fix crash when embedding empty glyphs in PDF
Empty QPainterPaths can have one move-to element, so the test
to detect this case was incomplete. For empty glyphs returned
from DirectWrite this would trigger a crash. This is only
reproducible after also enabling embedding of fonts with the
DirectWrite engine.

Task-number: QTBUG-54740
Change-Id: I3fbbfb8d958818550d5ab5234242d39688b84811
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-08-24 06:11:07 +00:00
Raphael Kubo da Costa
a9474d1260 configure: Correctly detect clang's version on FreeBSD
"clang -v" on FreeBSD reports something like "FreeBSD clang version
x.y.z [...]" instead of just "clang version x.y.z [...]", which fails to
match the sed pattern in the configure script, resulting in qconfig.pri
having no clang version defined.

Augment the pattern so that both version strings match.

Change-Id: I5f38f8480f4b1156ca7147e32c1157a009557035
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-08-23 21:40:01 +00:00
Maurice Kalinowski
1e1eddb2de Fix crash in dumpConfiguration
Some qpa backends do not provide a QPlatformNativeInterface. Hence,
check whether return value is valid.

Change-Id: Iab46bc59a151aa244fcfebf58edb37496369db89
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-08-23 17:52:47 +00:00
Maurice Kalinowski
4d07042c70 winrt: Fix crash when clearing mimedata
Some autotests clear the clipboard by invoking setMimeData() with a null
QMimeData argument.

Change-Id: I4a9d3dfd41b2c52964e272fc1362162f47fd8cda
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-08-23 17:52:41 +00:00
Maurice Kalinowski
f1808e96c5 Fix crash for dereferencing zero
Some targets do not support QFileSystemWatcher causing
QFileSystemModel::iconProvider() to return zero.

Change-Id: I3d2b7034b9fb805237c66a7dcea4457bfa41d46d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-08-23 17:52:36 +00:00
Raphael Kubo da Costa
680ec54a76 QMutex: Make freelist() return a real global static
Since Qt 5.6.0, some applications such as Kate (built with clang, libc++
and libcxxrt) on FreeBSD occasionally crash with the following error
message on exit:

    QMutex::lock(): sem_wait failure: Invalid argument
    [or pthread_cond_wait in the 5.6 branch]

Investigation by Gleb Popov, Thiago Macieira and Olivier Goffart has
shown that this is caused by the fact that QDBusConnectionManager is a
Q_GLOBAL_STATIC (so it will be destroyed with all the other
Q_GLOBAL_STATICs in the reverse order of construction). In the
Q_COMPILER_THREADSAFE_STATICS case, freelist() also returns a
function-level static that is constructed on first use, so it may be
destroyed earlier than the QDBusConnectionManager object, making it
impossible to lock a contended mutex.

We now make freelist() return a global static, so that it is always
destroyed after QDBusConnectionManager and other function-static
variables.

Change-Id: I210fa7c18dbdf2345863da49141b9a85cffdef52
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-08-23 15:37:00 +00:00
Christian Strømme
5e3f770ad5 Fix problem with exception reporting in QFuture::waitForResult()
This fixes a problem that occurs when a task, that is run synchronously,
throws an exception. If that happened, then the exception would not be
re-thrown, because of an early return.

Task-number: QTBUG-54831
Change-Id: Ic70c5b810ec6adce6e62bfd6832ba9f170b13a7f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-08-23 14:55:49 +00:00
Orgad Shaneh
449390c3a5 Revert "QLocale: Actually get the language script for the system locale"
The text direction should *not* be set by the default script, but by the
UI direction.

For example, if the default script is Hebrew, but the UI is in English,
it doesn't make sense to default all the controls to RTL. This should be
done only if the UI is RTL.

This reverts commit a90869861c.

Task-number: QTBUG-53110
Change-Id: I5a6951ac30f24eec86bc0ae2a9fcfe14eb3a8e28
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-08-23 14:52:31 +00:00
Albert Astals Cid
3fa18bf881 Make sure connection is not null before using it
connectionFromId can return null if the id isn't found.

This causes crashes like http://paste.ubuntu.com/23061009/

Change-Id: Ib72412f61dc7661455394679b3e90662de505920
Reviewed-by: Lorn Potter <lorn.potter@canonical.com>
2016-08-23 14:46:06 +00:00