本文整理汇总了Python中PySide.QtGui.QFrame.setFixedWidth方法的典型用法代码示例。如果您正苦于以下问题:Python QFrame.setFixedWidth方法的具体用法?Python QFrame.setFixedWidth怎么用?Python QFrame.setFixedWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QFrame
的用法示例。
在下文中一共展示了QFrame.setFixedWidth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PySide.QtGui import QFrame [as 别名]
# 或者: from PySide.QtGui.QFrame import setFixedWidth [as 别名]
def __init__(self, parent, app, widget, on_change):
"""Init and connect signals"""
self.parent = parent
self.app = app
self.widget = widget
self.note = None
self.on_change = on_change
self._resource_labels = {}
self._resources = []
self._res_hash = {}
frame = QFrame()
frame.setLayout(QVBoxLayout())
frame.setFixedWidth(100)
self.widget.setFixedWidth(100)
self.widget.setWidget(frame)
self.widget.hide()
self.mime = magic.open(magic.MIME_TYPE)
self.mime.load()
示例2: __create_ui
# 需要导入模块: from PySide.QtGui import QFrame [as 别名]
# 或者: from PySide.QtGui.QFrame import setFixedWidth [as 别名]
def __create_ui(self):
""" Create main UI """
self.setWindowTitle(CREATE_NODE_TITLE)
# remove window decoration if path and type is set
if self.defined_path and self.defined_type:
self.setWindowFlags(Qt.FramelessWindowHint | Qt.Popup)
main_layout = QVBoxLayout(self)
main_layout.setSpacing(1)
main_layout.setContentsMargins(2, 2, 2, 2)
# content layout
content_layout = QVBoxLayout()
self.files_model = QFileSystemModel()
self.files_model.setNameFilterDisables(False)
self.files_list = MTTFileList()
self.files_list.setAlternatingRowColors(True)
self.files_list.setSelectionMode(QAbstractItemView.ExtendedSelection)
self.files_list.selectionValidated.connect(self.do_validate_selection)
self.files_list.goToParentDirectory.connect(self.on_go_up_parent)
self.files_list.doubleClicked.connect(self.on_double_click)
self.files_list.setModel(self.files_model)
buttons_layout = QHBoxLayout()
content_layout.addLayout(self.__create_filter_ui())
content_layout.addWidget(self.files_list)
content_layout.addLayout(buttons_layout)
self.files_list.filter_line = self.filter_line
if not self.defined_path:
# path line
path_layout = QHBoxLayout()
# bookmark button
bookmark_btn = QPushButton('')
bookmark_btn.setFlat(True)
bookmark_btn.setIcon(QIcon(':/addBookmark.png'))
bookmark_btn.setToolTip('Bookmark this Folder')
bookmark_btn.setStatusTip('Bookmark this Folder')
bookmark_btn.clicked.connect(self.on_add_bookmark)
# path line edit
self.path_edit = QLineEdit()
self.path_edit.editingFinished.connect(self.on_enter_path)
# parent folder button
self.parent_folder_btn = QPushButton('')
self.parent_folder_btn.setFlat(True)
self.parent_folder_btn.setIcon(QIcon(':/SP_FileDialogToParent.png'))
self.parent_folder_btn.setToolTip('Parent Directory')
self.parent_folder_btn.setStatusTip('Parent Directory')
self.parent_folder_btn.clicked.connect(self.on_go_up_parent)
# browse button
browse_btn = QPushButton('')
browse_btn.setFlat(True)
browse_btn.setIcon(QIcon(':/navButtonBrowse.png'))
browse_btn.setToolTip('Browse Directory')
browse_btn.setStatusTip('Browse Directory')
browse_btn.clicked.connect(self.on_browse)
# parent widget and layout
path_layout.addWidget(bookmark_btn)
path_layout.addWidget(self.path_edit)
path_layout.addWidget(self.parent_folder_btn)
path_layout.addWidget(browse_btn)
main_layout.addLayout(path_layout)
# bookmark list
bookmark_parent_layout = QHBoxLayout()
bookmark_frame = QFrame()
bookmark_frame.setFixedWidth(120)
bookmark_layout = QVBoxLayout()
bookmark_layout.setSpacing(1)
bookmark_layout.setContentsMargins(2, 2, 2, 2)
bookmark_frame.setLayout(bookmark_layout)
bookmark_frame.setFrameStyle(QFrame.Sunken)
bookmark_frame.setFrameShape(QFrame.StyledPanel)
self.bookmark_list = MTTBookmarkList()
self.bookmark_list.bookmarkDeleted.connect(self.do_delete_bookmark)
self.bookmark_list.setAlternatingRowColors(True)
self.bookmark_list.dragEnabled()
self.bookmark_list.setAcceptDrops(True)
self.bookmark_list.setDropIndicatorShown(True)
self.bookmark_list.setDragDropMode(QListView.InternalMove)
self.bookmark_list_sel_model = self.bookmark_list.selectionModel()
self.bookmark_list_sel_model.selectionChanged.connect(
self.on_select_bookmark)
bookmark_layout.addWidget(self.bookmark_list)
bookmark_parent_layout.addWidget(bookmark_frame)
bookmark_parent_layout.addLayout(content_layout)
main_layout.addLayout(bookmark_parent_layout)
self.do_populate_bookmarks()
else:
main_layout.addLayout(content_layout)
if not self.defined_type:
# type layout
self.types = QComboBox()
self.types.addItems(self.supported_node_type)
#.........这里部分代码省略.........