QHeaderView::dataChanged() did not check for the modified roles which
lead to unneeded size calculations even if the size did not change.
Avoid it by only looking at the relevant roles (DisplayRole, DecorationRole,
SizeHintRole and FontRole).
[ChangeLog][QtWidgets][QHeaderView] dataChanged now respects the given
roles to avoid useless recomputations
Fixes: QTBUG-71172
Change-Id: I0de53897347a72bddc425ae1fae8f2560ad0e977
Reviewed-by: David Faure <david.faure@kdab.com>
QHeaderView::initializeSections() was calling updateHiddenSections()
with wrong parameters which lead to an inconsistency in the hidden
section handling.
updateHiddenSections() needs the first and last index which got removed.
Therefore we must pass the new section count for logicalFirst.
Fixes: QTBUG-55461
Change-Id: Ica06125cf19bdd500f55fd9cd59ace1795f3703f
Reviewed-by: David Faure <david.faure@kdab.com>
Add a new function to return the underlying model to avoid code
duplication and make the code more readable. Also replace some 0 with
nullptr.
Change-Id: I1ca33de6f26b4e36f46ce7d2eacc45d0799478a3
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Since the comma character was originally used as a separator, we
need to extend QFont to have setFamilies() so that we can avoid
joining the family strings together. This enables us to see the
family name as a single string and for multiple family names,
we have families().
Subsequently, this has added functions to QTextCharFormat to
account for multiple font families too. So it is now possible to
set a single one directly with setFontFamily() and multiple ones
with setFontFamilies().
This also bumps up the datastream version to 19 as QFont now
streams the families list as well.
[ChangeLog][QtGui][QFont] Add setFamilies()/families() to aid using of font families with commas and quotes in their name.
[ChangeLog][Important Behavior Changes] QDataStream version bumped up to 19 to account for changes in the serialization of QFont.
Fixes: QTBUG-46322
Change-Id: Iee9f715e47544a7a705c7f36401aba216a7d42b0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
There's no good reason to use non-temporal stores. Images may be 100x
bigger than strings, but they're not so big that the non-temporal stores
make sense.
Patch-By: Allan Sandfeld Jensen <allan.jensen@qt.io>
Change-Id: Iba4b5c183776497d8ee1fffd156380ec9103ef1a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Compilers can optimize memcpy, so don't try to be too smart.
Change-Id: Iba4b5c183776497d8ee1fffd156455b50de65182
Patch-By: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
It's not used anywhere.
Patch-By: Allan Sandfeld Jensen <allan.jensen@qt.io>
Change-Id: Iba4b5c183776497d8ee1fffd1564559d6502a6f5
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
They were just calling a function, may as well just call said function
directly.
Change-Id: I343f2beed55440a7ac0bfffd15636b183c1a420f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
It's not actually exercised by anything in our source tree, but is
potentially useful and has been part of the documented public API for
some time. So mention that the caller is responsible for delete[]ing
its return and add a test that exercises it.
Task-number: QTPM-1385
Change-Id: Ifc5284b9eb1b678cf3c9708c681311e874838fc6
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Add an option that moves windows back to the top left corner,
which is useful when some window (of some application saving its
position) is lost after changing the monitor setup.
Change-Id: If358b1ed7f481f2bb98e375e88f11049f97a4a91
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
For some reason some Visuals with semi-transparency incorrectly reports
a depth of 24.
Change-Id: If41ba1032fbe7d248f53f735cb84e61038b3300a
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
This allows a user to efficiently watch for services with a common
domain prefix.
This is exposed in the API via a wildcard character in the service name.
For example creating a watcher on "org.mpris*" will match
"org.mpris.foo" "org.mpris.bar" and "org.mpris" itself. It will not
match org.mprisasdf.
Internally the argument match rules have been expanded from a single
QStringList to a struct containing args and arg0namespace. This was done
so that we can easily use argpath in match rules in the future.
Change-Id: I55882ab603cc6ba478e8c0ea9a6800f6e483a50c
Reviewed-by: Kai Uwe Broulik <kde@privat.broulik.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: David Faure <david.faure@kdab.com>
This avoids memory allocation and data copying in e.g.
QObject::property().
Detected by heaptrack's "Temporary allocations" counter in an
application using the breeze widget style (many animations).
Change-Id: Iabdb58a3e504cb121cce906ef707b0722de89df6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
No need to make a QStyleOptionButton copy, we can just use the pointer
we already have
Change-Id: I3ef5f59eb4fe25adf675e67ebf548f4358456379
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
It expands to the same thing in all three branches.
Change-Id: I343f2beed55440a7ac0bfffd15636a8bfd8fd21c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Implemented a new proxy model to transpose the source model.
Rows will become columns and vice-versa.
Both flat and tree models supported.
[ChangeLog][QtCore] New class QTransposeProxyModel to
swap rows and columns of the source model.
Change-Id: I902963c6b81aa0f63b5ad2bddca538f28b565084
Reviewed-by: David Faure <david.faure@kdab.com>
Replace BackgroundColorRole/TextColorRole with
BackgroundRole/ForegroundRole and explicit deprecate them for 5.13
Change-Id: I6b0d99844a32d2f5fdfd1878317a7b7422b800d3
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Replace all occurrences of QApplication::set/resetOverrideCursor with
the QGuiApplication::set/resetOverrideCursor since it's a static
function of QGuiApplication.
Change-Id: Ic898ab50a7ad4ed2bc9c6acb26cf4a979c2f82af
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
QAbstractOpenGLFunctions must not be copied but the copy and assignment
operators were not marked as deleted.
Add Q_DISABLE_COPY to prevent an accidentally copy.
Fixes: QTBUG-71422
Change-Id: I5fa508bc76a4142a4404d3529720e717b7f7fd41
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Niels Dekker
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The three public functions heightForWidth/minimumSizeHint/sizeHint were
accidentally marked as protected in QCommandLinkButton.
This patch makes sure it get fixed with Qt6.
Fixes: QTBUG-68722
Change-Id: I577e48cbe9274c8506a555dae1ec81044a889d6e
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This part was accidently left disabling after testing the
fallback still worked.
Change-Id: Ic2df939753641a9771e68bc8857c570d356cff44
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This update eliminates ALL parsing errors when clang parses the
Qt headers to build the precompiled header qdoc needs. These errors
are often cases where an old use of Q_QDOC no longer works because
clang sees the enclosed fake declarations as erroneous.
In a few cases, clang reported errors because two dummy function
declartations under the Q_CLANG_QDOC guard were indistinguishable,
so one of them was removed, and the documentation was patched
accordingly.
Using the macro Q_DECLARE_INTERFACE(...) causes clang to report errors
because the class parametewr is abstract. These uses of the macro are
not needed, so they are removed with #ifndef Q_CLANG_QDOC.
Some declarations of default GL types that had been provided for qdoc
were no longer needed, so they are removed.
Now there are some member function signatures in QDBusPendingReply
and QDBusPendingCall that have very long template clauses and qualifiers
in their signatures. These unwieldy signatures will be unnecessary in the
documentation and will look bad there, but for now they are correct. The
ultimate solution will be to add a metacommand to qdoc, something like
\simplify-signature to tell qdoc to generate the documentation for these
member functions without the long template caluses and qualifiers.
Change-Id: I012cf17a544fbba2ebc71002f31bdc865119bb8e
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Martin Smith <martin.smith@qt.io>
It appears we are missing some setups for SIMD optimization, and already
have a workaround for that for NEON, so do the same for VSX.
Fixes: QTBUG-66388
Change-Id: I1cc1d0fe9c5a9df97acb589d29dec4dceb8fc576
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Marking various as final because no upstream is known or available.
Listing versions of others, where I was able to discover them.
Updated a stale link (that helpfully redirected).
Task-number: QTBUG-70008
Change-Id: Id00f34827133c560735c68793b4f1353f2b2ca85
Reviewed-by: Tobias Koenig <tobias.koenig@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The tests would rely on the window manager giving it focus a bit too much.
Change-Id: I1b28def2c95a4f0a9665a7cf6e0c14db03df98d5
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
tst_QSqlQuery::bindBool() did not check if the bool is correctly bound
as part of the WHERE statement. Add a new test to query for the bool
column and check if there is exactly one row returned.
Fixes: QTBUG-38891
Change-Id: I0bd1ceb1b30e50f67f44f5b06d68683195b78b29
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
When QMimeProvider parses the shared mime database xml files,
it will read the <comment> element for mime comment and treat the
`xml:lang` attribute as locale language string. When no `xml:lang`
attr is provided, QMimeProvider will read the value and treat it as
a en_US locale string as the default key.
When we call QMimeType::comment(), it will try to get the locale
comment string with the default language (QLocale().name()), once
it can't find a matched result, it should return the default key
(which QMimeProvider set it as en_US locale before) as fallback.
Task-number: QTBUG-71314
Change-Id: I444f8159d6f19dfef6338cd79312f608d8f13394
Reviewed-by: David Faure <david.faure@kdab.com>
A hardcoded value of 16 was used in QColorDialogPrivate::_q_addCustom()
instead QColorDialogOptions::customColorCount()
Fixes: QTBUG-58425
Change-Id: I7ae9881abd5926e0c6b118d5c84c3f259c545d35
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
QLocale::formattedDataSize() was not marked const when it was added
although the function is const.
Add a const overload and mark the non-const version as deprecated and
remove it with Qt6
Fixes: QTBUG-71445
Change-Id: I56d051d9928b5e00cdaca7a874c543fed27a888d
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
QTableWidget::isItemSelected/setItemSelected() are deprecated for a
long time but not marked as such. Therefore explicitly mark them as
deprecated so they can get removed with Qt6.
Change-Id: I77fffe2786751306115c3f5da0ef98ff84e35b1a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
QTreeView/TableView::sortByColumn(int) was deprecated a long time ago
but never got removed. Therefore mark it with QT_DEPRECATED_SINCE(5, 13)
so we can remove it with Qt6.
Also sync the handling of the sort order changes in QTableView with the
one from QTreeView.
Change-Id: I0371d9a9c21116edaa9125835827f1a200075d36
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
QTreeView only had functions to either expand all items or until a given
depth. What was missing is to expand all subitems for an index
programmatically which is added with this patch.
[ChangeLog][QtWidgets][QTreeView] Added expandRecursively() to expand
all items below a given index
Fixes: QTBUG-10482
Change-Id: I8fc4d50b0b7e90245840c99a0188f13c0670253a
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Attempts to use QSslSocket and its OpenSSL 1.1 back-end with OpenSSL 1.1.1
in a very peculiar way (for some reason the reporter calls OPENSSL_no_config())
combined with a bug in OpenSSL 1.1.1 resulted in a QSslSocket dead-locking
in initialization. This was happening because supportsSsl() first reported
false (OpenSSL internally fails to initialize after OPENSSL_no_config()),
but we have s_libraryLoaded set to true too early, thus the first supportsSsl()
returns false, the second - true.
Move setting of s_libraryLoaded later so that we don't claim to support
OpenSSL when an earlier ensureLibraryLoaded() attempt failed.
Task-number: QTBUG-70956
Task-number: QTBUG-71446
Change-Id: I8ad8763d357c84fc38c62e2ce914366367c2b445
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
freetype is included depending on configuration by the top level .pro
file.
Fix build warning:
Makefile:1361: warning: ignoring old commands for target `.obj/qfontengine_ft.o'
Change-Id: I0a0f111a841b368196633bbc0f9c698197f64bb2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Preparing the use of the option for Python.
Task-number: PYSIDE-797
Change-Id: Ia1267b227ceac7f9dcbcfde6ed7c1480ef790f2a
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Follow the pattern of char and float, and treat shorts as a more generic
type in QVariant::canConvert()
Task-number: QTBUG-60914
Change-Id: Ib1cc7941ee47cb0fc0098f22f98a03cd6f6b63fe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use function name overloading for all of _NET_WM_STATE setters for
a mapped window, instead of few similar sounding functions, where all
do the same thing. For an unmapped window rename updateNetWmStateBeforeMap()
-> setNetWmStateOnUnmappedWindow(). Merge setNetWmStates(NetWmStates) into
setNetWmStateOnUnmappedWindow() and add a comment explaining why it does
what it does, as it was not obvious.
Internally there are 2 variants:
a) When a window is already mapped, to change the window state we send
XCB_CLIENT_MESSAGE(_NET_WM_STATE) messages to the root window as per EWMH
spec. The Window Manager MUST keep this property updated to reflect the
current state of the window. If this variant of the overload is called
while a window is not mapped yet, it does nothing. WM would ignore this
message anyway. The state change is not lost, it will be set later and
that is where the second variant comes in.
b) On an unmapped window we can set _NET_WM_STATE by using setNetWmStateOnUnmappedWindow().
This function will read QWindow properties and set all of them via one
xcb_change_property(_NET_WM_STATE) call. We do this inside QXcbWindow::show(),
where we know that QWindow state properties won't change anymore until
it gets mapped. Once it is mapped, we use the other variant.
This patch doesn't change any functionality, just makes the code easier
to follow.
Change-Id: I4f4703a35de083fcfd398112eabd0a5aec358e51
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
In the process, update the README's e-mail address for Simon and
mention all recognized command-line options in the usage message. The
generated CSS scanner was also out of sync with our source, so update
it. Also fixed handling of FileHeader to cope with running from a
shadow build by handling paths relative to __FILE__; and revised the
CSS3 config to use the same copyright header as was already in use by
the existing generated file.
Change-Id: I918ff84dbdc95d0478fd6aa4ea74e9a221d1a476
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Use array dereferencing notation ptr[expr] rather than the more
verbose and less readable *(ptr + expr).
Change-Id: Ie98986e7f622aa1a94f3f14bc362ed65767f9d92
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
In the process, corrected an inaccurate XFAIL message (an XPASS is
normally an error, unless blacklisting ignores it so turns it into a
BPASS). Added the missing .tap file to its expected output.
Documented the similarity to the silent/ selftest.
Task-number: QTPM-1385
Change-Id: Id74a1353d54af2f3bfe2c764e33c1f051958ab21
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
A count(T *list) was declared but not defined; and the plain count()
that was defined isn't called by anything. It's in a private header,
so can be removed without harm.
Task-number: QTPM-1385
Change-Id: I1ac580d57996895a4123b4f55fa984e9c8001ecb
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
QTest::qtest_qParseArgs() takes a needlessly mutable parameter.
This needs transient legacy version until qtdeclarative is converted
to use the const-qualified variant.
Change-Id: I19fad25423f6f1ea7d5fac537815f4f633ac4405
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>