本文整理汇总了Python中PyQt5.QtWidgets.QDockWidget方法的典型用法代码示例。如果您正苦于以下问题:Python QtWidgets.QDockWidget方法的具体用法?Python QtWidgets.QDockWidget怎么用?Python QtWidgets.QDockWidget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets
的用法示例。
在下文中一共展示了QtWidgets.QDockWidget方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setupUi
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDockWidget [as 别名]
def setupUi(self, Master):
Master.setObjectName("Master")
Master.resize(718, 477)
self.verticalLayout = QtWidgets.QVBoxLayout(Master)
self.verticalLayout.setObjectName("verticalLayout")
self.splitter = QtWidgets.QSplitter(Master)
self.splitter.setOrientation(QtCore.Qt.Vertical)
self.splitter.setObjectName("splitter")
self.tab_widget = QtWidgets.QTabWidget(self.splitter)
self.tab_widget.setObjectName("tab_widget")
self.docker = QtWidgets.QDockWidget(self.splitter)
self.docker.setObjectName("docker")
self.docker.setAllowedAreas(QtCore.Qt.BottomDockWidgetArea)
self.log_widget = QtWidgets.QTreeWidget(self.docker)
self.log_widget.setHeaderItem(QtWidgets.QTreeWidgetItem(["date", "origin", "type", "message"]))
self.docker.setWidget(self.log_widget)
self.verticalLayout.addWidget(self.splitter)
self.tab_widget.setCurrentIndex(-1)
QtCore.QMetaObject.connectSlotsByName(Master)
Master.setWindowTitle("IDASec")
示例2: populate
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDockWidget [as 别名]
def populate(self):
self.setFeatures(QtWidgets.QDockWidget.DockWidgetClosable)
self.setTitleBarWidget(QtWidgets.QWidget(self)) # Removes titlebar
self.sideDockTabWidget = QtWidgets.QTabWidget(self)
self.setWidget(self.sideDockTabWidget)
# This order is important
self.bookmarkModel = QtGui.QStandardItemModel(self)
self.bookmarkProxyModel = BookmarkProxyModel(self)
self.bookmarks = Bookmarks(self)
self.bookmarks.generate_bookmark_model()
if not self.parent.are_we_doing_images_only:
self.annotationModel = QtGui.QStandardItemModel(self)
self.annotations = Annotations(self)
self.annotations.generate_annotation_model()
self.searchResultsModel = QtGui.QStandardItemModel(self)
self.search = Search(self)
示例3: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDockWidget [as 别名]
def __init__(self, sandbox, *args, **kwargs):
QtWidgets.QDockWidget.__init__(self, 'Sources', *args, **kwargs)
self.sandbox = sandbox
layout = QtWidgets.QVBoxLayout()
layout.setContentsMargins(3, 3, 3, 3)
sources = SourcesList(sandbox)
sources_add_menu = SourcesAddButton(sandbox)
self.setFeatures(QtWidgets.QDockWidget.DockWidgetFloatable |
QtWidgets.QDockWidget.DockWidgetMovable)
self.widget = QtWidgets.QWidget()
self.widget.setLayout(layout)
self.widget.layout().addWidget(sources)
self.widget.layout().addWidget(sources_add_menu)
self.setWidget(self.widget)
示例4: dock
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDockWidget [as 别名]
def dock(widget,
title,
parent,
allowedAreas = QtCore.Qt.AllDockWidgetAreas,
defaultArea = 'right',
name=None,
icon = None):
dock = QtWidgets.QDockWidget(title,parent,objectName=title)
if name: dock.setObjectName(name)
if icon: dock.toggleViewAction().setIcon(icon)
dock.setAllowedAreas(allowedAreas)
dock.setWidget(widget)
action = dock.toggleViewAction()
action.setText(title)
dock.setFeatures(QtWidgets.QDockWidget.DockWidgetFeatures(\
QtWidgets.QDockWidget.AllDockWidgetFeatures))
parent.addDockWidget(DOCK_POSITIONS[defaultArea],
dock)
return dock
示例5: setupDock
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDockWidget [as 别名]
def setupDock(self):
"""Setup empty Dock at startup. """
self.dock = QtWidgets.QDockWidget("Classes", self)
self.dock.setWidget(self.tree)
self.dock.setFeatures(QtWidgets.QDockWidget.NoDockWidgetFeatures)
self.addDockWidget(QtCore.Qt.LeftDockWidgetArea, self.dock)
示例6: addTimeSlider
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDockWidget [as 别名]
def addTimeSlider(self):
stack = self.model.getScene()
self.time_slider = QRangeSlider(self)
self.time_slider.setMaximumHeight(50)
slider_tmin = math.ceil(stack.tmin)
slider_tmax = math.floor(stack.tmax)
def datetime_formatter(value):
return datetime.fromtimestamp(value).strftime('%Y-%m-%d')
self.time_slider.setMin(slider_tmin)
self.time_slider.setMax(slider_tmax)
self.time_slider.setRange(slider_tmin, slider_tmax)
self.time_slider.setFormatter(datetime_formatter)
@QtCore.pyqtSlot(int)
def changeTimeRange():
tmin, tmax = self.time_slider.getRange()
stack.set_time_range(tmin, tmax)
self.time_slider.startValueChanged.connect(changeTimeRange)
self.time_slider.endValueChanged.connect(changeTimeRange)
self.dock_time_slider = QtGui.QDockWidget(
'Displacement time series - range control', self)
self.dock_time_slider.setWidget(self.time_slider)
self.dock_time_slider.setFeatures(
QtWidgets.QDockWidget.DockWidgetMovable)
self.dock_time_slider.setAllowedAreas(
QtCore.Qt.BottomDockWidgetArea |
QtCore.Qt.TopDockWidgetArea)
self.addDockWidget(
QtCore.Qt.BottomDockWidgetArea, self.dock_time_slider)
示例7: createDock
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDockWidget [as 别名]
def createDock(self, widgetClass, widgetName, widgetArea):
"""创建停靠组件"""
widget = widgetClass(self.mainEngine, self.eventEngine)
dock = QDockWidget(widgetName)
dock.setWidget(widget)
dock.setObjectName(widgetName)
dock.setFeatures(dock.DockWidgetFloatable | dock.DockWidgetMovable)
self.addDockWidget(widgetArea, dock)
return widget, dock
示例8: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDockWidget [as 别名]
def __init__(self, title, icon, parent=None):
"""
Initialize the widget.
:type title: str
:type icon: QIcon
:type parent: QDockWidget
"""
super().__init__(parent)
# CREATE TITLEBAR ICON AND TITLE
self.imageLabel = QtWidgets.QLabel(self)
self.imageLabel.setPixmap(icon.pixmap(18))
self.imageLabel.setAlignment(QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
self.imageLabel.setContentsMargins(0, 0, 0, 0)
self.imageLabel.setFixedSize(18, 18)
self.titleLabel = QtWidgets.QLabel(title, self)
self.titleLabel.setAlignment(QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
self.titleLabel.setContentsMargins(4, 0, 0, 0)
self.titleLabel.setFont(Font('Roboto', 13))
# CREATE STANDARD BUTTONS
close = QtWidgets.QPushButton(self)
close.setIcon(QtGui.QIcon(':/icons/18/ic_close_black'))
close.setFixedSize(18, 18)
connect(close.clicked, parent.close)
self.buttons = [close]
# CONFIGURE LAYOUT
self.mainLayout = QtWidgets.QHBoxLayout(self)
self.mainLayout.setContentsMargins(0, 0, 0, 0)
self.mainLayout.setSpacing(0)
self.setContentsMargins(6, 4, 6, 4)
self.setContextMenuPolicy(QtCore.Qt.PreventContextMenu)
self.setFont(Font('Roboto', 13))
self.updateLayout()
#############################################
# INTERFACE
#################################
示例9: setupDock
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDockWidget [as 别名]
def setupDock(self):
'''Setup empty Dock at startup. '''
self.dock = QtWidgets.QDockWidget("Classes", self)
self.dock.setWidget(self.tree)
self.dock.setFeatures(QtWidgets.QDockWidget.NoDockWidgetFeatures)
self.addDockWidget(QtCore.Qt.LeftDockWidgetArea, self.dock)
示例10: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDockWidget [as 别名]
def __init__(self, app, flags=None):
super(QDebugPanel, self).__init__(flags)
self.setDockOptions(QMainWindow.AnimatedDocks | QMainWindow.AllowNestedDocks | QMainWindow.AllowTabbedDocks)
self.app = app
self.q_settings = app.q_settings
screen_size = QtWidgets.QDesktopWidget().screenGeometry(-1)
m_width = screen_size.width()
self.memory_panel = HexEditor(self.app)
self.memory_panel.debug_panel = self
self.memory_panel.dataChanged.connect(self.on_memory_modified)
self.disassembly_panel = DisassemblyView(self.app)
self.disassembly_panel.debug_panel = self
self.dock_memory_panel = QDockWidget('Memory', self)
self.dock_memory_panel.setWidget(self.memory_panel)
self.dock_memory_panel.setObjectName('memory')
self.dock_disassembly_panel = QDockWidget('Disassembly', self)
self.dock_disassembly_panel.setWidget(self.disassembly_panel)
self.dock_disassembly_panel.setObjectName('disassembly')
self.addDockWidget(Qt.LeftDockWidgetArea, self.dock_memory_panel, Qt.Horizontal)
self.addDockWidget(Qt.LeftDockWidgetArea, self.dock_disassembly_panel, Qt.Horizontal)
if m_width >= 1920:
self.splitDockWidget(self.dock_memory_panel, self.dock_disassembly_panel, Qt.Horizontal)
else:
self.tabifyDockWidget(self.dock_memory_panel, self.dock_disassembly_panel)
self.restoreUiState()
示例11: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDockWidget [as 别名]
def __init__(self, main_window, contentView, parent):
super(PliantNavBarWidget, self).__init__(parent)
self.main_window = main_window
self.contentView = contentView
self.parent = parent
self.setWindowTitle('Navigation')
# Animate appearance
self.animation = QtCore.QPropertyAnimation(self, b'windowOpacity')
self.animation.setDuration(200)
self.animation.setStartValue(0)
self.animation.setEndValue(.8)
background = self.main_window.settings['dialog_background']
self.setStyleSheet(
"QDockWidget {{background-color: {0}}}".format(background.name()))
self.backButton = QtWidgets.QPushButton()
self.backButton.setFlat(True)
icon = QtGui.QIcon()
icon.addPixmap(
QtGui.QPixmap(":/images/previous.png"),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.backButton.setIcon(icon)
self.backButton.setIconSize(QtCore.QSize(24, 24))
self.nextButton = QtWidgets.QPushButton()
self.nextButton.setFlat(True)
icon = QtGui.QIcon()
icon.addPixmap(
QtGui.QPixmap(":/images/next.png"),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.nextButton.setIcon(icon)
self.nextButton.setIconSize(QtCore.QSize(24, 24))
self.backButton.clicked.connect(lambda: self.button_click(-1))
self.nextButton.clicked.connect(lambda: self.button_click(1))
self.tocComboBox = FixedComboBox(self)
self.populate_combo_box()
self.navLayout = QtWidgets.QHBoxLayout()
self.navLayout.addWidget(self.backButton)
self.navLayout.addWidget(self.tocComboBox)
self.navLayout.addWidget(self.nextButton)
self.navWidget = QtWidgets.QWidget()
self.navWidget.setLayout(self.navLayout)
self.setWidget(self.navWidget)
示例12: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QDockWidget [as 别名]
def __init__(self):
QtWidgets.QMainWindow.__init__(self)
Ui_MainWindow.__init__(self)
self.setupUi(self)
self.actionOpen.triggered.connect(self.onOpen)
self.actionAnalyze.triggered.connect(self.onAnalyze)
self.actionTest.triggered.connect(self.onTest)
self.actionFindCallers.triggered.connect(self.onFindCallers)
self.actionFindCallees.triggered.connect(self.onFindCallees)
self.actionFindMembers.triggered.connect(self.onFindMembers)
self.actionFindBases.triggered.connect(self.onFindBases)
self.actionFindUses.triggered.connect(self.onFindUses)
self.actionFindOverrides.triggered.connect(self.onFindOverrides)
self.actionFindSimilarItem.triggered.connect(self.onAddSimilarCodeItem)
self.actionGoToEditor.triggered.connect(self.goToEditor)
self.actionDeleteOldestItem.triggered.connect(self.onClearOldestItem)
self.actionToggleFocus.triggered.connect(self.onToggleFocus)
self.actionFindCallPaths.triggered.connect(self.onFindCallPaths)
self.actionGoUp.triggered.connect(self.goToUp)
self.actionGoDown.triggered.connect(self.goToDown)
self.actionGoLeft.triggered.connect(self.goToLeft)
self.actionGoRight.triggered.connect(self.goToRight)
self.actionUpdatePosition.triggered.connect(self.onUpdatePosition)
self.actionDeleteOldItems.triggered.connect(self.onDeleteOldItems)
self.actionDeleteSelectedItems.triggered.connect(self.onDeleteSelectedItems)
self.actionDeleteAndIgnoreSelectedItems.triggered.connect(self.onDeleteSelectedItemsAndAddToStop)
self.actionDeleteNearbyItems.triggered.connect(self.onDeleteNearbyItems)
self.actionShowSymbolWindow.triggered.connect(self.onActionShowSymbolWindow)
self.actionShowSearchWindow.triggered.connect(self.onActionShowSearchWindow)
self.actionBuildSymbolScene.triggered.connect(self.onBuildSymbolScene)
self.actionPinSymbol.triggered.connect(self.onPinSymbol)
self.actionUnpinSymbol.triggered.connect(self.onUnpinSymbol)
self.actionIgnoreSymbol.triggered.connect(self.onIgnoreSymbol)
self.actionUnignoreSymbol.triggered.connect(self.onUnignoreSymbol)
self.setCentralWidget(codeview.CodeView())
self.symbolView = None
self.searchDock = QtWidgets.QDockWidget()
self.searchDock.setWidget(SearchWindow())
self.searchDock.setWindowTitle('Search')
self.symbolDock = QtWidgets.QDockWidget()
self.symbolDock.setWidget(SymbolWindow())
self.symbolDock.setWindowTitle('Symbol')
self.schemeDock = QtWidgets.QDockWidget()
self.schemeDock.setWidget(SchemeWindow())
self.schemeDock.setWindowTitle('Scheme')
self.addDockWidget(QtCore.Qt.BottomDockWidgetArea, self.symbolDock)
self.addDockWidget(QtCore.Qt.BottomDockWidgetArea, self.searchDock)
self.addDockWidget(QtCore.Qt.BottomDockWidgetArea, self.schemeDock)
self.tabifyDockWidget(self.symbolDock, self.searchDock)
self.tabifyDockWidget(self.searchDock, self.schemeDock)
self.searchDock.setVisible(False)
self.symbolDock.setVisible(False)
self.schemeDock.setVisible(False)