def ui(self): super(InterpolateItView, self).ui() central_layout = layouts.VerticalLayout(spacing=0, margins=(0, 0, 0, 0)) central_widget = QWidget() central_widget.setLayout(central_layout) central_widget.setSizePolicy( QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)) scroll = QScrollArea() scroll.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff) scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) scroll.setWidgetResizable(True) scroll.setFocusPolicy(Qt.NoFocus) self.main_layout.addWidget(scroll) scroll.setWidget(central_widget) self._interpolator_layout = layouts.VerticalLayout(spacing=0, margins=(0, 0, 0, 0)) self._interpolator_layout.setAlignment(Qt.AlignTop) button_layout = layouts.HorizontalLayout(spacing=2, margins=(0, 0, 0, 0)) self._load_btn = buttons.BaseButton('Load', parent=self) self._save_btn = buttons.BaseButton('Save', parent=self) self._add_btn = buttons.BaseButton('New', parent=self) button_layout.addWidget(self._save_btn) button_layout.addWidget(self._load_btn) button_layout.addStretch() button_layout.addWidget(self._add_btn) central_layout.addLayout(self._interpolator_layout) self.main_layout.addLayout(button_layout)
def ui(self): # theme = tpDcc.ToolsMgr().get_tool_theme('tpDcc-tools-hub') # border_width = qtutils.dpi_scale_divide(theme.STACK_BORDER_WIDTH) margin = qtutils.dpi_scale_divide(1) self.main_layout = layouts.VerticalLayout(margins=(margin, margin, margin, margin), spacing=0) # self.main_layout = layouts.VerticalLayout(margins=(0, 0, 0, 0), spacing=0) self.setLayout(self.main_layout) if not self._title_frame: self._title_frame = StackTitleFrame( title=self._title, icon=self._icon, title_editable=self._title_editable, item_icon_size=self._icon_size) if not self._show_item_icon: self._title_frame.item_icon_button.hide() self._contents_widget = QFrame(parent=self) self._contents_layout = layouts.VerticalLayout( spacing=self._contents_spacing, margins=self._contents_margins) self._contents_widget.setLayout(self._contents_layout) self.main_layout.addWidget(self._title_frame) self.main_layout.addWidget(self._contents_widget)
def __init__(self, parent, factor, main_color=None, *args, **kwargs): super(HoudiniInputDragger, self).__init__(*args, **kwargs) self._parent = parent self._factor = factor self._main_color = main_color if main_color else QColor(215, 128, 26).getRgb() self._size = 35 self.setAttribute(Qt.WA_Hover) self.setStyleSheet(self._get_style_sheet()) self.setMinimumHeight(self._size) self.setMinimumWidth(self._size) self.setMaximumHeight(self._size) self.setMaximumWidth(self._size) main_layout = layouts.VerticalLayout(margins=(0, 0, 0, 0)) self.setLayout(main_layout) frame_layout = layouts.VerticalLayout(spacing=0, margins=(0, 0, 0, 0)) self._frame = QGroupBox() self._frame.setLayout(frame_layout) main_layout.addWidget(self._frame) self._label = label.BaseLabel('+' + str(factor), parent=self) font = self._label.font() font.setPointSize(7) self._label.setFont(font) self._label.setAlignment(Qt.AlignCenter) frame_layout.addWidget(self._label) self.installEventFilter(self) self._label.installEventFilter(self)
def setup_ui(self): self.main_layout = layouts.VerticalLayout(spacing=5, margins=(5, 5, 5, 5)) self.setLayout(self.main_layout) self.child_layout = layouts.VerticalLayout(spacing=5, margins=(5, 5, 5, 5)) self.child_layout.setAlignment(Qt.AlignTop) self.main_layout.addLayout(self.child_layout) self.main_layout.addSpacing(30)
def ui(self): super(SkinningWidget, self).ui() self._average_falloff_widget = QWidget() average_falloff_layout = layouts.VerticalLayout(spacing=2, margins=(5, 5, 5, 5)) self._average_falloff_widget.setLayout(average_falloff_layout) self._average_falloff_curve = fallofcurve.FallofCurveWidget( parent=self) average_falloff_layout.addWidget(self._average_falloff_curve) self._mirror_auto_assign_joints_labels_cbx = checkbox.BaseCheckBox( 'Auto Assign Labels', self) self._copy_skin_weights_auto_assign_joints_labels_cbx = checkbox.BaseCheckBox( 'Auto Assign Labels', self) self._transfer_skin_uvs_auto_assign_joints_labels_cbx = checkbox.BaseCheckBox( 'Auto Assign Labels', self) self._clean_skin_mesh_auto_assign_joints_labels_cbx = checkbox.BaseCheckBox( 'Auto Assign Labels', self) self._extract_skin_faces_auto_assign_joints_labels_cbx = checkbox.BaseCheckBox( 'Auto Assign Labels', self) self._distance_widget = QWidget() distance_layout = layouts.VerticalLayout(spacing=2, margins=(5, 5, 5, 5)) self._distance_widget.setLayout(distance_layout) self._distance_average_cbx = checkbox.BaseCheckBox('On Distance', self) self._average_falloff_curve = fallofcurve.FallofCurveWidget( parent=self) distance_layout.addWidget(self._distance_average_cbx) distance_layout.addWidget(self._average_falloff_curve) self._fast_delete_cbx = checkbox.BaseCheckBox('Fast Delete', self) self._average_falloff_widget.setVisible(False) self._mirror_auto_assign_joints_labels_cbx.setVisible(False) self._copy_skin_weights_auto_assign_joints_labels_cbx.setVisible(False) self._transfer_skin_uvs_auto_assign_joints_labels_cbx.setVisible(False) self._clean_skin_mesh_auto_assign_joints_labels_cbx.setVisible(False) self._extract_skin_faces_auto_assign_joints_labels_cbx.setVisible( False) self._distance_widget.setVisible(False) self._fast_delete_cbx.setVisible(False) self.main_layout.addWidget(self._average_falloff_widget) self.main_layout.addWidget(self._mirror_auto_assign_joints_labels_cbx) self.main_layout.addWidget( self._copy_skin_weights_auto_assign_joints_labels_cbx) self.main_layout.addWidget( self._transfer_skin_uvs_auto_assign_joints_labels_cbx) self.main_layout.addWidget( self._clean_skin_mesh_auto_assign_joints_labels_cbx) self.main_layout.addWidget( self._extract_skin_faces_auto_assign_joints_labels_cbx) self.main_layout.addWidget(self._distance_widget) self.main_layout.addWidget(self._fast_delete_cbx)
def ui(self): super(BaseSaveWidget, self).ui() title_layout = layouts.HorizontalLayout() title_layout.setContentsMargins(2, 2, 0, 0) title_layout.setSpacing(2) self._icon_lbl = QLabel() self._icon_lbl.setMaximumSize(QSize(14, 14)) self._icon_lbl.setMinimumSize(QSize(14, 14)) self._icon_lbl.setScaledContents(True) self._title_lbl = QLabel() title_layout.addWidget(self._icon_lbl) title_layout.addWidget(self._title_lbl) self._folder_widget = directory.SelectFolder('Folder', use_app_browser=True) buttons_layout = layouts.HorizontalLayout() buttons_layout.setContentsMargins(4, 4, 4, 4) buttons_layout.setSpacing(4) buttons_frame = QFrame() buttons_frame.setFrameShape(QFrame.NoFrame) buttons_frame.setFrameShadow(QFrame.Plain) buttons_frame.setLayout(buttons_layout) buttons_layout.addStretch() self.save_btn = buttons.BaseButton('Save') self.cancel_btn = buttons.BaseButton('Cancel') buttons_layout.addWidget(self.save_btn, parent=self) buttons_layout.addWidget(self.cancel_btn, parent=self) buttons_layout.addStretch() self._options_layout = layouts.VerticalLayout() self._options_layout.setContentsMargins(0, 0, 0, 0) self._options_layout.setSpacing(2) self._options_frame = QFrame() self._options_frame.setFrameShape(QFrame.NoFrame) self._options_frame.setFrameShadow(QFrame.Plain) self._options_frame.setLineWidth(0) self._options_frame.setLayout(self._options_layout) self._extra_layout = layouts.VerticalLayout() self._extra_layout.setContentsMargins(0, 0, 0, 0) self._extra_layout.setSpacing(2) self.main_layout.addLayout(title_layout) self.main_layout.addWidget(self._folder_widget) self._extra_layout.addWidget(self._options_frame) self.main_layout.addWidget(dividers.Divider()) self.main_layout.addLayout(self._extra_layout) self.main_layout.addWidget(dividers.Divider()) self.main_layout.addWidget(buttons_frame)
def setup_ui(self): main_group_layout = layouts.VerticalLayout() main_group_layout.setContentsMargins(0, 0, 0, 0) main_group_layout.setSpacing(1) self.group = OptionGroup(self._name) self.child_layout = self.group.child_layout self.main_layout = layouts.VerticalLayout() self.main_layout.setContentsMargins(0, 0, 0, 0) self.main_layout.setSpacing(0) self.main_layout.addSpacing(2) self.main_layout.addWidget(self.group) self.setLayout(self.main_layout) self.group.expand.connect(self._on_expand_updated)
def __init__(self, parent=None, is_float=True, dragger_steps=None, main_color=None): super(SliderDraggers, self).__init__(parent) self._drags = list() self._initial_pos = None self._active_drag = None self._last_delta_x = 0 self._change_direction = 0 self._main_color = main_color if main_color else QColor(215, 128, 26).getRgb() dragger_steps = dragger_steps or FLOAT_SLIDER_DRAG_STEPS self.setWindowFlags(Qt.Popup) draggers_layout = layouts.VerticalLayout(spacing=0, margins=(0, 0, 0, 0)) self.setLayout(draggers_layout) steps = copy(dragger_steps) if not is_float: steps = list(filter(lambda x: abs(x) >= 1.0, steps)) for i in steps: drag = HoudiniInputDragger(self, i) self._drags.append(drag) draggers_layout.addWidget(drag) self.installEventFilter(self)
def set_widget(self, widget): """ Sets the widget used to set and get the field value :param widget: QWidget """ widget_layout = layouts.HorizontalLayout(spacing=0, margins=(0, 0, 0, 0)) self._widget = widget self._widget.setParent(self) self._widget.setObjectName('widget') # self._widget.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred) self._menu_button = buttons.BaseButton() self._menu_button.setIcon(resources.icon('menu_dots')) self._menu_button.setHidden(True) self._menu_button.setObjectName('menuButton') # self._menu_button.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding) self._menu_button.clicked.connect(self._on_menu_callback) widget_layout.addWidget(self._widget) widget_layout.addWidget(self._menu_button) layout = layouts.VerticalLayout(spacing=0, margins=(0, 0, 0, 0)) self._error_label = message.BaseMessage(parent=self).error().set_show_icon(False) self._error_label.setMaximumHeight(40) self._error_label.setHidden(True) self._error_label.setObjectName('errorLabel') self._error_label.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred) layout.addLayout(widget_layout) layout.addWidget(self._error_label) self._layout2.addLayout(layout)
def __init__(self, widget, title, icon=None, uid=None, parent=None): super(BootStrapWidget, self).__init__(parent=parent) self._preferred_size = self.PREFERRED_SIZE # This cannot be an empty string, otherwise Maya will get crazy uid = uid or title or 'BootstrapWidget' global BOOTSTRAP_WIDGETS BOOTSTRAP_WIDGETS[uid] = self # This was causing the dock widge to disappear after creation # Not sure why, maybe because the id had - characters, or because maybe there was a widget with the same # objectName, for now no setting an objectName seems to work fine # self.setObjectName(uid) self.setWindowTitle(title) if icon: self.setWindowIcon(icon) self._docking_frame = QMainWindow(self) self._docking_frame.layout().setContentsMargins(0, 0, 0, 0) self._docking_frame.setWindowFlags(Qt.Widget) self._docking_frame.setDockOptions(QMainWindow.AnimatedDocks) self.central_widget = widget self._docking_frame.setCentralWidget(self.central_widget) bootstrap_layout = layouts.VerticalLayout(spacing=0, margins=(0, 0, 0, 0)) bootstrap_layout.addWidget(self._docking_frame, 0) self.setLayout(bootstrap_layout) widget.setProperty('bootstrapWidget', self)
def ui(self): super(SidebarWidget, self).ui() self._title_widget = QFrame(self) title_layout = layouts.VerticalLayout(spacing=0, margins=(0, 0, 0, 0)) self._title_widget.setLayout(title_layout) buttons_layout = layouts.HorizontalLayout(spacing=0, margins=(0, 0, 0, 0)) self._title_button = buttons.BaseButton(parent=self) self._title_button.setIcon(resources.icon('reset')) self._menu_button = buttons.BaseButton(parent=self) self._menu_button.setIcon(resources.icon('menu_dots')) buttons_layout.addWidget(self._title_button) buttons_layout.addStretch() buttons_layout.addWidget(self._menu_button) self._filter_search = search.SearchFindWidget(parent=self) self._filter_search.setVisible(False) title_layout.addLayout(buttons_layout) title_layout.addWidget(self._filter_search) self._tree_widget = SidebarTree(self) self._tree_widget.installEventFilter(self) self._tree_widget.itemDropped = self.itemDropped self._tree_widget.itemRenamed = self.itemRenamed self.itemSelectionChanged = self._tree_widget.itemSelectionChanged self._filter_search.set_text(self._tree_widget.filter_text()) self.main_layout.addWidget(self._title_widget) self.main_layout.addWidget(self._tree_widget)
def ui(self): super(RenamerView, self).ui() renamer_widget = QWidget() renamer_widget.setLayout( layouts.VerticalLayout(spacing=0, margins=(0, 0, 0, 0))) renamer_widget.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed) self.main_layout.addWidget(renamer_widget) rename_layout = layouts.HorizontalLayout(spacing=2, margins=(0, 0, 0, 0)) rename_layout.setAlignment(Qt.AlignLeft) renamer_widget.layout().addLayout(rename_layout) self._base_name_cbx = checkbox.BaseCheckBox(parent=self) rename_layout.addWidget(self._base_name_cbx) self._renamer_line = lineedit.BaseLineEdit(parent=self) self._renamer_line.setPlaceholderText('New Name') rename_layout.addWidget(self._renamer_line) reg_ex = QRegExp("^(?!^_)[a-zA-Z_]+") text_validator = QRegExpValidator(reg_ex, self._renamer_line) self._renamer_line.setValidator(text_validator) self._renamer_btn = buttons.BaseButton(parent=self) self._renamer_btn.setIcon(resources.icon('rename')) rename_layout.addWidget(self._renamer_btn)
def ui(self): super(EditFileTreeWidget, self).ui() self.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) self._tree_widget = self.TREE_WIDGET(parent=self) self._manager_widget = self.MANAGER_WIDGET(parent=self) self._manager_widget.set_tree_widget(self._tree_widget) self._filter_widget = self.FILTER_WIDGET(parent=self) self._filter_widget.set_tree_widget(self._tree_widget) self._filter_widget.set_directory(self._directory) drag_reorder_icon = resources.icon('drag_reorder') edit_mode_layout = layouts.VerticalLayout(spacing=0, margins=(0, 0, 0, 0)) edit_mode_layout.setAlignment(Qt.AlignBottom) self._edit_mode_btn = buttons.BaseButton(parent=self) self._edit_mode_btn.setIcon(drag_reorder_icon) self._edit_mode_btn.setCheckable(True) edit_mode_layout.addWidget(self._edit_mode_btn) self._filter_widget.main_layout.addLayout(edit_mode_layout) self.main_layout.addWidget(self._filter_widget) self.main_layout.addWidget(self._tree_widget) self.main_layout.addWidget(self._manager_widget)
def ui(self): # theme = tpDcc.ToolsMgr().get_tool_theme('tpDcc-tools-hub') # border_width = qtutils.dpi_scale_divide(theme.STACK_BORDER_WIDTH) margin = qtutils.dpi_scale_divide(1) self.main_layout = layouts.VerticalLayout(margins=(margin, margin, margin, margin), spacing=0) # self.main_layout = layouts.VerticalLayout(margins=(0, 0, 0, 0), spacing=0) self.setLayout(self.main_layout) if not self._title_frame: self._title_frame = StackTitleFrame( title=self._title, icon=self._icon, title_editable=self._title_editable, item_icon_size=self._icon_size, collapsed=self._collapsed, shift_arrows_enabled=self._shift_arrows_enabled, delete_button_enabled=self._delete_button_enabled) if not self._show_item_icon: self._title_frame.item_icon_button.hide() self._widget_hider = StackHiderWidget(parent=self) self._contents_layout = self._widget_hider.main_layout self._contents_layout.setContentsMargins(*self._contents_margins) self._contents_layout.setSpacing(self._contents_spacing) self._widget_hider.setContentsMargins(0, 0, 0, 0) self._widget_hider.setHidden(self._collapsed) self._widget_hider.setObjectName('stackbody') self.main_layout.addWidget(self._title_frame) self.main_layout.addWidget(self._widget_hider)
def get_drives_widget(self): """ Returns a QGroupBox widget that contains all disk drivers of the PC in a vertical layout :return: QGroupBox """ w = QGroupBox('') w.setParent(self) box = layouts.VerticalLayout() box.setAlignment(Qt.AlignTop) places = [(getpass.getuser(), os.path.realpath(os.path.expanduser('~')))] places += [ (q, q) for q in [os.path.realpath(x.absolutePath()) for x in QDir().drives()] ] for label, loc in places: icon = QFileIconProvider().icon(QFileInfo(loc)) drive_btn = QRadioButton(label) drive_btn.setIcon(icon) drive_btn.setToolTip(loc) drive_btn.setProperty('path', loc) drive_btn.clicked.connect(self.go_to_drive) self.places[loc] = drive_btn box.addWidget(drive_btn) w.setLayout(box) return w
def ui(self): """ Function that sets up the ui of the widget Override it on new widgets (but always call super) """ self.main_layout = self.get_main_layout() if self._use_scrollbar: layout = layouts.VerticalLayout(spacing=0, margins=(0, 0, 0, 0)) self.setLayout(layout) central_widget = QWidget() central_widget.setSizePolicy( QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)) scroll = QScrollArea() scroll.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded) scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) scroll.setWidgetResizable(True) scroll.setFocusPolicy(Qt.NoFocus) layout.addWidget(scroll) scroll.setWidget(central_widget) central_widget.setLayout(self.main_layout) self.setSizePolicy( QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)) else: self.setLayout(self.main_layout)
def _toolbar_example(self): def _collapse(): tool_bar.collapse() def _set_icon_color(): tool_bar.set_icon_color(QColor(255, 255, 0)) toolbar_widget = QWidget(parent=self) toolbar_layout = layouts.VerticalLayout() toolbar_widget.setLayout(toolbar_layout) tool_bar = toolbar.ToolBar(parent=self) tool_bar.set_children_height(50) toolbar_layout.addWidget(tool_bar) line_edit = lineedit.BaseLineEdit(parent=self) line_edit.setObjectName('hello') collapse_action = tool_bar.addAction('Collapse') tool_bar.addWidget(line_edit) tool_bar.addAction(resources.icon('add'), 'Plus') color_action = QAction('Yellow', None) tool_bar.insertAction('Plus', color_action) collapse_action.triggered.connect(_collapse) color_action.triggered.connect(_set_icon_color) self.main_layout.addWidget(buttons.BaseButton('Hello')) self.main_layout.addStretch() return toolbar_widget
def ui(self): super(ProjectSettingsWidget, self).ui() image_layout = layouts.HorizontalLayout(spacing=2, margins=(2, 2, 2, 2)) image_layout.setContentsMargins(2, 2, 2, 2) image_layout.setSpacing(2) self.main_layout.addLayout(image_layout) self._project_image = QLabel() self._project_image.setAlignment(Qt.AlignCenter) image_layout.addStretch() image_layout.addWidget(self._project_image) image_layout.addStretch() self._settings_tab = tabs.BaseTabWidget(parent=self) self.main_layout.addWidget(self._settings_tab) self._naming_widget = NamingWidget(project=self._project) self._project_options_widget = rigoptionsviewer.RigOptionsViewer( option_object=self._project, parent=self) self._external_code_widget = ExternalCodeDirectoryWidget(parent=self) version_control_widget = QWidget(parent=self) version_control_layout = layouts.VerticalLayout(spacing=0, margins=(2, 2, 2, 2)) version_control_widget.setLayout(version_control_layout) self._version_type_combo = combobox.BaseComboBox(parent=self) version_control_layout.addWidget(self._version_type_combo) version_control_layout.addStretch() self._settings_tab.addTab(self._project_options_widget, 'Settings') self._settings_tab.addTab(self._naming_widget, 'Nomenclature') self._settings_tab.addTab(version_control_widget, 'Version Control') self._settings_tab.addTab(self._external_code_widget, 'External Code') bottom_layout = layouts.VerticalLayout(spacing=2, margins=(2, 2, 2, 2)) bottom_layout.setAlignment(Qt.AlignBottom) self.main_layout.addLayout(bottom_layout) bottom_layout.addLayout(dividers.DividerLayout()) buttons_layout = layouts.HorizontalLayout(spacing=2, margins=(2, 2, 2, 2)) bottom_layout.addLayout(buttons_layout) ok_icon = resources.icon('ok') self._ok_btn = buttons.BaseButton(parent=self) self._ok_btn.setIcon(ok_icon) buttons_layout.addWidget(self._ok_btn)
def get_main_layout(self): """ Function that generates the main layout used by the widget Override if necessary on new widgets :return: QLayout """ return layouts.VerticalLayout(spacing=2, margins=(2, 2, 2, 2))
def ui(self): super(Changelog, self).ui() self.set_logo('changelog_logo') self.main_layout.setAlignment(Qt.AlignTop) self.main_layout.setContentsMargins(0, 0, 0, 0) self.setFixedWidth(600) self.setMaximumHeight(800) scroll_layout = layouts.VerticalLayout(spacing=2, margins=(2, 2, 2, 2)) scroll_layout.setAlignment(Qt.AlignTop) central_widget = QWidget() central_widget.setSizePolicy( QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)) scroll = QScrollArea() scroll.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded) scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) scroll.setWidgetResizable(True) scroll.setFocusPolicy(Qt.NoFocus) ok_btn = QPushButton('OK') ok_btn.clicked.connect(self.close) self.main_layout.addWidget(scroll) self.main_layout.setAlignment(Qt.AlignTop) self.main_layout.addWidget(ok_btn) scroll.setWidget(central_widget) central_widget.setLayout(scroll_layout) self.setSizePolicy( QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)) self.main_layout = scroll_layout # =========================================================================================== self.version_accordion = accordion.AccordionWidget(parent=self) self.version_accordion.rollout_style = accordion.AccordionStyle.MAYA self.main_layout.addWidget(self.version_accordion) # =========================================================================================== changelog_json_file = os.path.join( os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'changelog.json') if not os.path.isfile(changelog_json_file): return with open(changelog_json_file, 'r') as f: changelog_data = json.load(f, object_pairs_hook=OrderedDict) if not changelog_data: return changelog_data = OrderedDict( sorted(changelog_data.items(), reverse=True)) for version, elements in changelog_data.items(): self._create_version(version, elements) last_version_item = self.version_accordion.item_at(0) last_version_item.set_collapsed(False)
def ui(self): super(InfoMessage, self).ui() self.setMaximumHeight(150) info_icon = resources.icon('info') self._expandable_frame = expandables.ExpandableFrame(icon=info_icon, parent=self) self._expandable_frame.setFrameStyle(QFrame.StyledPanel | QFrame.Raised) expandable_layout = layouts.HorizontalLayout(margins=(2, 2, 2, 2)) texts_layout = layouts.HorizontalLayout(spacing=0, margins=(0, 0, 0, 0)) self._description_text = QPlainTextEdit(parent=self) self._description_text.setReadOnly(True) self._description_text.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Maximum) self._description_text.setFocusPolicy(Qt.NoFocus) self._description_text.setFrameShape(QFrame.NoFrame) self._instructions_widget = QWidget() instructions_layout = layouts.VerticalLayout(spacing=2, margins=(0, 0, 0, 0)) self._instructions_widget.setLayout(instructions_layout) self._instructions_text = QTextEdit(parent=self) self._instructions_text.setReadOnly(True) self._instructions_text.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Maximum) self._instructions_text.setFocusPolicy(Qt.NoFocus) self._instructions_text.setFrameShape(QFrame.NoFrame) self._instructions_widget.setVisible(False) # self._instructions_text.insertHtml("<ul><li>text 1</li><li>text 2</li><li>text 3</li></ul> <br />") instructions_layout.addWidget(dividers.Divider('Instructions')) instructions_layout.addWidget(self._instructions_text) texts_layout.addWidget(self._description_text) texts_layout.addWidget(self._instructions_widget) content_layout = layouts.VerticalLayout() content_layout.addLayout(texts_layout) expandable_layout.addLayout(content_layout) self._expandable_frame.addLayout(expandable_layout) self.main_layout.addWidget(self._expandable_frame)
def ui(self): super(AutoRenameWidget, self).ui() top_layout = layouts.HorizontalLayout(spacing=2, margins=(0, 0, 0, 0)) self._unique_id_cbx = checkbox.BaseCheckBox('Unique Id') self._last_joint_end_cbx = checkbox.BaseCheckBox('Make Last Joint End') top_layout.addStretch() top_layout.addWidget(self._unique_id_cbx) top_layout.addWidget(self._last_joint_end_cbx) self.main_layout.addLayout(top_layout) main_splitter = QSplitter(Qt.Horizontal) main_splitter.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding) self.main_layout.addWidget(main_splitter) auto_widget = QWidget() auto_layout = layouts.VerticalLayout(spacing=0, margins=(0, 0, 0, 0)) auto_widget.setLayout(auto_layout) main_splitter.addWidget(auto_widget) self._rules_list = QTreeWidget(self) self._rules_list.setHeaderHidden(True) self._rules_list.setSortingEnabled(True) self._rules_list.setRootIsDecorated(False) self._rules_list.setSelectionMode(QAbstractItemView.SingleSelection) self._rules_list.sortByColumn(0, Qt.AscendingOrder) self._rules_list.setUniformRowHeights(True) self._rules_list.setAlternatingRowColors(True) auto_layout.addWidget(self._rules_list) auto_w = QWidget() self.auto_l = layouts.VerticalLayout(spacing=0, margins=(0, 0, 0, 0)) auto_w.setLayout(self.auto_l) auto_w.setMinimumWidth(200) main_splitter.addWidget(auto_w) self.main_auto_layout = QFormLayout() self.auto_l.addLayout(self.main_auto_layout) self._rename_btn = buttons.BaseButton('Rename') self._rename_btn.setIcon(resources.icon('rename')) self.main_layout.addLayout(dividers.DividerLayout()) self.main_layout.addWidget(self._rename_btn)
def __init__(self): super(ScriptsEditorPlugin, self).__init__() self._script_editor_widget = None self._content = QWidget() self._content_layout = layouts.VerticalLayout(spacing=0, margins=(0, 0, 0, 0)) self._content.setLayout(self._content_layout) self.setWidget(self._content)
def __init__(self, widgets_parent, modal=False, parent=None): super(CommandBalloon, self).__init__(modal=modal, parent=parent) self._widgets = list() self._widgets_parent = widgets_parent self.main_layout = layouts.VerticalLayout(spacing=2, margins=(2, 2, 2, 2)) self.setLayout(self.main_layout)
def __init__(self): super(RenamerPlugin, self).__init__() self._renamer_widget = None self._content = QWidget() self._content_layout = layouts.VerticalLayout(spacing=0, margins=(0, 0, 0, 0)) self._content.setLayout(self._content_layout) self.setWidget(self._content)
def ui(self): super(PreferencesWidget, self).ui() self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self._splitter = QSplitter() self._splitter.setOrientation(Qt.Horizontal) self._splitter.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding) self._scroll_area = QScrollArea() self._scroll_area.setWidgetResizable(True) self._scroll_area.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) # self._scroll_area.setMinimumWidth(200) self._scroll_area_widget_contents = QWidget() # self._scroll_area_widget_contents.setGeometry(QRect(0, 0, 480, 595)) self._scroll_area_layout = layouts.VerticalLayout(spacing=2, margins=(1, 1, 1, 1)) self._scroll_area_layout.setAlignment(Qt.AlignTop) self._scroll_area_widget_contents.setLayout(self._scroll_area_layout) self._categories_layout = layouts.VerticalLayout() self._stack = stack.SlidingStackedWidget() self._stack.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self._stack.set_vertical_mode() self._buttons_layout = layouts.HorizontalLayout(spacing=1, margins=(0, 0, 0, 0)) self._save_prefs_close_btn = buttons.BaseButton( 'Save and Close', icon=resources.icon('save'), parent=self) self._close_btn = buttons.BaseButton('Close', icon=resources.icon('cancel'), parent=self) self._buttons_layout.addStretch() self._buttons_layout.addWidget(self._save_prefs_close_btn) self._buttons_layout.addWidget(self._close_btn) self._scroll_area_layout.addLayout(self._categories_layout) self._scroll_area.setWidget(self._scroll_area_widget_contents) self._splitter.addWidget(self._scroll_area) self._splitter.addWidget(self._stack) self._splitter.setSizes([150, 450]) self.main_layout.addWidget(self._splitter) self.main_layout.addWidget(dividers.Divider(parent=self)) self.main_layout.addLayout(self._buttons_layout)
def __init__(self, name, parent=None): super(OptionGroup, self).__init__(parent) if dcc.is_maya(): if dcc.get_version() < 2016: # self.setFrameStyle(self.Panel | self.Raised) palette = self.palette() palette.setColor(self.backgroundRole(), QColor(80, 80, 80)) self.setAutoFillBackground(True) self.setPalette(palette) # else: # self.setFrameStyle(self.NoFrame) if dcc.is_maya(): self._rollout_style = GroupStyles.Maya else: self._rollout_style = GroupStyles.Square self._expanded = True self._clicked = False self._collapsible = True self.close_height = 28 self.setMinimumHeight(self.close_height) self.background_shade = 80 self.main_layout = layouts.VerticalLayout() self.main_layout.setContentsMargins(0, 0, 0, 0) self.main_layout.setSpacing(0) self.setLayout(self.main_layout) self.child_layout = layouts.VerticalLayout() self.child_layout.setContentsMargins(0, 2, 0, 3) self.child_layout.setSpacing(0) self.child_layout.setAlignment(Qt.AlignTop) self.header_layout = layouts.HorizontalLayout() self.main_layout.addSpacing(4) self.main_layout.addLayout(self.child_layout) self.setObjectName(name) self.setTitle(name)
def __init__(self, parent=None): super(WidgetsList, self).__init__(parent=parent) self._widgets_list = list() self.main_layout = layouts.VerticalLayout(spacing=0, margins=(0, 0, 0, 0)) self.main_layout.setAlignment(Qt.AlignTop) self.setLayout(self.main_layout) self.widgets_layout = layouts.VerticalLayout(spacing=0, margins=(0, 0, 0, 0)) self.main_layout.addLayout(self.widgets_layout) button_layout = layouts.HorizontalLayout(margins=(5, 5, 5, 5)) button_layout.setAlignment(Qt.AlignRight) self.main_layout.addLayout(button_layout) self.add_button = QPushButton('New...', parent=self) button_layout.addWidget(self.add_button)
def _init(self): """ Internal function that initializes tooltip widget """ self.setMouseTracking(True) self._layout = layouts.VerticalLayout(parent=self) self._hide_timer.setSingleShot(True) self._hide_timer.setInterval(500) self._hide_timer.timeout.connect(self._on_timer_timeout) # self.setAttribute(Qt.WA_TranslucentBackground) self.setWindowFlags(Qt.ToolTip | Qt.FramelessWindowHint | Qt.NoDropShadowWindowHint)
def ui(self): super(FilterTreeWidget, self).ui() texts_layout = layouts.VerticalLayout(spacing=2, margins=(0, 0, 0, 0)) self._filter_names = search.SearchFindWidget() self._filter_names.set_placeholder_text('Filter Names') self._sub_path_filter = lineedit.BaseLineEdit() self._sub_path_filter.setPlaceholderText('Set Sub Path') self._sub_path_filter.setVisible(False) texts_layout.addWidget(self._filter_names) texts_layout.addWidget(self._sub_path_filter) self.main_layout.addLayout(texts_layout)