first try to motion to PyQt6
This commit is contained in:
@ -6,7 +6,7 @@ from ..lib.pg_objects import RegionItem
|
||||
class FitToolbar(QtWidgets.QToolBar):
|
||||
def __init__(
|
||||
self,
|
||||
fitaction: QtWidgets.QAction,
|
||||
fitaction: QtGui.QAction,
|
||||
limit_menu: QtWidgets.QMenu,
|
||||
parent=None,
|
||||
):
|
||||
@ -18,7 +18,7 @@ class FitToolbar(QtWidgets.QToolBar):
|
||||
|
||||
self.fitlim_button = QtWidgets.QToolButton(self)
|
||||
self.fitlim_button.setMenu(limit_menu)
|
||||
self.fitlim_button.setPopupMode(self.fitlim_button.InstantPopup)
|
||||
self.fitlim_button.setPopupMode(self.fitlim_button.ToolButtonPopupMode.InstantPopup)
|
||||
self.fitlim_button.setIcon(get_icon('fit_region'))
|
||||
self.addWidget(self.fitlim_button)
|
||||
|
||||
@ -44,7 +44,7 @@ class FitToolbar(QtWidgets.QToolBar):
|
||||
self.lineedit2.setMaximumWidth(92)
|
||||
self.lineedit2.setEnabled(False)
|
||||
|
||||
self.limit_group = QtWidgets.QActionGroup(self)
|
||||
self.limit_group = QtGui.QActionGroup(self)
|
||||
for ac in limit_menu.actions():
|
||||
self.limit_group.addAction(ac)
|
||||
|
||||
@ -56,10 +56,9 @@ class FitToolbar(QtWidgets.QToolBar):
|
||||
self.lineedit.textChanged.connect(self.move_region)
|
||||
self.lineedit2.textChanged.connect(self.move_region)
|
||||
|
||||
@QtCore.pyqtSlot(QtWidgets.QAction)
|
||||
def change_limit_type(self, action: QtWidgets.QAction):
|
||||
@QtCore.pyqtSlot(QtGui.QAction)
|
||||
def change_limit_type(self, action: QtGui.QAction):
|
||||
is_custom = (action.text() in ['Custom', 'Exclude region'])
|
||||
print(is_custom)
|
||||
|
||||
for w in [self.label, self.label2, self.lineedit, self.lineedit2]:
|
||||
w.setEnabled(is_custom)
|
||||
|
Reference in New Issue
Block a user