# -*- 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_())
Source: https://habr.com/ru/post/139933/
All Articles