本文整理汇总了Python中PyQt5.QtWidgets.QTreeWidget.setObjectName方法的典型用法代码示例。如果您正苦于以下问题:Python QTreeWidget.setObjectName方法的具体用法?Python QTreeWidget.setObjectName怎么用?Python QTreeWidget.setObjectName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QTreeWidget
的用法示例。
在下文中一共展示了QTreeWidget.setObjectName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SqlConnectionWidget
# 需要导入模块: from PyQt5.QtWidgets import QTreeWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTreeWidget import setObjectName [as 别名]
class SqlConnectionWidget(QWidget):
"""
Class implementing a widget showing the SQL connections.
@signal tableActivated(str) emitted after the entry for a table has been
activated
@signal schemaRequested(str) emitted when the schema display is requested
@signal cleared() emitted after the connection tree has been cleared
"""
tableActivated = pyqtSignal(str)
schemaRequested = pyqtSignal(str)
cleared = pyqtSignal()
def __init__(self, parent=None):
"""
Constructor
@param parent reference to the parent widget (QWidget)
"""
super(SqlConnectionWidget, self).__init__(parent)
layout = QVBoxLayout(self)
layout.setContentsMargins(0, 0, 0, 0)
self.__connectionTree = QTreeWidget(self)
self.__connectionTree.setObjectName("connectionTree")
self.__connectionTree.setHeaderLabels([self.tr("Database")])
if qVersion() >= "5.0.0":
self.__connectionTree.header().setSectionResizeMode(
QHeaderView.Stretch)
else:
self.__connectionTree.header().setResizeMode(QHeaderView.Stretch)
refreshAction = QAction(self.tr("Refresh"), self.__connectionTree)
self.__schemaAction = QAction(
self.tr("Show Schema"), self.__connectionTree)
refreshAction.triggered.connect(self.refresh)
self.__schemaAction.triggered.connect(self.showSchema)
self.__connectionTree.addAction(refreshAction)
self.__connectionTree.addAction(self.__schemaAction)
self.__connectionTree.setContextMenuPolicy(Qt.ActionsContextMenu)
layout.addWidget(self.__connectionTree)
self.__activating = False
self.__connectionTree.itemActivated.connect(self.__itemActivated)
self.__connectionTree.currentItemChanged.connect(
self.__currentItemChanged)
self.__activeDb = ""
def refresh(self):
"""
Public slot to refresh the connection tree.
"""
self.__connectionTree.clear()
self.cleared.emit()
connectionNames = QSqlDatabase.connectionNames()
foundActiveDb = False
for name in connectionNames:
root = QTreeWidgetItem(self.__connectionTree)
db = QSqlDatabase.database(name, False)
root.setText(0, self.__dbCaption(db))
if name == self.__activeDb:
foundActiveDb = True
self.__setActive(root)
if db.isOpen():
tables = db.tables()
for table in tables:
itm = QTreeWidgetItem(root)
itm.setText(0, table)
if not foundActiveDb and connectionNames:
self.__activeDb = connectionNames[0]
self.__setActive(self.__connectionTree.topLevelItem(0))
def showSchema(self):
"""
Public slot to show schema data of a database.
"""
cItm = self.__connectionTree.currentItem()
if cItm is None or cItm.parent() is None:
return
self.__setActive(cItm.parent())
self.schemaRequested.emit(cItm.text(0))
def __itemActivated(self, itm, column):
"""
Private slot handling the activation of an item.
@param itm reference to the item (QTreeWidgetItem)
@param column column that was activated (integer)
"""
if itm is None:
return
#.........这里部分代码省略.........
示例2: ConfigurationWidget
# 需要导入模块: from PyQt5.QtWidgets import QTreeWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTreeWidget import setObjectName [as 别名]
#.........这里部分代码省略.........
# set the initial size of the splitter
self.configSplitter.setSizes([200, 600])
self.configList.itemActivated.connect(self.__showConfigurationPage)
self.configList.itemClicked.connect(self.__showConfigurationPage)
self.buttonBox.accepted.connect(self.accept)
self.buttonBox.rejected.connect(self.rejected)
if displayMode in [ConfigurationWidget.HelpBrowserMode,
ConfigurationWidget.TrayStarterMode,
ConfigurationWidget.HexEditorMode]:
self.configListSearch.hide()
if displayMode not in [ConfigurationWidget.TrayStarterMode,
ConfigurationWidget.HexEditorMode]:
self.__initLexers()
def accept(self):
"""
Public slot to accept the buttonBox accept signal.
"""
if not isMacPlatform():
wdg = self.focusWidget()
if wdg == self.configList:
return
self.accepted.emit()
def __setupUi(self):
"""
Private method to perform the general setup of the configuration
widget.
"""
self.setObjectName("ConfigurationDialog")
self.resize(900, 650)
self.verticalLayout_2 = QVBoxLayout(self)
self.verticalLayout_2.setSpacing(6)
self.verticalLayout_2.setContentsMargins(6, 6, 6, 6)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.configSplitter = QSplitter(self)
self.configSplitter.setOrientation(Qt.Horizontal)
self.configSplitter.setObjectName("configSplitter")
self.configListWidget = QWidget(self.configSplitter)
self.leftVBoxLayout = QVBoxLayout(self.configListWidget)
self.leftVBoxLayout.setContentsMargins(0, 0, 0, 0)
self.leftVBoxLayout.setSpacing(0)
self.leftVBoxLayout.setObjectName("leftVBoxLayout")
self.configListSearch = E5ClearableLineEdit(
self, self.tr("Enter search text..."))
self.configListSearch.setObjectName("configListSearch")
self.leftVBoxLayout.addWidget(self.configListSearch)
self.configList = QTreeWidget()
self.configList.setObjectName("configList")
self.leftVBoxLayout.addWidget(self.configList)
self.configListSearch.textChanged.connect(self.__searchTextChanged)
self.scrollArea = QScrollArea(self.configSplitter)
self.scrollArea.setFrameShape(QFrame.NoFrame)
self.scrollArea.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
self.scrollArea.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
self.scrollArea.setWidgetResizable(False)
self.scrollArea.setObjectName("scrollArea")
self.configStack = QStackedWidget()
示例3: EditorConfiguration
# 需要导入模块: from PyQt5.QtWidgets import QTreeWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTreeWidget import setObjectName [as 别名]
#.........这里部分代码省略.........
self._showErrorsOnLine.setChecked(settings.ERRORS_HIGHLIGHT_LINE)
self._showErrorsOnLine.stateChanged[int].connect(
self._enable_errors_inline)
vboxg3.addWidget(self._checkErrors)
vboxg3.addWidget(self._showErrorsOnLine)
vboxg3.addItem(QSpacerItem(0, 0, QSizePolicy.Expanding))
formFeatures.addWidget(group3, 2, 0)
# Find PEP8 Errors (highlighter)
vboxg4 = QHBoxLayout(group4)
vboxg4.setContentsMargins(5, 15, 5, 5)
vvbox = QVBoxLayout()
self._checkStyle = QCheckBox(
translations.TR_PREFERENCES_EDITOR_CONFIG_SHOW_PEP8)
self._checkStyle.setChecked(settings.CHECK_STYLE)
self._checkStyle.stateChanged[int].connect(self._disable_check_style)
vvbox.addWidget(self._checkStyle)
self._checkStyleOnLine = QCheckBox(
translations.TR_PREFERENCES_EDITOR_CONFIG_SHOW_TOOLTIP_PEP8)
self._checkStyleOnLine.setChecked(settings.CHECK_HIGHLIGHT_LINE)
self._checkStyleOnLine.stateChanged[int].connect(
self._enable_check_inline)
vvbox.addWidget(self._checkStyleOnLine)
vvbox.addItem(QSpacerItem(0, 0,
QSizePolicy.Expanding, QSizePolicy.Expanding))
vboxg4.addLayout(vvbox)
# Container for tree widget and buttons
widget = QWidget()
hhbox = QHBoxLayout(widget)
hhbox.setContentsMargins(0, 0, 0, 0)
# Tree Widget with custom item delegate
# always adds uppercase text
self._listIgnoreViolations = QTreeWidget()
self._listIgnoreViolations.setObjectName("ignore_pep8")
self._listIgnoreViolations.setItemDelegate(ui_tools.CustomDelegate())
self._listIgnoreViolations.setMaximumHeight(80)
self._listIgnoreViolations.setHeaderLabel(
translations.TR_PREFERENCES_EDITOR_CONFIG_IGNORE_PEP8)
for ic in settings.IGNORE_PEP8_LIST:
self._listIgnoreViolations.addTopLevelItem(QTreeWidgetItem([ic]))
hhbox.addWidget(self._listIgnoreViolations)
box = QVBoxLayout()
box.setContentsMargins(0, 0, 0, 0)
btn_add = QPushButton(QIcon(":img/add_small"), '')
btn_add.setMaximumSize(26, 24)
btn_add.clicked.connect(self._add_code_pep8)
box.addWidget(btn_add)
btn_remove = QPushButton(QIcon(":img/delete_small"), '')
btn_remove.setMaximumSize(26, 24)
btn_remove.clicked.connect(self._remove_code_pep8)
box.addWidget(btn_remove)
box.addItem(QSpacerItem(0, 0,
QSizePolicy.Fixed, QSizePolicy.Expanding))
hhbox.addLayout(box)
vboxg4.addWidget(widget)
formFeatures.addWidget(group4)
# Show Python3 Migration, DocStrings and Spaces (highlighter)
vboxg5 = QVBoxLayout(group5)
vboxg5.setContentsMargins(5, 15, 5, 5)
self._showMigrationTips = QCheckBox(
translations.TR_PREFERENCES_EDITOR_CONFIG_SHOW_MIGRATION)
self._showMigrationTips.setChecked(settings.SHOW_MIGRATION_TIPS)
vboxg5.addWidget(self._showMigrationTips)
self._checkForDocstrings = QCheckBox(
translations.TR_PREFERENCES_EDITOR_CONFIG_CHECK_FOR_DOCSTRINGS)
示例4: MainWindow
# 需要导入模块: from PyQt5.QtWidgets import QTreeWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTreeWidget import setObjectName [as 别名]
class MainWindow(QMainWindow):
def __init__(self):
super(MainWindow, self).__init__()
self.dbm_obj = Dbm()
self.curFile = ''
self.textEdit = QTextEdit()
self.sectionTreeWidget = QTreeWidget()
self.notesListWidget = QListWidget()
self.createHorizontalGroupBox()
self.setCentralWidget(self.horizontalGroupBox)
self.createActions()
self.createMenus()
# self.createToolBars()
self.createStatusBar()
self.readSettings()
[self.hierarchy_dict, self.notebook_dict, self.section_dict, self.page_dict] = [{}, {}, {}, {}]
self.setCurrentFile('')
# For binding slots and signals
self.fetchPageThread = FetchPage()
self.fetchPageThread.setObjectName('fetchPageThread')
self.syncAllThread = SyncAllThread()
self.syncAllThread.setObjectName('syncAllThread')
self.textEdit.document().contentsChanged.connect(self.documentWasModified)
self.sectionTreeWidget.setObjectName("sectionTreeWidget")
self.notesListWidget.setObjectName("notesListWidget")
QMetaObject.connectSlotsByName(self)
self.readDB()
@pyqtSlot()
def on_sectionTreeWidget_itemSelectionChanged(self):
for x in self.sectionTreeWidget.selectedItems():
if x.text(1) in self.section_dict.keys():
self.populate_notes_list(x.parent().text(1), x.text(1))
@pyqtSlot()
def on_notesListWidget_itemSelectionChanged(self):
for x in self.notesListWidget.selectedItems():
self.fetchPageThread.fetchSignal.connect(self.on_fetchPageThread_fetchComplete)
self.titleLabel.setText("Syncing")
self.statusBar().showMessage("Syncing")
# self.fetchPageThread.fetchSignal.connect(lambda:self.view.setHtml("<body>hello world</body>"))
self.fetchPageThread.fetch(self.page_dict[x.data(1)])
def on_fetchPageThread_fetchComplete(self, string):
self.view.setHtml(string)
self.titleLabel.setText(self.view.title())
self.statusBar().showMessage("Page fetched")
def on_syncAllThread_syncComplete(self, dbm):
self.dbm_obj = dbm
self.statusBar().showMessage("Sync complete")
def createHorizontalGroupBox(self):
self.horizontalGroupBox = QGroupBox()
layout = QHBoxLayout()
self.sectionTreeWidget.setHeaderHidden(1)
layout.addWidget(self.sectionTreeWidget, 0)
self.sectionTreeWidget.setStyleSheet("background-color: rgb(215,227,229)")
self.notesListWidget.setWindowTitle('Notes')
layout.addWidget(self.notesListWidget, 0)
self.notesListWidget.setStyleSheet("QListWidget {background-color: rgb(196,226,233)}")
subVBox = QGroupBox()
vLayout = QVBoxLayout()
self.titleLabel = QLabel()
vLayout.addWidget(self.titleLabel, 0)
self.view = QWebView()
vLayout.addWidget(self.view, 1)
subVBox.setLayout(vLayout)
layout.addWidget(subVBox, 1)
self.horizontalGroupBox.setLayout(layout)
def closeEvent(self, event):
if self.maybeSave():
self.writeSettings()
event.accept()
else:
event.ignore()
def newFile(self):
self.readDB()
# if self.maybeSave():
# self.textEdit.clear()
# self.setCurrentFile('')
def open(self):
if self.maybeSave():
fileName, _ = QFileDialog.getOpenFileName(self)
if fileName:
#.........这里部分代码省略.........
示例5: MainWindow
# 需要导入模块: from PyQt5.QtWidgets import QTreeWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTreeWidget import setObjectName [as 别名]
#.........这里部分代码省略.........
self.lblTxtVar2 = QLabel()
self.lblTxtVar2.setFont(QFont('Veranda', 14, QFont.Bold))
self.lblTxtVar2.setMargin(0)
self.lblSkuName = QLabel()
self.lblSkuName.setFont(QFont('Veranda', 14, QFont.Bold))
self.lblSkuName.setMargin(10)
self.searchToolBar.addWidget(btnNameChange)
self.searchToolBar.addWidget(self.lblVar1)
self.searchToolBar.addWidget(self.lblTxtVar1)
self.searchToolBar.addWidget(self.lblVar2)
self.searchToolBar.addWidget(self.lblTxtVar2)
self.searchToolBar.addWidget(self.lblSkuName)
def createStatusBar(self):
self.statusBar().showMessage("Ready")
def createDockWindows(self):
dock = QDockWidget("Available Garments Types", self)
#dock.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea)
self.availableItems = QListWidget(dock)
self.availableItems.setMinimumWidth(350)
self.availableItems.setMaximumWidth(350)
#self.availableItems.addItems(("stuff"))
self.availableItems.itemClicked.connect(self.itemClicked_Click)
dock.setWidget(self.availableItems)
self.addDockWidget(Qt.RightDockWidgetArea, dock)
self.viewMenu.addAction(dock.toggleViewAction())
dock.hide()
self.dock = QDockWidget("Available Garment Sizes", self)
self.orderItem = QTreeWidget(dock)
#self.orderItem.setMinimumWidth(350)
#self.orderItem.setMaximumWidth(350)
#self.orderItem.insertText(("more stuff"))
self.dock.setWidget(self.orderItem)
self.addDockWidget(Qt.RightDockWidgetArea, self.dock)
self.viewMenu.addAction(self.dock.toggleViewAction())
self.dock.hide()
#Create a tree widget for use when the t-shirt is clicked.
self.treeDock = QDockWidget("Order Items", self)
self.garmentTree = QTreeWidget(self.treeDock)
self.garmentTree.setObjectName('garmentTree')
self.garmentTree.itemClicked.connect(CSRWidgets.sumQuantity)
self.garmentTree.itemClicked.connect(lambda: CSRWidgets.updateNameDesign(self))
self.garmentTree.setMaximumWidth(480)
self.garmentTree.setMinimumWidth(480)
self.treeDock.hide()
def btnSale_Click(self):
btnName = self.sender()
sku_code = str(btnName.objectName())
# #print(sku_code)
# sv = mysql_db.getSecondVar(self, sku_code)
# if self.var1 == "":
# CSRWidgets.getCustomerName(self, sku_code)
# elif self.var1 != "" and not self.var2:
# sv = mysql_db.getSecondVar(self, sku_code)
# print(sv)
# if sv:
# CSRWidgets.getCustomerName(self, sku_code)
# else:
# self.var2 = None
# self.lblVar2.hide()
# self.lblTxtVar2.hide()
CSRWidgets.loadDesignItem(self, sku_code)
def btnNameChange_Click(self):
CSRWidgets.changeCustName(self)
def btnHome_Click(self):
CSRWidgets.changeCentralWidget(self, CSRWidgets.createDesignButtons(self,'default'))
self.availableItems.clear()
itSku = QTreeWidgetItemIterator(self.garmentTree)
#################################################################################
while itSku.value():
if itSku.value().parent() != None:
itSku.value().setExpanded(False)
itSku += 1
#################################################################################
def btnSearch_Click(self):
self.availableItems.clear()
#self.orderItem.clear()
searchTerm = self.searchBar.text()
CSRWidgets.changeCentralWidget(self, CSRWidgets.createDesignButtons(self,searchTerm))
def btnUndo_Click(self):
CSRWidgets.undo(self)
def itemClicked_Click(self):
button = self.sender()
txtItem = button.uniqueId
CSRWidgets.loadGarmentInfo(self, self.currentInfo[txtItem][2], self.currentInfo[txtItem][1], self.currentInfo[txtItem][0], self.currentInfo[txtItem][6])
示例6: Ui_Ucics
# 需要导入模块: from PyQt5.QtWidgets import QTreeWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTreeWidget import setObjectName [as 别名]
class Ui_Ucics(object):
def setupUi(self, Ucics):
size_280_650 = QSize(280, 650)
size_20_20 = QSize(20, 20)
size_25_25 = QSize(25, 25)
Ucics.setObjectName("Ucics")
Ucics.resize(size_280_650) # 窗口大小
Ucics.setMinimumSize(size_280_650) # 设置最小大小
Ucics.setMaximumSize(size_280_650) # 设置最大大小
Ucics.setWindowFlags(Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint) # 无边框
Ucics.setMouseTracking(True) # 可拖动
Ucics.setContextMenuPolicy(Qt.NoContextMenu) # 禁止上下文菜单
# 由于父QWidget无法通过样式设置背景
# 所以这里把所有控件放到子QWidget中
self.bgWidget = QWidget(Ucics)
self.bgWidget.setObjectName("bgWidget")
# 顶部标题图标 最小化 关闭
self.topWidget = QWidget(self.bgWidget)
self.topWidget.setMaximumHeight(25)
self.topWidget.setObjectName("topWidget")
# --布局
topLayout = QHBoxLayout(self.topWidget)
topLayout.setSpacing(1)
topLayout.setContentsMargins(0, 0, 0, 0)
topLayout.setObjectName("topLayout")
# ----icon
self.iconLabel = QLabel(self.bgWidget)
self.iconLabel.setMinimumSize(size_25_25)
self.iconLabel.setMaximumSize(size_25_25)
self.iconLabel.setObjectName("iconLabel")
# ----最小化按钮
self.minButton = QPushButton(self.bgWidget)
self.minButton.setMinimumSize(size_25_25)
self.minButton.setMaximumSize(size_25_25)
self.minButton.setObjectName("minButton")
# ----关闭按钮
self.closeButton = QPushButton(self.bgWidget)
self.closeButton.setMinimumSize(size_25_25)
self.closeButton.setMaximumSize(size_25_25)
self.closeButton.setObjectName("closeButton")
# ----添加到布局中
topLayout.addWidget(self.iconLabel, 0, Qt.AlignLeft)
topLayout.addWidget(self.minButton, 1, Qt.AlignRight)
topLayout.addWidget(self.closeButton, 0, Qt.AlignRight)
# 头像 昵称 心情 天气等
self.headWidget = QWidget(self.bgWidget)
self.headWidget.setMinimumHeight(90)
self.headWidget.setMaximumHeight(90)
self.headWidget.setObjectName("headWidget")
# --布局
headLayout = QHBoxLayout(self.headWidget)
headLayout.setSpacing(6)
headLayout.setContentsMargins(9, 20, 9, 6)
headLayout.setObjectName("headLayout")
# ----头像
self.headLabel = QLabel(self.headWidget)
self.headLabel.setMinimumWidth(60)
self.headLabel.setMaximumWidth(60)
self.headLabel.setToolTip("")
self.headLabel.setCursor(QCursor(Qt.PointingHandCursor))
self.headLabel.setObjectName("headLabel")
# ----中间部分(昵称和签名等)
self.headInfoWidget = QWidget(self.headWidget)
self.headInfoWidget.setObjectName("headInfoWidget")
# ------中间部分布局
headInfoLayout = QVBoxLayout(self.headInfoWidget)
headInfoLayout.setSpacing(1)
headInfoLayout.setContentsMargins(0, 0, 0, 0)
headInfoLayout.setObjectName("headInfoLayout")
# --------昵称
self.nameLabel = QLabel(self.headInfoWidget)
self.nameLabel.setMinimumHeight(20)
self.nameLabel.setMaximumHeight(20)
self.nameLabel.setObjectName("nameLabel")
# --------签名
self.moodEdit = LineEdit(self.headInfoWidget)
self.moodEdit.setMinimumHeight(20)
self.moodEdit.setMaximumHeight(20)
self.moodEdit.setFrame(False) # 去掉边框
# self.moodEdit.setClearButtonEnabled(True) # 添加清除按钮
self.moodEdit.setObjectName("moodEdit")
# --------工具
self.toolWidget = QWidget(self.headInfoWidget)
self.toolWidget.setMinimumHeight(20)
self.toolWidget.setMaximumHeight(20)
self.toolWidget.setObjectName("toolWidget")
# ----------工具布局
toolLayout = QHBoxLayout(self.toolWidget)
toolLayout.setSpacing(1)
toolLayout.setContentsMargins(0, 0, 0, 0)
toolLayout.setObjectName("toolLayout")
# ------------空间
self.qzoneButton = QPushButton(self.toolWidget)
self.qzoneButton.setMinimumSize(size_20_20)
self.qzoneButton.setMaximumSize(size_20_20)
self.qzoneButton.setObjectName("qzoneButton")
#.........这里部分代码省略.........
示例7: KeyMgmt
# 需要导入模块: from PyQt5.QtWidgets import QTreeWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QTreeWidget import setObjectName [as 别名]
class KeyMgmt(QWidget):
def __init__(self, gui):
super(KeyMgmt, self).__init__()
self.ui = gui
self.tran = self.ui.tran
self.parser = self.ui.configparser
self.config = self.ui.config
self.setObjectName("keytab")
self.layout = QGridLayout(self)
self.layout.setObjectName('keytab_layout')
# the new button
self.button_new = QPushButton(self)
self.button_new.setObjectName('key_tab_button_new')
self.button_new.setText(self.tran.get_text(self.button_new.objectName()))
# edit button
self.button_edit = QPushButton(self)
self.button_edit.setObjectName('key_tab_button_edit')
self.button_edit.setText(self.tran.get_text(self.button_edit.objectName()))
# setup the delete button
self.button_delete = QPushButton(self)
self.button_delete.setObjectName('key_tab_button_delete')
self.button_delete.setText(self.tran.get_text(self.button_delete.objectName()))
# import button
self.button_import = QPushButton(self)
self.button_import.setObjectName('key_tab_button_import')
self.button_import.setText(self.tran.get_text(self.button_import.objectName()))
# export button
self.button_export = QPushButton(self)
self.button_export.setObjectName('key_tab_button_export')
self.button_export.setText(self.tran.get_text(self.button_export.objectName()))
# drop down menu
self.combobox = QComboBox(self)
self.combobox.setObjectName('key_tab_combobox')
# scroll area
self.scroll = QScrollArea(self)
self.scroll.setWidgetResizable(True)
self.scroll.setObjectName('key_tab_scroll')
# widget that holds the scroll area contents
self.scroll_content = QWidget()
self.scroll_content.setGeometry(QRect(0, 0, 800, 400))
self.scroll_content.setObjectName('key_tab_scroll_content')
# layout for the scroll area main widget
self.scroll_content_layout = QGridLayout(self.scroll_content)
self.scroll_content_layout.setObjectName('key_tab_scroll_content_layout')
# setup the tree widget
self.tree = QTreeWidget(self.scroll_content)
self.tree.setObjectName('key_tab_tree')
# add the tree widget to the layout of the scroll area
self.scroll_content_layout.addWidget(self.tree) # TODO change to grid layout
# add the contents of the scroll area to the scroll area
self.scroll.setWidget(self.scroll_content)
# add the components to the main layout
self.layout.addWidget(self.button_new, 0, 0, 1, 1)
self.layout.addWidget(self.button_edit, 0, 1, 1, 1)
self.layout.addWidget(self.button_delete, 0, 2, 1, 1)
self.layout.addWidget(self.button_import, 0, 3, 1, 1)
self.layout.addWidget(self.button_export, 0, 4, 1, 1)
self.layout.addWidget(self.combobox, 0, 5, 1, 1)
self.layout.addWidget(self.scroll, 1, 0, 1, 6)
# add relevant widgets to tooltip list
self.tooltips = [
self.button_delete, self.button_edit, self.button_import,
self.button_new, self.button_export, self.combobox
]