我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用PyQt5.QtWidgets.QSpacerItem()。
def __init__(self, parent=None): super(SearchLineEdit, self).__init__() self.setObjectName("SearchLine") self.parent = parent self.setMinimumSize(218, 20) with open('QSS/searchLine.qss', 'r') as f: self.setStyleSheet(f.read()) self.button = QPushButton(self) self.button.setMaximumSize(13, 13) self.button.setCursor(QCursor(Qt.PointingHandCursor)) self.setTextMargins(3, 0, 19, 0) self.spaceItem = QSpacerItem(150, 10, QSizePolicy.Expanding) self.mainLayout = QHBoxLayout() self.mainLayout.addSpacerItem(self.spaceItem) # self.mainLayout.addStretch(1) self.mainLayout.addWidget(self.button) self.mainLayout.addSpacing(10) self.mainLayout.setContentsMargins(0, 0, 0, 0) self.setLayout(self.mainLayout)
def __init__(self, msg, details="", parent=None): super().__init__(parent=parent) self.setWindowTitle("Error message") self.setIcon(QW.QMessageBox.Critical) # Force a minimum width ! Cannot use setFixedWidth. This is a trick # found on # http://www.qtcentre.org/threads/22298-QMessageBox-Controlling-the-width layout = self.layout() spacer = QW.QSpacerItem(600,0) layout.addItem(spacer, layout.rowCount(), 0,1,layout.columnCount()) msg = '<b style="color:red">' + msg + "</b><br><br>" try: details = str(details).replace("\\n", "<br>") except: pass self.setText(msg + details)
def __init__(self, *args, **kwargs): super(FileWatch, self).__init__(*args, **kwargs) self.filePath = "" self.lastEdited = 0 self.fileContent = "" self.propertiesWidget = QWidget() self.vlayout = QVBoxLayout() self.lineEdit = QLineEdit() self.lineEdit.textChanged.connect(self.lineEditTextChanges) self.vlayout.addWidget(self.lineEdit) self.vlayout.addItem(QSpacerItem(40, 20, QSizePolicy.Minimum, QSizePolicy.Expanding)) self.propertiesWidget.setLayout(self.vlayout) self.timer = QTimer() self.timer.timeout.connect(self.checkFileChange) self.timer.start(200)
def __init__(self, *args, **kwargs): super(FullScreenQuad, self).__init__(*args, **kwargs) self.propertiesWidget = QWidget() self.vlayout = QVBoxLayout() self.xoffsetWidget = QDoubleSpinBox() self.xoffsetWidget.setMaximum(9999) self.xoffsetWidget.setMinimum(-9999) self.yoffsetWidget = QDoubleSpinBox() self.yoffsetWidget.setMaximum(9999) self.yoffsetWidget.setMinimum(-9999) self.vlayout.addWidget(self.xoffsetWidget) self.vlayout.addWidget(self.yoffsetWidget) self.xoffsetWidget.valueChanged.connect(self.offsetchange) self.yoffsetWidget.valueChanged.connect(self.offsetchange) self.vlayout.addItem(QSpacerItem(40, 20, QSizePolicy.Minimum, QSizePolicy.Expanding)) self.propertiesWidget.setLayout(self.vlayout)
def __init__(self, *args, **kwargs): self.ownsheet = None self.sheets = None self.selectedSheet = None self.listSheetItems = {} super(SubSheet, self).__init__(*args, **kwargs) self.propertiesWidget = QWidget() self.vlayout = QVBoxLayout() self.listWidget = QListWidget() self.listWidget.itemClicked.connect(self.listClicked) self.vlayout.addWidget(self.listWidget) self.vlayout.addItem(QSpacerItem(40, 20, QSizePolicy.Minimum, QSizePolicy.Expanding)) self.propertiesWidget.setLayout(self.vlayout)
def setupUi(self, window): window.setObjectName("window") window.resize(380, 477) window.setModal(True) self.verticalLayout = QtWidgets.QVBoxLayout(window) self.verticalLayout.setObjectName("verticalLayout") self.txt_list = QtWidgets.QTextEdit(window) self.txt_list.setMinimumSize(QtCore.QSize(183, 0)) self.txt_list.setAcceptRichText(False) self.txt_list.setObjectName("txt_list") self.verticalLayout.addWidget(self.txt_list) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setContentsMargins(-1, -1, -1, 10) self.horizontalLayout.setObjectName("horizontalLayout") self.btn_cancel = QtWidgets.QPushButton(window) self.btn_cancel.setAutoDefault(False) self.btn_cancel.setObjectName("btn_cancel") self.horizontalLayout.addWidget(self.btn_cancel) spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem) self.btn_ok = QtWidgets.QPushButton(window) self.btn_ok.setAutoDefault(True) self.btn_ok.setObjectName("btn_ok") self.horizontalLayout.addWidget(self.btn_ok) self.verticalLayout.addLayout(self.horizontalLayout) self.retranslateUi(window) QtCore.QMetaObject.connectSlotsByName(window)
def process_delete(self, process): """ Handle the removal of a B3 process. """ msgbox = QMessageBox() msgbox.setIcon(QMessageBox.Question) msgbox.setWindowTitle('CONFIRM') msgbox.setText('Are you sure?') msgbox.setInformativeText('Do you want to remove %s?' % process.name) msgbox.setStandardButtons(QMessageBox.No|QMessageBox.Yes) msgbox.setDefaultButton(QMessageBox.No) msgbox.layout().addItem(QSpacerItem(300, 0, QSizePolicy.Minimum, QSizePolicy.Expanding), msgbox.layout().rowCount(), 0, 1, msgbox.layout().columnCount()) msgbox.exec_() if msgbox.result() == QMessageBox.Yes: if process.state() != QProcess.NotRunning: self.process_shutdown(process) process.delete() self.repaint()
def draw_network(self, links): # get the units self.dunits = self.mainwindow.projectgui.projectproperties.dataset.dunits self.lunits = self.mainwindow.projectgui.projectproperties.dataset.lunits logger = logging.getLogger() if(not links): logger.info("Links sent was None. Ignoring request to draw!") return logger.info("Creating assignment items for %d links " % len(links)) for link in links: self.add_assign_asset_item(link) spacerItem = QtWidgets.QSpacerItem( 20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.ui.assign_asset_item_parent_layout.addItem(spacerItem) # now populate select_diameter_combobox with unique diameters dia = [str(y) for y in sorted(set(x.diameter_ for x in self.myplotitems.values()))] self.ui.select_diameter_combobox.clear() self.ui.select_diameter_combobox.addItems(dia)
def setupUi(self, FileTransferDialog): FileTransferDialog.setObjectName("FileTransferDialog") FileTransferDialog.resize(400, 120) self.verticalLayout_2 = QtWidgets.QVBoxLayout(FileTransferDialog) self.verticalLayout_2.setObjectName("verticalLayout_2") self.label = QtWidgets.QLabel(FileTransferDialog) self.label.setObjectName("label") self.verticalLayout_2.addWidget(self.label) self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.progressBar = QtWidgets.QProgressBar(FileTransferDialog) self.progressBar.setProperty("value", 24) self.progressBar.setObjectName("progressBar") self.verticalLayout.addWidget(self.progressBar) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem) self.cancelButton = QtWidgets.QPushButton(FileTransferDialog) self.cancelButton.setEnabled(False) self.cancelButton.setCheckable(False) self.cancelButton.setObjectName("cancelButton") self.horizontalLayout.addWidget(self.cancelButton) self.verticalLayout.addLayout(self.horizontalLayout) self.verticalLayout_2.addLayout(self.verticalLayout) self.retranslateUi(FileTransferDialog) QtCore.QMetaObject.connectSlotsByName(FileTransferDialog)
def __init__(self, parent=None): super().__init__(parent) self.setSubTitle(self.tr("<h2>Save Your Settings</h2>")) vlayout = QVBoxLayout(self) label = QLabel(self) label.setWordWrap(True) label.setText(self.tr("<p>You have successfully finished all steps. Here's a summary of the settings you want to apply. \ Click <strong>Apply Settings</strong> to save them now. You are now ready to enjoy KaOS!</p>")) vlayout.addWidget(label) vlayout.addItem(QSpacerItem(20, 40, QSizePolicy.Preferred, QSizePolicy.Preferred)) groupBox = QGroupBox() groupBox.setTitle(self.tr("The following settings will be applied")) groupBox.setMinimumHeight(350) groupLayout = QHBoxLayout(groupBox) self.labelSummary = QLabel() self.labelSummary.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop) groupLayout.addWidget( self.labelSummary) self.labelSummary2 = QLabel() self.labelSummary2.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop) groupLayout.addWidget( self.labelSummary2) vlayout.addWidget(groupBox) vlayout.addItem(QSpacerItem(20, 40, QSizePolicy.Preferred, QSizePolicy.Preferred)) self.summary = {} self.parent().summaryVisible.connect(self.summaryWrite)
def __init__(self, parent=None): super().__init__(parent) self.setSubTitle(self.tr("<h2>Welcome to KaOS</h2>")) vlayout = QVBoxLayout(self) vlayout.addItem(QSpacerItem(20, 30, QSizePolicy.Preferred, QSizePolicy.Minimum)) hlayout = QHBoxLayout(self) label = QLabel(self) label.setText(self.tr("""<h1>What is KaOS?</h1> <p>The idea behind KaOS is to create a tightly integrated rolling and<br /> transparent distribution for the modern desktop, build from scratch with<br /> a very specific focus. Focus on one DE (KDE), one toolkit (Qt) & one architecture (x86_64).<br /> Plus a focus on evaluating and selecting the most suitable tools and applications.</p> <p>This wizard will help you personalize your KaOS workspace easily and quickly.</p> <p>Please click <code style=color:#3498DB>Next</code> in order to begin. Click <code style=color:#3498DB>Cancel</code> anytime and changes won't be saved.</p>""")) label.setWordWrap(True) label.setAlignment(Qt.AlignLeft) hlayout.addWidget(label) kaptan_logo = QLabel(self) kaptan_logo.setPixmap(QPixmap(":/data/images/welcome.png")) kaptan_logo.setAlignment(Qt.AlignRight) kaptan_logo.setMaximumSize(157, 181) hlayout.addWidget(kaptan_logo) vlayout.addLayout(hlayout) vlayout.addItem(QSpacerItem(20, 40, QSizePolicy.Preferred, QSizePolicy.Preferred)) desktop_file = os.path.join(os.environ["HOME"], ".config", "autostart", "kaptan.desktop") if os.path.exists(desktop_file): self.checkBox = QCheckBox() self.checkBox.setText(self.tr("Run on system startup")) self.checkBox.setChecked(True) self.checkBox.clicked.connect(self.autoRemove) vlayout.addWidget(self.checkBox)
def setupUi(self, IndependenceTestViewer): IndependenceTestViewer.setObjectName("IndependenceTestViewer") IndependenceTestViewer.resize(640, 480) self.verticalLayout = QtWidgets.QVBoxLayout(IndependenceTestViewer) self.verticalLayout.setContentsMargins(0, -1, 0, 0) self.verticalLayout.setObjectName("verticalLayout") self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setContentsMargins(4, -1, 4, -1) self.horizontalLayout.setObjectName("horizontalLayout") self.label = QtWidgets.QLabel(IndependenceTestViewer) self.label.setObjectName("label") self.horizontalLayout.addWidget(self.label) self.button_copy_text = QtWidgets.QPushButton(IndependenceTestViewer) self.button_copy_text.setObjectName("button_copy_text") self.horizontalLayout.addWidget(self.button_copy_text) self.button_copy_html = QtWidgets.QPushButton(IndependenceTestViewer) self.button_copy_html.setObjectName("button_copy_html") self.horizontalLayout.addWidget(self.button_copy_html) self.button_copy_latex = QtWidgets.QPushButton(IndependenceTestViewer) self.button_copy_latex.setObjectName("button_copy_latex") self.horizontalLayout.addWidget(self.button_copy_latex) spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem) self.verticalLayout.addLayout(self.horizontalLayout) self.textBrowser = QtWidgets.QTextBrowser(IndependenceTestViewer) self.textBrowser.setObjectName("textBrowser") self.verticalLayout.addWidget(self.textBrowser) self.retranslateUi(IndependenceTestViewer) QtCore.QMetaObject.connectSlotsByName(IndependenceTestViewer)
def setupUi(self, AboutDialog): AboutDialog.setObjectName("AboutDialog") AboutDialog.resize(640, 480) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(AboutDialog.sizePolicy().hasHeightForWidth()) AboutDialog.setSizePolicy(sizePolicy) self.verticalLayout = QtWidgets.QVBoxLayout(AboutDialog) self.verticalLayout.setSizeConstraint(QtWidgets.QLayout.SetMinimumSize) self.verticalLayout.setSpacing(16) self.verticalLayout.setObjectName("verticalLayout") self.frame_pixmap = QtWidgets.QFrame(AboutDialog) self.frame_pixmap.setStyleSheet("background-color: #fffdfd") self.frame_pixmap.setObjectName("frame_pixmap") self.layout_pixmap = QtWidgets.QVBoxLayout(self.frame_pixmap) self.layout_pixmap.setContentsMargins(4, 3, 4, 3) self.layout_pixmap.setSpacing(0) self.layout_pixmap.setObjectName("layout_pixmap") self.label_pixmap = QtWidgets.QLabel(self.frame_pixmap) self.label_pixmap.setText("") self.label_pixmap.setObjectName("label_pixmap") self.layout_pixmap.addWidget(self.label_pixmap) self.verticalLayout.addWidget(self.frame_pixmap) self.label_description = QtWidgets.QLabel(AboutDialog) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.label_description.sizePolicy().hasHeightForWidth()) self.label_description.setSizePolicy(sizePolicy) self.label_description.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) self.label_description.setWordWrap(True) self.label_description.setOpenExternalLinks(True) self.label_description.setObjectName("label_description") self.verticalLayout.addWidget(self.label_description) spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout.addItem(spacerItem) self.retranslateUi(AboutDialog) QtCore.QMetaObject.connectSlotsByName(AboutDialog)
def setupUi(self, OrphanagedDatabases): OrphanagedDatabases.setObjectName("OrphanagedDatabases") OrphanagedDatabases.resize(640, 479) self.verticalLayout = QtWidgets.QVBoxLayout(OrphanagedDatabases) self.verticalLayout.setSizeConstraint(QtWidgets.QLayout.SetDefaultConstraint) self.verticalLayout.setObjectName("verticalLayout") self.label = QtWidgets.QLabel(OrphanagedDatabases) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth()) self.label.setSizePolicy(sizePolicy) self.label.setWordWrap(True) self.label.setObjectName("label") self.verticalLayout.addWidget(self.label) self.listWidget = QtWidgets.QListWidget(OrphanagedDatabases) self.listWidget.setObjectName("listWidget") self.verticalLayout.addWidget(self.listWidget) self.label_3 = QtWidgets.QLabel(OrphanagedDatabases) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.MinimumExpanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth()) self.label_3.setSizePolicy(sizePolicy) self.label_3.setWordWrap(True) self.label_3.setObjectName("label_3") self.verticalLayout.addWidget(self.label_3) spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout.addItem(spacerItem) self.buttonBox = QtWidgets.QDialogButtonBox(OrphanagedDatabases) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.No|QtWidgets.QDialogButtonBox.Yes) self.buttonBox.setObjectName("buttonBox") self.verticalLayout.addWidget(self.buttonBox) self.retranslateUi(OrphanagedDatabases) self.buttonBox.accepted.connect(OrphanagedDatabases.accept) self.buttonBox.rejected.connect(OrphanagedDatabases.reject) QtCore.QMetaObject.connectSlotsByName(OrphanagedDatabases)
def __init__(self, *args, **kwargs): super(Bool, self).__init__(*args, **kwargs) self.propertiesWidget = QWidget() self.vlayout = QVBoxLayout() self.toggle = QCheckBox("Output") self.toggle.toggled.connect(self.toggleTrueFalse) self.vlayout.addWidget(self.toggle) self.vlayout.addItem(QSpacerItem(40, 20, QSizePolicy.Minimum, QSizePolicy.Expanding)) self.propertiesWidget.setLayout(self.vlayout)
def __init__(self, *args, **kwargs): super(String, self).__init__(*args, **kwargs) self.text = "" self.propertiesWidget = QWidget() self.vlayout = QVBoxLayout() self.lineEdit = QLineEdit() self.lineEdit.textChanged.connect(self.textChanged) self.vlayout.addWidget(self.lineEdit) self.vlayout.addItem(QSpacerItem(40, 20, QSizePolicy.Minimum, QSizePolicy.Expanding)) self.propertiesWidget.setLayout(self.vlayout)
def __init__(self, parent=None): QtWidgets.QFrame.__init__(self, parent) # Set layout self.sideLayout = QtWidgets.QVBoxLayout() # Widgets self.sideTitle = SideTitle(parent) self.sideSpacer = QtWidgets.QSpacerItem(240, 150) self.sideMenu = SideMenu(parent) # Run side information # Show when running a task self.sideRunMenu = SideRunMenu(parent) # Hide when intialize self.sideRunMenu.setVisible(False) # Option self.sideOption = SideOption(parent) # Add widgets self.sideLayout.addWidget(self.sideTitle, 1) self.sideLayout.insertStretch(1, 1) self.sideLayout.addWidget(self.sideMenu, 7) self.sideLayout.addWidget(self.sideRunMenu, 7) self.sideLayout.addWidget(self.sideOption, 0) # Add layout self.sideLayout.setContentsMargins(0, 0, 0, 0) self.sideLayout.setSpacing(0) self.setLayout(self.sideLayout) # Stylesheet self.setStyleSheet("background:#399ee5; ") # Side Title
def setCallbackPlot(self, filedir): self.plot_file = {} # Delete previous widgets for root, dir, files in os.walk(filedir): for file in files: if file.endswith(".png"): filename = file.rsplit(".", 1)[0] root_index = root.rsplit("/", 1)[1] if root_index in self.plot_file: if file != "ui.png": self.plot_file[root_index].append(root + "/" + file) else: self.plot_file[root_index] = [root + "/ui.png"] if file != "ui.png": self.plot_file[root_index].append(root + "/" + file) row_pos = col_pos = 0 for root_index in range(0, len(list(self.plot_file.keys()))): row_pos = int(root_index/2) col_pos = root_index % 2 root_name = list(self.plot_file.keys())[root_index] currentfile = self.plot_file[root_name][0] plot_frame = SubGraphViewer(self, root_name, currentfile) self.plotViewer.addWidget(plot_frame, row_pos, col_pos, QtCore.Qt.AlignTop) # self.plotViewer.addItem(QtWidgets.QSpacerItem(20, 60, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding), row_pos + 1, 0) # self.graph_comboBox.setCurrentIndex(-1) self.exportPlot_flag = -1
def __init__(self, name, parent=None): super().__init__(name, parent) self.ui = plexdesktop.ui.downloadwindow_ui.Ui_DownloadWindow() self.ui.setupUi(self) self.mutex = QtCore.QMutex() self.setWindowTitle('Downloads') self.setWindowFlags(QtCore.Qt.Window) self.spacer = QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) self.ui.layout.insertItem(-1, self.spacer) self.jobs = {} self.queue = queue.Queue()
def finalise(self): """ Finalise Add a spacer at the bottom of the QGroupBox layout """ policy = QtWidgets.QSizePolicy.Expanding self.spacer = QtWidgets.QSpacerItem(0, 0, vPolicy=policy) self.layout.addItem(self.spacer)
def setupUi(self, Form): Form.setObjectName("Form") Form.resize(194, 91) self.gridLayout = QtWidgets.QGridLayout(Form) self.gridLayout.setObjectName("gridLayout") self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.label_Animated = QtWidgets.QLabel(Form) self.label_Animated.setText("") self.label_Animated.setObjectName("label_Animated") self.verticalLayout.addWidget(self.label_Animated) self.label_StatusText = QtWidgets.QLabel(Form) self.label_StatusText.setText("") self.label_StatusText.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByMouse) self.label_StatusText.setObjectName("label_StatusText") self.verticalLayout.addWidget(self.label_StatusText) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem) self.pushButton_Cancel = QtWidgets.QPushButton(Form) self.pushButton_Cancel.setObjectName("pushButton_Cancel") self.horizontalLayout.addWidget(self.pushButton_Cancel) spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem1) self.verticalLayout.addLayout(self.horizontalLayout) self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1) self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form)
def setupUi(self, Dialog): Dialog.setObjectName("Dialog") Dialog.resize(208, 89) self.gridLayout_2 = QtWidgets.QGridLayout(Dialog) self.gridLayout_2.setObjectName("gridLayout_2") self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem) self.label_Animated = QtWidgets.QLabel(Dialog) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.label_Animated.sizePolicy().hasHeightForWidth()) self.label_Animated.setSizePolicy(sizePolicy) self.label_Animated.setText("") self.label_Animated.setScaledContents(False) self.label_Animated.setObjectName("label_Animated") self.horizontalLayout.addWidget(self.label_Animated) self.label_StatusText = QtWidgets.QLabel(Dialog) self.label_StatusText.setObjectName("label_StatusText") self.horizontalLayout.addWidget(self.label_StatusText) spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem1) self.gridLayout_2.addLayout(self.horizontalLayout, 0, 0, 1, 1) self.widget_Cancel = QtWidgets.QWidget(Dialog) self.widget_Cancel.setObjectName("widget_Cancel") self.gridLayout = QtWidgets.QGridLayout(self.widget_Cancel) self.gridLayout.setContentsMargins(0, 0, 0, 0) self.gridLayout.setObjectName("gridLayout") spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout.addItem(spacerItem2, 0, 0, 1, 1) self.pushButton_Cancel = QtWidgets.QPushButton(self.widget_Cancel) self.pushButton_Cancel.setObjectName("pushButton_Cancel") self.gridLayout.addWidget(self.pushButton_Cancel, 0, 1, 1, 1) spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout.addItem(spacerItem3, 0, 2, 1, 1) self.gridLayout_2.addWidget(self.widget_Cancel, 1, 0, 1, 1) self.retranslateUi(Dialog) QtCore.QMetaObject.connectSlotsByName(Dialog)
def setupUi(self, Form): Form.setObjectName("Form") Form.resize(900, 300) self.gridLayout = QtWidgets.QGridLayout(Form) self.gridLayout.setObjectName("gridLayout") self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.label = QtWidgets.QLabel(Form) self.label.setObjectName("label") self.verticalLayout.addWidget(self.label) self.listWidget = QtWidgets.QListWidget(Form) self.listWidget.setObjectName("listWidget") self.verticalLayout.addWidget(self.listWidget) self.horizontalLayout.addLayout(self.verticalLayout) self.verticalLayout_2 = QtWidgets.QVBoxLayout() self.verticalLayout_2.setObjectName("verticalLayout_2") self.label_2 = QtWidgets.QLabel(Form) self.label_2.setObjectName("label_2") self.verticalLayout_2.addWidget(self.label_2) self.lineEdit_Info = QtWidgets.QLineEdit(Form) self.lineEdit_Info.setReadOnly(True) self.lineEdit_Info.setObjectName("lineEdit_Info") self.verticalLayout_2.addWidget(self.lineEdit_Info) self.label_3 = QtWidgets.QLabel(Form) self.label_3.setObjectName("label_3") self.verticalLayout_2.addWidget(self.label_3) self.lineEdit_Comment = QtWidgets.QLineEdit(Form) self.lineEdit_Comment.setReadOnly(True) self.lineEdit_Comment.setObjectName("lineEdit_Comment") self.verticalLayout_2.addWidget(self.lineEdit_Comment) spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout_2.addItem(spacerItem) self.horizontalLayout.addLayout(self.verticalLayout_2) self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 1) self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form)
def setupUi(self, Dialog): Dialog.setObjectName("Dialog") Dialog.resize(389, 239) Dialog.setStyleSheet("font: 10pt \"Arial\";") self.gridLayout = QtWidgets.QGridLayout(Dialog) self.gridLayout.setObjectName("gridLayout") self.buttonBox = QtWidgets.QDialogButtonBox(Dialog) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.gridLayout.addWidget(self.buttonBox, 1, 0, 1, 1) self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.label = QtWidgets.QLabel(Dialog) font = QtGui.QFont() font.setFamily("Arial") font.setPointSize(10) font.setItalic(False) self.label.setFont(font) self.label.setObjectName("label") self.verticalLayout.addWidget(self.label, 0, QtCore.Qt.AlignTop) self.comboBox = QtWidgets.QComboBox(Dialog) self.comboBox.setObjectName("comboBox") self.verticalLayout.addWidget(self.comboBox) spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout.addItem(spacerItem) spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout.addItem(spacerItem1) self.label_2 = QtWidgets.QLabel(Dialog) self.label_2.setObjectName("label_2") self.verticalLayout.addWidget(self.label_2) self.plainTextEditDescription = QtWidgets.QPlainTextEdit(Dialog) self.plainTextEditDescription.setReadOnly(True) self.plainTextEditDescription.setObjectName("plainTextEditDescription") self.verticalLayout.addWidget(self.plainTextEditDescription) self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1) self.retranslateUi(Dialog) self.buttonBox.accepted.connect(Dialog.accept) self.buttonBox.rejected.connect(Dialog.reject) QtCore.QMetaObject.connectSlotsByName(Dialog)
def setupUi(self, Dialog): Dialog.setObjectName("Dialog") Dialog.resize(640, 977) self.verticalLayout = QtWidgets.QVBoxLayout(Dialog) self.verticalLayout.setObjectName("verticalLayout") self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem) self.pushButtonOk = QtWidgets.QPushButton(Dialog) self.pushButtonOk.setFocusPolicy(QtCore.Qt.NoFocus) self.pushButtonOk.setLayoutDirection(QtCore.Qt.LeftToRight) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(":/icons/open-iconic-master/png/check-3x.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.pushButtonOk.setIcon(icon) self.pushButtonOk.setIconSize(QtCore.QSize(35, 35)) self.pushButtonOk.setDefault(False) self.pushButtonOk.setFlat(False) self.pushButtonOk.setObjectName("pushButtonOk") self.horizontalLayout.addWidget(self.pushButtonOk) self.pushButtonCancel = QtWidgets.QPushButton(Dialog) self.pushButtonCancel.setFocusPolicy(QtCore.Qt.NoFocus) self.pushButtonCancel.setLayoutDirection(QtCore.Qt.LeftToRight) icon1 = QtGui.QIcon() icon1.addPixmap(QtGui.QPixmap(":/icons/open-iconic-master/png/thumb-down-3x.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.pushButtonCancel.setIcon(icon1) self.pushButtonCancel.setIconSize(QtCore.QSize(35, 35)) self.pushButtonCancel.setDefault(False) self.pushButtonCancel.setFlat(False) self.pushButtonCancel.setObjectName("pushButtonCancel") self.horizontalLayout.addWidget(self.pushButtonCancel) self.verticalLayout.addLayout(self.horizontalLayout) self.line = QtWidgets.QFrame(Dialog) self.line.setFrameShadow(QtWidgets.QFrame.Sunken) self.line.setLineWidth(5) self.line.setFrameShape(QtWidgets.QFrame.HLine) self.line.setObjectName("line") self.verticalLayout.addWidget(self.line) self.retranslateUi(Dialog) QtCore.QMetaObject.connectSlotsByName(Dialog)
def __init__(self, parent=None): super().__init__() self.parent = parent self.setWindowTitle(self.tr("Finish")) self.setLayout(QVBoxLayout()) titleText = QLabel() self.layout().addWidget(titleText) titleText.setAlignment(Qt.AlignCenter) titleText.setText(self.tr("<h1>All of the process is completed.</h1>")) descText = QLabel() descText.setWordWrap(True) descText.setAlignment(Qt.AlignCenter) descText.setText(self.tr("Lime GNU/Linux, has been installed successfully to your system.\nTo use the newly installed system " "you can restart or you can continue to use Lime GNU/Linux Live system.")) self.layout().addWidget(descText) hlayout = QHBoxLayout() self.layout().addLayout(hlayout) hlayout.addItem(QSpacerItem(40, 20, QSizePolicy.Preferred, QSizePolicy.Preferred)) restartButton = CustomButton() restartButton.setFlat(True) restartButton.setIcon(QIcon(":/images/restart.svg")) restartButton.setIconSize(QSize(128, 128)) restartButton.setFixedSize(130, 130) hlayout.addWidget(restartButton) hlayout.addItem(QSpacerItem(40, 20, QSizePolicy.Preferred, QSizePolicy.Preferred)) restartButton.clicked.connect(self.systemRestart)
def setupUi(self, dlgDerlem): dlgDerlem.setObjectName("dlgDerlem") dlgDerlem.resize(656, 460) self.horizontalLayout_2 = QtWidgets.QHBoxLayout(dlgDerlem) self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.editGirdi = QtWidgets.QPlainTextEdit(dlgDerlem) self.editGirdi.setObjectName("editGirdi") self.verticalLayout.addWidget(self.editGirdi) self.editCikti = QtWidgets.QPlainTextEdit(dlgDerlem) self.editCikti.setObjectName("editCikti") self.verticalLayout.addWidget(self.editCikti) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.btnSecenekler = QtWidgets.QPushButton(dlgDerlem) self.btnSecenekler.setObjectName("btnSecenekler") self.horizontalLayout.addWidget(self.btnSecenekler) self.btnGirdiDosyasiSec = QtWidgets.QPushButton(dlgDerlem) self.btnGirdiDosyasiSec.setObjectName("btnGirdiDosyasiSec") self.horizontalLayout.addWidget(self.btnGirdiDosyasiSec) self.btnDonustur = QtWidgets.QPushButton(dlgDerlem) self.btnDonustur.setObjectName("btnDonustur") self.horizontalLayout.addWidget(self.btnDonustur) spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem) self.btnKaydet = QtWidgets.QPushButton(dlgDerlem) self.btnKaydet.setObjectName("btnKaydet") self.horizontalLayout.addWidget(self.btnKaydet) self.verticalLayout.addLayout(self.horizontalLayout) self.horizontalLayout_2.addLayout(self.verticalLayout) self.retranslateUi(dlgDerlem) self.btnSecenekler.clicked.connect(dlgDerlem.secenekler) self.btnGirdiDosyasiSec.clicked.connect(dlgDerlem.dosyasec) self.btnDonustur.clicked.connect(dlgDerlem.donustur) self.btnKaydet.clicked.connect(dlgDerlem.kaydet) QtCore.QMetaObject.connectSlotsByName(dlgDerlem)
def setupUi(self, Dialog): Dialog.setObjectName("Dialog") Dialog.resize(216, 152) self.verticalLayout_2 = QtWidgets.QVBoxLayout(Dialog) self.verticalLayout_2.setObjectName("verticalLayout_2") self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.chkStopword = QtWidgets.QCheckBox(Dialog) self.chkStopword.setObjectName("chkStopword") self.verticalLayout.addWidget(self.chkStopword) self.chkEnuzunkok = QtWidgets.QCheckBox(Dialog) self.chkEnuzunkok.setObjectName("chkEnuzunkok") self.verticalLayout.addWidget(self.chkEnuzunkok) self.chkTumKokleriListele = QtWidgets.QCheckBox(Dialog) self.chkTumKokleriListele.setObjectName("chkTumKokleriListele") self.verticalLayout.addWidget(self.chkTumKokleriListele) self.verticalLayout_2.addLayout(self.verticalLayout) spacerItem = QtWidgets.QSpacerItem(20, 17, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout_2.addItem(spacerItem) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.pushButton = QtWidgets.QPushButton(Dialog) self.pushButton.setObjectName("pushButton") self.horizontalLayout.addWidget(self.pushButton) spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem1) self.pushButton_2 = QtWidgets.QPushButton(Dialog) self.pushButton_2.setObjectName("pushButton_2") self.horizontalLayout.addWidget(self.pushButton_2) self.verticalLayout_2.addLayout(self.horizontalLayout) self.retranslateUi(Dialog) self.pushButton.clicked.connect(Dialog.close) self.pushButton_2.clicked.connect(Dialog.secenekKaydet) QtCore.QMetaObject.connectSlotsByName(Dialog)
def qui(self, ui_list_string, parentObject_string='', opt=''): # pre-defined user short name syntax type_dict = { 'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout', 'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget', 'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox', 'txtEdit': 'LNTextEdit', 'txt': 'QTextEdit', 'tree': 'QTreeWidget', 'table': 'QTableWidget', 'space': 'QSpacerItem', } # get ui_list, creation or existing ui object ui_list = [x.strip() for x in ui_list_string.split('|')] for i in range(len(ui_list)): if ui_list[i] in self.uiList: # - exisiting object ui_list[i] = self.uiList[ui_list[i]] else: # - string creation: # get part info partInfo = ui_list[i].split(';',1) uiName = partInfo[0].split('@')[0] uiType = uiName.rsplit('_',1)[-1] if uiType in type_dict: uiType = type_dict[uiType] # set quickUI string format ui_list[i] = partInfo[0]+';'+uiType if len(partInfo)==1: # give empty button and label a place holder name if uiType in ('btn', 'btnMsg', 'QPushButton','label', 'QLabel'): ui_list[i] = partInfo[0]+';'+uiType + ';'+uiName elif len(partInfo)==2: ui_list[i]=ui_list[i]+";"+partInfo[1] # get parentObject or exisiting object parentObject = parentObject_string if parentObject in self.uiList: parentObject = self.uiList[parentObject] # process quickUI self.quickUI(ui_list, parentObject, opt)
def run_gui(): """ Run B3 graphical user interface. Will raise an exception if the GUI cannot be initialized. """ from b3.gui import B3App from b3.gui.misc import SplashScreen from PyQt5.QtWidgets import QMessageBox from PyQt5.QtWidgets import QSpacerItem, QSizePolicy # initialize outside try/except so if PyQt5 is not avaiable or there is # no display adapter available, this will raise an exception and we can # fallback into console mode app = B3App.Instance(sys.argv) try: with SplashScreen(min_splash_time=2): mainwindow = app.init() except Exception, e: box = QMessageBox() box.setIcon(QMessageBox.Critical) box.setWindowTitle('CRITICAL') box.setText('CRITICAL: B3 FAILED TO START!') box.setInformativeText('ERROR: %s' % e) box.setDetailedText(traceback.format_exc()) box.setStandardButtons(QMessageBox.Ok) # this will trick Qt and resize a bit the QMessageBox to the exception stack trace is printed nice box.layout().addItem(QSpacerItem(400, 0, QSizePolicy.Minimum, QSizePolicy.Expanding), box.layout().rowCount(), 0, 1, box.layout().columnCount()) box.exec_() sys.exit(127) else: mainwindow.make_visible() sys.exit(app.exec_())
def process_log(self, process): """ Open the B3 instance log file. """ try: if not process.isFlag(CONFIG_FOUND): raise ConfigFileNotFound('missing configuration file (%s)' % process.config_path) elif not process.isFlag(CONFIG_VALID): raise ConfigFileNotValid('invalid configuration file (%s)' % process.config_path) if not process.config.has_option('b3', 'logfile'): raise Exception('missing b3::logfile option in %s configuration file' % process.name) path = b3.getAbsolutePath(process.config.get('b3', 'logfile'), decode=True, conf=process.config) if not os.path.isfile(path): message = '- missing: %s' % path path = os.path.join(b3.HOMEDIR, os.path.basename(path)) if not os.path.isfile(path): raise Exception(message + '\n- missing: %s' % path) except Exception, err: msgbox = QMessageBox() msgbox.setIcon(QMessageBox.Warning) msgbox.setWindowTitle('WARNING') msgbox.setText('%s log file no found' % process.name) msgbox.setDetailedText(err.message) msgbox.setStandardButtons(QMessageBox.Ok) msgbox.layout().addItem(QSpacerItem(400, 0, QSizePolicy.Minimum, QSizePolicy.Expanding), msgbox.layout().rowCount(), 0, 1, msgbox.layout().columnCount()) msgbox.exec_() else: B3App.Instance().openpath(path)
def __init__(self, parent=None): super().__init__(parent) self.setSubTitle(self.tr("<h2>Save Your Settings</h2>")) vlayout = QVBoxLayout(self) label = QLabel(self) label.setWordWrap(True) label.setText(self.tr("<p>You have successfully finished all steps. Here's a summary of the settings you want to apply. \ Click <strong>Apply Settings</strong> to save them now. You are now ready to enjoy Pisi Linux!</p>")) vlayout.addWidget(label) vlayout.addItem(QSpacerItem(20, 40, QSizePolicy.Preferred, QSizePolicy.Preferred)) groupBox = QGroupBox() groupBox.setTitle(self.tr("The following settings will be applied")) groupBox.setMinimumHeight(350) groupLayout = QHBoxLayout(groupBox) self.labelSummary = QLabel() self.labelSummary.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop) groupLayout.addWidget( self.labelSummary) self.labelSummary2 = QLabel() self.labelSummary2.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop) groupLayout.addWidget( self.labelSummary2) vlayout.addWidget(groupBox) vlayout.addItem(QSpacerItem(20, 40, QSizePolicy.Preferred, QSizePolicy.Preferred)) self.summary = {} self.parent().summaryVisible.connect(self.summaryWrite)
def __init__(self, parent=None): super().__init__(parent) self.setSubTitle(self.tr("<h2>Welcome to Pisi Linux!</h2>")) vlayout = QVBoxLayout(self) vlayout.addItem(QSpacerItem(20, 150, QSizePolicy.Preferred, QSizePolicy.Minimum)) hlayout = QHBoxLayout(self) label = QLabel(self) label.setText(self.tr("""<h1>What is Pisi Linux?</h1> <p><strong>Pisi Linux</strong> is a reliable, secure, fast and user friendly operating system.</p> <p>With Pisi Linux, you can connect to the internet, read your e-mails, work with your office documents, watch movies, play music, develop applications, play games and much more!</p> <p><strong>Kaptan</strong>, will help you personalize your Pisi Linux workspace easily and quickly. Please click <strong>Next</strong> in order to begin.</p>""")) label.setWordWrap(True) label.setAlignment(Qt.AlignLeft) hlayout.addWidget(label) kaptan_logo = QLabel(self) kaptan_logo.setScaledContents(True) kaptan_logo.setPixmap(QPixmap(":/data/images/kaptan_welcome.svg")) kaptan_logo.setAlignment(Qt.AlignRight) kaptan_logo.setFixedSize(196, 196) hlayout.addWidget(kaptan_logo) vlayout.addLayout(hlayout) vlayout.addItem(QSpacerItem(20, 40, QSizePolicy.Preferred, QSizePolicy.Preferred))
def customize_ui(self): self.spacerItem1 = QtWidgets.QSpacerItem( 40, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
def setupUi(self, AboutDialog): AboutDialog.setObjectName("AboutDialog") AboutDialog.resize(300, 120) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(AboutDialog.sizePolicy().hasHeightForWidth()) AboutDialog.setSizePolicy(sizePolicy) AboutDialog.setMinimumSize(QtCore.QSize(300, 120)) AboutDialog.setMaximumSize(QtCore.QSize(300, 120)) AboutDialog.setSizeGripEnabled(False) self.horizontalLayout_2 = QtWidgets.QHBoxLayout(AboutDialog) self.horizontalLayout_2.setSizeConstraint(QtWidgets.QLayout.SetFixedSize) self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.verticalLayout_2 = QtWidgets.QVBoxLayout() self.verticalLayout_2.setContentsMargins(0, -1, -1, -1) self.verticalLayout_2.setSpacing(7) self.verticalLayout_2.setObjectName("verticalLayout_2") self.iconLabel = QtWidgets.QLabel(AboutDialog) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.iconLabel.sizePolicy().hasHeightForWidth()) self.iconLabel.setSizePolicy(sizePolicy) self.iconLabel.setMinimumSize(QtCore.QSize(64, 64)) self.iconLabel.setMaximumSize(QtCore.QSize(64, 64)) self.iconLabel.setText("") self.iconLabel.setPixmap(QtGui.QPixmap(PyInstallerHelper.resource_path("icons/main-512.png"))) self.iconLabel.setScaledContents(True) self.iconLabel.setObjectName("iconLabel") self.verticalLayout_2.addWidget(self.iconLabel) spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout_2.addItem(spacerItem) self.horizontalLayout_2.addLayout(self.verticalLayout_2) spacerItem1 = QtWidgets.QSpacerItem(10, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout_2.addItem(spacerItem1) self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.label = QtWidgets.QLabel(AboutDialog) self.label.setObjectName("label") self.horizontalLayout.addWidget(self.label) spacerItem2 = QtWidgets.QSpacerItem(100, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem2) self.versionLabel = QtWidgets.QLabel(AboutDialog) self.versionLabel.setObjectName("versionLabel") self.horizontalLayout.addWidget(self.versionLabel) self.verticalLayout.addLayout(self.horizontalLayout) spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout.addItem(spacerItem3) self.horizontalLayout_2.addLayout(self.verticalLayout) self.retranslateUi(AboutDialog) QtCore.QMetaObject.connectSlotsByName(AboutDialog)
def __init__(self, parent=None): super().__init__(parent) self.setSubTitle(self.tr("<h2>Select Menu Style</h2>")) texts = [ self.tr("<p>Application Menu is the default for KaOS because of its \ extremely lightweight (and fast) structure.</p>"), self.tr("<p>Application Launcher is the standard for KDE. \ Application shortcuts are arranged under a tab structure.</p>"), self.tr("<p>Application Panel is a full screen menu style. \ Application shortcuts are arranged so that you can access them quickly and easily.</p>") ] self.menus = [[":/data/images/menu-kicker.png", texts[0]], [":/data/images/menu-kickoff.png", texts[1]], [":/data/images/menu-kimpanel.png", texts[2]]] vlayout = QVBoxLayout(self) labelLayout = QHBoxLayout() iconLabel = QLabel() iconLabel.setMaximumSize(64, 64) iconLabel.setPixmap(QIcon.fromTheme("kde").pixmap(64, 64)) labelLayout.addWidget(iconLabel) label = QLabel(self) label.setText(self.tr("<p>You can also customize your <strong>KDE menu</strong> as you like. \ Please choose one from the following styles.</p>")) labelLayout.addWidget(label) vlayout.addLayout(labelLayout) vlayout.addItem(QSpacerItem(20, 40, QSizePolicy.Preferred, QSizePolicy.Preferred)) self.comboBox = QComboBox(self) self.comboBox.addItem(self.tr("Application Menu")) self.comboBox.addItem(self.tr("Application Launcher")) self.comboBox.addItem(self.tr("Application Dashboard")) vlayout.addWidget(self.comboBox) vlayout.addItem(QSpacerItem(20, 40, QSizePolicy.Preferred, QSizePolicy.Preferred)) hlayout = QHBoxLayout(self) self.labelMenu = QLabel(self) self.labelMenu.setPixmap(QPixmap(self.menus[0][0])) self.labelMenu.setMaximumSize(350 ,214) hlayout.addWidget(self.labelMenu) self.labelText = QLabel(self) self.labelText.setWordWrap(True) self.labelText.setText(self.tr(self.menus[0][1])) hlayout.addWidget(self.labelText) vlayout.addLayout(hlayout) vlayout.addItem(QSpacerItem(20, 40, QSizePolicy.Preferred, QSizePolicy.Preferred)) self.comboBox.currentIndexChanged.connect(self.menuSelect) self.menuSelected = 0
def setupUi(self, ButtonList): ButtonList.setObjectName("ButtonList") ButtonList.resize(472, 184) self.verticalLayout = QtWidgets.QVBoxLayout(ButtonList) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setSpacing(6) self.verticalLayout.setObjectName("verticalLayout") self.list_widget = QtWidgets.QListWidget(ButtonList) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Ignored) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.list_widget.sizePolicy().hasHeightForWidth()) self.list_widget.setSizePolicy(sizePolicy) self.list_widget.setMinimumSize(QtCore.QSize(0, 24)) self.list_widget.setDragDropMode(QtWidgets.QAbstractItemView.InternalMove) self.list_widget.setSelectionMode(QtWidgets.QAbstractItemView.ContiguousSelection) self.list_widget.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows) self.list_widget.setObjectName("list_widget") self.verticalLayout.addWidget(self.list_widget) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.horizontalLayout.setSpacing(3) self.horizontalLayout.setObjectName("horizontalLayout") self.button_remove_group = QtWidgets.QPushButton(ButtonList) self.button_remove_group.setObjectName("button_remove_group") self.horizontalLayout.addWidget(self.button_remove_group) spacerItem = QtWidgets.QSpacerItem(0, 0, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem) self.button_group_up = QtWidgets.QToolButton(ButtonList) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.button_group_up.sizePolicy().hasHeightForWidth()) self.button_group_up.setSizePolicy(sizePolicy) self.button_group_up.setText("") self.button_group_up.setObjectName("button_group_up") self.horizontalLayout.addWidget(self.button_group_up) self.button_group_down = QtWidgets.QToolButton(ButtonList) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.button_group_down.sizePolicy().hasHeightForWidth()) self.button_group_down.setSizePolicy(sizePolicy) self.button_group_down.setText("") self.button_group_down.setObjectName("button_group_down") self.horizontalLayout.addWidget(self.button_group_down) self.verticalLayout.addLayout(self.horizontalLayout) self.verticalLayout.setStretch(0, 1) self.retranslateUi(ButtonList) QtCore.QMetaObject.connectSlotsByName(ButtonList)
def setupUi(self, UniqueViewer): UniqueViewer.setObjectName("UniqueViewer") UniqueViewer.resize(407, 544) self.verticalLayout = QtWidgets.QVBoxLayout(UniqueViewer) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setObjectName("verticalLayout") self.verticalLayout_2 = QtWidgets.QVBoxLayout() self.verticalLayout_2.setSpacing(0) self.verticalLayout_2.setObjectName("verticalLayout_2") self.verticalLayout_3 = QtWidgets.QVBoxLayout() self.verticalLayout_3.setContentsMargins(4, -1, 4, -1) self.verticalLayout_3.setSpacing(1) self.verticalLayout_3.setObjectName("verticalLayout_3") self.label_inform = QtWidgets.QLabel(UniqueViewer) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Minimum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.label_inform.sizePolicy().hasHeightForWidth()) self.label_inform.setSizePolicy(sizePolicy) self.label_inform.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) self.label_inform.setObjectName("label_inform") self.verticalLayout_3.addWidget(self.label_inform) self.progress_bar = QtWidgets.QProgressBar(UniqueViewer) self.progress_bar.setMaximum(0) self.progress_bar.setProperty("value", 0) self.progress_bar.setObjectName("progress_bar") self.verticalLayout_3.addWidget(self.progress_bar) self.verticalLayout_2.addLayout(self.verticalLayout_3) self.tableWidget = QtWidgets.QTableWidget(UniqueViewer) self.tableWidget.setAlternatingRowColors(True) self.tableWidget.setShowGrid(False) self.tableWidget.setCornerButtonEnabled(False) self.tableWidget.setObjectName("tableWidget") self.tableWidget.setColumnCount(0) self.tableWidget.setRowCount(0) self.tableWidget.horizontalHeader().setSortIndicatorShown(True) self.tableWidget.horizontalHeader().setStretchLastSection(True) self.verticalLayout_2.addWidget(self.tableWidget) spacerItem = QtWidgets.QSpacerItem(20, 0, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout_2.addItem(spacerItem) self.verticalLayout_2.setStretch(1, 1) self.verticalLayout.addLayout(self.verticalLayout_2) self.buttonBox = QtWidgets.QDialogButtonBox(UniqueViewer) self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Save) self.buttonBox.setObjectName("buttonBox") self.verticalLayout.addWidget(self.buttonBox) self.retranslateUi(UniqueViewer) QtCore.QMetaObject.connectSlotsByName(UniqueViewer)
def setupUi(self, RegexDialog): RegexDialog.setObjectName("RegexDialog") RegexDialog.resize(640, 480) self.verticalLayout = QtWidgets.QVBoxLayout(RegexDialog) self.verticalLayout.setObjectName("verticalLayout") self.gridLayout = QtWidgets.QGridLayout() self.gridLayout.setObjectName("gridLayout") self.edit_regex = QtWidgets.QLineEdit(RegexDialog) self.edit_regex.setObjectName("edit_regex") self.gridLayout.addWidget(self.edit_regex, 1, 0, 1, 1) self.edit_test_string = QtWidgets.QLineEdit(RegexDialog) self.edit_test_string.setObjectName("edit_test_string") self.gridLayout.addWidget(self.edit_test_string, 4, 0, 1, 1) self.label = QtWidgets.QLabel(RegexDialog) self.label.setObjectName("label") self.gridLayout.addWidget(self.label, 0, 0, 1, 1) self.label_3 = QtWidgets.QLabel(RegexDialog) self.label_3.setObjectName("label_3") self.gridLayout.addWidget(self.label_3, 0, 1, 1, 1) self.text_cheatsheet = QtWidgets.QTextBrowser(RegexDialog) self.text_cheatsheet.setObjectName("text_cheatsheet") self.gridLayout.addWidget(self.text_cheatsheet, 6, 0, 1, 2) self.label_2 = QtWidgets.QLabel(RegexDialog) self.label_2.setObjectName("label_2") self.gridLayout.addWidget(self.label_2, 3, 0, 1, 1) spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.gridLayout.addItem(spacerItem, 5, 0, 1, 1) self.table_groups = QtWidgets.QTableWidget(RegexDialog) self.table_groups.setColumnCount(1) self.table_groups.setObjectName("table_groups") self.table_groups.setRowCount(0) self.table_groups.horizontalHeader().setVisible(False) self.table_groups.horizontalHeader().setStretchLastSection(True) self.gridLayout.addWidget(self.table_groups, 1, 1, 5, 1) self.label_error = QtWidgets.QLabel(RegexDialog) self.label_error.setText("") self.label_error.setObjectName("label_error") self.gridLayout.addWidget(self.label_error, 2, 0, 1, 1) self.gridLayout.setColumnStretch(0, 3) self.gridLayout.setColumnStretch(1, 2) self.verticalLayout.addLayout(self.gridLayout) self.label.setBuddy(self.edit_regex) self.label_2.setBuddy(self.edit_test_string) self.retranslateUi(RegexDialog) QtCore.QMetaObject.connectSlotsByName(RegexDialog)
def setupUi(self, logfileDialog): logfileDialog.setObjectName("logfileDialog") logfileDialog.resize(640, 480) self.verticalLayout = QtWidgets.QVBoxLayout(logfileDialog) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setSpacing(10) self.verticalLayout.setObjectName("verticalLayout") self.scrollArea = QtWidgets.QScrollArea(logfileDialog) self.scrollArea.setFrameShape(QtWidgets.QFrame.NoFrame) self.scrollArea.setWidgetResizable(True) self.scrollArea.setObjectName("scrollArea") self.scrollAreaWidgetContents = QtWidgets.QWidget() self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 640, 480)) self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents") self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents) self.verticalLayout_2.setContentsMargins(0, 0, 0, 0) self.verticalLayout_2.setObjectName("verticalLayout_2") self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.label = QtWidgets.QLabel(self.scrollAreaWidgetContents) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth()) self.label.setSizePolicy(sizePolicy) self.label.setObjectName("label") self.horizontalLayout.addWidget(self.label) self.check_errors = QtWidgets.QCheckBox(self.scrollAreaWidgetContents) self.check_errors.setObjectName("check_errors") self.horizontalLayout.addWidget(self.check_errors) self.check_warnings = QtWidgets.QCheckBox(self.scrollAreaWidgetContents) self.check_warnings.setObjectName("check_warnings") self.horizontalLayout.addWidget(self.check_warnings) self.check_info = QtWidgets.QCheckBox(self.scrollAreaWidgetContents) self.check_info.setObjectName("check_info") self.horizontalLayout.addWidget(self.check_info) spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem) self.verticalLayout_2.addLayout(self.horizontalLayout) self.log_table = QtWidgets.QTableView(self.scrollAreaWidgetContents) self.log_table.setHorizontalScrollMode(QtWidgets.QAbstractItemView.ScrollPerPixel) self.log_table.setObjectName("log_table") self.log_table.horizontalHeader().setStretchLastSection(True) self.log_table.verticalHeader().setVisible(False) self.verticalLayout_2.addWidget(self.log_table) self.scrollArea.setWidget(self.scrollAreaWidgetContents) self.verticalLayout.addWidget(self.scrollArea) self.retranslateUi(logfileDialog) QtCore.QMetaObject.connectSlotsByName(logfileDialog)
def setupUi(self, TabMapSpecific): TabMapSpecific.setObjectName("TabMapSpecific") TabMapSpecific.resize(445, 534) self.gridLayout = QtWidgets.QGridLayout(TabMapSpecific) self.gridLayout.setContentsMargins(0, 0, 0, 0) self.gridLayout.setSpacing(0) self.gridLayout.setObjectName("gridLayout") self.scrollArea_2 = QtWidgets.QScrollArea(TabMapSpecific) self.scrollArea_2.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) self.scrollArea_2.setWidgetResizable(True) self.scrollArea_2.setObjectName("scrollArea_2") self.scrollAreaWidgetContents_2 = QtWidgets.QWidget() self.scrollAreaWidgetContents_2.setGeometry(QtCore.QRect(0, 0, 443, 532)) self.scrollAreaWidgetContents_2.setObjectName("scrollAreaWidgetContents_2") self.verticalLayout = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents_2) self.verticalLayout.setContentsMargins(6, 6, 6, 6) self.verticalLayout.setSpacing(6) self.verticalLayout.setObjectName("verticalLayout") self.selectedMap = QtWidgets.QComboBox(self.scrollAreaWidgetContents_2) self.selectedMap.setObjectName("selectedMap") self.verticalLayout.addWidget(self.selectedMap) self.frame = QtWidgets.QFrame(self.scrollAreaWidgetContents_2) self.frame.setFrameShape(QtWidgets.QFrame.NoFrame) self.frame.setFrameShadow(QtWidgets.QFrame.Raised) self.frame.setObjectName("frame") self.gridLayout_4 = QtWidgets.QGridLayout(self.frame) self.gridLayout_4.setContentsMargins(0, 0, 0, 0) self.gridLayout_4.setSpacing(0) self.gridLayout_4.setObjectName("gridLayout_4") self.mapSpecificOptionsPosition = QtWidgets.QGridLayout() self.mapSpecificOptionsPosition.setSpacing(0) self.mapSpecificOptionsPosition.setObjectName("mapSpecificOptionsPosition") self.gridLayout_4.addLayout(self.mapSpecificOptionsPosition, 0, 0, 1, 1) self.verticalLayout.addWidget(self.frame) spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout.addItem(spacerItem) self.scrollArea_2.setWidget(self.scrollAreaWidgetContents_2) self.gridLayout.addWidget(self.scrollArea_2, 0, 0, 1, 1) self.retranslateUi(TabMapSpecific) QtCore.QMetaObject.connectSlotsByName(TabMapSpecific) TabMapSpecific.setTabOrder(self.scrollArea_2, self.selectedMap)
def setupUi(self, RuntimeSettingsDialog): RuntimeSettingsDialog.setObjectName("RuntimeSettingsDialog") RuntimeSettingsDialog.resize(844, 243) self.verticalLayout = QtWidgets.QVBoxLayout(RuntimeSettingsDialog) self.verticalLayout.setObjectName("verticalLayout") self.verticalLayout_3 = QtWidgets.QVBoxLayout() self.verticalLayout_3.setSpacing(0) self.verticalLayout_3.setObjectName("verticalLayout_3") self.label_3 = QtWidgets.QLabel(RuntimeSettingsDialog) font = QtGui.QFont() font.setPointSize(14) self.label_3.setFont(font) self.label_3.setObjectName("label_3") self.verticalLayout_3.addWidget(self.label_3) self.label_4 = QtWidgets.QLabel(RuntimeSettingsDialog) font = QtGui.QFont() font.setItalic(True) self.label_4.setFont(font) self.label_4.setObjectName("label_4") self.verticalLayout_3.addWidget(self.label_4) self.verticalLayout.addLayout(self.verticalLayout_3) self.line = QtWidgets.QFrame(RuntimeSettingsDialog) self.line.setFrameShape(QtWidgets.QFrame.HLine) self.line.setFrameShadow(QtWidgets.QFrame.Sunken) self.line.setObjectName("line") self.verticalLayout.addWidget(self.line) self.gridLayout = QtWidgets.QGridLayout() self.gridLayout.setObjectName("gridLayout") self.cldevicesSelection = QtWidgets.QListWidget(RuntimeSettingsDialog) self.cldevicesSelection.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection) self.cldevicesSelection.setObjectName("cldevicesSelection") self.gridLayout.addWidget(self.cldevicesSelection, 0, 1, 1, 1) self.label_10 = QtWidgets.QLabel(RuntimeSettingsDialog) font = QtGui.QFont() font.setItalic(True) self.label_10.setFont(font) self.label_10.setObjectName("label_10") self.gridLayout.addWidget(self.label_10, 0, 2, 1, 1) self.label = QtWidgets.QLabel(RuntimeSettingsDialog) self.label.setObjectName("label") self.gridLayout.addWidget(self.label, 0, 0, 1, 1) self.verticalLayout.addLayout(self.gridLayout) spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout.addItem(spacerItem) self.line_3 = QtWidgets.QFrame(RuntimeSettingsDialog) self.line_3.setFrameShape(QtWidgets.QFrame.HLine) self.line_3.setFrameShadow(QtWidgets.QFrame.Sunken) self.line_3.setObjectName("line_3") self.verticalLayout.addWidget(self.line_3) self.buttonBox = QtWidgets.QDialogButtonBox(RuntimeSettingsDialog) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.verticalLayout.addWidget(self.buttonBox) self.retranslateUi(RuntimeSettingsDialog) self.buttonBox.accepted.connect(RuntimeSettingsDialog.accept) self.buttonBox.rejected.connect(RuntimeSettingsDialog.reject) QtCore.QMetaObject.connectSlotsByName(RuntimeSettingsDialog)
def setupUi(self, ConnectionsGroup): ConnectionsGroup.setObjectName("ConnectionsGroup") ConnectionsGroup.resize(508, 100) self.verticalLayout = QtWidgets.QVBoxLayout(ConnectionsGroup) self.verticalLayout.setObjectName("verticalLayout") self.cbxConnections = QtWidgets.QComboBox(ConnectionsGroup) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.cbxConnections.sizePolicy().hasHeightForWidth()) self.cbxConnections.setSizePolicy(sizePolicy) self.cbxConnections.setObjectName("cbxConnections") self.verticalLayout.addWidget(self.cbxConnections) self.horizontalLayout_3 = QtWidgets.QHBoxLayout() self.horizontalLayout_3.setSizeConstraint(QtWidgets.QLayout.SetMinimumSize) self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.btnConnect = QtWidgets.QPushButton(ConnectionsGroup) self.btnConnect.setEnabled(False) self.btnConnect.setObjectName("btnConnect") self.horizontalLayout_3.addWidget(self.btnConnect) self.btnCreateConnection = QtWidgets.QPushButton(ConnectionsGroup) self.btnCreateConnection.setObjectName("btnCreateConnection") self.horizontalLayout_3.addWidget(self.btnCreateConnection) self.btnEdit = QtWidgets.QPushButton(ConnectionsGroup) self.btnEdit.setEnabled(False) self.btnEdit.setObjectName("btnEdit") self.horizontalLayout_3.addWidget(self.btnEdit) self.btnDelete = QtWidgets.QPushButton(ConnectionsGroup) self.btnDelete.setEnabled(False) self.btnDelete.setMaximumSize(QtCore.QSize(80, 16777215)) self.btnDelete.setObjectName("btnDelete") self.horizontalLayout_3.addWidget(self.btnDelete) spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout_3.addItem(spacerItem) self.btnLoad = QtWidgets.QPushButton(ConnectionsGroup) self.btnLoad.setMaximumSize(QtCore.QSize(80, 16777215)) self.btnLoad.setObjectName("btnLoad") self.horizontalLayout_3.addWidget(self.btnLoad) self.btnSave = QtWidgets.QPushButton(ConnectionsGroup) self.btnSave.setMaximumSize(QtCore.QSize(80, 16777215)) self.btnSave.setObjectName("btnSave") self.horizontalLayout_3.addWidget(self.btnSave) self.verticalLayout.addLayout(self.horizontalLayout_3) self.retranslateUi(ConnectionsGroup) QtCore.QMetaObject.connectSlotsByName(ConnectionsGroup)
def setupUi(self, DlgEditTileJSONConnection): DlgEditTileJSONConnection.setObjectName("DlgEditTileJSONConnection") DlgEditTileJSONConnection.resize(636, 154) self.verticalLayout_3 = QtWidgets.QVBoxLayout(DlgEditTileJSONConnection) self.verticalLayout_3.setObjectName("verticalLayout_3") self.groupBox = QtWidgets.QGroupBox(DlgEditTileJSONConnection) self.groupBox.setObjectName("groupBox") self.gridLayout = QtWidgets.QGridLayout(self.groupBox) self.gridLayout.setObjectName("gridLayout") self.txtName = QtWidgets.QLineEdit(self.groupBox) self.txtName.setText("") self.txtName.setObjectName("txtName") self.gridLayout.addWidget(self.txtName, 0, 1, 1, 1) self.label = QtWidgets.QLabel(self.groupBox) self.label.setObjectName("label") self.gridLayout.addWidget(self.label, 0, 0, 1, 1) self.lblTileJsonUrl = QtWidgets.QLabel(self.groupBox) self.lblTileJsonUrl.setObjectName("lblTileJsonUrl") self.gridLayout.addWidget(self.lblTileJsonUrl, 1, 0, 1, 1) self.txtUrl = QtWidgets.QLineEdit(self.groupBox) self.txtUrl.setText("") self.txtUrl.setPlaceholderText("") self.txtUrl.setObjectName("txtUrl") self.gridLayout.addWidget(self.txtUrl, 1, 1, 1, 1) self.txtStyleJsonUrl = QtWidgets.QLineEdit(self.groupBox) self.txtStyleJsonUrl.setObjectName("txtStyleJsonUrl") self.gridLayout.addWidget(self.txtStyleJsonUrl, 2, 1, 1, 1) self.lblServerStyleJsonUrl = QtWidgets.QLabel(self.groupBox) self.lblServerStyleJsonUrl.setObjectName("lblServerStyleJsonUrl") self.gridLayout.addWidget(self.lblServerStyleJsonUrl, 2, 0, 1, 1) self.verticalLayout_3.addWidget(self.groupBox) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem) self.btnSave = QtWidgets.QPushButton(DlgEditTileJSONConnection) self.btnSave.setEnabled(False) self.btnSave.setCheckable(False) self.btnSave.setObjectName("btnSave") self.horizontalLayout.addWidget(self.btnSave) self.btnCancel = QtWidgets.QPushButton(DlgEditTileJSONConnection) self.btnCancel.setObjectName("btnCancel") self.horizontalLayout.addWidget(self.btnCancel) self.verticalLayout_3.addLayout(self.horizontalLayout) self.verticalLayout_3.setStretch(1, 1) self.retranslateUi(DlgEditTileJSONConnection) self.btnCancel.clicked.connect(DlgEditTileJSONConnection.reject) self.btnSave.clicked.connect(DlgEditTileJSONConnection.accept) QtCore.QMetaObject.connectSlotsByName(DlgEditTileJSONConnection)
def setupUi(self, Form): Form.setObjectName("Form") Form.resize(549, 437) self.gridLayout = QtWidgets.QGridLayout(Form) self.gridLayout.setObjectName("gridLayout") self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.pushButton_Stop = QtWidgets.QPushButton(Form) self.pushButton_Stop.setObjectName("pushButton_Stop") self.horizontalLayout.addWidget(self.pushButton_Stop) spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem) self.comboBox_ValueType = QtWidgets.QComboBox(Form) self.comboBox_ValueType.setToolTip("") self.comboBox_ValueType.setSizeAdjustPolicy(QtWidgets.QComboBox.AdjustToContents) self.comboBox_ValueType.setObjectName("comboBox_ValueType") self.horizontalLayout.addWidget(self.comboBox_ValueType) self.gridLayout.addLayout(self.horizontalLayout, 3, 0, 1, 1) self.tableWidget_TrackInfo = QtWidgets.QTableWidget(Form) self.tableWidget_TrackInfo.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) self.tableWidget_TrackInfo.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection) self.tableWidget_TrackInfo.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows) self.tableWidget_TrackInfo.setObjectName("tableWidget_TrackInfo") self.tableWidget_TrackInfo.setColumnCount(4) self.tableWidget_TrackInfo.setRowCount(0) item = QtWidgets.QTableWidgetItem() self.tableWidget_TrackInfo.setHorizontalHeaderItem(0, item) item = QtWidgets.QTableWidgetItem() self.tableWidget_TrackInfo.setHorizontalHeaderItem(1, item) item = QtWidgets.QTableWidgetItem() self.tableWidget_TrackInfo.setHorizontalHeaderItem(2, item) item = QtWidgets.QTableWidgetItem() self.tableWidget_TrackInfo.setHorizontalHeaderItem(3, item) self.tableWidget_TrackInfo.horizontalHeader().setStretchLastSection(True) self.tableWidget_TrackInfo.verticalHeader().setVisible(False) self.tableWidget_TrackInfo.verticalHeader().setDefaultSectionSize(16) self.tableWidget_TrackInfo.verticalHeader().setMinimumSectionSize(16) self.gridLayout.addWidget(self.tableWidget_TrackInfo, 0, 0, 1, 1) self.label_Info = QtWidgets.QLabel(Form) self.label_Info.setText("") self.label_Info.setAlignment(QtCore.Qt.AlignCenter) self.label_Info.setObjectName("label_Info") self.gridLayout.addWidget(self.label_Info, 1, 0, 1, 1) self.label_AdditionalInfo = QtWidgets.QLabel(Form) self.label_AdditionalInfo.setAlignment(QtCore.Qt.AlignCenter) self.label_AdditionalInfo.setObjectName("label_AdditionalInfo") self.gridLayout.addWidget(self.label_AdditionalInfo, 2, 0, 1, 1) self.retranslateUi(Form) self.comboBox_ValueType.setCurrentIndex(-1) QtCore.QMetaObject.connectSlotsByName(Form)
def setupUi(self, Form): Form.setObjectName("Form") Form.resize(286, 336) self.gridLayout = QtWidgets.QGridLayout(Form) self.gridLayout.setObjectName("gridLayout") self.buttonNew = QtWidgets.QPushButton(Form) self.buttonNew.setMinimumSize(QtCore.QSize(0, 25)) self.buttonNew.setObjectName("buttonNew") self.gridLayout.addWidget(self.buttonNew, 4, 0, 1, 1) self.buttonRules = QtWidgets.QPushButton(Form) self.buttonRules.setMinimumSize(QtCore.QSize(0, 25)) self.buttonRules.setObjectName("buttonRules") self.gridLayout.addWidget(self.buttonRules, 7, 0, 1, 1) self.buttonEdit = QtWidgets.QPushButton(Form) self.buttonEdit.setMinimumSize(QtCore.QSize(0, 25)) self.buttonEdit.setObjectName("buttonEdit") self.gridLayout.addWidget(self.buttonEdit, 5, 0, 1, 1) self.label = QtWidgets.QLabel(Form) self.label.setMinimumSize(QtCore.QSize(0, 30)) font = QtGui.QFont() font.setPointSize(13) font.setBold(True) font.setItalic(True) font.setWeight(75) font.setKerning(True) self.label.setFont(font) self.label.setScaledContents(False) self.label.setAlignment(QtCore.Qt.AlignCenter) self.label.setObjectName("label") self.gridLayout.addWidget(self.label, 1, 0, 1, 1) self.label_2 = QtWidgets.QLabel(Form) self.label_2.setMinimumSize(QtCore.QSize(0, 20)) self.label_2.setAlignment(QtCore.Qt.AlignCenter) self.label_2.setObjectName("label_2") self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1) spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.gridLayout.addItem(spacerItem, 3, 0, 1, 1) spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.gridLayout.addItem(spacerItem1, 6, 0, 1, 1) self.labelVersion = QtWidgets.QLabel(Form) font = QtGui.QFont() font.setPointSize(7) font.setItalic(True) self.labelVersion.setFont(font) self.labelVersion.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) self.labelVersion.setObjectName("labelVersion") self.gridLayout.addWidget(self.labelVersion, 9, 0, 1, 1) spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.gridLayout.addItem(spacerItem2, 8, 0, 1, 1) spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.gridLayout.addItem(spacerItem3, 0, 0, 1, 1) self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form) Form.setTabOrder(self.buttonNew, self.buttonEdit) Form.setTabOrder(self.buttonEdit, self.buttonRules)
def setupUi(self, Form): Form.setObjectName("Form") Form.resize(867, 300) self.horizontalLayout = QtWidgets.QHBoxLayout(Form) self.horizontalLayout.setObjectName("horizontalLayout") self.frameOptions = QtWidgets.QFrame(Form) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.frameOptions.sizePolicy().hasHeightForWidth()) self.frameOptions.setSizePolicy(sizePolicy) self.frameOptions.setFrameShape(QtWidgets.QFrame.StyledPanel) self.frameOptions.setFrameShadow(QtWidgets.QFrame.Plain) self.frameOptions.setObjectName("frameOptions") self.gridLayout = QtWidgets.QGridLayout(self.frameOptions) self.gridLayout.setObjectName("gridLayout") self.verticalLayoutButtons = QtWidgets.QVBoxLayout() self.verticalLayoutButtons.setObjectName("verticalLayoutButtons") self.gridLayout.addLayout(self.verticalLayoutButtons, 0, 0, 1, 1) spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.gridLayout.addItem(spacerItem, 1, 0, 1, 1) self.horizontalLayout.addWidget(self.frameOptions) self.frameWidgets = QtWidgets.QFrame(Form) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.frameWidgets.sizePolicy().hasHeightForWidth()) self.frameWidgets.setSizePolicy(sizePolicy) self.frameWidgets.setFrameShape(QtWidgets.QFrame.StyledPanel) self.frameWidgets.setFrameShadow(QtWidgets.QFrame.Plain) self.frameWidgets.setObjectName("frameWidgets") self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.frameWidgets) self.verticalLayout_3.setContentsMargins(5, 5, 5, 5) self.verticalLayout_3.setObjectName("verticalLayout_3") self.verticalLayoutWidgets = QtWidgets.QVBoxLayout() self.verticalLayoutWidgets.setObjectName("verticalLayoutWidgets") spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayoutWidgets.addItem(spacerItem1) self.verticalLayout_3.addLayout(self.verticalLayoutWidgets) self.horizontalLayout.addWidget(self.frameWidgets) self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form)
def setupUi(self, Form): Form.setObjectName("Form") Form.resize(643, 91) Form.setStyleSheet("font: 10pt \"Arial\";") self.horizontalLayout = QtWidgets.QHBoxLayout(Form) self.horizontalLayout.setObjectName("horizontalLayout") self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.label = QtWidgets.QLabel(Form) self.label.setObjectName("label") self.verticalLayout.addWidget(self.label) self.spinBoxWinSize = QtWidgets.QSpinBox(Form) self.spinBoxWinSize.setKeyboardTracking(False) self.spinBoxWinSize.setMinimum(1) self.spinBoxWinSize.setMaximum(1000000) self.spinBoxWinSize.setObjectName("spinBoxWinSize") self.verticalLayout.addWidget(self.spinBoxWinSize) spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout.addItem(spacerItem) self.horizontalLayout.addLayout(self.verticalLayout) self.verticalLayout_2 = QtWidgets.QVBoxLayout() self.verticalLayout_2.setObjectName("verticalLayout_2") self.label_2 = QtWidgets.QLabel(Form) font = QtGui.QFont() font.setFamily("Arial") font.setPointSize(10) font.setBold(False) font.setItalic(False) font.setWeight(50) self.label_2.setFont(font) self.label_2.setObjectName("label_2") self.verticalLayout_2.addWidget(self.label_2) self.spinBoxOrder = QtWidgets.QSpinBox(Form) self.spinBoxOrder.setKeyboardTracking(False) self.spinBoxOrder.setMinimum(1) self.spinBoxOrder.setMaximum(101) self.spinBoxOrder.setObjectName("spinBoxOrder") self.verticalLayout_2.addWidget(self.spinBoxOrder) spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout_2.addItem(spacerItem1) self.horizontalLayout.addLayout(self.verticalLayout_2) self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form)
def initUI(self): button_clasterization = QPushButton("?????????????") button_clasterization.setMinimumHeight(32) button_clasterization.clicked.connect(self.clasterization) button_clastering = QPushButton("????????????? (LIB)") button_clastering.setMinimumHeight(32) button_clastering.clicked.connect(self.clastering) button_classification = QPushButton("?????????????") button_classification.setMinimumHeight(32) button_classification.clicked.connect(self.classification) button_classification_lib = QPushButton("????????????? (LIB)") button_classification_lib.setMinimumHeight(32) button_classification_lib.clicked.connect(self.classification_lib) button_lsa = QPushButton("????????-????????????? ??????") button_lsa.setMinimumHeight(32) button_lsa.clicked.connect(self.makeLSA) button_analyze_and_rule_apply = QPushButton("?????? ? ??????? ?????? ???????????") button_analyze_and_rule_apply.setMinimumHeight(32) button_analyze_and_rule_apply.clicked.connect(self.analyze_and_rule_apply) button_xi_square = QPushButton("??????? ????????? ??? ????????? ??????") button_xi_square.setMinimumHeight(32) button_xi_square.clicked.connect(self.makeXiSquare) button_annotation = QPushButton("???????? ????????? ?????????") button_annotation.setMinimumHeight(32) button_annotation.clicked.connect(self.makeTextAnnotation) #button_annotation.setEnabled(False) spacer = QSpacerItem(20,40,QSizePolicy.Minimum,QSizePolicy.Expanding) vbox = QVBoxLayout() vbox.addWidget(button_clasterization) vbox.addWidget(button_clastering) vbox.addWidget(button_classification) vbox.addWidget(button_classification_lib) vbox.addWidget(button_lsa) vbox.addWidget(button_analyze_and_rule_apply) vbox.addWidget(button_xi_square) vbox.addWidget(button_annotation) vbox.addItem(spacer) widget = QWidget(); widget.setLayout(vbox); self.setCentralWidget(widget); self.setGeometry(300, 300, 480, 320) self.setWindowTitle('??????? ????????? ?????????') self.show()
def __init__(self, parent=None): super().__init__() self.parent = parent self.setWindowTitle(self.tr("System Location")) self.setLayout(QVBoxLayout()) self.layout().setAlignment(Qt.AlignCenter) layout = QHBoxLayout() self.layout().addLayout(layout) worldMap = QLabel() worldMap.setFixedSize(480, 283) worldMap.setScaledContents(True) worldMap.setPixmap(QPixmap(":/images/world.svg")) layout.addWidget(worldMap) hlayout = QHBoxLayout() self.layout().addLayout(hlayout) cLabel = QLabel() cLabel.setText(self.tr("Region:")) hlayout.addWidget(cLabel) self.cBox = QComboBox() self.cBox.setFixedWidth(300) hlayout.addWidget(self.cBox) hlayout.addSpacerItem(QSpacerItem(40, 20, QSizePolicy.Preferred, QSizePolicy.Expanding)) iLabel = QLabel() iLabel.setText(self.tr("City:")) hlayout.addWidget(iLabel) self.iBox = QComboBox() self.iBox.setFixedWidth(300) hlayout.addWidget(self.iBox) self.cBox.addItems(zone) info = zone_info[self.cBox.currentText()] info.sort() self.iBox.addItems(info) self.parent.lilii_settings["timezone"] = "{}/{}".format(self.cBox.currentText() , self.iBox.currentText()) self.cBox.currentTextChanged.connect(self.zoneChanged) self.iBox.currentTextChanged.connect(self.cityChanged)