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


Python QtWidgets.QDockWidget方法代码示例

本文整理汇总了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") 
开发者ID:RobinDavid,项目名称:idasec,代码行数:25,代码来源:idasec.py

示例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) 
开发者ID:BasioMeusPuga,项目名称:Lector,代码行数:21,代码来源:dockwidgets.py

示例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) 
开发者ID:pyrocko,项目名称:kite,代码行数:20,代码来源:sources_dock.py

示例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 
开发者ID:CadQuery,项目名称:CQ-editor,代码行数:27,代码来源:utils.py

示例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) 
开发者ID:amimo,项目名称:dcc,代码行数:8,代码来源:mainwindow.py

示例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) 
开发者ID:pyrocko,项目名称:kite,代码行数:38,代码来源:spool.py

示例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 
开发者ID:quantOS-org,项目名称:TradeSim,代码行数:11,代码来源:uiMainWindow.py

示例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
    ################################# 
开发者ID:danielepantaleone,项目名称:eddy,代码行数:38,代码来源:dock.py

示例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) 
开发者ID:xtiankisutsa,项目名称:MARA_Framework,代码行数:8,代码来源:mainwindow.py

示例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() 
开发者ID:iGio90,项目名称:Dwarf,代码行数:35,代码来源:panel_debug.py

示例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) 
开发者ID:BasioMeusPuga,项目名称:Lector,代码行数:52,代码来源:dockwidgets.py

示例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) 
开发者ID:league1991,项目名称:CodeAtlasSublime,代码行数:60,代码来源:mainwindow.py


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