def __init__(self, preset, itemTypes): IProcessorUI.__init__(self) self._preset = None self._exportTemplate = None self._exportStructureViewer = None self._contentElement = None self._contentScrollArea = None self._contentUI = None self._editMode = IProcessorUI.ReadOnly self._itemTypes = itemTypes self._tags = [] self._project = None self._exportItems = [] self.setPreset(preset) ''' ####################################################### # NIM VARS ''' self.app = nimFile.get_app() self.prefs = nimPrefs.read() try: self.user = self.prefs['NIM_User'] self.pref_job = self.prefs[self.app + '_Job'] self.pref_show = self.prefs[self.app + '_Show'] self.pref_server = self.prefs[self.app + '_ServerPath'] except: #return False pass self.nim_OS = platform.system() self.nim_userID = nimAPI.get_userID(self.user) if not self.nim_userID: nimUI.GUI().update_user() userInfo = nim.NIM().userInfo() self.user = userInfo['name'] self.nim_userID = userInfo['ID'] print "NIM: user=%s" % self.user print "NIM: userID=%s" % self.nim_userID print "NIM: default job=%s" % self.pref_job #Get NIM Jobs self.nim_jobID = None self.nim_jobs = nimAPI.get_jobs(self.nim_userID) if not self.nim_jobs: print "No Jobs Found" self.nim_jobs["None"] = "0" #self.nim_shows = [] self.nim_servers = {} self.nim_shows = {} self.nim_showDict = {} self.nim_showChooser = QtWidgets.QComboBox() self.nim_serverChooser = QtWidgets.QComboBox() self.nim_jobPaths = {} self.nim_showPaths = {} self.nim_showFolder = '' self.nim_serverOSPath = '' #Get NIM Element Types self.pref_elementType = '' self.element = '' self.elementID = None self.nim_elementTypes = [] self.nim_elementTypesDict = {} self.nim_elementTypes = nimAPI.get_elementTypes() #Get NIM Task Types self.pref_taskType = '' self.task = '' self.taskID = None self.nim_taskTypes = [] self.nim_taskTypesDict = {} self.nim_taskFolderDict = {} self.nim_taskTypes = nimAPI.get_tasks(app='NUKE', userType='all') self.nim_publishElementCheckbox = QtWidgets.QCheckBox() self.nim_publishElement = False self.nim_publishCompCheckbox = QtWidgets.QCheckBox() self.nim_publishComp = False self.loadingNimUI = False '''
def __init__(self, selection, selectedPresets, parent=None): super(NimHieroExport.NimExportDialog, self).__init__(parent) self.app = nimFile.get_app() self.prefs = nimPrefs.read() try: self.user = self.prefs['NIM_User'] self.pref_job = self.prefs[self.app + '_Job'] self.pref_show = self.prefs[self.app + '_Show'] self.pref_server = self.prefs[self.app + '_ServerPath'] except: #return False pass self.nim_OS = platform.system() self.nim_userID = nimAPI.get_userID(self.user) if not self.nim_userID: nimUI.GUI().update_user() userInfo = nim.NIM().userInfo() self.user = userInfo['name'] self.nim_userID = userInfo['ID'] print "NIM: user=%s" % self.user print "NIM: userID=%s" % self.nim_userID print "NIM: default job=%s" % self.pref_job self.nim_jobPaths = {} self.nim_showPaths = {} self.nim_shotPaths = {} self.nim_showFolder = '' self.nim_servers = {} self.nim_serverID = None self.nim_serverOSPath = '' #Get NIM Jobs self.nim_jobID = None self.nim_jobs = nimAPI.get_jobs(self.nim_userID) if not self.nim_jobs: print "No Jobs Found" self.nim_jobs["None"] = "0" self.nim_shows = [] self.nim_showDict = {} self.nim_showID = None self.setWindowTitle("NIM Update Selected Shots") self.setSizeGripEnabled(True) self._exportTemplate = None tag_jobID = None tag_showID = None nimConnect = nimHieroConnector.NimHieroConnector() # Check Sequence for existing showID for trackItem in selection: sequence = trackItem.parentSequence() nim_sequence_tag = nimConnect.getNimTag(sequence) if (nim_sequence_tag != False): tag_showID = nim_sequence_tag.metadata().value( "tag.showID") print "NIM: Sequence showID=%s" % tag_showID if (tag_showID != ''): showInfo = nimAPI.get_showInfo(tag_showID) if len(showInfo) > 0: for showInfoDetails in showInfo: tag_jobID = showInfoDetails['jobID'] print "NIM: Sequence jobID=%s" % tag_jobID break layout = QVBoxLayout() formLayout = QFormLayout() groupBox = QGroupBox() groupLayout = QFormLayout() groupBox.setLayout(groupLayout) # JOBS: List box for job selection horizontalLayout = QHBoxLayout() horizontalLayout.setSpacing(-1) horizontalLayout.setSizeConstraint(QLayout.SetDefaultConstraint) horizontalLayout.setObjectName("HorizontalLayout") self.nimJobLabel = QLabel() self.nimJobLabel.setFixedWidth(40) self.nimJobLabel.setText("Job:") horizontalLayout.addWidget(self.nimJobLabel) self.nim_jobChooser = QComboBox() self.nim_jobChooser.setToolTip( "Choose the job you wish to export shots to.") horizontalLayout.addWidget(self.nim_jobChooser) horizontalLayout.setStretch(1, 40) groupLayout.setLayout(0, QFormLayout.SpanningRole, horizontalLayout) # JOBS: Add dictionary in ordered list jobIndex = 0 jobIter = 0 if len(self.nim_jobs) > 0: for key, value in sorted(self.nim_jobs.items(), reverse=True): self.nim_jobChooser.addItem(key) if nimHieroConnector.g_nim_jobID: if nimHieroConnector.g_nim_jobID == value: print "Found matching jobID, job=", key self.pref_job = key jobIndex = jobIter else: if self.pref_job == key: print "Found matching Job Name, job=", key jobIndex = jobIter jobIter += 1 if self.pref_job != '': self.nim_jobChooser.setCurrentIndex(jobIndex) self.nim_jobChooser.currentIndexChanged.connect( self.nim_jobChanged) #self.nim_jobChanged() #trigger job changed to load choosers ''' # SERVERS: List box for server selection horizontalLayout2 = QHBoxLayout() horizontalLayout2.setSpacing(-1) horizontalLayout2.setSizeConstraint(QLayout.SetDefaultConstraint) horizontalLayout2.setObjectName("HorizontalLayout2") self.nimServerLabel = QLabel() self.nimServerLabel.setFixedWidth(40) self.nimServerLabel.setText("Server:") horizontalLayout2.addWidget(self.nimServerLabel) self.nim_serverChooser = QComboBox() self.nim_serverChooser.setToolTip("Choose the server you wish to export shots to.") horizontalLayout2.addWidget(self.nim_serverChooser) horizontalLayout2.setStretch(1, 40) groupLayout.setLayout(1, QFormLayout.SpanningRole, horizontalLayout2) # SERVERS: Add dictionary in ordered list serverIndex = 0 serverIter=0 if len(self.nim_servers)>0: for server in self.nim_servers: self.nim_serverDict[server['server']] = server['ID'] for key, value in sorted(self.nim_serverDict.items(), reverse=False): self.nim_serverChooser.addItem(key) if nimHieroConnector.g_nim_serverID == value: self.pref_server = key serverIndex = serverIter #print "Found matching serverID, server=", key #print "serverIndex=",serverIndex serverIter +=1 if self.pref_server != '': #print "self.pref_server=",self.pref_server self.nim_serverChooser.setCurrentIndex(serverIndex) self.nim_serverChooser.currentIndexChanged.connect(self.nim_serverChanged) self.nim_serverChanged() ''' # SHOWS: List box for show selection horizontalLayout3 = QHBoxLayout() horizontalLayout3.setSpacing(-1) horizontalLayout3.setSizeConstraint(QLayout.SetDefaultConstraint) horizontalLayout3.setObjectName("HorizontalLayout3") self.nimShowLabel = QLabel() self.nimShowLabel.setFixedWidth(40) self.nimShowLabel.setText("Show:") horizontalLayout3.addWidget(self.nimShowLabel) self.nim_showChooser = QComboBox() self.nim_showChooser.setToolTip( "Choose the show you wish to export shots to.") horizontalLayout3.addWidget(self.nim_showChooser) horizontalLayout3.setStretch(1, 40) groupLayout.setLayout(1, QFormLayout.SpanningRole, horizontalLayout3) self.nim_showChooser.currentIndexChanged.connect( self.nim_showChanged) # Add the standard ok/cancel buttons, default to ok. self._buttonbox = QDialogButtonBox( QDialogButtonBox.StandardButton.Ok | QDialogButtonBox.StandardButton.Cancel) self._buttonbox.button( QDialogButtonBox.StandardButton.Ok).setText("Update") self._buttonbox.button( QDialogButtonBox.StandardButton.Ok).setDefault(True) self._buttonbox.button( QDialogButtonBox.StandardButton.Ok).setToolTip( "Executes exports on selection for each selected preset") self._buttonbox.accepted.connect(self.acceptTest) self._buttonbox.rejected.connect(self.reject) horizontalLayout4 = QHBoxLayout() horizontalLayout4.setSpacing(-1) horizontalLayout4.setSizeConstraint(QLayout.SetDefaultConstraint) horizontalLayout4.setObjectName("HorizontalLayout4") spacerItem4 = QSpacerItem(175, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) horizontalLayout4.addItem(spacerItem4) horizontalLayout4.addWidget(self._buttonbox) horizontalLayout4.setStretch(1, 40) groupLayout.setLayout(2, QFormLayout.SpanningRole, horizontalLayout4) self.setLayout(groupLayout) layout.addWidget(groupBox) self.nim_jobChanged() #trigger job changed to load choosers
def populateUI(self, processorUIWidget, taskUIWidget, exportItems): """ Build the processor UI and add it to widget. """ self._exportItems = exportItems self._tags = self.findTagsForItems(exportItems) layout = QtWidgets.QVBoxLayout(processorUIWidget) layout.setContentsMargins(0, 0, 0, 0) splitter = QtWidgets.QSplitter(QtCore.Qt.Vertical) splitter.setChildrenCollapsible(False) splitter.setHandleWidth(10) layout.addWidget(splitter) self._editMode = IProcessorUI.ReadOnly if self._preset.readOnly( ) else IProcessorUI.Full ''' ####################################################### # NIM CONTROLS ''' print "NIM: Loading UI" self.loadingNimUI = True print "NimHieroConnector.g_nim_jobID=", nimHieroConnector.g_nim_jobID print "NimHieroConnector.g_nim_serverID=", nimHieroConnector.g_nim_serverID print "NimHieroConnector.g_nim_showID=", nimHieroConnector.g_nim_showID print "NimHieroConnector.g_nim_elementTypeID=", nimHieroConnector.g_nim_elementTypeID nim_groupBox = QtWidgets.QGroupBox("NIM") nim_groupLayout = QtWidgets.QFormLayout() #nim_groupBox.setLayout(nim_groupLayout) # JOBS: List box for job selection nim_horizontalLayout1 = QtWidgets.QHBoxLayout() nim_horizontalLayout1.setSpacing(-1) nim_horizontalLayout1.setSizeConstraint( QtWidgets.QLayout.SetDefaultConstraint) nim_horizontalLayout1.setObjectName("nim_HorizontalLayout1") self.nimJobLabel = QtWidgets.QLabel() self.nimJobLabel.setFixedWidth(40) self.nimJobLabel.setText("Job:") nim_horizontalLayout1.addWidget(self.nimJobLabel) self.nim_jobChooser = QtWidgets.QComboBox() self.nim_jobChooser.setToolTip( "Choose the job you wish to export shots to.") nim_horizontalLayout1.addWidget(self.nim_jobChooser) nim_horizontalLayout1.setStretch(1, 40) nim_groupLayout.setLayout(1, QtWidgets.QFormLayout.SpanningRole, nim_horizontalLayout1) # JOBS: List box for job selection ''' self.nimJobLabel = QtWidgets.QLabel() self.nimJobLabel.setText("Job:") layout.addWidget(self.nimJobLabel) self.nim_jobChooser = QtWidgets.QComboBox() self.nim_jobChooser.setToolTip("Choose the job you wish to export shots to.") ''' # JOBS: Add dictionary in ordered list #Get NIM Jobs self.nim_jobs = nimAPI.get_jobs(self.nim_userID) if not self.nim_jobs: print "No Jobs Found" self.nim_jobs["None"] = "0" jobIndex = 0 jobIter = 0 if len(self.nim_jobs) > 0: for key, value in sorted(self.nim_jobs.items(), reverse=True): self.nim_jobChooser.addItem(key) if nimHieroConnector.g_nim_jobID == value: #print "Found matching jobID, job=", key self.pref_job = key jobIndex = jobIter jobIter += 1 if self.pref_job != '': self.nim_jobChooser.setCurrentIndex(jobIndex) self.nim_jobChooser.currentIndexChanged.connect(self.nim_jobChanged) splitter.addWidget(self.nim_jobChooser) self.nim_jobChanged() #trigger job changed to load choosers # SERVERS: List box for server selection nim_horizontalLayout2 = QtWidgets.QHBoxLayout() nim_horizontalLayout2.setSpacing(-1) nim_horizontalLayout2.setSizeConstraint( QtWidgets.QLayout.SetDefaultConstraint) nim_horizontalLayout2.setObjectName("nim_HorizontalLayout2") self.nimServerLabel = QtWidgets.QLabel() self.nimServerLabel.setFixedWidth(40) self.nimServerLabel.setText("Server:") nim_horizontalLayout2.addWidget(self.nimServerLabel) self.nim_serverChooser = QtWidgets.QComboBox() self.nim_serverChooser.setToolTip( "Choose the server you wish to export shots to.") nim_horizontalLayout2.addWidget(self.nim_serverChooser) nim_horizontalLayout2.setStretch(1, 40) nim_groupLayout.setLayout(2, QtWidgets.QFormLayout.SpanningRole, nim_horizontalLayout2) ''' self.nimServerLabel = QtWidgets.QLabel() self.nimServerLabel.setText("Server:") layout.addWidget(self.nimServerLabel) self.nim_serverChooser = QtWidgets.QComboBox() self.nim_serverChooser.setToolTip("Choose the server you wish to export shots to.") layout.addWidget(self.nim_serverChooser) ''' # SERVERS: Add dictionary in ordered list serverIndex = 0 serverIter = 0 if len(self.nim_servers) > 0: for server in self.nim_servers: self.nim_serverDict[server['server']] = server['ID'] for key, value in sorted(self.nim_serverDict.items(), reverse=False): self.nim_serverChooser.addItem(key) if nimHieroConnector.g_nim_serverID == value: self.pref_server = key serverIndex = serverIter #print "Found matching serverID, server=", key #print "serverIndex=",serverIndex serverIter += 1 if self.pref_server != '': #print "self.pref_server=",self.pref_server self.nim_serverChooser.setCurrentIndex(serverIndex) self.nim_serverChooser.currentIndexChanged.connect( self.nim_serverChanged) self.nim_serverChanged() # SHOWS: List box for show selection nim_horizontalLayout3 = QtWidgets.QHBoxLayout() nim_horizontalLayout3.setSpacing(-1) nim_horizontalLayout3.setSizeConstraint( QtWidgets.QLayout.SetDefaultConstraint) nim_horizontalLayout3.setObjectName("nim_HorizontalLayout3") self.nimShowLabel = QtWidgets.QLabel() self.nimShowLabel.setFixedWidth(40) self.nimShowLabel.setText("Show:") nim_horizontalLayout3.addWidget(self.nimShowLabel) self.nim_showChooser = QtWidgets.QComboBox() self.nim_showChooser.setToolTip( "Choose the show you wish to export shots to.") nim_horizontalLayout3.addWidget(self.nim_showChooser) nim_horizontalLayout3.setStretch(1, 40) nim_groupLayout.setLayout(3, QtWidgets.QFormLayout.SpanningRole, nim_horizontalLayout3) ''' self.nimShowLabel = QtWidgets.QLabel() self.nimShowLabel.setText("Show:") layout.addWidget(self.nimShowLabel) self.nim_showChooser = QtWidgets.QComboBox() self.nim_showChooser.setToolTip("Choose the show you wish to export shots to.") layout.addWidget(self.nim_showChooser) ''' # SHOWS: Add dictionary in ordered list showIndex = 0 showIter = 0 if len(self.nim_shows) > 0: for show in self.nim_shows: self.nim_showDict[show['showname']] = show['ID'] for key, value in sorted(self.nim_showDict.items(), reverse=False): self.nim_showChooser.addItem(key) if nimHieroConnector.g_nim_showID == value: #print "Found matching showID, show=", key self.pref_show == key showIndex = showIter showIter += 1 if self.pref_show != '': self.nim_showChooser.setCurrentIndex(showIndex) self.nim_showChooser.currentIndexChanged.connect(self.nim_showChanged) self.nim_showChanged() nim_horizontalLayout6 = QtWidgets.QHBoxLayout() nim_horizontalLayout6.setSpacing(-1) nim_horizontalLayout6.setSizeConstraint( QtWidgets.QLayout.SetDefaultConstraint) nim_horizontalLayout6.setObjectName("nim_HorizontalLayout6") nim_dividerline1 = QtWidgets.QFrame() nim_dividerline1.setFrameShape(QtWidgets.QFrame.HLine) nim_dividerline1.setFrameShadow(QtWidgets.QFrame.Sunken) nim_horizontalLayout6.addWidget(nim_dividerline1) nim_horizontalLayout6.setStretch(1, 40) nim_groupLayout.setLayout(4, QtWidgets.QFormLayout.SpanningRole, nim_horizontalLayout6) # Publish NIM Elements Checkbox nim_horizontalLayout4 = QtWidgets.QHBoxLayout() nim_horizontalLayout4.setSpacing(-1) nim_horizontalLayout4.setSizeConstraint( QtWidgets.QLayout.SetDefaultConstraint) nim_horizontalLayout4.setObjectName("nim_HorizontalLayout4") self.nimPublishElementLabel = QtWidgets.QLabel() self.nimPublishElementLabel.setFixedWidth(260) self.nimPublishElementLabel.setText( "Publish Transcoded Images as NIM Elements:") nim_horizontalLayout4.addWidget(self.nimPublishElementLabel) self.nim_publishElementCheckbox = QtWidgets.QCheckBox() self.nim_publishElementCheckbox.setToolTip( "Choose to publish the elements to the associated NIM shots.") self.nim_publishElementCheckbox.stateChanged.connect( self.nim_publishElementChanged) nim_horizontalLayout4.addWidget(self.nim_publishElementCheckbox) if nimHieroConnector.g_nim_publishElement == True: self.nim_publishElementCheckbox.toggle() # Element Types: List box for element type selection self.nimElementTypeLabel = QtWidgets.QLabel() self.nimElementTypeLabel.setFixedWidth(90) self.nimElementTypeLabel.setText("Element Type:") nim_horizontalLayout4.addWidget(self.nimElementTypeLabel) self.nim_elementTypeChooser = QtWidgets.QComboBox() self.nim_elementTypeChooser.setToolTip( "Choose the element type you wish to publish.") self.nim_elementTypeChooser.setFixedWidth(160) nim_horizontalLayout4.addWidget(self.nim_elementTypeChooser) nim_horizontalLayout4.setStretch(1, 40) nim_groupLayout.setLayout(6, QtWidgets.QFormLayout.SpanningRole, nim_horizontalLayout4) #Add dictionary in ordered list elemIndex = 0 elemIter = 0 if len(self.nim_elementTypes) > 0: for element in self.nim_elementTypes: self.nim_elementTypesDict[element['name']] = element['ID'] for key, value in sorted(self.nim_elementTypesDict.items(), reverse=False): self.nim_elementTypeChooser.addItem(key) if nimHieroConnector.g_nim_elementTypeID == value: #print "Found matching elementTypeID, elementType=", key self.pref_elementType = key elemIndex = elemIter elemIter += 1 if self.pref_elementType != '': self.nim_elementTypeChooser.setCurrentIndex(elemIndex) self.nim_elementTypeChooser.currentIndexChanged.connect( self.nim_elementTypeChanged) self.nim_elementTypeChanged() # Publish NIM Comp Checkbox nim_horizontalLayout7 = QtWidgets.QHBoxLayout() nim_horizontalLayout7.setSpacing(-1) nim_horizontalLayout7.setSizeConstraint( QtWidgets.QLayout.SetDefaultConstraint) nim_horizontalLayout7.setObjectName("nim_HorizontalLayout7") self.nimPublishCompLabel = QtWidgets.QLabel() self.nimPublishCompLabel.setFixedWidth(260) self.nimPublishCompLabel.setText( "Publish Nuke Project Files as NIM Files:") nim_horizontalLayout7.addWidget(self.nimPublishCompLabel) self.nim_publishCompCheckbox = QtWidgets.QCheckBox() self.nim_publishCompCheckbox.setToolTip( "Choose to publish the nuke projects to the associated NIM shots.") self.nim_publishCompCheckbox.stateChanged.connect( self.nim_publishCompChanged) nim_horizontalLayout7.addWidget(self.nim_publishCompCheckbox) #nim_horizontalLayout7.setStretch(1, 40) #nim_groupLayout.setLayout(7, QtWidgets.QFormLayout.SpanningRole, nim_horizontalLayout7) if nimHieroConnector.g_nim_publishComp == True: self.nim_publishCompCheckbox.toggle() # Task Types: List box for element type selection self.nimTaskTypeLabel = QtWidgets.QLabel() self.nimTaskTypeLabel.setFixedWidth(90) self.nimTaskTypeLabel.setText("Task:") nim_horizontalLayout7.addWidget(self.nimTaskTypeLabel) self.nim_taskTypeChooser = QtWidgets.QComboBox() self.nim_taskTypeChooser.setToolTip( "Choose the task you wish to assign to the exported nuke project files." ) self.nim_taskTypeChooser.setFixedWidth(160) nim_horizontalLayout7.addWidget(self.nim_taskTypeChooser) nim_horizontalLayout7.setStretch(1, 40) nim_groupLayout.setLayout(7, QtWidgets.QFormLayout.SpanningRole, nim_horizontalLayout7) #Add dictionary in ordered list taskIndex = 0 taskIter = 0 if len(self.nim_taskTypes) > 0: for task in self.nim_taskTypes: self.nim_taskTypesDict[task['name']] = task['ID'] self.nim_taskFolderDict[task['ID']] = task['folder'] for key, value in sorted(self.nim_taskTypesDict.items(), reverse=False): self.nim_taskTypeChooser.addItem(key) if nimHieroConnector.g_nim_expTaskTypeID == value: self.pref_taskType = key taskIndex = taskIter taskIter += 1 if self.pref_taskType != '': self.nim_taskTypeChooser.setCurrentIndex(taskIndex) self.nim_taskTypeChooser.currentIndexChanged.connect( self.nim_taskTypeChanged) self.nim_taskTypeChanged() nim_groupBox.setLayout(nim_groupLayout) splitter.addWidget(nim_groupBox) # splitter.addSpacing(5) self.loadingNimUI = False ''' # END NIM CONTROLS ####################################################### ''' # The same enums are declared in 2 classes. They should have the same values but to be sure, map between them editModeMap = { IProcessorUI.ReadOnly: ui.ExportStructureViewer.ReadOnly, IProcessorUI.Limited: ui.ExportStructureViewer.Limited, IProcessorUI.Full: ui.ExportStructureViewer.Full } structureViewerMode = editModeMap[self._editMode] ###EXPORT STRUCTURE exportStructureWidget = QtWidgets.QWidget() splitter.addWidget(exportStructureWidget) exportStructureLayout = QtWidgets.QVBoxLayout(exportStructureWidget) exportStructureLayout.setContentsMargins(0, 0, 0, 9) self._exportStructureViewer = ui.ExportStructureViewer( self._exportTemplate, structureViewerMode) exportStructureLayout.addWidget(self._exportStructureViewer) self._project = self.projectFromSelection(exportItems) if self._project: self._exportStructureViewer.setProject(self._project) self._exportStructureViewer.destroyed.connect( self.onExportStructureViewerDestroyed) self._exportStructureViewer.setItemTypes(self._itemTypes) self._preset.createResolver().addEntriesToExportStructureViewer( self._exportStructureViewer) self._exportStructureViewer.structureModified.connect( self.onExportStructureModified) self._exportStructureViewer.selectionChanged.connect( self.onExportStructureSelectionChanged) exportStructureLayout.addWidget(self.createVersionWidget()) exportStructureLayout.addWidget(self.createPathPreviewWidget()) splitter.addWidget(self.createProcessorSettingsWidget(exportItems)) taskUILayout = QtWidgets.QVBoxLayout(taskUIWidget) taskUILayout.setContentsMargins(10, 0, 0, 0) tabWidget = QtWidgets.QTabWidget() taskUILayout.addWidget(tabWidget) self._contentScrollArea = QtWidgets.QScrollArea() tabWidget.addTab(self._contentScrollArea, "Content") self._contentScrollArea.setFrameStyle(QtWidgets.QScrollArea.NoFrame) self._contentScrollArea.setWidgetResizable(True)