本文整理汇总了Python中PyQt5.QtWidgets.QBoxLayout.setDirection方法的典型用法代码示例。如果您正苦于以下问题:Python QBoxLayout.setDirection方法的具体用法?Python QBoxLayout.setDirection怎么用?Python QBoxLayout.setDirection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QBoxLayout
的用法示例。
在下文中一共展示了QBoxLayout.setDirection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: E5SideBar
# 需要导入模块: from PyQt5.QtWidgets import QBoxLayout [as 别名]
# 或者: from PyQt5.QtWidgets.QBoxLayout import setDirection [as 别名]
#.........这里部分代码省略.........
@param index index of the tab to check (integer)
@return flag indicating the enabled state (boolean)
"""
return self.__tabBar.isTabEnabled(index)
def setTabEnabled(self, index, enabled):
"""
Public method to set the enabled state of a tab.
@param index index of the tab to set (integer)
@param enabled enabled state to set (boolean)
"""
self.__tabBar.setTabEnabled(index, enabled)
def orientation(self):
"""
Public method to get the orientation of the sidebar.
@return orientation of the sidebar (North, East, South, West)
"""
return self.__orientation
def setOrientation(self, orient):
"""
Public method to set the orientation of the sidebar.
@param orient orientation of the sidebar (North, East, South, West)
"""
if orient == E5SideBar.North:
self.__tabBar.setShape(QTabBar.RoundedNorth)
self.__tabBar.setSizePolicy(
QSizePolicy.Expanding, QSizePolicy.Preferred)
self.barLayout.setDirection(QBoxLayout.LeftToRight)
self.layout.setDirection(QBoxLayout.TopToBottom)
self.layout.setAlignment(self.barLayout, Qt.AlignLeft)
elif orient == E5SideBar.East:
self.__tabBar.setShape(QTabBar.RoundedEast)
self.__tabBar.setSizePolicy(
QSizePolicy.Preferred, QSizePolicy.Expanding)
self.barLayout.setDirection(QBoxLayout.TopToBottom)
self.layout.setDirection(QBoxLayout.RightToLeft)
self.layout.setAlignment(self.barLayout, Qt.AlignTop)
elif orient == E5SideBar.South:
self.__tabBar.setShape(QTabBar.RoundedSouth)
self.__tabBar.setSizePolicy(
QSizePolicy.Expanding, QSizePolicy.Preferred)
self.barLayout.setDirection(QBoxLayout.LeftToRight)
self.layout.setDirection(QBoxLayout.BottomToTop)
self.layout.setAlignment(self.barLayout, Qt.AlignLeft)
elif orient == E5SideBar.West:
self.__tabBar.setShape(QTabBar.RoundedWest)
self.__tabBar.setSizePolicy(
QSizePolicy.Preferred, QSizePolicy.Expanding)
self.barLayout.setDirection(QBoxLayout.TopToBottom)
self.layout.setDirection(QBoxLayout.LeftToRight)
self.layout.setAlignment(self.barLayout, Qt.AlignTop)
self.__orientation = orient
def tabIcon(self, index):
"""
Public method to get the icon of a tab.
@param index index of the tab (integer)
@return icon of the tab (QIcon)
"""