1 Star 0 Fork 0

iounce/PySideJSON

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
base_window_demo.py 1.42 KB
一键复制 编辑 原始数据 按行查看 历史
iounce 提交于 2024-08-04 15:47 . PySideJSON--a tool for JSON
# -*- coding: utf-8 -*-
import sys
from PySide6.QtWidgets import QApplication, QHBoxLayout, QLabel
from PySide6.QtCore import QTranslator
from icon import LogoIcon
from main_window import MainWindow
from setting import Setting
from theme import Theme
from base_window import BaseWindow
class MyWindow(BaseWindow):
def __init__(self, parent=None, theme=None):
super().__init__(parent, theme)
# main entry point
if __name__ == "__main__":
# load language and theme from settings
setting = Setting()
setting.load()
locale = setting.get_locale()
theme = setting.get_theme()
print("main:", locale, theme)
# set default language
translator = QTranslator()
translator.load(locale)
app = QApplication(sys.argv)
app.installTranslator(translator)
# body
layout_body = QHBoxLayout()
label = QLabel("Hello")
label.setStyleSheet("background-color:red")
layout_body.addWidget(label)
label = QLabel("World")
label.setStyleSheet("background-color:blue")
layout_body.addWidget(label)
# tail
layout_tail = QHBoxLayout()
label2 = QLabel("tail")
label2.setStyleSheet("background-color:yellow")
layout_tail.addWidget(label2)
theme = Theme(app, theme)
window = MyWindow()
window.setWindowIcon(LogoIcon.get_icon())
window.set_body_layout(layout_body)
window.set_tail_layout(layout_tail)
window.show()
sys.exit(app.exec())
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/iounce_admin/PySideJSON.git
[email protected]:iounce_admin/PySideJSON.git
iounce_admin
PySideJSON
PySideJSON
master

搜索帮助