def test_list(widget, *_): alignments = [AlignLeft, AlignRight, AlignHCenter] child = QtWidgets.QListWidget(widget) for index in range(10): item = QtWidgets.QListWidgetItem(f'Item {index + 1}') item.setTextAlignment(random.choice(alignments)) child.addItem(item) icon = QtGui.QIcon(':/dark/close.svg') for index in range(10): item = QtWidgets.QListWidgetItem(icon, f'Item {index + 1}') item.setTextAlignment(random.choice(alignments)) child.addItem(item) return child
def test_scrollbar_vertical(widget, *_): child = QtWidgets.QListWidget(widget) for index in range(100): child.addItem(QtWidgets.QListWidgetItem(f'Item {index + 1}')) return child
def setup(self, MainWindow): MainWindow.setObjectName('MainWindow') MainWindow.resize(1068, 824) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName('centralwidget') self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.centralwidget) self.verticalLayout_5.setObjectName('verticalLayout_5') self.tabWidget = QtWidgets.QTabWidget(self.centralwidget) self.tabWidget.setTabPosition(East) self.tabWidget.setTabsClosable(True) self.tabWidget.setObjectName('tabWidget') self.tab = QtWidgets.QWidget() self.tab.setObjectName('tab') self.gridLayout = QtWidgets.QGridLayout(self.tab) self.gridLayout.setObjectName('gridLayout') self.groupBox = QtWidgets.QGroupBox(self.tab) self.groupBox.setObjectName('groupBox') self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.groupBox) self.verticalLayout_3.setObjectName('verticalLayout_3') self.toolBox = QtWidgets.QToolBox(self.groupBox) self.toolBox.setObjectName('toolBox') self.page = QtWidgets.QWidget() self.page.setGeometry(QtCore.QRect(0, 0, 718, 227)) self.page.setObjectName('page') self.gridLayout_4 = QtWidgets.QGridLayout(self.page) self.gridLayout_4.setObjectName('gridLayout_4') self.lineEdit = QtWidgets.QLineEdit(self.page) self.lineEdit.setObjectName('lineEdit') self.gridLayout_4.addWidget(self.lineEdit, 0, 0, 1, 1) self.toolBox.addItem(self.page, '') self.page_2 = QtWidgets.QWidget() self.page_2.setGeometry(QtCore.QRect(0, 0, 718, 227)) self.page_2.setObjectName('page_2') self.gridLayout_5 = QtWidgets.QGridLayout(self.page_2) self.gridLayout_5.setObjectName('gridLayout_5') self.listWidget = QtWidgets.QListWidget(self.page_2) self.listWidget.setObjectName('listWidget') item = QtWidgets.QListWidgetItem() self.listWidget.addItem(item) item = QtWidgets.QListWidgetItem() self.listWidget.addItem(item) item = QtWidgets.QListWidgetItem() self.listWidget.addItem(item) item = QtWidgets.QListWidgetItem() self.listWidget.addItem(item) item = QtWidgets.QListWidgetItem() self.listWidget.addItem(item) item = QtWidgets.QListWidgetItem() self.listWidget.addItem(item) item = QtWidgets.QListWidgetItem() self.listWidget.addItem(item) item = QtWidgets.QListWidgetItem() self.listWidget.addItem(item) self.gridLayout_5.addWidget(self.listWidget, 0, 0, 1, 1) self.toolBox.addItem(self.page_2, '') self.verticalLayout_3.addWidget(self.toolBox) self.gridLayout.addWidget(self.groupBox, 1, 0, 1, 1) self.tabWidget_2 = QtWidgets.QTabWidget(self.tab) self.tabWidget_2.setObjectName('tabWidget_2') self.tab_3 = QtWidgets.QWidget() self.tab_3.setObjectName('tab_3') self.gridLayout_6 = QtWidgets.QGridLayout(self.tab_3) self.gridLayout_6.setObjectName('gridLayout_6') self.checkableButton = QtWidgets.QPushButton(self.tab_3) self.checkableButton.setCheckable(True) self.checkableButton.setChecked(True) self.checkableButton.setObjectName('checkableButton') self.gridLayout_6.addWidget(self.checkableButton, 1, 0, 1, 1) self.pushButton = QtWidgets.QPushButton(self.tab_3) self.pushButton.setObjectName('pushButton') self.pushButton.setToolTip('Sample Tooltip1') self.gridLayout_6.addWidget(self.pushButton, 0, 0, 1, 1) self.pushButton_5 = QtWidgets.QPushButton(self.tab_3) self.pushButton_5.setObjectName('pushButton_5') self.gridLayout_6.addWidget(self.pushButton_5, 2, 0, 1, 1) self.tabWidget_2.addTab(self.tab_3, '') self.tab_5 = QtWidgets.QWidget() self.tab_5.setObjectName('tab_5') self.gridLayout_7 = QtWidgets.QGridLayout(self.tab_5) self.gridLayout_7.setObjectName('gridLayout_7') self.tableWidget = QtWidgets.QTableWidget(self.tab_5) self.tableWidget.setObjectName('tableWidget') self.tableWidget.setColumnCount(2) self.tableWidget.setRowCount(4) item = QtWidgets.QTableWidgetItem() self.tableWidget.setVerticalHeaderItem(0, item) item = QtWidgets.QTableWidgetItem() self.tableWidget.setVerticalHeaderItem(1, item) item = QtWidgets.QTableWidgetItem() self.tableWidget.setVerticalHeaderItem(2, item) item = QtWidgets.QTableWidgetItem() self.tableWidget.setVerticalHeaderItem(3, item) item = QtWidgets.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(0, item) item = QtWidgets.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(1, item) self.gridLayout_7.addWidget(self.tableWidget, 0, 0, 1, 1) self.tabWidget_2.addTab(self.tab_5, '') self.tab_4 = QtWidgets.QWidget() self.tab_4.setObjectName('tab_4') self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.tab_4) self.calendar = QtWidgets.QCalendarWidget(self.tab_4) self.calendar.setGridVisible(True) self.verticalLayout_6.addWidget(self.calendar) self.tabWidget_2.addTab(self.tab_4, '') self.tab_5v2 = QtWidgets.QWidget() self.tab_5v2.setObjectName('tab_5v2') self.verticalLayout_7 = QtWidgets.QVBoxLayout(self.tab_5v2) self.tableWidget_2 = QtWidgets.QTableWidget(self.tab_5v2) self.tableWidget_2.setColumnCount(100) self.tableWidget_2.setRowCount(1) item = QtWidgets.QTableWidgetItem(f'Row 1') self.tableWidget_2.setVerticalHeaderItem(0, item) for index in range(100): item = QtWidgets.QTableWidgetItem(f'Column {index + 1}') self.tableWidget_2.setHorizontalHeaderItem(index, item) self.verticalLayout_7.addWidget(self.tableWidget_2) self.tabWidget_2.addTab(self.tab_5v2, '') self.tab_6v2 = QtWidgets.QWidget() self.tab_6v2.setObjectName('tab_6v2') self.verticalLayout_8 = QtWidgets.QVBoxLayout(self.tab_6v2) splitter = QtWidgets.QSplitter(self.tab_6v2) splitter.addWidget(QtWidgets.QListWidget(self.tab_6v2)) tree = QtWidgets.QTreeWidget(self.tab_6v2) item_12 = QtWidgets.QTreeWidgetItem(tree, ['Row 1']) splitter.addWidget(tree) splitter.addWidget(QtWidgets.QTextEdit(self.tab_6v2)) self.verticalLayout_8.addWidget(splitter) self.tabWidget_2.addTab(self.tab_6v2, '') self.gridLayout.addWidget(self.tabWidget_2, 0, 0, 1, 1) self.tabWidget.addTab(self.tab, '') self.tab_2 = QtWidgets.QWidget() self.tab_2.setObjectName('tab_2') self.gridLayout_2 = QtWidgets.QGridLayout(self.tab_2) self.gridLayout_2.setObjectName('gridLayout_2') self.groupBox_2 = QtWidgets.QGroupBox(self.tab_2) self.groupBox_2.setObjectName('groupBox_2') self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.groupBox_2) self.verticalLayout_4.setObjectName('verticalLayout_4') self.label = QtWidgets.QLabel(self.groupBox_2) self.label.setObjectName('label') self.verticalLayout_4.addWidget(self.label) self.radioButton = QtWidgets.QRadioButton(self.groupBox_2) self.radioButton.setObjectName('radioButton') self.verticalLayout_4.addWidget(self.radioButton) self.checkBox = QtWidgets.QCheckBox(self.groupBox_2) self.checkBox.setObjectName('checkBox') self.verticalLayout_4.addWidget(self.checkBox) self.checkBox_2 = QtWidgets.QCheckBox(self.groupBox_2) self.checkBox_2.setTristate(True) self.checkBox_2.setObjectName('checkBox_2') self.verticalLayout_4.addWidget(self.checkBox_2) self.checkBox_3 = QtWidgets.QCheckBox(self.groupBox_2) self.checkBox_3.setEnabled(False) self.checkBox_3.setObjectName('checkBox_3') self.verticalLayout_4.addWidget(self.checkBox_3) self.treeWidget = QtWidgets.QTreeWidget(self.groupBox_2) self.treeWidget.setObjectName('treeWidget') item_0 = QtWidgets.QTreeWidgetItem(self.treeWidget) item_1 = QtWidgets.QTreeWidgetItem(self.treeWidget) item_2 = QtWidgets.QTreeWidgetItem(item_1) item_2.setText(0, 'subitem') item_3 = QtWidgets.QTreeWidgetItem(item_2, ['Row 2.1']) item_3.setFlags(item_3.flags() | ItemIsUserCheckable) item_3.setCheckState(0, Unchecked) item_4 = QtWidgets.QTreeWidgetItem(item_2, ['Row 2.2']) item_5 = QtWidgets.QTreeWidgetItem(item_4, ['Row 2.2.1']) item_6 = QtWidgets.QTreeWidgetItem(item_5, ['Row 2.2.1.1']) item_7 = QtWidgets.QTreeWidgetItem(item_5, ['Row 2.2.1.2']) item_3.setFlags(item_7.flags() | ItemIsUserCheckable) item_7.setCheckState(0, Checked) item_8 = QtWidgets.QTreeWidgetItem(item_2, ['Row 2.3']) item_8.setFlags(item_8.flags() | ItemIsUserTristate) item_8.setCheckState(0, PartiallyChecked) item_9 = QtWidgets.QTreeWidgetItem(self.treeWidget, ['Row 3']) item_10 = QtWidgets.QTreeWidgetItem(item_9, ['Row 3.1']) item_11 = QtWidgets.QTreeWidgetItem(self.treeWidget, ['Row 4']) self.verticalLayout_4.addWidget(self.treeWidget) self.gridLayout_2.addWidget(self.groupBox_2, 0, 0, 1, 1) self.tab_3v2 = QtWidgets.QWidget() self.tab_3v2.setObjectName('tab_3v2') self.gridLayout_3v2 = QtWidgets.QGridLayout(self.tab_3v2) self.gridLayout_3v2.setObjectName('gridLayout_3v2') self.groupBox_3v2 = QtWidgets.QGroupBox(self.tab_3v2) self.groupBox_3v2.setObjectName('groupBox_3v2') self.verticalLayout_4v2 = QtWidgets.QVBoxLayout(self.groupBox_3v2) self.verticalLayout_4v2.setObjectName('verticalLayout_4v2') self.tabBar = QtWidgets.QTabBar(self.tab_3v2) self.gridLayout_3v2.setObjectName('tabBar') self.tabBar.addTab('TabBar Tab 1') self.tabBar.addTab('TabBar Tab 2') self.tabBar.addTab('TabBar Tab 3') self.verticalLayout_4v2.addWidget(self.tabBar, 0, AlignTop) self.gridLayout_3v2.addWidget(self.groupBox_3v2, 0, 0, 1, 1) self.tabWidget.addTab(self.tab_2, '') self.tabWidget.addTab(self.tab_3v2, '') self.verticalLayout_5.addWidget(self.tabWidget) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName('horizontalLayout') self.pushButton_2 = QtWidgets.QPushButton(self.centralwidget) self.pushButton_2.setObjectName('pushButton_2') self.pushButton_2.setToolTip('Sample Tooltip2') self.horizontalLayout.addWidget(self.pushButton_2) self.bt_delay_popup = QtWidgets.QToolButton(self.centralwidget) self.bt_delay_popup.setObjectName('bt_delay_popup') self.horizontalLayout.addWidget(self.bt_delay_popup) self.bt_instant_popup = QtWidgets.QToolButton(self.centralwidget) self.bt_instant_popup.setPopupMode(InstantPopup) self.bt_instant_popup.setObjectName('bt_instant_popup') self.horizontalLayout.addWidget(self.bt_instant_popup) self.bt_menu_button_popup = QtWidgets.QToolButton(self.centralwidget) self.bt_menu_button_popup.setPopupMode(MenuButtonPopup) self.bt_menu_button_popup.setObjectName('bt_menu_button_popup') self.horizontalLayout.addWidget(self.bt_menu_button_popup) self.line_2 = QtWidgets.QFrame(self.centralwidget) self.line_2.setFrameShape(VLine) self.line_2.setFrameShadow(Sunken) self.line_2.setObjectName('line_2') self.horizontalLayout.addWidget(self.line_2) self.pushButton_3 = QtWidgets.QPushButton(self.centralwidget) self.pushButton_3.setEnabled(False) self.pushButton_3.setObjectName('pushButton_3') self.pushButton_3.setToolTip('Sample Tooltip3') self.horizontalLayout.addWidget(self.pushButton_3) self.doubleSpinBox = QtWidgets.QDoubleSpinBox(self.centralwidget) self.doubleSpinBox.setObjectName('doubleSpinBox') self.horizontalLayout.addWidget(self.doubleSpinBox) self.toolButton = QtWidgets.QToolButton(self.centralwidget) self.toolButton.setPopupMode(InstantPopup) self.toolButton.setObjectName('toolButton') self.horizontalLayout.addWidget(self.toolButton) self.verticalLayout_5.addLayout(self.horizontalLayout) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 1068, 29)) self.menubar.setObjectName('menubar') self.menuMenu = QtWidgets.QMenu(self.menubar) self.menuMenu.setObjectName('menuMenu') self.menuSubmenu_2 = QtWidgets.QMenu(self.menuMenu) self.menuSubmenu_2.setObjectName('menuSubmenu_2') MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName('statusbar') MainWindow.setStatusBar(self.statusbar) self.dockWidget1 = QtWidgets.QDockWidget(MainWindow) self.dockWidget1.setObjectName('dockWidget1') self.dockWidgetContents = QtWidgets.QWidget() self.dockWidgetContents.setObjectName('dockWidgetContents') self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.dockWidgetContents) self.verticalLayout_2.setObjectName('verticalLayout_2') self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName('verticalLayout') self.comboBox = QtWidgets.QComboBox(self.dockWidgetContents) self.comboBox.setObjectName('comboBox') self.comboBox.setEditable(True) self.comboBox.addItem('') self.comboBox.addItem('') self.verticalLayout.addWidget(self.comboBox) self.horizontalSlider = QtWidgets.QSlider(self.dockWidgetContents) self.horizontalSlider.setOrientation(Horizontal) self.horizontalSlider.setObjectName('horizontalSlider') self.verticalLayout.addWidget(self.horizontalSlider) self.textEdit = QtWidgets.QTextEdit(self.dockWidgetContents) self.textEdit.setObjectName('textEdit') self.verticalLayout.addWidget(self.textEdit) self.line = QtWidgets.QFrame(self.dockWidgetContents) self.line.setFrameShape(HLine) self.line.setFrameShadow(Sunken) self.line.setObjectName('line') self.verticalLayout.addWidget(self.line) self.progressBar = QtWidgets.QProgressBar(self.dockWidgetContents) self.progressBar.setProperty('value', 24) self.progressBar.setObjectName('progressBar') self.verticalLayout.addWidget(self.progressBar) self.verticalLayout_2.addLayout(self.verticalLayout) self.frame = QtWidgets.QFrame(self.dockWidgetContents) self.frame.setMinimumSize(QtCore.QSize(0, 100)) self.frame.setFrameShape(StyledPanel) self.frame.setFrameShadow(Raised) self.frame.setLineWidth(3) self.frame.setObjectName('frame') self.verticalLayout_2.addWidget(self.frame) self.dockWidget1.setWidget(self.dockWidgetContents) MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(1), self.dockWidget1) self.toolBar = QtWidgets.QToolBar(MainWindow) self.toolBar.setObjectName('toolBar') MainWindow.addToolBar(TopToolBarArea, self.toolBar) self.dockWidget2 = QtWidgets.QDockWidget(MainWindow) self.dockWidget2.setObjectName('dockWidget2') self.dockWidgetContents_2 = QtWidgets.QWidget() self.dockWidgetContents_2.setObjectName('dockWidgetContents_2') self.gridLayout_3 = QtWidgets.QGridLayout(self.dockWidgetContents_2) self.gridLayout_3.setObjectName('gridLayout_3') self.verticalSlider = QtWidgets.QSlider(self.dockWidgetContents_2) self.verticalSlider.setOrientation(Vertical) self.verticalSlider.setObjectName('verticalSlider') self.gridLayout_3.addWidget(self.verticalSlider, 0, 0, 1, 1) self.dockWidget2.setWidget(self.dockWidgetContents_2) MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(1), self.dockWidget2) self.actionAction = QAction(MainWindow) self.actionAction.setObjectName('actionAction') self.actionSub_menu = QAction(MainWindow) self.actionSub_menu.setObjectName('actionSub_menu') self.actionAction_C = QAction(MainWindow) self.actionAction_C.setObjectName('actionAction_C') self.menuSubmenu_2.addAction(self.actionSub_menu) self.menuSubmenu_2.addAction(self.actionAction_C) self.menuMenu.addAction(self.actionAction) self.menuMenu.addAction(self.menuSubmenu_2.menuAction()) self.menubar.addAction(self.menuMenu.menuAction()) self.toolBar.addAction(self.actionAction) self.toolBar.addAction(self.actionSub_menu) self.retranslateUi(MainWindow) self.tabWidget.setCurrentIndex(0) self.toolBox.setCurrentIndex(1) self.tabWidget_2.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(MainWindow) MainWindow.setTabOrder(self.pushButton, self.checkableButton) MainWindow.setTabOrder(self.checkableButton, self.pushButton_5) MainWindow.setTabOrder(self.pushButton_5, self.tabWidget_2) MainWindow.setTabOrder(self.tabWidget_2, self.tableWidget) MainWindow.setTabOrder(self.tableWidget, self.radioButton) MainWindow.setTabOrder(self.radioButton, self.checkBox) MainWindow.setTabOrder(self.checkBox, self.checkBox_2) MainWindow.setTabOrder(self.checkBox_2, self.treeWidget) MainWindow.setTabOrder(self.treeWidget, self.pushButton_2) MainWindow.setTabOrder(self.pushButton_2, self.bt_delay_popup) MainWindow.setTabOrder(self.bt_delay_popup, self.bt_instant_popup) MainWindow.setTabOrder(self.bt_instant_popup, self.bt_menu_button_popup) MainWindow.setTabOrder(self.bt_menu_button_popup, self.pushButton_3) MainWindow.setTabOrder(self.pushButton_3, self.doubleSpinBox) MainWindow.setTabOrder(self.doubleSpinBox, self.toolButton) MainWindow.setTabOrder(self.toolButton, self.comboBox) MainWindow.setTabOrder(self.comboBox, self.horizontalSlider) MainWindow.setTabOrder(self.horizontalSlider, self.textEdit) MainWindow.setTabOrder(self.textEdit, self.verticalSlider) MainWindow.setTabOrder(self.verticalSlider, self.tabWidget) MainWindow.setTabOrder(self.tabWidget, self.lineEdit) MainWindow.setTabOrder(self.lineEdit, self.listWidget)
def setupUi(self, SettingsDialog): SettingsDialog.setObjectName("SettingsDialog") SettingsDialog.resize(500, 350) SettingsDialog.setMinimumSize(QtCore.QSize(500, 350)) self.verticalLayout = QtWidgets.QVBoxLayout(SettingsDialog) self.verticalLayout.setObjectName("verticalLayout") self.tabWidget = QtWidgets.QTabWidget(SettingsDialog) self.tabWidget.setObjectName("tabWidget") self.tab = QtWidgets.QWidget() self.tab.setObjectName("tab") self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.tab) self.verticalLayout_2.setObjectName("verticalLayout_2") self.label = QtWidgets.QLabel(self.tab) self.label.setObjectName("label") self.verticalLayout_2.addWidget(self.label) self.computer_name_line_edit = QtWidgets.QLineEdit(self.tab) self.computer_name_line_edit.setObjectName("computer_name_line_edit") self.verticalLayout_2.addWidget(self.computer_name_line_edit) self.label_2 = QtWidgets.QLabel(self.tab) self.label_2.setObjectName("label_2") self.verticalLayout_2.addWidget(self.label_2) self.backup_schedule_combo_box = QtWidgets.QComboBox(self.tab) self.backup_schedule_combo_box.setObjectName( "backup_schedule_combo_box") self.backup_schedule_combo_box.addItem("") self.backup_schedule_combo_box.addItem("") self.verticalLayout_2.addWidget(self.backup_schedule_combo_box) spacerItem = QtWidgets.QSpacerItem( 20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.verticalLayout_2.addItem(spacerItem) self.horizontalLayout_6 = QtWidgets.QHBoxLayout() self.horizontalLayout_6.setObjectName("horizontalLayout_6") spacerItem1 = QtWidgets.QSpacerItem( 40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.horizontalLayout_6.addItem(spacerItem1) self.change_password_label = QtWidgets.QLabel(self.tab) self.change_password_label.setObjectName("change_password_label") self.horizontalLayout_6.addWidget(self.change_password_label) self.verticalLayout_2.addLayout(self.horizontalLayout_6) self.tabWidget.addTab(self.tab, "") self.tab_2 = QtWidgets.QWidget() self.tab_2.setObjectName("tab_2") self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.tab_2) self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.inclusions_list_widget = QtWidgets.QListWidget(self.tab_2) self.inclusions_list_widget.setFocusPolicy( QtCore.Qt.FocusPolicy.NoFocus) self.inclusions_list_widget.setObjectName("inclusions_list_widget") item = QtWidgets.QListWidgetItem() self.inclusions_list_widget.addItem(item) self.horizontalLayout_2.addWidget(self.inclusions_list_widget) self.verticalLayout_3 = QtWidgets.QVBoxLayout() self.verticalLayout_3.setObjectName("verticalLayout_3") self.inclusions_add_button = QtWidgets.QPushButton(self.tab_2) self.inclusions_add_button.setObjectName("inclusions_add_button") self.verticalLayout_3.addWidget(self.inclusions_add_button) self.inclusions_remove_button = QtWidgets.QPushButton(self.tab_2) self.inclusions_remove_button.setObjectName("inclusions_remove_button") self.verticalLayout_3.addWidget(self.inclusions_remove_button) spacerItem2 = QtWidgets.QSpacerItem( 20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.verticalLayout_3.addItem(spacerItem2) self.horizontalLayout_2.addLayout(self.verticalLayout_3) self.tabWidget.addTab(self.tab_2, "") self.tab_3 = QtWidgets.QWidget() self.tab_3.setObjectName("tab_3") self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.tab_3) self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.exclusions_list_widget = QtWidgets.QListWidget(self.tab_3) self.exclusions_list_widget.setFocusPolicy( QtCore.Qt.FocusPolicy.NoFocus) self.exclusions_list_widget.setObjectName("exclusions_list_widget") item = QtWidgets.QListWidgetItem() self.exclusions_list_widget.addItem(item) item = QtWidgets.QListWidgetItem() self.exclusions_list_widget.addItem(item) item = QtWidgets.QListWidgetItem() self.exclusions_list_widget.addItem(item) item = QtWidgets.QListWidgetItem() self.exclusions_list_widget.addItem(item) item = QtWidgets.QListWidgetItem() self.exclusions_list_widget.addItem(item) item = QtWidgets.QListWidgetItem() self.exclusions_list_widget.addItem(item) item = QtWidgets.QListWidgetItem() self.exclusions_list_widget.addItem(item) item = QtWidgets.QListWidgetItem() self.exclusions_list_widget.addItem(item) item = QtWidgets.QListWidgetItem() self.exclusions_list_widget.addItem(item) item = QtWidgets.QListWidgetItem() self.exclusions_list_widget.addItem(item) item = QtWidgets.QListWidgetItem() self.exclusions_list_widget.addItem(item) item = QtWidgets.QListWidgetItem() self.exclusions_list_widget.addItem(item) item = QtWidgets.QListWidgetItem() self.exclusions_list_widget.addItem(item) item = QtWidgets.QListWidgetItem() self.exclusions_list_widget.addItem(item) self.horizontalLayout_3.addWidget(self.exclusions_list_widget) self.verticalLayout_4 = QtWidgets.QVBoxLayout() self.verticalLayout_4.setObjectName("verticalLayout_4") self.exclusions_add_button = QtWidgets.QPushButton(self.tab_3) self.exclusions_add_button.setObjectName("exclusions_add_button") self.verticalLayout_4.addWidget(self.exclusions_add_button) self.exclusions_remove_button = QtWidgets.QPushButton(self.tab_3) self.exclusions_remove_button.setObjectName("exclusions_remove_button") self.verticalLayout_4.addWidget(self.exclusions_remove_button) spacerItem3 = QtWidgets.QSpacerItem( 20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.verticalLayout_4.addItem(spacerItem3) self.horizontalLayout_3.addLayout(self.verticalLayout_4) self.tabWidget.addTab(self.tab_3, "") self.tab_4 = QtWidgets.QWidget() self.tab_4.setObjectName("tab_4") self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.tab_4) self.verticalLayout_5.setObjectName("verticalLayout_5") self.label_4 = QtWidgets.QLabel(self.tab_4) self.label_4.setObjectName("label_4") self.verticalLayout_5.addWidget(self.label_4) self.max_upload_kibs_spin_box = QtWidgets.QSpinBox(self.tab_4) self.max_upload_kibs_spin_box.setMaximum(2147483647) self.max_upload_kibs_spin_box.setObjectName("max_upload_kibs_spin_box") self.verticalLayout_5.addWidget(self.max_upload_kibs_spin_box) self.backup_connected_file_systems_label = QtWidgets.QLabel(self.tab_4) self.backup_connected_file_systems_label.setObjectName( "backup_connected_file_systems_label") self.verticalLayout_5.addWidget( self.backup_connected_file_systems_label) self.backup_connected_file_systems_combo_box = QtWidgets.QComboBox( self.tab_4) self.backup_connected_file_systems_combo_box.setObjectName( "backup_connected_file_systems_combo_box") self.backup_connected_file_systems_combo_box.addItem("") self.backup_connected_file_systems_combo_box.addItem("") self.verticalLayout_5.addWidget( self.backup_connected_file_systems_combo_box) self.label_3 = QtWidgets.QLabel(self.tab_4) self.label_3.setObjectName("label_3") self.verticalLayout_5.addWidget(self.label_3) self.number_of_backup_threads_spin_box = QtWidgets.QSpinBox(self.tab_4) self.number_of_backup_threads_spin_box.setMaximum(64) self.number_of_backup_threads_spin_box.setObjectName( "number_of_backup_threads_spin_box") self.verticalLayout_5.addWidget(self.number_of_backup_threads_spin_box) spacerItem4 = QtWidgets.QSpacerItem( 20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding) self.verticalLayout_5.addItem(spacerItem4) self.horizontalLayout_4 = QtWidgets.QHBoxLayout() self.horizontalLayout_4.setObjectName("horizontalLayout_4") spacerItem5 = QtWidgets.QSpacerItem( 40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.horizontalLayout_4.addItem(spacerItem5) self.restore_different_computer_label = QtWidgets.QLabel(self.tab_4) self.restore_different_computer_label.setObjectName( "restore_different_computer_label") self.horizontalLayout_4.addWidget( self.restore_different_computer_label) self.verticalLayout_5.addLayout(self.horizontalLayout_4) self.horizontalLayout_5 = QtWidgets.QHBoxLayout() self.horizontalLayout_5.setObjectName("horizontalLayout_5") spacerItem6 = QtWidgets.QSpacerItem( 40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.horizontalLayout_5.addItem(spacerItem6) self.inherit_backup_history_label = QtWidgets.QLabel(self.tab_4) self.inherit_backup_history_label.setObjectName( "inherit_backup_history_label") self.horizontalLayout_5.addWidget(self.inherit_backup_history_label) self.verticalLayout_5.addLayout(self.horizontalLayout_5) self.tabWidget.addTab(self.tab_4, "") self.verticalLayout.addWidget(self.tabWidget) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.save_button = QtWidgets.QPushButton(SettingsDialog) self.save_button.setObjectName("save_button") self.horizontalLayout.addWidget(self.save_button) spacerItem7 = QtWidgets.QSpacerItem( 40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum) self.horizontalLayout.addItem(spacerItem7) self.verticalLayout.addLayout(self.horizontalLayout) self.retranslateUi(SettingsDialog) self.tabWidget.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(SettingsDialog)
def main(): 'Application entry point' if args.scale != 1: os.environ['QT_SCALE_FACTOR'] = str(args.scale) else: os.environ['QT_AUTO_SCREEN_SCALE_FACTOR'] = '1' if args.style != 'native': style = QtWidgets.QStyleFactory.create(args.style) QtWidgets.QApplication.setStyle(style) app = QtWidgets.QApplication(sys.argv[:1] + unknown) window = QtWidgets.QMainWindow() # use the default font size font = app.font() if args.font_size > 0: font.setPointSizeF(args.font_size) if args.font_family: font.setFamily(args.font_family) app.setFont(font) # setup stylesheet if args.stylesheet != 'native': file = QtCore.QFile(stylesheet) file.open(ReadOnly | Text) stream = QtCore.QTextStream(file) app.setStyleSheet(stream.readAll()) # setup the dock manager window.setObjectName('MainWindow') window.resize(1068, 824) widget = QtWidgets.QWidget(window) window.setCentralWidget(widget) dock_manager = QtAds.CDockManager(window) # add widgets to the dock manager label_widget = QtAds.CDockWidget('Dock') label = QtWidgets.QLabel('Some label') label_widget.setWidget(label) dock_area = dock_manager.setCentralWidget(label_widget) dock_area.setAllowedAreas(QtAds.DockWidgetArea.OuterDockAreas) list_widget = QtAds.CDockWidget('List') lst = QtWidgets.QListWidget() for index in range(10): lst.addItem(QtWidgets.QListWidgetItem(f'Item {index + 1}')) list_widget.setWidget(lst) list_widget.setMinimumSizeHintMode( QtAds.CDockWidget.MinimumSizeHintFromDockWidget) dock_manager.addDockWidget(QtAds.DockWidgetArea.LeftDockWidgetArea, list_widget, dock_area) table_widget = QtAds.CDockWidget('Table') table = QtWidgets.QTableWidget() # make sure we have both scroll areas active. table.setColumnCount(40) table.setRowCount(40) table_widget.setWidget(table) table_widget.setMinimumSizeHintMode( QtAds.CDockWidget.MinimumSizeHintFromDockWidget) dock_manager.addDockWidget(QtAds.DockWidgetArea.RightDockWidgetArea, table_widget, dock_area) if not args.use_internal: dock_manager.setStyleSheet('') # run window.setWindowState(WindowMaximized) window.show() if args.pyqt6: return app.exec() else: return app.exec_()
def setupUi(self, SettingsDialog): SettingsDialog.setObjectName("SettingsDialog") SettingsDialog.resize(500, 350) SettingsDialog.setMinimumSize(QtCore.QSize(500, 350)) self.verticalLayout = QtWidgets.QVBoxLayout(SettingsDialog) self.verticalLayout.setObjectName("verticalLayout") self.tabWidget = QtWidgets.QTabWidget(SettingsDialog) self.tabWidget.setObjectName("tabWidget") self.tab = QtWidgets.QWidget() self.tab.setObjectName("tab") self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.tab) self.verticalLayout_2.setObjectName("verticalLayout_2") self.label = QtWidgets.QLabel(self.tab) self.label.setObjectName("label") self.verticalLayout_2.addWidget(self.label) self.lineEdit = QtWidgets.QLineEdit(self.tab) self.lineEdit.setObjectName("lineEdit") self.verticalLayout_2.addWidget(self.lineEdit) self.label_2 = QtWidgets.QLabel(self.tab) self.label_2.setObjectName("label_2") self.verticalLayout_2.addWidget(self.label_2) self.comboBox = QtWidgets.QComboBox(self.tab) self.comboBox.setObjectName("comboBox") self.comboBox.addItem("") self.comboBox.addItem("") self.verticalLayout_2.addWidget(self.comboBox) spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout_2.addItem(spacerItem) self.tabWidget.addTab(self.tab, "") self.tab_2 = QtWidgets.QWidget() self.tab_2.setObjectName("tab_2") self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.tab_2) self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.listWidget = QtWidgets.QListWidget(self.tab_2) self.listWidget.setFocusPolicy(QtCore.Qt.NoFocus) self.listWidget.setObjectName("listWidget") item = QtWidgets.QListWidgetItem() self.listWidget.addItem(item) self.horizontalLayout_2.addWidget(self.listWidget) self.verticalLayout_3 = QtWidgets.QVBoxLayout() self.verticalLayout_3.setObjectName("verticalLayout_3") self.pushButton_2 = QtWidgets.QPushButton(self.tab_2) self.pushButton_2.setObjectName("pushButton_2") self.verticalLayout_3.addWidget(self.pushButton_2) self.pushButton_3 = QtWidgets.QPushButton(self.tab_2) self.pushButton_3.setObjectName("pushButton_3") self.verticalLayout_3.addWidget(self.pushButton_3) spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout_3.addItem(spacerItem1) self.horizontalLayout_2.addLayout(self.verticalLayout_3) self.tabWidget.addTab(self.tab_2, "") self.tab_3 = QtWidgets.QWidget() self.tab_3.setObjectName("tab_3") self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.tab_3) self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.listWidget_2 = QtWidgets.QListWidget(self.tab_3) self.listWidget_2.setFocusPolicy(QtCore.Qt.NoFocus) self.listWidget_2.setObjectName("listWidget_2") item = QtWidgets.QListWidgetItem() self.listWidget_2.addItem(item) item = QtWidgets.QListWidgetItem() self.listWidget_2.addItem(item) item = QtWidgets.QListWidgetItem() self.listWidget_2.addItem(item) item = QtWidgets.QListWidgetItem() self.listWidget_2.addItem(item) item = QtWidgets.QListWidgetItem() self.listWidget_2.addItem(item) item = QtWidgets.QListWidgetItem() self.listWidget_2.addItem(item) item = QtWidgets.QListWidgetItem() self.listWidget_2.addItem(item) item = QtWidgets.QListWidgetItem() self.listWidget_2.addItem(item) item = QtWidgets.QListWidgetItem() self.listWidget_2.addItem(item) item = QtWidgets.QListWidgetItem() self.listWidget_2.addItem(item) item = QtWidgets.QListWidgetItem() self.listWidget_2.addItem(item) item = QtWidgets.QListWidgetItem() self.listWidget_2.addItem(item) item = QtWidgets.QListWidgetItem() self.listWidget_2.addItem(item) item = QtWidgets.QListWidgetItem() self.listWidget_2.addItem(item) self.horizontalLayout_3.addWidget(self.listWidget_2) self.verticalLayout_4 = QtWidgets.QVBoxLayout() self.verticalLayout_4.setObjectName("verticalLayout_4") self.pushButton_4 = QtWidgets.QPushButton(self.tab_3) self.pushButton_4.setObjectName("pushButton_4") self.verticalLayout_4.addWidget(self.pushButton_4) self.pushButton_5 = QtWidgets.QPushButton(self.tab_3) self.pushButton_5.setObjectName("pushButton_5") self.verticalLayout_4.addWidget(self.pushButton_5) spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout_4.addItem(spacerItem2) self.horizontalLayout_3.addLayout(self.verticalLayout_4) self.tabWidget.addTab(self.tab_3, "") self.verticalLayout.addWidget(self.tabWidget) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.pushButton = QtWidgets.QPushButton(SettingsDialog) self.pushButton.setObjectName("pushButton") self.horizontalLayout.addWidget(self.pushButton) spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem3) self.verticalLayout.addLayout(self.horizontalLayout) self.retranslateUi(SettingsDialog) self.tabWidget.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(SettingsDialog)