¾È±Ô °øºÎ¹æ

Python ÇÁ·Î±×·¡¹Ö > PyQt5 - Qt¿¡¼­ signal°ú slot

µî·ÏÀÏ : 2017-11-14 14:36 Á¶È¸¼ö : 53,084

Qt¿¡¼­´Â signal°ú slotÀÌ Á¸ÀçÇÑ´Ù. À̺¥Æ® ¹ß»ý½Ã signalÀÌ ¹ß»ýµÇ°í, signal¹ß»ý½Ã È£ÃâµÇ´Â ÇÔ¼ö¸¦ slotÀ̶ó°í ÇÑ´Ù.
±×¸®°í signal°ú slotÀ» ¼­·Î ¿¬°á(connect)ÇØ¾ß ¿Ã¹Ù¸£°Ô ÀÛµ¿ÀÌ µÈ´Ù.

signal°ú slotÀ» ¿¬°áÇÏ´Â ¹æ¹ý
QtCore.QObject.connect(widget, QtCore.SIGNAL(‘signalname’), slot_function)
widget.signalname.connect(slot_function)


À§ÀÇ 2°¡Áö ¹æ¹ý ¸ðµÎ °á°ú´Â °°´Ù.

button(buttonset)¿¡¼­ clicked½Ã±×³ÎÀÌ ¹ß»ý½Ã »ç¿ëÀÚ°¡ Á¤ÀÇÇÑ buttonset_clicked()¸Þ¼­µå°¡ È£ÃâµÇµµ·Ï ¿¹Á¦¸¦ ÀÛ¼ºÇÏ¸é ¾Æ·¡¿Í °°´Ù.
 
# 1 
  self.connect(button_set, Qt.Core.SIGNAL('clicked'), button_set_clicked) 
# 2 
  self.button_set.clicked.connect(button_set_clicked)


 
¡Ø Ȥ½Ã µµ¿òÀÌ µÇ¼Ì´Ù¸é ´ñ±Û¿¡ ÇѸ¶µð ³²°ÜÁÖ¼¼¿ä!
ÀÛ¼ºÀÚ   ºñ¹Ð¹øÈ£
ÀÚµ¿±Û ¹æÁö     (ÀÚµ¿±Û ¹æÁö ±â´ÉÀÔ´Ï´Ù.)
³»¿ë   ´ñ±Û´Þ±â 
À̸ÞÀÏ ¹®ÀÇ : cak0280@nate.com  
Copyright 2000 By ENTERSOFT.KR All Rights Reserved.