рдРрд╕рд╛ рд▓рдЧрддрд╛ рд╣реИ рдХрд┐ рдпрд╣ рдЕрдкрдиреЗ рдорд╛рдирдХ рд╡реНрдпрд╡рд╣рд╛рд░ рдФрд░ рджреБрдирд┐рдпрд╛ рднрд░ рдореЗрдВ рдПрдХ рдкрд░рд┐рдЪрд┐рдд рдирдЬрд╝рд░ рдХреЗ рд╕рд╛рде рдПрдХ рдирд┐рдпрдорд┐рдд рдмрдЯрди рдХреА рддреБрд▓рдирд╛ рдореЗрдВ рд╕рд░рд▓ рд╣реЛ рд╕рдХрддрд╛ рд╣реИ? рд╣рд╛рд▓рд╛рдБрдХрд┐, рдЕрдкрдиреЗ рд╕реНрд╡рдпрдВ рдХреЗ рдмрдЯрди рдмрдирд╛рдиреЗ рдХреА рдкреНрд░рдХреНрд░рд┐рдпрд╛ PyQt4 рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рдХреЗ рд╕рдВрдкреВрд░реНрдг рдЕрдиреБрдкреНрд░рдпреЛрдЧ рдмрдирд╛рдиреЗ рд╕реЗ рдХрдо рджрд┐рд▓рдЪрд╕реНрдк рдирд╣реАрдВ рд╣реИред
рдпрд╣рд╛рдБ QGraphicsWidget рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рдХреЗ QGraphicsScene рдореЗрдВ рдЕрдкрдирд╛ рд╕реНрд╡рдпрдВ рдХрд╛ рд╣рд╛рде рд╕реЗ рддреИрдпрд╛рд░ рдмрдЯрди рдмрдирд╛рдиреЗ рдХрд╛ рдПрдХ рдЙрджрд╛рд╣рд░рдг рд╣реИред
PyQt4 рдХреЗ рд╕рд╛рде рдЕрдиреБрднрд╡ рд╡рд╛рд▓реЗ рд▓реЛрдЧреЛрдВ рдХреЗ рд▓рд┐рдП рдЕрдиреБрд╢рдВрд╕рд┐рдд рдкрдврд╝рдиреЗред
рд╕рдмрд╕реЗ рдкрд╣рд▓реЗ, рдЖрдЗрдП рдЬрд╛рдиреЗрдВ рдХрд┐ рдПрдХ рдмрдЯрди рдХреНрдпрд╛ рд╣реИред
рд╕рд╛рдорд╛рдиреНрдп рдмрдЯрди, рдЕрдХреНрд╕рд░, рдкрд╛рда рдФрд░ / рдпрд╛ рдПрдХ рддрд╕реНрд╡реАрд░ рдХреЗ рд╕рд╛рде рдПрдХ рдЖрдпрдд, рдПрдХ рдорд╛рдЙрд╕ рдХреНрд▓рд┐рдХ рд╣реЛрддрд╛ рд╣реИ, рдЬрд┐рд╕ рдкрд░ рдПрдХ рджреГрд╢реНрдп рдкреНрд░рддрд┐рдХреНрд░рд┐рдпрд╛ рд╣реЛрддреА рд╣реИред рдмрдЯрди рдХрд╛ рдореБрдЦреНрдп рдЙрджреНрджреЗрд╢реНрдп рдЗрд╕ рдмрдЯрди рдХреЗ рд╕рдордиреНрд╡рдп рдХреНрд╖реЗрддреНрд░ рдореЗрдВ рд╕реНрдерд┐рдд рдорд╛рдЙрд╕ рдкреЙрдЗрдВрдЯрд░ (рдпрд╛ рдЙрдВрдЧрд▓реА) рдХреЗ рд╕рд╛рде рджрдмрд╛рдиреЗ рдФрд░ рдорд╣рд╕реВрд╕ рдХрд░рдиреЗ рдХреА рдПрдХ рд╕рд░рд▓ рдШрдЯрдирд╛ рдХрд╛ рдЬрд╡рд╛рдм рджреЗрдирд╛ рд╣реИред
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys class AButton(QtGui.QGraphicsWidget): # mouse_isPressed = False def __init__ ( self , parent = None ): QtGui.QGraphicsWidget. __init__ ( self ) def boundingRect( self ): # # # # . # QRectF, QRect, # . return QtCore.QRectF( 0 , 0 , 40 , 40 ) def paint( self , painter, option, widget = 0 ): # opt = QtGui.QStyleOptionButton() # , # opt.state = ((QtGui.QStyle.State_Sunken if self .mouse_isPressed else QtGui.QStyle.State_Raised) | QtGui.QStyle.State_Enabled) # opt.text = self .text() # opt.icon = self .icon() # opt.rect = option.rect # opt.palette = option.palette # QtGui.QApplication.style().drawControl(QtGui.QStyle.CE_PushButton, opt, painter) def text( self ): # , , # return QtCore.QString( "hi" ) def icon( self ): # , # # QPixmap QIcon return QtGui.QIcon() def mousePressEvent( self , event): # # self .mouse_isPressed = True self .update() def mouseReleaseEvent( self , event): # self .mouse_isPressed = False # update - , # self .update() if __name__ == "__main__" : app = QtGui.QApplication( sys .argv) # , # scene = QtGui.QGraphicsScene() # button = AButton() # scene.addItem(button) # , # view = QtGui.QGraphicsView(scene) # view.setRenderHint(QtGui.QPainter.Antialiasing) # view.resize( 200 , 100 ) # view.setBackgroundBrush(QtGui.QApplication.palette().background()) view.show() sys .exit(app.exec_())
рдореЗрд░реЗ рдорд╛рдорд▓реЗ рдореЗрдВ, рдкрд╛рдпрдерди 2.7 рдХреЗ рд▓рд┐рдП рдпрд╣ рдХреЛрдб PyQt 4.9.1 рдореЗрдВ рдареАрдХ рд╕реЗ рдХрд╛рдо рдХрд░рддрд╛ рд╣реИред
рдмреЗрд╢рдХ, рдпрд╣ рдмрдЯрди рдПрдХрджрдо рд╕рд╣реА рд╣реИ, рд▓реЗрдХрд┐рди рд╣рдорд╛рд░рд╛ рд▓рдХреНрд╖реНрдп рдпрд╣ рд╕рдордЭрдирд╛ рдерд╛ рдХрд┐ рдЧреНрд░рд╛рдлрд┐рдХреНрд╕ рдХреНрд╖реЗрддреНрд░ рдореЗрдВ рд╣рдорд╛рд░реЗ рд╡рд┐рдЬреЗрдЯ рдХреИрд╕реЗ рдмрдирд╛рдПрдВ рдФрд░ рдЙрдиреНрд╣реЗрдВ рдЗрдВрдЯрд░реИрдХреНрдЯрд┐рд╡ рдХреИрд╕реЗ рдмрдирд╛рдПрдВред рд╕рд╛рдорд╛рдиреНрдп рддреМрд░ рдкрд░, рдпреЗ рдореВрд▓ рдмрд╛рддреЗрдВ рд╣реИрдВ, рдЬрд┐рдирдореЗрдВ рд╕реЗ рд╢реБрд░реВ рдХрд░рдирд╛ рдФрд░ рдЙрдиреНрд╣реЗрдВ рдмрджрд▓рдирд╛, рдЖрдк рдЕрдкрдиреЗ рд╡рд┐рдЪрд╛рд░реЛрдВ рдХреА рд▓рдЧрднрдЧ рдХрд┐рд╕реА рднреА рдкреНрд░рд╛рдкреНрддрд┐ рдХреЛ рдкреНрд░рд╛рдкреНрдд рдХрд░ рд╕рдХрддреЗ рд╣реИрдВ рдФрд░ рдкреНрд░реЛрдЧреНрд░рд╛рдорд░ рдХреЗ рд░реВрдк рдореЗрдВ рдЕрдкрдиреЗ рдХрд╛рдо рдХрд╛ рдЕрднреНрдпрд╛рд╕ рдХрд░ рд╕рдХрддреЗ рд╣реИрдВред
рдкреНрд░рд╛рд░рдВрдн рдореЗрдВ, рдЗрдВрдЯрд░рдиреЗрдЯ рдкрд░ рдЙрдкрд░реЛрдХреНрдд рдХреЛрдб C ++ рдореЗрдВ рд▓рд┐рдЦрд╛ рдЧрдпрд╛ рдерд╛, рдЬрд┐рд╕реЗ рдХрдВрдкреНрдпреВрдЯрд░ рдкрд░ рд╕реБрд░рдХреНрд╖рд┐рдд рд░реВрдк рд╕реЗ рд╕рдВрдЧреНрд░рд╣реАрдд рдХрд┐рдпрд╛ рдЧрдпрд╛ рдерд╛, рдФрд░ рд╕реНрд░реЛрдд рдЦреЛ рдЧрдпрд╛ рдерд╛ред рдмрд╛рдж рдореЗрдВ, рдкрд╛рдпрдерди рдореЗрдВ рдХреБрдЫ рд╡рд┐рд╢реЗрд╖рддрд╛рдУрдВ рдХреЗ рд╕рд╛рде рдХреЛрдб рдХреЛ рдлрд┐рд░ рд╕реЗ рд▓рд┐рдЦрд╛ рдЧрдпрд╛, рдФрд░ рдореВрд▓ рдХреЛ рдХрдВрдкреНрдпреВрдЯрд░ рд╕реЗ рд╣рдЯрд╛ рджрд┐рдпрд╛ рдЧрдпрд╛редрдЖрдкрдХрд╛ рдзреНрдпрд╛рди рджреЗрдиреЗ рдХреЗ рд▓рд┐рдП рдзрдиреНрдпрд╡рд╛рджред