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 a5953d20e27ab73774058dd06ac514f9310a41e8. 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>
This commit is contained in:
parent
4ca0c6db5e
commit
ea138d7557
@ -21,7 +21,7 @@ QPaintDevice::~QPaintDevice()
|
|||||||
\internal
|
\internal
|
||||||
*/
|
*/
|
||||||
// ### Qt 7: Replace this workaround mechanism: virtual devicePixelRatio() and virtual metricF()
|
// ### 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];
|
qint32 buf[2];
|
||||||
// The Encoded metric enum values come in pairs of one odd and one even value.
|
// 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 void initPainter(QPainter *painter) const;
|
||||||
virtual QPaintDevice *redirected(QPoint *offset) const;
|
virtual QPaintDevice *redirected(QPoint *offset) const;
|
||||||
virtual QPainter *sharedPainter() const;
|
virtual QPainter *sharedPainter() const;
|
||||||
double getDecodedMetricF(PaintDeviceMetric metricA, PaintDeviceMetric metricB) const;
|
inline double getDecodedMetricF(PaintDeviceMetric metricA, PaintDeviceMetric metricB) const;
|
||||||
|
|
||||||
ushort painters; // refcount
|
ushort painters; // refcount
|
||||||
private:
|
private:
|
||||||
@ -84,7 +84,7 @@ inline int QPaintDevice::devType() const
|
|||||||
inline bool QPaintDevice::paintingActive() const
|
inline bool QPaintDevice::paintingActive() const
|
||||||
{ return painters != 0; }
|
{ return painters != 0; }
|
||||||
|
|
||||||
inline int QPaintDevice::encodeMetricF(PaintDeviceMetric metric, double value)
|
int QPaintDevice::encodeMetricF(PaintDeviceMetric metric, double value)
|
||||||
{
|
{
|
||||||
qint32 buf[2];
|
qint32 buf[2];
|
||||||
Q_STATIC_ASSERT(sizeof(buf) == sizeof(double));
|
Q_STATIC_ASSERT(sizeof(buf) == sizeof(double));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user