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>
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>
... 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>
Change-Id: Ib7cf5db6c9a49e7f359410bc0ec3d1ceadcde5cf
Reviewed-by: Stephan Binner <stephan.binner@basyskom.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
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>
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>
The text member was never filled and thus was not set in onKeyUp.
Change-Id: I0d0094745c385e0942635da643d863868b010c2a
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
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>
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>
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>
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>
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>
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>
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>
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>
Change-Id: Ifa3382098c8f7c2cb1750b7ac5e583ddd71895e2
Reviewed-by: Stephan Binner <stephan.binner@basyskom.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Change-Id: I58a2bd715ff1767571d076a881872bd5eab2caec
Reviewed-by: Stephan Binner <stephan.binner@basyskom.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
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>
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>
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>
.. 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>
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>
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>
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>
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>
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>
... 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>
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>
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>
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>
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>
qnetworkreply.cpp:307: warning: Can't link to 'QNetworkRequest::UserVerifiedRedirectsPolicy'
Change-Id: Ic96f834f3ca9984f626833e45e69f6322b83d12d
Reviewed-by: Martin Smith <martin.smith@qt.io>
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>
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>
qstringbuilder.cpp:75: warning: Command '\li' outside of '\list' and '\table'
Change-Id: I2353462cfd14a4f7cf60d5064ecb069155d1cd34
Reviewed-by: Martin Smith <martin.smith@qt.io>
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>
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>
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>
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>
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>
They're not affected by the GCC bug noted in the comment.
Change-Id: I7814054a102a407d876ffffd14b69e8a8e2527f1
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Mark QPlatformGraphicsBuffer and QSystemTrayIcon as internal.
Change-Id: I39e5b4f635fca21ab0544cd840a113514b6b1e99
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
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>
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>
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>
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>
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>
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>
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>
_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>
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>
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>
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>
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>
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>
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>
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>
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>
$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>
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>
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>
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>
- 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>
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>
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>
This fixes a regression introduced in ff19ebcc
Task-number: QTBUG-60046
Change-Id: I47c357433b25f07011a7a3a64d3150591785b206
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
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>
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>
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>
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>
- 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>
- 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>
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>
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>
[ChangeLog][QtTest] QUuids are now printed on failure.
Change-Id: I39a7b9169aef8ab6ef5ce0790920547af23bd1b9
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
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>
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>
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>
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>
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>
<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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
c0157a9f03 was incomplete.
Change-Id: I27b55fdf514247549455fffd14b158f54403663d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
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>
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>
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>
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>
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>
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
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>
The QCoreTextFontEngine constructor already sets the member (like it should).
Change-Id: I6e59ff36c439857418a636de4056c20d2f65e8d4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
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>
So that the logic can be used without subclassing the FreeType font database.
Change-Id: Ib1ac0e1948ce18003b8eda0c1e8fbb3c7e6c8360
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
This amends commit c20cd4d98e
Change-Id: I2fa903209694cd05e0dcf31e6f92d96ed934c91d
Reviewed-by: Stephan Binner <stephan.binner@basyskom.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
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>
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>
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>
... 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>
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>
Apply white text only for macOS style.
Amends 2c0033983b
Task-number: QTBUG-59784
Change-Id: I9e66e929699efd715ed4565394f1aba763aeb32a
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Change-Id: I6b1239941f8fd13eec72b0874d15d821d717ddf3
Reviewed-by: Stephan Binner <stephan.binner@basyskom.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Change-Id: Ia384c2b48a6eaccb424cdde00240ebcfa6fd24c6
Reviewed-by: Stephan Binner <stephan.binner@basyskom.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
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>
Change-Id: I352c011b21624ae9fb9db5a608e8c2b2491a05cd
Reviewed-by: Stephan Binner <stephan.binner@basyskom.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Change-Id: Ib0eae1858880e3fe2b6c6abd94c7ea0bbc2649a2
Reviewed-by: Stephan Binner <stephan.binner@basyskom.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
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>
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>
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>
Also use canonical contact url.
Change-Id: I43f8c6a2c4949ee0e054045bccc17d82575b072c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
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>
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>
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>
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>
Add the missing endobj tag for the shader function object.
Change-Id: Ieb3cfa5a5d0e27d04164a80b028d41371507fb94
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
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>
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>
After change e54356151c, qwidgettextcontrol_p.h does not
always include qtextedit_p.h
Change-Id: If7b54384d644fda4985eb1966d6773ee393ba107
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
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>
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>