本文整理汇总了Python中PySide.QtGui.QTabWidget.setCornerWidget方法的典型用法代码示例。如果您正苦于以下问题:Python QTabWidget.setCornerWidget方法的具体用法?Python QTabWidget.setCornerWidget怎么用?Python QTabWidget.setCornerWidget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QTabWidget
的用法示例。
在下文中一共展示了QTabWidget.setCornerWidget方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: window
# 需要导入模块: from PySide.QtGui import QTabWidget [as 别名]
# 或者: from PySide.QtGui.QTabWidget import setCornerWidget [as 别名]
#.........这里部分代码省略.........
self.bookmarks_layout.addWidget(link)
self.bookmarks_widget = QFrame()
self.bookmarks_widget.setObjectName("BookmarkWidget")
self.bookmarks_widget.setStyleSheet(self.style_sheet)
self.bookmarks_widget.setLayout(self.bookmarks_layout)
if not bookmarks:
self.bookmarks_widget.hide()
# Task list
self.tasklist = QStandardItemModel()
#parentItem = self.tasklist.invisibleRootItem()
#self.tasklist.header().hide()
self.tasklist.setHorizontalHeaderItem(0, QStandardItem('Tasks'))
parentItem = QStandardItem("Parent")
self.tasklist.appendRow(parentItem)
for i in range(4):
item = QStandardItem("Item %d" % i)
parentItem.appendRow(item)
#parentItem = item
#self.list.activated[str].connect(self.handleBookmarks)
#self.list.view().setSizePolicy(QSizePolicy.Minimum,QSizePolicy.Minimum)
# create tabs
self.tabs = QTabWidget()
self.tabs.setDocumentMode(True)
self.tabs.setTabsClosable(True)
self.tabs.setMovable(True)
self.tabs.tabBar().hide()
self.tabs.setFont(QFont("Helvetica Neue", 11, QFont.Normal))
self.tabs.setCornerWidget(self.nbutton)
self.tabs.cornerWidget().setObjectName("CornerWidget")
self.tabs.cornerWidget().setMinimumSize(10, 24)
self.tabs.cornerWidget().setSizePolicy(QSizePolicy.Minimum,QSizePolicy.Minimum)
if saved_tabs:
for tab in saved_tabs['tabs']:
tasklist = QTreeView()
tasklist.hide()
tasklist.setObjectName('taskList')
tasklist.setMinimumWidth(100)
tasklist.setMaximumWidth(250)
new_tab = QWebView()
new_tab.setObjectName('webView')
inspector = QWebInspector(self)
inspector.setObjectName('webInspector')
inspector.hide()
page_layout = QVBoxLayout()
page_layout.setSpacing(0)
page_layout.setContentsMargins(0, 0, 0, 0)
page_layout.addWidget(new_tab)
page_layout.addWidget(inspector)
page_widget = QFrame()
page_widget.setObjectName('pageWidget')
page_widget.setLayout(page_layout)
complete_tab_layout = QHBoxLayout()
complete_tab_layout.setSpacing(0)
complete_tab_layout.setContentsMargins(0, 0, 0, 0)
complete_tab_layout.addWidget(tasklist)
示例2: uiManager
# 需要导入模块: from PySide.QtGui import QTabWidget [as 别名]
# 或者: from PySide.QtGui.QTabWidget import setCornerWidget [as 别名]
class uiManager(QMainWindow):
def __init__(self):
super(uiManager, self).__init__()
self.setMinimumSize(900,500)
self.setWindowTitle("Manage")
self.aFileModel = FileModel() # Add files
self.sFileModel = FileModel() # Queried files
self.eFileModel = FileModel() # Editing files
self.tabWidget = QTabWidget()
self.setCentralWidget(self.tabWidget)
self.defActions()
self.addTab()
self.searchTab()
self.editTab()
self.testtab()
self.statusBar().showMessage("Hi.")
def defActions(self):
self.findAct = QAction("+", self, triggered=self.findFilesDlg)
self.dropAddTabAct = QAction("-", self, shortcut="Delete",
triggered=self.dropAddTabRows)
self.dropEditTabAct = QAction("-", self, shortcut="Delete",
triggered=self.dropEditTabRows)
def dropEditTabRows(self):
self.dropFiles(self.eFileTable, self.eFileModel)
def dropAddTabRows(self):
self.dropFiles(self.aFileTable, self.aFileModel)
def testtab(self):
self.test = QWidget()
self.tabWidget.addTab(self.test, "WORDS")
self.tabWidget.setCornerWidget(self.test)
def addTab(self):
self.aFileTable = QTableView()
self.aFileTable.setModel(self.aFileModel)
self.aFileTable.setSelectionBehavior(QAbstractItemView.SelectRows)
self.setColumnsWidths(self.aFileTable)
self.addWidget = QWidget()
vLayout = QVBoxLayout()
vLayout.addWidget(self.aFileTable)
addBtn = QToolButton()
addBtn.setDefaultAction(self.findAct)
# addBtn.clicked.connect(self.findFilesDlg)
dropBtn = QToolButton()
dropBtn.setDefaultAction(self.dropAddTabAct)
# rmvBtn.clicked.connect(self.rmvFiles)
insBtn = QPushButton("Track")
insBtn.clicked.connect(self.insert)
hLayout = QHBoxLayout()
hLayout.addWidget(addBtn)
hLayout.addWidget(dropBtn)
hLayout.addStretch(1)
hLayout.addWidget(insBtn)
vLayout.addLayout(hLayout)
self.addWidget.setLayout(vLayout)
self.tabWidget.addTab(self.addWidget, u"Add")
def searchTab(self):
# sFileModel + view tab
self.sFileTable = QTableView()
self.sFileTable.setModel(self.sFileModel)
self.sFileTable.setEditTriggers(QAbstractItemView.NoEditTriggers)
self.sFileTable.setSelectionBehavior(QAbstractItemView.SelectRows)
self.setColumnsWidths(self.sFileTable)
self.searchWidget = QWidget()
# Horizontal layout
# Button, Line Edit, Button
hLayout = QHBoxLayout()
self.searchBox = QLineEdit()
#.........这里部分代码省略.........