import
sys
from
PyQt5.QtCore
import
Qt, QUrl
from
PyQt5.QtGui
import
QIcon, QDesktopServices
from
PyQt5.QtWidgets
import
QApplication, QFrame, QHBoxLayout
from
qfluentwidgets
import
(NavigationItemPosition, MessageBox, MSFluentWindow,
SubtitleLabel, setFont)
from
qfluentwidgets
import
FluentIcon as FIF
from
view.GPS
import
GPS
from
view.MySQLSetting
import
Setting
from
view.onepage
import
Onepage
from
view.device
import
Device
from
view.tikuup
import
Other
from
view.TTdevice
import
TTDevice
from
view.app_other
import
App_other
from
view.user
import
User
import
utils.gl as gl
class
Window(MSFluentWindow):
def
__init__(
self
):
super
().__init__()
gl._init()
self
.homeInterface
=
Onepage(
self
)
self
.app_user
=
User(
self
)
self
.libraryInterface
=
Setting(
self
)
self
.appInterface1
=
GPS(
self
)
self
.appInterface2
=
Device(
self
)
self
.appInterface3
=
TTDevice(
self
)
self
.appInterface4
=
Other(
self
)
self
.libraryInterface1
=
App_other(
self
)
self
.initNavigation()
self
.initWindow()
def
initNavigation(
self
):
self
.addSubInterface(
self
.homeInterface, FIF.HOME,
'主页'
, FIF.HOME_FILL)
self
.addSubInterface(
self
.app_user, FIF.FEEDBACK,
'人员关联'
)
self
.addSubInterface(
self
.appInterface1, FIF.SEND,
'坐标转换'
)
self
.addSubInterface(
self
.appInterface2, FIF.LABEL,
'台账新增'
)
self
.addSubInterface(
self
.appInterface4, FIF.CLOUD_DOWNLOAD,
'题库导入'
)
self
.addSubInterface(
self
.libraryInterface1, FIF.APPLICATION,
'应用'
)
self
.addSubInterface(
self
.libraryInterface, FIF.BOOK_SHELF,
'库'
, FIF.LIBRARY_FILL, NavigationItemPosition.BOTTOM)
self
.navigationInterface.addItem(
routeKey
=
'Help'
,
icon
=
FIF.
HELP
,
text
=
'帮助'
,
onClick
=
self
.showMessageBox,
selectable
=
False
,
position
=
NavigationItemPosition.BOTTOM,
)
self
.navigationInterface.setCurrentItem(
self
.homeInterface.objectName())
def
initWindow(
self
):
self
.resize(
1020
,
760
)
self
.setWindowIcon(QIcon(
':/qfluentwidgets/images/logo.png'
))
self
.setWindowTitle(
'Newdata MySQL Tool'
)
desktop
=
QApplication.desktop().availableGeometry()
w, h
=
desktop.width(), desktop.height()
self
.move(w
/
/
2
-
self
.width()
/
/
2
, h
/
/
2
-
self
.height()
/
/
2
)