Don't prepend the default suffix to the NSSavePanel allowedFileTypes.
"If no extension is given by the user, the first item in the
allowedFileTypes array will be used as the extension for the save
panel." The user expects to get the suffix displayed to them in the
drop down filter, not the default suffix set by the developer.
Apply the default suffix if neither the user or the NSSavePanel
provide a suffix.
Task-number: QTBUG-66066
Change-Id: I64093b9f3178bd2377a7b65d6f23aed6214a4119
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
On Android, we load the application library, and its dependencies (Qt),
on Android's main thread (thread 0), and then spin up a secondary
thread (thread 1), that we call main() on.
If any QObject is constructed during loading of the application library
or any of Qt's libraries, via static initializers or constructor
functions, we will set QCoreApplicationPrivate::theMainThread to
thread 0, which will confuse Qt later on when it's being run on
thread 1, and will result in a warning during QCoreApplication
construction:
QApplication was not created in the main() thread
This situation can easily lead to a crash as well.
Unfortunately logging via qDebug/qCDebug and friends will trigger
this too, as they internally use QObject.
Fixing the root cause of this is under investigation, but for now
we will partially revert fa2a653b3b for Android. The effect
is that any qCDebug with a "qt.*" category before qApp construction
will turn into a no-op, like it was before fa2a653b3b.
This patch does not cover the case of a regular qDebug, or a qCDebug
with a non-Qt category. Those will still produce the same symptom,
as before fa2a653b3b.
Task-number: QTBUG-65863
Change-Id: I95675731d233244530d0a2a1c82a9578d5599775
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Instead of trying to detect situations where we need to send a real
expose event instead of an update request in response to a drawRect
call, we keep track of when we've asked the view to display due to
a requestUpdate call, and only deliver the corresponding drawRect
as an update request if no other code has asked the view to
display.
This should cover all cases of asking the view to display, issued
from our code or from AppKit, such as the view changing its backing
scale factor, or otherwise needing a real expose event.
Task-number: QTBUG-65663
Change-Id: I1783787823aee889dad8e48f34a1cb0f1b7b06bd
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
When using QFileDialog::getOpenFileUrl() with dir set to e.g.
"sftp://foo/bar.cpp" we call q->selectDirectoryUrl("sftp://foo")
followed by q->selectFile("bar.cpp").
Inside QFileDialog::selectFile() we unconditionally convert "bar.cpp"
to an absolute URL and then call d->selectFile_sys("$CWD/bar.cpp")
This then calls platform integration that detects that an absolute URL
is being passed to selectFile() and therefore overrides the initial
directory.
Initially reported as https://bugs.kde.org/show_bug.cgi?id=374913
This is a regression that appeared some time between Qt 5.7.0 and 5.7.1.
I have not had time to bisect this but the only commit that may have
change behavior in that time range appears to be
007f92c6ee.
Change-Id: I6968abe9ed5c5b9de067c453a7e9d2c5cdb3a190
Reviewed-by: Christoph Resch
Reviewed-by: David Faure <david.faure@kdab.com>
On platforms such as XCB, the drag cursor pixmap is shown via a window
(a QShapedPixmapWindow) under the cursor.
The mouse button release event at the end of the drag is received in
this QXcbWindow, but intercepted by an event filter that QSimpleDrag
installs on the QApplication. It then resends it unmodified(!) after
the drag has ended and the drag pixmap window destroyed, causing it to
be delivered to the new top-level window.
The local coordinates in the unmodified QMouseEvent are local to the
drag pixmap window and don't match the window it is delayed-transmitted
to.
This ends up having fatal, user-visible effects particularly in Qt
Quick: QQuickWindow synthesizes a hover event once per frame using
the last received mouse coordinates, here: the release posted by
QSimpleDrag. This is done to update the hover event state for items
under the cursor when the mouse hasn't moved (e.g. QQuickMouseArea::
containsMouse). The bogus event coordinates in the release event then
usually end up causing an item near the top-left of the QQuickWindow
to assume it is hovered (because drag pixmap windows tend to be small),
even when the mouse cursor is actually far away from it at the end of
the drag.
This shows up e.g. in the Plasma 5 desktop, where dragging an icon
on the desktop will cause the icon at the top-left of the screen (if
any) to switch to hovered state, as the release coordinates on the
drag pixmap window (showing a dragged icon) fall into the geometry
of the top-left icon.
QSimpleDrag contains a topLevelAt() function to find the top-level
window under the global cursor coordinates that is not the drag
pixmap window. This is used by the drop event delivery code.
This patch uses this function to find the relevant top-level window,
then asks it to map the global cusor coordinates to its local
coordinate system, then synthesizes a new QMouseEvent with local
coordinates computed in this fashion. As a result the window now
gets a release event with coordinates that make sense and are
correct.
Task-number: QTBUG-66103
Change-Id: I04ebe6ccd4a991fdd4b540ff0227973ea8896a9d
Reviewed-by: Eike Hein <hein@kde.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
- Allocate widgets on stack. The previous version was inconsistent (some
widets were managed by QScopedPointer and some were simply leaking).
- Use QTest::mouseMove(QWindow *)
- "This test fails on OS X on CI" was a clear indication that test is
flaky, the new implementation can reliably reproduce issue which is
now tracked in QTBUG-63031.
Task-number: QTBUG-63031
Change-Id: I59965ef8fa8edca17c8a73901d81e9efc7da3c5b
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
QHeaderView is doing a complete rebuild of the sections when the layout
changed because everything could have happened. But since layoutChanged
is also called during e.g. sorting, the old data must be restored when
possible.
Task-number: QTBUG-65478
Change-Id: I088d4d843cad362b97df6dc5e0dcb9819b13547f
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
[ChangeLog][QtCore][QBitArray] Added fromBits(), which creates a
QBitArray from a dense bit array, and bits(), which returns that.
Change-Id: Ia9c88b83534240a5872dfffd150b1c8b1c36ced5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit introduces minimal support for instrumentation within Qt.
Currently, only LTTNG/Linux and ETW/Windows are supported.
Change-Id: I59b48cf83acf5532a998bb493e6379e9177e14c8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It's vectorized, so it should be faster than this version.
Change-Id: I56b444f9d6274221a3b7fffd150c1519eb999cdc
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
isLatin1(QLatin1String) is provided for completeness sake, in case some
generic code operates on both QLatin1String and QString/QStringView.
Change-Id: I5e421e32396d44e4b39efffd150b99a18eedf648
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This patch fixes the strange behavior when selecting text.
This patch (on a Left To Right text) makes sure that:
- the left handle will select text only on the left & above of the right handle
- the right handle will select text only on the right & below of the left handle
For RTL is way more complicated:
- the left handle is acuatually the right handle but on the left side and it acts as a right handle
- the right handle is acuatually the left handle but on the right side and it acts as a left handle
Change-Id: Ifca591398103199d5aef479f0a080161c9f44c0e
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
This way the user will not cover with his finger the text with the cursor/selection.
Set the tolerance to 0.5mm which is less then the width of the thinnest letters (e.g. i, I, l)
Change-Id: Ia5d50bd3f4fe79c89d01b3d7f5e5c22e94e8158b
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Allowing empty selections leads to strange behavior, it switches from selection handles
to cursor handle.
Change-Id: Ida69346e2a47b13c92cfd68a555d6b94422bb580
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
On Android if the edit control is bigger than the remaining screen we resize it, this caused the
handler(s) to remain outside the control.
A better fix will be to ensure that the cursor/selection remains visible when the control is resized
but I don't know if this is the desired behavior on all platforms.
Task-number: QTBUG-62994
Task-number: QTBUG-58700
Change-Id: If43eb7bc1ecde426697694a8f26118e95fccb80c
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
There was missing update in setTreePosition() or better to say update
was but in not that part of QTreeView that needed. Now QTreeView
correctly updates and paints tree decoration in a new place on
changing tree position.
[ChangeLog][QtWidgets][QTreeView] Fixed missing update of QTreeView
on changing tree position.
Task-number: QTBUG-65980
Change-Id: Id79ab8fcb39d511245a551068640684dd2a10cb9
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
'win32-icc' toolchain:
- remove duplicated angle/vulkan includes.
'win32-g++' toolchain:
- place angle/vulkan includes before the unrelated compiler-related
variable re-definitions, similarly to the 'win32-clang-msvc',
'win32-icc', and 'win32-msvc' mkspecs.
Change-Id: Ie04bc9fb1d51ec0366b42713439f680e51214bbc
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Two small changes late in the review process were flawed.
Change-Id: I4b1f6e3fdb8e17000a2e11bc30aae1b29d9f43a9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Refactor the page displaying the standard pixmaps of a style:
- Use a QGroupBox
- Sort items by enumeration name
Add a page displaying the standard icons along with the list of
sizes.
This allows for conveniently checking which resolutions are available.
Change-Id: I2d7f655456fc3e7013c2582ad520b6ac582951e6
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
QXmlStreamWriter does not: it just writes the QString inputs to the
output.
QXmlStreamReader does: it first converts the QString to UTF-8 and stores
locally. Then it tries to decode using the XML encoding header.
Change-Id: I39332e0a867442d58082fffd1503d7652cb9fbff
Reviewed-by: Martin Smith <martin.smith@qt.io>
This is in preparation to adding CBOR support. We don't need yet another
dir for CBOR and placing it in src/corelib/json is just wrong.
Change-Id: I9741f017961b410c910dfffd14ffb9d870340fa6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
QAbstractItemModel::dataChanged() gained an optional role parameter
with Qt5 which was not filled within QListWidgetItem/QStandardItem
setData() functions
Task-number: QTBUG-55903
Task-number: QTBUG-63766
Change-Id: I4da9346ef8401cc8633dc4b2ea7d00451d1e3942
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Wait a little bit longer for the visibility and resize events. By
directly waiting for the incoming events with QTRY_COMPARE we give
the test some more time to deliver the expected events.
Also move the check for the expectedResizeCount/expectedPaintCount
before the geometry check for better debugging.
Task-number: QTBUG-64639
Change-Id: I712e432aa8f8d35dd199adf88af3653009528b57
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
File system operations like renaming/removing may fail on Windows when
file system watchers are present. Add functions to
QFileSystemModelPrivate to temporarily remove the watchers prior to such
operations and to restore them in case of failure. Use them for
rename/remove (within a feature check for QFileSystemWatcher
and Q_OS_WIN).
Task-number: QTBUG-65683
Change-Id: I90142901892fbf9b1e1206a3397a95ffd3c8f010
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
With this change it is possible to use all supported
configurations in different backends without any new interfaces.
Change-Id: Ib233539a970681d30ae3907258730e491f8d3531
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Instead of having to modify the tst_databases.h file whenever you want
to add a test database, this will now read from a file to find what
databases are available. This defaults to dbs.json in the same directory
or the QT_TEST_DATABASES_FILE environment variable can be set to point
to the file that contains the databases. The latter makes it easier for
CI then to have something set up on a per configuration basis.
The SQLite database stays hardcoded so this will continue to be tested as
before without any additional changes.
Change-Id: I7e7ccde6a6be3e490dd640b1590e3b691a6b2ab3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Variable was added in e2e874415e
but is not used anywhere.
Change-Id: Iff1e7c20317bb489978eb77d24b8da12493d7e45
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Move the instantiation of QGuiApplication to the top since it is
required by QOpenGLContext::openGLModuleType().
Task-number: QTBUG-55671
Change-Id: I506cee193fe2ba48400851588a8ef079848bc2f4
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The include is needed for std::unique_ptr on winrt.
Change-Id: I72a28bd0951cc947ac65877ccc35f464c757c444
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
The backwards iteration was done under the assumption that the only
valid modification of the winEventNotifierList in a slot connected to
activated() would be the removal of the notifier itself. This is wrong.
Instead, iterate forwards, like before 85403d0a, and check the index
against the current list size in every iteration. This ensures that we
do not run out of bounds while the list is modified.
Also, retry the activation loop if the list was modified by a slot
connected to activated(). This ensures that all notifiers with signaled
handles are activated.
Task-number: QTBUG-65940
Change-Id: I25f305463b9234f391abc51fe0628d02f49b6931
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Change-Id: Ib9a1b107dd8d2cd4bf541c3edf19a602fde6356f
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
This way, it's lossless.
Change-Id: I5e421e32396d44e4b39efffd150b744e40fff3a1
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
[ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 1.5.3
Change-Id: I8c0caec3c92ba199b1a3baac9a523cc399c8001f
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
All of our compilers support #include <immintrin.h>, so we don't need
the legacy code that includes the earlier versions.
Change-Id: I938b024e38bf4aac9154fffd14f80214d1d744c8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Without this, building Qt and Qt applications fails with GCC 8.
The errors look like this:
writing to an object of type ‘class QPointer<QQuickPointerHandler>’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Werror=class-memaccess]
Task-number: QTBUG-65691
Change-Id: Ie5a30814125deca7a160b9a61f5aa3f944ee1ac9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The PRODUCT_BUNDLE_IDENTIFIER property was not defined in the Xcode
project file and therefore the build would fail.
This fixes a regression introduced by 0749ba2c5e.
Task-number: QTBUG-65673
Change-Id: I8089b36d86588223ec34859af7388c99a3574d8b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Fix regression from commit 8b3a120a where also dialogs
got NSResizableWindowMask, making them have a Zoom
button.
Task-number: QTBUG-65668
Change-Id: I21054b3aa6fc11eab3d93f78ede44ae771522e2c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The idx member of EventWithNotifier is unused.
Change-Id: I0f5aacaaad4b4e82c57ff7bb020586944014f139
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Adds inline handling of the C++17 type std::variant, so the type will
be resolved if converted into a QVariant.
Change-Id: I31809d70d7f347277389d42a3695836ec7a32d02
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When the application is hidden then Qt will hide the popup
windows associated with it when it has lost the activation
for the application. However, when it gets to this point it
believes the popup windows to be hidden already due to the
fact that the application itself is hidden. As a result,
when the application is restored it causes a problem with
the still visible popup window as it is taking the input
events without responding to them.
Therefore we need to explicitly hide the windows right before the
application is hidden to ensure that they are actually hidden
correctly.
Task-number: QTBUG-58727
Change-Id: I4be1e1c0b1388d0c9ec872e7732185670998b7af
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The linker complains:
LINK : warning LNK4281: undesirable base address 0x67000000 for x64 image; set base address above 4GB for best ASLR optimization
And it's not really required anymore, as the recommended /DYNAMICBASE is
the default.
Change-Id: I56b444f9d6274221a3b7fffd150caab1beecfd43
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Commit 29bc68cf16 added support for
unsigned and commit 5ff7a3d96e later added
support for int. This commit adds support for qsizetype, which isn't int
on 64-bit platforms.
We do this by reorganizing the code and using the generic version of
__builtin_{add,sub,mul}_overflow from GCC 5 and Clang 3.8, which ICC 18
seems to support now too on Linux. That leaves older versions of GCC and
Clang, as well as MSVC, ICC on Windows, and the GHS compiler, to use the
generic implementations, as I've removed the assembly code those
versions of GCC and Clang on x86 are now uncommon.
Note: any older version of ICC probably breaks. We only support the
latest.
Change-Id: I9e2892cb6c374e93bcb7fffd14fc11bcd5f067a7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>