Currently, code paths that call QWindowsWindow:setCustomMargins()
automatically also activate the window (=give the window focus).
The reason for this is the call of SetWindowPos (Windows API)
without the flag SWP_NOACTIVATE.
From the Windows API documentation about SetWindowPos() about the
flag SWP_NOACTIVATE:
Does not activate the window. If this flag is not set, the
window is activated and moved to the top of either the
topmost or non-topmost group (depending on the setting of
the hWndInsertAfter parameter).
It seems the flag SWP_NOACTIVATE is accidentally missing in the
call of SetWindowPos() in setCustomMargins(), especially since
the flag is present in pretty much all other calls of SetWindowPos().
The obvious fix is to add the flag SWP_NOACTIVATE to the call
of SetWindowPos() in setCustomMargins().
So far, this issue exists for a long time, an was possibly
introduced with commit f5fd534603, where setCustomMargins()
was initially added.
Change-Id: Id3f058f8762df17eb3f033ab0b3e1791283937fc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Actually check that there's a T where ISO 8601 wants it (instead of
just skipping over whatever's there), with something after it; move
some declarations later; add some comments; and use the QStringRef API
more cleanly (so that it's easier to see what's going on). Simplify a
loop condition to avoid the need for a post-loop fix-up.
This incidentally prevents an assertion failure (which brought the
mess to my attention) parsing a short string as an ISO date-time; if
there's a T with nothing after it, we won't try to read at index -1 in
the following text. (The actual fail seen had a Z where the T should
have been, with nothing after it.)
Add tests for invalid ISOdate cases that triggered the assertion.
Task-number: QTBUG-66076
Change-Id: Ided9adf62a56d98f144bdf91b40f918e22bd82cd
Reviewed-by: Israel Lins Albuquerque <israelins85@yahoo.com.br>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a9c111ed8c)
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>
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>
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>
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>
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>
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>
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>
Since braille characters are not included in Apple Unicode MS, we
extend the fallback to include Apple Symbols to cover those too.
Task-number: QTBUG-63510
Change-Id: I3977f1f9b7370a9fe9cfde643c86518e006c050a
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Follow the example of the other modules and explicitly mention
the valid licenses on each module landing page, optionally
combining it with trademark information.
Change-Id: I9f1fea0f002e0ab607da89a0cbfe7c53060582d7
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Make it clearer what the variable actually does by mentioning
that it makes its headers available for inclusion and causes
it to be linked to the binary.
Change-Id: I72821d4bceea7a92e91175ba6c5acc4c3377d7b7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Passing -1 to waitForReadyRead() may cause it to wait for some time
but the data retrieved may be enough for processing. So if 0 is passed
from read, indicating that there is potentially more to come, then
it will do a waitForReadyRead() then for more data to come.
Change-Id: I75f270d1f124ecc12b18512cc20fb11f7a88f02e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This affected PE_IndicatorCheckBox in some cases.
Change-Id: I6f10dabd2ca4093f4c1bdaa2bd0ebf73c02e8d12
Task-number: QTBUG-65737
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Yulong Bai <yulong.bai@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Both ICC and MSVC have bugs concatenating strings and that's despite the
standard giving an example ([lex.string] table 9) that says that
u"a" "b"
is the same as
u"ab"
We can't change to preprocessor concatenation (u ## STR) because that
fails when QStringLiteral is used with a macro instead of an actual
string literal.
Task-number: QTBUG-65479
Change-Id: I39332e0a867442d58082fffd1504a0a868c291ef
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The Embedded Android build (Boot to Qt Android injection) is defined by
having both Q_OS_ANDROID and Q_OS_ANDROID_EMBEDDED flags defined,
as well as having Qt config android-embedded.
This commit enables the possibility to build embedded Android builds.
(i.e. Qt build for Android baselayer only, without JNI)
Change-Id: I8406e959fdf1c8d9efebbbe53f1a391fa25f336a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
A large plugin dll (e.g., one with many MB of debug info) could cause
a 32-bit application to crash when the entire dll file could not fit
within the address space of the process. The code for validating a
plugin library and retrieving metadata from it first tried to map
the entire file in memory, which failed for large files, returning
NULL. In this case, the code tried then to read the entire file via
QFile::readAll(), which deep below caused a bad_alloc exception in
malloc, resulting in the termination of the application. This change
handles the case where the library could not be mapped into memory,
in spite of memory mapping being supported, by reporting the error
and returning false, making the plugin unavailable.
[ChangeLog][QtCore][QPluginLoader] Fixed a bug that would cause the
Qt plugin scanning system to allocate too much memory and possibly
crash the process.
Task-number: QTBUG-65197
Change-Id: I8c7235d86175c9fcd2b87fcb1151570da9b9ebe3
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
We do add, remove or update third party code in minor releases,
sometimes even in patch level releases. However, the documentation is
supposed to be valid for all existing Qt 5 versions, but doing this for
attributions would require infrastructure we don't have.
Therefore rather make it explicit which Qt version the attributions
apply to. Also mention since when Qt is available under LGPLv3
(starting with Qt 5.4).
Task-number: QTBUG-65665
Change-Id: I328b5bf0c143f78ea61aad51f0644c3cbb6dee49
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
QFileInfo.isRelative() deems any path starting with a slash to be
absolute; on MS-Win, such paths need a drive specifier (unless they're
UNC), so use IoUtils's more robust test for absolute paths.
Change-Id: I7d0872a87833cbf1cc1a6ef107941adc4c529624
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
The native APIs don't support previous transition, only next after a
stipulated date. The prior code started its search at the epoch; if
used for a time before the first transition after the epoch, this
found no transitions so returned invalid data, when the last
transition before the epoch would have been suitable. It also wound
through all transitions since the epoch, on its way to the selected
time, which was potentially laborious.
Instead, start a year before the stipulated time; this should get a
transition if the zone uses DST. If it doesn't, start with the first
known transition and binary-chop our way to one within a year of the
last before the stipulated time; then wind forward one transition at a
time, as before. The chopping is actually faster than binary: each
time we find a transition after the interval mid-point but early
enough, we move the early end of our interval to the transition, which
is later than the old interval's middle. Using halving, starting with
a vast interval, should thus only incur modest cost, while ensuring we
give up early when no transition data is available at all or the
zone's first transition ever was after the stipulated time.
Task-number: QTBUG-65443
Change-Id: I96c14540fc2600837e6a22e480fb8dc36cb37220
(cherry picked from commit 7c0b706488)
(cherry picked from commit a090076e93)
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Jason Dolan <jason.t.dolan@gmail.com>
use a "use" entry instead of including the transitive dep into the list
of libraries.
this also removes the redundant check of freetype features from the
fontconfig test code.
Change-Id: I86b78028255c9bf0a62be5ec0f97a62ef3fda36f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
such a project structure violates the assumption that the referenced
resources are specified relative to the sub-project root, so we must
resolve them to absolute paths manually.
Task-number: QTBUG-65753
Change-Id: I8bcd5c6e7d7c6a713e5fcd3668be7d2f23169501
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
For Q_OS_WIN, a path is only truly absolute if it includes a drive
letter; merely starting with a slash is not enough. (We can't support
UNC paths, so don't even try: qmake runs various commands in the
source directory using CMD.exe, which doesn't support UNC as PWD.)
This requires, when resolving a path relative to a root, transcribing
the root's drive to such not-quite-absolute paths.
Changed QMakeGlobals, $$absolute_path() and $$relative_path() to now
use IoUtils::resolvePath() rather than delegating to QDir's absolute
path method, since that doesn't correctly recognize the need for a
drive letter (and qmake did run into problems with some paths, from
splitPathList and a failing test, as a result).
Moved existing ioUtils tests for handling of relative / absolute paths
out into separate functions and expanded significantly. Fixed some
existing tests to use an absolute path where one is needed; added two
tests involving driveless (but rooted) paths; and fixed the test init
to set a value for QT_HOST_DATA/src property (the lack of which lead
to an assertion failure with this fix).
Task-number: QTBUG-50839
Change-Id: I2bfc13c1bfbe1ae09997274622ea55cb3de31b43
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
QSettings does not preserve the original key type in the registry, it
will set the type for the key based on the value that is being set.
Therefore we should make it clear that existing key types will be
overridden as this can cause some problems with types we do not
directly support (such as REG_EXPAND_SZ).
Task-number: QTBUG-2894
Change-Id: Ib2f2eed02759591e69fefb98a4a1f3cf897dd5cb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Showing file dialogs if running on a system that has an older GTK3
version installed results in a crash. Do a version check at runtime
and disable native file dialog support if the version is too old.
(GTK3 bug: https://bugzilla.gnome.org/show_bug.cgi?id=725164)
Change-Id: I77bd23f1298333412bae04f52153e1a224ddf470
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Although qt_create_pipe() tries again if the pipe name is already
in use, it doesn't handle the case when another user has created
the pipe with the name (the error is "access denied" in that case).
The chance that it happens is small, but it can be entirely
eliminated by including a unique part in the pipe name, in this
case the PID.
[ChangeLog][Windows] Named pipes internally created by QProcess now
contain the PID in their name to ensure uniqueness.
Change-Id: I079f1b68695c1ddea3eccad241061d11e08b60f4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Makes it easier to copy and paste the snippet into a code editor.
Change-Id: I27c0a7aa268bd4fd0af885e929f67a28f083dabf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Saves people the trouble of trying it out themselves. When I tried
"address" and "thread", I got:
cc1plus: error: -fsanitize=address and -fsanitize=kernel-address
are incompatible with -fsanitize=thread
Change-Id: I48ae817e60d0b71d5349e1dbce8706cc8430c2c4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
mingw-w64 toolchain:
- add missing compiler definitions, similar to
'msvc-desktop.conf' toolchain,
- describe the reasons of missing compiler definitions, available in
'msvc-desktop.conf' toolchain,
- add missing 'QMAKE_CXXFLAGS' and 'QMAKE_CXXFLAGS_WARN_ON' variables,
similar to 'msvc-desktop.conf' toolchain.
ICC on Windows toolchain:
- add 'QMAKE_CFLAGS_OPTIMIZE_FULL' variable, similar to 'gcc-base.conf'
toolchain, though left it unused for now,
- add missing flags to 'QMAKE_CFLAGS' variable, similar to
'msvc-desktop.conf' toolchain,
- update deprecated 'Qwd' flag with 'Qdiag-disable',
- use 'QMAKE_CFLAGS_OPTIMIZE_DEBUG' variable instead of '-Od' flag,
similar to 'gcc-base.conf' toolchain (ICC implies '-O2' optimization
level by default, while MSVC implies '-Od'),
- add 'QMAKE_CFLAGS_UTF8_SOURCE' variable, similar to
'msvc-version.conf' toolchain; use a workaround to initialize it,
until '-utf-8' flag would be supported by ICC on Windows,
- update deprecated '-Qstd=c++1z' flag with '-Qstd=c++17',
MSVC toolchain:
- remove 'incremental' from MSVC 'CONFIG' variable, since it has
relevance only for the Unix generator,
- add 'QMAKE_CFLAGS_OPTIMIZE_DEBUG' variable, used in ICC for Windows
toolchain,
- add empty 'QMAKE_LIBS' variable, similar to 'win32-g++' toolchain,
- add 'uuid.lib' library to 'QMAKE_LIBS_GUI' variable, similar to
'win32-g++' toolchain,
- add C++14 and C++17 language support flags, though left them disabled
for now, similar to 'win32-icc' toolchain.
Change-Id: Ideef62d0422674184836faa655bfc5d09a5f612f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Add a check on the platform window to QWidgetPrivate::create_sys().
Task-number: QTBUG-65783
Change-Id: I077882e1cf22ef49bb6f578f7460493ef48c9627
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
When a deleteLater event is queued, a check if done if the same event
for the same receiver is queued before by scanning all pending events.
This leads to quadratic behavior, which is quite noticeable. By using
an unused bit in QObjectData, this can be prevented. Now the duplicate
event scanning in QCoreApplication is only done for the quit event.
Task-number: QTBUG-65712
Change-Id: Ie505acbbec802f91ebd0b94ac067e362c2476113
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The changes introduced in 0e810e27a5
turn out to be incompatible with our style sheets styling. We
partially revert the style option state check, so that the look
for a highlighted PE_IndicatorMenuCheckMark only depends on
State_On, as it's expected in QWindowsStyle and QCommonStyle.
[ChangeLog][QtWidgets][QMacStyle] PE_IndicatorMenuCheckMark
goes back to only depend on State_On for its highlighted look.
Change-Id: I20f8e712196b5515bd5528ff6eedcdca9df5856f
Task-number: QTBUG-65773
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
If the stylesheet does not have a rule that manipulates the font at all
for the menu item, then it should use the one passed into the style
option instead.
Task-number: QTBUG-65034
Change-Id: I6cae3fad3cc22d5ab2b984e4a58b14303bcd6d03
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>