# Path: vnpy/trader/setting.py
# SETTINGS: Dict[str, Any] = {
#     "font.family": "微软雅黑",
#     "font.size": 12,
# 
#     "log.active": True,
#     "log.level": CRITICAL,
#     "log.console": True,
#     "log.file": True,
# 
#     "email.server": "smtp.qq.com",
#     "email.port": 465,
#     "email.username": "",
#     "email.password": "",
#     "email.sender": "",
#     "email.receiver": "",
# 
#     "datafeed.name": "",
#     "datafeed.username": "",
#     "datafeed.password": "",
# 
#     "database.timezone": get_localzone().zone,
#     "database.name": "sqlite",
#     "database.database": "database.db",
#     "database.host": "",
#     "database.port": 0,
#     "database.user": "",
#     "database.password": ""
# }
# 
# Path: vnpy/trader/utility.py
# def get_icon_path(filepath: str, ico_name: str) -> str:
#     """
#     Get path for icon file with ico name.
#     """
#     ui_path = Path(filepath).parent
#     icon_path = ui_path.joinpath("ico", ico_name)
#     return str(icon_path)


import ctypes
import platform
import sys
import traceback
import webbrowser
import types
import qdarkstyle
from PySide6 import QtGui, QtWidgets, QtCore
from ..setting import SETTINGS
from ..utility import get_icon_path




Qt = QtCore.Qt
QtCore.pyqtSignal = QtCore.Signal
QtWidgets.QAction = QtGui.QAction
QtCore.QDate.toPyDate = QtCore.QDate.toPython
QtCore.QDateTime.toPyDate = QtCore.QDateTime.toPython


def create_qapp(app_name: str = "Veighna Trader") -> QtWidgets.QApplication:
    """
    Create Qt Application.
    """
    # Set up dark stylesheet
    qapp = QtWidgets.QApplication(sys.argv)
    qapp.setStyleSheet(qdarkstyle.load_stylesheet(qt_api="pyside6"))

    # Set up font

# Path: vnpy/trader/setting.py
# SETTINGS: Dict[str, Any] = {
#     "font.family": "微软雅黑",
#     "font.size": 12,
# 
#     "log.active": True,
#     "log.level": CRITICAL,
#     "log.console": True,
#     "log.file": True,
# 
#     "email.server": "smtp.qq.com",
#     "email.port": 465,
#     "email.username": "",
#     "email.password": "",
#     "email.sender": "",
#     "email.receiver": "",
# 
#     "datafeed.name": "",
#     "datafeed.username": "",
#     "datafeed.password": "",
# 
#     "database.timezone": get_localzone().zone,
#     "database.name": "sqlite",
#     "database.database": "database.db",
#     "database.host": "",
#     "database.port": 0,
#     "database.user": "",
#     "database.password": ""
# }
# 
# Path: vnpy/trader/utility.py
# def get_icon_path(filepath: str, ico_name: str) -> str:
#     """
#     Get path for icon file with ico name.
#     """
#     ui_path = Path(filepath).parent
#     icon_path = ui_path.joinpath("ico", ico_name)
#     return str(icon_path)


# Path: vnpy/trader/ui/qt.py
import ctypes
import platform
import sys
import traceback
import webbrowser
import types
import qdarkstyle
from PySide6 import QtGui, QtWidgets, QtCore
from ..setting import SETTINGS
from ..utility import get_icon_path





Qt = QtCore.Qt
QtCore.pyqtSignal = QtCore.Signal
QtWidgets.QAction = QtGui.QAction
QtCore.QDate.toPyDate = QtCore.QDate.toPython
QtCore.QDateTime.toPyDate = QtCore.QDateTime.toPython


def create_qapp(app_name: str = "Veighna Trader") -> QtWidgets.QApplication:
    """
    Create Qt Application.
    """
    # Set up dark stylesheet
    qapp = QtWidgets.QApplication(sys.argv)
    qapp.setStyleSheet(qdarkstyle.load_stylesheet(qt_api="pyside6"))

    # Set up font

    font = QtGui.QFont(SETTINGS["font.family"], SETTINGS["font.size"])