• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python QtGui.QTabBar类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中spyderlib.qt.QtGui.QTabBar的典型用法代码示例。如果您正苦于以下问题:Python QTabBar类的具体用法?Python QTabBar怎么用?Python QTabBar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了QTabBar类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: mouseMoveEvent

 def mouseMoveEvent(self, event):
     """Override Qt method"""
     if event.buttons() == Qt.MouseButtons(Qt.LeftButton) and \
        (event.pos() - self.__drag_start_pos).manhattanLength() > \
             QApplication.startDragDistance():
         drag = QDrag(self)
         mimeData = QMimeData()
         # Converting id's to long to avoid an OverflowError with PySide
         if PY2:
             ancestor_id = long(id(self.ancestor))
             parent_widget_id = long(id(self.parentWidget()))
             self_id = long(id(self))
         else:
             ancestor_id = id(self.ancestor)
             parent_widget_id = id(self.parentWidget())
             self_id = id(self)
         mimeData.setData("parent-id", QByteArray.number(ancestor_id))
         mimeData.setData("tabwidget-id",
                          QByteArray.number(parent_widget_id))
         mimeData.setData("tabbar-id", QByteArray.number(self_id))
         mimeData.setData("source-index", 
                      QByteArray.number(self.tabAt(self.__drag_start_pos)))
         drag.setMimeData(mimeData)
         drag.exec_()
     QTabBar.mouseMoveEvent(self, event)
开发者ID:MarvinLiu0810,项目名称:spyder,代码行数:25,代码来源:tabs.py


示例2: __init__

 def __init__(self, parent, ancestor):
     QTabBar.__init__(self, parent)
     self.ancestor = ancestor
         
     # Dragging tabs
     self.__drag_start_pos = QPoint()
     self.setAcceptDrops(True)
开发者ID:Micseb,项目名称:spyder,代码行数:7,代码来源:tabs.py


示例3: dragEnterEvent

 def dragEnterEvent(self, event):
     """Override Qt method"""
     mimeData = event.mimeData()
     formats = list(mimeData.formats())
     if "parent-id" in formats and mimeData.data("parent-id").toLong()[0] == id(self.ancestor):
         event.acceptProposedAction()
     QTabBar.dragEnterEvent(self, event)
开发者ID:gyenney,项目名称:Tools,代码行数:7,代码来源:tabs.py


示例4: __init__

    def __init__(self, parent, ancestor):
        QTabBar.__init__(self, parent)
        self.ancestor = ancestor

        # To style tabs on Mac
        if sys.platform == 'darwin':
            self.setObjectName('plugin-tab')
            
        # Dragging tabs
        self.__drag_start_pos = QPoint()
        self.setAcceptDrops(True)
开发者ID:MarvinLiu0810,项目名称:spyder,代码行数:11,代码来源:tabs.py


示例5: dropEvent

 def dropEvent(self, event):
     """Override Qt method"""
     mimeData = event.mimeData()
     index_from = mimeData.data("source-index").toInt()[0]
     index_to = self.tabAt(event.pos())
     if index_to == -1:
         index_to = self.count()
     if mimeData.data("tabbar-id").toLong()[0] != id(self):
         tabwidget_from = mimeData.data("tabwidget-id").toLong()[0]
         self.emit(SIGNAL("move_tab(long,int,int)"), 
                   tabwidget_from, index_from, index_to)
         event.acceptProposedAction()
     elif index_from != index_to:
         self.emit(SIGNAL("move_tab(int,int)"), index_from, index_to)
         event.acceptProposedAction()
     QTabBar.dropEvent(self, event)
开发者ID:jromang,项目名称:retina-old,代码行数:16,代码来源:tabs.py


示例6: mouseMoveEvent

 def mouseMoveEvent(self, event):
     """Override Qt method"""
     if event.buttons() == Qt.MouseButtons(Qt.LeftButton) and \
        (event.pos() - self.__drag_start_pos).manhattanLength() > \
             QApplication.startDragDistance():
         drag = QDrag(self)
         mimeData = QMimeData()
         mimeData.setData("parent-id", QByteArray.number(id(self.ancestor)))
         mimeData.setData("tabwidget-id",
                          QByteArray.number(id(self.parentWidget())))
         mimeData.setData("tabbar-id", QByteArray.number(id(self)))
         mimeData.setData("source-index", 
                      QByteArray.number(self.tabAt(self.__drag_start_pos)))
         drag.setMimeData(mimeData)
         drag.exec_()
     QTabBar.mouseMoveEvent(self, event)
开发者ID:jromang,项目名称:retina-old,代码行数:16,代码来源:tabs.py


示例7: dropEvent

    def dropEvent(self, event):
        """Override Qt method"""
        mimeData = event.mimeData()
        index_from = mimeData.data("source-index").toInt()[0]
        index_to = self.tabAt(event.pos())
        if index_to == -1:
            index_to = self.count()
        if mimeData.data("tabbar-id").toLong()[0] != id(self):
            tabwidget_from = str(mimeData.data("tabwidget-id").toLong()[0])

            # We pass self object ID as a QString, because otherwise it would
            # depend on the platform: long for 64bit, int for 32bit. Replacing
            # by long all the time is not working on some 32bit platforms
            # (see Issue 1094, Issue 1098)
            self.sig_move_tab[(str, int, int)].emit(tabwidget_from, index_from, index_to)

            event.acceptProposedAction()
        elif index_from != index_to:
            self.sig_move_tab.emit(index_from, index_to)
            event.acceptProposedAction()
        QTabBar.dropEvent(self, event)
开发者ID:gyenney,项目名称:Tools,代码行数:21,代码来源:tabs.py


示例8: mousePressEvent

 def mousePressEvent(self, event):
     """Reimplement Qt method"""
     if event.button() == Qt.LeftButton:
         self.__drag_start_pos = QPoint(event.pos())
     QTabBar.mousePressEvent(self, event)
开发者ID:MarvinLiu0810,项目名称:spyder,代码行数:5,代码来源:tabs.py



注:本文中的spyderlib.qt.QtGui.QTabBar类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python QtGui.QTabWidget类代码示例发布时间:2022-05-27
下一篇:
Python QtGui.QStackedWidget类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap