Commit Graph

24009 Commits

Author SHA1 Message Date
Tasuku Suzuki
de76ccb967 Fix warnings with -no-feature-menu
Change-Id: I1e62e3772dbd5f17d9ad69025b23e3726386c2bd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Stephan Binner <stephan.binner@basyskom.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-04-30 07:49:32 +00:00
Tasuku Suzuki
da1079e51c Fix build without features.cupsjobwidget
Change-Id: I1b49a9f63a6a071457a3b9305dc87abe5f3b5b19
Reviewed-by: Stephan Binner <stephan.binner@basyskom.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-04-30 07:49:06 +00:00
Thiago Macieira
3c4c02b3f1 Include moc of qnamespace.h in qobject.cpp
Change-Id: I84e363d735b443cb9beefffd14b8bd4b39b00840
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-04-29 02:44:37 +00:00
Jesus Fernandez
dc8933e0aa Initialize vao variable
If vaoHelper is not valid the vao variable was being initializated with
a random value.

Change-Id: I44962841baeb1a1cff3124d6126e19c791feaea3
Coverity-Id: 171484
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-04-28 20:03:06 +00:00
Aaron Linville
5995238f29 Doc: Fix references to QIconEngineV2 and QIconEnginePluginV2
Fix a few lingering doc references to the old classes.

Task-number: QTBUG-59815
Change-Id: Ia6b406485260c943b018422aaeb8e22ca4406e81
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2017-04-28 20:02:48 +00:00
Gatis Paeglis
fad814088c do not wrap QAbstractEventDispatcher::flush with QT_DEPRECATED_SINCE
... as this would require us to remove usage of QAbstractEventDispatcher::flush
from Qt source code as well. We can not do this already in Qt 5.9 as there are
few event dispatchers in Qt that actually do override the ::flush (with non empty
bodies). Removing this code could result in behavior changes (not very likely) for
some user code. This method will be removed in Qt6.

Instead mark it with a well known "### Qt{Version}" comment.

This patch amends 41eefd7. The warning was:

qcoreapplication.cpp: In static member function ‘static void QCoreApplication::flush()’:
qcoreapplication.cpp:733:48: warning: ‘virtual void QAbstractEventDispatcher::flush()’ is deprecated [-Wdeprecated-declarations]
         self->d_func()->eventDispatcher->flush();

Change-Id: I48a1c68b84ff93268956205e1205e6d4b5d48664
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-28 17:23:18 +00:00
Thiago Macieira
63b94c5772 Export QPlatformThemeFactory, for use in qtdiag
Change-Id: I0e1a09998253489388abfffd14b5ee5392b0ce52
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-04-28 12:37:14 +00:00
Tasuku Suzuki
179fe5981f Fix build without features.networkproxy
Change-Id: Ie0868b2d2ec30513e870861514b252a79dff4998
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-04-28 12:33:17 +00:00
Gatis Paeglis
5106d496f3 wrap QCoreApplication::flush with QT_DEPRECATED_SINCE
... in cpp file as well.

This patch amends 41eefd7.

Change-Id: Id6a4dfd3a93a600fe3bb84bb74379451ad167aa8
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-04-28 08:40:48 +00:00
Tasuku Suzuki
9b8a7de794 Fix build without features.style-stylesheet
Change-Id: Ib7cf5db6c9a49e7f359410bc0ec3d1ceadcde5cf
Reviewed-by: Stephan Binner <stephan.binner@basyskom.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-28 08:10:49 +00:00
Allan Sandfeld Jensen
82c06fb0f5 Fix return of empty paths with multiple points on intersections
The intersection algorithm for intersection with rects, might return
one edge of the rect even if that edge does not intersect with the path.
To deal with that we collapse paths with empty bounding rects to the empty path.

Task-number: QTBUG-60024
Change-Id: I3e305983c66548e772d7d7ce3de99d715edbdd1b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-04-28 07:58:25 +00:00
Thiago Macieira
851b39a6d6 Update detection of $DESKTOP_SESSION
I don't know how widespread this use is, but apparently sddm seems to
set DESKTOP_SESSION to be the .desktop file that it used to launch the
session (minus the .desktop extension). In that case, we should read the
DesktopName entry from the file to get the actual desktop type.

And since the desktop detection from QGenericUnixServices should
suffice, we don't need to repeat the same code in QGenericUnixThemes.

Change-Id: I0e1a09998253489388abfffd14b5eeefbd7fe740
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2017-04-27 22:35:06 +00:00
Tasuku Suzuki
a9e0879ee1 Fix build without features.shortcut
Change-Id: I87a7ba1a77b0671559616a3ea4722bcc233af32d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-27 15:38:31 +00:00
Thiago Macieira
c1e19a2ecb QSysInfo: Make use of the QT_WARNING_DISABLE_DEPRECATED macro
We have it for a reason.

Change-Id: I84e363d735b443cb9beefffd14b8f355aeb8a31c
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-04-27 15:27:25 +00:00
Oliver Wolff
11e37a0e8c winrt: Use list initialization for KeyInfo's members
Change-Id: Idd05d1e1332efd9afc9816a48437fee377730735
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2017-04-27 07:00:17 +00:00
Oliver Wolff
eb77a24faa winrt: Fix text value for key release events
The text member was never filled and thus was not set in onKeyUp.

Change-Id: I0d0094745c385e0942635da643d863868b010c2a
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2017-04-27 07:00:16 +00:00
Oliver Wolff
4bfb464570 winrt: Remove wrong parameter from handleExtendedKeyEvent call
The event's count parameter is used to determine the number of keys
involved in the key event, not the repeat count of the key press.

The desktop windows implementation does not pass the "count" parameter,
so we omit it as well.

The tryShortcutOverride parameter is only used on macOS and thus can be
omitted as well.

Change-Id: Id7554e43cc73ec616f68444e82a38418e622e20a
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2017-04-27 07:00:15 +00:00
Dyami Caliri
32f8cbae90 QOpenGLWidget: Fix UB (invalid cast) in ~QOpenGLWidgetPrivate
The QOpenGLWidgetPrivate destructor calls reset(), which accesses
the Q-pointer. Calling Q_Q(Class) while still inside the private
class's destructor is wrong due to the cast in q_func() which is
undefined behavior at that stage.

Here is the UB report:
qopenglwidget.cpp:548:5: runtime error: downcast of address 0x000016d0e200 which does not point to an object of type 'QOpenGLWidget'
0x000016d0e200: note: object is of type 'QObject'
 00 00 00 00  10 30 32 0f 00 00 00 00  40 e2 d0 16 00 00 00 00  80 7b 42 0f 00 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'QObject'

0     QOpenGLWidgetPrivate::reset    qopenglwidget.cpp    656    0x607e667
1     QOpenGLWidgetPrivate::~QOpenGLWidgetPrivate    qopenglwidget.cpp    570    0x60982ab
2     QOpenGLWidgetPrivate::~QOpenGLWidgetPrivate    qopenglwidget.cpp    569    0x6098516
3     QScopedPointerDeleter<QObjectData>::cleanup    qscopedpointer.h    54    0xcbf7058
4     QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>>::~QScopedPointer    qscopedpointer.h    101    0xcbde858
5     QObject::~QObject    qobject.cpp    1042    0xcb94792
6     QWidget::~QWidget    qwidget.cpp    1701    0x5e173f7
7     QOpenGLWidget::~QOpenGLWidget    qopenglwidget.cpp    946    0x608d72b
8     ImagePreviewComponent::~ImagePreviewComponent    imagepreviewcomponent.h    16    0x58237b6
9     ImagePreviewComponent::~ImagePreviewComponent    imagepreviewcomponent.h    16    0x58238c6

Change-Id: If13932ac657afb9d1358ac82ab911a05e96cfbcd
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-04-27 01:38:48 +00:00
Gabriel de Dietrich
445191bba8 QMenu: Display the menu title on the torn-off menu's title bar
Change-Id: If16e262a6c8b39dff517cc105cf55686d4c22582
Task-number: QTBUG-11693
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-04-26 22:27:53 +00:00
Shawn Rutledge
6107f63f93 QXcbConnection::xi2ReportTabletEvent: use fixed1616ToReal
This should not change the result since fixed1616ToReal also divides
by 65536.  It's just to make it consistent with the other places that
we use fixed1616ToReal.

Change-Id: I96b3a07d1cbc98d7bdbe7a3b6035b196e34a5abc
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-04-26 18:57:57 +00:00
Thiago Macieira
8e6a17f687 Fix unused private fields in dbusmenu and dbustray
qdbusplatformmenu_p.h:131:9: error: private field 'm_reserved' is not used [-Werror,-Wunused-private-field]
qdbusplatformmenu_p.h:192:10: error: private field 'm_isSeparator' is not used [-Werror,-Wunused-private-field]
etc.

Change-Id: I84e363d735b443cb9beefffd14b8bc4253081145
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-04-26 13:11:39 +00:00
Thiago Macieira
6ac33c4841 Fix warnings about unused private fields we can't remove
These are in public classes, so we can't remove them until we get to
Qt 6.

qtimer.h:231:20: warning: private field 'del' is not used [-Wunused-private-field]

Change-Id: I84e363d735b443cb9beefffd14b8b5fb720c9e41
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-04-26 13:07:01 +00:00
Thiago Macieira
bd52bff35d Fix Clang build: it does not have __attribute__((optimize(x)))
Change-Id: I84e363d735b443cb9beefffd14b8b5f3885b84d6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-04-26 13:06:46 +00:00
Thiago Macieira
ac9103fd85 Fix ICC build with Q_FALLTHROUGH
ICC 17 does not yet implement C++17 [[fallthrough]] nor does it support
GCC's __attribute__((fallthrough))

Change-Id: I84e363d735b443cb9beefffd14b8aba60a7e3f81
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-04-26 12:53:36 +00:00
Timur Pocheptsov
2d2dd85766 QSslSocket (SecureTransport) - use anchors only from QSslConfiguration
Calling SecTrustSetAnchorCertificatesOnly(trust, false) we actually extend
what our user provided in QSslConfiguration as CA certificates (caCertificates,
setCaCertificates) - Secure Transport will also use a default set provided
by the system and SSL handshake can surprisingly (for a user) succeed.
And the default content of these caCertificates, if not altered by setCaCertificates
call - are those system CA certificates.

Task-number: QTBUG-60233
Change-Id: I8c1094bb7eec260f5202a47085f9f75e720eda7b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-04-26 12:42:40 +00:00
Tasuku Suzuki
36553f8efe Fix warning for -no-feature-evdev
Change-Id: I95af276a6d21e67a980cce1d8c6e41900ece7f31
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-26 09:09:22 +00:00
Vyacheslav Koscheev
5d61c0882c Android: add logging to QtCore JNI_OnLoad
Change-Id: I15609d14ac39f89bcba72df33d33a25ac23ad516
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-04-26 07:28:46 +00:00
Ulf Hermann
40fdc4f44c Check for qApp before using it in ibus plugin
We might call updatePreeditText from the QCoreApplication dtor by
running an event loop from inside a "post routine" added with
qAddPostRoutine().

Task-number: QTBUG-60000
Change-Id: I04c08fe36bfa63ac345a06e50952d2ec83a78ac0
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-04-25 16:51:32 +00:00
Tasuku Suzuki
b6ae2695af Fix warning for -no-feature-multiprocess
Change-Id: Ifa3382098c8f7c2cb1750b7ac5e583ddd71895e2
Reviewed-by: Stephan Binner <stephan.binner@basyskom.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-25 09:51:08 +00:00
Tasuku Suzuki
3828022508 Fix warning for -no-feature-cursor
Change-Id: I58a2bd715ff1767571d076a881872bd5eab2caec
Reviewed-by: Stephan Binner <stephan.binner@basyskom.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-25 09:50:30 +00:00
Stephan Binner
21db5ebea9 Fix warnings for -no-feature-animation
Change-Id: I624e68e96d2a673b36d9519d1189fe4a25e1fbd0
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-25 09:50:07 +00:00
Shawn Rutledge
fccc831af6 xcb: include keyboard modifiers with every touch event
Task-number: QTBUG-60389
Change-Id: I9bf77dffc39b82993bc66c7c7c26e3fa9778534e
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2017-04-25 08:37:40 +00:00
Paul Olav Tvete
5170ed8efb Don't use eglGetProcAddress() on Android
Android 4.1 has a limitation on how many slots are available
for eglGetProcAddress().

This reverts commit 7e393280e4
("OpenGLES20 direct function call removed") for the Android platform only.

Task-number: QTBUG-60318
Change-Id: I4a7224583e775143021735c037af07a95abbd6bf
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-04-25 08:29:48 +00:00
BogDan Vatra
c76918b2b2 Use gdbserver command from a safe place
Removed support for old QtCreator versions (pre 3.5)

Change-Id: I5ec0e965c09c8a76810144b133af3395e32fddfa
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-04-25 08:07:49 +00:00
Thiago Macieira
9e2c6899e0 QUrl: fix IDN conversion when the ACE form is invalid
We guarded against the Unicode form being invalid and did not produce an
encoded form. But we did not guard against proper Punycode sequences
that decode to forms that had not passed the proper Nameprep stage. So
check for that and, if it fails, just keep the label in the form we
found it in (it's valid STD3 anyway).

[ChangeLog][QtCore][QUrl] Fixed a bug that caused certain domain names
that look like Internationalized Domain Names to become corrupt in
decoded forms of QUrl, notably toString() and toDisplayString().

Task-number: QTBUG-60364
Change-Id: Iadfecb6f28984634979dfffd14b833142cca8d0d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-04-25 00:51:43 +00:00
Tor Arne Vestbø
e7222c0a71 Make QT_ASCII_CAST_WARN more informative
Change-Id: I4b9aad9cc2f2605a01635c2760e76fde7023f92f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-24 22:31:36 +00:00
Thiago Macieira
21dd5d314a QUrl: fix IDN whitelist checking when the TLD is in Unicode
The whitelist is kept in ACE form, so if the TLD came in Unicode, we
need to run ToASCII before we can check the whitelist. This is slightly
inefficient because we'll run the same operation later in this domain.

Change-Id: Iadfecb6f28984634979dfffd14b831f37b0f4818
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Florian Bruhin <qt-project.org@the-compiler.org>
2017-04-24 19:29:57 +00:00
Gatis Paeglis
fbb485d4f6 Prevent busy loop in glib event dispatcher
.. when running event loop with QEventLoop::ExcludeUserInputEvents.

In a properly functioning code, g_main_context_iteration is expected
to block until any event source becomes ready to dispatch an event
(or interrupt occurs). Qt provides several custom event sources to
the Glib event loop. The bug (busy loop) was caused by faulty event
source implementation when QEventLoop::ExcludeUserInputEvents is set.
As long as the window system's event queue was not empty, we signaled
to the event dispatcher that there is an event ready to be dispatched.
This results in the dispatcher calling the relevant dispatch function
(which does handle the ExcludeUserInputEvents flag correctly). As we
do not dispatch user events, the window system's event queue never
becomes empty and we enter a busy loop (CPU running at 100%) where we
signal that we have events to dispatch, but we actually do not dispatch
them and g_main_context_iteration never gets to block.

This busy loop can cause blocking GTK functions such as gtk_dialog_run()
never return.

Task-number: QTBUG-59760
Task-number: QTBUG-57101
Change-Id: I545b7951108eeaba019614ae8f5a1168c8b26c27
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
2017-04-24 18:11:13 +00:00
Kai Koehne
c2cac34e94 gradle: Complete qt_attribution.json file
Add it to the qtcore documentation, but mark it as a tool (code does
not get shipped with customer application).

Change-Id: I75cc199a2bbd86f9e40a75396144645ea69a7bd1
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-04-24 12:51:47 +00:00
Jesus Fernandez
87f9a44ef0 Fix QSqlRelationDelegate when using quotation marks
Strip the quotes from the field name in QSqlRelationalDelegate
implementation to able to find the field in the dictionary.

Task-number: QTBUG-59137
Change-Id: I2f1dc9ce3b9c91ca6cc3d3b82e61e1456c3b22c7
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-04-24 12:23:50 +00:00
Morten Johan Sørvig
8bc36c773f Cocoa: Send correct mouse buttons for tablets
Tablet vendors allow user configurable pen buttons
where the user may assign a logical mouse button to
a given physical button.

In the case of Wacom tablets this mapping is not reflected
in the buttonMask API, which returns the state of
the physical buttons.

Use NSEvent buttonNummber instead, which returns the
logical button number, after applying user mappings.
Unifiy button state stacking with the mouse handlers.

Handle a special case where buttonNumber returns 0
for tablet right mouse presses. We get these events
via rightMouse* event handlers and can hardcode the
button number.

Change-Id: I06b9b1aa98c49b84f7e3871e694c22c7ad0169d6
Task-number: QTBUG-57487
Task-number: QTBUG-54160
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-04-24 09:19:31 +00:00
Olivier Goffart
2eee24702b Fix UB in QSplitter::childEvent
The widget might be in the QObject destructor when the event is received,
so we can't static cast.
There is no need to check for isWindow for ChildRemoved because it would
not otherwise be on our list.

Change-Id: Ifc0a2979f1f6720f1963399276a28ac4a3224fff
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-04-23 10:11:14 +00:00
Olivier Goffart
88b6abcebf Fix UB in QStandardItemModel
The destructor of QStandardItem needs to access the model. So we need to
destroy them before the QStrandardItemModel gets destroyed.
In the destructor of the private, it is already too late because we are
already in the ~QObject

Since the destructor of QStandardItemPrivate is now empty, remove it
completely. There is no need for QStandardItemPrivate to have a virtual
table as there are no class that inherit from it.

Change-Id: Id6639e21f277f1c4e85c3f9bc720b4f29eb16c2c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-04-23 10:11:01 +00:00
Gatis Paeglis
41eefd7493 Deprecate QCoreApplication::flush()
... as it has outlived its original purpose:

Qt3 implementation on X11:
void QApplication::flush() { flushX(); }
void QApplication::flushX() { if (appDpy) XFlush( appDpy ); }

Qt4 implementation on X11:
Did nothing when QApplication::flush() was called (the flush()
overrides in {unix,glib} event dispatchers with empty bodies).

In Qt5 this function somehow has been repurposed (inconsistently)
to do what QCoreApplication::sendPostedEvents already does:

QAbstractEventDispatcher::flush() = 0;
 => QCocoaEventDispatcher::flush() {}
 => QEventDispatcherCoreFoundation::flush() {}
    => QIOSEventDispatcher (does not override ::flush())
 => QEventDispatcherGlib::flush() {}
    => QPAEventDispatcherGlib (does not override ::flush())
 => QEventDispatcherUNIX::flush() {}
    => QUnixEventDispatcherQPA (when QT_NO_GLIB=true)
       ::flush() { if (qApp) qApp->sendPostedEvents(); })
       ==> QAndroidEventDispatcher (does not override ::flush())
 => QEventDispatcherWin32::flush() {}
    => QOffscreenEventDispatcher::flush() {
         if (qApp) qApp->sendPostedEvents();
         QEventDispatcherWin32::flush();
       }
    => QWindowsGuiEventDispatcher (does not override ::flush())
       => QWindowsDirect2DEventDispatcher (does not override ::flush())
 => QEventDispatcherWinRT::flush() {}
    => QOffscreenEventDispatcher::flush() {
         if (qApp) qApp->sendPostedEvents();
         QEventDispatcherWinRT::flush();
       }
    => QWinRTEventDispatcher (qminimaleglintegration.cpp) (does not override ::flush())
    => QWinRTEventDispatcher (qwinrteventdispatcher.h) (does not override ::flush())

Whatever this function was doing on macOS in Qt3 and Qt4 also has been
dropped in Qt5. It appears that the other event dispatchers in Qt5 that
have overrides for flush() have simply copy-pasted this logic.

Clearly the documentation of QCoreApplication::flush() is outdated and
has nothing to do with the actual implementation in Qt5.

This function is rarely used in Qt5 sources. It should be safe to remove
the calls to QCoreApplication::flush() from Qt source code, as this
function has been doing nothing on most platforms anyways. Repurposing
it even broke handling of posted events (see QTBUG-48717).

[ChangeLog][QtCore][Event loop] QCoreApplication::flush() is now
deprecated. Use QCoreApplication::processEvents() and
QCoreApplication::sendPostedEvents() instead.

Task-number: QTBUG-33489
Task-number: QTBUG-48717
Change-Id: Icc7347ff203024b7153ea74be6bf527dd07ce821
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
2017-04-22 15:18:01 +00:00
Olivier Goffart
d4cdc45426 Fix QMetaMethod::invoke and automatic type registration
This was simply not working for two reasons:
 - The index passed to QMetaObject::metacall was not right (there was an offset
   because of the return type)
 - If the registration succeeded, the arguments were not even initialized.

The tests in tst_moc always called QMetaMethod::parameterType before calling invoke,
which was properly registering the type. So this was not seen in the tests before.

[ChangeLog][QtCore][QMetaMethod] Fixed crash in invoke() with QueuedConnection and
types whose metatype gets automatically registered.

Task-number: QTBUG-60185
Change-Id: I4247628484214fba0a8acc1813ed8f112f59c888
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-22 11:25:49 +00:00
Laszlo Agocs
23287dfb15 Update qopenglext.h
Change-Id: Ifb1d20855f0c0b9459d7ff2e01fbda1f713bff35
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-04-22 11:05:49 +00:00
Laszlo Agocs
01902c2343 Update qopengles2ext.h
Change-Id: I03b867133a00ef6e662a05d5eac7a733747fb8be
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-04-22 11:05:43 +00:00
Morten Johan Sørvig
b113107419 QMacStyle: Fix scroller memory leak
Calling initWithFrame repeatedly on the same object
leaks memory since internal structures allocated on
the previous init call will not be released.

However, initWithFrame is the only API that can set
scroller direction, which is does based on the geometry.

Use two scroller objets, one for each of the horizontal
and vertical cases.

Task-number: QTBUG-60004
Change-Id: I5d07b62e6969a1824ab705941ac4d0340139b99c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-04-21 16:52:36 +00:00
Gabriel de Dietrich
5cde07350c QMacStyle: Properly flip vertical sliders
Cocoa is better than us at vertically flipping views,
so we use that API instead of fiddling with the graphics
context transforms. But only so from 10.12 onwards. Go
figure.

This also fixes a one pixel offset with horizontal sliders
handle on non-retina displays.

Change-Id: Ia3da8431ad0499a4b6fb7bf6973ed353d91c2905
Task-number: QTBUG-59666
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-04-21 16:52:22 +00:00
Tor Arne Vestbø
031e0f4364 macOS: Fix crash when closing windows with raster backingstore
After 5b78fcd03b the raster backingstore tries to use the platform window
to resolve the native DPR, but we might not always have a platform window.

Instead we go though the window, like before, which has fallback paths for
the case of no platform window, and then remove the Qt scaling factor
manually.

Change-Id: I19c8383b0a33f3d97aaf0d0e886ed03e14cb1592
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-04-21 15:12:52 +00:00
Nico Vertriest
4a46a7cf50 Doc: correct \sa statement
qnetworkreply.cpp:307: warning: Can't link to 'QNetworkRequest::UserVerifiedRedirectsPolicy'

Change-Id: Ic96f834f3ca9984f626833e45e69f6322b83d12d
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-04-21 15:10:02 +00:00
Tor Arne Vestbø
84b3f12310 macOS: Defer population of localized font family aliases until needed
Getting the localized family name of a font involves quite a bit of work
internally in CoreText, e.g. creating and sorting font descriptors.

By deferring population of family aliases until a font match misses
we shave off ~1 second of startup time for applications that use non-
localized font families (most applications).

Change-Id: I021952c311c0d70d7769ccf764dbf997ebf30a4b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-04-21 10:36:00 +00:00
Tor Arne Vestbø
414c751c7d Fall back to QWindow's screen when resolving DPR instead of using qApp
QGuiApplication::devicePixelRatio() should only be used when we don't
know which window we're targeting. For QWindow::devicePixelRatio(),
we can go though the associated screen to get a more accurate DPR.

Change-Id: Idf511fa5c09562a6daf391cd4d0b8b99471045e7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-04-21 10:32:47 +00:00
Nico Vertriest
b4c8455eeb Doc: correct incorrect syntax \li command
qstringbuilder.cpp:75: warning: Command '\li' outside of '\list' and '\table'

Change-Id: I2353462cfd14a4f7cf60d5064ecb069155d1cd34
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-04-21 10:17:22 +00:00
Marc Mutz
dfc2a4a537 QLoggingRegistry: remove rules vector
It only contained a concatenation of the individual rule sets,
probably to fix their order in a central place, as well as
simplifying iteration in defaultCategoryFilter().

Fix these two issues differently, but introducing a RuleSet
enum that lists rule sets in the order in which they should
be applied by defaultCategoryFilter(), and turn individual
rule sets vectors into a C array of vectors.

This enables two nested loops in defaultCategoryFilter to
replace the one loop over 'rules'. Apart from building up
'rules' in updateRules(), this was the only access to that
member. That leaves updateRules() with just the task of
running defaultCategoryFilter() on the new rule sets.
Consequently, a call to updateRules() can now replace the
identical loop in installFilter().

Performance should not suffer. Iterating over a fixed-size
array of vectors is hardly any slower than iterating over
a single vector, and while the construction of 'rules'
was probably a one-off task in most programs, this way
of keeping the rules also saves memory because rules are
not kept in two different vectors.

It is also more maintainable, of course.

Change-Id: Ibc132d096c8137dd02b034752646212e51208637
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-04-21 07:16:33 +00:00
Stephan Binner
45104dff04 Remove wrong features.rubberband condition of features.itemviews
Change-Id: I0eff127baba2f8677ae08bb18ef0b4bb742d7b6e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-04-21 06:53:46 +00:00
Stephan Binner
72b3fa702a Remove features.rubberband dependency of features.splitter
Change-Id: Ia55850f37f9384c8e00cef699fa308a02af64fd5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-04-21 05:47:02 +00:00
Stephan Binner
38bedf34c9 Remove wrong features.rubberband condition of features.dockwidget
Change-Id: I8259274e7eba7943eb3a944a18fa8b598eb697d7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-04-21 05:46:59 +00:00
Joni Poikelin
903a59042e Fix QComboBox popup from opening on wrong screen
Nothing seems to be telling the popup on which screen it should be shown
on. To fix this, simply set same screen the QComboBox uses to the popup.

Task-number: QTBUG-58392
Change-Id: If62a26fe4e51bcf3d770ee72c9baa998541618f4
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-04-21 04:40:11 +00:00
Tasuku Suzuki
2a41e05fde Fix build without features.xlib
Change-Id: I5c95540ba0deb8a1688d8994522324552f2432e2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-04-21 02:59:52 +00:00
Marc Mutz
7291a24416 QErrorMessage: use QStringBuilder
Extract Method msgType2i18nString() and use it to build 'rich' in a
single QStringBuilder expression.

Replace the switch over QtMsgType with an array of QT_TRANSLATE_NOOP'ed
strings. That introduces a dependency on the order and amount of enum
values, so add static and dynamic asserts to catch any change.

Saves memory allocations, as well as nearly 300B in text size on GCC 7
optimized Linux AMD64 builds.

Change-Id: I48cc916cba283e482a90ca4ae28aa17b26a4e5ab
Reviewed-by: David Faure <david.faure@kdab.com>
2017-04-20 18:09:10 +00:00
Laszlo Agocs
c3bd694c18 Fix typo in QRasterPlatformPixmap::metric()
Task-number: QTBUG-60132
Change-Id: I1f0ad7babf16800d3acdf579db6abd6854e1ed76
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-04-20 08:53:24 +00:00
Marc Mutz
126c4eae84 Split Q_COMPILER_UNICODE_STRINGS: add Q_STDLIB_UNICODE_STRINGS
Since commit bf2160e72c, we can rely on
charNN_t support in all compilers except MSVC 2013, and since that
commit, we use (in 5.10, not 5.9, yet)

  !defined(Q_OS_WIN) || defined(Q_COMPILER_UNICODE_STRINGS)

when we only need charNN_t, the type, as opposed to its library
support (u16string, char_traits<char16_t>, ...).

This patch splits the Q_C_UNICODE_STRINGS macro into two, adding
Q_STDLIB_UNICODE_STRINGS for when we need std::uNNstring, leaving
Q_C_UNICODE_STRINGS for when we need just charNN_t support.

In QDebug, when constructing a QChar out of a char16_t, cast to ushort
first, since QChar(char16_t) was only officially introduced in Qt 5.10.

[ChangeLog][Potentially Source-Incompatible Changes] The internal
Q_COMPILER_UNICODE_STRINGS macro is now defined if the compiler
supports charNN_t, even if the standard library does not. To check for
availability of std::uNNstring, use the new Q_STDLIB_UNICODE_STRINGS
macro.

Change-Id: I8f210fd7f1799fe21faf54506475a759b1f76a59
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-20 06:50:36 +00:00
Thiago Macieira
3dcc075f4a Move Q_REQUIRED_RESULT to its correct position
That's before the return type or static, inline, constexpr or such
keywords (if any).

Perl Script:
s/^(\s+)(.*) Q_REQUIRED_RESULT(;)?(\s*\/\/.*)?$/\1Q_REQUIRED_RESULT \2\3\4/

Change-Id: I7814054a102a407d876ffffd14b6a16182f159e2
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-04-20 05:40:59 +00:00
Thiago Macieira
870964895b Don't disable Q_REQUIRED_RESULT with Clang and ICC
They're not affected by the GCC bug noted in the comment.

Change-Id: I7814054a102a407d876ffffd14b69e8a8e2527f1
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-04-20 05:40:27 +00:00
Thiago Macieira
47c9b66a8b Disable precompiled headers for small modules
Creating a precompiled header exclusively for a one- or two-file module
is wasteful. The time that it takes to build the precompiled source is
on the same order as a regular compilation, so enabling precompiled
headers for those modules just makes the build slower.

Also make it possible to override the precompiled header by just setting
PRECOMPILED_HEADER to empty.

Change-Id: I0e1a09998253489388abfffd14b5f221288c4826
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-04-20 05:39:47 +00:00
Giuseppe D'Angelo
e70e8dd6a9 qgrayraster: use a cast to void to mark a variable as unused
Do not use a self-assignment, as that may trigger compiler warnings.

Casting to void is also what Q_UNUSED is doing these days, but we can't
use it here because qgrayraster.c does not include qglobal.h.

Remove a 15-years old comment related to the self assignment.

Found by clazy.

Change-Id: I8cc92b7a1b0b5fb13824959740243e17606ec753
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-20 04:44:24 +00:00
Tor Arne Vestbø
924b02aecb Revert "Initialize QLoggingRegistry rules on first use, not qApp construction"
This reverts commit 47cc9e23a3.

We use QCoreApplication::applicationDirPath in the logging initialization to find
a possible qtlogging.ini file. Because QCoreApplication::applicationDirPath requires
a QCoreApplication instance this leads to a qWarning, which in turn leads to a
recursive call to the logging initialization, and in turn to a recursive mutex deadlock.

Task-number: QTCREATORBUG-18031
Change-Id: Ic75e1e8c062eb647991725378489bf87c9648cca
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-04-19 22:59:43 +00:00
Olivier Goffart
97850b952c Fix UB in QWidgetEffectSourcePrivate::detach
Delete the QGraphicsEffect from the QWidget destructor instead of from
the QWidgetPrivate destructor. The destructor of QGraphicsEffect still
access methods of the QWidget, but the QObjectPrivate being destroyed
from ~QObject, the pointer is no longer a QWidget.

Fix warning with UB sanitizer in tst_QWidget::setGraphicsEffect

qwidget_p.h:900:23: runtime error: member call on address 0x000001d822c0 which does not point to an object of type 'QWidget'
0x000001d822c0: note: object is of type 'QObject'
 00 00 00 00  b0 46 5f 40 e5 7f 00 00  00 23 d8 01 00 00 00 00  f0 e6 00 44 e5 7f 00 00  00 00 74 47
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'QObject'
    #0 0x7fe54767db76 in QWidgetEffectSourcePrivate::detach()
    #1 0x7fe548f29815 in QGraphicsEffect::~QGraphicsEffect()
    #2 0x7fe548f2a1b7 in QGraphicsBlurEffect::~QGraphicsBlurEffect()
    #3 0x7fe548f2a208 in QGraphicsBlurEffect::~QGraphicsBlurEffect()
    #4 0x7fe5475cd463 in QWidgetPrivate::~QWidgetPrivate()
    #5 0x7fe5475ce62c in QWidgetPrivate::~QWidgetPrivate()
    #6 0x7fe5400d0dda in QObject::~QObject()
    #7 0x7fe54763d411 in QWidget::~QWidget()
    #8 0x7fe54763d7f4 in QWidget::~QWidget()
    #9 0x4cc309 in QScopedPointerDeleter<QWidget>::cleanup(QWidget*)
    #10 0x4cc309 in QScopedPointer<QWidget, QScopedPointerDeleter<QWidget> >::reset(QWidget*)
    #11 0x4cc309 in tst_QWidget::setGraphicsEffect()

Change-Id: I19c049e979cfce2adda908af8336cb4adac8f6c4
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-04-19 13:25:19 +00:00
Olivier Goffart
cdb7e81572 Fix UB in QLayout::childEvent
We can't just static_cast a child to QLayout, because the child might
not be a QLayout, and even if it was, we might be called from the
QObject destructor so we would not be a layout anymore.
Instead we can just qobject_cast the deleted object to a QLayout and
remove it from the layout with removeItem.
This would not take in account the case where we would be called because
the QLayout gets destroyed, so we handle this case from ~QLayout by
removing ourself from the parent.

Note that the comment in ~QLayout was wrong, as the layout gets destroyed
explicitly from ~QWidget, not from ~QObject.

Change-Id: I49c6f17a76f207b9d750b6e5d987469498b96b31
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-04-19 13:25:14 +00:00
Tor Arne Vestbø
f368cd8868 macOS: Initialize window geometry early on, instead of when creating NSWindow
We don't need to defer to NSWindow creation before determining the initial
window geometry, and we don't need to redetermine each time we re-create
an NSWindow for a QCocoaWindow.

Change-Id: Ie13380830b44e96670ff16513f29deef5f5ae313
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-04-19 12:50:46 +00:00
Nico Vertriest
30d825f5f2 Doc: Fix link errors
qimage.cpp:2127: warning: Can't link to 'isDetached()'
qmatrix4x4.cpp:1933: warning: Can't link to 'operator()()'

Change-Id: I93a2ead9650faf139040173f8d3b24cfa1e730ae
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-04-19 12:27:01 +00:00
Oliver Wolff
32b92b9e21 winrt: Fix keyboard modifier states
CoreWindow::GetAsyncKeyState returns flags and not enums so checking
equality does not give the needed result.

As seen in qwindowskeymapper.cpp key events that only contain a modifier
key should not have the key itself as a modifier when calling
handleExtendedKeyEvent.

With the current approach the modifier states are the same as
on desktop Windows.

Task-number: QTBUG-58750
Change-Id: Ie0f3e1d3e8294e1a6b41c9223a7a5153306579f6
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2017-04-19 10:27:35 +00:00
Oliver Wolff
ad0249cc79 winrt: Fix QKeyEvent::isAutoRepeat
CorePhysicalKeyStatus::KeyStatus does not give the information we are
after so we have to keep track of "auto repeat" state of the keys
ourself.

Task-number: QTBUG-59232
Change-Id: I22aa185780e5fa1f7f3c23c2deb2a0dde0c4a582
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2017-04-19 10:27:32 +00:00
Allan Sandfeld Jensen
ee3ac3a3bf Fix PNGs saved from QImage transform of 8-bit images
Fixes two separate errors. QImage::transform was incorrectly adding
colors to the color-table of the returned image when the converted image
would not be indexed, and qpnghandler was looking at non-empty color-
table instead of color format.

Task-number: QTBUG-43708
Change-Id: Ife14b6428ca65ac7d3a0b36a89a73e56d64586b4
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-04-19 10:08:41 +00:00
Elvis Angelaccio
288bfb0bbd QLineEdit: Make the clear button always the leftmost button
QLineEditIconButton currently draws a fully transparent pixmap in its
paintEvent() function, when the line edit is empty. This does not work
when there is another trailing QAction that is visible even when the
line edit has no text, as reported in QTBUG-59957.

To fix this issue, make sure the clear button is always the leftmost
button.

Task-number: QTBUG-59957
Change-Id: I8a4f96aae07856aa0e1053ebb338ba9bdf052a16
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-04-19 08:49:49 +00:00
Timur Pocheptsov
254f35ce98 QNetworkReplyHttpImpl - check 'isOpen' twice
A signal emitted after the first 'isOpen' check on QNetworkReply can
trigger a slot that aborts/closes our reply. So before we can append
any data to reply's buffer, we have to re-check that we're still open.

Task-number: QTBUG-59909
Change-Id: I781d5a4fd5fc30d485af63f45cf36c254378af64
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-04-19 08:13:32 +00:00
Stephan Binner
59d9ee0aa4 Fix build for -no-feature-cssparser
Change-Id: I78b66e8a98458736c69c4955390a98f8889968ea
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-19 08:00:39 +00:00
Stephan Binner
b3066656e5 Fix warning for -no-feature-graphicseffect
Change-Id: I0be9e4293dfcef3c144f4e998ea071336c4d56d3
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-19 08:00:26 +00:00
Stephan Binner
45f7d35f7b Fix warning for -no-feature-gestures
Change-Id: Iaadc4e27ee2a75a8c053de4438ef74daaa48ee64
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-19 08:00:16 +00:00
Stephan Binner
dde83fdeeb Fix warnings for -no-feature-texthtmlparser
Change-Id: Ie757e4ecb9ced14bd809f56d2d3d09274fc3bc39
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-19 08:00:06 +00:00
Friedemann Kleint
2381332b0d Doc: Hide QPA classes
Mark QPlatformGraphicsBuffer and QSystemTrayIcon as internal.

Change-Id: I39e5b4f635fca21ab0544cd840a113514b6b1e99
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-04-19 07:25:05 +00:00
Friedemann Kleint
c5dafb177f Add debug output for QScrollPrepareEvent and QScrollEvent
Change-Id: If283cecbefdf20c80ce00f689003f6a0ed9fe42b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-04-19 06:29:50 +00:00
Tor Arne Vestbø
47cc9e23a3 Initialize QLoggingRegistry rules on first use, not qApp construction
Allows categorized logging before QCoreApplication has been created,
which otherwise would silently fail to output anything because the
category would never be enabled, despite QT_LOGGING_RULES being set.

Change-Id: Ia733105c5b6f28e22af511ced5271e45782da12b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-18 21:09:43 +00:00
Friedemann Kleint
9595622e36 QGraphicsBlurEffect: Fix for high DPI scaling
Preserve the device pixel ratio in the various helper functions
and when drawing.

Task-number: QTBUG-60026
Change-Id: Ieac9360b00044b6aedd0d3e1ad6e3b16d436f20f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-04-18 20:27:36 +00:00
Nico Vertriest
fc2f0fb390 Doc: add missing doc for parameters
qhstspolicy.cpp:105: warning: Undocumented parameter 'flags' in QHstsPolicy::QHstsPolicy()
qhstspolicy.cpp:105: warning: No such parameter 'includeSubDomains' in QHstsPolicy::QHstsPolicy()
qnetworkaccessmanager.cpp:732: warning: Undocumented parameter 'knownHosts' in QNetworkAccessManager::addStrictTransportSecurityHosts()

Change-Id: I24217d328df12febab30e19e2abd351e87007959
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-04-18 14:18:36 +00:00
Friedemann Kleint
8b62673d9f QGraphicsDropShadowEffect: Fix for high DPI scaling
Preserve the device pixel ratio.

Task-number: QTBUG-60026
Change-Id: Ie818c582fe2c7b11ceb347b39cfbf7ea49361021
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-04-18 13:08:43 +00:00
Leena Miettinen
84fb8c5ec9 Doc: Remove broken link to QWindowSystemInterface::registerTouchDevice()
Mention that it is a private function. Also mention using
QTest::createTouchDevice() for adding simulated touch screens
to autotests.

Task-number: QTBUG-26647
Change-Id: I08c12225768e76b1b9e3fc0fda00af86d44ca766
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Bo Thorsen <bo@vikingsoft.eu>
Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
2017-04-18 12:57:45 +00:00
Friedemann Kleint
db2de20c59 QGraphicsColorizeEffect: Fix for high DPI scaling
Preserve the device pixel ratio.

Task-number: QTBUG-60026
Change-Id: I91a1bda6ce4defd064ec7edfcea40ff192a9068f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-04-18 12:27:57 +00:00
Nico Vertriest
f26be29ea8 Doc: add missing specs about parameters
qopengltexture.cpp:3476: warning: Undocumented parameter 'layerCount' in
QOpenGLTexture::setCompressedData() and QOpenGLTexture::setData()
qimage.cpp:2127: warning: Undocumented parameter 'format' in QImage::reinterpretAsFormat()

Change-Id: I17feb2256a29f3bb722d2de3a83b390abff85a35
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-04-18 11:33:21 +00:00
Nico Vertriest
28ea26e574 Doc: rephrase parameter description to avoid qdoc error message
Change-Id: I79d446289b4450d2fcce097cf46d2cf7b6d969da
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2017-04-18 10:37:50 +00:00
Tor Arne Vestbø
46976eea18 Add debug operators for font database structs for easier debugging
Change-Id: Ice1b27ff93de2d369dc6b66c72a64eb05da5639c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-04-18 09:40:41 +00:00
Liang Qi
18934bcb0c Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
	src/corelib/global/qglobal.cpp

Change-Id: I375fa4afa662fa411a15f212ebd5f2f0dffdba7f
2017-04-18 10:46:22 +02:00
Paul Olav Tvete
bc5454d2c4 Fix build error with -no-feature-slider
Change-Id: Ia74aeefdba3ac6b831aeeaff40600e30d90183d8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-04-18 06:59:54 +00:00
Thiago Macieira
285789781c icc: thread_local in macOS is working since 10.7
Change-Id: I0e1a09998253489388abfffd14b611b1403a0c9f
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-04-17 16:24:47 +00:00
Ihor Dutchak
d1210281e4 Fix undefined behavior in QSharedPointer::create()
Initialize a deleter for a new object, created by
QSharedPointer::create(), only after the object is actually
constructed.

[ChangeLog][QtCore][QSharedPointer] Fixed undefined behavior when
creating an object with QSharedPointer::create() and its conscructor
throws an exception.

Task-number: QTBUG-49824
Change-Id: I07f77a78ff468d9b45b8ef133278e8cdd96a0647
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-04-17 09:56:15 +00:00
Thiago Macieira
34d2fd1497 Fix build with libdrm >= 2.4.78
drmEventContext has grown by one pointer, so the build fails with an
error about a member without initialization.

 qeglfskmsgbmdevice.cpp:147:5: error: missing initializer for member ‘_drmEventContext::page_flip_handler2’ [-Werror=missing-field-initializers]

Change-Id: I0e1a09998253489388abfffd14b6014b1ddc90e1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-04-17 09:44:11 +00:00
Thiago Macieira
3bea9450e9 Update the Clang support for SIMD code generation
Clang 3.8 has support for __attribute__((target(xxx))) and its SIMD
headers can be included unconditionally.

Change-Id: Ic15b7ff417c8412893e5fffd14b5b42b950b48d7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-04-17 00:04:21 +00:00
Thiago Macieira
2814744a73 Update the Clang usual versions for Apple's build
Change-Id: Id69a70a52573241e1b6a05bd62a3fd01a8e78550
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-04-16 07:39:30 +00:00
Thiago Macieira
89c8dd30a1 qfloat16: Fix GCC warning about use of old-style cast
_mm_cvtps_ph is usually defined as a macro:
qfloat16.h:122:37: error: use of old-style cast [-Werror=old-style-cast]

Change-Id: Icd0e0d4b27cb4e5eb892fffd14b516ec47826c0c
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-04-15 03:33:33 +00:00
Gabriel de Dietrich
d5d31c64a4 QSplitter::replaceWidget(): Add geometry related remark
The late geometry update on the widget has been confusing
some of our users.

Change-Id: I7f2600322be0a0c54fac3beb42065413a0693f74
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-04-14 17:06:27 +00:00
Dongmei Wang
ae6ef2e3ec QMenu: Fix torn-off menu display crash issue
When tearing off either a non-scrollable multi-colume menu
or a scrollable menu, displaying the torn-off menu crashes.
The root cause is when the torn-off menu is created, the
tear-off menu's style, margins and other attributes are not
set to it. The patch is to ensure the torn-off menu has
the same attributes as the tear-off menu does and set the
torn-off menu with a correct menu size.

Task-number: QTBUG-24815
Change-Id: Icea45f149ea8792671af4a62e62cad6ee01a1f95
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-04-14 17:06:12 +00:00
Dongmei Wang
eea585ad0b QMenu: Fix margins related display issues
Currently the contents margins and the menu paddings are not considered
for calculating the menu size, the positions and the size of tear-off
bar, scrollers and the positions of the menu items when scrolling the
menu, which results in the following problems when valid contents
margins and/or menu paddings are set:

- The tear off area is displayed in a wrong position. The mouse events
are not handled correctly in the tear off area. For example, when you
click in the tear off area, the menu should be torn off but nothing
happens
- For a multi-column menu, the menu width is not calculated correctly
- For a scrollable menu,
  - the menu width is not calculated correctly
  - the menu items are not displayed in correct positions
  - the scrollers are not displayed in correct positions
  - menu items are displayed on the area of borders and margins when
    scrolling the menu
  - the last menu item is not displayed above the bottom of the content
    area when scrolling the menu to the end.

The changes are to fix the problems above.

Change-Id: I7931e1088dff0029f2d4825e2aa34b4e32fdccd9
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-04-14 17:06:00 +00:00
Marc Mutz
e1c8451ffe QVariant: implement QByteArray ↔ QUuid conversion
Seems like an obvious omission.

[ChangeLog][QtCore][QVariant] Can now convert QUuid to and from
QByteArray, not just QString.

Change-Id: Ib56ae86ca0c27adaf1e095b6b85e64fe64ea8d18
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-14 12:54:21 +00:00
Marc Mutz
5662234afa QMatrix4x4: fix aliasing problem in operator*=
When multiplying a QMatrix4x4 by itself, we were clobbering the very
matrix we read from. Employ read-caching to avoid this aliasing problem.

[ChangeLog][QtGui][QMatrix4x4] operator*=() now calculates the correct
result even if the RHS and LHS are the same object.

Change-Id: I8534d56cfdd62c336577125127f05173fcec2873
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-04-14 12:29:35 +00:00
Friedemann Kleint
eca6f5492c Windows QPA: Move initialization of resources out of the Qt namespace
Q_INIT_RESOURCE() should not be within the Qt namespace; the
namespace is appended to the resource function.

Task-number: QTBUG-60118
Change-Id: I05203c3196ccdcffaf27658bcd7f3ec1c25f22d9
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-04-13 12:40:03 +00:00
Jake Petroules
fbcdf6d753 Be more explicit about the supported platforms for OpenGL ES 2
The OpenGLES framework is only supported on iOS and tvOS, and does not
exist on macOS and watchOS.

Change-Id: I643d3bdac522b67a8d945648dfcc8f1780ab0d7f
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-04-13 02:11:12 +00:00
Gabriel de Dietrich
e7443b88fc bootstrap: Remove redundant occurrence of qcore_foundation.mm
Already added in the "mac" clause.

Change-Id: I272882347cb65ef32e5aae7b1eee9f15cede6fcb
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-04-12 23:24:31 +00:00
Samuel Gaist
98e0cb0a28 Doc: updated QSyntaxHighlighter documentation and use QRegularExpression
The documentation of QSyntaxHighlighter still uses the deprecated
QRegExp class. This patch updates the code samples as well as cleanup
some typos.

Change-Id: I87b525fddb560b7c5bb38f96d9aaceadb594f76c
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2017-04-12 22:09:43 +00:00
Giuseppe D'Angelo
feaaca456b QLocale: do not test for Q_OS_MAC before including qglobal.h
Found by clazy.

Change-Id: I66b6698c309720891db83626e18c5e1baca19091
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-12 18:31:33 +00:00
Liang Qi
94c576cf66 Merge remote-tracking branch 'origin/5.8' into 5.9
Change-Id: I3bd83a839b16822035ed56a5cffe77bd6bc3f08d
2017-04-12 20:08:56 +02:00
Marco Trevisan (Treviño)
b727f11c2e QFontconfigDatabase: properly parse desktop environment variable
$XDG_CURRENT_DESKTOP is defined as a colon-separated list of
desktop strings, thus we can't check for equality, but split it
and check if it contains the desktop environments we care about.

Change-Id: Ia9ab0f28654a3e1a68b918794a079f3974f85642
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
2017-04-12 11:11:32 +00:00
Tor Arne Vestbø
7f29367c09 Prevent QWindow transient parent loop
Clients may wrongly set the transient parent to the window itself,
causing endless loop when e.g. looking for the top level parent.

Change-Id: Ib23cae3a5576320435ae9b76dd618d1e5ae08b5d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-04-12 10:00:52 +00:00
Friedemann Kleint
59d4cbca0b QWindowsFontEngineDirectWrite: Fix build with MinGW
In member function 'void tn::QWindowsFontEngineDirectWrite::collectMetrics()':
windows\qwindowsfontenginedirectwrite.cpp:361:22: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     if (table.size() >= advanceWidthMaxLocation + sizeof(quint16)) {
                      ^
Amends 17fc188aec.

Task-number: QTBUG-58954
Change-Id: Ice2ff135d411b55d32290069b3c85ca0b5ea09af
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-04-12 08:32:00 +00:00
Błażej Szczygieł
bdd5a67e65 QtWidgets: Don't open submenus when mouse is moving between actions
Don't set the current action during closing submenu when mouse moved
more than one action in the menu to the top or to the bottom.

Task-number: QTBUG-53215
Change-Id: I2383363bc48f644df046198662dfa4d080fe3f1d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-04-12 07:29:18 +00:00
Marc Mutz
11ed95ac9c Improve QStringBuilder docs
- Mention you can build QByteArrays, too
- Nicer list of types that can be used, separate for QByteArray and
  QString

Change-Id: Ia91445f0cb4872bab12a55f4812c283e9c38dba4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2017-04-12 06:46:12 +00:00
Thiago Macieira
cdc5f47aeb Restore compatibility with Qt 5.7.0 and 5.6.1
QSysInfo::productType() returned "osx" for all versions of macOS, even
10.12. Change 3e2bde3578 was incorrect.

[ChangeLog][Important Behavior Changes] QSysInfo::productType() and
QFileSelector behavior on macOS was restored to match what Qt used to
return in version 5.7.0 and earlier. The behavior found in Qt 5.6.2,
5.7.1 and 5.8.0 is removed.

[ChangeLog][Future Compatibility Notice] The identifiers that
QSysInfo::productType() and QFileSelector will use to identify macOS
systems will change in Qt 6.0 to match the Apple naming guidelines which
will be current then.

Task-number: QTBUG-59849
Change-Id: Ib0e40a7a3ebc44329f23fffd14b2b39392210c4f
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-04-12 05:14:19 +00:00
Thiago Macieira
e45516ea0d QSysInfo: Bring back suppression of ICC warning #1478
Turns out that different versions of ICC use different warning numbers.
The Linux and Windows compilers emit 1786, but the macOS one emits 1478.
Don't ask me why.

Change-Id: I523b0abacd5148b2bf08fffd14b475a4c4d89ba1
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-04-12 03:37:11 +00:00
Jake Petroules
cd5c8e78c7 QProcess: fix Unix build
This fixes a regression introduced in ff19ebcc

Task-number: QTBUG-60046
Change-Id: I47c357433b25f07011a7a3a64d3150591785b206
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-04-11 17:07:19 +00:00
Andy Shaw
1cd8c6f48e Make networkAccessibility() return the actual state of the network
If networkAccessibility() was queried when the networkAccessibleChanged
signal was emitted then it would report the wrong state and in some
instances it would incorrectly report NotAccessible. This ensures that
it is reflecting what the signal would have been emitted with.

Change-Id: Ib0a7ef9e9ec42c9007340020fd535c8ad36caa49
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-04-11 16:31:32 +00:00
Tor Arne Vestbø
f9226217d1 macOS: Prevent leaking font data when creating QRawFont from QByteArrays
CTFontCreateWithGraphicsFont has a bug causing it to never release the
graphics font, which cascades down to the data provider never being
released and releaseFontData never being called.

Instead of relying on a callback to release the byte array font data,
we attach the font data to the engine's lifetime. Note that we are
still leaking the CoreFoundation types.

Change-Id: I6eda4212638ccc9439b90e004222272d204c707a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-04-11 14:30:26 +00:00
Tor Arne Vestbø
31273f079e macOS: Don't marshal app font data via URL when using FreeType font engine
Font descriptors can have attached attributes of any kind, not just pre-
defined constants like kCTFontURLAttribute. We take advantage of this and
attach the font data that was passed into addApplicationFont() to the
font descriptor, so we can read it out directly when later creating an
engine for it. This removes the need to build up a URL to represent the
font data, which also didn't work for the memory-font use-case. The
FreeType font engine now passes the same tst_QFontDatabase tests on
macOS as the native CoreText font engine.

This also fixes the leak caused by CTFontCreateWithGraphicsFont never
releasing the graphics font, resulting in releaseFontData never being
called:

  http://stackoverflow.com/questions/40805382/

We're now cleaning up the font data in releaseHandle, based on the
attribute set on the font descriptor.

Change-Id: Iba15222ec919f989e29fd98b263d9fb182c4d710
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-04-11 14:30:18 +00:00
Rolf Eike Beer
6ef07e0902 Qt5DBusMacros: remove intermediate variable
This has been there probably forever, likely from the time when the code
was derived from upstream CMake. Since this is just copying one variable
to another and the latter has a wrong name (_qt4_*) just drop it.

Change-Id: Ica74f3bc9a6b0a6669d80cfc0ebafc003f5b908e
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-04-11 14:07:29 +00:00
Gatis Paeglis
e893e657e5 configure: fix detection of xcb extensions
- Properly detect xcb-render and xkb features.
  a) when -qt-xcb, use bundled versions
  b) when -system-xcb, detect from system

- Be consistent with other features (jpeg, png)
  in "enable"/"disable" field handling.

- And move the "xkb" feature higer up in configure.json.
  It is an X11 extension, so keep them all together (instead
  of grouping it with libxkbcommon).

Task-number: QTBUG-59064
Change-Id: I60f95fb37060b8abde4c611cdef178ba3795982c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-04-11 13:23:15 +00:00
Christian Strømme
9091a058bc Android: Fix application state tracking
- Make sure we don't process state changes before the platform plugin
is completely created and registered.
- Protect shared data with mutexes.
- Don't update the application state from different threads.

This was causing issues when testing run-time permission checks, when
the application quickly switches state due to permission dialog being
shown. In this case the states would be incorrectly delivered when the
application was made active again.

Change-Id: I3446eab9414ee5437cd788c27d65f808d1314aa5
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2017-04-11 11:58:02 +00:00
Tor Arne Vestbø
5ad2e1cea1 Populate application fonts via font descriptors on Apple platforms
Instead of registering the font via CTFontManagerRegister we just create
a font descriptor for the data/URL and populate that like normal system
fonts. This makes the code more similar to how we deal with other fonts,
shaves off a ms during font registration due to not registering the font,
and fixes an issue on iOS where CTFontManagerRegister would invalidate
earlier populated system font descriptors.

Task-number: QTBUG-56765
Change-Id: I002a65075b15837c9a2d22573020d4c834111837
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-04-11 09:23:44 +00:00
Eskil Abrahamsen Blomfeldt
17fc188aec Implement maxCharWidth() for DirectWrite engine
This is used to create the bounding box in QFontEngine::properties(), which
in turn is used for the FontBBox when generating PDFs. The result was that
the bounding width in the output was 0 and Adobe Reader complained that the
PDF was malformed. We could implement the proper bounding rect in properties()
at some point, instead of assuming an origin at x = 0 for instance. The
metrics for that are in the head table. But for silencing the warning in
Reader, just implementing the maxCharWidth() function is sufficient.

[ChangeLog][Windows][PDF] Fixed a bug in PDF output when using high-dpi
scaling which was causing the display of warnings when opening the
file in Adobe Reader.

Task-number: QTBUG-58954
Change-Id: I2540571863d4dd0f85af533b591f75dad3f0d75b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-04-11 08:01:44 +00:00
Nico Vertriest
850c5dbcd3 Doc: minor language issues in Qt Sql doc
Change-Id: If9ad86644c097d78895e392acdf017f176d8f95d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-04-11 07:38:51 +00:00
Marc Mutz
da1be671cf QtTest: add toString(QUuid)
[ChangeLog][QtTest] QUuids are now printed on failure.

Change-Id: I39a7b9169aef8ab6ef5ce0790920547af23bd1b9
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
2017-04-11 07:34:38 +00:00
Thiago Macieira
d5f62f7bc7 Ask MS runtime to reload the timezone details if they've changed
POSIX documents that localtime() ensures that tzset() has been called,
but the wording could be understood to mean that it only needs to do so
the first time. Anyway, we're sure that the MS runtime only gets the
timezone information from the Control Panel once. That means Qt-based
applications will not react to a change in the timezone.

Attempt to do that by moving tzset() out of the #if, to apply to all
operating systems.

Task-number: QTBUG-60043
Change-Id: I6ab535fb61094af19fc1fffd14b413541fe5a64c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-04-11 06:45:41 +00:00
Thiago Macieira
dbea118f12 gtk3: Mark the minimum version we support
This suppresses warnings for API that is deprecated. Gtk often marks API
like:

GDK_DEPRECATED_IN_3_22_FOR((gtk_menu_popup_at_widget, gtk_menu_popup_at_pointer, gtk_menu_popup_at_rect))
void	   gtk_menu_popup		  (GtkMenu	       *menu,

Which generates this (found with ICC, accidentally an error):
 qgtk3menu.cpp(449): error #1786: function "gtk_menu_popup" (declared at line 138 of "/usr/include/gtk-3.0/gtk/gtkmenu.h") was declared deprecated ("Use '(gtk_menu_popup_at_widget, gtk_menu_popup_at_pointer, gtk_menu_popup_at_rect)' instead")

The warning is generated by GDK_DEPRECATED_IN_xxxx_FOR when
GDK_VERSION_MIN_REQUIRED is higher than xxxx. And by default,
unlike the Qt equivalent macros, the minimum version required
is equal to the current version.

The minimum version our support requires is 3.6, as we depend
on gtk_accel_label_set_accel, which was first introduced in
that version.

Change-Id: I27b55fdf514247549455fffd14b1c47e470510b2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-04-11 06:44:20 +00:00
BogDan Vatra
eda7f6ea78 Don't hide critical info
The developer should see what's wrong even on release builds.
That code hides any mistakes we do in JNI which are pretty critical
for developers because they can't see what's wrong with their code. e.g.

 QtAndroid::activity().callMethod<void>("wrongMethodName")

*silently* fails, which is so wrong!

Change-Id: I8b6a24946dfef716fcd86ab9bba82666974e3991
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-04-11 06:19:58 +00:00
BogDan Vatra
187427c0ae Use latest stable version of the android:gradle plugin
Change-Id: I15418015c6a206dd1a8e4b52894ec83ddaeb9fc2
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-04-11 05:56:49 +00:00
BogDan Vatra
6c4cbd4122 Android: Fix crash at exit
We need to remove and release the surface imediately, otherwise
setSurface might be called after the object is deleted.

Task-number: QTBUG-59818
Change-Id: I3a09e3de1ceecc22d8d7a48e2fc1cfe40cf09f0a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Mathias Hasselmann <mathias.hasselmann@kdab.com>
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2017-04-10 15:27:20 +00:00
Marc Mutz
46c66bce5d Optimize QLoggingSettingsParser
Factor the line parsing into a separate function, parseNextLine(),
taking a QStringRef.

In setContent(QTextStream&), use the new readLineInto() function to
re-use the capacity of a single QString for all lines.

In setContent(QString), use splitRef() to split the lines.

In either function, pass each line to parseNextLine().

In order to port all the parsing to QStringRef, I needed to make some
semantic changes: the old code removed all whitespace right at the
beginning. This is not possible with QStringRef. It also didn't feel
right, since a line like

   [    r u  l e s ]

would successfully parse as the section named "rules".

I added trimmed() calls at the beginning, and around the valueStr and
pattern extraction, which should be good enough.

Also, when a section is found, don't store it anymore. Instead, only
store whether it was the [rules] section, because that's all we'll
test for. That way, we don't have to convert QStringRefs to QString
just to store them across parseNextLine() calls.

Replace the setSection() function with setImplicitRulesSection(),
because "rules" is all that was ever passed.

This is private API, we can bring back some of the dropped flexibility
later, as needed.

[ChangeLog][Important Behavior Changes] Logging rules can no longer
contain arbitrary whitespace such as within a category identifier.

Change-Id: Ic26cd23c71f5c810b37ef4b972354ac31d3408fe
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2017-04-10 14:54:31 +00:00
Marc Mutz
db29042588 QQnxWindow: replace QUuid::toString().toLatin1() with QUuid::toByteArray()
UUIDs are always US-ASCII.

Change-Id: I335882a2df179204d8eca1cf9f02bc6473bac700
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-04-10 14:30:07 +00:00
Daniel Teske
88d3195164 QWindowsPrintDevice: Handle 0 from DocumentProperties correctly
Task-number: QTBUG-55090
Change-Id: I5fadd0f007c826ab6747f319dbf3eaee5f208a44
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
2017-04-10 14:27:46 +00:00
BogDan Vatra
2099709a72 Fix build: Remove unused variable
Change-Id: Ib5e7782e23eb1ff976caedd167d3df8b857d9883
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-04-10 10:46:43 +00:00
David Faure
c0ecfc08e3 QTextDocument: improve import of DIV tags
<div>1<br/></div>2 was inserting two newlines between 1 and 2, while all
tested web browsers only insert one newline - as long as there is nothing
between the <br/> and the </div>.

This was the cause for extra newlines being inserted in KMail when
replying to HTML emails, such as those generated by gmail.

Change-Id: I5145d977701e68913264357bba22780e7cdd3f7d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-04-10 09:44:01 +00:00
Maurice Kalinowski
45862976b7 winrt: Fix build for Windows 10 Creators Update
Phone specific UI colors have been removed from the windows headers.
Continue to use the enum values does not gain anything as the native
calls return errors for those. Actually they did that already with
14393.

Change-Id: I4b04d3af319766216ae7c550af704aab488c1d15
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-04-10 07:02:06 +00:00
Marc Mutz
9d1203bf02 QVariant: fix docs regarding QUuid
- toUuid(): QUuid is a built-in type, so use type(), not userType()
- canConvert()/toUuid(): QUuid converts to and from QString

Change-Id: I5262ff7ab093040cb943b6ab9cfffe95491d2b9b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-10 05:18:14 +00:00
Thiago Macieira
75cdf654bc QMap: fix UB (invalid cast) in QMapData::end()
The end() pointer, like in all other containers, is a sentinel value
that must never be dereferenced. But unlike array-based containers,
end() in QMap is not "last element plus one", but points to a base class
of Node, not a full Node.

Therefore, the casting from QMapNodeBase to QMapNode must not be a
static_cast, reinterpret_cast is required.

libstdc++-v3's red-black tree had the exact same problem:
 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60734

Change-Id: I43f05fedf0b44314a2dafffd14b33697861ae589
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-04-09 17:06:41 +00:00
Filipe Azevedo
07bd5a90a3 Fix hidpi support for opengl window grabbing
Now set the QImage devicePixelRatio so the content is correct on all
screens.

Task-number: QTBUG-53795
Change-Id: Ic92eee98f691ebb1e0212498c1ae13ede74bca93
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-04-09 13:42:34 +00:00
Jesus Fernandez
944bf6867f Add more information about how to get a QString from qgetenv
Change-Id: Ic712654c8d4735a59bf02cf6a7e1c689ca9a886c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-08 12:02:50 +00:00
Heiko Becker
43a5fe258b Update attribution file for changed command line param
47c4d1378c changed the configuration
command line parameter back to pcre, omitting the "2" which has
been added after porting to PCRE2.

Change-Id: Iadbd57725ab706cb4bae89c2decf8259bcad46b5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-04-07 21:05:47 +00:00
Thiago Macieira
23d08ce2ed Fix QDir::mkpath() when the path contains "symlink/../"
It is incorrect to collapse a "symlink/.." segment because the parent
directory of the symlink's target may not be the directory where the
symlink itself is located.

[ChangeLog][QtCore][QDir] Fixed a bug that caused QDir::mkpath() to
create the wrong directory if the requested path contained a symbolic
link and "../".

Change-Id: Iaddbecfbba5441c8b2e4fffd14a3e367730a1e24
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2017-04-07 20:26:02 +00:00
J-P Nurmi
49163ca689 Android: fix Menu and Back key handling
Don't quit on Back key release when Back shortcut was accepted and
likewise for the Menu key, don't trigger the platform menubar if Menu
shortcut was accepted.

Change-Id: Ifde87cbc2d95be1beb90ca59f55889b83a90ff02
Task-number: QTBUG-59670
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-07 18:08:58 +00:00
Thiago Macieira
795a54ff96 QDataStream: add operator<< and >> for std::nullptr_t
std::nullptr_t is nullary: it accepts only one value, nullptr. So we
don't need to read or write anything. This commit simply adds the two
operators that allow generic code to operate on std::nullptr_t if
required.

This commit also adds the actual use to QMetaType::load/save, even
though there's no change in behavior.

[ChangeLog][QtCore][QDataStream] Added operator<< and operator>>
overloads that take std::nullptr_t, to facilitate generic code.

Change-Id: Iae839f6a131a4f0784bffffd14aa37e7f62d2740
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-04-07 17:41:06 +00:00
Friedemann Kleint
f497dea730 Doc: Clarify the porting notes from QRegExp to QRegularExpression
Add a small table to illustrate the results exactMatch() and split
out the part on partial matching to a separate section since it
is less common.

Change-Id: Ifbd5c3cbd1d8c0ee9e8b2d58ed13f40776b03762
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2017-04-07 11:52:01 +00:00
Jesus Fernandez
4a6cb89f29 Fix reusing FTP connection after abort
The QNetworkAccessCache was keeping the connection alive and it was
trying to reuse it for subsequent calls to download files from the
same server. After closing the connection, it is not usable anymore
and a new one should be created.

Task-number: QTBUG-40368
Change-Id: I1a0d08956a94eb36f39d14112cdcab6c1e2add82
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-04-07 11:37:13 +00:00
Thiago Macieira
872bff5b24 Enable a given SIMD feature if the compiler has enabled it
Change-Id: I09100678ff4443e6be06fffd1482c08125adc0a4
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-04-06 19:37:02 +00:00
Sami Nurmenniemi
0624085b73 Don't set margin on offscreen window if it has a parent
Offscreen platform had window frame margins set to 2 by default unless
Qt::FramelessWindowHint had been set. Margins must not be set to 2 if
the window has a parent. This change fixes two tests in
tst_QWindowContainer for offscreen platform.

Change-Id: Ib1577c301ea3a3b240bfa7c46ff12510dd2bcef0
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-06 13:29:01 +00:00
Liang Qi
c50f6a8329 Merge "Merge remote-tracking branch 'origin/5.8' into 5.9" into refs/staging/5.9 2017-04-06 14:35:54 +00:00
Liang Qi
0fc569184c Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
	src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
	src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase.cpp
	src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp
	src/widgets/widgets/qtabbar.cpp

Change-Id: Iaa9daee5f7a6490d56257a3824730a35751ceb05
2017-04-06 14:16:31 +02:00
Morten Johan Sørvig
5e76cb1692 Fix menu position when highdpi scaling
Certain display and scale factor configurations would
cause menus to pop up in incorrect locations or not
be shown at all.

This was due to QDesktopWidget::screenNumber() having
a toNativePixels(QRect, QWindow) call which requires
that QWindow::screen() returns the correct screen.

Break the circular dependency by converting coordinates
the other way for the intersection test: transform screen
geometry to device independent coordinates.

Task-number: QTBUG-58329
Change-Id: I5621de89a9a2b8df44bdae528baf011fc111eba3
Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-06 09:42:23 +00:00
Rainer Keller
4387202f31 eglfs: Show error details when JSON parsing failed
Change-Id: I1a92da5b2ed0b8064efa37c43d7894c212073b60
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-04-06 08:47:03 +00:00
Kai Koehne
65a551816f Replace last occurrences of LGPL3, LGPL3-COMM headers
Change-Id: I0e967120d7bdfa00f110b49e6c65d8c6f9b329aa
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2017-04-06 08:13:54 +00:00
Thiago Macieira
280e321e52 Fix detection of F16C for the Intel compiler (again) and Visual Studio
Neither the Intel compiler nor Visual C++ have a dedicated switch to
enable F16C support, like GCC and Clang do. So we used the AVX switch
for that in commit 8241d51f70, as it was
the closest, lowest denominator. That was incorrect and insufficient.

The Intel compiler silently miscompiles the intrinsics with -xAVX,
making calls to out-of-line functions like _mm_cvtps_ph, which don't
exist. So we actually have to use AVX2 support to generate correct code.
That might be a problem later, since Ivy Bridge supports F16C but not
AVX2.

Visual C++ is able to generate F16C code with just -arch:AVX.

Either way, since there's no dedicated command-line switch, there's also
no dedicated preprocessor macro. We're using __AVX2__ for both
compilers, as that's a sufficient condition to indicate a processor that
supports F16C.

Change-Id: I27b55fdf514247549455fffd14b205b8d8b86da7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-04-06 04:15:07 +00:00
Thiago Macieira
c817b33b45 f16c: Use the packed intrinsics instead of scalar ones
MSVC, Apple's Clang and Clang prior to 3.9 do not recognize _cvtss_sh
and _cvtsh_ss. So expand the operation to use directly the packed
intrinsics.

Change-Id: I27b55fdf514247549455fffd14b2046fd638593d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-04-06 04:15:04 +00:00
Thiago Macieira
264d814773 Fix GCC warning about dereferencing type-punned pointers
GCC is wrong. Type-punning is when you read something of a given
type as something else. We're not doing that, as it's only read
as integer.

 qnativesocketengine_unix.cpp:1011:79: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]

Too bad my plan for a good C++ solution was foiled by glibc
developers.

Change-Id: I27b55fdf514247549455fffd14b1a27667745e94
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-04-06 04:14:58 +00:00
Thiago Macieira
b3f474d620 QSysInfo: update the ICC warning that needs to be suppressed
qsysinfo.h(235): error #1786: enum "QSysInfo::MacVersion" (declared at line 156) was declared deprecated ("Use QOperatingSystemVersion")

Take this opportunity to merge the two groups.

Change-Id: I27b55fdf514247549455fffd14b1c2a1d8eab869
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-04-06 04:14:55 +00:00
Thiago Macieira
71649e2168 Fix build when SCTP is enabled
c0157a9f03 was incomplete.

Change-Id: I27b55fdf514247549455fffd14b158f54403663d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-04-06 04:14:41 +00:00
Tor Arne Vestbø
fb38db29e1 Consider ENXIO (No such device or address) reason to check isatty()
Aligns with EPERM (Operation not permitted) and ENOENT (No such file
or directory), and is what errno is set to on macOS when opening the
/dev/tty device when running inside e.g. Xcode, where isatty() will
return true.

Change-Id: I09b88eaa3ff611d95ab37f0ff4df9aaaca52747d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-05 11:51:15 +00:00
Allan Sandfeld Jensen
efb84b6189 Copy stretch to multifont fontDef
If we do not the fontDef of the multifont will be the default 0.

Task-number: QTBUG-59443
Change-Id: Ib223517975b2a57b2371e309d12cd8f918d30825
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-04-05 11:27:15 +00:00
Allan Sandfeld Jensen
b67b80b715 Fix stretch of QRawFonts
Set stretch to always have no transform on raw fonts.

Task-number: QTBUG-59799
Change-Id: Ibfacc5c247e0b4a8410572e207f09f6e67b74f9d
Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-04-05 10:26:14 +00:00
Marco Martin
9ae028f507 Environment variable enabling the workaround FBO readback bug
On some ARM devices the font glyph generation is broken
Add an environment variable to enable workaround_brokenFBOReadBack
in QOpenGLContext, to fix font rendering on such devices as
Mali and Adreno

Change-Id: I9cc99ecb8b71a35bc369ec9dd11b877016b1179e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-04-05 10:04:54 +00:00
Timur Pocheptsov
ce2771c71c QNetworkRequest - do not set ManualRedirectPolicy
If QNAM's general policy is 'Manual' and QNetworkRequest has neither
policy set not FollowRedirectAttribute - do NOT set this 'Manual' policy -
its implicitly implied. This fixes previously unnoticed auto test failure
(was blacklisted) and also makes QNetworkRequest::operator == work correctly.

Change-Id: If17c9af4baf8a470659f82d1a40488078ea8ede0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-04-04 16:42:10 +00:00
Hendrick Melo
6b52039866 qbmphandler fix: use qint64 for caching QIODevice file position
Changed the file position and offset types so they can properly handle
files larger than the 32bit limit

Task-number: QTBUG-59493
Change-Id: I00e1741c7682c4c79f35fef808fe1ea26e67c8b5
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Hendrick Melo
2017-04-04 16:25:33 +00:00
Jesus Fernandez
83486f362b Adds a note to QSqlDatabase::~QSqlDatabase documentation
When the last QSqlDatabase object is destroyed the destructor implicitly
calls close() to release the database connection.

Task-number: QTBUG-59919
Change-Id: I04c15c4999cdaaa8800a44a1a1006f977a90d8a6
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-04-04 15:52:33 +00:00
Tor Arne Vestbø
1b2234c4e7 macOS: Remove un-needed fontDef assignment in QCoreTextFontDatabase
The QCoreTextFontEngine constructor already sets the member (like it should).

Change-Id: I6e59ff36c439857418a636de4056c20d2f65e8d4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-04-04 15:14:35 +00:00
Tor Arne Vestbø
5b41b34958 macOS: Use NSURL to resolve FreeType font names instead of CoreFoundation
Change-Id: I4b397361c483fa07e4e95288f66d7f7ea2df8d9f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-04-04 15:14:22 +00:00
Tor Arne Vestbø
a7fe6ab891 macOS: Use shared code path for creating FreeType font engine for QRawFont
The round trip via a CGFontRef to a CTFontRef so that we could pull out
the kCTFontURLAttribute of the font makes no sense, as the input is just
raw font data. None of the tst_QRawFont tests are able to pull out a
URL, and none of the other platforms where FreeType is available resolve
a filename from raw fonts.

Without this change the tst_QRawFont test has 13 failed test cases and
spits out 1250 QWARNs. With the patch all tests pass without warnings.

Change-Id: I17965e7405d7161958ff0870825ce8190598288f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-04-04 15:02:13 +00:00
Tor Arne Vestbø
6c547142d5 Move FreeType font engine creation for QRawFont into factory function
So that the logic can be used without subclassing the FreeType font database.

Change-Id: Ib1ac0e1948ce18003b8eda0c1e8fbb3c7e6c8360
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-04-04 15:01:43 +00:00
Tor Arne Vestbø
2b9ecfe69c macOS: Split out font engine creation from QCoreTextFontDatabase
The Core Text font database can produce both Core Text and FreeType font
engines. Refactor the code a bit so that the actual factory methods that
differ between the two stand out, and do not require a granular runtime
check in each method.

Change-Id: Ib70f76f4a9001a8108d87c1101a50699a6ea8f55
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-04-04 15:01:38 +00:00
Giuseppe D'Angelo
ecceaec858 GCC 7: fix -Werror=implicit-fallthrough
More fallthrough-are-errors fixed.

Change-Id: I9a6cb6efe988400ed3f9cb95d1e426dac317e6c4
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-04-04 14:26:34 +00:00
Stephan Binner
08fc4c4e95 Fix warning for -no-feature-draganddrop -no-feature-clipboard
Change-Id: I974ac692f59622fbb5cf7c6bd60954cf306dabe7
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-04 13:17:34 +00:00
Stephan Binner
8146fd5f8c Fix several unused warnings for misc disabled features
Change-Id: Id42daf684abeeb888155d65eca143150d9c5f5a7
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-04 13:12:21 +00:00
Stephan Binner
0db0441bb7 Fix warning for -no-feature-temporaryfile
Change-Id: Ibb022a1fd043001f628a343dc8ae509083eb4471
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-04 13:12:20 +00:00
Stephan Binner
dfe0bfff39 Fix warnings for -no-feature-settings
Change-Id: I79ce0b9c5eb931e238394519ba80bf35e4ff3bf7
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-04 13:12:19 +00:00
Stephan Binner
5678e62141 Fix warning for -no-feature-textcodec
Change-Id: I7775c8611a532db96f9843c311463a69c2e9ef82
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-04 13:12:18 +00:00
Stephan Binner
acc0ad7883 Fix warning for -no-feature-texthtmlparser
Change-Id: I6dd6e80a546a76ce3717855ebacb188254fe70d6
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-04 13:12:17 +00:00
Stephan Binner
d285409674 Fix warning for -no-feature-graphicsview
Change-Id: I11ab0c664b860014376c725ea162e62740234ea4
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-04 13:12:16 +00:00
Stephan Binner
21abfc8101 Fix warning for -no-feature-wheelevent
Change-Id: Ibf240228100bbc7cd8a85e49abc9dbff026e5433
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-04 13:12:15 +00:00
Stephan Binner
4fda233ad7 Fix warning for -no-feature-menubar
Change-Id: I58573d769897c956144604d51d38cad1c121f751
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-04 13:12:13 +00:00
Morten Johan Sørvig
5b78fcd03b QRasterBackingStore: Correct high-dpi image size
Fix QT_SCALE_FACTOR usage on macOS. Follow-up to
2d2d9078

QRasterBackingStore should account for native scaling
only. Any Qt scaling will have already been factored
into the size argument.

Change-Id: I26a67addfcbec3d45f4ed87f03b8dd79fd99cb62
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-04-04 11:14:38 +00:00
Timur Pocheptsov
5377f4ec0e Allow Secure Transport backend to use a temporary keychain
Cherry picked:

this change was first merged into dev, but now we also need it in 5.9
to enable SSL socket tests on the new CI VMs (macOS 10.11, 10.12).
As we do not merge dev->5.9, we need this cherry-pick.

Since day one Secure Transport socket has two annoying problems on macOS:
when we call SecPKCS12Import, we indeed import certs and keys into the default keychain
and also (which is more serious) later a dialog can pop up, asking for permission
to use a private key (this is especially annoying if you're running SSL autotests or
have a server application). Apparently, it's possible to work around those problems
if we create our own (temporary) keychain and pass it in the 'options' parameter
to SecPKCS12Import.

[ChangeLog][QtNetwork] Allow QSslSocket to use a temporary keychain on macOS.

Task-number: QTBUG-56102
Change-Id: Ic3a56c905100dc80d907a25fe6ebfa232dcf5b9e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 17927392cf)
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-04-04 10:44:29 +00:00
Tor Arne Vestbø
de4aeade5e Delete QRasterWindow backingstore while window is still alive
The platform backingstore might need access to the window that the
backingstore was created for, e.g. for makingCurrent to release OpenGL
resources. In that case leaving it to the QRasterWindowPrivate destructor
would be too late, as the QWindow was gone.

This was seen on iOS, where the backingstore inherits QRasterBackingStore,
and uses composeAndFlush to composit via GL. The raster backingstore
cleans up these GL resources in its destructor, so the QIOSBackingStore
destructor makes sure that the GL context is current for the window,
resulting in a crash since the window is long gone by then.

Change-Id: I5a22597842819f0fe3b580856b9e75e4fab32ae5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-04-04 09:36:12 +00:00
Tor Arne Vestbø
0d12ebd7e7 Share FreeType font engine creation code between platforms
The FreeType font engine setup is spread out between factory functions,
constructors, and init() functions, so let's at least try to share as
much as possible of it to make it easier to reason about and possibly
refactor in the future.

Change-Id: Ic39353d2b3111024e0589a70211bac80feb8498e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-04-04 09:23:59 +00:00
Tor Arne Vestbø
e33b0118b4 Rename QBasicFontDatabase to QFreeTypeFontDatabase which is what it is
Change-Id: I8def2f7ae1e4c8d8a3e1f8e60549da5d691e4fb3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-04-04 09:23:52 +00:00
Stephan Binner
876563ced0 No divide by zero if all imageformat features are disabled
Change-Id: Ib3e8a4b62ae627bc3dc8541767dafff4e493d2f8
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-04-04 09:01:37 +00:00
Friedemann Kleint
267c2c2a93 QFusionStyle::drawPrimitive(): Use color in cache key of PE_PanelButtonCommand
Previously, only bool isDefault was used, which did not discriminate
changes in ButtonColor. Use the color name instead.

Task-number: QTBUG-59850
Change-Id: I1e006f98371a5f2039dcca1207addc0396e7c1e5
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2017-04-04 08:42:01 +00:00
Laszlo Agocs
22d43c9e51 xcb: Get rid of qCInfo in the GLX backend
qCInfo must never be used. For qt.* logging categories Debug is disabled
while everything else is enabled by default. This means that doing qCInfo
is equivalent to putting a qDebug which is not acceptable.

Amends 3e0355014e

Change-Id: I428e620f12afa324cf6af8dbe3912a55189a38a9
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-04-04 08:17:48 +00:00
Andreas Holzammer
229fd2cece CMAKE: Fix EGL link extensions
Targets were always exported as .lib, for all windows compilers
which is correct for msvc, but not for mingw. Hence use
QMAKE_EXTENSION_STATICLIB to switch between .lib and .a

Task-number: QTBUG-59906
Change-Id: I948f5dd96e0fb46d679c474b7beececc379ad436
Reviewed-by: Volker Krause <volker.krause@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-04-04 08:11:58 +00:00
Thiago Macieira
6a83f9aa98 Fix qReallocAligned for reallocation when alignment > 2*sizeof(void*)
When we call realloc, the alignment of the new block may be different
from the old one. When that happens, we need to memmove the data to the
new position, before we start overwriting things.

Task-number: QTBUG-59804
Change-Id: I27b55fdf514247549455fffd14b07ea78918a3d0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-04-04 07:08:16 +00:00
Tasuku Suzuki
a7b32ff63c Fix build without features.qeventtransition
Change-Id: I498d482b01d9dcaf794d35ecc26110c9a2d45ce0
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-04-04 04:24:02 +00:00
Tasuku Suzuki
b53c229a4b Fix build without features.networkinterface
Change-Id: I9fd2a7ec402a1d2d99e30f08554d86f18c6424ff
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-04 01:24:07 +00:00
Pavol Markovic
116ade88ea macOS: Replace deprecated NSOpenSavePanelDelegate method
shouldShowFilename method has been deprecated since macOS 10.6.
In 10.11 the behavior of this method has been broken, causing
files containing metadata (e.g. audio) to be incorrectly filtered out,
displayed them as disabled in file dialog even though they shouldn’t be.
This erratic behavior applies also to NSOpenPanel setAllowedFileTypes
if set to anything but nil. This has been confirmed to be a known bug
in Cocoa.

Using shouldEnableURL solves this problem and also removes risk
of breaking compatibility with future SDKs.

Renamed and simplified private method isHiddenFile to
isHiddenFileAtURL.
Renamed to be consistent with other Cocoa file query methods.
Simplified to return true only if the file is hidden as the name of the method
implies. Previously it might have returned true also if the file has
not existed which was in fact very metaphysical answer.
Check for presence of the file is done by other method before calling
this one and the scope of the method is limited to one source file.

Task-number: QTBUG-57527
Change-Id: I2fded712d4e7098eb444331d92e38cee71655100
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-04-04 01:16:01 +00:00
Giuseppe D'Angelo
c807dc3c12 Use fallthrough attributes only in C++ mode
GCC 7 defines __has_cpp_attribute even when invoked as "gcc" (possibly,
Clang does the same, according to a comment in the code, did not test
myself).

Hence, define the fallthrough declaration (as C++11 attributes)
only when compiling as C++, otherwise we pick them up even in C mode,
and they cause build failures.

Change-Id: I3f13205e014bb1dea59ee3664b29111521a7eae3
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-04-03 21:26:09 +00:00
Eric Lemanissier
e1d3c8e203 qtconcurrent: correct whitespaces
Change-Id: Idaec09b75767a072bd817416c3cc2b19e3a0e03b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-04-03 17:15:27 +00:00
Gatis Paeglis
c9f5607500 xcb: fix build when xlib is not present
Remove Xutil.h include from qxcbmime.cpp as it does
not use any Xlib APIs. Using API from Xutil.h requires
Xlib as noted in Xutil.h:

/* You must include <X11/Xlib.h> before including this file */

Everywhere else we do check for presence of Xlib, before
including Xutil.h

And remove some useless #undef(s)

Task-number: QTBUG-39665
Change-Id: Ibfd2341338fe7e902b47eae2df6b9dafe4ab962d
Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-04-03 11:35:45 +00:00
Gatis Paeglis
e0e6cbdacb xcb: prevent dangling pointer when window focus changes
With the current implementation, the QXcbConnection::m_focusWindow
was holding a dangling pointer during the focus transition from a
dying modal window to other modal window.

1) QXcbConnection::m_focusWindow holds a pointer to A;
2) A is closed;
3) relayFocusToModalWindow B;
   => m_focusWindow now points to a dead window.
4) We get a reply back from WM in a respone to
   relayFocusToModalWindow (_NET_ACTIVE_WINDOW)
   => m_focusWindow now points to a valid window.

The fix is to update m_focusWindow to nullptr, when the current
focus window was destroyed and the new focus window has not been
set yet by WM.

This patch actually solves a more general case - whenever we get a
focus-out event, we should set m_focusWindow to nullptr. It is ok
for none of the windows to be in-focus while focus transition is
happening. The focusInPeeker will make sure to "optimize out" (when possible)
this no-window-in-focus state, and GUI won't be bothered by this
extra event. This is how things were working before relayFocusToModalWindow
was introduced. Having a focus-relay mechanism in-between is ok,
but it should not have changed the original behavior.

Task-number: QTBUG-48391
Task-number: QTBUG-55197
Change-Id: I6fdda9de73f999dad84000059ce4b89c0d1a964c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-04-03 10:20:53 +00:00
Friedemann Kleint
e94e4d002e QMenu: Do not unnecessarily call QPlatformMenu::menuItemForTag()
When handling QActionEvent / ActionAdded, QActionEvent::before()
is 0 for the common 'append' case. Do not try to find a
QPlatformMenuItem for this.

Change-Id: I535b675fda6a2812b61eb8d7eec01da378ece413
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-04-03 06:49:42 +00:00
Thiago Macieira
392294936e qfloat16: suppress warning caused by Clang macro we used
Clang implements the _cvtss_sh intrinsic by way of a macro, which
uses a C99 extension and that's not allowed in C++ mode:

 float16.h:119:11: error: compound literals are a C99-specific feature [-Werror,-Wc99-extensions]
 /usr/bin/../lib64/clang/3.9.1/include/f16cintrin.h:76:55: note: expanded from macro '_cvtss_sh'

Reported at https://bugs.llvm.org/show_bug.cgi?id=32491.

Change-Id: I27b55fdf514247549455fffd14b170df75dd4e1f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-04-02 17:40:29 +00:00
Thiago Macieira
62013d7772 Mark to remove const from function parameters in QtCore public headers
Some compilers are known to complain about this with a warning. GCC
complains about const on return values on -Wignored-qualifiers (enabled
at -Wextra), so it's not too much of a jump to assume that others do
too. Besides, this is not Qt Library API policy. As maintainer for
QtCore, I'm exercising my prerrogative in specifying certain unspecified
parts of the coding style, like I've done for constructor initializer
lists.

Since all the classes involved are exported (including QVector, through
derived classes), we can't remove the qualifier until Qt 6, since there
are compilers known to encode the qualifier in the mangled name
(suncc). I'm not introducing #ifdef to silence unknown compilers unless
we get an actual complaint.

Change-Id: I33850dcdb2ce4a47878efffd14a876edef843c46
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-31 21:08:14 +00:00
Tobias Sung
507223a218 Don't use non-POD type as variadic argument
Implicit conversion from QByteArray to const char* works for most gtk
functions. But gtk_file_chooser_dialog_new() uses varargs and passing
the non-POD QByteArray through varargs does not work (it's UB).

Task-number: QTBUG-59763
Change-Id: I85f9323d99342896e6921cdeb85f5a1af7377b4f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-03-31 20:29:35 +00:00
Nikita Krupenko
8675e1c5ee Fix warnings for -no-feature-dockwidget
This amends commit c20cd4d98e

Change-Id: I2fa903209694cd05e0dcf31e6f92d96ed934c91d
Reviewed-by: Stephan Binner <stephan.binner@basyskom.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-03-31 09:45:53 +00:00
Tor Arne Vestbø
5090fd5018 Rewrite FreeType-ifdef'ed function call in QCoreTextFontDatabase
Makes the code slightly less awkward to deal with.

Change-Id: Ie98a04d812beecfbf0d19e77b8e784db783a19d6
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-03-31 09:35:43 +00:00
Giuseppe D'Angelo
88a8feeacb QCryptographicHash: make SHA3 calculate SHA3, not Keccak
The SHA3 family is a modified version of Keccak. We were
incorrectly calculating Keccak (and even *testing* Keccak!),
but claiming it was SHA3.

To actually calculate SHA3, we need invoke Keccak on the original
message followed by the two bits sequence 0b01, cf. §6.1 [1].

[1] http://dx.doi.org/10.6028/NIST.FIPS.202

[ChangeLog][QtCore][QCryptographicHash] QCryptographicHash now
properly calculates SHA3 message digests. Before, when asked
to calculate a SHA3 digest, it calculated a Keccak digest instead.

Task-number: QTBUG-59770
Change-Id: Iae694d1a1668aa676922e3e00a292cddc30d3e0d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-31 07:58:35 +00:00
Giuseppe D'Angelo
cd9e850f9e QCryptographicHash: fix documentation of the supported algorithms
Change-Id: Idfa7843ef8a8e3410ae0a8cf5311b8b598299730
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-31 07:57:55 +00:00
Maurice Kalinowski
995719cebd winrt: Fix dnd with non mouse input device
When using anything but the mouse, there is no release event sent.
Instead one needs to subscribe to the ICorePointerRedirector.

Task-number: QTBUG-58781
Change-Id: I664ba24bd89ea9f513f8f11b385e2f06ece42fd0
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-03-31 07:45:37 +00:00
Marc Mutz
df43ef7b6d QStringBuilder: simplify QConcatenable<char[N]>
... by delegating to QConcatenable<const char[N]>.

The only thing that varied was the nested type alias 'type', which
therefore got retained.

Change-Id: I202f899034e1ddd23c6d1978a31be5eb7c195697
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-31 07:11:13 +00:00
Anton Kudryavtsev
5ec57560c0 Prefer rvalue versions of toLatin() and toUtf8()
... to re-use existing buffers.

Change-Id: I7c42529b8cd4400520a59e658ab76f4f8e965cd4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-30 20:31:59 +00:00
Anton Kudryavtsev
ce124d5119 Prefer rvalue version of toLocal8Bit()
... to re-use existing buffers.

Change-Id: I5907a2e29d7f7dac04df5bf50769b47131e175d8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-30 20:30:19 +00:00
Michael Brüning
805a850f04 Convert QStrings with qUtf8Printable for GTK API calls
The fix for dangling pointers in 524f39 caused some problems when the
QByteArray was implicitly converted to const gchar*. This is fixed
by wrapping the QString in question in qUtf8Printable where possible
and removing the former convenience method.

Task-number: QTBUG-59692
Change-Id: I5abcf42e1c23b12c7a5c4c195d801f377fe9d138
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2017-03-30 08:33:10 +00:00
Błażej Szczygieł
2fbc143202 QtWidgets: Fix white text color on tabs on macOS for non-macOS styles
Apply white text only for macOS style.

Amends 2c0033983b

Task-number: QTBUG-59784
Change-Id: I9e66e929699efd715ed4565394f1aba763aeb32a
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-03-30 07:05:31 +00:00
Anton Kudryavtsev
f901afaf49 Use QStringBuilder more
Change-Id: If5283e364e921d99ffa7a8fa1abb07356a4a2682
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-03-30 04:28:09 +00:00
Nikita Krupenko
cc4f610c21 Fix warnings for -no-feature-mimetype
Change-Id: I6b1239941f8fd13eec72b0874d15d821d717ddf3
Reviewed-by: Stephan Binner <stephan.binner@basyskom.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-03-29 20:06:18 +00:00
Nikita Krupenko
d8426aa18e Fix warnings for -no-feature-itemviews
Change-Id: Ia384c2b48a6eaccb424cdde00240ebcfa6fd24c6
Reviewed-by: Stephan Binner <stephan.binner@basyskom.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-03-29 20:06:15 +00:00
Nikita Krupenko
c20cd4d98e Fix warnings for -no-feature-dockwidget
Change-Id: Id1f04f9ff6da9bec07068d4ebed15f8bd29105af
Reviewed-by: Stephan Binner <stephan.binner@basyskom.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-03-29 20:06:12 +00:00
Nikita Krupenko
b7febc35da Fix warnings for -no-feature-combobox
Change-Id: I352c011b21624ae9fb9db5a608e8c2b2491a05cd
Reviewed-by: Stephan Binner <stephan.binner@basyskom.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-03-29 20:06:10 +00:00
Nikita Krupenko
d9fe00e8e2 Fix warnings for -no-feature-cssparser
Change-Id: Ib0eae1858880e3fe2b6c6abd94c7ea0bbc2649a2
Reviewed-by: Stephan Binner <stephan.binner@basyskom.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-03-29 20:06:03 +00:00
Timur Pocheptsov
baf7180776 Use HTTP2WasUsedAttribute for HTTP2
Previously we were always setting SpdyWasUsedAttribute for SPDY/HTTP/2/HTTP/1.1
(true/false) which is confusing. Now if HTTP2AllowedAttribute was set to true on
a request, we set HTTP2WasUsedAttribute. Otherwise, as we did before, we're setting
SpdyWasUsedAttribute.

Change-Id: I0c44cfb5469fef0c12719baa951197ee2accee4a
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-03-29 13:54:49 +00:00
Olivier Goffart
886ce572d6 Windows QPA: don't resize fixed sized windows when changing screen
This seems to give pretty good result when EnableHighDPIScaling is NOT set.
But this seems to be worse when it's set.

Task-number: QTBUG-58959
Change-Id: I8de5a6c3c8b6146b1cb8f89676463206af404083
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
2017-03-29 13:36:03 +00:00
Michael Brüning
78f761318a Set the mode for the GTK3 file chooser also in selectFile
If the mode is not GTK_FILE_CHOOSER_ACTION_SAVE or
GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER , a GTK warning will
be generated which makes Qt WebEngine's Glib error handler
assert. Doing so only when showing the dialog is too late.

This patch moves the actual file selection to a private method
that can be called from both selectFile and applyOptions in
order to prevent overwriting the file chooser action potentially
multiple times.

Task-number: QTBUG-59692
Change-Id: Ied939248cdc3a0b4c9e8239ab61ba617a46b8496
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2017-03-29 12:25:00 +00:00
Anton Kudryavtsev
ff259bffe6 Use case-insensitive compare more
... to avoid allocations.

Change-Id: I5993633d1509495ff6ce3a11274a53504aac7c5e
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-29 03:54:57 +00:00
Kimmo Ollila
cea75a2a65 Add GHS internal id TOOLS-26637 to bug workaround comments
Change-Id: I653e0b16e08e6167891603f47298554a87352765
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-03-28 13:10:20 +00:00
Kai Koehne
3c66df6400 Core: Replace LGPL21 with LGPL license header
Also use canonical contact url.

Change-Id: I43f8c6a2c4949ee0e054045bccc17d82575b072c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2017-03-28 12:47:55 +00:00
Tor Arne Vestbø
22a414ab3d macOS: Remove workaround for default-sized NSViews
The workaround introduced in 38a55c7 to explicitly call viewDidChangeFrame()
was not ideal for a multitude of reasons. Instead we can just initialize the
NSView with a NSZeroRect frame, which will ensure that whatever geometry
we set from the Qt side will result in geometry change and expose events.

The only case where we will not receive an expose event is if the QWindow
is requested to be 0x0 sized, but that wouldn't warrant an expose event
anyways. Also, it's not possible to initialize a QWindow to 0x0 from the
Qt side, as that will trigger QPlatformWindow::initialGeometry() to pick
the default size (160x160 in the case of macOS).

Task-number: QTBUG-58963
Change-Id: Ia84de7edcfdf26b90e4e93186fabe8b5c7382caa
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-03-28 12:30:24 +00:00
Laszlo Agocs
dd38574160 Switch to RGB(A|X)8888[_Premultiplied] for QOpenGLFBO readbacks on GLES
Instead of the never-ending blacklisting of "broken" drivers, simply switch
to always choosing a byte ordered QImage format with OpenGL ES, and keep
on using the (one and only) spec-mandated GL_RGBA/GL_UNSIGNED_BYTE combo.

There is nothing broken with not supporting BGRA for glReadPixels even when
GL_EXT_read_format_bgra (an out of date, pre-2.0 extension that got folded
into the spec to begin with) is present. We do not have a good way to tell
if BGRA_EXT is supported for glReadPixels or not, so just skip the whole
problem altogether.

Task-number: QTBUG-59283
Task-number: QTBUG-59303
Change-Id: I9f0605380923bd3b3ffdeb80f5c172d3e4cc7927
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-03-28 11:17:52 +00:00
Anton Kudryavtsev
bae0c4c11a Avoid expensive QHash::values() calls
qcocoawindow.mm: we can replace QHash::values() with std::vector
since CoW is needless here and std::vector is more cache-friendly.
Also replace foreach with range-based for.

qitemeditorfactory.cpp: QHash::values() is used as auxiliary container
to create QSet. Replace it with std::vector since CoW is needless here
and apply sort-unique idiom to remove duplicates.
Also avoid needless allocations.

Change-Id: If34c7016977ceb7fab68e9298bf2e1944af79139
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-03-28 11:15:33 +00:00
Timur Pocheptsov
81b5aa792f QCocoaWindow - fix a compilation error
Clang does not like Q_FALLTHROUGH in 'default' label, the diagnostics is:
'fallthrough annotation does not directly precede switch label'.
Accodring to their docs: "The fallthrough (or clang::fallthrough) attribute
is used to annotate intentional fall-through between switch labels. It can
only be applied to a null statement placed at a point of execution between
any statement and the next switch label." - obviously, there is no 'next
switch label' in our case.

Change-Id: Ia7dba4cb965a85d229d44b04b69633a8f07d4a0c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-03-28 11:14:37 +00:00
Liang Qi
5d3b27f521 Merge "Merge remote-tracking branch 'origin/5.8' into 5.9" into refs/staging/5.9 2017-03-28 11:13:44 +00:00
Liang Qi
e52eb747b1 Merge remote-tracking branch 'origin/5.8' into 5.9
Change-Id: I4788bc037c55c48563ffd4ba9633a22aa1d12f22
2017-03-28 12:18:11 +02:00
Anton Kudryavtsev
18d6c82299 Prefer rvalue versions of toLower() and toUpper()
... to re-use existing buffers.

Change-Id: Ib2bc938f1cf0451c1dbc012b3db022b878e987cb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-28 07:18:26 +00:00
Tobias Koenig
781b5a6198 Fix generation of gradient shader function in PDF
Add the missing endobj tag for the shader function object.

Change-Id: Ieb3cfa5a5d0e27d04164a80b028d41371507fb94
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-03-28 07:01:30 +00:00
Oliver Wolff
a6bbaa08bf ANGLE: remove dead MinGW code from common.pri
Change-Id: I09a9d0553f00a3b04d084300cb6e2b9f5211913e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-03-28 06:29:43 +00:00
Anton Kudryavtsev
ed96363d56 QMimeGlobPattern: init all members only once
... by initializer list.

Change-Id: I39d2f933dac171273f500963eb47ffa9165978de
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-28 04:01:41 +00:00
Tor Arne Vestbø
e0e717d06a Fix crash when QUrl::from{NS/CF}URL() was passed a nullptr
Change-Id: Ib193447c4a91dd3d08746e97727f7d4764f33d80
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-27 17:39:58 +00:00
Tor Arne Vestbø
52767b8ee7 macOS: Disassociate NSView from contentView when switching NSWindows
When a NSView is the contentView of a NSWindow, it still has a superview,
in this case an NSThemeFrame, and the theme frame is the view that retains
the view, not the contentView property of the window.

Unfortunately, when a view is removed from the NSThemeFrame by means of
[NSView removeFromSuperview], or indirectly via [NSView addSubview:],
AppKit does not update the contentView property of the corresponding
NSWindow. The result is that the NSView might be deallocated while the
NSWindow still is around, with a stale contentView property.

To work around this we explicitly disassociate the view from the NSWindow
when we know that we are going to release the NSWindow. This will take
care of both resetting the property to nil, and remove the view from
the NSThemeFrame superview.

Task-number: QTBUG-59734
Change-Id: I1111d492f52fe5bdf86bbae071421f6a8a7a38b8
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-03-27 17:39:48 +00:00
Allan Sandfeld Jensen
d3fd3171ce Annotate more implicit fallthroughs
Reduces our number of gcc 7 warnings

Change-Id: I792d658cbc11cad15cf45da3a36fc93fcdcc67ea
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-03-27 14:11:57 +00:00
BogDan Vatra
1ab60b0430 Make sure we quit qt when the service is destroyed
Task-number: QTBUG-58471
Change-Id: I37f162717f57323136811a8f80d53e3c3b7d6f22
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2017-03-27 12:20:40 +00:00
Dmitry Shachnev
41750492db Make sure QDBusMenuBar is restored when the window is hidden and shown
Task-number: QTBUG-58723
Change-Id: Ib4c3dac8a8cce717f4d47ab619c05b9e1719f311
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-03-27 12:14:27 +00:00
Joerg Bornemann
0ec871dac8 Introduce QInputControl::isCommonTextEditShortcut
For handling ShortcutOverride events in text-edit-like controls one must
know if a key event matches a common text edit short cut. The code that
was formerly in QWidgetTextControl is now moved into
QInputControl::isCommonTextEditShortcut to remove duplicated code in
QtQuick and to avoid adding adding a third duplicate in QtWebEngine.

Task-number: QTBUG-59053
Change-Id: I18723bb0224acd33c8ea4a8d0a601bb5e274a7a9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-03-27 11:32:30 +00:00
Paul Olav Tvete
9ccc3070dd Build fix for -no-feature-textedit
After change e54356151c, qwidgettextcontrol_p.h does not
always include qtextedit_p.h

Change-Id: If7b54384d644fda4985eb1966d6773ee393ba107
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-03-27 11:25:09 +00:00
Kimmo Ollila
15fe60cfda Workaround GHS compiler bug
This temporary workaround allows to compile with GHS toolchain and
should be removed when GHS provides patch to fix the compiler issue.

Change-Id: I0d0eac8054e6ba2f448fed3d3c80a518e0d2af97
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-03-27 09:00:15 +00:00
Friedemann Kleint
e8d03c5599 Bump copyright year
Task-number: QTBUG-59648
Change-Id: Ie2d08515f4ad177bab338210a0a3e52f5519dcc3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-03-27 07:38:36 +00:00
Liang Qi
d5df0e9949 Merge "Merge remote-tracking branch 'origin/5.8' into 5.9" into refs/staging/5.9 2017-03-27 09:21:47 +00:00
Liang Qi
7702fe8602 Merge remote-tracking branch 'origin/5.8' into 5.9
Change-Id: Icdd71e9713725bda9c305e338f5c8b41a92ed8e8
2017-03-27 10:42:08 +02:00
Shawn Rutledge
1e7795ef60 Add documentation for TabletTrackingChange enum value
Amends 6aaf853222

Change-Id: I2c264db235ea552ce6b4eb003d7daeeb2cecde6f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2017-03-27 08:32:56 +00:00
Andy Shaw
197b55c939 iOS: Hide the overlay when the keyboard is hidden
If the keyboard is hidden via the hide keyboard button then the edit
menu should also hide with it. This ensures it behaves in the same way
as native applications on iOS then.

Change-Id: I4c714dd5c5cb27d8eaf310e2911dc38feb1cb74e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-03-27 07:21:32 +00:00