本文整理汇总了Python中qdarkstyle.load_stylesheet方法的典型用法代码示例。如果您正苦于以下问题:Python qdarkstyle.load_stylesheet方法的具体用法?Python qdarkstyle.load_stylesheet怎么用?Python qdarkstyle.load_stylesheet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qdarkstyle
的用法示例。
在下文中一共展示了qdarkstyle.load_stylesheet方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: import qdarkstyle [as 别名]
# 或者: from qdarkstyle import load_stylesheet [as 别名]
def main():
"""
Application entry point
"""
logging.basicConfig(level=logging.DEBUG)
# create the application and the main window
app = QtGui.QApplication(sys.argv)
window = QtGui.QMainWindow()
# setup ui
ui = example_ui.Ui_MainWindow()
ui.setupUi(window)
ui.bt_delay_popup.addActions([
ui.actionAction,
ui.actionAction_C
])
ui.bt_instant_popup.addActions([
ui.actionAction,
ui.actionAction_C
])
ui.bt_menu_button_popup.addActions([
ui.actionAction,
ui.actionAction_C
])
window.setWindowTitle("QDarkStyle example")
# tabify dock widgets to show bug #6
window.tabifyDockWidget(ui.dockWidget1, ui.dockWidget2)
# setup stylesheet
app.setStyleSheet(qdarkstyle.load_stylesheet(pyside=False))
# auto quit after 2s when testing on travis-ci
if "--travis" in sys.argv:
QtCore.QTimer.singleShot(2000, app.exit)
# run
window.show()
app.exec_()
示例2: main
# 需要导入模块: import qdarkstyle [as 别名]
# 或者: from qdarkstyle import load_stylesheet [as 别名]
def main():
"""
Application entry point
"""
logging.basicConfig(level=logging.DEBUG)
# create the application and the main window
app = QtGui.QApplication(sys.argv)
window = QtGui.QMainWindow()
# setup ui
ui = example_ui.Ui_MainWindow()
ui.setupUi(window)
ui.bt_delay_popup.addActions([
ui.actionAction,
ui.actionAction_C
])
ui.bt_instant_popup.addActions([
ui.actionAction,
ui.actionAction_C
])
ui.bt_menu_button_popup.addActions([
ui.actionAction,
ui.actionAction_C
])
window.setWindowTitle("QDarkStyle example")
# tabify dock widgets to show bug #6
window.tabifyDockWidget(ui.dockWidget1, ui.dockWidget2)
# setup stylesheet
app.setStyleSheet(qdarkstyle.load_stylesheet(pyside=True))
# auto quit after 2s when testing on travis-ci
if "--travis" in sys.argv:
QtCore.QTimer.singleShot(2000, app.exit)
# run
window.show()
app.exec_()
示例3: main
# 需要导入模块: import qdarkstyle [as 别名]
# 或者: from qdarkstyle import load_stylesheet [as 别名]
def main():
"""主程序入口"""
# 重载sys模块,设置默认字符串编码方式为utf8
reload(sys)
sys.setdefaultencoding('utf8')
# 设置Windows底部任务栏图标
if 'Windows' in platform.uname() :
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID('vn.trader')
# 初始化Qt应用对象
app = QtGui.QApplication(sys.argv)
app.setWindowIcon(QtGui.QIcon('meng.ico'))
app.setFont(BASIC_FONT)
# 设置Qt的皮肤
try:
f = file("VT_setting.json")
setting = json.load(f)
if setting['darkStyle']:
import qdarkstyle
app.setStyleSheet(qdarkstyle.load_stylesheet(pyside=False))
except:
pass
# 初始化主引擎和主窗口对象
mainEngine = MainEngine()
mainWindow = MainWindow(mainEngine, mainEngine.eventEngine)
mainWindow.showMaximized()
# 在主线程中启动Qt事件循环
sys.exit(app.exec_())
示例4: main
# 需要导入模块: import qdarkstyle [as 别名]
# 或者: from qdarkstyle import load_stylesheet [as 别名]
def main():
"""主程序入口"""
# 重载sys模块,设置默认字符串编码方式为utf8
reload(sys)
sys.setdefaultencoding('utf8')
# 设置Windows底部任务栏图标
if 'Windows' in platform.uname() :
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID('InplusTrader')
# 初始化Qt应用对象
app = QtGui.QApplication(sys.argv)
app.setWindowIcon(QtGui.QIcon(ICON_FILENAME))
app.setFont(BASIC_FONT)
# 设置Qt的皮肤
try:
f = file(SETTING_FILENAME)
setting = json.load(f)
if setting['darkStyle']:
import qdarkstyle
app.setStyleSheet(qdarkstyle.load_stylesheet(pyside=False))
except:
pass
# 初始化主引擎和主窗口对象
mainEngine = MainEngine()
mainWindow = MainWindow(mainEngine, mainEngine.eventEngine)
mainWindow.showMaximized()
# 在主线程中启动Qt事件循环
sys.exit(app.exec_())
示例5: main
# 需要导入模块: import qdarkstyle [as 别名]
# 或者: from qdarkstyle import load_stylesheet [as 别名]
def main(argv):
"""Standard boilerplate Qt application code."""
app = QApplication(argv)
app.setStyleSheet(qdarkstyle.load_stylesheet(pyside=False))
app.setApplicationName(__appname__)
app.setWindowIcon(newIcon("app"))
win = MainWindow(argv[1] if len(argv) == 2 else None)
win.show()
return app.exec_()
示例6: __init__
# 需要导入模块: import qdarkstyle [as 别名]
# 或者: from qdarkstyle import load_stylesheet [as 别名]
def __init__(self, argv, style):
QApplication.__init__(self, argv)
# Sick! The QT doc recommends the following:
# "To ensure that the application's style is set correctly, it is best
# to call this function before the QApplication constructor, if
# possible". However if I do it before QApplication.__init__() then
# there is a crash! At least with some styles on Ubuntu 12.04 64 bit.
# So I have to call the initialization after the __init__ call.
QApplication.setStyle(style)
self.mainWindow = None
self.__lastFocus = None
self.__beforeMenuBar = None
# Sick! It seems that QT sends Activate/Deactivate signals every time
# a dialog window is opened/closed. This happens very quickly (and
# totally unexpected!). So the last focus widget must not be focused
# unconditionally as the last focus may come from a dialog which has
# already been destroyed. Without checking that a widget is still alive
# (e.g. clicking 'Cancel' in a dialog box) leads to a core dump.
QApplication.setWindowIcon(getIcon('icon.png'))
self.focusChanged.connect(self.__onFocusChanged)
appCSS = ''
if GlobalData().skin['dark']:
appCSS = qdarkstyle.load_stylesheet(qt_api='pyqt5')
#appCSS = appCSS.replace('QStatusBar QLabel',
# 'QStatusBar QComboBox')
#appCSS = appCSS.replace('QStatusBar::item',
# 'QStatusBar QComboBox')
# Avoid having rectangular frames on the status bar and
# some application wide style changes
adjustmentCSS = GlobalData().skin['appCSS']
if adjustmentCSS:
appCSS += '\n' + adjustmentCSS
if appCSS:
self.setStyleSheet(appCSS)
# Install custom GC
self.__gc = GarbageCollector(self)
self.installEventFilter(self)
示例7: main
# 需要导入模块: import qdarkstyle [as 别名]
# 或者: from qdarkstyle import load_stylesheet [as 别名]
def main():
"""客户端主程序入口"""
# 设置Windows底部任务栏图标
if 'Windows' in platform.uname() :
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID('vn.trader')
# 创建事件引擎
eventEngine = EventEngine()
eventEngine.start(timer=False)
# 创建客户端
reqAddress = 'tcp://localhost:2114'
subAddress = 'tcp://localhost:2116'
client = VtClient(reqAddress, subAddress, eventEngine)
# 这里是订阅所有的publish event,也可以指定。
client.subscribeTopic('')
client.start()
# 初始化Qt应用对象
app = QtGui.QApplication(sys.argv)
app.setWindowIcon(QtGui.QIcon(ICON_FILENAME))
app.setFont(BASIC_FONT)
# 设置Qt的皮肤
try:
from vnpy.trader.vtGlobal import globalSetting
if globalSetting['darkStyle']:
import qdarkstyle
app.setStyleSheet(qdarkstyle.load_stylesheet(pyside=False))
except:
pass
# 初始化主引擎和主窗口对象
mainEngine = ClientEngine(client, eventEngine)
mainWindow = MainWindow(mainEngine, mainEngine.eventEngine)
mainWindow.showMaximized()
# 在主线程中启动Qt事件循环
sys.exit(app.exec_())
示例8: main
# 需要导入模块: import qdarkstyle [as 别名]
# 或者: from qdarkstyle import load_stylesheet [as 别名]
def main():
"""主程序入口"""
# 重载sys模块,设置默认字符串编码方式为utf8
'''
reload(sys)
try:
sys.setdefaultencoding('utf8')
except:
pass
'''
# 设置Windows底部任务栏图标
if 'Windows' in platform.uname() :
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID('vn.trader')
# 初始化Qt应用对象
icon = os.path.join(os.getcwd(), 'setting', 'vnpy.ico')
app = QApplication(['VnTrader',''])
app.setWindowIcon(QIcon(icon))
app.setFont(BASIC_FONT)
darksheet = qdarkstyle.load_stylesheet(pyside=False)
whitesheet = app.styleSheet()
sheets = [whitesheet, darksheet]
# 设置Qt的皮肤
try:
f = open("setting/VT_setting.json")
setting = json.load(f)
if setting['darkStyle']:
app.setStyleSheet(darksheet)
sheets = [darksheet, whitesheet]
except:
pass
# 初始化主引擎和主窗口对象
mainEngine = MainEngine()
mainWindow = MainWindow(mainEngine, mainEngine.eventEngine, app, sheets)
mainWindow.showMaximized()
mainWindow.showLogin()
# 在主线程中启动Qt事件循环
sys.exit(app.exec_())
示例9: main
# 需要导入模块: import qdarkstyle [as 别名]
# 或者: from qdarkstyle import load_stylesheet [as 别名]
def main():
"""客户端主程序入口"""
# 重载sys模块,设置默认字符串编码方式为utf8
reload(sys)
sys.setdefaultencoding('utf8')
# 设置Windows底部任务栏图标
if 'Windows' in platform.uname() :
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID('vn.trader')
# 创建事件引擎
eventEngine = EventEngine()
eventEngine.start(timer=False)
# 创建客户端
reqAddress = 'tcp://localhost:2014'
subAddress = 'tcp://localhost:0602'
client = VtClient(reqAddress, subAddress, eventEngine)
client.subscribeTopic('')
client.start()
# 初始化Qt应用对象
app = QtGui.QApplication(sys.argv)
app.setWindowIcon(QtGui.QIcon(ICON_FILENAME))
app.setFont(BASIC_FONT)
# 设置Qt的皮肤
try:
f = file(SETTING_FILENAME)
setting = json.load(f)
if setting['darkStyle']:
import qdarkstyle
app.setStyleSheet(qdarkstyle.load_stylesheet(pyside=False))
except:
pass
# 初始化主引擎和主窗口对象
mainEngine = ClientEngine(client, eventEngine)
mainWindow = MainWindow(mainEngine, mainEngine.eventEngine)
mainWindow.showMaximized()
# 在主线程中启动Qt事件循环
sys.exit(app.exec_())