! 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
| 408 | \note this function hides the non-virtual base class implementation. |
| 409 | */ |
| 410 | bool QCPPainter::begin(QPaintDevice *device) |
| 411 | { |
| 412 | bool result = QPainter::begin(device); |
| 413 | #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. |
| 414 | if (result) |
| 415 | setRenderHint(QPainter::NonCosmeticDefaultPen); |
| 416 | #endif |
| 417 | return result; |
| 418 | } |
| 419 | |
| 420 | /*! \overload |
| 421 |