! \internal Returns the hit box in pixel coordinates that will be used for data selection with the selection rect (\ref selectTestRect), of the data point given by \a it. */
| 27074 | rect (\ref selectTestRect), of the data point given by \a it. |
| 27075 | */ |
| 27076 | QRectF QCPFinancial::selectionHitBox(QCPFinancialDataContainer::const_iterator it) const |
| 27077 | { |
| 27078 | QCPAxis *keyAxis = mKeyAxis.data(); |
| 27079 | QCPAxis *valueAxis = mValueAxis.data(); |
| 27080 | if (!keyAxis || !valueAxis) { qDebug() << Q_FUNC_INFO << "invalid key or value axis"; return QRectF(); } |
| 27081 | |
| 27082 | double keyPixel = keyAxis->coordToPixel(it->key); |
| 27083 | double highPixel = valueAxis->coordToPixel(it->high); |
| 27084 | double lowPixel = valueAxis->coordToPixel(it->low); |
| 27085 | double keyWidthPixels = keyPixel-keyAxis->coordToPixel(it->key-mWidth*0.5); |
| 27086 | if (keyAxis->orientation() == Qt::Horizontal) |
| 27087 | return QRectF(keyPixel-keyWidthPixels, highPixel, keyWidthPixels*2, lowPixel-highPixel).normalized(); |
| 27088 | else |
| 27089 | return QRectF(highPixel, keyPixel-keyWidthPixels, lowPixel-highPixel, keyWidthPixels*2).normalized(); |
| 27090 | } |
| 27091 | /* end of 'src/plottables/plottable-financial.cpp' */ |
| 27092 | |
| 27093 |
nothing calls this directly
no test coverage detected