def move_left_button_onClicked(self): root_item = self.delete_roi_window_delete_tree_view.invisibleRootItem() for index in range(root_item.childCount()): item = root_item.child(index) if item in self.delete_roi_window_delete_tree_view.selectedItems(): # This will get ROI name self.regions_of_interest_to_keep.append(item.text(0)) # Move to the left column list self.delete_roi_window_keep_tree_view.clear() self.delete_roi_window_keep_tree_view.setIndentation(0) for roi in self.regions_of_interest_to_keep: item = QTreeWidgetItem([roi]) self.delete_roi_window_keep_tree_view.addTopLevelItem(item) # Delete moved items from the right column list self.regions_of_interest_to_delete = [ x for x in self.regions_of_interest_to_delete if x not in self.regions_of_interest_to_keep ] self.delete_roi_window_delete_tree_view.clear() for index in self.regions_of_interest_to_delete: item = QTreeWidgetItem([index]) self.delete_roi_window_delete_tree_view.addTopLevelItem(item) if len(self.regions_of_interest_to_delete) == 0: self.delete_roi_window_confirm_button.setEnabled(False)
def _create_item_for_packet(self, viewsb_packet): """ Creates a QTreeWidgetItem for a given ViewSBPacket. Args: viewsb_packet -- The ViewSBPacket to create the QTreeWidgetItem from. Returns a QTreeWidgetItem. """ def get_packet_string_array(viewsb_packet): """ Tiny helper to return and stringify the common fields used for the columns of tree items. """ direction = viewsb_packet.direction.name if viewsb_packet.direction is not None else '' length = len( viewsb_packet.data) if viewsb_packet.data is not None else '' return self._stringify_list([ viewsb_packet.summarize(), viewsb_packet.device_address, viewsb_packet.endpoint_number, direction, length, viewsb_packet.timestamp, viewsb_packet.summarize_status(), viewsb_packet.summarize_data() ]) + [viewsb_packet] item = QTreeWidgetItem(get_packet_string_array(viewsb_packet)) # Give the item a reference to the original packet object. item.setData(0, QtCore.Qt.UserRole, viewsb_packet) return item
def move_right_button_on_clicked(self): """ This function is triggered when move right buttons is clicked """ root_item = self.delete_roi_window_keep_tree_view.invisibleRootItem() for index in range(root_item.childCount()): item = root_item.child(index) if item in self.delete_roi_window_keep_tree_view.selectedItems(): # This will get ROI name self.regions_of_interest_to_delete.append(item.text(0)) # Move to the right column list self.delete_roi_window_delete_tree_view.clear() self.delete_roi_window_delete_tree_view.setIndentation(0) for roi in self.regions_of_interest_to_delete: item = QTreeWidgetItem([roi]) self.delete_roi_window_delete_tree_view.addTopLevelItem(item) self.delete_roi_window_confirm_button.setEnabled(True) # Delete moved items from the left column list self.regions_of_interest_to_keep = \ [x for x in self.regions_of_interest_to_keep if x not in self.regions_of_interest_to_delete] self.delete_roi_window_keep_tree_view.clear() for index in self.regions_of_interest_to_keep: item = QTreeWidgetItem([index]) self.delete_roi_window_keep_tree_view.addTopLevelItem(item)
def __init__(self, parent=None, data=[None, None, None, None]): QTreeWidgetItem.__init__(self, parent, data) self.label = None # string self.value = None # string self.start = None # int self.end = None # int self.ksobj = None # KaitaiStruct
def recurse(parent_item: QTreeWidgetItem): for i in range(parent_item.childCount()): child = parent_item.child(i) if int(child.flags()) & int(Qt.ItemIsUserCheckable) and \ child.checkState(0) == Qt.Checked: checked_items.append(child) grand_children = child.childCount() if grand_children > 0: recurse(child)
def recurse(parent_item: QTreeWidgetItem): for i in range(parent_item.childCount()): child = parent_item.child(i) grand_children = child.childCount() if grand_children > 0: recurse(child) else: if child.checkState(0) == Qt.Checked: checked_items.append(child)
def recurse(parent_item: QTreeWidgetItem): for i in range(parent_item.childCount()): child = parent_item.child(i) grand_children = child.childCount() if grand_children > 0: recurse(child) else: if child.checkState(0) == Qt.Checked: child.setCheckState(0, Qt.CheckState.Unchecked) child.setSelected(False)
def display_rois_in_listViewKeep(self): self.regions_of_interest_to_keep.clear() for roi_id, roi_dict in self.regions_of_interest_list.items(): self.regions_of_interest_to_keep.append(roi_dict['name']) self.delete_roi_window_keep_tree_view.clear() self.delete_roi_window_keep_tree_view.setIndentation(0) self.item = QTreeWidgetItem(["item"]) for index in self.regions_of_interest_to_keep: item = QTreeWidgetItem([index]) self.delete_roi_window_keep_tree_view.addTopLevelItem(item)
def scan_directory_for_patient(self): # Reset tree view header and last patient self.open_patient_window_patients_tree.setHeaderLabels([""]) self.last_patient = None self.filepath = self.open_patient_directory_input_box.text() # Proceed if a folder was selected if self.filepath != "": # Update the QTreeWidget to reflect data being loaded # First, clear the widget of any existing data self.open_patient_window_patients_tree.clear() # Next, update the tree widget self.open_patient_window_patients_tree.addTopLevelItem( QTreeWidgetItem(["Loading selected directory..."])) # The choose button is disabled until the thread finishes executing self.open_patient_directory_choose_button.setEnabled(False) # Reveals the Stop Search button for the duration of the search self.open_patient_window_stop_button.setVisible(True) # The interrupt flag is then un-set if a previous search has been stopped. self.interrupt_flag.clear() # Then, create a new thread that will load the selected folder worker = Worker(DICOMDirectorySearch.get_dicom_structure, self.filepath, self.interrupt_flag, progress_callback=True) worker.signals.result.connect(self.on_search_complete) worker.signals.progress.connect(self.search_progress) # Execute the thread self.threadpool.start(worker)
def search_progress(self, progress_update): """ Current progress of the file search. """ self.open_patient_window_patients_tree.clear() self.open_patient_window_patients_tree.addTopLevelItem( QTreeWidgetItem(["Loading selected directory... " "(%s files searched)" % progress_update]))
def create_item(self, text, parent, index): after = None if index != 0: after = self.child_at(parent, index - 1) if parent is not None: item = QTreeWidgetItem(parent, after) else: item = QTreeWidgetItem(self, after) item.setText(0, text) item.setFlags(item.flags() | Qt.ItemIsEditable) return item
def _on_item_new_state(self, item: QtWidgets.QTreeWidgetItem, new_state: bool): uid = item.data(0, Qt.UserRole) if uid is None: game = self._find_game_for_root_item(item) with self.options as options: options.set_is_game_expanded(game, new_state) else: with self.options as options: options.set_preset_uuid_hidden(uid, not new_state)
def populate_tree(parent, node): item = QTreeWidgetItem(parent) item.setText(0, node.tag.strip()) if node.text is not None and node.text.strip(): item.setText(1, node.text.strip()) for element in node: populate_tree(item, element)
def get(self): result = None self.window.treeWidget.clear() selector = self.window.lineEdit_2.text().strip() if self.response: result = BaseScraper.process_xpath(self.response, selector) if result: self.window.lineEdit_3.setText(result.get().strip()) data = {k: v.strip() for k, v in enumerate(result.getall())} tree = QTreeWidgetItem() items = self.fill_item(tree, data) self.window.treeWidget.addTopLevelItems(items) self.window.treeWidget.expandAll()
def update_detail_fields(self, detail_fields): """ Populates the detail view with the relevant fields for the selected packet. """ # Each table will have a root item in the details view. root_items = [] for table in detail_fields: title = table[0] root = QTreeWidgetItem([title]) children = [] fields = table[1] # The usual case: a str:str dict. if isinstance(fields, dict): for key, value in fields.items(): children.append( QTreeWidgetItem(self._stringify_list([key, value]))) # Sometimes it'll just be a 1-column list. elif isinstance(fields, list): for item in fields: children.append( QTreeWidgetItem(self._stringify_list([item]))) # Sometimes it'll just be a string, or a `bytes` instance. else: children.append(QTreeWidgetItem(self._stringify_list([fields ]))) root.addChildren(children) # Add an empty "item" between each table. root_items.extend([root, QTreeWidgetItem([])]) self.window.usb_details_tree_widget.addTopLevelItems(root_items) self.window.usb_details_tree_widget.expandAll() self.window.usb_details_tree_widget.resizeColumnToContents(0) self.window.usb_details_tree_widget.resizeColumnToContents(1)
def setupUi(self, Form): if not Form.objectName(): Form.setObjectName(u"Form") Form.resize(529, 777) self.verticalLayout = QVBoxLayout(Form) self.verticalLayout.setObjectName(u"verticalLayout") self.stepsLayout = QVBoxLayout() self.stepsLayout.setSpacing(10) self.stepsLayout.setObjectName(u"stepsLayout") self.stepsLayout.setSizeConstraint(QLayout.SetMaximumSize) self.stepsLayout.setContentsMargins(0, 0, 0, 0) self.assetsTabs = QTabWidget(Form) self.assetsTabs.setObjectName(u"assetsTabs") self.assetsTabs.setMinimumSize(QSize(362, 0)) self.assetsTabs.setMaximumSize(QSize(410, 16777215)) self.assetsTabs.setMouseTracking(False) self.assetsTabs.setLayoutDirection(Qt.LeftToRight) self.assetsTabs.setAutoFillBackground(False) self.assetsTabs.setTabPosition(QTabWidget.North) self.assetsTabs.setTabShape(QTabWidget.Rounded) self.assetsTabs.setUsesScrollButtons(False) self.assetsTabs.setDocumentMode(False) self.assetsTabs.setTabsClosable(False) self.assetsTabs.setMovable(False) self.assetsTabs.setTabBarAutoHide(False) self.demoList = QWidget() self.demoList.setObjectName(u"demoList") sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.demoList.sizePolicy().hasHeightForWidth()) self.demoList.setSizePolicy(sizePolicy) self.verticalLayout_11 = QVBoxLayout(self.demoList) self.verticalLayout_11.setObjectName(u"verticalLayout_11") self.verticalLayout_12 = QVBoxLayout() self.verticalLayout_12.setObjectName(u"verticalLayout_12") self.horizontalLayout_10 = QHBoxLayout() self.horizontalLayout_10.setObjectName(u"horizontalLayout_10") self.browseDemoBtn = QPushButton(self.demoList) self.browseDemoBtn.setObjectName(u"browseDemoBtn") self.horizontalLayout_10.addWidget(self.browseDemoBtn) self.browseScriptBtn = QPushButton(self.demoList) self.browseScriptBtn.setObjectName(u"browseScriptBtn") self.horizontalLayout_10.addWidget(self.browseScriptBtn) self.browseAudioBtn = QPushButton(self.demoList) self.browseAudioBtn.setObjectName(u"browseAudioBtn") self.horizontalLayout_10.addWidget(self.browseAudioBtn) self.verticalLayout_12.addLayout(self.horizontalLayout_10) self.verticalLayout_11.addLayout(self.verticalLayout_12) self.demoListTreeWidget = QTreeWidget(self.demoList) self.demoListTreeWidget.setObjectName(u"demoListTreeWidget") self.verticalLayout_11.addWidget(self.demoListTreeWidget) self.horizontalLayout_11 = QHBoxLayout() self.horizontalLayout_11.setObjectName(u"horizontalLayout_11") self.infoBtn = QPushButton(self.demoList) self.infoBtn.setObjectName(u"infoBtn") self.horizontalLayout_11.addWidget(self.infoBtn) self.loadScriptBtn = QPushButton(self.demoList) self.loadScriptBtn.setObjectName(u"loadScriptBtn") self.horizontalLayout_11.addWidget(self.loadScriptBtn) self.loadAudioBtn = QPushButton(self.demoList) self.loadAudioBtn.setObjectName(u"loadAudioBtn") self.horizontalLayout_11.addWidget(self.loadAudioBtn) self.removeDemoBtn = QPushButton(self.demoList) self.removeDemoBtn.setObjectName(u"removeDemoBtn") self.horizontalLayout_11.addWidget(self.removeDemoBtn) self.addDemoBtn = QPushButton(self.demoList) self.addDemoBtn.setObjectName(u"addDemoBtn") self.horizontalLayout_11.addWidget(self.addDemoBtn) self.verticalLayout_11.addLayout(self.horizontalLayout_11) self.assetsTabs.addTab(self.demoList, "") self.scriptOverviewTab = QWidget() self.scriptOverviewTab.setObjectName(u"scriptOverviewTab") self.verticalLayout_13 = QVBoxLayout(self.scriptOverviewTab) self.verticalLayout_13.setObjectName(u"verticalLayout_13") self.scriptListTreeWidget = QListWidget(self.scriptOverviewTab) self.scriptListTreeWidget.setObjectName(u"scriptListTreeWidget") self.verticalLayout_13.addWidget(self.scriptListTreeWidget) self.assetsTabs.addTab(self.scriptOverviewTab, "") self.audioOverviewTab = QWidget() self.audioOverviewTab.setObjectName(u"audioOverviewTab") self.verticalLayout_15 = QVBoxLayout(self.audioOverviewTab) self.verticalLayout_15.setObjectName(u"verticalLayout_15") self.audioListTreeWidget = QListWidget(self.audioOverviewTab) self.audioListTreeWidget.setObjectName(u"audioListTreeWidget") self.verticalLayout_15.addWidget(self.audioListTreeWidget) self.assetsTabs.addTab(self.audioOverviewTab, "") self.stepsLayout.addWidget(self.assetsTabs) self.opsTabs = QTabWidget(Form) self.opsTabs.setObjectName(u"opsTabs") self.opsTabs.setEnabled(True) self.opsTabs.setMaximumSize(QSize(410, 16777215)) self.stepsTab = QWidget() self.stepsTab.setObjectName(u"stepsTab") sizePolicy.setHeightForWidth( self.stepsTab.sizePolicy().hasHeightForWidth()) self.stepsTab.setSizePolicy(sizePolicy) self.stepsTab.setMinimumSize(QSize(200, 278)) self.stepsTab.setAutoFillBackground(False) self.verticalLayout_2 = QVBoxLayout(self.stepsTab) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.verticalLayout_2.setContentsMargins(-1, 11, -1, -1) self.stepsTreeWidget = QTreeWidget(self.stepsTab) self.stepsTreeWidget.setObjectName(u"stepsTreeWidget") self.verticalLayout_2.addWidget(self.stepsTreeWidget) self.horizontalLayout_3 = QHBoxLayout() self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") self.stepDownBtn = QPushButton(self.stepsTab) self.stepDownBtn.setObjectName(u"stepDownBtn") self.horizontalLayout_3.addWidget(self.stepDownBtn) self.stepUpBtn = QPushButton(self.stepsTab) self.stepUpBtn.setObjectName(u"stepUpBtn") self.horizontalLayout_3.addWidget(self.stepUpBtn) self.removeStepBtn = QPushButton(self.stepsTab) self.removeStepBtn.setObjectName(u"removeStepBtn") self.horizontalLayout_3.addWidget(self.removeStepBtn) self.addStepBtn = QPushButton(self.stepsTab) self.addStepBtn.setObjectName(u"addStepBtn") self.horizontalLayout_3.addWidget(self.addStepBtn) self.runBtn = QPushButton(self.stepsTab) self.runBtn.setObjectName(u"runBtn") sizePolicy1 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Fixed) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.runBtn.sizePolicy().hasHeightForWidth()) self.runBtn.setSizePolicy(sizePolicy1) self.runBtn.setMinimumSize(QSize(0, 0)) font = QFont() font.setBold(False) self.runBtn.setFont(font) self.runBtn.setCheckable(False) self.runBtn.setFlat(False) self.horizontalLayout_3.addWidget(self.runBtn) self.verticalLayout_2.addLayout(self.horizontalLayout_3) self.opsTabs.addTab(self.stepsTab, "") self.optionsTab = QWidget() self.optionsTab.setObjectName(u"optionsTab") self.optionsTab.setAutoFillBackground(True) self.verticalLayout_17 = QVBoxLayout(self.optionsTab) self.verticalLayout_17.setObjectName(u"verticalLayout_17") self.stepOptionsTreeWidget = QTreeWidget(self.optionsTab) __qtreewidgetitem = QTreeWidgetItem() __qtreewidgetitem.setText(0, u"1") self.stepOptionsTreeWidget.setHeaderItem(__qtreewidgetitem) self.stepOptionsTreeWidget.setObjectName(u"stepOptionsTreeWidget") self.verticalLayout_17.addWidget(self.stepOptionsTreeWidget) self.opsTabs.addTab(self.optionsTab, "") self.templatesTab = QWidget() self.templatesTab.setObjectName(u"templatesTab") self.verticalLayout_19 = QVBoxLayout(self.templatesTab) self.verticalLayout_19.setObjectName(u"verticalLayout_19") self.treeWidget = QTreeWidget(self.templatesTab) __qtreewidgetitem1 = QTreeWidgetItem() __qtreewidgetitem1.setText(0, u"1") self.treeWidget.setHeaderItem(__qtreewidgetitem1) self.treeWidget.setObjectName(u"treeWidget") self.verticalLayout_19.addWidget(self.treeWidget) self.opsTabs.addTab(self.templatesTab, "") self.stepsLayout.addWidget(self.opsTabs) self.verticalLayout.addLayout(self.stepsLayout) self.retranslateUi(Form) self.assetsTabs.setCurrentIndex(0) self.opsTabs.setCurrentIndex(1) QMetaObject.connectSlotsByName(Form)
def setupUi(self, demoView): if not demoView.objectName(): demoView.setObjectName(u"demoView") demoView.resize(570, 550) self.verticalLayout_2 = QVBoxLayout(demoView) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.demoViewGroupBox = QGroupBox(demoView) self.demoViewGroupBox.setObjectName(u"demoViewGroupBox") self.demoViewGroupBox.setFlat(True) self.verticalLayout_6 = QVBoxLayout(self.demoViewGroupBox) self.verticalLayout_6.setObjectName(u"verticalLayout_6") self.verticalLayout_6.setContentsMargins(4, 4, 4, 4) self.demoTreeView = QTreeWidget(self.demoViewGroupBox) __qtreewidgetitem = QTreeWidgetItem() __qtreewidgetitem.setText(0, u"Step") self.demoTreeView.setHeaderItem(__qtreewidgetitem) self.demoTreeView.setObjectName(u"demoTreeView") self.verticalLayout_6.addWidget(self.demoTreeView) self.horizontalLayout_5 = QHBoxLayout() self.horizontalLayout_5.setObjectName(u"horizontalLayout_5") self.demoDuplicateBtn = QPushButton(self.demoViewGroupBox) self.demoDuplicateBtn.setObjectName(u"demoDuplicateBtn") self.horizontalLayout_5.addWidget(self.demoDuplicateBtn) self.demoInsertSectionBtn = QPushButton(self.demoViewGroupBox) self.demoInsertSectionBtn.setObjectName(u"demoInsertSectionBtn") self.horizontalLayout_5.addWidget(self.demoInsertSectionBtn) self.demoDeleteBtn = QPushButton(self.demoViewGroupBox) self.demoDeleteBtn.setObjectName(u"demoDeleteBtn") self.horizontalLayout_5.addWidget(self.demoDeleteBtn) self.demoAddStepBtn = QPushButton(self.demoViewGroupBox) self.demoAddStepBtn.setObjectName(u"demoAddStepBtn") self.horizontalLayout_5.addWidget(self.demoAddStepBtn) self.demoOverflowBtn = QToolButton(self.demoViewGroupBox) self.demoOverflowBtn.setObjectName(u"demoOverflowBtn") self.horizontalLayout_5.addWidget(self.demoOverflowBtn) self.verticalLayout_6.addLayout(self.horizontalLayout_5) self.verticalLayout_2.addWidget(self.demoViewGroupBox) self.metadataGroupBox = QGroupBox(demoView) self.metadataGroupBox.setObjectName(u"metadataGroupBox") self.metadataGroupBox.setMaximumSize(QSize(16777215, 300)) self.metadataGroupBox.setFlat(True) self.metadataGroupBox.setCheckable(False) self.verticalLayout_8 = QVBoxLayout(self.metadataGroupBox) self.verticalLayout_8.setObjectName(u"verticalLayout_8") self.verticalLayout_8.setContentsMargins(4, 4, 4, 4) self.dataStack = QStackedWidget(self.metadataGroupBox) self.dataStack.setObjectName(u"dataStack") self.stepDataL = QWidget() self.stepDataL.setObjectName(u"stepDataL") self.verticalLayout_14 = QVBoxLayout(self.stepDataL) self.verticalLayout_14.setObjectName(u"verticalLayout_14") self.metadataTreeWidget = QTreeWidget(self.stepDataL) self.metadataTreeWidget.setObjectName(u"metadataTreeWidget") self.verticalLayout_14.addWidget(self.metadataTreeWidget) self.stepDataBtnL = QHBoxLayout() self.stepDataBtnL.setObjectName(u"stepDataBtnL") self.pushButton_2 = QPushButton(self.stepDataL) self.pushButton_2.setObjectName(u"pushButton_2") self.stepDataBtnL.addWidget(self.pushButton_2) self.pushButton = QPushButton(self.stepDataL) self.pushButton.setObjectName(u"pushButton") self.stepDataBtnL.addWidget(self.pushButton) self.toolButton = QToolButton(self.stepDataL) self.toolButton.setObjectName(u"toolButton") self.stepDataBtnL.addWidget(self.toolButton) self.verticalLayout_14.addLayout(self.stepDataBtnL) self.dataStack.addWidget(self.stepDataL) self.sectDataL = QWidget() self.sectDataL.setObjectName(u"sectDataL") self.verticalLayout_16 = QVBoxLayout(self.sectDataL) self.verticalLayout_16.setObjectName(u"verticalLayout_16") self.sectionDataTreeW = QTreeWidget(self.sectDataL) self.sectionDataTreeW.setObjectName(u"sectionDataTreeW") self.verticalLayout_16.addWidget(self.sectionDataTreeW) self.sectionDataBtnL = QHBoxLayout() self.sectionDataBtnL.setObjectName(u"sectionDataBtnL") self.pushButton_4 = QPushButton(self.sectDataL) self.pushButton_4.setObjectName(u"pushButton_4") self.sectionDataBtnL.addWidget(self.pushButton_4) self.pushButton_3 = QPushButton(self.sectDataL) self.pushButton_3.setObjectName(u"pushButton_3") self.sectionDataBtnL.addWidget(self.pushButton_3) self.pushButton_5 = QPushButton(self.sectDataL) self.pushButton_5.setObjectName(u"pushButton_5") self.sectionDataBtnL.addWidget(self.pushButton_5) self.toolButton_2 = QToolButton(self.sectDataL) self.toolButton_2.setObjectName(u"toolButton_2") self.sectionDataBtnL.addWidget(self.toolButton_2) self.verticalLayout_16.addLayout(self.sectionDataBtnL) self.dataStack.addWidget(self.sectDataL) self.verticalLayout_8.addWidget(self.dataStack) self.verticalLayout_2.addWidget(self.metadataGroupBox) self.retranslateUi(demoView) self.dataStack.setCurrentIndex(1) QMetaObject.connectSlotsByName(demoView)
def setupUi(self, Form): if not Form.objectName(): Form.setObjectName(u"Form") Form.resize(400, 300) self.verticalLayout = QVBoxLayout(Form) self.verticalLayout.setObjectName(u"verticalLayout") self.opsTabs = QTabWidget(Form) self.opsTabs.setObjectName(u"opsTabs") self.opsTabs.setEnabled(True) self.opsTabs.setMaximumSize(QSize(410, 16777215)) self.stepsTab = QWidget() self.stepsTab.setObjectName(u"stepsTab") sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.stepsTab.sizePolicy().hasHeightForWidth()) self.stepsTab.setSizePolicy(sizePolicy) self.stepsTab.setMinimumSize(QSize(200, 278)) self.stepsTab.setAutoFillBackground(False) self.verticalLayout_2 = QVBoxLayout(self.stepsTab) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.verticalLayout_2.setContentsMargins(-1, 11, -1, -1) self.stepsTreeWidget = QTreeWidget(self.stepsTab) self.stepsTreeWidget.setObjectName(u"stepsTreeWidget") self.verticalLayout_2.addWidget(self.stepsTreeWidget) self.horizontalLayout_3 = QHBoxLayout() self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") self.stepDownBtn = QPushButton(self.stepsTab) self.stepDownBtn.setObjectName(u"stepDownBtn") self.horizontalLayout_3.addWidget(self.stepDownBtn) self.stepUpBtn = QPushButton(self.stepsTab) self.stepUpBtn.setObjectName(u"stepUpBtn") self.horizontalLayout_3.addWidget(self.stepUpBtn) self.removeStepBtn = QPushButton(self.stepsTab) self.removeStepBtn.setObjectName(u"removeStepBtn") self.horizontalLayout_3.addWidget(self.removeStepBtn) self.addStepBtn = QPushButton(self.stepsTab) self.addStepBtn.setObjectName(u"addStepBtn") self.horizontalLayout_3.addWidget(self.addStepBtn) self.runBtn = QPushButton(self.stepsTab) self.runBtn.setObjectName(u"runBtn") sizePolicy1 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Fixed) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.runBtn.sizePolicy().hasHeightForWidth()) self.runBtn.setSizePolicy(sizePolicy1) self.runBtn.setMinimumSize(QSize(0, 0)) font = QFont() font.setBold(False) self.runBtn.setFont(font) self.runBtn.setCheckable(False) self.runBtn.setFlat(False) self.horizontalLayout_3.addWidget(self.runBtn) self.verticalLayout_2.addLayout(self.horizontalLayout_3) self.opsTabs.addTab(self.stepsTab, "") self.optionsTab = QWidget() self.optionsTab.setObjectName(u"optionsTab") self.optionsTab.setAutoFillBackground(True) self.verticalLayout_17 = QVBoxLayout(self.optionsTab) self.verticalLayout_17.setObjectName(u"verticalLayout_17") self.stepOptionsTreeWidget = QTreeWidget(self.optionsTab) __qtreewidgetitem = QTreeWidgetItem() __qtreewidgetitem.setText(0, u"1") self.stepOptionsTreeWidget.setHeaderItem(__qtreewidgetitem) self.stepOptionsTreeWidget.setObjectName(u"stepOptionsTreeWidget") self.verticalLayout_17.addWidget(self.stepOptionsTreeWidget) self.opsTabs.addTab(self.optionsTab, "") self.templatesTab = QWidget() self.templatesTab.setObjectName(u"templatesTab") self.verticalLayout_19 = QVBoxLayout(self.templatesTab) self.verticalLayout_19.setObjectName(u"verticalLayout_19") self.treeWidget = QTreeWidget(self.templatesTab) __qtreewidgetitem1 = QTreeWidgetItem() __qtreewidgetitem1.setText(0, u"1") self.treeWidget.setHeaderItem(__qtreewidgetitem1) self.treeWidget.setObjectName(u"treeWidget") self.verticalLayout_19.addWidget(self.treeWidget) self.opsTabs.addTab(self.templatesTab, "") self.verticalLayout.addWidget(self.opsTabs) self.retranslateUi(Form) self.opsTabs.setCurrentIndex(0) QMetaObject.connectSlotsByName(Form)
def _on_tree_node_double_clicked(self, item: QtWidgets.QTreeWidgetItem, _): node: Optional[Node] = getattr(item, "node", None) if not item.isDisabled( ) and node is not None and node != self._actions[-1]: self._add_new_action(node)
def setupUi(self, Dialog): if not Dialog.objectName(): Dialog.setObjectName(u"Dialog") Dialog.resize(688, 530) Dialog.setMinimumSize(QSize(600, 0)) Dialog.setMaximumSize(QSize(1000000, 16777215)) self.verticalLayout = QVBoxLayout(Dialog) self.verticalLayout.setObjectName(u"verticalLayout") self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") self.verticalFrame = QFrame(Dialog) self.verticalFrame.setObjectName(u"verticalFrame") self.verticalFrame.setMaximumSize(QSize(250, 16777215)) self.verticalLayout_2 = QVBoxLayout(self.verticalFrame) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.label = QLabel(self.verticalFrame) self.label.setObjectName(u"label") self.verticalLayout_2.addWidget(self.label) self.treeWidget = QTreeWidget(self.verticalFrame) QTreeWidgetItem(self.treeWidget) QTreeWidgetItem(self.treeWidget) QTreeWidgetItem(self.treeWidget) self.treeWidget.setObjectName(u"treeWidget") font = QFont() font.setFamilies([u"Segoe UI"]) font.setPointSize(10) self.treeWidget.setFont(font) self.treeWidget.setFrameShape(QFrame.VLine) self.treeWidget.setFrameShadow(QFrame.Plain) self.treeWidget.setTabKeyNavigation(True) self.treeWidget.setAlternatingRowColors(False) self.verticalLayout_2.addWidget(self.treeWidget) self.horizontalLayout.addWidget(self.verticalFrame) self.line = QFrame(Dialog) self.line.setObjectName(u"line") self.line.setFrameShape(QFrame.VLine) self.line.setFrameShadow(QFrame.Sunken) self.horizontalLayout.addWidget(self.line) self.stackedWidget = QStackedWidget(Dialog) self.stackedWidget.setObjectName(u"stackedWidget") self.page = QWidget() self.page.setObjectName(u"page") self.verticalLayout_3 = QVBoxLayout(self.page) self.verticalLayout_3.setObjectName(u"verticalLayout_3") self.groupBox = QGroupBox(self.page) self.groupBox.setObjectName(u"groupBox") self.formLayout_4 = QFormLayout(self.groupBox) self.formLayout_4.setObjectName(u"formLayout_4") self.label_2 = QLabel(self.groupBox) self.label_2.setObjectName(u"label_2") self.formLayout_4.setWidget(0, QFormLayout.LabelRole, self.label_2) self.comboBox = QComboBox(self.groupBox) self.comboBox.addItem("") self.comboBox.addItem("") self.comboBox.addItem("") self.comboBox.setObjectName(u"comboBox") self.formLayout_4.setWidget(0, QFormLayout.FieldRole, self.comboBox) self.verticalLayout_3.addWidget(self.groupBox) self.groupBox_2 = QGroupBox(self.page) self.groupBox_2.setObjectName(u"groupBox_2") self.formLayout_3 = QFormLayout(self.groupBox_2) self.formLayout_3.setObjectName(u"formLayout_3") self.label_3 = QLabel(self.groupBox_2) self.label_3.setObjectName(u"label_3") self.formLayout_3.setWidget(1, QFormLayout.LabelRole, self.label_3) self.spinBox = QSpinBox(self.groupBox_2) self.spinBox.setObjectName(u"spinBox") self.spinBox.setValue(11) self.formLayout_3.setWidget(1, QFormLayout.FieldRole, self.spinBox) self.label_4 = QLabel(self.groupBox_2) self.label_4.setObjectName(u"label_4") self.formLayout_3.setWidget(0, QFormLayout.LabelRole, self.label_4) self.fontComboBox = QFontComboBox(self.groupBox_2) self.fontComboBox.setObjectName(u"fontComboBox") self.formLayout_3.setWidget(0, QFormLayout.FieldRole, self.fontComboBox) self.verticalLayout_3.addWidget(self.groupBox_2) self.stackedWidget.addWidget(self.page) self.page_2 = QWidget() self.page_2.setObjectName(u"page_2") self.verticalLayout_5 = QVBoxLayout(self.page_2) self.verticalLayout_5.setObjectName(u"verticalLayout_5") self.verticalLayout_4 = QVBoxLayout() self.verticalLayout_4.setObjectName(u"verticalLayout_4") self.verticalLayout_5.addLayout(self.verticalLayout_4) self.stackedWidget.addWidget(self.page_2) self.horizontalLayout.addWidget(self.stackedWidget) self.verticalLayout.addLayout(self.horizontalLayout) self.buttonBox = QDialogButtonBox(Dialog) self.buttonBox.setObjectName(u"buttonBox") self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Apply | QDialogButtonBox.Close | QDialogButtonBox.Save) self.verticalLayout.addWidget(self.buttonBox) self.retranslateUi(Dialog) self.buttonBox.accepted.connect(Dialog.accept) self.buttonBox.rejected.connect(Dialog.reject) self.stackedWidget.setCurrentIndex(0) QMetaObject.connectSlotsByName(Dialog)
def new_item(parent, text, val=None): child = QTreeWidgetItem([text]) self.fill_item(child, val) parent.addChild(child)
import sys from PySide6.QtWidgets import QApplication, QTreeWidget, QTreeWidgetItem data = { "Project A": ["file_a.py", "file_a.txt", "something.xls"], "Project B": ["file_b.csv", "photo.jpg"], "Project C": [] } app = QApplication() tree = QTreeWidget() tree.setColumnCount(3) tree.setHeaderLabels(["Name", "Type", "Comment"]) items = [] for key, values in data.items(): item = QTreeWidgetItem([key]) for value in values: ext = value.split(".")[-1].upper() child = QTreeWidgetItem([value, ext, "XXX"]) item.addChild(child) items.append(item) tree.insertTopLevelItems(0, items) tree.show() sys.exit(app.exec_())
def setupUi(self, Form): if not Form.objectName(): Form.setObjectName(u"Form") Form.resize(403, 803) self.verticalLayout = QVBoxLayout(Form) self.verticalLayout.setObjectName(u"verticalLayout") self.viewTabs = QTabWidget(Form) self.viewTabs.setObjectName(u"viewTabs") self.viewTabs.setDocumentMode(False) self.viewTabs.setMovable(True) self.demoView = QWidget() self.demoView.setObjectName(u"demoView") self.verticalLayout_9 = QVBoxLayout(self.demoView) self.verticalLayout_9.setObjectName(u"verticalLayout_9") self.demoViewGroupBox = QGroupBox(self.demoView) self.demoViewGroupBox.setObjectName(u"demoViewGroupBox") self.demoViewGroupBox.setFlat(True) self.verticalLayout_6 = QVBoxLayout(self.demoViewGroupBox) self.verticalLayout_6.setObjectName(u"verticalLayout_6") self.verticalLayout_6.setContentsMargins(4, 4, 4, 4) self.demoTreeView = QTreeWidget(self.demoViewGroupBox) __qtreewidgetitem = QTreeWidgetItem() __qtreewidgetitem.setText(0, u"Step") self.demoTreeView.setHeaderItem(__qtreewidgetitem) self.demoTreeView.setObjectName(u"demoTreeView") self.verticalLayout_6.addWidget(self.demoTreeView) self.horizontalLayout_5 = QHBoxLayout() self.horizontalLayout_5.setObjectName(u"horizontalLayout_5") self.demoDuplicateBtn = QPushButton(self.demoViewGroupBox) self.demoDuplicateBtn.setObjectName(u"demoDuplicateBtn") self.horizontalLayout_5.addWidget(self.demoDuplicateBtn) self.demoInsertSectionBtn = QPushButton(self.demoViewGroupBox) self.demoInsertSectionBtn.setObjectName(u"demoInsertSectionBtn") self.horizontalLayout_5.addWidget(self.demoInsertSectionBtn) self.demoDeleteBtn = QPushButton(self.demoViewGroupBox) self.demoDeleteBtn.setObjectName(u"demoDeleteBtn") self.horizontalLayout_5.addWidget(self.demoDeleteBtn) self.demoAddStepBtn = QPushButton(self.demoViewGroupBox) self.demoAddStepBtn.setObjectName(u"demoAddStepBtn") self.horizontalLayout_5.addWidget(self.demoAddStepBtn) self.demoOverflowBtn = QToolButton(self.demoViewGroupBox) self.demoOverflowBtn.setObjectName(u"demoOverflowBtn") self.horizontalLayout_5.addWidget(self.demoOverflowBtn) self.verticalLayout_6.addLayout(self.horizontalLayout_5) self.verticalLayout_9.addWidget(self.demoViewGroupBox) self.dataFrame = QGroupBox(self.demoView) self.dataFrame.setObjectName(u"dataFrame") self.dataFrame.setMaximumSize(QSize(16777215, 300)) self.dataFrame.setFlat(True) self.dataFrame.setCheckable(False) self.verticalLayout_8 = QVBoxLayout(self.dataFrame) self.verticalLayout_8.setObjectName(u"verticalLayout_8") self.verticalLayout_8.setContentsMargins(4, 4, 4, 4) self.dataStack = QStackedWidget(self.dataFrame) self.dataStack.setObjectName(u"dataStack") self.stepDataL = QWidget() self.stepDataL.setObjectName(u"stepDataL") self.verticalLayout_14 = QVBoxLayout(self.stepDataL) self.verticalLayout_14.setObjectName(u"verticalLayout_14") self.metadataTreeWidget = QTreeWidget(self.stepDataL) self.metadataTreeWidget.setObjectName(u"metadataTreeWidget") self.verticalLayout_14.addWidget(self.metadataTreeWidget) self.stepDataBtnL = QHBoxLayout() self.stepDataBtnL.setObjectName(u"stepDataBtnL") self.pushButton_2 = QPushButton(self.stepDataL) self.pushButton_2.setObjectName(u"pushButton_2") self.stepDataBtnL.addWidget(self.pushButton_2) self.pushButton = QPushButton(self.stepDataL) self.pushButton.setObjectName(u"pushButton") self.stepDataBtnL.addWidget(self.pushButton) self.toolButton = QToolButton(self.stepDataL) self.toolButton.setObjectName(u"toolButton") self.stepDataBtnL.addWidget(self.toolButton) self.verticalLayout_14.addLayout(self.stepDataBtnL) self.dataStack.addWidget(self.stepDataL) self.sectDataL = QWidget() self.sectDataL.setObjectName(u"sectDataL") self.verticalLayout_16 = QVBoxLayout(self.sectDataL) self.verticalLayout_16.setObjectName(u"verticalLayout_16") self.sectionDataTreeW = QTreeWidget(self.sectDataL) self.sectionDataTreeW.setObjectName(u"sectionDataTreeW") self.verticalLayout_16.addWidget(self.sectionDataTreeW) self.sectionDataBtnL = QHBoxLayout() self.sectionDataBtnL.setObjectName(u"sectionDataBtnL") self.pushButton_4 = QPushButton(self.sectDataL) self.pushButton_4.setObjectName(u"pushButton_4") self.sectionDataBtnL.addWidget(self.pushButton_4) self.pushButton_3 = QPushButton(self.sectDataL) self.pushButton_3.setObjectName(u"pushButton_3") self.sectionDataBtnL.addWidget(self.pushButton_3) self.pushButton_5 = QPushButton(self.sectDataL) self.pushButton_5.setObjectName(u"pushButton_5") self.sectionDataBtnL.addWidget(self.pushButton_5) self.toolButton_2 = QToolButton(self.sectDataL) self.toolButton_2.setObjectName(u"toolButton_2") self.sectionDataBtnL.addWidget(self.toolButton_2) self.verticalLayout_16.addLayout(self.sectionDataBtnL) self.dataStack.addWidget(self.sectDataL) self.verticalLayout_8.addWidget(self.dataStack) self.verticalLayout_9.addWidget(self.dataFrame) self.viewTabs.addTab(self.demoView, "") self.objectViewTabWPage2_2 = QWidget() self.objectViewTabWPage2_2.setObjectName(u"objectViewTabWPage2_2") self.viewTabs.addTab(self.objectViewTabWPage2_2, "") self.verticalLayout.addWidget(self.viewTabs) self.retranslateUi(Form) self.viewTabs.setCurrentIndex(0) self.dataStack.setCurrentIndex(0) QMetaObject.connectSlotsByName(Form)
def setupUi(self, ProjectSettings_UI): if not ProjectSettings_UI.objectName(): ProjectSettings_UI.setObjectName(u"ProjectSettings_UI") ProjectSettings_UI.resize(575, 685) self.gridLayout_3 = QGridLayout(ProjectSettings_UI) self.gridLayout_3.setObjectName(u"gridLayout_3") self.buttonBox = QDialogButtonBox(ProjectSettings_UI) self.buttonBox.setObjectName(u"buttonBox") self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok) self.gridLayout_3.addWidget(self.buttonBox, 2, 0, 1, 1) self.tabWidget = QTabWidget(ProjectSettings_UI) self.tabWidget.setObjectName(u"tabWidget") self.tabWidget.setDocumentMode(True) self.tab = QWidget() self.tab.setObjectName(u"tab") self.gridLayout = QGridLayout(self.tab) self.gridLayout.setObjectName(u"gridLayout") self.previewparams = QPlainTextEdit(self.tab) self.previewparams.setObjectName(u"previewparams") sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Maximum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.previewparams.sizePolicy().hasHeightForWidth()) self.previewparams.setSizePolicy(sizePolicy) self.previewparams.setReadOnly(True) self.gridLayout.addWidget(self.previewparams, 7, 0, 1, 4) self.label_2 = QLabel(self.tab) self.label_2.setObjectName(u"label_2") self.gridLayout.addWidget(self.label_2, 5, 0, 1, 1) self.audio_thumbs = QCheckBox(self.tab) self.audio_thumbs.setObjectName(u"audio_thumbs") self.gridLayout.addWidget(self.audio_thumbs, 5, 2, 1, 1) self.horizontalLayout_2 = QHBoxLayout() self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.label_7 = QLabel(self.tab) self.label_7.setObjectName(u"label_7") self.horizontalLayout_2.addWidget(self.label_7) self.video_tracks = QSpinBox(self.tab) self.video_tracks.setObjectName(u"video_tracks") self.horizontalLayout_2.addWidget(self.video_tracks) self.label_8 = QLabel(self.tab) self.label_8.setObjectName(u"label_8") self.horizontalLayout_2.addWidget(self.label_8) self.audio_tracks = QSpinBox(self.tab) self.audio_tracks.setObjectName(u"audio_tracks") self.horizontalLayout_2.addWidget(self.audio_tracks) self.label = QLabel(self.tab) self.label.setObjectName(u"label") self.horizontalLayout_2.addWidget(self.label) self.audio_channels = QComboBox(self.tab) self.audio_channels.addItem("") self.audio_channels.addItem("") self.audio_channels.addItem("") self.audio_channels.setObjectName(u"audio_channels") sizePolicy1 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Fixed) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.audio_channels.sizePolicy().hasHeightForWidth()) self.audio_channels.setSizePolicy(sizePolicy1) self.horizontalLayout_2.addWidget(self.audio_channels) self.gridLayout.addLayout(self.horizontalLayout_2, 4, 0, 1, 4) self.horizontalSpacer = QSpacerItem(229, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.gridLayout.addItem(self.horizontalSpacer, 5, 3, 1, 1) self.profile_box = QGroupBox(self.tab) self.profile_box.setObjectName(u"profile_box") sizePolicy2 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.MinimumExpanding) sizePolicy2.setHorizontalStretch(0) sizePolicy2.setVerticalStretch(0) sizePolicy2.setHeightForWidth( self.profile_box.sizePolicy().hasHeightForWidth()) self.profile_box.setSizePolicy(sizePolicy2) self.profile_box.setFlat(True) self.gridLayout.addWidget(self.profile_box, 3, 0, 1, 4) self.label_4 = QLabel(self.tab) self.label_4.setObjectName(u"label_4") self.gridLayout.addWidget(self.label_4, 0, 0, 1, 4) self.video_thumbs = QCheckBox(self.tab) self.video_thumbs.setObjectName(u"video_thumbs") self.gridLayout.addWidget(self.video_thumbs, 5, 1, 1, 1) self.horizontalLayout_4 = QHBoxLayout() self.horizontalLayout_4.setObjectName(u"horizontalLayout_4") self.label_25 = QLabel(self.tab) self.label_25.setObjectName(u"label_25") sizePolicy3 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Preferred) sizePolicy3.setHorizontalStretch(0) sizePolicy3.setVerticalStretch(0) sizePolicy3.setHeightForWidth( self.label_25.sizePolicy().hasHeightForWidth()) self.label_25.setSizePolicy(sizePolicy3) self.horizontalLayout_4.addWidget(self.label_25) self.preview_profile = KComboBox(self.tab) self.preview_profile.setObjectName(u"preview_profile") sizePolicy1.setHeightForWidth( self.preview_profile.sizePolicy().hasHeightForWidth()) self.preview_profile.setSizePolicy(sizePolicy1) self.horizontalLayout_4.addWidget(self.preview_profile) self.preview_showprofileinfo = QToolButton(self.tab) self.preview_showprofileinfo.setObjectName(u"preview_showprofileinfo") self.preview_showprofileinfo.setCheckable(True) self.horizontalLayout_4.addWidget(self.preview_showprofileinfo) self.preview_manageprofile = QToolButton(self.tab) self.preview_manageprofile.setObjectName(u"preview_manageprofile") self.horizontalLayout_4.addWidget(self.preview_manageprofile) self.gridLayout.addLayout(self.horizontalLayout_4, 6, 0, 1, 4) self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") self.custom_folder = QCheckBox(self.tab) self.custom_folder.setObjectName(u"custom_folder") self.horizontalLayout.addWidget(self.custom_folder) self.project_folder = KUrlRequester(self.tab) self.project_folder.setObjectName(u"project_folder") self.project_folder.setEnabled(False) self.horizontalLayout.addWidget(self.project_folder) self.gridLayout.addLayout(self.horizontalLayout, 1, 0, 1, 4) self.same_folder = QCheckBox(self.tab) self.same_folder.setObjectName(u"same_folder") self.gridLayout.addWidget(self.same_folder, 2, 0, 1, 4) self.tabWidget.addTab(self.tab, "") self.label_4.raise_() self.profile_box.raise_() self.label_2.raise_() self.video_thumbs.raise_() self.audio_thumbs.raise_() self.previewparams.raise_() self.same_folder.raise_() self.tab_4 = QWidget() self.tab_4.setObjectName(u"tab_4") self.verticalLayout = QVBoxLayout(self.tab_4) self.verticalLayout.setObjectName(u"verticalLayout") self.enable_proxy = QCheckBox(self.tab_4) self.enable_proxy.setObjectName(u"enable_proxy") self.verticalLayout.addWidget(self.enable_proxy) self.proxy_box = QGroupBox(self.tab_4) self.proxy_box.setObjectName(u"proxy_box") self.proxy_box.setEnabled(False) self.proxy_box.setFlat(True) self.proxy_box.setCheckable(False) self.proxy_box.setChecked(False) self.gridLayout_2 = QGridLayout(self.proxy_box) self.gridLayout_2.setObjectName(u"gridLayout_2") self.gridLayout_2.setHorizontalSpacing(6) self.gridLayout_2.setContentsMargins(0, 0, 0, 0) self.l_relPathProxyToOrig = QLabel(self.proxy_box) self.l_relPathProxyToOrig.setObjectName(u"l_relPathProxyToOrig") self.gridLayout_2.addWidget(self.l_relPathProxyToOrig, 10, 1, 1, 1) self.generate_imageproxy = QCheckBox(self.proxy_box) self.generate_imageproxy.setObjectName(u"generate_imageproxy") self.gridLayout_2.addWidget(self.generate_imageproxy, 3, 0, 1, 2) self.l_prefix_proxy = QLabel(self.proxy_box) self.l_prefix_proxy.setObjectName(u"l_prefix_proxy") self.gridLayout_2.addWidget(self.l_prefix_proxy, 11, 1, 1, 1) self.proxy_imagesize = QSpinBox(self.proxy_box) self.proxy_imagesize.setObjectName(u"proxy_imagesize") self.proxy_imagesize.setEnabled(False) self.proxy_imagesize.setMinimum(200) self.proxy_imagesize.setMaximum(100000) self.proxy_imagesize.setValue(800) self.gridLayout_2.addWidget(self.proxy_imagesize, 4, 2, 1, 4) self.label_24 = QLabel(self.proxy_box) self.label_24.setObjectName(u"label_24") sizePolicy3.setHeightForWidth( self.label_24.sizePolicy().hasHeightForWidth()) self.label_24.setSizePolicy(sizePolicy3) self.gridLayout_2.addWidget(self.label_24, 1, 0, 1, 1) self.proxy_minsize = QSpinBox(self.proxy_box) self.proxy_minsize.setObjectName(u"proxy_minsize") self.proxy_minsize.setMaximum(10000) self.proxy_minsize.setValue(1000) self.gridLayout_2.addWidget(self.proxy_minsize, 0, 2, 1, 4) self.l_prefix_clip = QLabel(self.proxy_box) self.l_prefix_clip.setObjectName(u"l_prefix_clip") self.gridLayout_2.addWidget(self.l_prefix_clip, 8, 1, 1, 1) self.proxy_profile = KComboBox(self.proxy_box) self.proxy_profile.setObjectName(u"proxy_profile") sizePolicy1.setHeightForWidth( self.proxy_profile.sizePolicy().hasHeightForWidth()) self.proxy_profile.setSizePolicy(sizePolicy1) self.gridLayout_2.addWidget(self.proxy_profile, 1, 1, 1, 2) self.proxy_showprofileinfo = QToolButton(self.proxy_box) self.proxy_showprofileinfo.setObjectName(u"proxy_showprofileinfo") self.proxy_showprofileinfo.setCheckable(True) self.gridLayout_2.addWidget(self.proxy_showprofileinfo, 1, 4, 1, 1) self.generate_proxy = QCheckBox(self.proxy_box) self.generate_proxy.setObjectName(u"generate_proxy") self.gridLayout_2.addWidget(self.generate_proxy, 0, 0, 1, 2) self.proxyparams = QPlainTextEdit(self.proxy_box) self.proxyparams.setObjectName(u"proxyparams") sizePolicy.setHeightForWidth( self.proxyparams.sizePolicy().hasHeightForWidth()) self.proxyparams.setSizePolicy(sizePolicy) self.proxyparams.setReadOnly(True) self.gridLayout_2.addWidget(self.proxyparams, 2, 0, 1, 6) self.image_label = QLabel(self.proxy_box) self.image_label.setObjectName(u"image_label") self.image_label.setEnabled(False) self.gridLayout_2.addWidget(self.image_label, 4, 0, 1, 2) self.le_relPathProxyToOrig = QLineEdit(self.proxy_box) self.le_relPathProxyToOrig.setObjectName(u"le_relPathProxyToOrig") self.le_relPathProxyToOrig.setEnabled(False) self.gridLayout_2.addWidget(self.le_relPathProxyToOrig, 10, 3, 1, 1) self.le_prefix_proxy = QLineEdit(self.proxy_box) self.le_prefix_proxy.setObjectName(u"le_prefix_proxy") self.le_prefix_proxy.setEnabled(False) self.gridLayout_2.addWidget(self.le_prefix_proxy, 11, 3, 1, 1) self.l_suffix_proxy = QLabel(self.proxy_box) self.l_suffix_proxy.setObjectName(u"l_suffix_proxy") self.gridLayout_2.addWidget(self.l_suffix_proxy, 12, 1, 1, 1) self.le_prefix_clip = QLineEdit(self.proxy_box) self.le_prefix_clip.setObjectName(u"le_prefix_clip") self.le_prefix_clip.setEnabled(False) self.gridLayout_2.addWidget(self.le_prefix_clip, 8, 3, 1, 1) self.le_suffix_proxy = QLineEdit(self.proxy_box) self.le_suffix_proxy.setObjectName(u"le_suffix_proxy") self.le_suffix_proxy.setEnabled(False) self.gridLayout_2.addWidget(self.le_suffix_proxy, 12, 3, 1, 1) self.proxy_imageminsize = QSpinBox(self.proxy_box) self.proxy_imageminsize.setObjectName(u"proxy_imageminsize") self.proxy_imageminsize.setMinimum(500) self.proxy_imageminsize.setMaximum(100000) self.proxy_imageminsize.setValue(2000) self.gridLayout_2.addWidget(self.proxy_imageminsize, 3, 2, 1, 4) self.l_suffix_clip = QLabel(self.proxy_box) self.l_suffix_clip.setObjectName(u"l_suffix_clip") self.gridLayout_2.addWidget(self.l_suffix_clip, 9, 1, 1, 1) self.l_relPathOrigToProxy = QLabel(self.proxy_box) self.l_relPathOrigToProxy.setObjectName(u"l_relPathOrigToProxy") self.gridLayout_2.addWidget(self.l_relPathOrigToProxy, 7, 1, 1, 1) self.le_relPathOrigToProxy = QLineEdit(self.proxy_box) self.le_relPathOrigToProxy.setObjectName(u"le_relPathOrigToProxy") self.le_relPathOrigToProxy.setEnabled(False) self.gridLayout_2.addWidget(self.le_relPathOrigToProxy, 7, 3, 1, 1) self.external_proxy_profile = QComboBox(self.proxy_box) self.external_proxy_profile.setObjectName(u"external_proxy_profile") self.gridLayout_2.addWidget(self.external_proxy_profile, 6, 1, 1, 5) self.proxy_resize = QSpinBox(self.proxy_box) self.proxy_resize.setObjectName(u"proxy_resize") self.proxy_resize.setMinimum(200) self.proxy_resize.setMaximum(100000) self.gridLayout_2.addWidget(self.proxy_resize, 5, 2, 1, 4) self.le_suffix_clip = QLineEdit(self.proxy_box) self.le_suffix_clip.setObjectName(u"le_suffix_clip") self.le_suffix_clip.setEnabled(False) self.gridLayout_2.addWidget(self.le_suffix_clip, 9, 3, 1, 1) self.external_proxy = QCheckBox(self.proxy_box) self.external_proxy.setObjectName(u"external_proxy") self.gridLayout_2.addWidget(self.external_proxy, 6, 0, 1, 1) self.checkProxy = QToolButton(self.proxy_box) self.checkProxy.setObjectName(u"checkProxy") self.gridLayout_2.addWidget(self.checkProxy, 1, 3, 1, 1) self.label_3 = QLabel(self.proxy_box) self.label_3.setObjectName(u"label_3") self.gridLayout_2.addWidget(self.label_3, 5, 0, 1, 1) self.proxy_manageprofile = QToolButton(self.proxy_box) self.proxy_manageprofile.setObjectName(u"proxy_manageprofile") self.gridLayout_2.addWidget(self.proxy_manageprofile, 1, 5, 1, 1) self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) self.gridLayout_2.addItem(self.verticalSpacer, 13, 1, 1, 1) self.verticalLayout.addWidget(self.proxy_box) self.tabWidget.addTab(self.tab_4, "") self.tab_3 = QWidget() self.tab_3.setObjectName(u"tab_3") self.gridLayout_6 = QGridLayout(self.tab_3) self.gridLayout_6.setObjectName(u"gridLayout_6") self.metadata_list = QTreeWidget(self.tab_3) self.metadata_list.setObjectName(u"metadata_list") self.metadata_list.setAlternatingRowColors(True) self.metadata_list.setRootIsDecorated(False) self.metadata_list.setAllColumnsShowFocus(True) self.metadata_list.setColumnCount(2) self.metadata_list.header().setVisible(False) self.gridLayout_6.addWidget(self.metadata_list, 0, 0, 1, 1) self.horizontalLayout_3 = QHBoxLayout() self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") self.add_metadata = QToolButton(self.tab_3) self.add_metadata.setObjectName(u"add_metadata") self.horizontalLayout_3.addWidget(self.add_metadata) self.delete_metadata = QToolButton(self.tab_3) self.delete_metadata.setObjectName(u"delete_metadata") self.horizontalLayout_3.addWidget(self.delete_metadata) self.horizontalSpacer_3 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout_3.addItem(self.horizontalSpacer_3) self.gridLayout_6.addLayout(self.horizontalLayout_3, 1, 0, 1, 1) self.tabWidget.addTab(self.tab_3, "") self.tab_2 = QWidget() self.tab_2.setObjectName(u"tab_2") self.gridLayout_4 = QGridLayout(self.tab_2) self.gridLayout_4.setObjectName(u"gridLayout_4") self.fonts_list = QListWidget(self.tab_2) self.fonts_list.setObjectName(u"fonts_list") self.fonts_list.setAlternatingRowColors(True) self.gridLayout_4.addWidget(self.fonts_list, 5, 0, 1, 5) self.files_list = QTreeWidget(self.tab_2) __qtreewidgetitem = QTreeWidgetItem() __qtreewidgetitem.setText(0, u"1") self.files_list.setHeaderItem(__qtreewidgetitem) self.files_list.setObjectName(u"files_list") self.files_list.setAlternatingRowColors(True) self.files_list.setRootIsDecorated(False) self.files_list.setItemsExpandable(False) self.files_list.setHeaderHidden(True) self.files_list.setExpandsOnDoubleClick(False) self.gridLayout_4.addWidget(self.files_list, 3, 0, 1, 5) self.label_12 = QLabel(self.tab_2) self.label_12.setObjectName(u"label_12") self.gridLayout_4.addWidget(self.label_12, 0, 0, 1, 2) self.used_count = QLabel(self.tab_2) self.used_count.setObjectName(u"used_count") self.gridLayout_4.addWidget(self.used_count, 0, 2, 1, 1) self.used_size = QLabel(self.tab_2) self.used_size.setObjectName(u"used_size") self.gridLayout_4.addWidget(self.used_size, 0, 3, 1, 1) self.label_6 = QLabel(self.tab_2) self.label_6.setObjectName(u"label_6") self.gridLayout_4.addWidget(self.label_6, 1, 0, 1, 1) self.unused_count = QLabel(self.tab_2) self.unused_count.setObjectName(u"unused_count") self.gridLayout_4.addWidget(self.unused_count, 1, 2, 1, 1) self.unused_size = QLabel(self.tab_2) self.unused_size.setObjectName(u"unused_size") self.gridLayout_4.addWidget(self.unused_size, 1, 3, 1, 1) self.delete_unused = QPushButton(self.tab_2) self.delete_unused.setObjectName(u"delete_unused") self.gridLayout_4.addWidget(self.delete_unused, 1, 4, 1, 1) self.list_search = KTreeWidgetSearchLine(self.tab_2) self.list_search.setObjectName(u"list_search") self.gridLayout_4.addWidget(self.list_search, 2, 3, 1, 2) self.label_13 = QLabel(self.tab_2) self.label_13.setObjectName(u"label_13") self.gridLayout_4.addWidget(self.label_13, 2, 0, 1, 1) self.label_fonts = QLabel(self.tab_2) self.label_fonts.setObjectName(u"label_fonts") self.gridLayout_4.addWidget(self.label_fonts, 4, 0, 1, 1) self.button_export = QPushButton(self.tab_2) self.button_export.setObjectName(u"button_export") self.gridLayout_4.addWidget(self.button_export, 6, 0, 1, 2) self.files_count = QLabel(self.tab_2) self.files_count.setObjectName(u"files_count") self.gridLayout_4.addWidget(self.files_count, 2, 2, 1, 1) self.tabWidget.addTab(self.tab_2, "") self.gridLayout_3.addWidget(self.tabWidget, 0, 0, 1, 1) self.retranslateUi(ProjectSettings_UI) self.buttonBox.accepted.connect(ProjectSettings_UI.accept) self.buttonBox.rejected.connect(ProjectSettings_UI.reject) self.custom_folder.toggled.connect(self.project_folder.setEnabled) self.enable_proxy.toggled.connect(self.proxy_box.setEnabled) self.external_proxy.toggled.connect( self.external_proxy_profile.setEnabled) self.tabWidget.setCurrentIndex(0) QMetaObject.connectSlotsByName(ProjectSettings_UI)
def preset_for_item( self, item: QtWidgets.QTreeWidgetItem) -> Optional[VersionedPreset]: return self.window_manager.preset_manager.preset_for_uuid( item.data(0, Qt.UserRole))