! Sets the QPainter::NonCosmeticDefaultPen in Qt versions before Qt5 after beginning painting on \a device. This is necessary to get cosmetic pen consistency across Qt versions, because since Qt5, all pens are non-cosmetic by default, and in Qt4 this render hint must be set to get that behaviour. The Constructor \ref QCPPainter(QPaintDevice *device) which directly starts painting also
| 419 | \note this function hides the non-virtual base class implementation. |
| 420 | */ |
| 421 | bool QCPPainter::begin(QPaintDevice *device) |
| 422 | { |
| 423 | bool result = QPainter::begin(device); |
| 424 | #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) // before Qt5, default pens used to be cosmetic if NonCosmeticDefaultPen flag isn't set. So we set it to get consistency across Qt versions. |
| 425 | if (result) |
| 426 | setRenderHint(QPainter::NonCosmeticDefaultPen); |
| 427 | #endif |
| 428 | return result; |
| 429 | } |
| 430 | |
| 431 | /*! \overload |
| 432 |