import sys
from PyQt5.QtWidgets import QApplication,QWidget,QCheckBox
qAp = QApplication(sys.argv)
natang = QWidget()
chongtick = QCheckBox('เอา',natang) # สร้างช่องติ๊ก
chongtick.move(20,20)
natang.show()
qAp.exec_()
import sys
from PyQt5.QtWidgets import QApplication,QWidget,QCheckBox
qAp = QApplication(sys.argv)
natang = QWidget()
chongtick1 = QCheckBox('ooo',natang)
chongtick1.setChecked(True) # ตั้งให้ติ๊ก
chongtick1.move(10,10)
chongtick2 = QCheckBox('oxo',natang)
chongtick2.setChecked(False) # ตั้งให้ไม่ติ๊ก
chongtick2.move(10,40)
natang.show()
qAp.exec_()
import sys
from PyQt5.QtWidgets import QApplication,QWidget,QCheckBox,QPushButton
qAp = QApplication(sys.argv)
natang = QWidget()
chongtick1 = QCheckBox('soba',natang)
chongtick1.move(10,10)
chongtick2 = QCheckBox('ramen',natang)
chongtick2.move(70,10)
chongtick3 = QCheckBox('udon',natang)
chongtick3.move(130,10)
def tickmot():
chongtick1.setChecked(True)
chongtick2.setChecked(True)
chongtick3.setChecked(True)
pumkot = QPushButton('zenbu',natang)
pumkot.move(10,40)
pumkot.clicked.connect(tickmot)
natang.show()
qAp.exec_()
import sys
from PyQt5.QtWidgets import QApplication,QWidget,QCheckBox,QPushButton
qAp = QApplication(sys.argv)
natang = QWidget()
chongtick1 = QCheckBox('ก',natang)
chongtick1.move(10,10)
chongtick2 = QCheckBox('ข',natang)
chongtick2.setChecked(True)
chongtick2.move(70,10)
chongtick3 = QCheckBox('ค',natang)
chongtick3.move(130,10)
def tickmot():
chongtick1.toggle()
chongtick2.toggle()
chongtick3.toggle()
pumkot = QPushButton('@@@',natang)
pumkot.move(50,40)
pumkot.clicked.connect(tickmot)
natang.show()
qAp.exec_()
import sys
from PyQt5.QtWidgets import QApplication,QWidget,QCheckBox
qAp = QApplication(sys.argv)
natang = QWidget()
chongtick = QCheckBox('!!!!',natang)
chongtick.move(10,10)
chongtick.toggled.connect(lambda: print('!!!'))
natang.show()
qAp.exec_()
import sys
from PyQt5.QtWidgets import QApplication,QWidget,QCheckBox
qAp = QApplication(sys.argv)
natang = QWidget()
def tickyumai():
if(chongtick.isChecked()):
print('ติ๊กอยู่')
else:
print('ไม่ติ๊กแล้ว')
chongtick = QCheckBox('ติ๊กต๊อก',natang)
chonttick.setStyleSheet('background-color: #9fe; font-family: Tahoma')
chongtick.move(10,10)
chongtick.toggled.connect(tickyumai)
natang.show()
qAp.exec_()
import sys
from PyQt5.QtWidgets import QApplication,QWidget,QCheckBox
qAp = QApplication(sys.argv)
natang = QWidget()
chongtick1 = QCheckBox('T_T',natang)
chongtick1.move(10,10)
chongtick1.setCheckable(False)
def tickla():
chongtick1.setCheckable(chongtick2.isChecked())
chongtick2 = QCheckBox('^_^',natang)
chongtick2.move(80,10)
chongtick2.toggled.connect(tickla)
natang.show()
qAp.exec_()
ติดตามอัปเดตของบล็อกได้ที่แฟนเพจ