forked from taseikyo/PyQt5-Apps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tich
committed
Jul 16, 2018
1 parent
c11bfbc
commit af776ad
Showing
4 changed files
with
953 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
# @Date : 2018-05-29 11:14:46 | ||
# @Author : Lewis Tian ([email protected] | [email protected]) | ||
# @Link : https://lewistian.github.io/ | ||
# @Version : Python3.5 | ||
|
||
from PyQt5 import QtWidgets | ||
from PyQt5 import QtCore | ||
from PyQt5.QtWidgets import QWidget, QApplication | ||
from mwin import Ui_MWin | ||
import sys | ||
|
||
class MWin(Ui_MWin): | ||
def __init__(self, parent=None): | ||
super(MWin, self).__init__() | ||
|
||
if __name__ == '__main__': | ||
app = QApplication(sys.argv) | ||
base = QWidget() # 创建基本窗口 | ||
try: | ||
with open('style.qss') as f: | ||
style = f.read() # 读取样式表 | ||
base.setStyleSheet(style) | ||
except: | ||
print("open stylesheet error") | ||
w = MWin() # 创建用户界面类的实例 | ||
w.setupUi(base) # 将用户界面加载到基本窗口 | ||
base.show() # 显示基本窗口,这样基于基本窗口的内容我们都可以看到了 | ||
sys.exit(app.exec_()) |
Oops, something went wrong.