Commit Graph

31516 Commits

Author SHA1 Message Date
Liang Qi
de49839df8 Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
	mkspecs/features/moc.prf

Change-Id: Ia71c8e3b3185f7c999bf226d0675051b10b8740b
2017-02-24 20:01:42 +01:00
Olivier Goffart
4d3781b640 QDockWidget: Fix memory leak when dragging a tab outside of a floating tab window
A QDockWidgetItem will be leaked if a QDockWidget is dragged out of a
floating tab window, and then plugged back somewhere.

The problem is that QMainWindowLayout::unplug was not returning the
QDockWidgetItem* from the floating tab's layout. When that's the case,
a new QDockWidgetItem is created in QDockWidgetPrivate::startDrag
and will be put into the layout, leaking the old QDockWidgetItem.

Change-Id: Ifb9c1c562cb74383ebff1df0f91ee225c5cdb296
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
2017-02-24 15:00:03 +00:00
Marc Mutz
e623453592 QImageReader: remove some unneeded relocations
Replace an array of pairs of pointers with an array of pairs of
arrays. Remove the unused end marker. Add a static_assert to
verify that the size of the array matches the constant all loops
use.

Also extract the common part of the mime-type name and append it when
building a QByteArray from it. This is free, as both the new
QStringBuilder expression as well as the old construction from a const
char * incur one memory allocation each.

Replace one indexed loop with ranged-for.

Results on optimized GCC 6.1.1 Linux AMD64 builds:
 text   -96B
 data  -160B
 relocs -16

Change-Id: Ic23eb06bacbf70afb6f60e2fb8a140bdd3880aca
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-24 08:23:38 +00:00
Marc Mutz
5a7165f2ea QtGui: kill some unneeded relocations
Turn arrays of pointers into arrays of arrays.

Results on optimized GCC 6.1.1 Linux AMD64 builds:
  text  -264B
  data  -512B
  relocs -43

Change-Id: I0b64615913d50c286596e66675e89758ce1ec2ba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-24 08:03:51 +00:00
Marc Mutz
f4495d29e5 Clean up QByteArrayLiteral definition
Remove the dead QByteArray(data, size) fall-back. We've been
requiring lambdas since Qt 5.7.

Change-Id: I4d9023ab4583f2ee80a74a828fba0d95c2fdb0df
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-24 08:03:32 +00:00
Marc Mutz
46d4dc8afb QStyleSheetStyle: optimize away triple key lookup
Instead of contains()/value()/remove(), all of which perform a new
lookup, and a new application of qHash(), get an iterator using
find(), deref it, then pass it to erase().

Also add some optimistic std::move().

Change-Id: I27a623dcd974de9c67d11d030e9b98d7598efc93
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-02-24 08:03:12 +00:00
Marc Mutz
1d0ee89548 QSideBar: replace a QPair with a struct
Instead of the incomprehensible "names" .first and .second, the code
can now use .index and .path.

Change-Id: I1449ba668f703b9a8b9391b0a0774072c8c6e8aa
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-02-24 08:02:50 +00:00
Aaron Linville
c4f122927a Doc: Fix minor typos in QRectF
Fix a couple incorrect references to the integer precision classes.

Update snippet to use floating point precision classes.

Task-number: QTBUG-51630
Change-Id: I9b08cfb68937a8e1179ee414d7981956ef7bc106
Reviewed-by: Martin Koller <kollix@aon.at>
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-02-23 20:55:10 +00:00
Timur Pocheptsov
09ca03e1aa QNAM - rename Redirect*s*Nnn to RedirectNnn
As discussed in API code-review.

Change-Id: Ib54cfd43d5bef8c7d99a7fb3b09a9d16dc1dc1dc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-02-23 20:24:17 +00:00
David Faure
9ffc9e306f QUrl::fromUserInput(with cwd) fix handling of files with trailing spaces
The call to trimmed() makes sense for URLs typed in a browser's location bar,
but its use in every code path made it impossible to open a file with a trailing
space in command-line tools that uses fromUserInput(cwd) to handle command-line
arguments, as recommended. For instance kde-open5 "file.txt " would fail.

Change-Id: Ie61182684521d91f077d3e76f95b7240965ab405
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-23 18:12:35 +00:00
David Faure
8cb9314971 tst_qurl: use temp dir and create our own files for testing
This allows to test specific filenames without polluting the current dir.

Change-Id: Ieb99019a2e37e30f294d85c5d80af1de1b919019
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-23 18:12:13 +00:00
David Faure
11790f41a7 tst_qurl: replace all QDir::currentPath() calls with local variable
Change-Id: I70e4547ba87292c29dfab59950aa1214be8015a5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-23 18:12:06 +00:00
David Faure
90b48a70ff QTextFormatCollection: replace copy ctor and op= with clear()
operator=, which was only used for clearing, wasn't clearing the hash.
This led to a mismatch between the vector and the hash (given that the hash
points into the vector).

Spotted by interrupting kmail in gdb, and it was in this code
iterating over a 2000 entries hash (the first vector entries not matching
the hash, this code keep appending new entries for the same formats).

This fixes QTBUG-8862 again, the initial fix having been accidentally
reverted in 467b15a.

Change-Id: Ia34b3d002a0199e1930431a4bbdb2ec981ed4ffc
Task-number: QTBUG-8862
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-02-23 18:11:55 +00:00
Marc Mutz
758a56e662 QSizePolicy: plaster API with Q_DECL_NOTHROW
This is mostly straight-forward, but some things are worth noting:

1. Yes, this is necessary. The noexcept operator looks for noexcept tagging,
   not at the contents of the function to determine whether to return true.
   The more conditionally-noexcept functions are used, the more important it
   becomes that low-level classes are correctly marked noexcept. In that, it
   is like constexpr.
2. In accordance with the rules governing noexcept specifications for the
   standard library itself, the set*Stretch() functions are not marked as
   noexcept, since they have preconditions and thus a narrow contract.
   Narrow-contract functions should not be noexcept. All other functions
   have wide contracts (ie. no preconditions).

Change-Id: I853e0fc2d98cf3fcb16402a18ab136cccca24d89
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-23 16:17:07 +00:00
Timur Pocheptsov
c0157a9f03 QNativeSocketEngine - set query type in checkProxy
The default query type for QNetworkProxyQuery is TcpSocket (that's what
our QNetworkProxy::applicationProxy() requests). Unfortunately, this
can result in http_proxy found and QTcpServer::listen() failing
(probably, QUdpSocket is also affected). So now we extract applicationProxy's
logic but modify it to provide the exact query type we need.

Task-number: QTBUG-58706
Task-number: QTBUG-41053
Task-number: QTBUG-58374
Change-Id: I79ce0efb779bbaf08afd78c44cbe92d08730152b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-23 16:13:43 +00:00
Timur Pocheptsov
b48e960969 HSTS - API/naming fixes
As recommended in API review: use 'is...STS...Enabled' and 'set...STS..Enabled(bool)'
function names instead of stsEnabled and separate enable/disable functions.

Replace QList with QVector in the public API.

Change-Id: I1526124c830450058967ebc192d27575cc89292d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-02-23 14:21:35 +00:00
Stephan Binner
8e95828475 Output "qml-debug" as privateFeature
Change-Id: Iecf59b5e4cd387e59b28a252d6cd8cdf411b3d41
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-02-23 14:11:54 +00:00
Shawn Rutledge
8fd6cef372 add tst_QWidget::tabletTracking autotest
Ensure that tablet moves are delivered iff tabletTracking is true.

Task-number: QTBUG-26116
Change-Id: Iaa360e181f0c6484cfbde6fa5365f2f0dc77433a
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-02-23 10:43:03 +00:00
Marc Mutz
62e15093ff Unexport QTimeZonePrivate
It's only used in the autotests, and it private API, so
downgrade from Q_CORE_EXPORT to Q_AUTOTEST_EXPORT.

Fix a use of QTimeZonePrivate functions unprotected by
QT_BUILD_INTERNAL in tst_qtimezone.cpp.

Change-Id: I70eaea06f8fcf2983aeafb6894c3a5d2a4b272a7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-23 10:42:51 +00:00
Shawn Rutledge
6aaf853222 make TabletMove hover events conditional on QWidget::tabletTracking
This adds the tabletTracking property in the same way that mouseTracking already
existed: there is a WA_TabletTracking attribute, and a TabletTrackingChange event
to notify when it changes.  So for widget applications it's an opt-in feature.
QtQuick applications don't yet make use of tablet events, but when they do
in the future, we don't yet have a mechanism to turn the move events off;
it remains to be seen whether that will be necessary.

[ChangeLog][QtWidget] QWidget now has a tabletTracking property, analogous
to mouseTracking, which will enable TabletMove events while the stylus is
hovering, even if no button is pressed.  This allows applications to show
feedback based on the other tablet event properties such as rotation and tilt.

Task-number: QTBUG-26116
Change-Id: Ie96e8acad882b167e967796cdd17f1ad747a2771
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-02-23 10:42:42 +00:00
Shawn Rutledge
ea615b421b handle TabletMove events during stylus hover
The main reason for this is to get feedback about the stylus orientation
(angles and rotation) before the user presses it.  For example an application
might provide an image of the brush which rotates along with the stylus.  As
with mouse events, applications can distinguish hovering by the fact that no
buttons are pressed.

On the xcb platform we need to stop blocking the hover events, and in
QWidgetWindow we need to send the event to the widget being hovered, while
keeping the existing "grab" behavior: after pressing the stylus (or any button
on the stylus or on the tablet), keep sending the events to the same widget
until release.

Task-number: QTBUG-26116
Change-Id: Iaed8b3b94961290dbb29b5fd2ea892fed7221685
Reviewed-by: Dmitry Kazakov <dimula73@gmail.com>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-02-23 10:42:23 +00:00
Friedemann Kleint
35fa30e65d Revert "testlib: Add qWaitFor to wait for predicate"
This reverts commit 3b38392844.

The change caused test compile failures with MSVC2015 in qqmlsettings;
a variable was not captured in the lambda expression. This appears
to be a compiler bug of MSVC.

Task-number: QTBUG-59096
Change-Id: I3bf5288eb005b2e1661819bb33bc54fb944d0150
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-02-23 10:07:57 +00:00
Edward Welbourne
2c13070162 Do not delete someone else's QSystemLocale when constructing another
The QSystemLocale constructor remembers the most-recently-constructed
instance - a dodgy enough proposition at the best of times - and
shares it with much of the rest of QLocale.  There is a global static
instance, actually of a derived singleton class, to which it is
usually set on program start-up.  However, the constructor deleted the
remembered instance before remembering any new instances; there was no
way this could not lead to bad consequences.  So let's not do that.

Change-Id: Ie8f3d655c9d4f75f6ec00a5861d98d6020ecc633
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-23 09:39:23 +00:00
Jarek Kobus
21298aad45 Enable FTS5, will be used by Assistant instead of clucene
Change-Id: Ifd1d7128c6080650b5ad43f87410c7058d8c5a74
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
2017-02-23 09:18:55 +00:00
Joni Poikelin
b56c8a3b3d Android: Fix always hidden software keyboard from popping up
Task-number: QTBUG-58803
Change-Id: I256e59cee9d131f88b83367b26dbc11de87319af
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-02-23 08:16:23 +00:00
Eskil Abrahamsen Blomfeldt
440ccba0ab Android: Fix OpenGL shader compilation on updated emulator
In 0ae4b948515af904dba397448839056d9b7965af, we added a work-around
specifically for the Android emulator, causing it to override the
precision qualifiers in shader code, since the emulator would send
the shader code directly to the host OpenGL driver and thus there
was no guarantee that the qualifiers would be supported.

Since then, the original issue with the emulator has been fixed,
so now Qt applications are failing because of the work-around.

[ChangeLog][Android] Removed old work-around which was causing
OpenGL shader compilation to fail on updated Android emulators.

Task-number: QTBUG-44697
Change-Id: I0da879b3a8fbe7cb2d0969cdf45664d0b3499891
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-02-23 07:56:14 +00:00
Thiago Macieira
6282948e96 Add CONFIG += no_moc_predefs to allow one to escape problems
Sometimes, users need to add compiler flags to QMAKE_CXXFLAGS that
aren't supposed to be passed to the predefs dump. That's especially true
for -include options, as that would change completely what's
defined. Not to mention that -include is a preprocessor option and
shouldn't be in CXXFLAGS in the first place (Automake has CPPFLAGS, but
qmake only has INCLUDEPATH and DEFINES).

[ChangeLog][qmake] Added the ability to suppress the collection of the
compiler predefined macros for moc's use. To disable the collection, use
CONFIG += no_moc_predefs.

Task-number: QTBUG-58857
Change-Id: I4139d5f93dcb4b429ae9fffd14a34d49825d9b85
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-02-23 07:51:50 +00:00
Marc Mutz
4d92712a2c QTimeZonePrivate: make clone() const, use covariant return types
There's nothing wrong with cloning a const QTimeZonePrivate, so make
clone() const.

Also, if you're cloning a QTzTimeZonePrivate, you already know that
you get a QTzTimeZonePrivate back. C++ supports covariant return types
for this reason, so use them.

Change-Id: I60e19e89b1b7bad080c552f1baca314ab0a6295e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-23 05:45:53 +00:00
Marc Mutz
4cd002402f Simplify QTzTimeZonePrivate implementation
- Don't init m_icu with 0. It's a QSharedDataPointer, which inits to
  nullptr anyway.
- The copy ctor didn't do anything out of the ordinary, so = default it.
  It's also only used in the implementation of clone(), so make it private.

Removes three #if QT_CONFIG blocks.

We can't use ctor delegation here, because systemTimeZoneId() is a
virtual function.

Change-Id: I2cd06c3349686b6f21c897acb5c12185a36d5b9f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-23 05:45:49 +00:00
Marc Mutz
2cda991ab1 QStaticByteArrayMatcher: fix MSVC warning
MSVC 2013 complained:

  src/corelib/tools/qbytearraymatcher.h(143) : warning C4351: new behavior: elements of array 'QStaticByteArrayMatcher<6>::m_pattern' will be default initialized

Fix the same way as 9a07ab9234: by suppressing
the warning.

Change-Id: Ic41f7eabe7e39709d76e6062f5891cdcfaa6e1ed
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-02-23 05:44:58 +00:00
Marc Mutz
b952bd3605 QSizePolicy: make (Policy,Policy) ctor constexpr
Unfortunately, that ctor also takes a ControlType argument (defaulted),
and calls the non-constexpr, non-inline function setControlType().

In order to make at least the two-arg version constexpr, I added
a use of the ternary operator to check for type == DefaultType,
making all calls of the ctor that use type == DefaultType
constexpr. For init'ing an aggregate type without ctor in the
ctor-init-list, I needed to require uniform initialization, too.

C++11-style constexpr cannot call void functions, so I needed
to extract the transformation part of setControlType() into a
new function that returns the result instead of storing it directly.

Saves a surprising 2K in QtWidgets text size on GCC 4.9, AMD64 Linux
stripped release builds.

Change-Id: Ib4adf5fd6e54d5345dbfe1c298554278faf13c58
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-02-23 05:44:51 +00:00
Marc Mutz
3ac8b8c696 QTypeInfo: record whether it was specialized
This is one of the pillars of my static container checking toolbox,
one of the main checks being that every type put into a Qt container
has been marked up with Q_DECLARE_TYPEINFO.

Obviously, we cannot upstream such a checker and inflict it upon the
world, but we can put some foundations in. This is the most central
one.

Change-Id: I9185facb2f37ba9fcc12c9aae5675eed454d755c
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-23 05:44:47 +00:00
Sergio Martins
8c1f147eaf dockwidgets: recalculate the press position if the window resizes
A window can resize while dragging, this happens on Windows when dragging
across screens, to a screen with a bigger scale factor. When that occurs
it might lead to the press pos being outside of the window.

Change-Id: Ic61ec7088c8fa81395d43ce665952dbd2eecba39
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-02-22 23:11:01 +00:00
Pavol Markovic
dd4465f57c Wrap RunLoopModeTracker into Objective-C namespace
RunLoopModeTracker as one of Qt Cocoa classes was not wrapped
in namespace which limited its use in Objective-C single symbol space.

Change-Id: Ida2c62c6f543a3bf5107f28c78d27435bcb3470d
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-02-22 20:16:59 +00:00
Ulf Hermann
4e9f7807fb Move qJsonFromRawLibraryMetaData into qfactoryloader_p.h
This is still not a great place for it, but this way we can
Q_REQUIRE_CONFIG(library) in qlibrary_p.h and qfactoryloader_p.h is the
only private header that doesn't require library support in plugin.pri.

Change-Id: Ia6c1ac8799822eca1e0cbeca98d1c1b8de74beae
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-02-22 17:36:32 +00:00
Edward Welbourne
4c367833b4 Fix multicastMembershipHelper to not assume addresses are IPv4
Make it iterate the addresses available looking for an IPv4 address,
when that's what it needs, instead of just assuming the first entry in
the list (when non-empty) is IPv4.

Based on a suggestion by Dmitry Pankratov.

Task-number: QTBUG-27641
Change-Id: I1920f68ade44a996ea5c2ed691a87ff3e686f35a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-22 16:58:46 +00:00
Marc Mutz
9fbe3a9262 QErrorMessage: replace a QPair with a struct
Instead of the incomprehensible "names" .first and .second, the code
can now use .content and .type.

Change-Id: I7fe320ded33a07fb8ff77ac96c17fc5ee1079da3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-02-22 16:42:29 +00:00
Marc Mutz
494ee2aa8d QThreadPool: supersede cancel() with tryTake()
The cancel() function added in 5b11e43e for Qt 5.5 suffers from a
number of problems:

First, if runnable->autoDelete() is true, then the function suffers
from the ABA problem (see documentation written for trytake()).

Second, if runnable->autoDelete() is false, due to cancel() throwing
away crucial information instead of returning it, the caller cannot
know whether the runnable was canceled (and thus has to be deleted),
wasn't found or is currently executing (and thus mustn't be deleted),
or has finished executing (and can be used to extract the result).

Deprecate this dangerous API and replace it with the much more useful
Private::stealRunnable(), promoted to public API and renamed to
tryTake() for consistency with the rest of Qt.

Described the various caveats in the function's documentation.

[ChangeLog][QtCore][QThreadPool] The cancel() function suffers from
several subtle issues and has been replaced with a new tryTake()
function.

Change-Id: I93125935614087efa24b3e3969dd6718aeabaa4f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-02-22 16:37:07 +00:00
Ulf Hermann
46730ca610 Make the factoryloader test compile without library support
We define QT_STATICPLUGIN for the plugins in this case, so that they
define the factory functions needed to link them directly into the
test.

Change-Id: I0f2de7bf6bec5a6d53ec9ad92536817c1221b7d5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-02-22 15:53:13 +00:00
Allan Sandfeld Jensen
beaf33983e Fix wrong access to qMemRotateFunctions
Since this table was restructured in 7c401397a4 and changed to
being indexed bitwidth and not format, NEON-enabled builds have
been writing to an undefined place after the table.

Discovered by compiler warnings on CI.

Change-Id: I109cd19a8dd703bdafdf13afd3f96ebeaa0e6de5
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2017-02-22 14:36:56 +00:00
Marc Mutz
7c647edae9 QTypeInfo: don't treat enums and (extended) integral types as complex
We fully specialize QTypeInfo for most C++ built-in types,
but enums and extended integral types (like GCC's int128_t)
were not covered.

Now that we depend on <type_traits>, we can stop pessimizing
enums and extended integral types in QVector and QVLA by
defaulting QTypeInfo::isComplex to true for such types.

Fix a test that checked that enums were complex types. This should
have been a XFAIL test. Enums are not complex types.

Change-Id: Ibb0fb38cc83e980a428b5573d1db5666593418ae
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-02-22 09:21:57 +00:00
Marc Mutz
19085350fb Do not use QTypeInfo::isStatic anymore
... except in QList.

When dafa3618 introduced isRelocatable and QTypeInfoQuery, the
intention was to decouple the memory layout of QList from the
reallocation optimizations in QVector. This never happened, as
QVector (and QVarLengthArray) continue to use isStatic to this
day.

Fix by porting both QVector and QVLA to QTypeInfoQuery and
isRelocatable.

Change-Id: I6951f2cf21f0cbb24e2dbd38f80f1bd82007d394
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-22 08:04:12 +00:00
Marc Mutz
4df229ce50 QArrayDataOps: don't use value-initialization
... but default-initialization instead.

This bug may have rendered the diverse Qt::Uninitialized ctors
we have in Qt containers ineffective.

Change-Id: I5a369fa8527f19b6f8cc1a9f36512f6a0058839a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-22 08:03:46 +00:00
Tor Arne Vestbø
53c0568924 macOS: Make sure NSResizableWindowMask is set when toggling fullscreen
Instead of setting the mask in toggleFullScreen(), which is only hit
when going to fullscreen via our own API, we do it in the window
notification callbacks, which also includes going to full screen via
the native macOS title bar buttons. This allows making customized
windows without Qt::WindowMaximizeButtonHint full screen with the
full geometry of the screen.

Change-Id: I63c3e4582ea7c4fe8c0008265793c5f656b830b2
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-02-22 07:58:20 +00:00
Marc Mutz
adca47cbc1 QTzTimeZonePrivate: introduce PosixZone class
... as a replacement for QPair<QString, int>, and move some
repsonsibilities into it.

This avoids the repeated use of the magic number INT_MIN to indicate
absence of an offset and does away with the confusing .first and
.second, replacing them instead with proper names, .name and .offset.

Change-Id: I0f6906467b8efa16bed2bf5677f2bbbd534da1ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-02-22 07:58:19 +00:00
Tor Arne Vestbø
c585802e94 QWindow: Remove "_q_foreignWinId" dynamic property
The platform plugins reading this out of the QWindow was a layering
violation, and propagates the notion that a window can shape shift
into representing a new native handle, while none of the platform
plugins support this.

A foreign QWindow is created via the factory function fromWinId(),
at which point we can pass the WId all the way to the platform
plugin as function arguments, where the platform will create a
corresponding platform-window.

The platform window can then answer the question of whether or
not it's representing a foreign window, which determines a few
behavioral changes here and there, as well as supplying the
native window handle back for QWindow::winId();

[ChangeLog][QtGui][QWindow] The "_q_foreignWinId" dynamic property
is no longer set nor read.

[ChangeLog][QtGui][QPA] The function createForeignWindow() has been
added to QPlatormIntegration and is now responsible for creating
foreign windows. The function isForeignWindow() in QPlatformWindow
has been added, and platforms should implement this to return true
for windows created by createForeignWindow().

Task-number: QTBUG-58383
Change-Id: If84142f95172f62b9377eb5d2a4d792cad36010b
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-02-22 07:58:07 +00:00
Stephan Reiter
1d44b6bedb QProcess::startDetached(): Support privilege elevation for non-.exe files
Pass classname 'exefile' to ShellExecuteEx() for UAC prompt.
This allows running executable files that do not have a .exe extension.

Task-number: QTBUG-59008
Change-Id: I88d669481e893db50edccd7b30259e5366477556
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-02-22 07:47:18 +00:00
Oswald Buddenhagen
dab0138043 make more use of 'use' in library detection
now that it works nicely, make use of it for the zlib deps, which are
not transitive when the detected library is built statically.

Change-Id: Iaed87a37b36f714f0b919244cd84809650102ba9
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-02-22 07:47:13 +00:00
Oswald Buddenhagen
421bbefb9d configure: fix 'use' for detecting static libraries
these statements are assumed to provide dependencies for the currently
detected library. this implies that their resolved content must be
passed to the linker after the to be detected static library.

Change-Id: Ifaaee2ac71bf176e8a0033765fb979fe119deaba
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-02-22 07:47:02 +00:00
Oswald Buddenhagen
fcf0aee044 configure: make it possible to make 'use' conditional
Change-Id: I8390634c5b23bf34692b4f532ab00a7aba690037
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-02-22 07:46:59 +00:00