Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Paint method of QtGui.QGraphicsWidget is not calling with(python 64Bit).
Qt 6.12 LTS is out! See what's new in the release blog

Paint method of QtGui.QGraphicsWidget is not calling with(python 64Bit).

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 733 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hi ,

    I am Using python 2.7.2 (64-bit), i have override paint method of QGraphicsWidget class but whenever i move and change the item size , paint method doesn't call.

    But when i use python 32- bit it's working.

    could anyone help me to figure out the problem.
    here is my code.

    from PySide import QtCore, QtGui

    class Widget(QtGui.QGraphicsWidget):

    def init(self,*args):
    QtGui.QGraphicsWidget.init(self,*args)
    self.setGeometry(2,2,500,500)

    def paint(self,*args,**kwargs):
    print "calling paint method"

    if name == 'main':
    import sys
    app = QtGui.QApplication(sys.argv)
    scene = QtGui.QGraphicsScene()

    scene.setSceneRect(0, 0, 800, 480)
    minSize = QtCore.QSizeF(30, 100)

    prefSize = QtCore.QSizeF(210, 100)

    maxSize = QtCore.QSizeF(300, 100)
    l = QtGui.QGraphicsAnchorLayout()
    l.setSpacing(0)
    w = Widget(None, QtCore.Qt.Window)
    w.setPos(20, 20)
    w.setLayout(l)
    scene.addItem(w)
    scene.setBackgroundBrush(QtCore.Qt.darkGreen)
    view = QtGui.QGraphicsView(scene)
    view.show()
    sys.exit(app.exec_())

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt
    • Unsolved