1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
   |  
import sys
import time
import serial
import binascii
 
from PyQt4 import QtCore, QtGui
 
class jouer(QtGui.QMainWindow):
    def __init__(self):
 
        # Main Window #
        QtGui.QMainWindow.__init__(self)
        self.resize(310,310)
        self.setWindowTitle(' debutant ')
 
        self.ComboBox_0 = QtGui.QComboBox()
        self.ComboBox_0.setGeometry(QtCore.QRect(10,10,10,10))
        self.ComboBox_0.addItem("A")
        self.ComboBox_0.addItem("B")
 
        self.ComboBox_1 = QtGui.QComboBox()
        self.ComboBox_1.setGeometry(QtCore.QRect(10,10,10,10))
        self.ComboBox_1.addItem("C")
        self.ComboBox_1.addItem("D")
 
        ''' SpinBox 1 '''         
        self.SpinBox_1 = QtGui.QSpinBox(self)
        self.SpinBox_1.setRange(-12,12)
        self.SpinBox_1.setSingleStep(1)
        self.SpinBox_1.setValue(0)
 
        ''' SpinBox 2 '''         
        self.SpinBox_2 = QtGui.QSpinBox(self)
        self.SpinBox_2.setRange(-12,12)
        self.SpinBox_2.setSingleStep(1)
        self.SpinBox_2.setValue(0)
 
 
 
        self.GridLayout_1 = QtGui.QGridLayout()
        self.GridLayout_1.addWidget(self.ComboBox_0,     1,0,1,1)
        self.GridLayout_1.addWidget(self.ComboBox_1,     2,0,1,1)
        self.GridLayout_1.addWidget(self.SpinBox_1,     1,1,1,1)
        self.GridLayout_1.addWidget(self.SpinBox_2,     2,1,1,1)
 
        ''' Group Box '''
        self.O_GroupBox_1 = QtGui.QGroupBox()
        self.O_GroupBox_1.setLayout(self.GridLayout_1)
        ''' Main Window - Central Widget '''
        self.setCentralWidget(self.O_GroupBox_1)
 
 
def main():
        '''Application'''
        App = QtGui.QApplication(sys.argv)
        App.setStyle("windows")
        MainWin2 = jouer()
        MainWin2.show()
        sys.exit(App.exec_() )
 
if __name__=='__main__':
    main() | 
Partager