當前位置: 首頁>>代碼示例>>Python>>正文


Python QtWidgets.QDockWidget方法代碼示例

本文整理匯總了Python中PySide2.QtWidgets.QDockWidget方法的典型用法代碼示例。如果您正苦於以下問題:Python QtWidgets.QDockWidget方法的具體用法?Python QtWidgets.QDockWidget怎麽用?Python QtWidgets.QDockWidget使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PySide2.QtWidgets的用法示例。


在下文中一共展示了QtWidgets.QDockWidget方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: createDocks

# 需要導入模塊: from PySide2 import QtWidgets [as 別名]
# 或者: from PySide2.QtWidgets import QDockWidget [as 別名]
def createDocks(self):
        self.parent.messagedock = QtWidgets.QDockWidget(self.parent)
        self.parent.messagedock. \
            setFeatures(QtWidgets.QDockWidget.DockWidgetMovable |
                        QtWidgets.QDockWidget.DockWidgetFloatable)
        self.parent.messagedock.setWindowTitle('Messages')
        self.parent.messagedock.setMinimumSize(100, 50)
        # connect messagedock to slot
        self.parent.messagedock.topLevelChanged.connect(
            self.parent.slots.onLevelChanged)

        self.parent.messages = QtWidgets.QTextEdit(self.parent)
        self.parent.messages. \
            setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse |
                                    QtCore.Qt.TextSelectableByKeyboard)
        # connect messages to scrollhandler
        self.parent.messages.textChanged.connect(
            self.parent.slots.onTextChanged)

        self.parent.messagedock.setWidget(self.parent.messages)

        place = QtCore.Qt.BottomDockWidgetArea
        self.parent.addDockWidget(
            QtCore.Qt.DockWidgetArea(place), self.parent.messagedock) 
開發者ID:chiefenne,項目名稱:PyAero,代碼行數:26,代碼來源:MenusTools.py

示例2: _init_widgets

# 需要導入模塊: from PySide2 import QtWidgets [as 別名]
# 或者: from PySide2.QtWidgets import QDockWidget [as 別名]
def _init_widgets(self):

        window = QMainWindow()
        window.setWindowFlags(Qt.Widget)

        # pseudo code text box
        self._textedit = QCCodeEdit(self)
        self._textedit.setTextInteractionFlags(Qt.TextSelectableByKeyboard | Qt.TextSelectableByMouse)
        self._textedit.setLineWrapMode(QCCodeEdit.NoWrap)
        textedit_dock = QDockWidget('Code', self._textedit)
        window.setCentralWidget(textedit_dock)
        textedit_dock.setWidget(self._textedit)

        # decompilation
        self._options = QDecompilationOptions(self, self.workspace.instance, options=None)
        options_dock = QDockWidget('Decompilation Options', self._options)
        window.addDockWidget(Qt.RightDockWidgetArea, options_dock)
        options_dock.setWidget(self._options)

        layout = QHBoxLayout()
        layout.addWidget(window)
        layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(layout) 
開發者ID:angr,項目名稱:angr-management,代碼行數:25,代碼來源:code_view.py

示例3: test_load_ui_dockwidget

# 需要導入模塊: from PySide2 import QtWidgets [as 別名]
# 或者: from PySide2.QtWidgets import QDockWidget [as 別名]
def test_load_ui_dockwidget():
    """Tests to see if the baseinstance loading loads a QDockWidget properly"""
    import sys
    from Qt import QtWidgets, QtCompat

    app = QtWidgets.QApplication(sys.argv)
    win = QtWidgets.QDockWidget()

    QtCompat.loadUi(self.ui_qdockwidget, win)

    assert hasattr(win, 'lineEdit'), \
        "loadUi could not load instance to main window"

    app.exit() 
開發者ID:mottosso,項目名稱:Qt.py,代碼行數:16,代碼來源:tests.py

示例4: test_load_ui_existingLayoutOnDockWidget

# 需要導入模塊: from PySide2 import QtWidgets [as 別名]
# 或者: from PySide2.QtWidgets import QDockWidget [as 別名]
def test_load_ui_existingLayoutOnDockWidget():
    """Tests to see if loading a ui onto a layout in a DockWidget works"""
    import sys
    from Qt import QtWidgets, QtCompat

    msgs = 'QLayout: Attempting to add QLayout "" to QDockWidget ' \
        '"", which already has a layout'

    with ignoreQtMessageHandler([msgs]):
        app = QtWidgets.QApplication(sys.argv)
        win = QtWidgets.QDockWidget()
        QtWidgets.QComboBox(win)
        QtWidgets.QHBoxLayout(win)
        QtCompat.loadUi(self.ui_qdockwidget, win)
    app.exit() 
開發者ID:mottosso,項目名稱:Qt.py,代碼行數:17,代碼來源:tests.py

示例5: _init_widgets

# 需要導入模塊: from PySide2 import QtWidgets [as 別名]
# 或者: from PySide2.QtWidgets import QDockWidget [as 別名]
def _init_widgets(self):

        main = QMainWindow()
        main.setWindowFlags(Qt.Widget)

        # main.setCorner(Qt.TopLeftCorner, Qt.TopDockWidgetArea)
        # main.setCorner(Qt.TopRightCorner, Qt.RightDockWidgetArea)

        pathtree = QPathTree(self.current_simgr, self.current_state, self, self.workspace, parent=main)
        pathtree_dock = QDockWidget('PathTree', pathtree)
        main.setCentralWidget(pathtree_dock)
        # main.addDockWidget(Qt.BottomDockWidgetArea, pathtree_dock)
        pathtree_dock.setWidget(pathtree)

        simgrs = QSimulationManagers(self.workspace.instance, self.current_simgr, self.current_state, parent=main)
        simgrs_dock = QDockWidget('SimulationManagers', simgrs)
        main.addDockWidget(Qt.RightDockWidgetArea, simgrs_dock)
        simgrs_dock.setWidget(simgrs)

        state_viewer = StateInspector(self.workspace, self.current_state, parent=self)
        state_viewer_dock = QDockWidget('Selected State', state_viewer)
        main.addDockWidget(Qt.RightDockWidgetArea, state_viewer_dock)
        state_viewer_dock.setWidget(state_viewer)

        self._pathtree = pathtree
        self._simgrs = simgrs
        self._state_viewer = state_viewer

        main_layout = QHBoxLayout()
        main_layout.addWidget(main)
        main_layout.setContentsMargins(0, 0, 0, 0)

        self.setLayout(main_layout)

    #
    # Private methods
    # 
開發者ID:angr,項目名稱:angr-management,代碼行數:39,代碼來源:symexec_view.py


注:本文中的PySide2.QtWidgets.QDockWidget方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。