Mark QSimplex{,Constraint} final, AnchorData non-copyable

These final touch-ups for CID 390828 make the code easier to
understand and safer, because more unsafe operations are now forbidden
(subclassing and copying).

Coverity-Id: 390828
Pick-to: 6.8 6.5
Change-Id: I2e43be71d8c3db59d95e69ec16c41c1547a2f180
Reviewed-by: Magdalena Stojek <magdalena.stojek@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 912388b3068e831e4fbd9b3c31a62c79ee91c72d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2025-03-12 15:09:46 +01:00 committed by Qt Cherry-pick Bot
parent 3d0243711e
commit 05cab5fdac
2 changed files with 6 additions and 2 deletions

View File

@ -75,6 +75,8 @@ struct AnchorVertex
Represents an edge (anchor) in the internal graph.
*/
struct AnchorData : public QSimplexVariable {
Q_DISABLE_COPY_MOVE(AnchorData)
enum Type {
Normal = 0,
Sequential,

View File

@ -43,8 +43,10 @@ struct QSimplexVariable
Where (ci, Xi) are the pairs in "variables" and K the real "constant".
*/
struct QSimplexConstraint
struct QSimplexConstraint final
{
Q_DISABLE_COPY_MOVE(QSimplexConstraint)
QSimplexConstraint() : constant(0), ratio(Equal), artificial(nullptr) {}
enum Ratio {
@ -109,7 +111,7 @@ struct QSimplexConstraint
#endif
};
class QSimplex
class QSimplex final
{
Q_DISABLE_COPY_MOVE(QSimplex)
public: