Commit Graph

33817 Commits

Author SHA1 Message Date
Andre de la Rocha
9f405f98a4 Add virtual keyboard geometry support to Windows port
Overrides keyboardRect() and isInputPanelVisible() in QWindowsInputContext
in order to provide support for virtual keyboard geometry and visibility
information in the Windows platform.

Change-Id: I15382e604dc076929d253c0c1fbe64ea7da853ce
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-10-16 12:14:55 +00:00
Jędrzej Nowacki
1798f0aa37 Build fix for clang-5.0
qkmsdevice.cpp:737:40: error: lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture]

Change-Id: I90f0281baeb7bd8216d62515e4b087070c98c235
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-10-14 07:07:08 +00:00
Richard Moe Gustavsen
0e1c9a34c2 QPlainTextEdit: draw placeholder text correctly when it wraps
382faed introduced placeholder text to QPlainTextEdit. But the code
relied on the text begin short enough to fit inside the width of
the text edit. If the text was longer, and therefore wrapped, drawing
artifacts would show.

This patch will listen for text changes and check if the
placeholder text should show or not, and if so, issue a full update
to ensure that the whole placeholder text is either fully drawn
or hidden. And then we allow to the placeholder text to be drawn
inside the full rect of the text edit.

Task-number: QTBUG-61875
Change-Id: I808472839ab397340080b56407c76e74f9ad1ae6
Reviewed-by: David Faure <david.faure@kdab.com>
2017-10-12 13:33:29 +00:00
David Faure
55e273c1a2 Fix compilation with clang, missing errno.h
Similar to cfe1a295fc which was in a different file.

Change-Id: I40e204f8603a2d4c10a6c737192957653f537d1a
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-10-12 13:26:16 +00:00
Edward Welbourne
ffd822b968 Force QT_LOGGING_RULES in testlib's selftest
On some systems (e.g. Debian/buster) a standard Qt package may install
a qtlogging.ini file, e.g. in /etc/xdg/QtProject/, which suppresses
QDEBUG output.  A ~/.config/QtProject/qtlogging.ini could interfere
similarly.  This can break the selftest, when run with expected_*
files generated without such interference.  Likewise, if those
expected_* files are generated on a system such similar, they won't
work on CI.  Given that this caused confusion and delay with
integrating the latest set of updates to the expected_* files, it
seemed best to save others from similar bafflement.

So set a standard value for QT_LOGGING_RULES in both the selftest and
the generator script, so we get consistency.

Change-Id: I649e2f1f6ead21edf8af051aaee286e369fed064
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-10-11 13:31:43 +00:00
Edward Welbourne
98ef376fb6 generate_expected_output.py: update generated expected_* files
In selftests.qrc, imposed alphabetic order (on stem of name, then on
suffix, effectively treating . as sorting before any letter) while
removing old tests and adding new tests and data.  Updated all non-csv
files and added many missing files.  (Not clear on csv support status;
the script seems to have dropped it after 5.6, but the test still uses
it.)

Left expected_crashes* alone (no new files added, no update to old) as
I don't get results resembling those anticipated.

Omitted printdatatagswithglobaltags, printdatatags due to dangling
hspace on output lines, which upset sanity-bot.  A change to the test
cpp is needed to make it viable to skip that dangling hspace.

Change-Id: Iab3fb626c44a91c249b2fb626c12c75ea0317098
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-10-11 09:59:44 +00:00
Masashi Fujimoto
aebc9023bb macOS: Fix standardLocations() returns invalid path
The file path included in the return value was
incorrect when giving the following value to the argument of
"QStandardPaths::standardLocations()".

- QStandardPaths::AppDataLocation
- QStandardPaths::AppLocalDataLocation
- QStandardPaths::DataLocation

The function to obtain the path to <AppName>.app changed from
CFURLCopyPath() to CFURLCopyFileSystemPath() by commit id
c0da37a806.
CFURLCopyPath() returns a value with a path delimiter appended at the
end, but CFURLCopyFileSystemPath() is not.
This is a commit to append '/' to the end of the return value of
CFURLCopyFileSystemPath().

Task-number: QTBUG-61159
Change-Id: Icaebdf09d9cdf992d59c16a398dfe666e6225f99
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-10-11 04:51:17 +00:00
Gatis Paeglis
2764d82dc4 tablet: use enhanced mouse event when synthesizing mouse
All the required data is just there, few lines above. Instead of
throwing it away and then deducing again in mouse event handler,
use the enhanced mouse constructor.

Tablet event handler was the last remaining user of the obsolete
mouse event constructor. This patch removes the now unused construtor.

Change-Id: I0df7f1b82f0e768f651aa7fbe2d4efce93e992fa
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-10-10 22:09:29 +00:00
Gatis Paeglis
72dfe1deb3 touch: use enhanced mouse event when synthesizing mouse
The documentation for AA_SynthesizeMouseForUnhandledTouchEvents states:

"All touch events that are not accepted by the application will be
translated to left button mouse events instead."

This is exactly what this patch does. With the enhanced mouse event,
we can simply pass event details as necessary. This should not conflict
with the code doing its own mouse synthesis (as long as custom event
handler accepts QEvent::Touch{Begin,Update,End}).

What was wrong with the previous implementation:

It was sharing the same state variable (mouse_buttons) to deduce button
state/type on physical mouse and emulated mouse. This was wrong, you
can't track state of two input devices by sharing one variable. Moreover,
this variable is intended for tracking state of a hardware mouse only.

Button state on physical mouse (as a separate pointer device) is
irrelevant for touch input (which is another "pointer device"). The
current API does not support multiple pointer devices, thus button state
on one pointer device should not affect state on other pointer device.

Task-number: QTBUG-57465
Task-number: QTBUG-52102
Change-Id: Id45d815508918b4e52319baddb2c9564d52ad783
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-10-10 22:09:22 +00:00
Gatis Paeglis
a37785ec76 qpa: enhance mouse event with type and button data
... and deprecate QWSI APIs that accepts mouse event without mouse button/
type data.

In the early days of Qt5 it was decided to centralize mouse button/type
handling in QGuiApplication (because of limitation of some now unknown
platform). This has proven to be problematic as mouse handling details
differ across platforms (e.g on X11 we do not receive mouse release event
when closing popup windows or ordinary windows that are closed from the
mouse press event). Instead of hacking around platform specific behaviors
in Qt Gui, we should move this task back to platform plugins (similar to
how this was done in Qt4 with native APIs sending mouse details directly
to QApplication). There are even cases where it simply is not possible
to deduce (from QGuiApplication) which button caused the event (e.g. when
more than one button is involved and some event goes missing). Besisdes,
throwing away information which is already available at QPA level (for free)
and trying to deduce it again at Qt Gui level seems impractical, fagile
(as probably noticed by people fixing all the unexpected issues) and adds
unnecessary complexity.

Note:

Removing the deprecated QWSI APIs from offscreen plugin depends on fixing
autotests that rely on QOffscreenCursor::setPos() logic.

For the convenience of testing use QT_QPA_DISABLE_ENHANCED_MOUSE to restore
to the old code path where QGuiApplication does the mouse state deducing.

Other platforms have similar issues. I do not have all supported platform
available on my desk, so other platform maintainers will need to take care
of porting those platforms to the new APIs. And mainly, I don't want to deal
with all the hacks that other platforms have added to workaround this broken
mouse logic.

In Qt6 we need to remove deprecated code path from QGuiApplication.

This patch:

- Extends QWindowSystemInterfacePrivate::MouseEvent ctor with QEvent::Type
and Qt::MouseButton. We use this extra data when processing mouse events in
QGuiApplication. This actually is similar to KeyEvent, where we do pass the
type (press or release) to QtGui.

- Refactors QGuiApplicationPrivate::processMouseEvent and qtestlib to use
the new APIs.

Task-number: QTBUG-59277
Task-number: QTBUG-62329
Task-number: QTBUG-63467
Change-Id: If94fd46a7cccfea8264dcb1368804c73334558b8
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-10-10 22:09:07 +00:00
Andy Shaw
0900cf3581 OCI: Use TIMESTAMP for datetime data
The TIMESTAMP type has been available in Oracle since Oracle 9i
which was released in June 2001 and contains more data than the
DATE type so it can be reliably used for the related data types.

This adds support for preserving milliseconds and the time zone
information if this is passed or in the database.

[ChangeLog][QtSql][OCI] Added support for the TIMESTAMP data type.

Task-number: QTBUG-23
Change-Id: Icf7a012dda75fb342ce6c6aa34eaa2a52755ff2d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-10 08:56:32 +00:00
Gatis Paeglis
bbcc2a92d0 xcb: tidy up QXcbWindow::handleClientMessageEvent
- Store "event->data.data32[0]" in a variable with a meaningful name.
  This improves code readility.

- Use categorized logging.

- Wrap lines where it makes sense (Qt Coding Style discorages more than
  100 chars per line).

Change-Id: I163abab8380b459fd349227f22dc417a444aefa7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-10-10 05:33:23 +00:00
Thiago Macieira
4a44bd6cdc Stop including net/if.h from qplatformdefs.h
I need to include linxx/if.h from elsewhere and these two files conflict
by defining the same types (struct ifreq, struct ifmap, struct ifconf,
etc.)

Change-Id: I0a103569c81b4711a649fffd14eb2f6dbbef83b6
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-10-08 06:41:24 +00:00
Alex Trotsenko
ca49f133f0 QSslSocket: implement skip() overload
As QAbstractSocket does not handle most cases for this socket type, we
should override skip() in QSslSocketPrivate implementation.

In unencrypted mode, QSslSocket should forward skipping to the plain
socket. If a connection is secure, we just need to check the connection
state.

Change-Id: I56602c6427b8617e8a9f453809a30fb2914ad798
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-10-07 17:22:24 +00:00
Allan Sandfeld Jensen
06089a19e5 xcb: Unify visual to QImage::Format logic
Make a common function to replace the two existing ones that convert
from XCB visuals to QImage format.

Change-Id: I2ae08ef4df96df950910a45e71c9d9cd98375b2e
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-10-07 09:04:38 +00:00
David Faure
23d0c77ce8 QTestLib: flush DeferredDelete events between every test
This makes qtestlib behave more like real Qt applications with an
event loop, where exiting the application does indeed flush deleteLaters.
And since every test method is supposed to be independent from other
test methods, we should even cleanup between tests.

For "app less" tests, no flushing happens.

Real life use cases:

* A unittest for some code (e.g. KIO job) which uses a socket, runs an
event loop until the socket communication is done, and ends. However
slotDisconnected() does, as recommended, socket->deleteLater(). So the
test finishes before the socket has a chance to actually get deleted,
and memory leak tools flag a memory leak, which doesn't actually happen
outside the unittest.

* Deleting a QWebEngineView with deleteLater is even worse than a memleak,
it leads to an assert (from a global object destructor) in QtWebEngine
if the view deletion hasn't actually been processed.

Change-Id: I18fc822fd26988a0fa4e75313c1947fcaa7d9e56
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-10-06 10:43:03 +00:00
Friedemann Kleint
cccede8fc7 Windows QPA: Directly link against touch functions
They are available on Windows 7.

Change-Id: Ia937c459fe0df0d39d407ca0e65641f8aa583f4a
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-10-05 08:45:14 +00:00
Friedemann Kleint
53fb2c48ef Qt Core: Remove code for Windows < 7
Change-Id: I919827c6016156af596fd90fc5563445e0ae4228
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-10-05 08:44:48 +00:00
Edward Welbourne
ee84db4c18 QLocaleData::longLongToString: clean up sign handling
In qlltoa we simply discarded sign, passing absolute value down to
qulltoa; given that it had just one caller and did something only that
caller is apt to want - violating the principle of least surprise for
those who would expect it to handle sign sanely - it is better to just
inline it in the one place it was used.

That one place, QLocaleData::longLongToString(), handles sign
separately and (for reasons I shall argue elsewhere are bogus) ignores
sign for bases other than ten.  When ignoring sign, it passes negative
values directly to qulltoa, which caught the attention of Coverity
(CID 22326).  This deliberately cast (for the same bogus reasons)
negatives to large unsigned.  Inlining base ten's call to qlltoa() as
a call to qulltoa() could now be unified into a simple (and less
obviously perverse) form.  Making the (contentious) cast explicit can
then calm Coverity and we get a simpler implementation all round.

Incorporate also Marc Mutz's fix for unary minus applied to unsigned
and handling of the most negative value, suitably adapted.

Change-Id: Iea02500a5dd7c6d7ac6e73656e1b11f116ae85c6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-10-03 08:38:17 +00:00
Gatis Paeglis
196f7af6e2 qpa: stop using QWindowSystemInterfacePrivate::FrameStrutMouse enum
Non client area mouse events are mouse events too. There is no need
for a dedicated event type in QWindowSystemInterface.

Instead we pass the state through a 'nonClientArea' variable of the
mouse event, corresponding to QEvent::NonClientArea{Press,Release,Move}.

Change-Id: Ia0a188400787506c8fe0cfe58aee0776c1ab13c7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-10-02 11:35:28 +00:00
Allan Sandfeld Jensen
6f16b7a8f3 Handle endian mismatch between X11 client and server
If the server and client has different endian we need to swizzle the
image pixels, we can do that by swizzling the masks and try to match
the new configuration. This is a rather rare setup so we don't try
to match every combination.

This patch fixes the colors when running Qt in a bigendian QEMU chroot.

Change-Id: Ie83f9607563cba137b2e1a63e996a05d43ff603e
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-10-02 08:06:21 +00:00
Samuel Gaist
b6f6920654 Change qrand() to QRandomGenerator in the SSL backend
Change-Id: I631649b2ad8d9c2c766e99a12f7ff3a39c79cc7d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-09-30 18:08:13 +00:00
Friedemann Kleint
e22bf03e23 Qt Network: Remove code for Windows < 7
Change-Id: I21b93b8d550f4a1f3e26d5d516886c76b2364e7b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-09-29 12:36:27 +00:00
Friedemann Kleint
7c7595e1b2 QWizard/Windows: Remove code for Windows < 7
Change-Id: I1021ede67fe1396cdea3114d310e293fad2bcd76
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-09-29 12:36:15 +00:00
Jesus Fernandez
0eb2e1f38f Remove pointer check
The win pointer is valid because it is ensured before the check. It
cannot be null.

Coverity-Id: 21652
Change-Id: Iec8c1710d33a4eeb3820cd70bd94bd5b02fa0b41
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-09-27 14:47:48 +00:00
Jüri Valdmann
91dbc59020 Fix unused variable warning in qrandom.cpp
The 'ret' variable is unused if assertions are disabled.

Change-Id: I90fec4e18e82d13b681068e222e994247988cbc5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-09-27 09:04:38 +00:00
Liang Qi
aadfe7d634 Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
	src/gui/kernel/qguiapplication.cpp
	src/platformsupport/input/libinput/qlibinputpointer.cpp
	src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h
	src/plugins/platforms/cocoa/qcocoawindow.h
	src/testlib/qtestsystem.h

Change-Id: I5975ffb3261c2dd82fe02ec4e57df7c0950226c5
2017-09-26 16:14:54 +02:00
Tor Arne Vestbø
4b6c144804 Revert "Revert "macOS: Deduplicate QNSWindow/QNSPanel code""
This reverts commit 3ad8295451.

The fix for the issue was landed in 5.10 as 1be1ed014b,
and will be merged into dev as a followup.

Change-Id: Id7773d1cc2caecbe358aadd9ade427a9c1eed9ef
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-09-26 12:28:35 +00:00
Timur Pocheptsov
a732e16d5f QtNetwork (examples) - update multicastsender
Similar to broadcast sender:

- where possible use local variables instead of data-members
- where possible avoid heap-allocated objects, use sub-objects instead
- change signal-slot connection syntax (and as a "bonus" - show our QOverload)

Task-number: QTBUG-60628
Change-Id: I8cd4f888c1d0653bdc8591800e713bbd347ad2fb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-09-25 18:43:35 +00:00
Alex Trotsenko
bec9afba6e QAbstractSocket: fix printing a debug message on successful connect
To have a consistent debug listing, we should print this message just
before emitting the signals.

Change-Id: Ibffcf1134d8b16c114fb54cad9afae86b5153f95
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-09-25 16:06:29 +00:00
Timur Pocheptsov
ddb191e47a QtNetwork (examples) - update secure socket client example
This patch contains:

- some cosmetic changes to  make example look more like
  modern C++;
- UI initialization code and SSL signals handling were split
  into separate member-functions;
- useless checks 'if (socket)' were deleted;
- widget's minimum size is now fixed + font size
  in 'CertInfo' dialog increased to make it readable.

Change-Id: I7aadb78896832a989494d280d6da0635045f948c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-09-25 13:59:50 +00:00
Friedemann Kleint
7896efdd9f QNativeGestureEvent: Fix documentation
Fix qdoc-warnings:

src/gui/kernel/qevent.cpp:2772: warning: Undocumented parameter 'dev' in QNativeGestureEvent::QNativeGestureEvent()
src/gui/kernel/qevent.cpp:2794: warning: No documentation for 'QNativeGestureEvent::device()'

Change-Id: I845b0925ad4f1d8602455444ebbd4ec6320ebae7
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-09-25 13:32:39 +00:00
Frederik Gladhorn
2b1ab81eda Register QVector with basic DBus types
In order to reduce surprises when using DBus, also register QVector
where QList is pre-registered.

Change-Id: I7fdc0a52b11cdc4ebb8338f9a8ba00c8a46c3ed5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-09-25 12:56:32 +00:00
Rainer Keller
bde42ffb8b Avoid window geometry jittering when changing geometry from JavaScript
The QML API allowed only separate setting of geometry parameters which
causes flickering when all parameters need to be changed.
By exposing the setGeometry function it is possible to set all of these
at once using an imperative setGeometry call from JavaScript.

Note that bindings for x/y/width/height are still evaluated
sequentially, resulting in four calls to the platform window's
setGeometry. This patch only introduces an imperative workaround for
that issue.

Change-Id: Ie9b0d3c39434740e50757ba7cff0385ae80f47f4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-09-25 12:56:04 +00:00
Tor Arne Vestbø
292cb12e02 testlib: Add qWaitFor to wait for predicate
Reduces duplication of logic and allows other primitives to be
built on top.

Change-Id: Ia100014cfb0c09ac2f47c3a156d0c76f0fddafa8
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-09-25 12:19:18 +00:00
Richard Moe Gustavsen
0dbede2b17 Widgets: be able to tab to a widget that has a focus proxy
When tabbing/searching for the next focus widget, the current
code would check if the next widget in the focus chain
had a focus proxy, and if so, ignore it. The exact reason
for this behavior is not clearly understood, but some widgets
(e.g QSpinBox) has children (a QLineEdit) that sets the parent
as focus proxy. If we didn't ignore children with focus proxy, tabbing
from a QSpinBox would lead us to find the inner QLineEdit, which
(because of its proxy), would lead us back to the QSpinBox. And
therefore not be able to tab out.

But ignoring the focus proxy has other problems. Normally a focus
proxy is the next sibling to the widget it acts as a proxy for, and
tabbing to the widget will therefore appear correct. But if the
focus proxy is not the next sibling, the logic will fail, since
the tab would anyway give focus to the next sibling. This becomes very
apparent if the focus proxy is a child of the widget, since then
its likely that the focus proxy is not the _first_ child among all
the children. So tabbing to the parent would not give focus to
the proxy.

This patch will change this logic so that you are allowed to tab to a
widget with a focus proxy. But we check that if you do so, you actually
end up moving focus in the right direction. If not, we ignore it like
before. This will ensure that we tab correctly when dealing with focus
proxies, and especially when focus proxies are used to construct
compound widgets.

[ChangeLog][Widgets] When tabbing to a widget with focus proxy, focus
will now be given to the proxy rather than just being ignored.

Task-number: QTBUG-10907
Change-Id: I66d1da5c941fdd984bb2783cc355ca65b553b5dd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-09-25 07:18:37 +00:00
Richard Moe Gustavsen
1fe27f79f7 Widgets: add QWidgetPrivate::deepestFocusProxy()
Factor out searching for the deepest focus proxy
in to a private function. Other than being called
from QWidget::setFocus(), this function will also be
used in subsequent patches.

Change-Id: I4450a42e362eccb64f8a88c7ea83b415101973b9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-09-25 07:18:28 +00:00
Eskil Abrahamsen Blomfeldt
5d2b12d71c Fix synchronization error when matching font with empty family
We currently match font family names in cross-platform code, before
asking the system to load it. In the case of an empty family name, we
will return the first font in the list which matches the other
conditions.

After that, though, we would pass the empty family name to the
platform font database, and some old platform-specific matching
was invoked. In the case of Windows, we would default to
MS Sans Serif, which is the old Windows 1.0 raster font and which
is probably used by Qt exclusively in the world at this point.

The problem in the end was that the font info would be out of sync.
If the font matched by Qt happened to be smoothly scalable, then
we would treat MS Sans Serif as smoothly scalable, giving us
random glyphs when displaying text in Qt Quick. We would also
overwrite the family name with the one matched by Qt, so even
when MS Sans Serif was used to render the text, we would report
that it was something else.

For empty font families, we therefore pass the family we have
actually matched into the platform database. This will have
the side effect of trusting the font matching in Qt, but only
for the rare case where someone actually explicitly sets the
font family to the empty string.

Note that the random glyph bug that triggered the investigation is not
happening anymore after 1eedfd0e66
because we will detect the glyph outlines as unreliable in the
MS Sans Serif font now instead of trusting the smoothly scalable
flag. But there would still be a mismatch between the font used
for rendering and the matched font.

Task-number: QTBUG-63147
Change-Id: I4a09ffddf9f8a0fabe7738e2944b6d874e4728f0
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-09-25 06:42:47 +00:00
Thiago Macieira
9467ebcf15 Autotest: centralize the detection of IPv6 support
I'll need it again in the next commit.

Change-Id: I209fcd5dbc2b4e5381cffffd14df65dcee71ca7e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-09-25 05:38:27 +00:00
Thiago Macieira
8656ee950b Refactor QNetworkAddress not to keep a full QHostAddress
QHostAddressPrivate is one QString and 24 bytes, allocated on the heap,
which is WAY too heavy for something that fits into 8 bits. So instead
of storing the expanded netmask inside QNetworkAddressEntryPrivate, we
store the simple prefix length and calculate the mask only if asked.

Change-Id: Ie05c6480d8a44fda817ffffd14d9ad4707aa8a92
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-09-25 05:38:24 +00:00
Thiago Macieira
758982bd74 QNetworkInterface/Windows: solve 11 year old puzzle about Win32 API
When I introduced QNetworkInterface in Qt 4.2, I didn't understand the
relationship between the prefix list and the unicast address list in the
IP_ADAPTERS_ADDRESSES structure. Turns out, there isn't a (direct) one
and the actual solution didn't come along until Windows Vista, adding
the prefix length to each address.

Change-Id: I6a556cca551116d77c7edf43f9c651dacb75348f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-09-25 05:38:21 +00:00
Thiago Macieira
59e0b6d40c QNetworkInterface: complete removing pre-Vista support
Commit 2589111dc0 removed the dynamic
function search, but did not remove the offsetof checks.

Change-Id: Ibd2b5263f7de551f47fe137dbe1a1b7b7cd71934
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-09-25 05:38:19 +00:00
Jake Petroules
bad4205250 Remove obsolete version checks
Our iOS deployment target is now 8, so this code will never be executed.

Change-Id: I7dd4001c01d7c8c2e8e977753cb3fa246b19ce06
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-09-25 00:58:52 +00:00
Jake Petroules
b0561e6382 Add currentType function to QOperatingSystemVersion
This allows us to retrieve the current OS type without constructing an
instance of the class, and it's also constexpr.

Change-Id: I8b32a1aebeb8139fe3fcf146e5de558fa1060bb8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-09-25 00:58:41 +00:00
Giuseppe D'Angelo
0d0ad598c5 QThread::create: move implementation out of line
Now that we accept STL datatypes in our ABI, expose a factory
function that takes a std::future<void>, and hide the QThread
subclass in our implementation. This also solves the problem
of a non-exported polymorphic class that would generate duplicate
vtables / typeinfo in all TUs.

Change-Id: I70a5c301e7c589de1a4a189db39b86b956d1ba0d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-09-24 15:05:25 +00:00
Giuseppe D'Angelo
e5033a5c9b QThread::create: make qdoc generate its documentation
Change-Id: I6eaaa0f9cbda6ef985cda63f2bf36d3102f34f32
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-09-24 12:35:59 +00:00
Gatis Paeglis
971adcaea1 examples: remove wince leftovers
This patch ammends c8602f45cc

Change-Id: I6bbc892b514b1768e4cc3a4d52aa420a6e9bb4e9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-09-22 19:22:07 +00:00
Alex Trotsenko
41ffe37a5f QAbstractSocket: optimize skipping
Avoid an unnecessary call to the slow base implementation on
buffered TCP socket.

Change-Id: Icc823b416b267aa8e0c1106b20872df9ef0e22d7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-09-22 16:11:36 +00:00
Mårten Nordheim
2734a6f24f Add the "we mean it" warning to qfutex_p.h
Change-Id: I77a0899532e2a38fa390991bbad11300672544bf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-09-22 15:52:42 +00:00
Thiago Macieira
282065d443 QRandomGenerator: update API to better name
"generate" is better than "get", and we already have "generate(it, it)"
which uses std::generate(). This changes:

 - get32()    →   generate()
 - get64()    →   generate64() and QRandomGenerator64::generate()
 - getReal()  →   generateDouble()

Change-Id: I6e1fe42ae4b742a7b811fffd14e5d7bd69abcdb3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-09-22 15:29:42 +00:00