title: QGraphicsScene/View Scale Understanding
body: <p>I'm lost with understanding the scale value of QGraphicsScene/View. </p>
  
  <p>Here is how I'm placing my targets in the scene.</p>
  
  <pre><code>QPointF Mainwindow::pointLocation(double bearing, double range){
      int offset = 90; //used to offset Cartesian system
      double centerX = baseSceneSize/2;//push my center location out to halfway point
      double centerY = baseSceneSize/2;
      double newX = centerX + qCos(qDegreesToRadians(bearing - offset)) * range;
      double newY = centerY + qSin(qDegreesToRadians(bearing - offset)) * range;
      QPointF newPoint = QPointF(newX, newY);
      return newPoint;
  
  }
  </code></pre>
  
  <p>So each target has a bearing and range. As long as I don't scale, or zoom, the scene, these values work sufficiently.  My problem is that I need to implement the zooming.</p>
  
  <p>Here's where things go wrong:</p>
  
  <p>I have a target at Bearing 270, Range 10.</p>
  
  <p>When the app runs, and my vertical slider is at a value of zero, I can see this target in my view. I should not.  I need for this target to only come into view when the slider has gotten to a value of 10.  Just think each position value on the slider equates to 1 nautical mile. So if a target is at 10 NMs it should only be visible once the slider is >= 10.</p>
  
  <p>here is how I'm doing the zooming:</p>
  
  <pre><code>void MainWindow:: on_PlotSlider_sliderMoved(int position){
      const qreal factor = 1.01;
      viewScaleValue = qPow(factor, -position);//-position to invert the scale
      QMatrix matrix;
      matrix.scale(viewScaleValue, viewScaleValue);
      view-&gt;setMatrix(matrix);
  }
  </code></pre>
  
  <p>I've tried making the View bigger, the Scene bigger, but nothing is having the proper effect.</p>
  
  <p>Here is my Scene setup:</p>
  
  <pre><code>view = ui-&gt;GraphicsView;
  scene = new QGraphicsScene(this);
  int baseSize = 355;
  scene-&gt;setSceneRect(0,0,baseSize,baseSize);
  baseSceneSize = scene-&gt;sceneRect().width();
  view-&gt;setScene(scene);
  </code></pre>
  
  <p>How do I take the range of my target and push it out into the scene so that it lines up with the slider value?</p>