發表文章

目前顯示的是 10月, 2022的文章

[第19期]Write a PyQt calculator program by using MVC architecture/使用MVC架構寫一個PyQt計算機程式

圖片
  This video demonstrate how to write a PyQt calculator program by using MVC architecture. The content includes: 1. MVC Architecture Introduction 2. Place codes with different purposes into Model.py, View.py and Controller.py PS: calculator.py please refer to video No. 18. 本視頻說明如何使用MVC架構寫一個PyQt計算機程式, 內容包含: 1. MVC架構簡介 2. 將不同意義的程式碼分別寫在Model.py, View.py以及Controller.py中。 註: calculator.py請參考第18期視頻 PyQt Template模板 import sys from PyQ t5 import QtWidgets , uic class MainWindow ( QtWidgets . QMainWindow ): def __init__ ( self , * args , ** kwargs ): super ( MainWindow , self ). __init__ ( * args , ** kwargs ) #Load the UI Page by PyQt5 uic . loadUi ( "ui name.ui" , self ) self . setWindowTitle ( "ui title" ) def main (): app = QtWidgets . QApplication ( sys . argv ) main = MainWindow () main . show () sys . exit ( app . exec ()) if __name__ == '__main__' : m...

[第18期]Use PyQt and Qt Designer to implement GUI of Calculator/使用PyQt與Qt Designer製作計算機圖形介面

圖片
This video introduce how to use PyQt and Qt Designer to implement GUI of Calculator. Including: 1. Use Qt Designer to design User Interface  2. Load UI file  3. Connect “Signal”and “Slot”  Use Signal/Slot Editor in Qt Designer中 Use connect() Method to connect Signal and Slot 4. Make a calculator with Button, LineEdit and Label 本視頻介紹如何使用PyQt與Qt Designer製作計算機圖形介面,內容包含: 1. 使用Qt Designer設計介面  2. 在PyQt中載入UI檔  3. 連接"信號"與"槽"  在Qt Designer中使用Signal/Slot Editor 在程式中使用connect()方法連結Signal和Slot 4. 使用按鈕、文字輸入與標籤來製作計算機 (2022/10/13) Updated Video/更新的視頻 PyQt Template模板 import sys from PyQ t5 import QtWidgets , uic class MainWindow ( QtWidgets . QMainWindow ): def __init__ ( self , * args , ** kwargs ): super ( MainWindow , self ). __init__ ( * args , ** kwargs ) #Load the UI Page by PyQt5 uic . loadUi ( "ui name.ui" , self ) self . setWindowTitle ( "ui title" ) def main (): app = QtWidget...