diff --git a/Wordcloud_GUI/main.py b/Wordcloud_GUI/main.py index 0572abc..eb429fa 100644 --- a/Wordcloud_GUI/main.py +++ b/Wordcloud_GUI/main.py @@ -20,12 +20,11 @@ class mainthread: self.mainWindow = uic.loadUi('main.ui') self.mainWindow.FileChooseButton.clicked.connect(self.Choose_File) self.mainWindow.MaskChooseButton.clicked.connect(self.Choose_Mask) - self.mainWindow.FontSelectionBox.addItems(['Adobe 黑体 Std R', '华文行楷 R', '楷体 R', '微软雅黑 R', '幼圆 R']) - self.mainWindow.FontSelectionBox.currentIndexChanged.connect(self.selectionChange) + self.mainWindow.FontSelectBox.addItems(['Adobe 黑体 Std R', '华文行楷 R', '楷体 R', '微软雅黑 R', '宋体 R', '幼圆 R']) + self.mainWindow.FontSelectBox.currentIndexChanged.connect(self.selectionChange) self.mainWindow.FontSizeSelectBox.valueChanged.connect(self.valueChange1) self.mainWindow.MaxWordCountBox.valueChanged.connect(self.valueChange2) - self.mainWindow.GenerateButton.toggle() - self.mainWindow.GenerateButton.clicked.connect(self.Generate_Action()) + self.mainWindow.GenerateButton.clicked.connect(lambda: self.Generate_Action()) # 文本选择 def Choose_File(self): @@ -61,15 +60,21 @@ class mainthread: def selectionChange(i): WcModule.font = fontlist[i] - @staticmethod - def Generate_Action(): + def Generate_Action(self): + print(WcModule.size, WcModule.maxword, WcModule.font, WcModule.file, WcModule.mask) + cursor = self.mainWindow.LogBrowser.textCursor() + cursor.movePosition(QtGui.QTextCursor.End) + cursor.insertText(f"[Sys]:Parameters:{WcModule.size, WcModule.maxword, WcModule.font, WcModule.file, WcModule.mask}\n") + cursor.insertText(f"[Sys]:Generating.....\n") + self.mainWindow.LogBrowser.setTextCursor(cursor) + self.mainWindow.LogBrowser.ensureCursorVisible() WcModule.generate(WcModule.size, WcModule.maxword, WcModule.font, WcModule.file, WcModule.mask) fontlist = ("AdobeHeitiStd-Regular.otf", "STXINGKA.TTF", "simkai.ttf", "msyh.ttc", "simsun.ttc", "SIMYOU.TTF") + if __name__ == '__main__': app = QApplication(sys.argv) - # 显示UI m_main = mainthread() m_main.mainWindow.show() app.exec_() diff --git a/Wordcloud_GUI/main.ui b/Wordcloud_GUI/main.ui index 4285720..3de39f4 100644 --- a/Wordcloud_GUI/main.ui +++ b/Wordcloud_GUI/main.ui @@ -7,7 +7,7 @@ 0 0 501 - 501 + 382 @@ -25,7 +25,7 @@ 380 - 460 + 340 101 32 @@ -43,43 +43,11 @@ true - - - - 20 - 110 - 461 - 91 - - - - - - - 20 - 90 - 81 - 21 - - - - - Adobe 黑体 Std R - 10 - - - - 文字预览 - - - Qt::NoTextInteraction - - 400 - 300 + 180 81 41 @@ -92,7 +60,7 @@ 20 - 300 + 180 371 41 @@ -102,7 +70,7 @@ 20 - 280 + 160 81 21 @@ -124,7 +92,7 @@ 20 - 370 + 250 461 81 @@ -134,7 +102,7 @@ 20 - 350 + 230 81 21 @@ -156,7 +124,7 @@ 20 - 230 + 110 371 41 @@ -166,7 +134,7 @@ 400 - 230 + 110 81 41 @@ -179,7 +147,7 @@ 20 - 210 + 90 81 21 @@ -238,25 +206,6 @@ Qt::NoTextInteraction - - - - 160 - 40 - 181 - 41 - - - - ArrowCursor - - - true - - - true - - @@ -324,7 +273,7 @@ 20 - 460 + 340 93 28 @@ -333,6 +282,16 @@ Generate + + + + 140 + 40 + 221 + 41 + + + MaskChooseButton @@ -342,8 +301,6 @@ FileChooseButton FontSizeSelectBox MaxWordCountBox - FontSelectionBox - SizePreview