def __init__(self): QtGui.QFrame.__init__(self) QtGui.QHBoxLayout(self) self.__tabWidget = QtGui.QTabWidget(self) self.layout().addWidget(self.__tabWidget) assetTab = QtGui.QFrame(self) QtGui.QHBoxLayout(assetTab) self.__tabWidget.addTab(assetTab, "Asset") self.__showList = self.__buildListWidget("Show", assetTab.layout()) self.__shotList = self.__buildListWidget("Shot", assetTab.layout()) self.__nameList = self.__buildListWidget("Asset", assetTab.layout()) self.__versionList = self.__buildListWidget("Version", assetTab.layout()) self.connect(self.__showList, QtCore.SIGNAL("itemSelectionChanged()"), self.__updateShow) self.connect(self.__shotList, QtCore.SIGNAL("itemSelectionChanged()"), self.__updateShot) self.connect(self.__nameList, QtCore.SIGNAL("itemSelectionChanged()"), self.__updateAsset) self.connect(self.__versionList, QtCore.SIGNAL("itemSelectionChanged()"), self.__updateVersion) sandboxTab = QtGui.QFrame(self) QtGui.QHBoxLayout(sandboxTab) self.__tabWidget.addTab(sandboxTab, "Sandbox") self.__sandboxList = self.__buildListWidget("Sandbox", sandboxTab.layout()) self.__widgetsDict = { "show": self.__showList, "shot": self.__shotList, "name": self.__nameList, "version": self.__versionList, "sandbox": self.__sandboxList, } self.__showList.clear() self.__showList.addItems(_getShows()) self.__sandboxList.addItems(_getSandboxFiles())
def create(self): widget = QtGui.QWidget() widget_a = QtGui.QWidget() widget_b = QtGui.QWidget() palette = widget.palette() palette.setColor(widget.backgroundRole(), QtGui.QColor(0.14 * 255, 0.14 * 255, 0.14 * 255)) widget.setPalette(palette) layout = QtGui.QVBoxLayout(widget) layout.setSpacing(5) layout.setContentsMargins(0, 0, 0, 0) layout_a = QtGui.QVBoxLayout(widget_a) layout_b = QtGui.QVBoxLayout(widget_b) layout_a.setContentsMargins(10, 10, 10, 10) layout_b.setContentsMargins(10, 10, 10, 10) widget_line = QtGui.QFrame() widget_line.setFrameShape(QtGui.QFrame.HLine) widget_line.setFrameShadow(QtGui.QFrame.Sunken) layout.addWidget(widget_a) layout.addWidget(widget_line) layout.addWidget(widget_b) self.pre_shot_image = kImageWidget() pre_shot_image_path = os.path.join(_iconsDir, "no-image.svg") pixmap = QtGui.QPixmap(pre_shot_image_path) self.pre_shot_image.setPixmap(pixmap) self.post_shot_image = kImageWidget() post_shot_image_path = os.path.join(_iconsDir, "no-image.svg") pixmap = QtGui.QPixmap(post_shot_image_path) self.post_shot_image.setPixmap(pixmap) self.pre_shot_label = QtGui.QLabel() self.pre_shot_label.setFont( QtGui.QFont("Rome times", 6, QtGui.QFont.Bold)) self.pre_shot_label.setText( "<font color='white'>Pre Shot : None</font>") self.pre_shot_label.setAlignment(QtCore.Qt.AlignLeft) self.pre_shot_label.setGeometry(5, 5, 300, 100) self.pre_shot_label.setParent(self.pre_shot_image) self.post_shot_label = QtGui.QLabel() self.post_shot_label.setFont( QtGui.QFont("Rome times", 6, QtGui.QFont.Bold)) self.post_shot_label.setText( "<font color='white'>Post Shot : None</font>") self.post_shot_label.setAlignment(QtCore.Qt.AlignLeft) self.post_shot_label.setGeometry(5, 5, 300, 100) self.post_shot_label.setParent(self.post_shot_image) layout_a.addWidget(self.pre_shot_image) layout_b.addWidget(self.post_shot_image) return widget
def __init__(self): """Builds the initial combose box UI""" QtGui.QFrame.__init__(self) QtGui.QVBoxLayout(self) assetFrame = QtGui.QFrame(self) QtGui.QHBoxLayout(assetFrame) self.layout().addWidget(assetFrame) assetFrame.layout().addWidget(QtGui.QLabel("show:")) self.__showCombobox = QtGui.QComboBox() assetFrame.layout().addWidget(self.__showCombobox) assetFrame.layout().addWidget(QtGui.QLabel("shot:")) self.__shotCombobox = QtGui.QComboBox() assetFrame.layout().addWidget(self.__shotCombobox) assetFrame.layout().addWidget(QtGui.QLabel("asset:")) self.__assetCombobox = QtGui.QComboBox() assetFrame.layout().addWidget(self.__assetCombobox) assetFrame.layout().addWidget(QtGui.QLabel("version:")) self.__versionCombobox = QtGui.QComboBox() assetFrame.layout().addWidget(self.__versionCombobox) self.connect(self.__showCombobox, QtCore.SIGNAL("currentIndexChanged(QString)"), self.__updateShow) self.connect(self.__shotCombobox, QtCore.SIGNAL("currentIndexChanged(QString)"), self.__updateShot) self.connect(self.__assetCombobox, QtCore.SIGNAL("currentIndexChanged(QString)"), self.__updateAsset) self.connect(self.__versionCombobox, QtCore.SIGNAL("currentIndexChanged(QString)"), self.__updateVersion) # Modify the integrated QListViews to lay out the items every time the # view is resized, so that changes in the application font preferences # are correctly reflected for combobox in (self.__showCombobox, self.__shotCombobox, self.__assetCombobox, self.__versionCombobox): combobox.view().setResizeMode(QtGui.QListView.Adjust) self.__sandboxCheckBox = QtGui.QCheckBox('Save to Sandbox', self) self.layout().addWidget(self.__sandboxCheckBox) self.__showCombobox.addItems(_getShows())
def __init__(self, parent): BaseTab.__init__(self, parent) self.__runtime = None self.__client = None self.setLayout(QtGui.QVBoxLayout()) self.layout().setSpacing(2) self.layout().setMargin(0) self.__locationsLabel = QtGui.QLabel('Locations') self.layout().addWidget(self.__locationsLabel) self.__locationInfoLabel = QtGui.QLabel('Info') self.layout().addWidget(self.__locationInfoLabel) self.__infoFrame = QtGui.QFrame() self.__infoFrame.setLayout(QtGui.QVBoxLayout()) self.layout().addWidget(self.__infoFrame) self.__setLocations() self.__connectSignals()
def setDisplayMode(self, mode): """ Set display mode and corresponding tool tips, icons, etc. """ self.__displayMode = mode if self.__displayMode == (DISPLAY_LIGHTS | DISPLAY_CAMERAS): switchArea = self.getWidgetSwitchArea() self.__topHBox = QtGui.QFrame(switchArea) switchArea.layout().addWidget(self.__topHBox) self.__topHBox.setLayout(QtGui.QHBoxLayout()) spacer = QtGui.QLabel('', self) self.__topHBox.layout().addWidget(spacer) self.__topHBox.layout().setStretchFactor(spacer, 100) self.__lightsCheckbox = QtGui.QCheckBox("Lights", self.__topHBox) self.__lightsCheckbox.setChecked(True) self.__topHBox.layout().addWidget(self.__lightsCheckbox) QtCore.QObject.connect(self.__lightsCheckbox, QtCore.SIGNAL('stateChanged(int)'), self.__on_lightsCheckbox_stateChanged) self.__camerasCheckbox = QtGui.QCheckBox("Cameras", self.__topHBox) self.__camerasCheckbox.setChecked(True) self.__topHBox.layout().addWidget(self.__camerasCheckbox) QtCore.QObject.connect(self.__camerasCheckbox, QtCore.SIGNAL('stateChanged(int)'), self.__on_camerasCheckbox_stateChanged) self.setToolTip("Choose Light or Camera") elif mode & DISPLAY_LIGHTS: self.setScenegraphPixmap(self.__pixmaps['light']) self.setToolTip("Choose Light") else: self.setScenegraphPixmap(self.__pixmaps['camera']) self.setToolTip("Choose Camera")
def __init__(self, parent, node): """ Initializes an instance of the class. """ QtGui.QWidget.__init__(self, parent) self.__node = node # Get the SuperTool's parameters rootLocationsParameter = self.__node.getParameter('rootLocations') passesParameter = self.__node.getParameter('passes') saveToParameter = self.__node.getParameter('saveTo') writeMatexOutButton = self.__node.getParameter("writeMaterialxOut") CreateParameterPolicy = UI4.FormMaster.CreateParameterPolicy self.__rootLocationsParameterPolicy = CreateParameterPolicy( None, rootLocationsParameter) self.__passesParameterPolicy = CreateParameterPolicy( None, passesParameter) self.__saveToParameterPolicy = CreateParameterPolicy( None, saveToParameter) self.__writeMatexOutButtonPolicy = CreateParameterPolicy( None, writeMatexOutButton) WidgetFactory = UI4.FormMaster.KatanaFactory.ParameterWidgetFactory rootLocationsWidget = WidgetFactory.buildWidget( self, self.__rootLocationsParameterPolicy) passesWidget = WidgetFactory.buildWidget(self, self.__passesParameterPolicy) saveToWidget = WidgetFactory.buildWidget(self, self.__saveToParameterPolicy) writeMatexOutButtonWidget = WidgetFactory.buildWidget( self, self.__writeMatexOutButtonPolicy) # Build a group widget self.group_layout = passesWidget.getPopdownWidget().layout() self.add_button = QtGui.QPushButton("Add New Pass") self.remove_button = QtGui.QPushButton("Remove Last Pass") self.connect(self.add_button, QtCore.SIGNAL('clicked(bool)'), self.onAddButtonPressed) self.connect(self.remove_button, QtCore.SIGNAL('clicked(bool)'), self.onRemoveButtonPressed) # parameter = self.__node.getParameters().getChild("look_origin") # if not parameter: # parameter = self.__node.getParameters().createChildString("look_origin", 'default') # policy = UI4.FormMaster.CreateParameterPolicy(None, parameter) # widget = WidgetFactory.buildWidget(self, policy) if not passesParameter.getChild("default"): passesParameter.createChildString("default", 'default') self.button_layout = QtGui.QHBoxLayout() self.button_layout.addWidget(self.add_button) self.button_layout.addWidget(self.remove_button) self.group_layout.addLayout(self.button_layout) line = QtGui.QFrame() line.setFrameShape(QtGui.QFrame.HLine) line.setFrameShadow(QtGui.QFrame.Sunken) # Create a layout and add the parameter editing widgets to it mainLayout = QtGui.QVBoxLayout() mainLayout.addWidget(rootLocationsWidget) mainLayout.addWidget(passesWidget) mainLayout.addWidget(line) mainLayout.addWidget(saveToWidget) mainLayout.addWidget(writeMatexOutButtonWidget) # Apply the layout to the widget self.setLayout(mainLayout)