def __init__(self, parent=None, mcawidget=None, rgbwidget=None, vertical=False, master=True): StackBase.StackBase.__init__(self) CloseEventNotifyingWidget.CloseEventNotifyingWidget.__init__( self, parent) self.setWindowIcon(qt.QIcon(qt.QPixmap(IconDict['gioconda16']))) self.setWindowTitle("PyMCA - ROI Imaging Tool") screenHeight = qt.QDesktopWidget().height() if screenHeight > 0: if QTVERSION < '4.5.0': self.setMaximumHeight(int(0.99 * screenHeight)) self.setMinimumHeight(int(0.5 * screenHeight)) screenWidth = qt.QDesktopWidget().width() if screenWidth > 0: if QTVERSION < '4.5.0': self.setMaximumWidth(int(screenWidth) - 5) self.setMinimumWidth(min(int(0.5 * screenWidth), 800)) self.mainLayout = qt.QVBoxLayout(self) self.mainLayout.setContentsMargins(0, 0, 0, 0) self.mainLayout.setSpacing(2) self.mcaWidget = mcawidget self.rgbWidget = rgbwidget self.master = master self._slave = None self._masterStack = None self.stackSelector = None self._build(vertical=vertical) self._buildBottom() self._buildConnections() self.__ROIConnected = True
def __init__(self, parent=None, name="Attenuators Tab", attenuators=None, graph=None): qt.QWidget.__init__(self, parent) layout = qt.QVBoxLayout(self) maxheight = qt.QDesktopWidget().height() if maxheight < 800: layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(2) self.table = AttenuatorsTableWidget(self, name, attenuators, funnyfilters=True) layout.addWidget(self.table) self.mainTab = qt.QTabWidget(self) layout.addWidget(self.mainTab) rheight = self.table.horizontalHeader().sizeHint().height() if maxheight < 801: self.editor = MaterialEditor.MaterialEditor(height=5, graph=graph) self.table.setMinimumHeight(7 * rheight) self.table.setMaximumHeight(13 * rheight) else: spacer = qt.VerticalSpacer(self) layout.addWidget(spacer) self.editor = MaterialEditor.MaterialEditor(graph=graph) self.table.setMinimumHeight(13 * rheight) self.table.setMaximumHeight(13 * rheight) self.mainTab.addTab(self.editor, "Material Editor")
def __init__(self, parent=None, name="Attenuators Tab", attenuators=None, graph=None): qt.QWidget.__init__(self, parent) layout = qt.QVBoxLayout(self) maxheight = qt.QDesktopWidget().height() layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(2) self.table = AttenuatorsTableWidget(self, name, attenuators, funnyfilters=True) layout.addWidget(self.table) self.mainTab = qt.QTabWidget(self) layout.addWidget(self.mainTab) rheight = self.table.horizontalHeader().sizeHint().height() if maxheight < 801: self.editor = MaterialEditor.MaterialEditor(height=5, graph=graph) self.table.setMinimumHeight(7 * rheight) self.table.setMaximumHeight(13 * rheight) else: spacer = qt.VerticalSpacer(self) layout.addWidget(spacer) if rheight > 32: # when using big letters we run into troubles # for instance windowx 1920x1080 but with a 150% scale self.editor = MaterialEditor.MaterialEditor(height=5, graph=graph) if rheight > 40: self.table.setMinimumHeight(10 * rheight) else: self.table.setMinimumHeight(13 * rheight) else: self.editor = MaterialEditor.MaterialEditor(graph=graph) self.table.setMinimumHeight(13 * rheight) self.table.setMaximumHeight(13 * rheight) self.userAttenuators = TransmissionTableGui.TransmissionTableGui() self.mainTab.addTab(self.editor, "Material Editor") self.mainTab.addTab(self.userAttenuators, "User Attenuators")