本文整理汇总了Python中PyQt5.QtWidgets.QStackedLayout.setStackingMode方法的典型用法代码示例。如果您正苦于以下问题:Python QStackedLayout.setStackingMode方法的具体用法?Python QStackedLayout.setStackingMode怎么用?Python QStackedLayout.setStackingMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QStackedLayout
的用法示例。
在下文中一共展示了QStackedLayout.setStackingMode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _MainContainer
# 需要导入模块: from PyQt5.QtWidgets import QStackedLayout [as 别名]
# 或者: from PyQt5.QtWidgets.QStackedLayout import setStackingMode [as 别名]
class _MainContainer(QWidget):
###############################################################################
# MainContainer SIGNALS
###############################################################################
"""
newFileOpened(QString)
allTabClosed()
runFile(QString)
addToProject(QString)
showFileInExplorer(QString)
recentTabsModified()
currentEditorChanged(QString)
fileOpened(QString)
---------migrationAnalyzed()
findOcurrences(QString)
---------updateFileMetadata()
editorKeyPressEvent(QEvent)
locateFunction(QString, QString, bool) [functionName, filePath, isVariable]
updateLocator(QString)
beforeFileSaved(QString)
fileSaved(QString)
openPreferences()
--------openProject(QString)
---------dontOpenStartPage()
"""
newFileOpened = pyqtSignal(str)
allTabClosed = pyqtSignal()
runFile = pyqtSignal(str)
addToProject = pyqtSignal(str)
showFileInExplorer = pyqtSignal(str)
recentTabsModified = pyqtSignal()
currentEditorChanged = pyqtSignal(str)
fileOpened = pyqtSignal(str)
migrationAnalyzed = pyqtSignal()#-----------
findOcurrences = pyqtSignal(str)
updateFileMetadata = pyqtSignal()#-----------
editorKeyPressEvent = pyqtSignal('QEvent*')
locateFunction = pyqtSignal(str, str, bool)
updateLocator = pyqtSignal(str)
beforeFileSaved = pyqtSignal(str)
fileSaved = pyqtSignal(str)
openPreferences = pyqtSignal()
openProject = pyqtSignal(str)#-----------
dontOpenStartPage = pyqtSignal()#-----------
closeDialog = pyqtSignal('QObject*')
allTabsClosed = pyqtSignal()
splitEditor = pyqtSignal('QWidget*', 'QWidget*', bool)
closeSplit = pyqtSignal(QWidget)
toRemovePreview = pyqtSignal()
###############################################################################
def __init__(self, parent=None):
super(_MainContainer, self).__init__(parent)
self._parent = parent
self._vbox = QVBoxLayout(self)
self._vbox.setContentsMargins(0, 0, 0, 0)
self._vbox.setSpacing(0)
self.stack = QStackedLayout()
self.stack.setStackingMode(QStackedLayout.StackAll)
self._vbox.addLayout(self.stack)
self.splitter = dynamic_splitter.DynamicSplitter()
self.setAcceptDrops(True)
# self._files_handler = files_handler.FilesHandler(self)
self._add_file_folder = add_file_folder.AddFileFolderWidget(self)
self.tdir = None
#documentation browser
self.docPage = None
#Code Navigation
self._locator = locator.GoToDefinition()
self.__codeBack = []
self.__codeForward = []
self.__bookmarksFile = ''
self.__bookmarksPos = -1
self.__breakpointsFile = ''
self.__breakpointsPos = -1
self.__operations = {
0: self._navigate_code_jumps,
1: self._navigate_bookmarks,
2: self._navigate_breakpoints}
self.locateFunction.connect(self.locate_function)
IDE.register_service('main_container', self)
#Register signals connections
connections = (
{'target': 'menu_file',
'signal_name': 'openFile',#(QString)
'slot': self.open_file},
{'target': 'explorer_container',
'signal_name': 'goToDefinition',#(int)
'slot': self.editor_go_to_line},
{'target': 'explorer_container',
'signal_name': 'pep8Activated',#(bool)
'slot': self.reset_pep8_warnings},
#.........这里部分代码省略.........
示例2: _MainContainer
# 需要导入模块: from PyQt5.QtWidgets import QStackedLayout [as 别名]
# 或者: from PyQt5.QtWidgets.QStackedLayout import setStackingMode [as 别名]
class _MainContainer(QWidget):
currentEditorChanged = pyqtSignal(str)
fileOpened = pyqtSignal(str)
beforeFileSaved = pyqtSignal(str)
fileSaved = pyqtSignal(str)
runFile = pyqtSignal(str)
showFileInExplorer = pyqtSignal(str)
addToProject = pyqtSignal(str)
allFilesClosed = pyqtSignal()
def __init__(self, parent=None):
super().__init__(parent)
self.setAcceptDrops(True)
self._vbox = QVBoxLayout(self)
self._vbox.setContentsMargins(0, 0, 0, 0)
self._vbox.setSpacing(0)
self.stack = QStackedLayout()
self.stack.setStackingMode(QStackedLayout.StackAll)
self._vbox.addLayout(self.stack)
self.splitter = dynamic_splitter.DynamicSplitter()
self._files_handler = files_handler.FilesHandler(self)
# Code Navigation
self.__code_back = []
self.__code_forward = []
self.__operations = {
0: self._navigate_code_jumps,
1: self._navigate_bookmarks
}
# Recent files list
self.__last_opened_files = []
# QML UI
self._add_file_folder = add_file_folder.AddFileFolderWidget(self)
if settings.SHOW_START_PAGE:
self.show_start_page()
IDE.register_service("main_container", self)
# Register signals connections
connections = (
# {
# "target": "main_container",
# "signal_name": "updateLocator",
# "slot": self._explore_code
# },
{
"target": "filesystem",
"signal_name": "projectOpened",
"slot": self._explore_code
},
# {
# "target": "projects_explore",
# "signal_name": "updateLocator",
# "slot": self._explore_code
# }
{
"target": "filesystem",
"signal_name": "projectClosed",
"slot": self._explore_code
}
)
IDE.register_signals("main_container", connections)
fhandler_short = QShortcut(QKeySequence(Qt.CTRL + Qt.Key_Tab), self)
fhandler_short.activated.connect(self.show_files_handler)
# Added for set language
# self._setter_language = set_language.SetLanguageFile()
def install(self):
ninjaide = IDE.get_service("ide")
ninjaide.place_me_on("main_container", self, "central", top=True)
self.combo_area = combo_editor.ComboEditor(original=True)
self.combo_area.allFilesClosed.connect(self._files_closed)
self.combo_area.allFilesClosed.connect(
lambda: self.allFilesClosed.emit())
self.combo_area.fileClosed.connect(self._add_to_last_opened)
self.splitter.add_widget(self.combo_area)
self.add_widget(self.splitter)
# self.current_widget = self.combo_area
# Code Locator
self._code_locator = locator_widget.LocatorWidget(ninjaide)
data_settings = IDE.data_settings()
recent_files = data_settings.value("lastSession/recentFiles")
if recent_files is not None:
self.__last_opened_files = recent_files
ui_tools.install_shortcuts(self, actions.ACTIONS, ninjaide)
# self.fileSaved.connect(self._show_message_about_saved)
def run_file(self, filepath):
self.runFile.emit(filepath)
def _show_file_in_explorer(self, filepath):
self.showFileInExplorer.emit(filepath)
def _add_to_project(self, filepath):
self.addToProject.emit(filepath)
#.........这里部分代码省略.........
示例3: __init__
# 需要导入模块: from PyQt5.QtWidgets import QStackedLayout [as 别名]
# 或者: from PyQt5.QtWidgets.QStackedLayout import setStackingMode [as 别名]
def __init__(self, parent=None):
super().__init__()
self.cards = {} # type: Dict[GuiCards, QWidget]
"""
Python's GC will clean up QPropertyAnimations as soon as it leaves the button handler,
therefore they will appear not to work. Use members to store the animations.
see http://stackoverflow.com/a/6953965
"""
self.slide_in_animation = None
self.slide_out_animation = None
self.animation_group = None
self.setObjectName("coffeeFundWindow")
"""
Store the position and size of visible/hidden cards for the animation sequences
"""
self.hidden_geometry = None
self.visible_geometry = None
layout = QStackedLayout()
layout.setStackingMode(QStackedLayout.StackAll)
card_remove = RemoveCard()
self.cards[GuiCards.RemoveCard] = card_remove
layout.addWidget(card_remove)
card_choose_action = ChooseActionCard()
self.cards[GuiCards.ChooseAction] = card_choose_action
layout.addWidget(card_choose_action)
card_account = AccountCard()
self.cards[GuiCards.AccountInfo] = card_account
layout.addWidget(card_account)
# keep this as last initialized card, the last card will be shown on startup!
card_start = StartCard()
self.cards[GuiCards.Start] = card_start
layout.addWidget(card_start)
self.setLayout(layout)
self.setWindowTitle("Kaffeekasse")
layout.setCurrentWidget(card_start)
self.active_card = None
card_choose_action.button_account.clicked.connect(self.signal_account)
card_choose_action.button_coffee.clicked.connect(self.signal_coffee)
card_account.button_back.clicked.connect(self.signal_back)