当前位置: 首页>>代码示例>>Python>>正文


Python QSplitter.__init__方法代码示例

本文整理汇总了Python中PyQt5.Qt.QSplitter.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QSplitter.__init__方法的具体用法?Python QSplitter.__init__怎么用?Python QSplitter.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt5.Qt.QSplitter的用法示例。


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

示例1: __init__

# 需要导入模块: from PyQt5.Qt import QSplitter [as 别名]
# 或者: from PyQt5.Qt.QSplitter import __init__ [as 别名]
    def __init__(self, parent=None):
        QSplitter.__init__(self, parent)
        self.setChildrenCollapsible(False)

        self.items = i = QListWidget(self)
        i.setContextMenuPolicy(Qt.CustomContextMenu)
        i.customContextMenuRequested.connect(self.context_menu)
        self.items.setSpacing(3)
        self.items.itemDoubleClicked.connect(self.current_item_activated)
        self.items.currentItemChanged.connect(self.current_item_changed)
        self.items.setSelectionMode(self.items.NoSelection)
        self.delegate = Delegate(self.items)
        self.items.setItemDelegate(self.delegate)
        self.addWidget(i)
        self.help = h = QTextBrowser(self)
        h.anchorClicked.connect(self.link_clicked)
        h.setOpenLinks(False)
        self.addWidget(h)
        self.setStretchFactor(0, 100)
        self.setStretchFactor(1, 50)
        self.clear_at_startup()

        state = tprefs.get('check-book-splitter-state', None)
        if state is not None:
            self.restoreState(state)
开发者ID:MarioJC,项目名称:calibre,代码行数:27,代码来源:check.py

示例2: __init__

# 需要导入模块: from PyQt5.Qt import QSplitter [as 别名]
# 或者: from PyQt5.Qt.QSplitter import __init__ [as 别名]
 def __init__(self, books_view, parent=None):
     QSplitter.__init__(self, parent)
     self.setChildrenCollapsible(False)
     self.books_view = books_view
     self.addWidget(books_view)
     self.addWidget(books_view.pin_view)
     books_view.pin_view.splitter = self
开发者ID:carlosalvesuy,项目名称:calibre,代码行数:9,代码来源:pin_columns.py

示例3: __init__

# 需要导入模块: from PyQt5.Qt import QSplitter [as 别名]
# 或者: from PyQt5.Qt.QSplitter import __init__ [as 别名]
    def __init__(self, name, label, icon, initial_show=True,
            initial_side_size=120, connect_button=True,
            orientation=Qt.Horizontal, side_index=0, parent=None, shortcut=None):
        QSplitter.__init__(self, parent)
        self.resize_timer = QTimer(self)
        self.resize_timer.setSingleShot(True)
        self.desired_side_size = initial_side_size
        self.desired_show = initial_show
        self.resize_timer.setInterval(5)
        self.resize_timer.timeout.connect(self.do_resize)
        self.setOrientation(orientation)
        self.side_index = side_index
        self._name = name
        self.label = label
        self.initial_side_size = initial_side_size
        self.initial_show = initial_show
        self.splitterMoved.connect(self.splitter_moved, type=Qt.QueuedConnection)
        self.button = LayoutButton(icon, label, self, shortcut=shortcut)
        if connect_button:
            self.button.clicked.connect(self.double_clicked)

        if shortcut is not None:
            self.action_toggle = QAction(QIcon(icon), _('Toggle') + ' ' + label,
                    self)
            self.action_toggle.triggered.connect(self.toggle_triggered)
            if parent is not None:
                parent.addAction(self.action_toggle)
                if hasattr(parent, 'keyboard'):
                    parent.keyboard.register_shortcut('splitter %s %s'%(name,
                        label), unicode(self.action_toggle.text()),
                        default_keys=(shortcut,), action=self.action_toggle)
                else:
                    self.action_toggle.setShortcut(shortcut)
            else:
                self.action_toggle.setShortcut(shortcut)
开发者ID:drxaero,项目名称:calibre,代码行数:37,代码来源:widgets.py

示例4: __init__

# 需要导入模块: from PyQt5.Qt import QSplitter [as 别名]
# 或者: from PyQt5.Qt.QSplitter import __init__ [as 别名]
    def __init__(self, parent=None, show_open_in_editor=False):
        QSplitter.__init__(self, parent)
        self._failed_img = None

        self.left, self.right = TextBrowser(parent=self), TextBrowser(right=True, parent=self, show_open_in_editor=show_open_in_editor)
        self.addWidget(self.left), self.addWidget(self.right)
        self.split_words = re.compile(r"\w+|\W", re.UNICODE)
        self.clear()
开发者ID:AtulKumar2,项目名称:calibre,代码行数:10,代码来源:view.py

示例5: __init__

# 需要导入模块: from PyQt5.Qt import QSplitter [as 别名]
# 或者: from PyQt5.Qt.QSplitter import __init__ [as 别名]
 def __init__(self, parent=None, orientation=Qt.Vertical, qv_widget=None):
     QSplitter.__init__(self, parent=parent, orientation=orientation)
     self.splitterMoved.connect(self.splitter_moved)
     self.setChildrenCollapsible(False)
     self.qv_widget = qv_widget
开发者ID:AEliu,项目名称:calibre,代码行数:7,代码来源:init.py


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