基于Dragonboard 410c的智能魔鏡設(shè)計(8)-python腳本實現(xiàn)UI原型_第1頁
基于Dragonboard 410c的智能魔鏡設(shè)計(8)-python腳本實現(xiàn)UI原型_第2頁
基于Dragonboard 410c的智能魔鏡設(shè)計(8)-python腳本實現(xiàn)UI原型_第3頁
基于Dragonboard 410c的智能魔鏡設(shè)計(8)-python腳本實現(xiàn)UI原型_第4頁
基于Dragonboard 410c的智能魔鏡設(shè)計(8)-python腳本實現(xiàn)UI原型_第5頁
已閱讀5頁,還剩10頁未讀 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)

文檔簡介

基于Dragonboard410c的智能魔鏡設(shè)計(8)——python腳本實現(xiàn)UI原型在上一篇文章中,已經(jīng)跟大家介紹如何智能魔鏡的UI原型設(shè)計,并且采用designer.exe工具完成了原始的魔鏡UI界面設(shè)計,可以看出,整個魔鏡的UI設(shè)計非常簡單,但是如果要實心較好的效果,我們單獨使用designer.exe工具很難完成,這就需要我們在完成原型設(shè)計后得到的xml文件進行進一步的修改和細(xì)化,以達到我們的設(shè)計要求。這里,大家可以直接修改designer.exe文件的xml的元素的屬性等來調(diào)節(jié)和細(xì)化UI,同時也可以使用pyuic5工具將其轉(zhuǎn)換成py腳本,然后對其進行修改,本文在設(shè)計中,直接使用pyuic5工具將其進行了轉(zhuǎn)換,然后進行修改,最終得到的UI代碼如下:#-*-coding:utf-8-*-fromPyQt5importQtCore,QtGui,QtWidgetsclassUi_MainWindow(object):defsetupUi(self,MainWindow):MainWindow.setObjectName(“MainWindow”)desktopRect=QtWidgets.QDesktopWidget().screenGeometry()MainWindow.resize(desktopRect.width(),desktopRect.height())icon=QtGui.QIcon()icon.addPixmap(QtGui.QPixmap(“:/images/icon”),QtGui.QIcon.Normal,QtGui.QIcon.Off)MainWindow.setWindowIcon(icon)self.centralWidget=QtWidgets.QWidget(MainWindow)self.centralWidget.setObjectName(“centralWidget”)self.centralWidget.resize(357,1059)self.temp=QtWidgets.QLabel(self.centralWidget)self.centralWidget.setGeometry(desktopRect.width()-self.centralWidget.width(),0,self.centralWidget.width(),self.centralWidget.height())self.temp.setGeometry(QtCore.QRect(20,60,231,100))font=QtGui.QFont()font.setFamily(“楷體”)font.setPointSize(40)font.setBold(False)font.setWeight(50)self.temp.setFont(font)self.temp.setText(“”)self.temp.setAlignment(QtCore.Qt.AlignCenter)self.temp.setObjectName(“temp”)self.city=QtWidgets.QLabel(self.centralWidget)self.city.setGeometry(QtCore.QRect(50,160,150,30))font=QtGui.QFont()font.setPointSize(13)font.setBold(True)font.setWeight(75)self.city.setFont(font)self.city.setText(“”)self.city.setAlignment(QtCore.Qt.AlignCenter)self.city.setObjectName(“city”)self.date=QtWidgets.QLabel(self.centralWidget)self.date.setGeometry(QtCore.QRect(30,245,211,25))font=QtGui.QFont()font.setPointSize(10)font.setBold(True)font.setWeight(75)self.date.setFont(font)self.date.setText(“”)self.date.setAlignment(QtCore.Qt.AlignCenter)self.date.setObjectName(“date”)self.closeButton=QtWidgets.QPushButton(self.centralWidget)self.closeButton.setGeometry(QtCore.QRect(240,5,25,25))self.closeButton.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))self.closeButton.setText(“”)self.closeButton.setFlat(True)self.closeButton.setObjectName(“closeButton”)#self.layoutWidget=QtWidgets.QWidget(self.centralWidget)self.layoutWidget=QtWidgets.QWidget(MainWindow)self.layoutWidget.setGeometry(QtCore.QRect(0,desktopRect.height()-170,desktopRect.width(),170))self.layoutWidget.setObjectName(“l(fā)ayoutWidget”)self.horizontalLayout=QtWidgets.QHBoxLayout(self.layoutWidget)self.horizontalLayout.setContentsMargins(11,11,11,11)self.horizontalLayout.setSpacing(6)self.horizontalLayout.setObjectName(“horizontalLayout”)self.gridLayout=QtWidgets.QGridLayout()self.gridLayout.setContentsMargins(11,11,11,11)self.gridLayout.setSpacing(8)self.gridLayout.setObjectName(“gridLayout”)self.forecast_0_date=QtWidgets.QLabel(self.layoutWidget)self.forecast_0_date.setMinimumSize(QtCore.QSize(80,20))self.forecast_0_date.setMaximumSize(QtCore.QSize(200,40))font=QtGui.QFont()font.setFamily(“微軟雅黑”)font.setPointSize(8)self.forecast_0_date.setFont(font)self.forecast_0_date.setText(“”)self.forecast_0_date.setAlignment(QtCore.Qt.AlignCenter)self.forecast_0_date.setObjectName(“forecast_0_date”)self.gridLayout.addWidget(self.forecast_0_date,0,0,1,1)self.forecast_0_type=QtWidgets.QLabel(self.layoutWidget)self.forecast_0_type.setMinimumSize(QtCore.QSize(78,75))self.forecast_0_type.setText(“”)self.forecast_0_type.setScaledContents(True)self.forecast_0_type.setObjectName(“forecast_0_type”)self.gridLayout.addWidget(self.forecast_0_type,1,0,1,1)self.forecast_0_temp=QtWidgets.QLabel(self.layoutWidget)self.forecast_0_temp.setMinimumSize(QtCore.QSize(75,20))self.forecast_0_temp.setMaximumSize(QtCore.QSize(200,40))font=QtGui.QFont()font.setFamily(“微軟雅黑”)font.setPointSize(8)self.forecast_0_temp.setFont(font)self.forecast_0_temp.setText(“”)self.forecast_0_temp.setAlignment(QtCore.Qt.AlignCenter)self.forecast_0_temp.setObjectName(“forecast_0_temp”)self.gridLayout.addWidget(self.forecast_0_temp,2,0,1,1)self.horizontalLayout.addLayout(self.gridLayout)self.gridLayout_2=QtWidgets.QGridLayout()self.gridLayout_2.setContentsMargins(11,11,11,11)self.gridLayout_2.setSpacing(8)self.gridLayout_2.setObjectName(“gridLayout_2”)self.forecast_1_date=QtWidgets.QLabel(self.layoutWidget)self.forecast_1_date.setMinimumSize(QtCore.QSize(75,20))self.forecast_1_date.setMaximumSize(QtCore.QSize(200,40))font=QtGui.QFont()font.setFamily(“微軟雅黑”)font.setPointSize(8)self.forecast_1_date.setFont(font)self.forecast_1_date.setText(“”)self.forecast_1_date.setAlignment(QtCore.Qt.AlignCenter)self.forecast_1_date.setObjectName(“forecast_1_date”)self.gridLayout_2.addWidget(self.forecast_1_date,0,0,1,1)self.forecast_1_type=QtWidgets.QLabel(self.layoutWidget)self.forecast_1_type.setMinimumSize(QtCore.QSize(78,75))self.forecast_1_type.setText(“”)self.forecast_1_type.setScaledContents(True)self.forecast_1_type.setObjectName(“forecast_1_type”)self.gridLayout_2.addWidget(self.forecast_1_type,1,0,1,1)self.forecast_1_temp=QtWidgets.QLabel(self.layoutWidget)self.forecast_1_temp.setMinimumSize(QtCore.QSize(75,20))self.forecast_1_temp.setMaximumSize(QtCore.QSize(200,40))font=QtGui.QFont()font.setFamily(“微軟雅黑”)font.setPointSize(8)self.forecast_1_temp.setFont(font)self.forecast_1_temp.setText(“”)self.forecast_1_temp.setAlignment(QtCore.Qt.AlignCenter)self.forecast_1_temp.setObjectName(“forecast_1_temp”)self.gridLayout_2.addWidget(self.forecast_1_temp,2,0,1,1)self.horizontalLayout.addLayout(self.gridLayout_2)self.gridLayout_3=QtWidgets.QGridLayout()self.gridLayout_3.setContentsMargins(11,11,11,11)self.gridLayout_3.setSpacing(6)self.gridLayout_3.setObjectName(“gridLayout_3”)self.forecast_2_date=QtWidgets.QLabel(self.layoutWidget)self.forecast_2_date.setMinimumSize(QtCore.QSize(75,20))self.forecast_2_date.setMaximumSize(QtCore.QSize(200,40))font=QtGui.QFont()font.setFamily(“微軟雅黑”)font.setPointSize(8)self.forecast_2_date.setFont(font)self.forecast_2_date.setText(“”)self.forecast_2_date.setAlignment(QtCore.Qt.AlignCenter)self.forecast_2_date.setObjectName(“forecast_2_date”)self.gridLayout_3.addWidget(self.forecast_2_date,0,0,1,1)self.forecast_2_type=QtWidgets.QLabel(self.layoutWidget)self.forecast_2_type.setMinimumSize(QtCore.QSize(78,75))self.forecast_2_type.setText(“”)self.forecast_2_type.setScaledContents(True)self.forecast_2_type.setObjectName(“forecast_2_type”)self.gridLayout_3.addWidget(self.forecast_2_type,1,0,1,1)self.forecast_2_temp=QtWidgets.QLabel(self.layoutWidget)self.forecast_2_temp.setMinimumSize(QtCore.QSize(75,20))self.forecast_2_temp.setMaximumSize(QtCore.QSize(200,40))font=QtGui.QFont()font.setFamily(“微軟雅黑”)font.setPointSize(8)self.forecast_2_temp.setFont(font)self.forecast_2_temp.setText(“”)self.forecast_2_temp.setAlignment(QtCore.Qt.AlignCenter)self.forecast_2_temp.setObjectName(“forecast_2_temp”)self.gridLayout_3.addWidget(self.forecast_2_temp,2,0,1,1)self.horizontalLayout.addLayout(self.gridLayout_3)self.gridLayout_4=QtWidgets.QGridLayout()self.gridLayout_4.setContentsMargins(11,11,11,11)self.gridLayout_4.setSpacing(6)self.gridLayout_4.setObjectName(“gridLayout_4”)self.forecast_3_date=QtWidgets.QLabel(self.layoutWidget)self.forecast_3_date.setMinimumSize(QtCore.QSize(75,20))self.forecast_3_date.setMaximumSize(QtCore.QSize(200,40))font=QtGui.QFont()font.setFamily(“微軟雅黑”)font.setPointSize(8)self.forecast_3_date.setFont(font)self.forecast_3_date.setText(“”)self.forecast_3_date.setAlignment(QtCore.Qt.AlignCenter)self.forecast_3_date.setObjectName(“forecast_3_date”)self.gridLayout_4.addWidget(self.forecast_3_date,0,0,1,1)self.forecast_3_type=QtWidgets.QLabel(self.layoutWidget)self.forecast_3_type.setMinimumSize(QtCore.QSize(78,75))self.forecast_3_type.setText(“”)self.forecast_3_type.setScaledContents(True)self.forecast_3_type.setObjectName(“forecast_3_type”)self.gridLayout_4.addWidget(self.forecast_3_type,1,0,1,1)self.forecast_3_temp=QtWidgets.QLabel(self.layoutWidget)self.forecast_3_temp.setMinimumSize(QtCore.QSize(75,20))self.forecast_3_temp.setMaximumSize(QtCore.QSize(200,40))font=QtGui.QFont()font.setFamily(“微軟雅黑”)font.setPointSize(8)self.forecast_3_temp.setFont(font)self.forecast_3_temp.setText(“”)self.forecast_3_temp.setAlignment(QtCore.Qt.AlignCenter)self.forecast_3_temp.setObjectName(“forecast_3_temp”)self.gridLayout_4.addWidget(self.forecast_3_temp,2,0,1,1)self.horizontalLayout.addLayout(self.gridLayout_4)self.gridLayout_5=QtWidgets.QGridLayout()self.gridLayout_5.setContentsMargins(11,11,11,11)self.gridLayout_5.setSpacing(6)self.gridLayout_5.setObjectName(“gridLayout_5”)self.forecast_4_date=QtWidgets.QLabel(self.layoutWidget)self.forecast_4_date.setMinimumSize(QtCore.QSize(75,20))self.forecast_4_date.setMaximumSize(QtCore.QSize(200,40))font=QtGui.QFont()font.setFamily(“微軟雅黑”)font.setPointSize(8)self.forecast_4_date.setFont(font)self.forecast_4_date.setText(“”)self.forecast_4_date.setAlignment(QtCore.Qt.AlignCenter)self.forecast_4_date.setObjectName(“forecast_4_date”)self.gridLayout_5.addWidget(self.forecast_4_date,0,0,1,1)self.forecast_4_temp=QtWidgets.QLabel(self.layoutWidget)self.forecast_4_temp.setMinimumSize(QtCore.QSize(75,20))self.forecast_4_temp.setMaximumSize(QtCore.QSize(200,40))font=QtGui.QFont()font.setFamily(“微軟雅黑”)font.setPointSize(8)self.forecast_4_temp.setFont(font)self.forecast_4_temp.setText(“”)self.forecast_4_temp.setAlignment(QtCore.Qt.AlignCenter)self.forecast_4_temp.setObjectName(“forecast_4_temp”)self.gridLayout_5.addWidget(self.forecast_4_temp,2,0,1,1)self.forecast_4_type=QtWidgets.QLabel(self.layoutWidget)self.forecast_4_type.setMinimumSize(QtCore.QSize(78,75))self.forecast_4_type.setText(“”)self.forecast_4_type.setScaledContents(True)self.forecast_4_type.setObjectName(“forecast_4_type”)self.gridLayout_5.addWidget(self.forecast_4_type,1,0,1,1)self.horizontalLayout.addLayout(self.gridLayout_5)self.layoutWidget1=QtWidgets.QWidget(self.centralWidget)self.layoutWidget1.setGeometry(QtCore.QRect(10,200,120,55))self.layoutWidget1.setObjectName(“l(fā)ayoutWidget1”)self.gridLayout_7=QtWidgets.QGridLayout(self.layoutWidget1)self.gridLayout_7.setContentsMargins(11,11,11,11)self.gridLayout_7.setSpacing(6)self.gridLayout_7.setObjectName(“gridLayout_7”)self.label_3=QtWidgets.QLabel(self.layoutWidget1)self.label_3.setMinimumSize(QtCore.QSize(30,30))self.label_3.setMaximumSize(QtCore.QSize(60,30))font=QtGui.QFont()font.setPointSize(9)font.setBold(True)font.setWeight(75)self.label_3.setFont(font)self.label_3.setText(“”)self.label_3.setScaledContents(True)self.label_3.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)self.label_3.setObjectName(“l(fā)abel_3”)self.gridLayout_7.addWidget(self.label_3,0,0,1,1)self.shidu=QtWidgets.QLabel(self.layoutWidget1)#self.shidu.setFont(font)self.shidu.setMinimumSize(QtCore.QSize(30,30))self.shidu.setMaximumSize(QtCore.QSize(60,30))font=QtGui.QFont()font.setPointSize(9)font.setBold(False)font.setWeight(50)self.shidu.setFont(font)self.shidu.setText(“”)self.shidu.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)self.shidu.setObjectName(“shidu”)self.gridLayout_7.addWidget(self.shidu,0,1,1,1)self.layoutWidget2=QtWidgets.QWidget(self.centralWidget)self.layoutWidget2.setGeometry(QtCore.QRect(110,200,200,55))self.layoutWidget2.setObjectName(“l(fā)ayoutWidget2”)self.gridLayout_8=QtWidgets.QGridLayout(self.layoutWidget2)self.gridLayout_8.setContentsMargins(11,11,11,11)self.gridLayout_8.setSpacing(6)self.gridLayout_8.setObjectName(“gridLayout_8”)self.fengxiang=QtWidgets.QLabel(self.layoutWidget2)self.fengxiang.setMinimumSize(QtCore.QSize(70,30))self.fengxiang.setMaximumSize(QtCore.QSize(70,30))font=QtGui.QFont()font.setPointSize(9)font.setBold(True)font.setWeight(75)self.fengxiang.setFont(font)self.fengxiang.setText(“”)self.fengxiang.setScaledContents(True)self.fengxiang.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)self.fengxiang.setObjectName(“fengxiang”)self.gridLayout_8.addWidget(self.fengxiang,0,0,1,1)self.fengli=QtWidgets.QLabel(self.layoutWidget2)self.fengli.setMinimumSize(QtCore.QSize(80,30))self.fengli.setMaximumSize(QtCore.QSize(80,30))font=QtGui.QFont()font.setPointSize(9)font.setBold(False)font.setWeight(50)self.fengli.setFont(font)self.fengli.setText(“”)self.fengli.setObjectName(“fengli”)self.gridLayout_8.addWidget(self.fengli,0,1,1,1)self.webMessageText=QtWebKitWidgets.QWebView(self.centralWidget)self.webMessageText.setGeometry(QtCore.QRect(10,460,331,241))self.webMessageText.setUrl(QtCore.QUrl(“about:bl

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論