當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。