tst_QWidget::updateWhileMinimized has been failing on Ubuntu 14.04
and was already blacklisted there. Now we extend it to cover Ubuntu
16.04.
Task-number: QTBUG-46116
Change-Id: I6758657cca46bb4c76cddb0298f9b87b8a43655b
Reviewed-by: Liang Qi <liang.qi@qt.io>
Fix the condition in QWidgetPrivate::resolveLocale() to decide whether
to propagate locale: make it match setLocale_helper()'s condition when
deciding whether to propagate to descendants. This lead to a
QDateTimeEdit's calendar popup not getting told what locale to use
correctly, unless we setLocale() on it overtly, which then blocked
propagation of locale changes to it unless QDateTimeEdit manually
propagated the changes.
Fix the documentation of WA_WindowPropagation to mention locale as
also being propagated (which it was in several places, only neglecting
this one in resolveLocale).
[ChangeLog][QWidget][Qt::WA_WindowPropagation] Propagate locale
consistently, along with font and palette, within the widget
hierarchy. Previously, locale was propagated on ancestral
setLocale(), but not on creation of the descendant.
Task-number: QTBUG-59106
Change-Id: I92270f7789c8eda66a458274a658c84c7b0df754
Reviewed-by: David Faure <david.faure@kdab.com>
The test has been observed to be flaky, printing warnings
"Rubber band has different geometry". Output the geometries.
Task-number: QTBUG-59641
Change-Id: I6c209f2a98a07655e8523c012c5562d602d217ad
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
When a text block is empty, and we are adding preedit text to it,
we need to merge the format of the preedit text with the current
format of the cursor, otherwise we will use a default format and
then suddenly switch to the proper one when the text is committed.
The reason this becomes a bit complex is that there are no rules
preventing someone from using several ime attributes to specify
formats for isolated parts of the text, and no rules defining the
order of such attributes. So even if the common case is one
text format attribute for the entire string, we need to make sure
we also handle the other cases gracefully, e.g. when we are setting
different formats for different substrings and then providing these
out of order. To make sure we have these corner cases covered, we
also add a set of autotests.
[ChangeLog][Qt Widgets][TextEdit] Fixed initial char format of
input method text as it is in pre-edit mode.
Task-number: QTBUG-59196
Change-Id: I1e37928e3bd1395fec1b5591908d4c69b84eb618
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This reflects QWidget API, and restores some behavior from Qt4.
Some WM can have several state at the same time. On Plasma for example,
when a window is both maximized and minimized, the "maximized" checkbox
is checked from the taskbar entry.
The API of QPlatformWindow was changed to take a QFlag and the platform
plugins were adapted.
- On XCB: Always send the full state to the WM. And read the full state.
- On Windows: The code was originally written with '&' in Qt4, and was changed
to == when porting. Some adaptation had to be made so the states would be
preserved.
- On macOS: Only a single state can be set and is reported back for now,
with the possibly to expand this in the future.
- Other platforms: Just do as before with the effective state.
Task-number: QTBUG-57882
Task-number: QTBUG-52616
Task-number: QTBUG-52555
Change-Id: I7a1f7cac64236bbd4c591f796374315639233dad
Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Made change to clear the hover index when the mouse leaves the widget.
This will ensure the component does not think the item still has the
mouse over it.
Task-number: QTBUG-46785
Change-Id: I34b7f0e171e9cf07ca23150af1b0e6e59a10a58a
Reviewed-by: David Faure <david.faure@kdab.com>
It's a Qt 3 compatibility vehicle, and as such inherits the now-alien
property to distinguish empty and null strings. Particularly worrisome
is the following asymmetry:
QString("") == QString::null // false
QString("") == QString(QString::null) // true
Instead of fixing this behavior, recognize that people might use it as
a weird way to call isNull(), albeit one that once was idiomatic, and
simply deprecate everything that deals with QString::null.
[ChangeLog][QtCore][QString] QString::null is now deprecated. When
used to construct a QString, use QString() instead. When used to
compare to a QString, replace with QString::isNull().
Change-Id: I9f7e84a92522c75666da15f49324c500ae93af42
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Carbon is deprecated and we should not rely on it at runtime or compile
time. These headers were only included for a small collection of
keyboard key constants which have now been hardcoded instead.
Change-Id: Ia2eaa267584b63be8019be3bbf64cba897a985a8
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
For the windows file system engine, we add an extra macro to use
library loading if configured to do so, but avoid it on WinRT, as
none of the symbols would be found.
We also QT_REQUIRE_CONFIG(library) in the library headers and
exclude the sources from the build if library loading is disabled.
This, in turn, makes it necessary to clean up some header inclusions.
Change-Id: I2b152cb5b47a2658996b6f4702b038536a5704ec
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
On a multi-display system wide submenu might either appear on wrong
screen or not appear at all (depending on the specific display
configuration).
Task-number: QTBUG-56917
Change-Id: I40013b0bee340a01ae1c08a5e074afa63da4dbfd
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
This patch fixes 2 issues related to wide menus:
1) Menu took on full screen height when menu width was larger than
screen width;
2) On a multi-display system wide menu might appear on wrong monitor
(not the one where show event was triggered).
The idea is we limit parent menu and all its submenus within the screen
where it was opened.
Note that this patch fixes only geometry-related issues and there are
also some style flaws which need to be addressed (for example, currently
the text does not elide if it doesn’t fit to the menu’s width).
Task-number: QTBUG-56917
Change-Id: I7e9ff4a48bf03060d76e34d33a13ad6cc890c133
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
This reverts commit a4c25c0205.
The API is too limited in scope, and a good name is hard to find, as
evidenced in the API review discussion preceding Qt 5.9 beta.
This API will hopefully return as something like setItemAlignment().
[ChangeLog][QtWidgets][QListView] EDIT: REMOVE: Added expandingListItems property.
Conflicts:
tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
Change-Id: I397acd8a7a6c716e2d3c96eee45a276eb6d4f9dd
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru>
If a floating QWidget has a parent on a different screen, its DPI was
still inherited from the parent instead of taken from the screen.
The only reason we did was in case there is a customDpi set.
(customDpi is a private thing that is only used in designer to change
the appearance of the previewed widget)
So instead of recursing into QWidget::metric for each ancestor, just
use a for loop to find if one parent has a customDpi. If no customDpi
is found, then return the DPI of the right screen.
Task-number: QTBUG-58959
Task-number: QTBUG-48242
Change-Id: Ie6e9e48cdd10234994c0919ba3aea9b0cdb52494
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
As the destroyed() signal is emitted from ~QObject, it is not allowed
to use static_cast to a QAbstractButton on that pointer anymore.
And the qobject_cast will also fail which will keep a dangling pointer
in the hash.
Change-Id: If0d22fcc30cde87e771e70914c3afb04ea207289
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The implementation now uses the relaxed-constexpr
qCountTrailingZeroBits() function from QtAlgorithms, making the
QSizePolicy(Policy, Policy, ControlType) constructor constexpr on
C++14 compilers. The explicit check for DefaultType remains to keep
the constructor C++11-constexpr when called with just (Policy,
Policy).
Extend the constExpr tests a bit.
Change-Id: I59690f0921d9bdee08e3615d0d1f4a9b92870c32
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Replace all QT_NO_PROCESS with QT_CONFIG(process), define it in
qconfig-bootstrapped.h, add QT_REQUIRE_CONFIG(process) to the qprocess
headers, exclude the sources from compilation when switched off, guard
header inclusions in places where compilation without QProcess seems
supported, drop some unused includes, and fix some tests that were
apparently designed to work with QT_NO_PROCESS but failed to.
Change-Id: Ieceea2504dea6fdf43b81c7c6b65c547b01b9714
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Embeddeding a QWindow via QWidget::createWindowContainer() fails to
deliver the SurfaceAboutToBeDestroyed event. This breaks any OpenGL
or Vulkan based QWindow that releases resources upon this event, and
is particularly critical with Vulkan where the only way to do properly
ordered swapchain - surface cleanup is via this event.
In the non-embedded case close() eventually ends up in an explicit
destroy() in QWindow. In the embedded case destroy() only gets called
from ~QWindow. This then silently breaks since the subclass' reimplemented
event() virtual is not getting called anymore.
To remedy the problem, simply add an explicit destroy() to
QWindowContainer.
Task-number: QTBUG-55166
Change-Id: I1671e8f4d39f6c44e19eca7b9387f55fe3788294
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
...in order to support sRGB framebuffers.
Add a --srgb option to the qopenglwidget example to allow testing.
[ChangeLog][QtWidgets][QOpenGLWidget] Added support for specifying
custom internal texture formats in QOpenGLWidget in order to make it
possible to have the widget backed by an sRGB-capable framebuffer.
Task-number: QTBUG-50987
Change-Id: I112e2f0ab0b1478c69e601031aa0bafaa87fa847
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Ensure that tablet moves are delivered iff tabletTracking is true.
Task-number: QTBUG-26116
Change-Id: Iaa360e181f0c6484cfbde6fa5365f2f0dc77433a
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Unfortunately, that ctor also takes a ControlType argument (defaulted),
and calls the non-constexpr, non-inline function setControlType().
In order to make at least the two-arg version constexpr, I added
a use of the ternary operator to check for type == DefaultType,
making all calls of the ctor that use type == DefaultType
constexpr. For init'ing an aggregate type without ctor in the
ctor-init-list, I needed to require uniform initialization, too.
C++11-style constexpr cannot call void functions, so I needed
to extract the transformation part of setControlType() into a
new function that returns the result instead of storing it directly.
Saves a surprising 2K in QtWidgets text size on GCC 4.9, AMD64 Linux
stripped release builds.
Change-Id: Ib4adf5fd6e54d5345dbfe1c298554278faf13c58
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Convert the function to be data-driven, then add cases for ranges with
limits INT_MIN, INT_MAX and zero to check for overflows in the
painting code. Speed up the function by removing the per-iteration
qWait() call and rely solely on the existing QTRY_VERIFY() to do the
right thing.
Change-Id: I6d2a2c2b7637fca7ddb2a9adc5f6550f8255da14
Reviewed-by: David Faure <david.faure@kdab.com>
QLineEdit, QAbstractSpinBox and QComboBox did not notify micro focus
changes to the input context.
In particular, the updates were missed during pre-edit stage.
This change adds the missing bindings to QWidget::updateMicroFocus().
Change-Id: I9a7fff962f46dbabd8fb02836c206bace115793b
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
I didn't even try to understand what the old code was trying to do;
once you're told by a user that the code is wrong, you see that it is.
Fixed by just using the row as passed to takeRow() instead of trying
to do some storage-index calculations. The m_matrix indexing operator
does it all for us.
Added a test that checks that the expected field widget gets
returned. Fixed expected test data that was wrong, and just checking
that the implementation behaves as implemented, instead of as
documented.
Amends change 8fbae648db.
[ChangeLog][QtWidget][QFormLayout] The functions takeRow() and
removeRow(), new in 5.8.0, now take and remove the correct row.
Task-number: QTBUG-58693
Task-number: QTBUG-15990
Change-Id: I7185ccbc6c03e2579741cad5c0c821d3ed165474
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The setData method of an item view would get an incorrect value of a
QDialog's result. This patch changes the order of functions called to
fix that.
[ChangeLog][QtWidgets][QDialog] Fixed a bug where accessing the result
of QDialog's result could yield an incorrect value in some situation
like using it as a delegate for item views.
Task-number: QTBUG-6018
Task-number: QTBUG-12156
Task-number: QTBUG-14430
Change-Id: I6ee4b6e8cacf6a806631c05c6c5dbcff925df65e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
As explained in
https://blogs.kde.org/2009/03/26/how-crash-almost-every-qtkde-application-and-how-fix-it-0
creating dialogs on the stack is a bad idea if the
application or the dialog's parent window can be closed
by means other than user interaction (such as a timer or
an IPC call). Since we cannot know whether Qt is used to
build such an application, we must assume it is, create
the dialog on the heap, and monitor its lifetime with a
QPointer.
Instead of using manual resource management, add a
minimal implementation of QAutoPointer, and use that in
all static get*() functions.
Task-number: QTBUG-54693
Change-Id: I6157dca18608e02be1ea2c2defbc31641defc9d1
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: David Faure <david.faure@kdab.com>
In some situations, this allows for nicer code. It's also possible to
make this constexpr in C++11, whereas the mutable transpose() would
require C++14-style constexpr.
The new function should also be faster, since it just swaps the member
variables.
Because of constexpr-function limitations, the way the return value is
constructed needs to depend on the level of the compiler's C++11 support.
This is not the only class that requires uniform init to provide a fully
constexpr interface (QUuid and QBasicAtomic come to mind), so this should
probably be generalized across Qt at some point.
Added tests.
[ChangeLog][QtWidgets][QSizePolicy] Added transposed() method.
Change-Id: Ic1077a0d5a861e7c63bd1daeeb42b97c3a2f71ef
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Also add a basic test for constexpr expressions involving QSizePolicy.
GCC < 4.8.0 has problems with initializing variant members in constexpr ctors:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54922
Instead of revoking its Q_COMPILER_CONSTEXPR, which is a source-incompatible
change, simply note the fact so we can selectively provide constexpr for
QSizePolicy.
Change-Id: Iba8e5a7cdf847d73e8e2b6bb6211fb3c9846aa0a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The char* returned from QTest::toString() calls must be manually
delete[]ed.
Change-Id: Iad078e8741e3e97693b1a417693f414b3fb3ec09
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Taken QTreeWidgetItems need to be deleted, as do items
created without a parent, and widgets without parent.
Change-Id: I7ffa69903af9a1b92ba308f9f9416aec1d6d975f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
... for calculated test data names.
That involved removing the leading ", " from test name literals
(folding it into the format string) and porting from some QString code
to QByteArray to make the result usable with addRow(), which does not
support %ls...
Change-Id: Icb2344778203f10939ae46b9e46872101f3878a9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The regression was introduced in d8857f21ac. The original change was
meant to fix support for SVG icons, but failed to take into account
a valid QIcon with no sizes, but which is also unable to create
a pixmap for the requested size.
Task-number: QTBUG-58344
Change-Id: I7ac1dbfaf6e3dab8581fe4b33c814e2517fcdba8
Reviewed-by: Andy Shaw <andy.shaw@qt.io>