Part-filled Ellipse












1















I'm currently drawing ellipses on a GraphicScene:



pen = QtGui.QPen(QtGui.QColor(QtCore.Qt.lightGray).darker(50))
for id, light in arrLights.iteritems():
angle = i*delta
circX = (w + x) * math.cos(angle)
circY = (h + y) * math.sin(angle)
item = callbackEllipse(light, hiveLight, circX, circY, w, h)
item.setAcceptHoverEvents(True)
item.setPen(pen)

if (light["status"]):
brush = QtGui.QBrush(QtGui.QColor(QtCore.Qt.lightGray))
else:
brush = QtGui.QBrush(QtGui.QColor(QtCore.Qt.lightGray).darker(150))

item.setBrush(brush)
self.scene().addItem(item)
self.writeText(light['name'], circX , circY, w, h)
i = i + 1


(callbackEllipse is a class with parent class QGraphicsEllipseItem for mouse click events)



I'm trying to work out how I can part fill these ellipses (based on a percentage) like the following images:



Ellipse





Ellipse





Ellipse





I have searched and tried a few things, such as multiple ellipse and drawn paths but this affected the click events and I lost the border of the 'unfilled' ellipse portion.



Can anyone help?










share|improve this question





























    1















    I'm currently drawing ellipses on a GraphicScene:



    pen = QtGui.QPen(QtGui.QColor(QtCore.Qt.lightGray).darker(50))
    for id, light in arrLights.iteritems():
    angle = i*delta
    circX = (w + x) * math.cos(angle)
    circY = (h + y) * math.sin(angle)
    item = callbackEllipse(light, hiveLight, circX, circY, w, h)
    item.setAcceptHoverEvents(True)
    item.setPen(pen)

    if (light["status"]):
    brush = QtGui.QBrush(QtGui.QColor(QtCore.Qt.lightGray))
    else:
    brush = QtGui.QBrush(QtGui.QColor(QtCore.Qt.lightGray).darker(150))

    item.setBrush(brush)
    self.scene().addItem(item)
    self.writeText(light['name'], circX , circY, w, h)
    i = i + 1


    (callbackEllipse is a class with parent class QGraphicsEllipseItem for mouse click events)



    I'm trying to work out how I can part fill these ellipses (based on a percentage) like the following images:



    Ellipse





    Ellipse





    Ellipse





    I have searched and tried a few things, such as multiple ellipse and drawn paths but this affected the click events and I lost the border of the 'unfilled' ellipse portion.



    Can anyone help?










    share|improve this question



























      1












      1








      1








      I'm currently drawing ellipses on a GraphicScene:



      pen = QtGui.QPen(QtGui.QColor(QtCore.Qt.lightGray).darker(50))
      for id, light in arrLights.iteritems():
      angle = i*delta
      circX = (w + x) * math.cos(angle)
      circY = (h + y) * math.sin(angle)
      item = callbackEllipse(light, hiveLight, circX, circY, w, h)
      item.setAcceptHoverEvents(True)
      item.setPen(pen)

      if (light["status"]):
      brush = QtGui.QBrush(QtGui.QColor(QtCore.Qt.lightGray))
      else:
      brush = QtGui.QBrush(QtGui.QColor(QtCore.Qt.lightGray).darker(150))

      item.setBrush(brush)
      self.scene().addItem(item)
      self.writeText(light['name'], circX , circY, w, h)
      i = i + 1


      (callbackEllipse is a class with parent class QGraphicsEllipseItem for mouse click events)



      I'm trying to work out how I can part fill these ellipses (based on a percentage) like the following images:



      Ellipse





      Ellipse





      Ellipse





      I have searched and tried a few things, such as multiple ellipse and drawn paths but this affected the click events and I lost the border of the 'unfilled' ellipse portion.



      Can anyone help?










      share|improve this question
















      I'm currently drawing ellipses on a GraphicScene:



      pen = QtGui.QPen(QtGui.QColor(QtCore.Qt.lightGray).darker(50))
      for id, light in arrLights.iteritems():
      angle = i*delta
      circX = (w + x) * math.cos(angle)
      circY = (h + y) * math.sin(angle)
      item = callbackEllipse(light, hiveLight, circX, circY, w, h)
      item.setAcceptHoverEvents(True)
      item.setPen(pen)

      if (light["status"]):
      brush = QtGui.QBrush(QtGui.QColor(QtCore.Qt.lightGray))
      else:
      brush = QtGui.QBrush(QtGui.QColor(QtCore.Qt.lightGray).darker(150))

      item.setBrush(brush)
      self.scene().addItem(item)
      self.writeText(light['name'], circX , circY, w, h)
      i = i + 1


      (callbackEllipse is a class with parent class QGraphicsEllipseItem for mouse click events)



      I'm trying to work out how I can part fill these ellipses (based on a percentage) like the following images:



      Ellipse





      Ellipse





      Ellipse





      I have searched and tried a few things, such as multiple ellipse and drawn paths but this affected the click events and I lost the border of the 'unfilled' ellipse portion.



      Can anyone help?







      python pyqt pyqt5 ellipse






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 24 '18 at 19:22









      eyllanesc

      80k103258




      80k103258










      asked Nov 24 '18 at 11:21









      xnemesisxnemesis

      474




      474
























          1 Answer
          1






          active

          oldest

          votes


















          0














          For these cases it is necessary to implement a custom item and overwrite the paint method, use QGraphicsEllipseItem as a base since it is enough to add the percentage properties and the fill color, if you want it to be repainted you must call update(). For the painting create 2 QPixmaps, the first draw the rectangle and the second the ellipse, then join them using compositionMode



          from PyQt5 import QtCore, QtGui, QtWidgets

          class CallbackEllipse(QtWidgets.QGraphicsEllipseItem):
          def __init__(self, light, *args, **kwargs):
          super(CallbackEllipse, self).__init__(*args, **kwargs)
          self._fill_brush = QtGui.QBrush(QtCore.Qt.NoBrush)
          self._percentage = 0
          self._light = light

          def setFillBrush(self, brush):
          self._fill_brush = brush
          self.update()

          def fillBrush(self):
          return self._fill_brush

          def setPercentage(self, percentage):
          self._percentage = percentage
          self.update()

          def percentage(self):
          return self._percentage

          def paint(self, painter, option, widget=None):
          painter.setPen(self.pen())
          r_in = QtCore.QRectF(QtCore.QPointF(), self.rect().size())
          r_out = QtCore.QRectF(r_in)
          r_out.setTop((1-self.percentage())*r_in.height())

          p1 = QtGui.QPixmap(r_in.size().toSize())
          p1.fill(QtCore.Qt.transparent)
          p_1 = QtGui.QPainter(p1)
          p_1.setRenderHints(painter.renderHints())
          p_1.fillRect(r_out, self.fillBrush())
          p_1.end()

          p2 = QtGui.QPixmap(r_in.size().toSize())
          p2.fill(QtCore.Qt.transparent)
          p_2 = QtGui.QPainter(p2)
          p_2.setRenderHints(painter.renderHints())
          p_2.setPen(painter.pen())
          p_2.setBrush(self.brush())
          p_2.drawEllipse(r_in)
          p_2.end()

          pixmap = QtGui.QPixmap(r_in.size().toSize())
          pixmap.fill(QtCore.Qt.transparent)
          p = QtGui.QPainter(pixmap)
          p.setRenderHints(painter.renderHints())
          p.drawPixmap(QtCore.QPointF(), p1)
          p.setCompositionMode(QtGui.QPainter.CompositionMode_DestinationAtop)
          p.drawPixmap(QtCore.QPointF(), p2)
          p.end()

          painter.drawPixmap(option.rect.topLeft(), pixmap)
          painter.setPen(self.pen())
          painter.drawEllipse(option.rect)

          class GraphicsView(QtWidgets.QGraphicsView):
          def __init__(self, parent=None):
          super(GraphicsView, self).__init__(parent)
          self.setScene(QtWidgets.QGraphicsScene(self))
          self.setRenderHints(self.renderHints() | QtGui.QPainter.Antialiasing)
          light = {"status": True, "name": "myname"}
          it = CallbackEllipse(light, 100, 100, 100, 100)
          it.setPercentage(0.4)
          it.setPen(QtGui.QPen(QtGui.QColor(QtCore.Qt.lightGray).darker(150)))
          it.setBrush(QtGui.QBrush(QtGui.QColor(QtCore.Qt.white)))
          it.setFillBrush(QtGui.QBrush(QtGui.QColor("#4471C4")))
          self.scene().addItem(it)

          if __name__ == '__main__':
          import sys
          app = QtWidgets.QApplication(sys.argv)
          w = GraphicsView()
          w.resize(640, 480)
          w.show()
          sys.exit(app.exec_())


          enter image description here






          share|improve this answer
























          • Phenomenal. I don't know how you make it look so simple. Works a treat. Thanks again eyllanesc :)

            – xnemesis
            Nov 24 '18 at 22:28











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53457608%2fpart-filled-ellipse%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          For these cases it is necessary to implement a custom item and overwrite the paint method, use QGraphicsEllipseItem as a base since it is enough to add the percentage properties and the fill color, if you want it to be repainted you must call update(). For the painting create 2 QPixmaps, the first draw the rectangle and the second the ellipse, then join them using compositionMode



          from PyQt5 import QtCore, QtGui, QtWidgets

          class CallbackEllipse(QtWidgets.QGraphicsEllipseItem):
          def __init__(self, light, *args, **kwargs):
          super(CallbackEllipse, self).__init__(*args, **kwargs)
          self._fill_brush = QtGui.QBrush(QtCore.Qt.NoBrush)
          self._percentage = 0
          self._light = light

          def setFillBrush(self, brush):
          self._fill_brush = brush
          self.update()

          def fillBrush(self):
          return self._fill_brush

          def setPercentage(self, percentage):
          self._percentage = percentage
          self.update()

          def percentage(self):
          return self._percentage

          def paint(self, painter, option, widget=None):
          painter.setPen(self.pen())
          r_in = QtCore.QRectF(QtCore.QPointF(), self.rect().size())
          r_out = QtCore.QRectF(r_in)
          r_out.setTop((1-self.percentage())*r_in.height())

          p1 = QtGui.QPixmap(r_in.size().toSize())
          p1.fill(QtCore.Qt.transparent)
          p_1 = QtGui.QPainter(p1)
          p_1.setRenderHints(painter.renderHints())
          p_1.fillRect(r_out, self.fillBrush())
          p_1.end()

          p2 = QtGui.QPixmap(r_in.size().toSize())
          p2.fill(QtCore.Qt.transparent)
          p_2 = QtGui.QPainter(p2)
          p_2.setRenderHints(painter.renderHints())
          p_2.setPen(painter.pen())
          p_2.setBrush(self.brush())
          p_2.drawEllipse(r_in)
          p_2.end()

          pixmap = QtGui.QPixmap(r_in.size().toSize())
          pixmap.fill(QtCore.Qt.transparent)
          p = QtGui.QPainter(pixmap)
          p.setRenderHints(painter.renderHints())
          p.drawPixmap(QtCore.QPointF(), p1)
          p.setCompositionMode(QtGui.QPainter.CompositionMode_DestinationAtop)
          p.drawPixmap(QtCore.QPointF(), p2)
          p.end()

          painter.drawPixmap(option.rect.topLeft(), pixmap)
          painter.setPen(self.pen())
          painter.drawEllipse(option.rect)

          class GraphicsView(QtWidgets.QGraphicsView):
          def __init__(self, parent=None):
          super(GraphicsView, self).__init__(parent)
          self.setScene(QtWidgets.QGraphicsScene(self))
          self.setRenderHints(self.renderHints() | QtGui.QPainter.Antialiasing)
          light = {"status": True, "name": "myname"}
          it = CallbackEllipse(light, 100, 100, 100, 100)
          it.setPercentage(0.4)
          it.setPen(QtGui.QPen(QtGui.QColor(QtCore.Qt.lightGray).darker(150)))
          it.setBrush(QtGui.QBrush(QtGui.QColor(QtCore.Qt.white)))
          it.setFillBrush(QtGui.QBrush(QtGui.QColor("#4471C4")))
          self.scene().addItem(it)

          if __name__ == '__main__':
          import sys
          app = QtWidgets.QApplication(sys.argv)
          w = GraphicsView()
          w.resize(640, 480)
          w.show()
          sys.exit(app.exec_())


          enter image description here






          share|improve this answer
























          • Phenomenal. I don't know how you make it look so simple. Works a treat. Thanks again eyllanesc :)

            – xnemesis
            Nov 24 '18 at 22:28
















          0














          For these cases it is necessary to implement a custom item and overwrite the paint method, use QGraphicsEllipseItem as a base since it is enough to add the percentage properties and the fill color, if you want it to be repainted you must call update(). For the painting create 2 QPixmaps, the first draw the rectangle and the second the ellipse, then join them using compositionMode



          from PyQt5 import QtCore, QtGui, QtWidgets

          class CallbackEllipse(QtWidgets.QGraphicsEllipseItem):
          def __init__(self, light, *args, **kwargs):
          super(CallbackEllipse, self).__init__(*args, **kwargs)
          self._fill_brush = QtGui.QBrush(QtCore.Qt.NoBrush)
          self._percentage = 0
          self._light = light

          def setFillBrush(self, brush):
          self._fill_brush = brush
          self.update()

          def fillBrush(self):
          return self._fill_brush

          def setPercentage(self, percentage):
          self._percentage = percentage
          self.update()

          def percentage(self):
          return self._percentage

          def paint(self, painter, option, widget=None):
          painter.setPen(self.pen())
          r_in = QtCore.QRectF(QtCore.QPointF(), self.rect().size())
          r_out = QtCore.QRectF(r_in)
          r_out.setTop((1-self.percentage())*r_in.height())

          p1 = QtGui.QPixmap(r_in.size().toSize())
          p1.fill(QtCore.Qt.transparent)
          p_1 = QtGui.QPainter(p1)
          p_1.setRenderHints(painter.renderHints())
          p_1.fillRect(r_out, self.fillBrush())
          p_1.end()

          p2 = QtGui.QPixmap(r_in.size().toSize())
          p2.fill(QtCore.Qt.transparent)
          p_2 = QtGui.QPainter(p2)
          p_2.setRenderHints(painter.renderHints())
          p_2.setPen(painter.pen())
          p_2.setBrush(self.brush())
          p_2.drawEllipse(r_in)
          p_2.end()

          pixmap = QtGui.QPixmap(r_in.size().toSize())
          pixmap.fill(QtCore.Qt.transparent)
          p = QtGui.QPainter(pixmap)
          p.setRenderHints(painter.renderHints())
          p.drawPixmap(QtCore.QPointF(), p1)
          p.setCompositionMode(QtGui.QPainter.CompositionMode_DestinationAtop)
          p.drawPixmap(QtCore.QPointF(), p2)
          p.end()

          painter.drawPixmap(option.rect.topLeft(), pixmap)
          painter.setPen(self.pen())
          painter.drawEllipse(option.rect)

          class GraphicsView(QtWidgets.QGraphicsView):
          def __init__(self, parent=None):
          super(GraphicsView, self).__init__(parent)
          self.setScene(QtWidgets.QGraphicsScene(self))
          self.setRenderHints(self.renderHints() | QtGui.QPainter.Antialiasing)
          light = {"status": True, "name": "myname"}
          it = CallbackEllipse(light, 100, 100, 100, 100)
          it.setPercentage(0.4)
          it.setPen(QtGui.QPen(QtGui.QColor(QtCore.Qt.lightGray).darker(150)))
          it.setBrush(QtGui.QBrush(QtGui.QColor(QtCore.Qt.white)))
          it.setFillBrush(QtGui.QBrush(QtGui.QColor("#4471C4")))
          self.scene().addItem(it)

          if __name__ == '__main__':
          import sys
          app = QtWidgets.QApplication(sys.argv)
          w = GraphicsView()
          w.resize(640, 480)
          w.show()
          sys.exit(app.exec_())


          enter image description here






          share|improve this answer
























          • Phenomenal. I don't know how you make it look so simple. Works a treat. Thanks again eyllanesc :)

            – xnemesis
            Nov 24 '18 at 22:28














          0












          0








          0







          For these cases it is necessary to implement a custom item and overwrite the paint method, use QGraphicsEllipseItem as a base since it is enough to add the percentage properties and the fill color, if you want it to be repainted you must call update(). For the painting create 2 QPixmaps, the first draw the rectangle and the second the ellipse, then join them using compositionMode



          from PyQt5 import QtCore, QtGui, QtWidgets

          class CallbackEllipse(QtWidgets.QGraphicsEllipseItem):
          def __init__(self, light, *args, **kwargs):
          super(CallbackEllipse, self).__init__(*args, **kwargs)
          self._fill_brush = QtGui.QBrush(QtCore.Qt.NoBrush)
          self._percentage = 0
          self._light = light

          def setFillBrush(self, brush):
          self._fill_brush = brush
          self.update()

          def fillBrush(self):
          return self._fill_brush

          def setPercentage(self, percentage):
          self._percentage = percentage
          self.update()

          def percentage(self):
          return self._percentage

          def paint(self, painter, option, widget=None):
          painter.setPen(self.pen())
          r_in = QtCore.QRectF(QtCore.QPointF(), self.rect().size())
          r_out = QtCore.QRectF(r_in)
          r_out.setTop((1-self.percentage())*r_in.height())

          p1 = QtGui.QPixmap(r_in.size().toSize())
          p1.fill(QtCore.Qt.transparent)
          p_1 = QtGui.QPainter(p1)
          p_1.setRenderHints(painter.renderHints())
          p_1.fillRect(r_out, self.fillBrush())
          p_1.end()

          p2 = QtGui.QPixmap(r_in.size().toSize())
          p2.fill(QtCore.Qt.transparent)
          p_2 = QtGui.QPainter(p2)
          p_2.setRenderHints(painter.renderHints())
          p_2.setPen(painter.pen())
          p_2.setBrush(self.brush())
          p_2.drawEllipse(r_in)
          p_2.end()

          pixmap = QtGui.QPixmap(r_in.size().toSize())
          pixmap.fill(QtCore.Qt.transparent)
          p = QtGui.QPainter(pixmap)
          p.setRenderHints(painter.renderHints())
          p.drawPixmap(QtCore.QPointF(), p1)
          p.setCompositionMode(QtGui.QPainter.CompositionMode_DestinationAtop)
          p.drawPixmap(QtCore.QPointF(), p2)
          p.end()

          painter.drawPixmap(option.rect.topLeft(), pixmap)
          painter.setPen(self.pen())
          painter.drawEllipse(option.rect)

          class GraphicsView(QtWidgets.QGraphicsView):
          def __init__(self, parent=None):
          super(GraphicsView, self).__init__(parent)
          self.setScene(QtWidgets.QGraphicsScene(self))
          self.setRenderHints(self.renderHints() | QtGui.QPainter.Antialiasing)
          light = {"status": True, "name": "myname"}
          it = CallbackEllipse(light, 100, 100, 100, 100)
          it.setPercentage(0.4)
          it.setPen(QtGui.QPen(QtGui.QColor(QtCore.Qt.lightGray).darker(150)))
          it.setBrush(QtGui.QBrush(QtGui.QColor(QtCore.Qt.white)))
          it.setFillBrush(QtGui.QBrush(QtGui.QColor("#4471C4")))
          self.scene().addItem(it)

          if __name__ == '__main__':
          import sys
          app = QtWidgets.QApplication(sys.argv)
          w = GraphicsView()
          w.resize(640, 480)
          w.show()
          sys.exit(app.exec_())


          enter image description here






          share|improve this answer













          For these cases it is necessary to implement a custom item and overwrite the paint method, use QGraphicsEllipseItem as a base since it is enough to add the percentage properties and the fill color, if you want it to be repainted you must call update(). For the painting create 2 QPixmaps, the first draw the rectangle and the second the ellipse, then join them using compositionMode



          from PyQt5 import QtCore, QtGui, QtWidgets

          class CallbackEllipse(QtWidgets.QGraphicsEllipseItem):
          def __init__(self, light, *args, **kwargs):
          super(CallbackEllipse, self).__init__(*args, **kwargs)
          self._fill_brush = QtGui.QBrush(QtCore.Qt.NoBrush)
          self._percentage = 0
          self._light = light

          def setFillBrush(self, brush):
          self._fill_brush = brush
          self.update()

          def fillBrush(self):
          return self._fill_brush

          def setPercentage(self, percentage):
          self._percentage = percentage
          self.update()

          def percentage(self):
          return self._percentage

          def paint(self, painter, option, widget=None):
          painter.setPen(self.pen())
          r_in = QtCore.QRectF(QtCore.QPointF(), self.rect().size())
          r_out = QtCore.QRectF(r_in)
          r_out.setTop((1-self.percentage())*r_in.height())

          p1 = QtGui.QPixmap(r_in.size().toSize())
          p1.fill(QtCore.Qt.transparent)
          p_1 = QtGui.QPainter(p1)
          p_1.setRenderHints(painter.renderHints())
          p_1.fillRect(r_out, self.fillBrush())
          p_1.end()

          p2 = QtGui.QPixmap(r_in.size().toSize())
          p2.fill(QtCore.Qt.transparent)
          p_2 = QtGui.QPainter(p2)
          p_2.setRenderHints(painter.renderHints())
          p_2.setPen(painter.pen())
          p_2.setBrush(self.brush())
          p_2.drawEllipse(r_in)
          p_2.end()

          pixmap = QtGui.QPixmap(r_in.size().toSize())
          pixmap.fill(QtCore.Qt.transparent)
          p = QtGui.QPainter(pixmap)
          p.setRenderHints(painter.renderHints())
          p.drawPixmap(QtCore.QPointF(), p1)
          p.setCompositionMode(QtGui.QPainter.CompositionMode_DestinationAtop)
          p.drawPixmap(QtCore.QPointF(), p2)
          p.end()

          painter.drawPixmap(option.rect.topLeft(), pixmap)
          painter.setPen(self.pen())
          painter.drawEllipse(option.rect)

          class GraphicsView(QtWidgets.QGraphicsView):
          def __init__(self, parent=None):
          super(GraphicsView, self).__init__(parent)
          self.setScene(QtWidgets.QGraphicsScene(self))
          self.setRenderHints(self.renderHints() | QtGui.QPainter.Antialiasing)
          light = {"status": True, "name": "myname"}
          it = CallbackEllipse(light, 100, 100, 100, 100)
          it.setPercentage(0.4)
          it.setPen(QtGui.QPen(QtGui.QColor(QtCore.Qt.lightGray).darker(150)))
          it.setBrush(QtGui.QBrush(QtGui.QColor(QtCore.Qt.white)))
          it.setFillBrush(QtGui.QBrush(QtGui.QColor("#4471C4")))
          self.scene().addItem(it)

          if __name__ == '__main__':
          import sys
          app = QtWidgets.QApplication(sys.argv)
          w = GraphicsView()
          w.resize(640, 480)
          w.show()
          sys.exit(app.exec_())


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 24 '18 at 20:45









          eyllanesceyllanesc

          80k103258




          80k103258













          • Phenomenal. I don't know how you make it look so simple. Works a treat. Thanks again eyllanesc :)

            – xnemesis
            Nov 24 '18 at 22:28



















          • Phenomenal. I don't know how you make it look so simple. Works a treat. Thanks again eyllanesc :)

            – xnemesis
            Nov 24 '18 at 22:28

















          Phenomenal. I don't know how you make it look so simple. Works a treat. Thanks again eyllanesc :)

          – xnemesis
          Nov 24 '18 at 22:28





          Phenomenal. I don't know how you make it look so simple. Works a treat. Thanks again eyllanesc :)

          – xnemesis
          Nov 24 '18 at 22:28




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53457608%2fpart-filled-ellipse%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Tonle Sap (See)

          I get strange results when I access the Sqlitedatabase with Unity C# via XAMPP

          Guatemaltekische Davis-Cup-Mannschaft