QPaintDevice: inline keyword only on a method's declaration in-class
Putting `inline` on the definition and not the declaration could cause
some issues with some compilers, e.g. MinGW[1].
Putting `inline` on a method's declaration and definition is redundant;
I am not sure if that could cause an issue with MinGW, but just in-class
on the declaration is enough/more-idiomatic.
Amends a5953d20e2.
Found in API review.
[1] https://wiki.qt.io/Things_To_Look_Out_For_In_Reviews#Methods item
1.2
Change-Id: Ieaba422670261330b5558f60dce2fcca2cb2723b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 77f5846d213b8355d369695c68d585d0d5fa47ce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
bb10
parent
4ca0c6db5e
commit
ea138d7557
|
|
@ -21,7 +21,7 @@ QPaintDevice::~QPaintDevice()
|
|||
\internal
|
||||
*/
|
||||
// ### Qt 7: Replace this workaround mechanism: virtual devicePixelRatio() and virtual metricF()
|
||||
inline double QPaintDevice::getDecodedMetricF(PaintDeviceMetric metricA, PaintDeviceMetric metricB) const
|
||||
double QPaintDevice::getDecodedMetricF(PaintDeviceMetric metricA, PaintDeviceMetric metricB) const
|
||||
{
|
||||
qint32 buf[2];
|
||||
// The Encoded metric enum values come in pairs of one odd and one even value.
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ protected:
|
|||
virtual void initPainter(QPainter *painter) const;
|
||||
virtual QPaintDevice *redirected(QPoint *offset) const;
|
||||
virtual QPainter *sharedPainter() const;
|
||||
double getDecodedMetricF(PaintDeviceMetric metricA, PaintDeviceMetric metricB) const;
|
||||
inline double getDecodedMetricF(PaintDeviceMetric metricA, PaintDeviceMetric metricB) const;
|
||||
|
||||
ushort painters; // refcount
|
||||
private:
|
||||
|
|
@ -84,7 +84,7 @@ inline int QPaintDevice::devType() const
|
|||
inline bool QPaintDevice::paintingActive() const
|
||||
{ return painters != 0; }
|
||||
|
||||
inline int QPaintDevice::encodeMetricF(PaintDeviceMetric metric, double value)
|
||||
int QPaintDevice::encodeMetricF(PaintDeviceMetric metric, double value)
|
||||
{
|
||||
qint32 buf[2];
|
||||
Q_STATIC_ASSERT(sizeof(buf) == sizeof(double));
|
||||
|
|
|
|||
Loading…
Reference in New Issue