コード例 #1
0
    def buildUI(self):
        layout = QtWidgets.QGridLayout(self)

        self.name = QtWidgets.QCheckBox()
        self.name.setChecked(self.light.visibility.get())
        self.name.toggled.connect(
            lambda val: self.light.getTransform().visibility.set(val))

        def setLightVisibility(val):
            self.light.visibility.set(val)

        layout.addWidget(self.name, 0, 0)
        self.setName = QtWidgets.QLabel(str(self.light.getTransform()))
        self.setName.setMinimumWidth(120)
        layout.addWidget(self.setName, 0, 1)

        soloBtn = QtWidgets.QPushButton('Solo')
        soloBtn.setCheckable(True)
        soloBtn.toggled.connect(lambda val: self.onSolo.emit(val))
        soloBtn.setMinimumWidth(80)
        layout.addWidget(soloBtn, 0, 2)

        deleteBtn = QtWidgets.QPushButton('Delete')
        deleteBtn.clicked.connect(self.deleteLight)
        deleteBtn.setMinimumWidth(80)
        layout.addWidget(deleteBtn, 0, 3)

        intensity = QtWidgets.QSlider(QtCore.Qt.Horizontal)
        intensity.setMinimum(0)
        intensity.setMaximum(1000)
        intensity.setMinimumWidth(160)
        intensity.setValue(self.light.intensity.get())
        intensity.valueChanged.connect(
            lambda val: self.light.intensity.set(val))
        layout.addWidget(intensity, 0, 4, 1, 1)

        self.colorBtn = QtWidgets.QPushButton()
        self.colorBtn.setMinimumWidth(80)
        self.colorBtn.clicked.connect(self.setColor)
        layout.addWidget(self.colorBtn, 0, 5)
コード例 #2
0
ファイル: toolBoxV.py プロジェクト: sherlockan/PipelineTool
    def buildUI(self):

        # Create a layout
        layout = QtWidgets.QGridLayout(self)
        layout.setContentsMargins(2,2,2,2)

        # Create a check box of light for visibility
        self.name = QtWidgets.QCheckBox(str(self.light.getTransform()))
        self.name.setChecked(self.light.visibility.get())
        self.name.toggled.connect(lambda val: self.light.getTransform().visibility.set(val))
        layout.addWidget(self.name, 0,0)

        # Create a solo button, it will turn on only the light selected, and disable all others
        soloBtn = QtWidgets.QPushButton('Solo')
        soloBtn.setMaximumWidth(40)
        soloBtn.setCheckable(True)
        soloBtn.toggled.connect(lambda val: self.onSolo.emit(val))
        layout.addWidget(soloBtn, 0,1)

        # Create delete button, delete the light selected
        deleteBtn = QtWidgets.QPushButton('Delete')
        deleteBtn.setMaximumWidth(40)
        deleteBtn.clicked.connect(self.deleteLight)
        layout.addWidget(deleteBtn, 0, 2)

        # intensity of light
        intensityLight = QtWidgets.QLineEdit(str(self.light.intensity.get()))
        intensityLight.setMaximumWidth(80)
        intensityLight.textChanged.connect(lambda val: self.light.intensity.set(float(val)))
        layout.addWidget(intensityLight, 0,3)

        # Change mode of light
        self.colorBtn = QtWidgets.QPushButton()
        self.colorBtn.setMaximumSize(20,20)
        self.setButtonColor()
        self.colorBtn.clicked.connect(self.setColorLight)
        layout.addWidget(self.colorBtn, 0,4)