From 95946222e6615cdf731f266530d4dc2db0f28a92 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Thu, 6 Aug 2020 18:53:12 +0300 Subject: QtFontStyle: Add missing const to non-mutable operators and once I touch these lines anyways, either add noexcept ;) Fixes-up 8bdbb7f2267 Change-Id: Ibfaedcff82c041293220408ab7ae739b3cbd2a4f Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfontdatabase_p.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gui/text/qfontdatabase_p.h b/src/gui/text/qfontdatabase_p.h index fba40e9133..5aff36d5cf 100644 --- a/src/gui/text/qfontdatabase_p.h +++ b/src/gui/text/qfontdatabase_p.h @@ -116,18 +116,18 @@ struct Q_GUI_EXPORT QtFontStyle signed int weight : 8; signed int stretch : 12; - bool operator==(const Key &other) + bool operator==(const Key &other) const noexcept { return (style == other.style && weight == other.weight && (stretch == 0 || other.stretch == 0 || stretch == other.stretch)); } - bool operator!=(const Key &other) + bool operator!=(const Key &other) const noexcept { return !operator==(other); } - bool operator<(const Key &o) + bool operator<(const Key &o) const noexcept { int x = (style << 12) + (weight << 14) + stretch; int y = (o.style << 12) + (o.weight << 14) + o.stretch; -- cgit v1.2.3