Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from PySide.QtGui import *
- from PySide.QtCore import *
- import sys
- def getPalette():
- palette = QPalette()
- brush = QBrush(QColor(80, 80, 80))
- brush.setStyle(Qt.SolidPattern)
- palette.setBrush(QPalette.Active, QPalette.Button, brush)
- # THIS SETS THE FONT TO WHITE ON WINDOWS BUT NOT ON OSX
- brush = QBrush(QColor(255, 255, 255))
- brush.setStyle(Qt.SolidPattern)
- palette.setBrush(QPalette.Active, QPalette.BrightText, brush)
- return palette
- def getStyleSheet():
- return """
- QPushButton{
- background-color: rgb(80, 80, 80);
- }
- QPushButton:active{
- color: rgb(255, 255, 255);
- }
- """
- app = QApplication( sys.argv )
- app.setStyle( 'plastique' )
- app.setStyleSheet( getStyleSheet() )
- w = QWidget()
- b = QPushButton( 'test' )
- w.setLayout( QHBoxLayout() )
- w.layout().addWidget( b )
- w.show()
- sys.exit( app.exec_() )
Advertisement
Add Comment
Please, Sign In to add comment