mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-27 00:11:33 +08:00
55ef6ef863
- Reduce requirements for the python build. - Fix version number. - Generate type hints for *.pyi files. - Make functional for sip-build - Reduced the unnecessary depth of the package. NOTE: This is a breaking change for python users, where, `from PyQtAds import QtAds` is changed to `import PyQtAds as QtAds`( or simply `import PyQtAds`)
39 lines
1.6 KiB
Python
39 lines
1.6 KiB
Python
import os
|
|
import sys
|
|
|
|
from PyQt5 import uic
|
|
import PyQtAds as QtAds
|
|
|
|
UI_FILE = os.path.join(os.path.dirname(__file__), 'StatusDialog.ui')
|
|
StatusDialogUI, StatusDialogBase = uic.loadUiType(UI_FILE)
|
|
|
|
class CStatusDialog(StatusDialogUI, StatusDialogBase):
|
|
|
|
def __init__(self, dock_manager: QtAds.CDockManager, parent=None):
|
|
super().__init__(parent)
|
|
|
|
self.setupUi(self)
|
|
|
|
self.dock_manager = dock_manager
|
|
self.dock_widgets = self.dock_manager.dockWidgetsMap()
|
|
|
|
for key, widget in self.dock_widgets.items():
|
|
self.dockWidgetsComboBox.addItem(key, widget)
|
|
|
|
def on_dockWidgetsComboBox_currentIndexChanged(self, index: int):
|
|
if not isinstance(index, int):
|
|
return
|
|
if index < 0:
|
|
return
|
|
|
|
dock_widget = self.dockWidgetsComboBox.currentData()
|
|
self.isClosedCheckBox.setChecked(dock_widget.isClosed())
|
|
self.isFloatingCheckBox.setChecked(dock_widget.isFloating())
|
|
self.tabbedCheckBox.setChecked(dock_widget.isTabbed())
|
|
self.isCurrentTabCheckBox.setChecked(dock_widget.isCurrentTab())
|
|
self.closableCheckBox.setChecked(dock_widget.features() & QtAds.CDockWidget.DockWidgetClosable)
|
|
self.movableCheckBox.setChecked(dock_widget.features() & QtAds.CDockWidget.DockWidgetMovable)
|
|
self.floatableCheckBox.setChecked(dock_widget.features() & QtAds.CDockWidget.DockWidgetFloatable)
|
|
self.deleteOnCloseCheckBox.setChecked(dock_widget.features() & QtAds.CDockWidget.DockWidgetDeleteOnClose)
|
|
self.customCloseHandlingCheckBox.setChecked(dock_widget.features() & QtAds.CDockWidget.CustomCloseHandling)
|