PyQt4

QThread

PyQtに実装されてある非同期処理です。 import sys from PyQt4 import QtCore from PyQt4 import QtGui class Worker(QtCore.QThread): mutex = QtCore.QMutex() def __init__(self, name = "", parent = None): QtCore.QThread.__init__(self, parent) self…

QProgressBar

import sys from PyQt4 import QtGui, QtCore class Example(QtGui.QWidget): def __init__(self): super(Example, self).__init__() # create layout self.vbox = QtGui.QVBoxLayout(self) # #self.vbox.setSizeConstraint(QtGui.QLayout.SetMaximumSize) #…

QCheckBox

import sys from PyQt4 import QtGui, QtCore class Example(QtGui.QWidget): def __init__(self): super(Example, self).__init__() self.cb = QtGui.QCheckBox('&Show title', self) self.cb.move(20, 20) # 状態を3つに増やす self.cb.setTristate() # s…

QSlider

import sys from PyQt4 import QtGui, QtCore class Example(QtGui.QWidget): def __init__(self): super(Example, self).__init__() # mainlayout hbox = QtGui.QVBoxLayout(self) # background self.bgColor = QtGui.QColor(0, 0, 0) self.bg = QtGui.QFra…

QAbstractSlider

import sys from PyQt4 import QtGui, QtCore class Example(QtGui.QWidget): def __init__(self): super(Example, self).__init__() # create components self.lcd = QtGui.QLCDNumber(self) self.lcd.setBaseSize(100, 100) self.sldh = QtGui.QSlider(QtC…

PyScripter exceptions.AttributeError

自動補完機能が付いてる便利なPythonIDE PyScripterを使っててエラーが出た。 PyQt4のクラスを補完してくれるようにパスを通そうとしてたところ、 Ctrl+Spaceでリストボックス出すと Traceback (most recent call last): File "D:\Python27\Lib\inspect.py",…