! \copydoc QCPPlottableInterface1D::selectTestRect */
| 23825 | \copydoc QCPPlottableInterface1D::selectTestRect |
| 23826 | */ |
| 23827 | QCPDataSelection QCPBars::selectTestRect(const QRectF &rect, bool onlySelectable) const |
| 23828 | { |
| 23829 | QCPDataSelection result; |
| 23830 | if ((onlySelectable && mSelectable == QCP::stNone) || mDataContainer->isEmpty()) |
| 23831 | return result; |
| 23832 | if (!mKeyAxis || !mValueAxis) |
| 23833 | return result; |
| 23834 | |
| 23835 | QCPBarsDataContainer::const_iterator visibleBegin, visibleEnd; |
| 23836 | getVisibleDataBounds(visibleBegin, visibleEnd); |
| 23837 | |
| 23838 | for (QCPBarsDataContainer::const_iterator it=visibleBegin; it!=visibleEnd; ++it) |
| 23839 | { |
| 23840 | if (rect.intersects(getBarRect(it->key, it->value))) |
| 23841 | result.addDataRange(QCPDataRange(it-mDataContainer->constBegin(), it-mDataContainer->constBegin()+1), false); |
| 23842 | } |
| 23843 | result.simplify(); |
| 23844 | return result; |
| 23845 | } |
| 23846 | |
| 23847 | /* inherits documentation from base class */ |
| 23848 | double QCPBars::selectTest(const QPointF &pos, bool onlySelectable, QVariant *details) const |
no test coverage detected