本文整理汇总了Python中PyQt5.Qt.QStackedWidget.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QStackedWidget.__init__方法的具体用法?Python QStackedWidget.__init__怎么用?Python QStackedWidget.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.Qt.QStackedWidget
的用法示例。
在下文中一共展示了QStackedWidget.__init__方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5.Qt import QStackedWidget [as 别名]
# 或者: from PyQt5.Qt.QStackedWidget import __init__ [as 别名]
def __init__(self, parent=None):
QStackedWidget.__init__(self, parent)
self.welcome = w = QLabel('<p>'+_(
'Double click a file in the left panel to start editing'
' it.'))
self.addWidget(w)
w.setWordWrap(True)
w.setAlignment(Qt.AlignTop | Qt.AlignHCenter)
self.container = c = QWidget(self)
self.addWidget(c)
l = c.l = QVBoxLayout(c)
c.setLayout(l)
l.setContentsMargins(0, 0, 0, 0)
self.editor_tabs = t = QTabWidget(c)
l.addWidget(t)
t.setDocumentMode(True)
t.setTabsClosable(True)
t.setMovable(True)
pal = self.palette()
if pal.color(pal.WindowText).lightness() > 128:
i = QImage(I('modified.png'))
i.invertPixels()
self.modified_icon = QIcon(QPixmap.fromImage(i))
else:
self.modified_icon = QIcon(I('modified.png'))
self.editor_tabs.currentChanged.connect(self.current_editor_changed)
self.editor_tabs.tabCloseRequested.connect(self._close_requested)
self.search_panel = SearchPanel(self)
l.addWidget(self.search_panel)
self.restore_state()
self.editor_tabs.tabBar().installEventFilter(self)
示例2: __init__
# 需要导入模块: from PyQt5.Qt import QStackedWidget [as 别名]
# 或者: from PyQt5.Qt.QStackedWidget import __init__ [as 别名]
def __init__(self, msg, after=None, parent=None, size=256, interval=10):
QStackedWidget.__init__(self, parent)
self.wp = WaitPanel(msg, self, size, interval)
if after is None:
after = QWidget(self)
self.after = after
self.addWidget(self.wp)
self.addWidget(after)
示例3: __init__
# 需要导入模块: from PyQt5.Qt import QStackedWidget [as 别名]
# 或者: from PyQt5.Qt.QStackedWidget import __init__ [as 别名]
def __init__(self, parent):
QStackedWidget.__init__(self, parent)
self.permanent_message = ''
self.temporary_message = TemporaryMessage(1, '', 'info', monotonic())
self.msg = Message(self, parent.sb_background)
self.addWidget(self.msg)
self.setFocusPolicy(Qt.NoFocus)
self.msg.setFocusPolicy(Qt.NoFocus)
self.search = SearchPanel(self)
self.search.edit.abort_search.connect(self.hide_search)
self.search.edit.editingFinished.connect(self.hide_search)
self.addWidget(self.search)
self.update_timer = t = QTimer(self)
self.fg_color = color('status bar foreground', None)
if self.fg_color:
self.fg_color = QColor(self.fg_color)
t.setSingleShot(True), t.setInterval(100), t.timeout.connect(self.update_message)
示例4: __init__
# 需要导入模块: from PyQt5.Qt import QStackedWidget [as 别名]
# 或者: from PyQt5.Qt.QStackedWidget import __init__ [as 别名]
def __init__(self, parent):
QStackedWidget.__init__(self, parent)
parent.cb_splitter = LibraryWidget(parent)
self.tb_widget = TagBrowserWidget(parent)
parent.tb_splitter = Splitter('tag_browser_splitter',
_('Tag Browser'), I('tags.png'),
parent=parent, side_index=0, initial_side_size=200,
shortcut='Shift+Alt+T')
parent.tb_splitter.state_changed.connect(
self.tb_widget.set_pane_is_visible, Qt.QueuedConnection)
parent.tb_splitter.addWidget(self.tb_widget)
parent.tb_splitter.addWidget(parent.cb_splitter)
parent.tb_splitter.setCollapsible(parent.tb_splitter.other_index, False)
self.addWidget(parent.tb_splitter)
for x in ('memory', 'card_a', 'card_b'):
name = x+'_view'
w = DeviceBooksView(parent)
setattr(parent, name, w)
self.addWidget(w)
w.setObjectName(name)