This reverts a limited part of commit ad2da2d27a
that deleted .pro files for snippets compilation.
Some .pro files which contain snippets used in the documentation
itself should be restored.
Task-number: QTBUG-90483
Change-Id: I1b03833c8ff17b5fca43a5b6c5417e8545b1711b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
For some use cases, vertical subpixel positioning may be
useful, as it allows you to vertically align text with
other painting primitives. This does impose an overhead,
so we make it opt-int with a render hint on the painter.
Note that this is only supported on Freetype currently.
It might be possible to support on older macOS versions,
prior to Mojave (which has disabled subpixel positioning
entirely), but since it would have limited usefulness
and Freetype is cross-platform anyway, I skipped that.
Note: This drive-by-fixes an issue with subpixel
positioning where glyphs would always be offset by 1/64,
because we added the aliasing offset *after* we had
determined the closest subpixel position. The idea of
this, as far as I can understand, is rather to snap to
nearest subpixel position upwards, not to add an offset
to all glyphs, so it should be added before finding the
correct position. It had a subtle visual effect when
animating the position. It might be that we could get
rid of it entirely, as I haven't been able to reproduce
any issues with that, but I have moved it instead, to
match what I believe the intention was.
[ChangeLog][QtGui][Text] Added render hint flag
QPainter::VerticalSubpixelPositioning which will position
text at subpixel positions vertically whenever supported.
In absence of this, text position will be rounded
vertically as before.
Fixes: QTBUG-35682
Change-Id: I8ce7a72a64e5a0924dac7c244e3e07c2938bfd09
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Those serve no purpose anymore, now that the .pro files are gone.
Task-number: QTBUG-88742
Change-Id: I39943327b8c9871785b58e9973e4e7602371793e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Remove the qmake project files for most of Qt.
Leave the qmake project files for examples, because we still test those
in the CI to ensure qmake does not regress.
Also leave the qmake project files for utils and other minor parts that
lack CMake project files.
Task-number: QTBUG-88742
Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
- QList iterators are now nested classes inside QList.
- Drop reference to Qt OpenGL Widgets landing page, there is no such
page.
- Fix typos and linking issues.
Fixes: QTBUG-86295
Pick-to: 6.0
Change-Id: I964843deb81aa55ff8ddb9a1c2b004cb72e68de9
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
The Professional CMake book suggests always using explicit linkage with
target_link_libraries, so let's use that.
Whether to use PUBLIC or PRIVATE depends on the context. But let's
be conservative and advise on using PRIVATE by default.
Task-number: QTBUG-88935
Pick-to: 6.0
Change-Id: I12b80ee85be9f6916f1e4dea6b1c9cb29e03c20f
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This fleshes out the Qt OpenGL documentation, since this
is now a first class citizen and no longer a compatibility
module. It also adds Qt OpenGL-related info on porting
to Qt 6.
Fixes: QTBUG-88150
Change-Id: I85fcaa2eb5ae574416dcebcc0104bf97428ff42d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Use a custom module header for the documentation build that pulls in
also QtOpenGLWidgets' headers.
Fixes: QTBUG-88275
Change-Id: I4e1144b179a124b01114de24cc183289fa05fb33
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
The content in the porting guides are closer to a changelog than
a porting guide. At this point, it is easier for maintainers and
contributors to write in a changelog than a guide. This change
should help with readability and is closer to the usage of
"Changes" in documentation.
Part of a rename in other submodules.
Task-number: QTBUG-87156
Change-Id: Ib59de7976fae19e7b39962e80161df6628e4070b
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
The non-versioned one's do miss some properties. It's therefore best
to not advocate using them.
Change-Id: I53645e65ed4de4e0100e59905c024cdfe40be0c5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Make hidden friends. Also add noexcept.
No documentation to adjust.
Fixes: QTBUG-87978
Change-Id: I6e757b7c37fb8aabdfd395ab057a84696104e640
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-Qt OpenGL is part of Qt 6.0 and graphics offering
-Edited introduction
Task-number: QTBUG-87155
Change-Id: I1581d5d962c62a3731d77e4e4dd58154257dc1fe
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Move snippets to the right place, and give the widgets class a place to
live.
QtOpenGLWidgets is just a library, not a separate module, but we need a
module page that the class can refer to for correct build instructions.
Change-Id: I6d955ad3c4cd1003a828cc1f256deb6e7fb50ec4
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Those methods where only kept for BC in Qt 5.x, but were actually
asserting at runtime. Get rid of them.
Fixes: QTBUG-86475
Change-Id: I19e6e4ada22b6a4427a2cb13962792c5a3b461af
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
At the moment we have two main strategies for dealing with move
assignment in Qt:
1) move-and-swap, used by "containers" (in the broad sense): containers,
but also smart pointers and similar classes that can hold user-defined
types;
2) pure swap, used by containers that hold only memory (e.g. QString,
QByteArray, ...) as well as most implicitly shared datatypes.
Given the fact that a move assignment operator's code is just
boilerplate (whether it's move-and-swap or pure swap), provide two
_strictly internal_ macros to help write them, and apply the macros
across corelib and gui, porting away from the hand-rolled
implementations.
The rule of thumb when porting to the new macros is:
* Try to stick to the existing code behavior, unless broken
* if changing, then follow this checklist:
* if the class does not have a move constructor => pure swap
(but consider ADDING a move constructor, if possible!)
* if the class does have a move constructor, try to follow the
criteria above, namely:
* if the class holds only memory, pure swap;
* if the class may hold anything else but memory (file handles,
etc.), then move and swap.
Noteworthy details:
* some operators planned to be removed in Qt 6 were not ported;
* as drive-by, some move constructors were simplified to be using
qExchange(); others were outright broken and got fixed;
* some contained some more interesting code and were not touched.
Change-Id: Idaab3489247dcbabb6df3fa1e5286b69e1d372e9
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Modify special case locations to use the new API as well.
Clean up some stale .prev files that are not needed anymore.
Clean up some project files that are not used anymore.
Task-number: QTBUG-86815
Change-Id: I9947da921f98686023c6bb053dfcc101851276b5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Also add existing such docs to the new document group
Task-number: QTBUG-84051
Change-Id: I76f033f0846e09943f249d2beeb1606869eef382
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Enough with the restricted bool trick; use the established solution.
[ChangeLog][Potentially Source-Incompatible Changes] QScopedPointer,
QSharedPointer and QWeakPointer's conversion operator towards bool
is now explicit. In some cases this may require an explicit cast
towards bool that was not needed before (notably, when returning
an object of these types from a function that actually returns bool).
Change-Id: I02b89278e75b7e7493ee7e35460504719e00f028
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Both normal and relaxed constexpr are required by our new minimum of
C++17.
Change-Id: Ic028b88a2e7a6cb7d5925f3133b9d54859a81744
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Static builds can not rely on a constructor function in the QtOpenGL
library, as that will be linked out unless something in the application
pulls it in.
Instead we export a helper function that clients that depend on
OpenGL support in QPlatformBackingStore can use to bring it it.
Change-Id: Ic54058bf413a476287884c78df5624b862f97695
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
OpenGL is not quite as dead as initially assumed.
Task-number: QTBUG-83255
Change-Id: I953040149812a5258caad5fe6bac0835e1982dd0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The change creates a slight source incompatibility. The main
things to take care of are
* code using printf statements on list.size(). Using qsizetype in
printf statements will always require a cast to work on both 32
and 64 bit.
* A few places where overloads now get ambiguous. One example is
QRandomGenerator::bounded() that has overloads for int, uint and
double, but not int64.
* Streaming list.size() to a QDataStream will change the format
depending on the architecture.
[ChangeLog][QtCore][QList] QList now uses qsizetype to index into
elements.
Change-Id: Iaff562a4d072b97f458417b670f95971bd47cbc6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
For all of these we know in advance that the vast majority of usages
will not exceed a certain number of elements. Also, none of these are
copied or moved ever.
Change-Id: I265afec154939c2fd0d1f902d97a86315ec7bc20
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This is a commit in preparation for an upcoming change in QtQuick.
We want to store the resolved functions for managing VAOs somewhere;
the "least worst" choice is next to the all other function resolvers,
which are in QOpenGLContext(Private).
To avoid moving the VAO resolvers themselves, leave a hook in
QOGLCPrivate, similar to e.g. the texture function resolvers. The hook
gets populated when the VAO resolvers for a given context are
requested.
This removes memory management burden from the users of those functions
(again, just like other function resolvers), and makes the
initialization of the functions automatic.
Change-Id: I0eba30a85bf8ad82946a5d68e91009d8b4bd91cf
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Make QPair an alias for std::pair, and qMakePair just a forwarder
towards std::make_pair.
Why? Fundamentally to ditch a bunch of NIH code; gain for free
structured bindings, std::tuple and std::reference_wrapper
compatibility, and so on.
Breakages:
* Some that code manually forward declares QPair.
We don't care about it (<QContainerFwd> is the proper way).
* Some code that overloads on std::pair and QPair. Luckily
it's mostly centralized: debug, metatypes, testing macros.
Just remove the QPair overload.
* Usages of qMakePair forcing the template type parameters.
There are a handful of these in qtbase, but only one was actually
broken.
* std::pair is NOT (and will never likely be) trivially copiable.
This is agreed to be a mistake done by practically all implementations
in C++11, can can't be fixed without breaking ABI.
Some code using QPair assuming it's trivially copiable may break;
exactly one occurrence was in qtbase.
* QMetaType logic extracts the type names in two different ways,
one by looking at the source code string (e.g. extracted by moc)
and one via some ad-hoc reflection in C++. We need to make
"QPair" (as spelled in the source code) be the same as "std::pair"
(gathered via reflection, which will see through the alias)
when compared. The way it's already done e.g. for QList is
by actually replacing the moc-extracted name with the name
of the actual type used in C++; do the same here.
On libc++, std::pair is actually in an inline namespace --
i.e. std::__1::pair; the reflection will extract and store
"std::__1::pair" so we need an ad-hoc fix to QMetaType.
[ChangeLog][QtCore][QPair] QPair is now an alias to std::pair,
and does not exist as a class in Qt any more. This may break
code such as functions overloaded for both QPair and std::pair.
Usually, the overload taking a QPair can be safely discarded,
leaving only the one taking a std::pair. QPair API has not changed,
and qMakePair is still available for compatibility (although
new code is encouraged to use std::pair and std::make_pair
directly instead).
Change-Id: I7725c751bf23946cde577b1406e86a336c0a3dcf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Allows them to not depend on QtOpenGL just to provide the default
backing store OpenGL support backend.
Change-Id: I90d6d9247ce76848d9d03e2d512fb736c81488d3
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Qt 5.4 is not documented anymore since quite some time.
Change-Id: I6811ead502178f7acbed8cf450e42d7fd33ae29b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>