๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
728x90

์ „์ฒด ๊ธ€140

GUI ๊ฐ•์˜3 Fornlayout์„ ์ด์šฉํ•˜์—ฌ ์ž๊ธฐ์†Œ๊ฐœ UI๋งŒ๋“ค๊ธฐ ์ •๋ณด๋ฅผ ์ž…๋ ฅํ•˜๊ฑฐ๋‚˜ ์ถœ๋ ฅํ•˜๋Š”๋ฐ ๋งŽ์ด ์ด์šฉ๋˜๋Š” ํ˜•ํƒœ ํšŒ์›๊ฐ€์ž…, ์ œํ’ˆ ์ŠคํŽ™ ๋“ฑ์„ ํ‘œํ˜„ํ•˜๋Š”๋ฐ ๋งŽ์ด ์‚ฌ์šฉ๋œ๋‹ค. PyQt์—์„œ๋Š” QFormLayout์„ ์ œ๊ณตํ•œ๋‹ค. ํ•œ์ค„ ํ•œ์ค„๋งˆ๋‹ค Lable: field ํ˜•ํƒœ์˜ ๋ฐฐ์น˜ ์ œ๊ณต A : a B : b C : c Label : Field Widget : Widget Label, Field ๋ชจ๋‘ QLabel ๋ณดํ†ต Label์€ text, Field์—๋Š” widget [๊ธฐ๋ณธ ์ฝ”๋”ฉ] import sys from PyQt5 import * from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * class Main(QDialog): def __init.. 2022. 11. 21.
GUI ๊ฐ•์˜2: ๋ ˆ์ด์•„์›ƒ import sys from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * class Main(QDialog): def __init__(self): super().__init__() self.init_ui() def init_ui(self): main_layout = QVBoxLayout() self.setLayout(main_layout) self.resize(500,500) self.show() if __name__ =='__main__': app = QApplication(sys.argv) main = Main() sys.exit(app.exec_() ์œ„์ ฏ ์ถ”๊ฐ€ import sys from PyQt5.QtG.. 2022. 11. 20.
GUI ๊ฐ•์˜ 1 1 .Hello World import sys,os import PyQt5 from PyQt5 import * from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * class Main(QDialog): def __init__(self): super().__init__() self.init_ui() def init_ui(self): layout = QVBoxLayout() label_widget = QLabel("Hello world!") layout.addWidget(label_widget) self.setLayout(layout) self.show() if __name__ =='__main__': app = .. 2022. 11. 20.
๋„คํŠธ์›Œํฌ 2 2022. 11. 18.
728x90