If you only want to distinguish between horizontal and vertical, you can use the following:
Qt Code:
  1. double ImageScaler::scaleFactor(RubberBands::lineType type) const{
  2. return type == RubberBands::horizontal ? _scaleFactorX : _scaleFactorY;
  3. }
To copy to clipboard, switch view to plain text mode 

Without any compiler warnings