Cleanup the QtWidgets animation examples:
- use nullptr
- use normalized includes, remove unused includes
- fix style
- fix crash of sub-attaq when the game ended (error during range-based
for loop porting)
- don't use keyword 'final' for a variable name
Change-Id: Id23be8ff8b1b310da005d13c052fe547f6a0d63a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The QVector dirtyOnScreenWidgets was aggregated by pointer, which
makes no sense, as a QVector is just as large as a pointer (and even
in Qt 6, when it will be larger, it's not going to be horrible). But
this complicated the code quite a bit.
Aggregate by value instead (it's just one of three such vectors now).
Drive-by fixes:
- use QVector::removeAll() instead of rolling your own
- port two indexed loops to ranged ones. In the first case, it's safe,
as the loop body clearly doesn't touch the iteratee (it's just a
std::accumulate). In the second, the question no longer applies, as
we're now using a consume loop.
Change-Id: Icd4ac13bb4a6f9a783f0adf2fb6a5bdfacd1f91a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
There's really no reason for it to be out-of-line, and we're going to
use it in QBezier::split(), which is inline, and we want the optimizer
to have a field day with the source, without a compiler firewall in
the way.
Change-Id: I49ae3a87fcce1e2dc87a9081f567503e5a98ef6b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Qt has traditionally considered Windows shortcut files equivalent to
symlinks on Unix file systems. Because of NTFS symlinks, the
interpretation of shotcut files as symlinks is confusing.
In this change, QFileInfo treats shortcut (.lnk) files as regular files
but can follow the pointed object.
In addition, QFileInfo introduces a more comprehensive file type. So
that applications can make well-informed decisions about how to treat a
file system entry.
Based on the implementation of QFileInfo::type(), two inline helper
functions are introduced to QFileInfo.
1. isSymbolicLink, returns true if it points to a symbolic link.
2. isShortcut, returns true if it points to a shortcut.
[ChangeLog][QtCore][QFileInfo] Introduce QFileInfo::type() to replace
the isSymLink method.
Task-number: QTBUG-75869
Change-Id: Icc0dd52f9ad0ea50b0265d77ee0d0a3d25054e39
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Amends 94d7603d51.
The port from QVector<QPlatformTextureList*> to a container of
unique_ptr<QPlatformTextureList> uncovered that QPlatformTextureList
isn't defined for QT_NO_OPENGL builds.
Some unguarded forward-declarations made the old declaration compile
by accident. The new code caught this, so add the #ifdef that had been
missing all along.
Change-Id: If3b14fc24007b1c917a41ab83343c2e5e65fc643
Reviewed-by: Martin Storsjö <martin@martin.st>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@qbc.io>
It is a bit frustrating that all the initialization and cleanup code
are not in the QTLWExtra ctor and dtor. But that is for another patch.
Change-Id: I0e45f89c1a53eb2f9a5699d3fbbef1a628b55432
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Despite the name, it's fully owned by an individual QWidget object.
Also make the member mutable, so we can remove the const_cast hack in
QWidgetPrivate::shareContext(), and protect QT_NO_OPENGL builds, since
the naked pointer compiled by chance due to some unguarded forward
declarations while a unique_ptr will somewhere want to call the dtor,
which doesn't compile on an object of merely forward-declared type.
Change-Id: If8027b55d303822236fcdc1a79e4f3010967b4d2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
features.animation and features.scroller depend on the feature.
In total, this saves around 180KB from QtCore and 75KB from QtWidgets.
Change-Id: I65aac3ec4d50d62424ee33f44b99f3cfb91121d6
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
In Windows-msys syncqt.pl expects CRLF line endings, and does not
work correctly with LF. syncqt.pl was fixed to be line-ending-agnostic.
Task-number: QTBUG-77192
Change-Id: Ie8029238bdd580bcf042ede0d0f64d5f01488406
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
I wonder whether a QIcon could be aggregated here by value,
as it has a null state and its default ctor sets d = nullptr.
Change-Id: I7a0f46e9fdd51a93afb5db768d46d93b08f307ec
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Use a vector<unique_ptr> (QVector cannot hold move-only classes), adapt
to different API.
Change-Id: Iece4b1bfcb35a02aac05935963e1e7f8c986b18d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Turns out that kern.uuid is not as unique as we thought. Googling for
mine finds other instances of the same being used.
Fixes: QTBUG-75371
Change-Id: I95ecabe2f50e450c991afffd159850cc975ec0da
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
...with a failing test case for QTBUG-77299.
Task-number: QTBUG-77299
Change-Id: I42c4fc4bb96f8660f8ff9bea97e6096ca6cec972
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Add Options flags similar to QFileDialog:
- DontWatch: Do not use file system watchers for simple
use cases like line edit completion. This brings it
closer to QDirModel, which then can be deprecated.
- DontResolveSymlinks: Similar to
QFileDialog::DontResolveSymlinks.
- DontUseCustomDirectoryIcons: matching
QFileIconProvider::DontUseCustomDirectoryIcons for
convenience.
Task-number: QTBUG-76493
Change-Id: I09d3cb73ef902a700e6ebfba427e2d990fce4b4c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
With things like sample count reducing a format (16 -> 8 -> 4 -> ...)
and trying again is perfectly fine. There is no need to show warnings
in this case. Even some of our own examples in qtdeclarative do a
setSamples(16) which is rarely supported. These all show warnings since
8ec98fc2dc. Avoid this.
Change-Id: Ice83d5720b02e92f77cfd63918c98ad222513b6a
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
With GLES both point sprites and gl_PointSize in the vertex shader
are implcitly enabled, but OpenGL has these as optional and must be
enabled explicitly.
Change-Id: I48cf6134f6bbd721cb938e2cad82d255cf4fb2cd
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Switching TexImage2D to the sized internal format was a bad idea.
Go with what we do without the RHI in QtGui and elsewhere, and just
pass the unsized GL_RGBA or GL_BGRA.
Change-Id: I8216c0e49813355fa5e2594b24f06c64bc8e3873
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Adjusting the size is not very useful on its own. Leave it to Qt Quick
or whoever provides the data to scale the source image data as they see
fit.
This is also more in line with other backends.
While we are at it, update the feature flag documentation. It applies
both to the repeat wrap mode and filtering modes other than nearest
and linear (i.e. mipmapping).
Change-Id: Ie28f1436b862335efeac042dc21e09189f46e626
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
...due to setting the unsupported texture compare mode. This keeps
wasm happy (gl errors show up in the console there).
Change-Id: I5de8bce8e793c709272f3df499d2320c7b07ff71
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Avoid unreasonable threshold values for extremely wide pens, since
that can lead to a very high processing cost.
The rare usecases where this would make a noticeable difference will
necessarily also be using scaling, and so is anyway depending on
setting a suitable curve threshold manually.
Fixes: QTBUG-77241
Change-Id: I27cea7d566d144389bb430739fde4f6033c4a28c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
/OPT:REF is enabled for release builds for MSVC by default,
however, clang-cl may not enable it without this flag,
add it to MSVC's mkspec so that all compilers based on MSVC
can benefit from it as well.
Change-Id: Ia80c20a8510cfa1e4687e39104ce99b37a2aa13f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Some servers seem to be unable to properly calculate our window size
from a delta we send via WINDOW_UPDATE frame immediately after our
client preface and the SETTINGS frame. The remote replies with a
GOAWAY frame blaming flow control error. Guessing what's this
magic number they use seems to be not feasible, we now use a
half of what we had before.
Fixes: QTBUG-77308
Change-Id: I41dacfd25a395a27003f330d01b6d8d60b8f407c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
When running Qt autotests on a developer machine with a high
resolution, failures occur due to either some widget becoming too
small, some rounding fuzz appearing when Qt High DPI scaling is active,
or some test taking screenshots failing to deal with device pixel
ratios != 1 in the obtained pixmaps.
It is not feasible to adapt all tests to pass on high resolution
monitors in both modes (Qt High DPI scaling enabled/disabled). It
should be possible to specify the High DPI setting per test.
Previously, it was not possible to set the Qt High DPI scaling
attributes since they must be applied before QApplication
instantiation.
Enable this by checking for the presence of a static void initMain()
function on the test object and invoking it before QApplication
instantiation.
Prototypically use it in tst_qtimer and to turn off High DPI scaling for
tst_QGL.
[ChangeLog][QtTestLib] It is now possible to perform static
initialization before QApplication instantiation by implementing a
initMain() function in the test class.
Change-Id: Idec0134b189710a14c41a451fa8445bc0c5b1cf3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
QTreeView allowed to set the sort column to -1 which shows the data in
it's natural order (when the model supports it). This functionality was
removed during the porting away from the deprecated sortByColumn(int)
functionality done in d0f909f8db
Readd the functionality and also allow it for QTableView.
Fixes: QTBUG-77419
Change-Id: I96b0c09ab9da36ca0a9de58fe0f37e2c56b1d51b
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: David Faure <david.faure@kdab.com>
No point in warning on every application startup that framebuffer size
setting is not available. Just ignore it then.
Change-Id: Id36ff0ab9560b99cc3f2d56a4ee51455cfa43cb7
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Reduces the number of warnings when building a bit.
Change-Id: I18e9a95a211736f18876405ba3d866f704e4dbe0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Add a boolean watch property and delay-create the file system watcher
in watchPaths(). De-inline the watchedFiles(), watchedDirectories(),
watchPaths(), unwatchPaths() helpers and a check for the watcher.
Task-number: QTBUG-76493
Change-Id: Ie02ac496c8c0246be62bc67ff7e0fcdb990b5ca6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This functionality is especially convenient if meta-object system is
heavily used in a test. For example, if you need to test a bunch of
signals based on their names and/or argument types.
Change-Id: I09a4ecbbd3d0859b5fd466d9dde7679804eb7614
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
After comparing colorspaces was remove from QImage equality, the test
was no longer testing what it was supposed to.
Change-Id: Ie7ee8ac2f488ea4254086cbb91a2662dc729e80b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
... in case of a test failure. QAutoPointer is private API, but here we can use it.
Change-Id: I45b734385cd13fdea95d0100f2d8152f969612f9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Write a local mutex locker for DRY. Use qt_unique_lock(Mutex*) because
we do not intend to add a QRecursiveMutexLocker and by Qt 6, the
current work-around where QMutexLocker works for QRecursiveMutex, too,
will be gone.
Could have used qt_scoped_lock, because no premature unlock() calls
are present, but it turns out the code attempts to take the mutex
after it's destroyed by Q_GLOBAL_STATIC, so we need QMutexLocker
compat, thus qt_unique_lock(Mutex*) instead of qt_scoped_lock(Mutex&).
Need to use decltype and using because auto doesn't work for NSDMs.
Change-Id: I8b0f8a3067f0a412279d075cb959105e485789cd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
It doesn't work since it relies on cups to do the heavy lifting and cups
is not used when printing to PDF
Task-number: QTBUG-77351
Change-Id: I1bdda58b50112b9bb3d7991f3cfd860d6b4f4fc4
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>