本文整理匯總了Python中PyQt4.QtGui.QTabBar.tabToolTip方法的典型用法代碼示例。如果您正苦於以下問題:Python QTabBar.tabToolTip方法的具體用法?Python QTabBar.tabToolTip怎麽用?Python QTabBar.tabToolTip使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PyQt4.QtGui.QTabBar
的用法示例。
在下文中一共展示了QTabBar.tabToolTip方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: E4SideBar
# 需要導入模塊: from PyQt4.QtGui import QTabBar [as 別名]
# 或者: from PyQt4.QtGui.QTabBar import tabToolTip [as 別名]
#.........這裏部分代碼省略.........
@param index index of the tab (integer)
@return icon of the tab (QIcon)
"""
return self.__tabBar.tabIcon(index)
def setTabIcon(self, index, icon):
"""
Public method to set the icon of a tab.
@param index index of the tab (integer)
@param icon icon to be set (QIcon)
"""
self.__tabBar.setTabIcon(index, icon)
def tabText(self, index):
"""
Public method to get the text of a tab.
@param index index of the tab (integer)
@return text of the tab (QString)
"""
return self.__tabBar.tabText(index)
def setTabText(self, index, text):
"""
Public method to set the text of a tab.
@param index index of the tab (integer)
@param text text to set (QString)
"""
self.__tabBar.setTabText(index, text)
def tabToolTip(self, index):
"""
Public method to get the tooltip text of a tab.
@param index index of the tab (integer)
@return tooltip text of the tab (QString)
"""
return self.__tabBar.tabToolTip(index)
def setTabToolTip(self, index, tip):
"""
Public method to set the tooltip text of a tab.
@param index index of the tab (integer)
@param tooltip text text to set (QString)
"""
self.__tabBar.setTabToolTip(index, tip)
def tabWhatsThis(self, index):
"""
Public method to get the WhatsThis text of a tab.
@param index index of the tab (integer)
@return WhatsThis text of the tab (QString)
"""
return self.__tabBar.tabWhatsThis(index)
def setTabWhatsThis(self, index, text):
"""
Public method to set the WhatsThis text of a tab.
@param index index of the tab (integer)
@param WhatsThis text text to set (QString)
示例2: SideBar
# 需要導入模塊: from PyQt4.QtGui import QTabBar [as 別名]
# 或者: from PyQt4.QtGui.QTabBar import tabToolTip [as 別名]
#.........這裏部分代碼省略.........
self.expand()
return
def indexOf( self, widget ):
""" Provides the index of the given widget """
return self.__stackedWidget.indexOf( widget )
def isTabEnabled( self, index ):
""" Check if the tab is enabled """
return self.__tabBar.isTabEnabled( index )
def setTabEnabled( self, index, enabled ):
""" Set the enabled state of the tab """
self.__tabBar.setTabEnabled( index, enabled )
return
def orientation( self ):
""" Provides the orientation of the sidebar """
return self.__orientation
def setOrientation( self, orient ):
""" Set the orientation of the sidebar """
if orient == SideBar.North:
self.__tabBar.setShape( QTabBar.RoundedNorth )
self.barLayout.setDirection( QBoxLayout.LeftToRight )
self.layout.setDirection( QBoxLayout.TopToBottom )
self.layout.setAlignment( self.barLayout, Qt.AlignLeft )
elif orient == SideBar.East:
self.__tabBar.setShape( QTabBar.RoundedEast )
self.barLayout.setDirection( QBoxLayout.TopToBottom )
self.layout.setDirection( QBoxLayout.RightToLeft )
self.layout.setAlignment( self.barLayout, Qt.AlignTop )
elif orient == SideBar.South:
self.__tabBar.setShape( QTabBar.RoundedSouth )
self.barLayout.setDirection( QBoxLayout.LeftToRight )
self.layout.setDirection( QBoxLayout.BottomToTop )
self.layout.setAlignment( self.barLayout, Qt.AlignLeft )
else:
# default
orient = SideBar.West
self.__tabBar.setShape( QTabBar.RoundedWest )
self.barLayout.setDirection( QBoxLayout.TopToBottom )
self.layout.setDirection( QBoxLayout.LeftToRight )
self.layout.setAlignment( self.barLayout, Qt.AlignTop )
self.__orientation = orient
return
def tabIcon( self, index ):
""" Provide the icon of the tab """
return self.__tabBar.tabIcon( index )
def setTabIcon( self, index, icon ):
""" Set the icon of the tab """
self.__tabBar.setTabIcon( index, icon )
return
def tabText( self, index ):
""" Provide the text of the tab """
return self.__tabBar.tabText( index )
def setTabText( self, index, text ):
""" Set the text of the tab """
self.__tabBar.setTabText( index, text )
return
def tabToolTip( self, index ):
""" Provide the tooltip text of the tab """
return self.__tabBar.tabToolTip( index )
def setTabToolTip( self, index, tip ):
""" Set the tooltip text of the tab """
self.__tabBar.setTabToolTip( index, tip )
return
def tabWhatsThis( self, index ):
""" Provide the WhatsThis text of the tab """
return self.__tabBar.tabWhatsThis( index )
def setTabWhatsThis( self, index, text ):
""" Set the WhatsThis text for the tab """
self.__tabBar.setTabWhatsThis( index, text )
return
def widget( self, index ):
""" Provides the reference to the widget (QWidget) """
return self.__stackedWidget.widget( index )