! A convenience function which returns the coordinate range of the provided \a axis, that this selection rect currently encompasses. */
| 2861 | selection rect currently encompasses. |
| 2862 | */ |
| 2863 | QCPRange QCPSelectionRect::range(const QCPAxis *axis) const |
| 2864 | { |
| 2865 | if (axis) |
| 2866 | { |
| 2867 | if (axis->orientation() == Qt::Horizontal) |
| 2868 | return {axis->pixelToCoord(mRect.left()), axis->pixelToCoord(mRect.left()+mRect.width())}; |
| 2869 | else |
| 2870 | return {axis->pixelToCoord(mRect.top()+mRect.height()), axis->pixelToCoord(mRect.top())}; |
| 2871 | } else |
| 2872 | { |
| 2873 | qDebug() << Q_FUNC_INFO << "called with axis zero"; |
| 2874 | return {}; |
| 2875 | } |
| 2876 | } |
| 2877 | |
| 2878 | /*! |
| 2879 | Sets the pen that will be used to draw the selection rect outline. |
no test coverage detected