Python PyQt5.QtWidgets.QDockWidget() Examples

The following are 12 code examples for showing how to use PyQt5.QtWidgets.QDockWidget(). These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.

You may check out the related API usage on the sidebar.

You may also want to check out all available functions/classes of the module PyQt5.QtWidgets , or try the search function .

Example 1
Project: idasec   Author: RobinDavid   File: idasec.py    License: GNU Lesser General Public License v2.1 6 votes vote down vote up
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") 
Example 2
Project: Lector   Author: BasioMeusPuga   File: dockwidgets.py    License: GNU General Public License v3.0 6 votes vote down vote up
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) 
Example 3
Project: kite   Author: pyrocko   File: sources_dock.py    License: GNU General Public License v3.0 6 votes vote down vote up
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) 
Example 4
Project: CQ-editor   Author: CadQuery   File: utils.py    License: Apache License 2.0 6 votes vote down vote up
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 
Example 5
Project: dcc   Author: amimo   File: mainwindow.py    License: Apache License 2.0 5 votes vote down vote up
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) 
Example 6
Project: kite   Author: pyrocko   File: spool.py    License: GNU General Public License v3.0 5 votes vote down vote up
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) 
Example 7
Project: TradeSim   Author: quantOS-org   File: uiMainWindow.py    License: Apache License 2.0 5 votes vote down vote up
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 
Example 8
Project: eddy   Author: danielepantaleone   File: dock.py    License: GNU General Public License v3.0 5 votes vote down vote up
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
    ################################# 
Example 9
Project: MARA_Framework   Author: xtiankisutsa   File: mainwindow.py    License: GNU Lesser General Public License v3.0 5 votes vote down vote up
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) 
Example 10
Project: Dwarf   Author: iGio90   File: panel_debug.py    License: GNU General Public License v3.0 5 votes vote down vote up
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() 
Example 11
Project: Lector   Author: BasioMeusPuga   File: dockwidgets.py    License: GNU General Public License v3.0 4 votes vote down vote up
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) 
Example 12
Project: CodeAtlasSublime   Author: league1991   File: mainwindow.py    License: Eclipse Public License 1.0 4 votes vote down vote up
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)