def setupUi(self, WorkflowRelationship): '''Set up ui for *WorkflowRelationship* widget.''' WorkflowRelationship.setObjectName('WorkflowRelationship') WorkflowRelationship.resize(275, 106) self.verticalLayout = QtWidgets.QVBoxLayout(WorkflowRelationship) self.verticalLayout.setObjectName('verticalLayout') self.gridLayout = QtWidgets.QGridLayout() self.gridLayout.setObjectName('gridLayout') spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.gridLayout.addItem(spacerItem, 2, 0, 1, 1) self.label = QtWidgets.QLabel(WorkflowRelationship) self.label.setObjectName('label') self.gridLayout.addWidget(self.label, 1, 0, 1, 1) self.taskCombo = QtWidgets.QComboBox(WorkflowRelationship) self.taskCombo.setObjectName('taskCombo') self.gridLayout.addWidget(self.taskCombo, 1, 1, 1, 1) self.versionCombo = QtWidgets.QComboBox(WorkflowRelationship) self.versionCombo.setObjectName('versionCombo') self.gridLayout.addWidget(self.versionCombo, 0, 1, 1, 1) self.label_2 = QtWidgets.QLabel(WorkflowRelationship) self.label_2.setObjectName('label_2') self.gridLayout.addWidget(self.label_2, 0, 0, 1, 1) self.preferNukeScript = QtWidgets.QCheckBox('Prefer nuke script', WorkflowRelationship) self.gridLayout.addWidget(self.preferNukeScript, 2, 0, 1, 2) spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.gridLayout.addItem(spacerItem1, 0, 3, 1, 1) self.verticalLayout.addLayout(self.gridLayout) self.retranslateUi(WorkflowRelationship) QtCore.QMetaObject.connectSlotsByName(WorkflowRelationship)
def setupUI(self): css_settings_global = """ QFrame { border: none; color: #FFF; } QCheckBox { color: #DDD; padding: 0px; background: none; } /*QComboBox { color: #DDD; padding: 2px; background: #333; }*/ QComboBox::drop-down { border-radius: 0px; } QToolButton { color: #DDD; padding: 0px; background: #333; } """ self.setStyleSheet(css_settings_global) main_layout = QtWidgets.QVBoxLayout(self) main_layout.setContentsMargins(0, 0, 0, 0) main_layout.setSpacing(5) settings_frame = QtWidgets.QFrame(self) layout_settings = QtWidgets.QHBoxLayout(settings_frame) layout_settings.setContentsMargins(0, 0, 0, 0) layout_settings.setSpacing(6) asset_types = ["All Asset Types"] + ['comp'] self._asset_connectors_cbbox = QtWidgets.QComboBox(self) self._asset_connectors_cbbox.addItems(asset_types) self._asset_connectors_cbbox.currentIndexChanged.connect( self._update_tree) self._asset_connectors_cbbox.setMaximumHeight(23) self._asset_connectors_cbbox.setMinimumWidth(100) self._asset_connectors_cbbox.setSizeAdjustPolicy( QtWidgets.QComboBox.AdjustToContents) self._refresh_btn = QtWidgets.QPushButton(self) self._refresh_btn.setText("refresh") self._refresh_btn.clicked.connect(self.initiate_assets_tree) spacer = QtWidgets.QSpacerItem(0, 0, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) layout_settings.addWidget(self._asset_connectors_cbbox) layout_settings.addItem(spacer) layout_settings.addWidget(self._refresh_btn) main_layout.addWidget(settings_frame) self.assets_tree = AssetsTree(self) main_layout.addWidget(self.assets_tree)
def _build(self): '''Build and layout widget.''' layout = QtWidgets.QVBoxLayout() layout.setSpacing(2) layout.setContentsMargins(6, 6, 6, 6) self.setLayout(layout) formLayout = QtWidgets.QGridLayout() layout.addLayout(formLayout) self._nameLabel = QtWidgets.QLabel('Name') formLayout.addWidget(self._nameLabel, 2, 0, 1, 1) self._nameInput = QtWidgets.QLineEdit() formLayout.addWidget(self._nameInput, 2, 1, 1, 1) self._typeLabel = QtWidgets.QLabel('Type') self._typeLabel.setEnabled(True) formLayout.addWidget(self._typeLabel, 1, 0, 1, 1) self._typeSelector = QtWidgets.QComboBox() self._typeSelector.setEnabled(True) formLayout.addWidget(self._typeSelector, 1, 1, 1, 1) self._objectLabel = QtWidgets.QLabel('Object') formLayout.addWidget(self._objectLabel, 0, 0, 1, 1) self._objectSelector = QtWidgets.QComboBox() formLayout.addWidget(self._objectSelector, 0, 1, 1, 1) controlsLayout = QtWidgets.QHBoxLayout() layout.addLayout(controlsLayout) spacerItem = QtWidgets.QSpacerItem(10, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) controlsLayout.addItem(spacerItem) self._cancelButton = QtWidgets.QPushButton('Cancel') controlsLayout.addWidget(self._cancelButton) self._createButton = QtWidgets.QPushButton('Create') self._createButton.setAutoDefault(True) self._createButton.setDefault(True) controlsLayout.addWidget(self._createButton)
def setupUI(self): css_task_global = """ QLabel { padding: 0px; background: none; } /*QTabWidget::pane { border-top: 2px solid #151515; top: -2px;} QTabBar::tab { padding: 6px 10px; background: #151515; border-top: 2px solid #151515; border-right: 2px solid #151515; border-left: 2px solid #151515; border-radius: 0px; } QTabBar::tab:selected { background: #333; border-top-left-radius: 4px; border-top-right-radius: 4px; } QTabBar::tab:hover { background: #222; } QTabBar::tab:!selected { margin-top: 2px; }*/ """ css_task_name_lbl = "font-size: 13px;" css_task_name = "color: #c3cfa4; font-size: 13px; font-weight: bold;" self.setStyleSheet(css_task_global) task_frame_layout = QtWidgets.QVBoxLayout(self) task_frame_layout.setContentsMargins(0, 0, 0, 0) task_frame_layout.setSpacing(15) # Display Task infos task_info_layout = QtWidgets.QFormLayout() task_info_layout.setContentsMargins(10, 10, 10, 10) task_info_layout.setSpacing(10) task_name_lbl = QtWidgets.QLabel("Task", self) task_name_lbl.setStyleSheet(css_task_name_lbl) self._task_name = QtWidgets.QLabel(self._t_name, self) self._task_name.setStyleSheet(css_task_name) project_lbl = QtWidgets.QLabel("Project", self) self._project_name = QtWidgets.QLabel(self._t_project_name, self) shot_lbl = QtWidgets.QLabel("Shot", self) shot_layout = QtWidgets.QHBoxLayout() shot_layout.setSpacing(6) self._shot_name = QtWidgets.QLabel(self) self._separator_shot = QtWidgets.QLabel("/", self) self._separator_shot.setVisible(False) self._sequence_name = QtWidgets.QLabel(self) spacer_shot = QtWidgets.QSpacerItem(0, 0, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) shot_layout.addWidget(self._sequence_name) shot_layout.addWidget(self._separator_shot) shot_layout.addWidget(self._shot_name) shot_layout.addItem(spacer_shot) shot_status_lbl = QtWidgets.QLabel("Shot status", self) shot_status = ftrack.getShotStatuses() self._shot_status = StatusWidget(shot_status, self) task_status_lbl = QtWidgets.QLabel("Task status", self) task_status = ftrack.getTaskStatuses() self._task_status = StatusWidget(task_status, self) due_date_lbl = QtWidgets.QLabel("Due date", self) self._due_date = QtWidgets.QLabel(self) task_info_layout.setWidget(0, QtWidgets.QFormLayout.LabelRole, task_name_lbl) task_info_layout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self._task_name) task_info_layout.setWidget(1, QtWidgets.QFormLayout.LabelRole, project_lbl) task_info_layout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self._project_name) task_info_layout.setWidget(2, QtWidgets.QFormLayout.LabelRole, shot_lbl) task_info_layout.setItem(2, QtWidgets.QFormLayout.FieldRole, shot_layout) task_info_layout.setWidget(3, QtWidgets.QFormLayout.LabelRole, shot_status_lbl) task_info_layout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self._shot_status) task_info_layout.setWidget(4, QtWidgets.QFormLayout.LabelRole, task_status_lbl) task_info_layout.setWidget(4, QtWidgets.QFormLayout.FieldRole, self._task_status) task_info_layout.setWidget(5, QtWidgets.QFormLayout.LabelRole, due_date_lbl) task_info_layout.setWidget(5, QtWidgets.QFormLayout.FieldRole, self._due_date) task_frame_layout.addItem(task_info_layout) self._tab_widget = QtWidgets.QTabWidget(self) # Display Nuke Assets from this task self.tab_asset_tree = QtWidgets.QWidget() self.tab_asset_tree.busy_overlay = LoadingOverlay(self.tab_asset_tree) self.tab_asset_tree.busy_overlay.hide() tab_asset_tree_layout = QtWidgets.QVBoxLayout(self.tab_asset_tree) tab_asset_tree_layout.setContentsMargins(0, 8, 0, 0) self.assets_widget = SceneAssetsWidget(self) self.assets_widget.worker_started.connect( self.tab_asset_tree.busy_overlay.show) self.assets_widget.worker_started.connect( self.tab_asset_tree.busy_overlay.raise_) self.assets_widget.worker_stopped.connect( self.tab_asset_tree.busy_overlay.hide) tab_asset_tree_layout.addWidget(self.assets_widget) self._tab_widget.addTab(self.tab_asset_tree, "All Scene Assets") task_frame_layout.addWidget(self._tab_widget)
def setupUI(self): main_layout = QtWidgets.QVBoxLayout(self) main_layout.setContentsMargins(0, 0, 0, 0) main_layout.setSpacing(0) self._script_editor_tree = ScriptEditorTreeView(self) self._script_editor_tree.setSelectionMode( QtWidgets.QAbstractItemView.NoSelection) self._script_editor_tree.setIndentation(20) self._script_editor_tree.setAnimated(True) self._script_editor_tree.setHeaderHidden(True) self._script_editor_tree.setExpandsOnDoubleClick(True) self._script_editor_tree.file_dropped.connect(self._emit_dropped_file) main_layout.addWidget(self._script_editor_tree) self._option_frame = QtWidgets.QFrame(self) option_layout = QtWidgets.QHBoxLayout(self._option_frame) option_layout.setContentsMargins(0, 8, 0, 8) option_layout.setSpacing(8) # filter_lbl = QtGui.QLabel("Filter", self._option_frame) css_filter = """ QLineEdit { border: 1px solid #666; background: #555; color: #000; } """ self._filter_edit = QtWidgets.QLineEdit(self._option_frame) self._filter_edit.setMaximumHeight(20) # self._filter_edit.setStyleSheet(css_filter) self._filter_edit.textChanged.connect(self._set_filter) self._previous_occurence = QtWidgets.QPushButton( 'previous', self._option_frame) # self._previous_occurence.setArrowType(QtCore.Qt.LeftArrow) # self._previous_occurence.setMaximumWidth(20) # self._previous_occurence.setMaximumHeight(20) self._next_occurence = QtWidgets.QPushButton('next', self._option_frame) # self._next_occurence.setArrowType(QtCore.Qt.RightArrow) # self._next_occurence.setMaximumWidth(20) # self._next_occurence.setMaximumHeight(20) spacer = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self._collapse_all_btn = QtWidgets.QPushButton("Collapse All", self._option_frame) self._collapse_all_btn.setMaximumHeight(20) # self._collapse_all_btn.setStyleSheet(css_btn) self._collapse_all_btn.clicked.connect( self._script_editor_tree.collapseAll) self._expand_all_btn = QtWidgets.QPushButton("Expand All", self._option_frame) self._expand_all_btn.setMaximumHeight(20) # self._expand_all_btn.setStyleSheet(css_btn) self._expand_all_btn.clicked.connect( self._script_editor_tree.expandAll) option_layout.addWidget(self._filter_edit) option_layout.addWidget(self._previous_occurence) option_layout.addWidget(self._next_occurence) option_layout.addItem(spacer) option_layout.addWidget(self._collapse_all_btn) option_layout.addWidget(self._expand_all_btn) main_layout.addWidget(self._option_frame)