title: Custom QDial notch ticks with PyQt
body: <p>Currently I have this custom rotated <code>QDial()</code> widget with the dial handle pointing upward at the <code>0</code> position instead of the default <code>180</code> value position.</p>
  
  <p>To change the tick spacing, <code>setNotchTarget()</code> is used to space the notches but this creates an even distribution of ticks (left). I want to create a custom dial with only <strong>three</strong> adjustable ticks (right). </p>
  
  <p><a href="https://i.stack.imgur.com/Jthgw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Jthgw.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/WaJM9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WaJM9.png" alt="enter image description here"></a></p>
  
  <p>The center tick will never move and will always be at the north position at <code>0</code>. But the other two ticks can be adjustable and should be evenly spaced. So for instance, if the tick was set at <code>70</code>, it would place the left/right ticks <code>35</code> units from the center. Similarly, if the tick was changed to <code>120</code>, it would space the ticks by <code>60</code>. </p>
  
  <p><a href="https://i.stack.imgur.com/Mz4oX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Mz4oX.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/E9HPK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/E9HPK.png" alt="enter image description here"></a></p>
  
  <p>How can I do this? If this is not possible using <code>QDial()</code>, what other widget would be capable of doing this? I'm using PyQt4 and Python 3.7</p>
  
  <pre><code>import sys
  from PyQt4 import QtGui, QtCore
  
  class Dial(QtGui.QWidget):
      def __init__(self, rotation=0, parent=None):
          QtGui.QWidget.__init__(self, parent)
          self.dial = QtGui.QDial()
          self.dial.setMinimumHeight(160)
          self.dial.setNotchesVisible(True)
          # self.dial.setNotchTarget(90)
          self.dial.setMaximum(360)
          self.dial.setWrapping(True)
  
          self.label = QtGui.QLabel('0')
          self.dial.valueChanged.connect(self.label.setNum)
  
          self.view = QtGui.QGraphicsView(self)
          self.scene = QtGui.QGraphicsScene(self)
          self.view.setScene(self.scene)
          self.graphics_item = self.scene.addWidget(self.dial)
          self.graphics_item.rotate(rotation)
  
          # Make the QGraphicsView invisible
          self.view.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
          self.view.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
          self.view.setFixedHeight(self.dial.height())
          self.view.setFixedWidth(self.dial.width())
          self.view.setStyleSheet("border: 0px")
  
          self.layout = QtGui.QVBoxLayout()
          self.layout.addWidget(self.view)
          self.layout.addWidget(self.label)
          self.setLayout(self.layout)
  
  if __name__ == '__main__':
      app = QtGui.QApplication(sys.argv)
      dialexample = Dial(rotation=180)
      dialexample.show()
      sys.exit(app.exec_())
  </code></pre>