-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
27 lines (20 loc) · 892 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
import sys
from argparse import ArgumentParser, RawTextHelpFormatter
from PySide6.QtWidgets import QApplication
from PySide6.QtCore import QCoreApplication, QUrl
from mainwindow import MainWindow
"""PySide6 port of the pdfwidgets/pdfviewer example from Qt v6.x"""
if __name__ == "__main__":
argument_parser = ArgumentParser(description="数据表处理工具",
formatter_class=RawTextHelpFormatter)
argument_parser.add_argument("file", help="The file to open",
nargs='?', type=str)
options = argument_parser.parse_args()
a = QApplication(sys.argv)
w = MainWindow()
w.show()
if options.file:
w.open(QUrl.fromLocalFile(options.file))
sys.exit(QCoreApplication.exec())