start v1 fix
This commit is contained in:
16
start.py
16
start.py
@@ -1,12 +1,25 @@
|
|||||||
|
# v1.0.3 start.py
|
||||||
|
import os
|
||||||
|
|
||||||
|
os.environ["QT_ENABLE_HIGHDPI_SCALING"] = "1"
|
||||||
|
os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1"
|
||||||
|
|
||||||
import signal
|
import signal
|
||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
|
from PyQt6.QtCore import Qt
|
||||||
|
from PyQt6.QtGui import QGuiApplication
|
||||||
from PyQt6.QtWidgets import QApplication
|
from PyQt6.QtWidgets import QApplication
|
||||||
|
|
||||||
from core.app import StickyNoteApp
|
from core.app import StickyNoteApp
|
||||||
|
|
||||||
|
|
||||||
|
QGuiApplication.setHighDpiScaleFactorRoundingPolicy(
|
||||||
|
Qt.HighDpiScaleFactorRoundingPolicy.PassThrough
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def main() -> int:
|
def main() -> int:
|
||||||
signal.signal(signal.SIGINT, signal.SIG_DFL)
|
signal.signal(signal.SIGINT, signal.SIG_DFL)
|
||||||
|
|
||||||
@@ -17,6 +30,7 @@ def main() -> int:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
return app.exec()
|
return app.exec()
|
||||||
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
try:
|
try:
|
||||||
window.safe_exit()
|
window.safe_exit()
|
||||||
@@ -24,8 +38,10 @@ def main() -> int:
|
|||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
except SystemExit:
|
except SystemExit:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
except Exception:
|
except Exception:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
Reference in New Issue
Block a user