Skip to content

Commit 0858070

Browse files
committed
增加图标
1 parent 0386a16 commit 0858070

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

logo.png

61.6 KB
Loading

mainwindow.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ def setupUi(self, MainWindow):
1919
MainWindow.setSizePolicy(sizePolicy)
2020
MainWindow.setMinimumSize(QtCore.QSize(800, 600))
2121
MainWindow.setMaximumSize(QtCore.QSize(16777215, 16777215))
22+
icon = QtGui.QIcon()
23+
icon.addPixmap(QtGui.QPixmap(":/img/logo.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
24+
MainWindow.setWindowIcon(icon)
2225
self.centralWidget = QtWidgets.QWidget(MainWindow)
2326
self.centralWidget.setObjectName("centralWidget")
2427
self.verticalLayout = QtWidgets.QVBoxLayout(self.centralWidget)
@@ -80,6 +83,7 @@ def retranslateUi(self, MainWindow):
8083
self.btn_copy.setText(_translate("MainWindow", "复制"))
8184
self.btn_generate.setText(_translate("MainWindow", "生成Bean"))
8285

86+
import logo_rc
8387

8488
if __name__ == "__main__":
8589
import sys

mainwindow.ui

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@
2929
</size>
3030
</property>
3131
<property name="windowTitle">
32-
<string>JSONFormat4Flutter(v0.4)</string>
32+
<string>JSONFormat4Flutter(v0.5)</string>
33+
</property>
34+
<property name="windowIcon">
35+
<iconset resource="logo.qrc">
36+
<normaloff>:/img/logo.png</normaloff>:/img/logo.png</iconset>
3337
</property>
3438
<widget class="QWidget" name="centralWidget">
3539
<layout class="QVBoxLayout" name="verticalLayout">
@@ -101,6 +105,8 @@
101105
</widget>
102106
</widget>
103107
<layoutdefault spacing="6" margin="11"/>
104-
<resources/>
108+
<resources>
109+
<include location="logo.qrc"/>
110+
</resources>
105111
<connections/>
106112
</ui>

0 commit comments

Comments
 (0)