A "compound widget" is a widget that has a focus proxy set to an inner
child. This is normal for complex black-box components where focus handling
is delegated to the children. Since the compound can have several
children, a local tab order might exist between them.
The current implementation of setTabOrder had no idea about
compound widgets. As such, when connecting two compounds in the
tab chain, it would just break up their inner tab order and
cause tabbing to ignore children other than the proxy.
The new implementation recognizes compound widgets, and add some
extra code to figure out the correct tab targets. This way, the
local tab order between the children will be preserved.
This implementation was inspired by the patches of Marek Wieckowski posted
in the linked bug report, and later modified by Nikita Krupenko.
[ChangeLog][Widgets] QWidget::setTabOrder() will now preserve the local
tab order inside a widget if it has a focus proxy set to an inner child.
Task-number: QTBUG-10907
Change-Id: I0673d39d70ec8c6bf64af30bf978d67c651b2f3c
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
That's no longer a thing on macOS. We still keep it around for
QMdiSubWindow, but we should support 4-edge resizing there as
do native windows.
In practice, because of WA_MacOpaqueSizeGrip, we were already
rendering the size grip manually instead of relying on HITheme.
Change-Id: If613a14f03dc650b457688f3f2f57631b5fb30a3
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
NSBox is good enough for this and pixel equivalent with
the previous HITheme calls.
Change-Id: I32b2a1cc8a9cd2a6ef17d1e01032540344808ebc
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
That switch following the if looked a bit corny.
Also made cocoaCells hash mutable to get rid of the
const_cast(this) in QMSP::cocoaCell().
Change-Id: I4facec827409314cf1214152c19efb9688715eb2
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Window icons on macOS are tied to document windows, and should not show
up unless a represented filename has also been set according to the HIG.
We follow this, and no longer create a document button based on the window
title if one did no exists. We also fall back to using the filename of
the file if a title has not been set, including being able to restore
this default title after setting a custom title.
The icon is no longer reset to nil after setting a QIcon(), which would
remove the icon completely, but instead we restore the default behavior
of showing the default filetype icon of the file.
Finally, the two callbacks in QNSWindowDelegate dealing with the document
icon/title popups and drags have been taught to look for spaces in the
represented filename. This allows clients who really want the old
behavior of setting an icon without caring about the filename to set
the filename to a single space character, which will prevent the
dropdowna and drag from occurring.
The reason for not tying this behavior to the existence of the file in
the filesystem is that being able to represent a file that is yet to
be saved is a valid usecase.
Task-number: QTBUG-63338
Change-Id: I7d4377c6358226fb6058f8c2b3c28588eec77ce5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
It's the one that is more complex - with a text-based 'progress-bar'
and queueing (for some, probably educational, reason) of requests.
Changes:
- update the C++ syntax (mem-initializers, range for, etc.)
- new-style headers
- redirects should not result in creating an empty file. Since we
have no UI, and this example is already complex enough, settle
for just reporting the redirect and removing the empty file.
Task-number: QTBUG-60628
Change-Id: I0b69cd77414ecac7c0bc6b2f8f787befc978de28
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Mainly 'modernizing' - use <c...> c-library includes (<stdio.h> -> <cstdio>),
add appropriate using directive; minor fixes in formatting + removal of a
hated double negation (aka ifndef QT_NO_NOTHING). Also, as our rules
('how to write examples') suggest - replace too many inclusion directives
with module-level headers. Basic redirects handling - do not create empty files
for redirected requests (or even files with some useless html).
Task-number: QTBUG-60628
Change-Id: Ia4398d39126313e6213bc7244d11a55958e64dec
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
MSVC is too stupid for them. Not only will it not inline those functions
if they are in a __declspec(dllimport) class, it will also print an
annoying Level 4 warning:
function 'function' marked as __forceinline not inlined
Task-number: QTBUG-57811
Task-number: QTBUG-55042
Change-Id: I0b48fc8e90304e0dacc3fffd14e8a346d18a9e0c
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The highlighted examples list for QQC2 is maintained separately.
Task-number: QTBUG-60647
Change-Id: Ib64ff7a44c6fcaf99058422d76ef6680df310911
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This reverts commit 9e268185bb.
Reasons: must go into 5.9 + the logic in this patch needs fixing, not good as
it is now.
Change-Id: I92516ddb1d2661d85ce77c54a1307f45df1ab635
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
- new screenshot with more up-to-date graphical look
- deleted itemviews-editabletreemodel.png from old folder
doc/src/images
- deleted unnecessary item in qtwidgets.qdocconf
Task-number: QTBUG-60635
Change-Id: I9b82fa027347fb0fd7adb86038abd32853e68c3a
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
access\qnetworkdiskcache.cpp: In member function 'virtual qint64 QNetworkDiskCache::expire()':
access\qnetworkdiskcache.cpp:540:44: warning: 'QDateTime QFileInfo::created() const' is deprecated: Use either birthTime() or metadataChangeTime() [-Wdeprecated-declarations]
cacheItems.insert(info.created(), path);
^
Change-Id: I5705de5cb4b490ef2bd788fb94ceac0e5b6c0d05
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This guarantees that we have proper version checks in place for APIs on
Apple platforms that are not necessarily available on the deployment
target.
Change-Id: I10060f8b910f2bb790aa4a9c6f8c5cdc14d7cf06
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Convert QSysInfo/QOperatingSystemVersion to __builtin_available where
required or possible, or to QOperatingSystemVersion where
__builtin_available cannot be used and is not needed (such as negated
conditions, which are not supported by that construct).
Change-Id: I83c0e7e777605b99ff4d24598bfcccf22126fdda
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Unlike client, this needs a bit more changes:
- remove redundant (and outdated) stdlib.h includes
- use QRandomGenerator (instead of qsrand/qrand pair)
- replace QStringList with QVector<QString>
- Q_NULLPTR->nullptr, ExplicitType * -> auto
- fix some weird indentation
Task-number: QTBUG-60628
Change-Id: I12eed12711b1e622407bd8ecd1afdf56a2cf2097
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
For HTTP/1 it's done when no data expected and response headers received -
protocol handler emits channel->allDone which handles the status code and
sets (if needed) a redirectUrl. HTTP/2 protocol handler cannot emit allDone
(it has many requests multiplexed and actually cannot say allDone yet).
So we set a redirect url if we have the corresponding status code and
found 'location' header. Before it's too late.
Task-number: QTBUG-63471
Change-Id: Icfa871fb999e676650d62c45a20e689596da4028
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Otherwise QWindow::setFilePath() before create() would have no effect.
Change-Id: Ia2171054aa13e21316d525193d330efaf4653dbf
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Copy into the intended array elements, not into the start of the
array.
Change-Id: I05c4ece2450583c9358aa1eddfd702262e995146
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Most linux distribution uses libjpeg-turbo as a replacement for libjpeg.
Since Qt will be linked against -turbo more frequently than the "original"
libjpeg we should use it for the bundled copy, too.
Also add an import script.
[ChangeLog][Third-Party Code] Replaced bundled libjpeg by libjpeg-turbo 1.5.2
Change-Id: I41081db74f194cbc288820fc783c9fef16545efd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
... as soon as we updated multicastsender. Changes are minimal and mostly
cosmetic - use 'explcit' and 'nullptr' where appropriate, make a socket
data-member and not a pointer, move the 'datagram's declaration outside
of a loop.
Task-number: QTBUG-60628
Change-Id: Icfa46e6d2844c40a605f2f4066847594943a8ea8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Problem was for 32 bit macOS, or if QT_COORD_TYPE was configured
to be float.
Change-Id: I0a3d3d305f2e8a0f9be7c40f4fef7eabf4643d05
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This is mostly relevant for Apple platforms, where we can use the new
unguarded availability warnings to guarantee that proper version checks
are present when using APIs that are not necessarily available on the
deployment target.
Change-Id: Ie408704b2924e1220491a9ea30f0141dfa4867d9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
... as soon as we updated the 'sender' example. Changes are purely cosmetic
though - 'explicit', nullptrs and local variables instead of redundant
data-members (QPushButton).
Task-number: QTBUG-60628
Change-Id: I572219da9d2a0ced07d94efb6f52f00b5a9c546d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
GCC 7 and other compilers compile this code just fine. GCC 6 fails, so
this is clearly a compiler bug. So revert the implementation of the
qWait() function back to the original, to make the problem disappear.
qtestsystem.h:58:42: error: ‘bool QTest::qWaitFor(Functor, int) [with Functor = bool (*)()]’ used but never defined [-Werror]
Change-Id: I0b48fc8e90304e0dacc3fffd14e8110138cc9f45
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
If you're using GCC 7 or Clang 4, Q_REQUIRED_RESULT expands to
[[nodiscard]] that must appear in as specific place on the line.
qcompilerdetection.h:1182:29: error: attribute ignored [-Werror=attributes]
qtestsystem.h:58:12: note: in expansion of macro ‘Q_REQUIRED_RESULT’
static Q_REQUIRED_RESULT bool qWaitFor(Functor predicate, int timeout = 5000)
^~~~~~~~~~~~~~~~~
Change-Id: I0b48fc8e90304e0dacc3fffd14e80ede168d5c6b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This avoids looping prior to the main 16-byte loop, by performing one
load that may include bytes prior to the start of the string. This is
guaranteed not to fault, since str points to a valid character, but it
may cause Valgrind to print warnings.
Change-Id: I6e9274c1e7444ad48c81fffd14dcae854bba24b2
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Child QWindows (or in the case of QWindows embedded in native applications:
top level QWindows where the corresponding NSView is a child of another
view, so not being the contentView of its window), still need some of the
NSWindow notifications to e.g. update their exposed state when the window
becomes visible.
We make sure to send the notification to all QCococaWindow children of
the relevant NSWindow, and let each callback decide if it should only
apply to content views.
This fixes an issue where a QWindow would never be exposed if the window
was a child NSView and added to a NSWindow that was yet to be shown.
Change-Id: I7f7df8bc5f4ca3ac553a2c146f8c3229b197c059
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Otherwise the deletion of the platform window may result in platform events
that then conclude the QWindow has a valid platform window and calls into
it, when it's been half-way destroyed.
Change-Id: If9eaad1b4e6aa414ba0f96475756a2146e0c01d5
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
From: https://tronche.com/gui/x/xlib/events/exposure/expose.html
"The circumstances in which the X server generates Expose events
are not as definite as those for other events."
On windows with XCB_GRAVITY_NORTH_WEST flag set we should not get
expose events according to e2665600c0,
but as stated earlier this might not always be true.
Nevertheless, sometimes we get expose event from X server when shrinking
window, but most of the time we don't. Make the test not flakey by
checking that we get at least 1 expose event, instead of exactly 1.
Now running test 500 times in a loop does not fail.
Task-number: QTBUG-63424
Change-Id: I8004e622020cc09e11b7d592faf6d9ee1b9cfee2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
QGuiApplicationPrivate::processExposeEvent updates the QWindow's exposed
state, so we need to call QWindowSystemInterface::handleExposeEvent()
when going from non-exposed to exposed.
Change-Id: I461b2fb27cd8fd4bdb250d05d47f9af6cb3eb15c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Similar to broadcast sender:
- where possible use local variables instead of data-members
- where possible avoid heap-allocated objects, use sub-objects instead
- change signal-slot connection syntax (and as a "bonus" - show our QOverload)
Task-number: QTBUG-60628
Change-Id: I8cd4f888c1d0653bdc8591800e713bbd347ad2fb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This patch contains:
- some cosmetic changes to make example look more like
modern C++;
- UI initialization code and SSL signals handling were split
into separate member-functions;
- useless checks 'if (socket)' were deleted;
- widget's minimum size is now fixed + font size
in 'CertInfo' dialog increased to make it readable.
Change-Id: I7aadb78896832a989494d280d6da0635045f948c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The QML API allowed only separate setting of geometry parameters which
causes flickering when all parameters need to be changed.
By exposing the setGeometry function it is possible to set all of these
at once using an imperative setGeometry call from JavaScript.
Note that bindings for x/y/width/height are still evaluated
sequentially, resulting in four calls to the platform window's
setGeometry. This patch only introduces an imperative workaround for
that issue.
Change-Id: Ie9b0d3c39434740e50757ba7cff0385ae80f47f4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reduces duplication of logic and allows other primitives to be
built on top.
Change-Id: Ia100014cfb0c09ac2f47c3a156d0c76f0fddafa8
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
When tabbing/searching for the next focus widget, the current
code would check if the next widget in the focus chain
had a focus proxy, and if so, ignore it. The exact reason
for this behavior is not clearly understood, but some widgets
(e.g QSpinBox) has children (a QLineEdit) that sets the parent
as focus proxy. If we didn't ignore children with focus proxy, tabbing
from a QSpinBox would lead us to find the inner QLineEdit, which
(because of its proxy), would lead us back to the QSpinBox. And
therefore not be able to tab out.
But ignoring the focus proxy has other problems. Normally a focus
proxy is the next sibling to the widget it acts as a proxy for, and
tabbing to the widget will therefore appear correct. But if the
focus proxy is not the next sibling, the logic will fail, since
the tab would anyway give focus to the next sibling. This becomes very
apparent if the focus proxy is a child of the widget, since then
its likely that the focus proxy is not the _first_ child among all
the children. So tabbing to the parent would not give focus to
the proxy.
This patch will change this logic so that you are allowed to tab to a
widget with a focus proxy. But we check that if you do so, you actually
end up moving focus in the right direction. If not, we ignore it like
before. This will ensure that we tab correctly when dealing with focus
proxies, and especially when focus proxies are used to construct
compound widgets.
[ChangeLog][Widgets] When tabbing to a widget with focus proxy, focus
will now be given to the proxy rather than just being ignored.
Task-number: QTBUG-10907
Change-Id: I66d1da5c941fdd984bb2783cc355ca65b553b5dd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Factor out searching for the deepest focus proxy
in to a private function. Other than being called
from QWidget::setFocus(), this function will also be
used in subsequent patches.
Change-Id: I4450a42e362eccb64f8a88c7ea83b415101973b9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
QHostAddressPrivate is one QString and 24 bytes, allocated on the heap,
which is WAY too heavy for something that fits into 8 bits. So instead
of storing the expanded netmask inside QNetworkAddressEntryPrivate, we
store the simple prefix length and calculate the mask only if asked.
Change-Id: Ie05c6480d8a44fda817ffffd14d9ad4707aa8a92
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>