Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DO NOT REVIEW 2378 Part Three: Return of the ROIFormWidget Class - Represent ROI: Export Tabs, Action Buttons, Table & Properties #2495

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions mantidimaging/gui/windows/spectrum_viewer/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,40 @@
from mantidimaging.gui.windows.main import MainWindowView # noqa:F401 # pragma: no cover
from uuid import UUID

class ROIFormWidget(QGroupBox):
"""
A class to represent the export tabs and ROI action buttons in the spectrum viewer window.
"""

# TODO: table_view: ROITableWidget - uncomment when ROITableWidget is implemented
# TODO: roi_properties_widget: ROIPropertiesTableWidget - uncomment when ROIPropertiesTableWidget is implemented

def __init__(self,
table_view: RemovableRowTableView,
roiPropertiesTableWidget: QTableWidget,
roiPropertiesGroupBox: QGroupBox,
exportTabs=None,
add_btn: QPushButton = None,
remove_btn: QPushButton = None,
export_btn: QPushButton = None,
export_button_rits: QPushButton = None,
parent=None):
super().__init__(parent)
if parent is not None:
layout = parent.layout()
if layout is not None:
layout.addWidget(self)
# TODO: Uncomment when ROITableWidget and ROIPropertiesTableWidget are implemented
# self.table_view = ROITableWidget(table_view)
# self.roi_properties_widget = ROIPropertiesTableWidget(parent,
# roiPropertiesTableWidget,
# roiPropertiesGroupBox)
self.exportTabs = exportTabs
self.add_btn = add_btn
self.remove_btn = remove_btn
self.export_btn = export_btn
self.export_button_rits = export_button_rits


class SpectrumViewerWindowView(BaseMainWindowView):
tableView: RemovableRowTableView
Expand Down Expand Up @@ -68,6 +102,17 @@ def __init__(self, main_window: MainWindowView):
icon_path = finder.ROOT_PATH + "/gui/ui/images/exclamation-triangle-red.png"
self.normalise_error_icon_pixmap = QPixmap(icon_path)

# TODO: Uncomment when ROITableWidget and ROIPropertiesTableWidget are implemented
# self.roi_form_widget = ROIFormWidget(table_view=self.roiTableView,
# roiPropertiesTableWidget=self.roiPropertiesTableWidget,
# roiPropertiesGroupBox=self.roiPropertiesGroupBox,
# exportTabs=self.exportTabs,
# add_btn=self.addBtn,
# remove_btn=self.removeBtn,
# export_btn=self.exportButton,
# export_button_rits=self.exportButtonRITS,
# parent=self)

self.selected_row: int = 0
self.last_clicked_roi = ""
self.current_roi_name: str = ""
Expand Down
Loading