Skip to content

Commit

Permalink
Merge pull request #126 from tangkong/mnt_ads_submodule
Browse files Browse the repository at this point in the history
MNT: rename QtAds submodule to ads
  • Loading branch information
ZLLentz authored Oct 6, 2023
2 parents a7ac25c + 367ae30 commit ca802a0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ requirements:
- ophyd
- pcdsutils
- pydm
- pyqt >=5
- pyqtads
- pyqt =5
- pyqtads >=4
- pyyaml
- qtpy
- typhos
Expand Down
12 changes: 6 additions & 6 deletions lucid/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import typhos.utils
from ophyd.signal import EpicsSignalBase
from pydm import exception
from PyQtAds import QtAds
from PyQtAds import ads
from qtpy import QtCore, QtWidgets

import lucid
Expand Down Expand Up @@ -233,18 +233,18 @@ def launch(beamline, *, toolbar=None, row_group_key="location_group",
callbacks=cbs)

def grid_to_dock():
dock_widget = QtAds.CDockWidget('Grid')
dock_widget.setToggleViewActionMode(QtAds.CDockWidget.ActionModeShow)
dock_widget = ads.CDockWidget('Grid')
dock_widget.setToggleViewActionMode(ads.CDockWidget.ActionModeShow)
dock_widget.setFeature(dock_widget.DockWidgetClosable, False)
dock_widget.setFeature(dock_widget.DockWidgetFloatable, False)
dock_widget.setFeature(dock_widget.DockWidgetMovable, False)
dock_widget.setMinimumSizeHintMode(
QtAds.CDockWidget.MinimumSizeHintFromContent
ads.CDockWidget.MinimumSizeHintFromContent
)
dock_widget.setWidget(grid.frame,
QtAds.CDockWidget.eInsertMode.ForceNoScrollArea)
ads.CDockWidget.eInsertMode.ForceNoScrollArea)

window.dock_manager.addDockWidget(QtAds.LeftDockWidgetArea,
window.dock_manager.addDockWidget(ads.LeftDockWidgetArea,
dock_widget)

loader.finished.connect(splash.accept)
Expand Down
20 changes: 10 additions & 10 deletions lucid/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import typhos
from pydm import exception
from PyQtAds import QtAds
from PyQtAds import ads
from qtpy import QtCore, QtGui, QtWidgets
from qtpy.QtCore import Qt, Signal
from qtpy.QtWidgets import QMainWindow, QSizePolicy, QStyle
Expand Down Expand Up @@ -161,7 +161,7 @@ def setup_ui(self):

# Use the dockmanager for the main window - it will set itself as the
# central widget
self.dock_manager = QtAds.CDockManager(self)
self.dock_manager = ads.CDockManager(self)
if self.dark:
self.dock_manager.setStyleSheet(
open(MODULE_PATH / (
Expand All @@ -178,12 +178,12 @@ def gather_windows(self):
continue

if dock_widget.isFloating():
self.dock_manager.addDockWidget(QtAds.RightDockWidgetArea,
self.dock_manager.addDockWidget(ads.RightDockWidgetArea,
dock_widget)
elif dock_widget.isInFloatingContainer():
container = dock_widget.dockContainer()
for dock_widget in container.dockWidgets():
self.dock_manager.addDockWidget(QtAds.RightDockWidgetArea,
self.dock_manager.addDockWidget(ads.RightDockWidgetArea,
dock_widget)

@QtCore.Slot(tuple)
Expand Down Expand Up @@ -261,12 +261,12 @@ def find_dock_widget_by_title(self, title):
Returns
-------
dock_widget : QtAds.DockWidget or None
dock_widget : ads.DockWidget or None
'''
return self.dock_manager.findDockWidget(title)

def add_dock(self, title, widget, *,
area=QtAds.RightDockWidgetArea):
area=ads.RightDockWidgetArea):
'''
Add dock widget by title
Expand All @@ -279,7 +279,7 @@ def add_dock(self, title, widget, *,
The DockWidget title
widget : QWidget
The widget to put inside the dock
area : QtAds.DockWidgetArea, optional
area : ads.DockWidgetArea, optional
The area to put the dock in
'''
dock = self.find_dock_widget_by_title(title)
Expand All @@ -299,9 +299,9 @@ def min_size_hint(*args, **kwargs):
QtWidgets.QSizePolicy.Ignored
)

dock = QtAds.CDockWidget(title)
dock = ads.CDockWidget(title)
dock.setMinimumSizeHintMode(
QtAds.CDockWidget.MinimumSizeHintFromContent
ads.CDockWidget.MinimumSizeHintFromContent
)
dock.setWidget(widget)
widget.setParent(dock)
Expand Down Expand Up @@ -375,7 +375,7 @@ def wrapper(*args, **kwargs):

dock = LucidMainWindow().add_dock(
title=dock_title, widget=widget,
area=QtAds.RightDockWidgetArea)
area=ads.RightDockWidgetArea)

if active_slot:
dock.viewToggled.connect(active_slot)
Expand Down

0 comments on commit ca802a0

Please sign in to comment.