コード例 #1
0
def main():
	
	# First we created a application object for pyqt
	app = QApplication(sys.argv)

	# Then we apply Flatipie style sheet and modern window style for creating modern-looking interfaces.
	# Please note that this is important for creating flatipie style app.
	apply_palette(app)
	window = ModernWindow(App())

	# Next is we show the window then execute the app.
	window.show()
	sys.exit(app.exec_())
コード例 #2
0
ファイル: materialbutton.py プロジェクト: znqi/Flatipie
from PyQt5.QtWidgets import ( QApplication, QWidget, QGridLayout, QDesktopWidget )
from Flatipie.widgets import MaterialButton
from Flatipie import apply_palette, ModernWindow
import sys

class MainWindow(QWidget):
  def __init__(self):
    super(MainWindow, self).__init__()
    self.setWindowTitle("flatipie buttons")
    resolution = QDesktopWidget().screenGeometry()
		self.move((resolution.width() / 2) - (self.frameSize().width() / 2),
			(resolution.height() / 2) - (self.frameSize().height() / 2)) 
    
    grid = QGridLayout()
    
    for x in range(5):
      for y in range(5):
        # Material Button style.
        # Read more infos at https://github.com/flatipie/flatipie
        
        grid.addWidget(MaterialButton("Push me"), x, y)
    
    self.setLayout(grid)
    
 if __name__ == "__main__":
  app = QApplication(sys.argv)
  apply_palette(app)
  window = ModernWindow(MainWindow())
  window.show()
  sys.exit(app)