mirror of
https://github.com/Wanderson-Magalhaes/PyOneDark_Qt_Widgets_Modern_GUI.git
synced 2026-02-17 07:53:57 +00:00
83 lines
2.7 KiB
Python
83 lines
2.7 KiB
Python
# ///////////////////////////////////////////////////////////////
|
|
#
|
|
# BY: WANDERSON M.PIMENTA
|
|
# PROJECT MADE WITH: Qt Designer and PySide6
|
|
# V: 1.0.0
|
|
#
|
|
# This project can be used freely for all uses, as long as they maintain the
|
|
# respective credits only in the Python scripts, any information in the visual
|
|
# interface (GUI) can be modified without any implication.
|
|
#
|
|
# There are limitations on Qt licenses if you want to use your products
|
|
# commercially, I recommend reading them on the official website:
|
|
# https://doc.qt.io/qtforpython/licenses.html
|
|
#
|
|
# ///////////////////////////////////////////////////////////////
|
|
|
|
# IMPORT PACKAGES AND MODULES
|
|
# ///////////////////////////////////////////////////////////////
|
|
import sys
|
|
import os
|
|
|
|
# IMPORT QT CORE
|
|
# ///////////////////////////////////////////////////////////////
|
|
from qt_core import *
|
|
|
|
# IMPORT SETTINGS
|
|
# ///////////////////////////////////////////////////////////////
|
|
from gui.core.json_settings import Settings
|
|
|
|
# IMPORT PY ONE DARK WINDOWS
|
|
# ///////////////////////////////////////////////////////////////
|
|
# MAIN WINDOW
|
|
from gui.uis.windows.main_window import *
|
|
|
|
# IMPORT PY ONE DARK WIDGETS
|
|
# ///////////////////////////////////////////////////////////////
|
|
from gui.widgets import *
|
|
|
|
# ADJUST QT FONT DPI FOR HIGHT SCALE
|
|
# ///////////////////////////////////////////////////////////////
|
|
os.environ["QT_FONT_DPI"] = "96"
|
|
|
|
# MAIN WINDOW
|
|
# ///////////////////////////////////////////////////////////////
|
|
class MainWindow(QMainWindow):
|
|
def __init__(self):
|
|
QMainWindow.__init__(self)
|
|
|
|
# SETUP MAIN WINDOw
|
|
# Load widgets from "gui\uis\main_window\ui_main.py"
|
|
# ///////////////////////////////////////////////////////////////
|
|
self.ui = UI_MainWindow()
|
|
self.ui.setup_ui(self)
|
|
|
|
# LOAD SETTINGS
|
|
# ///////////////////////////////////////////////////////////////
|
|
settings = Settings()
|
|
self.settings = settings.items
|
|
|
|
# SETUP MAIN WINDOW
|
|
# ///////////////////////////////////////////////////////////////
|
|
self.hide_grips = True # Show/Hide resize grips
|
|
SetupMainWindow.setup(self)
|
|
|
|
# SHOW MAIN WINDOW
|
|
# ///////////////////////////////////////////////////////////////
|
|
self.show()
|
|
|
|
# RESIZE EVENT
|
|
# ///////////////////////////////////////////////////////////////
|
|
def resizeEvent(self, event):
|
|
SetupMainWindow.resize_grips(self)
|
|
|
|
|
|
# SETTINGS WHEN TO START
|
|
# Set the initial class and also additional parameters of the "QApplication" class
|
|
# ///////////////////////////////////////////////////////////////
|
|
if __name__ == "__main__":
|
|
# APPLICATION
|
|
app = QApplication(sys.argv)
|
|
# app.setWindowIcon(QIcon("icon.ico"))
|
|
window = MainWindow()
|
|
sys.exit(app.exec_()) |