def initUI(self): title = QLabel('标题') author = QLabel('提交人') review = QLabel('申告内容') titleEdit = QLineEdit() authorEdit = QLineEdit() reviewEdit = QTextEdit() grid = QGridLayout() grid.setSpacing(10) grid.addWidget(title, 1, 0) grid.addWidget(titleEdit, 1, 1) grid.addWidget(author, 2, 0) grid.addWidget(authorEdit, 2, 1) grid.addWidget(review, 3, 0) grid.addWidget(reviewEdit, 3, 1, 5, 1) self.setLayout(grid) self.setGeometry(300, 300, 350, 300) self.setWindowTitle('故障申告')
def init_ui(self): self.setFixedSize(400, 180) self.move2center() content = ([] if 'darwin' not in sys.platform else [ 'Press Cmd + r to speed up(refresh)', 'Press Cmd + , to open settings', 'Press Cmd + q to quit', ]) content.append(f'Version {VERSION}') grid = QGridLayout() grid.setSpacing(10) a_tag = ''' <a href="https://ukiyoesoragoto.com" style="color:Black"> By UkiyoESoragoto (๑•̀ㅂ•́)و✧ </a> ''' lab = QLabel(a_tag) lab.setOpenExternalLinks(True) grid.addWidget(lab, 0, 0) for index, line in enumerate(content): grid.addWidget(QLabel(line), index + 1, 0) self.setLayout(grid) self.setWindowTitle('About')
def initUI(self): title = QLabel("Title") author = QLabel("Author") review = QLabel("Review") titleEdit = QLineEdit() authorEdit = QLineEdit() reviewEdit = QLineEdit() grid = QGridLayout() grid.setSpacing(10) grid.addWidget(title, 1, 0) grid.addWidget(titleEdit, 1, 1) grid.addWidget(author, 2, 0) grid.addWidget(authorEdit, 2, 1) grid.addWidget(review, 3, 0) grid.addWidget(reviewEdit, 3, 1) self.setLayout(grid) self.setGeometry(300, 300, 400, 500) self.setWindowTitle("Review")
def __init__(self, parent=None): QWidget.__init__(self) self.setParent(parent) # Set the colour of the overlay self.setStyleSheet("QWidget { background-color: rgba(255, 255, 255, 0.05)}") # Set OverlayTop heights # TODO: Change heights with increasing resolution self.setFixedHeight(50) # Create layout with margins/spacings layout = QGridLayout() layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(0) # Initialise MarqueeText self.marqueeText = self.MarqueeText(self) layout.addWidget(self.marqueeText, 0, 0, 2, 1) # Initialise search button self.initButton() layout.addWidget(self.button, 0, 1, 2, 1) # Initialise elapsedTime/localTime self.initTimes() layout.addWidget(self.elapsedTime, 0, 2, 1, 1) layout.addWidget(self.localTime, 1, 2, 1, 1) self.setLayout(layout)
def __init__(self, parent=None): QWidget.__init__(self) self.setParent(parent) # Create layout with margins/spacings layout = QGridLayout() layout.setContentsMargins(20, 20, 20, 20) layout.setSpacing(10) self.setLayout(self.initButtons(layout))
def __init__(self, ruler, parent=None): QWidget.__init__(self, parent) # colors settings backgroundColor = ruler.data.get('background_color') linesColor = ruler.data.get('lines_color') divisionsColor = ruler.data.get('divisions_color') def updateBackgroundColor(newColor): ruler.data.update('background_color', newColor) ruler.update() def updateLinesColor(newColor): ruler.data.update('lines_color', newColor) ruler.update() def updateDivisionsColor(newColor): ruler.data.update('divisions_color', newColor) ruler.update() backgroundColorElement = ColorButton(self, 'Background', backgroundColor, updateBackgroundColor) linesColorElement = ColorButton(self, 'Lines', linesColor, updateLinesColor) divisionsColorElement = ColorButton(self, 'Divisions', divisionsColor, updateDivisionsColor) layout = QGridLayout() layout.setSpacing(10) # set the same width/height for all the columns/rows columnWidth = 120 rowHeight = 25 layout.setRowMinimumHeight(0, rowHeight) layout.setRowMinimumHeight(1, rowHeight) layout.setRowMinimumHeight(2, rowHeight) layout.setColumnMinimumWidth(0, columnWidth) layout.setColumnMinimumWidth(1, columnWidth) layout.setColumnMinimumWidth(2, columnWidth) # first column layout.addWidget(backgroundColorElement, 1, 0) # second column layout.addWidget(linesColorElement, 1, 1) # third column layout.addWidget(divisionsColorElement, 1, 2) layout.setSizeConstraint(QLayout.SetFixedSize) self.setLayout(layout)
class WelcomePage(QWizardPage): butt_signal = Signal(str) # Make a signal, pass it def __init__(self, parent=None): QWizardPage.__init__(self, parent) self.setTitle("Select the data source(s) to analyze:") self.label = QLabel("<b>Images are not required.</b><br> However, if they"+ " are not present, then bounded metrics will be calculated from the bounding rectangle" " of the provided coordinates.") self.label.setWordWrap(True) self.label.setTextFormat(Qt.RichText) self.label.setAlignment(Qt.AlignCenter) self.file_dir_form = QGridLayout() self.coord_label = QLineEdit() self.coord_label.setReadOnly(True) self.coord_label.text() self.coord_butt = QPushButton("Select...") self._coord_path = "" self.image_label = QLineEdit() self.image_label.setReadOnly(True) #self.image_label.setMaximumWidth() self.image_butt = QPushButton("Select...") self.image_path = "" self.file_dir_form.addWidget(self.coord_label, 0, 0) self.file_dir_form.addWidget(self.coord_butt, 0, 1) self.file_dir_form.addWidget(self.image_label, 1, 0) self.file_dir_form.addWidget(self.image_butt, 1, 1) self.v_layout = QVBoxLayout() self.v_layout.setSpacing(32) self.v_layout.addWidget(self.label) self.v_layout.addLayout(self.file_dir_form) self.file_dir_form.setSpacing(4) self.setLayout(self.v_layout) self.butt_signal self.coord_butt.clicked.connect(self.select_coord_path) self.image_butt.clicked.connect(self.select_image_path) def readCoordPath(self): return self._coord_path def setCoordPath(self, val): self._coord_path = val coord_path = Property(str, readCoordPath, setCoordPath, notify=butt_signal) @Slot() def select_coord_path(self): self._coord_path = QFileDialog.getExistingDirectory(parent=self, caption="Select the folder containing the coordinates of interest.", options=QFileDialog.ShowDirsOnly) @Slot() def select_image_path(self): self.image_path = QFileDialog.getExistingDirectory(parent=self, caption="Select the folder containing the images of interest.", options=QFileDialog.ShowDirsOnly)
class Ui_TaxExportDlg(object): def setupUi(self, TaxExportDlg): if not TaxExportDlg.objectName(): TaxExportDlg.setObjectName(u"TaxExportDlg") TaxExportDlg.resize(602, 315) self.gridLayout = QGridLayout(TaxExportDlg) self.gridLayout.setObjectName(u"gridLayout") self.gridLayout.setHorizontalSpacing(6) self.gridLayout.setContentsMargins(9, 9, 9, 9) self.line = QFrame(TaxExportDlg) self.line.setObjectName(u"line") self.line.setFrameShape(QFrame.HLine) self.line.setFrameShadow(QFrame.Sunken) self.gridLayout.addWidget(self.line, 4, 0, 1, 4) self.XlsSelectBtn = QPushButton(TaxExportDlg) self.XlsSelectBtn.setObjectName(u"XlsSelectBtn") sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.XlsSelectBtn.sizePolicy().hasHeightForWidth()) self.XlsSelectBtn.setSizePolicy(sizePolicy) self.gridLayout.addWidget(self.XlsSelectBtn, 3, 2, 1, 1) self.WarningLbl = QLabel(TaxExportDlg) self.WarningLbl.setObjectName(u"WarningLbl") font = QFont() font.setItalic(True) self.WarningLbl.setFont(font) self.gridLayout.addWidget(self.WarningLbl, 5, 0, 1, 4) self.DlsgGroup = QGroupBox(TaxExportDlg) self.DlsgGroup.setObjectName(u"DlsgGroup") sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.DlsgGroup.sizePolicy().hasHeightForWidth()) self.DlsgGroup.setSizePolicy(sizePolicy1) self.DlsgGroup.setFlat(False) self.DlsgGroup.setCheckable(True) self.DlsgGroup.setChecked(False) self.gridLayout_2 = QGridLayout(self.DlsgGroup) self.gridLayout_2.setSpacing(2) self.gridLayout_2.setObjectName(u"gridLayout_2") self.gridLayout_2.setContentsMargins(6, 6, 6, 6) self.InitialFileLbl = QLabel(self.DlsgGroup) self.InitialFileLbl.setObjectName(u"InitialFileLbl") self.gridLayout_2.addWidget(self.InitialFileLbl, 0, 0, 1, 1) self.DlsgOutFileName = QLineEdit(self.DlsgGroup) self.DlsgOutFileName.setObjectName(u"DlsgOutFileName") self.gridLayout_2.addWidget(self.DlsgOutFileName, 1, 1, 1, 1) self.DlsgInFileName = QLineEdit(self.DlsgGroup) self.DlsgInFileName.setObjectName(u"DlsgInFileName") self.gridLayout_2.addWidget(self.DlsgInFileName, 0, 1, 1, 1) self.OutputFileLbl = QLabel(self.DlsgGroup) self.OutputFileLbl.setObjectName(u"OutputFileLbl") self.gridLayout_2.addWidget(self.OutputFileLbl, 1, 0, 1, 1) self.DividendsOnly = QCheckBox(self.DlsgGroup) self.DividendsOnly.setObjectName(u"DividendsOnly") self.gridLayout_2.addWidget(self.DividendsOnly, 3, 0, 1, 3) self.OutputSelectBtn = QPushButton(self.DlsgGroup) self.OutputSelectBtn.setObjectName(u"OutputSelectBtn") self.gridLayout_2.addWidget(self.OutputSelectBtn, 1, 2, 1, 1) self.InitialSelectBtn = QPushButton(self.DlsgGroup) self.InitialSelectBtn.setObjectName(u"InitialSelectBtn") self.gridLayout_2.addWidget(self.InitialSelectBtn, 0, 2, 1, 1) self.IncomeSourceBroker = QCheckBox(self.DlsgGroup) self.IncomeSourceBroker.setObjectName(u"IncomeSourceBroker") self.IncomeSourceBroker.setChecked(True) self.gridLayout_2.addWidget(self.IncomeSourceBroker, 2, 0, 1, 3) self.gridLayout.addWidget(self.DlsgGroup, 7, 0, 1, 4) self.Year = QSpinBox(TaxExportDlg) self.Year.setObjectName(u"Year") self.Year.setAlignment(Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter) self.Year.setMinimum(2010) self.Year.setMaximum(2030) self.Year.setValue(2020) self.gridLayout.addWidget(self.Year, 1, 1, 1, 2) self.XlsFileName = QLineEdit(TaxExportDlg) self.XlsFileName.setObjectName(u"XlsFileName") sizePolicy2 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed) sizePolicy2.setHorizontalStretch(0) sizePolicy2.setVerticalStretch(0) sizePolicy2.setHeightForWidth( self.XlsFileName.sizePolicy().hasHeightForWidth()) self.XlsFileName.setSizePolicy(sizePolicy2) self.gridLayout.addWidget(self.XlsFileName, 3, 1, 1, 1) self.AccountWidget = AccountSelector(TaxExportDlg) self.AccountWidget.setObjectName(u"AccountWidget") self.gridLayout.addWidget(self.AccountWidget, 2, 1, 1, 2) self.YearLbl = QLabel(TaxExportDlg) self.YearLbl.setObjectName(u"YearLbl") self.gridLayout.addWidget(self.YearLbl, 1, 0, 1, 1) self.buttonBox = QDialogButtonBox(TaxExportDlg) self.buttonBox.setObjectName(u"buttonBox") self.buttonBox.setOrientation(Qt.Vertical) self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok) self.gridLayout.addWidget(self.buttonBox, 1, 3, 3, 1) self.AccountLbl = QLabel(TaxExportDlg) self.AccountLbl.setObjectName(u"AccountLbl") self.gridLayout.addWidget(self.AccountLbl, 2, 0, 1, 1) self.XlsFileLbl = QLabel(TaxExportDlg) self.XlsFileLbl.setObjectName(u"XlsFileLbl") self.gridLayout.addWidget(self.XlsFileLbl, 3, 0, 1, 1) self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) self.gridLayout.addItem(self.verticalSpacer, 9, 0, 1, 1) self.NoSettlement = QCheckBox(TaxExportDlg) self.NoSettlement.setObjectName(u"NoSettlement") self.gridLayout.addWidget(self.NoSettlement, 8, 0, 1, 4) QWidget.setTabOrder(self.Year, self.XlsFileName) QWidget.setTabOrder(self.XlsFileName, self.XlsSelectBtn) QWidget.setTabOrder(self.XlsSelectBtn, self.DlsgGroup) QWidget.setTabOrder(self.DlsgGroup, self.DlsgInFileName) QWidget.setTabOrder(self.DlsgInFileName, self.InitialSelectBtn) QWidget.setTabOrder(self.InitialSelectBtn, self.DlsgOutFileName) QWidget.setTabOrder(self.DlsgOutFileName, self.OutputSelectBtn) self.retranslateUi(TaxExportDlg) self.buttonBox.accepted.connect(TaxExportDlg.accept) self.buttonBox.rejected.connect(TaxExportDlg.reject) QMetaObject.connectSlotsByName(TaxExportDlg) # setupUi def retranslateUi(self, TaxExportDlg): TaxExportDlg.setWindowTitle( QCoreApplication.translate( "TaxExportDlg", u"Select parameters and files for tax report", None)) #if QT_CONFIG(tooltip) self.XlsSelectBtn.setToolTip( QCoreApplication.translate("TaxExportDlg", u"Select file", None)) #endif // QT_CONFIG(tooltip) self.XlsSelectBtn.setText( QCoreApplication.translate("TaxExportDlg", u"...", None)) self.WarningLbl.setText( QCoreApplication.translate( "TaxExportDlg", u"Below functions are experimental - use it with care", None)) self.DlsgGroup.setTitle( QCoreApplication.translate( "TaxExportDlg", u"Update file \"\u0414\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u044f\" (*.dc0)", None)) self.InitialFileLbl.setText( QCoreApplication.translate("TaxExportDlg", u"Initial file:", None)) #if QT_CONFIG(tooltip) self.DlsgOutFileName.setToolTip( QCoreApplication.translate( "TaxExportDlg", u"File where to store russian tax form", None)) #endif // QT_CONFIG(tooltip) #if QT_CONFIG(tooltip) self.DlsgInFileName.setToolTip( QCoreApplication.translate( "TaxExportDlg", u"File to use as a template for russian tax form", None)) #endif // QT_CONFIG(tooltip) self.OutputFileLbl.setText( QCoreApplication.translate("TaxExportDlg", u"Output file:", None)) self.DividendsOnly.setText( QCoreApplication.translate( "TaxExportDlg", u"Update only information about dividends", None)) #if QT_CONFIG(tooltip) self.OutputSelectBtn.setToolTip( QCoreApplication.translate("TaxExportDlg", u"Select file", None)) #endif // QT_CONFIG(tooltip) self.OutputSelectBtn.setText( QCoreApplication.translate("TaxExportDlg", u" ... ", None)) #if QT_CONFIG(tooltip) self.InitialSelectBtn.setToolTip( QCoreApplication.translate("TaxExportDlg", u"Select file", None)) #endif // QT_CONFIG(tooltip) self.InitialSelectBtn.setText( QCoreApplication.translate("TaxExportDlg", u" ... ", None)) self.IncomeSourceBroker.setText( QCoreApplication.translate("TaxExportDlg", u"Use broker name as income source", None)) self.Year.setSuffix("") #if QT_CONFIG(tooltip) self.XlsFileName.setToolTip( QCoreApplication.translate( "TaxExportDlg", u"File where to store tax report in Excel format", None)) #endif // QT_CONFIG(tooltip) #if QT_CONFIG(tooltip) self.AccountWidget.setToolTip( QCoreApplication.translate( "TaxExportDlg", u"Foreign account to prepare tax report for", None)) #endif // QT_CONFIG(tooltip) self.YearLbl.setText( QCoreApplication.translate("TaxExportDlg", u"Year:", None)) self.AccountLbl.setText( QCoreApplication.translate("TaxExportDlg", u"Account:", None)) self.XlsFileLbl.setText( QCoreApplication.translate("TaxExportDlg", u"Excel file:", None)) self.NoSettlement.setText( QCoreApplication.translate( "TaxExportDlg", u"Do not use settlement date for currency rates", None))
class Ui_PaymentDlg(object): def setupUi(self, PaymentDlg): if not PaymentDlg.objectName(): PaymentDlg.setObjectName(u"PaymentDlg") PaymentDlg.resize(399, 276) self.gridLayout = QGridLayout(PaymentDlg) # ifndef Q_OS_MAC self.gridLayout.setSpacing(6) # endif # ifndef Q_OS_MAC self.gridLayout.setContentsMargins(9, 9, 9, 9) # endif self.gridLayout.setObjectName(u"gridLayout") self.buttonBox = QDialogButtonBox(PaymentDlg) self.buttonBox.setObjectName(u"buttonBox") self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.NoButton | QDialogButtonBox.Ok) self.gridLayout.addWidget(self.buttonBox, 3, 0, 1, 1) self.spacerItem = QSpacerItem(381, 16, QSizePolicy.Minimum, QSizePolicy.Expanding) self.gridLayout.addItem(self.spacerItem, 2, 0, 1, 1) self.tabWidget = QTabWidget(PaymentDlg) self.tabWidget.setObjectName(u"tabWidget") self.tab = QWidget() self.tab.setObjectName(u"tab") self.hboxLayout = QHBoxLayout(self.tab) # ifndef Q_OS_MAC self.hboxLayout.setSpacing(6) # endif # ifndef Q_OS_MAC self.hboxLayout.setContentsMargins(9, 9, 9, 9) # endif self.hboxLayout.setObjectName(u"hboxLayout") self.paidCheckBox = QCheckBox(self.tab) self.paidCheckBox.setObjectName(u"paidCheckBox") self.hboxLayout.addWidget(self.paidCheckBox) self.tabWidget.addTab(self.tab, "") self.tab_2 = QWidget() self.tab_2.setObjectName(u"tab_2") self.gridLayout1 = QGridLayout(self.tab_2) # ifndef Q_OS_MAC self.gridLayout1.setSpacing(6) # endif # ifndef Q_OS_MAC self.gridLayout1.setContentsMargins(9, 9, 9, 9) # endif self.gridLayout1.setObjectName(u"gridLayout1") self.sortCodeLineEdit = QLineEdit(self.tab_2) self.sortCodeLineEdit.setObjectName(u"sortCodeLineEdit") self.gridLayout1.addWidget(self.sortCodeLineEdit, 1, 3, 1, 1) self.label_8 = QLabel(self.tab_2) self.label_8.setObjectName(u"label_8") self.gridLayout1.addWidget(self.label_8, 1, 2, 1, 1) self.bankLineEdit = QLineEdit(self.tab_2) self.bankLineEdit.setObjectName(u"bankLineEdit") self.gridLayout1.addWidget(self.bankLineEdit, 0, 3, 1, 1) self.label_7 = QLabel(self.tab_2) self.label_7.setObjectName(u"label_7") self.gridLayout1.addWidget(self.label_7, 0, 2, 1, 1) self.accountNumLineEdit = QLineEdit(self.tab_2) self.accountNumLineEdit.setObjectName(u"accountNumLineEdit") self.gridLayout1.addWidget(self.accountNumLineEdit, 1, 1, 1, 1) self.label_6 = QLabel(self.tab_2) self.label_6.setObjectName(u"label_6") self.gridLayout1.addWidget(self.label_6, 1, 0, 1, 1) self.checkNumLineEdit = QLineEdit(self.tab_2) self.checkNumLineEdit.setObjectName(u"checkNumLineEdit") self.gridLayout1.addWidget(self.checkNumLineEdit, 0, 1, 1, 1) self.label_2 = QLabel(self.tab_2) self.label_2.setObjectName(u"label_2") self.gridLayout1.addWidget(self.label_2, 0, 0, 1, 1) self.tabWidget.addTab(self.tab_2, "") self.tab_3 = QWidget() self.tab_3.setObjectName(u"tab_3") self.gridLayout2 = QGridLayout(self.tab_3) # ifndef Q_OS_MAC self.gridLayout2.setSpacing(6) # endif # ifndef Q_OS_MAC self.gridLayout2.setContentsMargins(9, 9, 9, 9) # endif self.gridLayout2.setObjectName(u"gridLayout2") self.creditCardLineEdit = QLineEdit(self.tab_3) self.creditCardLineEdit.setObjectName(u"creditCardLineEdit") self.gridLayout2.addWidget(self.creditCardLineEdit, 0, 1, 1, 3) self.label_11 = QLabel(self.tab_3) self.label_11.setObjectName(u"label_11") self.gridLayout2.addWidget(self.label_11, 0, 0, 1, 1) self.expiryDateEdit = QDateEdit(self.tab_3) self.expiryDateEdit.setObjectName(u"expiryDateEdit") self.expiryDateEdit.setAlignment(Qt.AlignRight) self.gridLayout2.addWidget(self.expiryDateEdit, 1, 3, 1, 1) self.label_10 = QLabel(self.tab_3) self.label_10.setObjectName(u"label_10") self.gridLayout2.addWidget(self.label_10, 1, 2, 1, 1) self.validFromDateEdit = QDateEdit(self.tab_3) self.validFromDateEdit.setObjectName(u"validFromDateEdit") self.validFromDateEdit.setAlignment(Qt.AlignRight) self.gridLayout2.addWidget(self.validFromDateEdit, 1, 1, 1, 1) self.label_9 = QLabel(self.tab_3) self.label_9.setObjectName(u"label_9") self.gridLayout2.addWidget(self.label_9, 1, 0, 1, 1) self.tabWidget.addTab(self.tab_3, "") self.gridLayout.addWidget(self.tabWidget, 1, 0, 1, 1) self.gridLayout3 = QGridLayout() # ifndef Q_OS_MAC self.gridLayout3.setSpacing(6) # endif self.gridLayout3.setContentsMargins(0, 0, 0, 0) self.gridLayout3.setObjectName(u"gridLayout3") self.label_3 = QLabel(PaymentDlg) self.label_3.setObjectName(u"label_3") self.gridLayout3.addWidget(self.label_3, 0, 2, 1, 1) self.amountSpinBox = QDoubleSpinBox(PaymentDlg) self.amountSpinBox.setObjectName(u"amountSpinBox") self.amountSpinBox.setAlignment(Qt.AlignRight) self.amountSpinBox.setMaximum(999999.000000000000000) self.gridLayout3.addWidget(self.amountSpinBox, 1, 3, 1, 1) self.label = QLabel(PaymentDlg) self.label.setObjectName(u"label") self.gridLayout3.addWidget(self.label, 0, 0, 1, 1) self.label_5 = QLabel(PaymentDlg) self.label_5.setObjectName(u"label_5") self.gridLayout3.addWidget(self.label_5, 1, 0, 1, 1) self.surnameLineEdit = QLineEdit(PaymentDlg) self.surnameLineEdit.setObjectName(u"surnameLineEdit") self.gridLayout3.addWidget(self.surnameLineEdit, 0, 3, 1, 1) self.forenameLineEdit = QLineEdit(PaymentDlg) self.forenameLineEdit.setObjectName(u"forenameLineEdit") self.gridLayout3.addWidget(self.forenameLineEdit, 0, 1, 1, 1) self.label_4 = QLabel(PaymentDlg) self.label_4.setObjectName(u"label_4") self.gridLayout3.addWidget(self.label_4, 1, 2, 1, 1) self.invoiceNumSpinBox = QSpinBox(PaymentDlg) self.invoiceNumSpinBox.setObjectName(u"invoiceNumSpinBox") self.invoiceNumSpinBox.setAlignment(Qt.AlignRight) self.invoiceNumSpinBox.setMaximum(999999999) self.invoiceNumSpinBox.setMinimum(1000000) self.invoiceNumSpinBox.setValue(1000000) self.gridLayout3.addWidget(self.invoiceNumSpinBox, 1, 1, 1, 1) self.gridLayout.addLayout(self.gridLayout3, 0, 0, 1, 1) # if QT_CONFIG(shortcut) self.label_8.setBuddy(self.sortCodeLineEdit) self.label_7.setBuddy(self.bankLineEdit) self.label_6.setBuddy(self.accountNumLineEdit) self.label_2.setBuddy(self.checkNumLineEdit) self.label_11.setBuddy(self.creditCardLineEdit) self.label_10.setBuddy(self.expiryDateEdit) self.label_9.setBuddy(self.validFromDateEdit) self.label_3.setBuddy(self.surnameLineEdit) self.label.setBuddy(self.forenameLineEdit) self.label_5.setBuddy(self.invoiceNumSpinBox) self.label_4.setBuddy(self.amountSpinBox) # endif // QT_CONFIG(shortcut) QWidget.setTabOrder(self.forenameLineEdit, self.surnameLineEdit) QWidget.setTabOrder(self.surnameLineEdit, self.invoiceNumSpinBox) QWidget.setTabOrder(self.invoiceNumSpinBox, self.amountSpinBox) QWidget.setTabOrder(self.amountSpinBox, self.tabWidget) QWidget.setTabOrder(self.tabWidget, self.paidCheckBox) QWidget.setTabOrder(self.paidCheckBox, self.checkNumLineEdit) QWidget.setTabOrder(self.checkNumLineEdit, self.accountNumLineEdit) QWidget.setTabOrder(self.accountNumLineEdit, self.bankLineEdit) QWidget.setTabOrder(self.bankLineEdit, self.sortCodeLineEdit) QWidget.setTabOrder(self.sortCodeLineEdit, self.creditCardLineEdit) QWidget.setTabOrder(self.creditCardLineEdit, self.validFromDateEdit) QWidget.setTabOrder(self.validFromDateEdit, self.expiryDateEdit) self.retranslateUi(PaymentDlg) self.buttonBox.accepted.connect(PaymentDlg.accept) self.buttonBox.rejected.connect(PaymentDlg.reject) self.tabWidget.setCurrentIndex(0) QMetaObject.connectSlotsByName(PaymentDlg) # setupUi def retranslateUi(self, PaymentDlg): PaymentDlg.setWindowTitle( QCoreApplication.translate("PaymentDlg", u"Payment Form", None)) self.paidCheckBox.setText( QCoreApplication.translate("PaymentDlg", u"&Paid", None)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.tab), QCoreApplication.translate("PaymentDlg", u"Cas&h", None), ) self.label_8.setText( QCoreApplication.translate("PaymentDlg", u"S&ort Code:", None)) self.label_7.setText( QCoreApplication.translate("PaymentDlg", u"&Bank:", None)) self.label_6.setText( QCoreApplication.translate("PaymentDlg", u"A&ccount No.:", None)) self.label_2.setText( QCoreApplication.translate("PaymentDlg", u"Check &No.:", None)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.tab_2), QCoreApplication.translate("PaymentDlg", u"Chec&k", None), ) self.label_11.setText( QCoreApplication.translate("PaymentDlg", u"&Number:", None)) self.expiryDateEdit.setDisplayFormat( QCoreApplication.translate("PaymentDlg", u"MMM yyyy", None)) self.label_10.setText( QCoreApplication.translate("PaymentDlg", u"E&xpiry Date", None)) self.validFromDateEdit.setDisplayFormat( QCoreApplication.translate("PaymentDlg", u"MMM yyyy", None)) self.label_9.setText( QCoreApplication.translate("PaymentDlg", u"&Valid From:", None)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("PaymentDlg", u"Credit Car&d", None), ) self.label_3.setText( QCoreApplication.translate("PaymentDlg", u"&Surname:", None)) self.amountSpinBox.setPrefix( QCoreApplication.translate("PaymentDlg", u"$ ", None)) self.label.setText( QCoreApplication.translate("PaymentDlg", u"&Forename:", None)) self.label_5.setText( QCoreApplication.translate("PaymentDlg", u"&Invoice No.:", None)) self.label_4.setText( QCoreApplication.translate("PaymentDlg", u"&Amount:", None))
def __init__(self, result, parent=None): # Popup when "Add song to playlist" is clicked on # How this works is a QWidget that encompasses the entire window area, representing an unclickable translucent background. # Another QWidget is then contained inside that QWidget representing the popup. # result: (dict) Python dict containing information of the song clicked QWidget.__init__(self) self.setParent(parent) self.result = result # Signals are used to indicate to close the window self.SIGNALS = self.TranslucentWidgetSignals() # Make the window frameless and expanding. self.setWindowFlags(Qt.FramelessWindowHint) self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) # Makes the window background colour translucent self.setAttribute(Qt.WA_StyledBackground) self.setStyleSheet( "PlaylistPopup { background-color: rgba(255, 255, 255, 0.5)}") # Sets the grid settings of the "background" and the "popup" layout = QGridLayout() layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(0) playlistAdd = QWidget(self) playlistAdd.setFixedSize(800, 300) playlistAdd.setStyleSheet( ".QWidget { background-color: rgba(255, 255, 255, 1)}") innerLayout = QGridLayout() innerLayout.setContentsMargins(20, 20, 20, 20) innerLayout.setSpacing(30) # Heading font font = QFont() font.setPointSize(24) # Default label font font2 = QFont() font2.setPointSize(16) # Heading label = QLabel("添加到播放列表/Add to Playlist", self) label.setAlignment(Qt.AlignCenter) label.setFont(font) innerLayout.addWidget(label, 0, 0) # Playlist selection self.comboBox = QComboBox(self) self.comboBox.setFont(font) playlists = DB.getPlaylists("") for playlist in playlists: self.comboBox.addItem(playlist["playlist_name"]) self.comboBox.setCurrentIndex(-1) innerLayout.addWidget(self.comboBox, 1, 0) # Textbox to create a new playlist self.textBox = QLineEdit(self) self.textBox.setFont(font2) self.textBox.setAlignment(Qt.AlignCenter) self.textBox.setPlaceholderText( "输入以创建新的播放列表/Type to create a new playlist") self.textBox.setSizePolicy(QSizePolicy.Maximum, QSizePolicy.Fixed) # TODO: resize textbox with window self.textBox.setFixedWidth(760) innerLayout.addWidget(self.textBox, 2, 0, Qt.AlignCenter) # Add actions for then the QComboBox or QLineEdit is changed. # This is done so there is only one action between "Add to existing Playlist" or "Add to new Playlist" self.comboBox.currentIndexChanged.connect(self.comboBoxChanged) self.textBox.textEdited.connect(self.textBoxChanged) # Confirm button confirmButton = QToolButton(self) confirmButton.setText("确认/Confirm") confirmButton.setFont(font) confirmButton.clicked.connect(self.processPlaylistRequest) innerLayout.addWidget(confirmButton, 3, 0, Qt.AlignCenter) # Exit button btn = QToolButton(self) btn.setFixedSize(44, 44) btn.setText("X") btn.setFont(font) btn.setToolButtonStyle(Qt.ToolButtonTextBesideIcon) btn.clicked.connect(lambda: self.SIGNALS.CLOSE.emit()) innerLayout.addWidget(btn, 0, 0, Qt.AlignRight) playlistAdd.setLayout(innerLayout) layout.addWidget(playlistAdd, 0, 0, Qt.AlignCenter) self.setLayout(layout)
class MainWindow(QMainWindow): def __init__(self): QMainWindow.__init__(self) # TODO: temp paths self.artistPath = "img\\artist\\" self.languagePath = "img\\language\\" self.songPath = "lib\\" # Database startup startUp() # Start Song Queue List self.songQueue = SongQueue() # Start Media Player self.mediaPlayer = MediaPlayer(self.songQueue, self.setMarquee, self) # Set the colour of the window self.setStyleSheet("MainWindow { background-color: rgb(25, 33, 60)}") # Create layout and set margins/spacings self.layout = QGridLayout() self.layout.setContentsMargins(0, 0, 0, 0) self.layout.setSpacing(0) # Create overlays of the application self.overlayTop = OverlayTop(self) self.overlayBottom = OverlayBottom(self) # Add overlays to layout self.layout.addWidget(self.overlayTop, 0, 0) self.layout.addWidget(self.overlayBottom, 2, 0) # Create home page then add to layout self.content = WindowHome(self) self.layout.addWidget(self.content, 1, 0) # Create widget, then set layout to widget which gets added as central widget window = QWidget() window.setLayout(self.layout) self.setCentralWidget(window) self.mediaPlayer.start() def setMarquee(self, msg): # Sets the text of the marquee label # msg: (str/list) message(s) to be displayed] if type(msg) == list: # If msg is a list, change to workable string # TODO: Change the join bit when adding universal settings msg = " ".join(msg) self.overlayTop.marqueeText.setText(msg) def changeWindow(self, widget): # removes the widget from the middle, then add a new one self.layout.removeWidget(self.content) self.content.close() self.content = widget self.layout.addWidget(self.content, 1, 0) self.layout.update()
def __init__(self, ruler, parent=None): QWidget.__init__(self, parent) # units (cm/px/inch) unitsGroup = QButtonGroup(self) pixels = QRadioButton('Pixels') pixels.unit = 'px' centimeters = QRadioButton('Centimeters') centimeters.unit = 'cm' inches = QRadioButton('Inches') inches.unit = 'inch' selectedUnit = ruler.data.get('units') if selectedUnit == 'cm': centimeters.setChecked(True) elif selectedUnit == 'inch': inches.setChecked(True) else: pixels.setChecked(True) unitsGroup.addButton(pixels) unitsGroup.addButton(centimeters) unitsGroup.addButton(inches) def changeUnits(radioButton): nonlocal selectedUnit newUnit = radioButton.unit if newUnit != selectedUnit: ruler.data.update('units', newUnit) selectedUnit = newUnit ruler.update() unitsGroup.buttonClicked.connect(changeUnits) # orientation (horizontal/vertical) horizontalOrientation = ruler.data.get('horizontal_orientation') orientationGroup = QButtonGroup(self) self.horizontal_string = 'Horizontal' self.vertical_string = 'Vertical' horizontal = QRadioButton(self.horizontal_string) vertical = QRadioButton(self.vertical_string) if horizontalOrientation: horizontal.setChecked(True) self.selected_orientation = self.horizontal_string else: vertical.setChecked(True) self.selected_orientation = self.vertical_string def changeOrientation(radioButton): text = radioButton.text() if self.selected_orientation != text: self.selected_orientation = text ruler.rotate() orientationGroup.addButton(horizontal) orientationGroup.addButton(vertical) orientationGroup.buttonClicked.connect(changeOrientation) # length settings (always above + division lines + current length) alwaysAbove = QCheckBox('Always Above', self) alwaysAbove.setChecked(ruler.data.get('always_above')) def alwaysAboveSetting(): if alwaysAbove.isChecked(): ruler.data.update('always_above', True) ruler.setWindowFlags(ruler.windowFlags() | Qt.WindowStaysOnTopHint) else: ruler.data.update('always_above', False) ruler.setWindowFlags(ruler.windowFlags() & ~Qt.WindowStaysOnTopHint) ruler.show() alwaysAbove.clicked.connect(alwaysAboveSetting) divisionLines = QCheckBox('1/2 1/4 3/4 divisions', self) divisionLines.setChecked(ruler.data.get('division_lines')) def divisionLinesSetting(): ruler.data.update('division_lines', divisionLines.isChecked()) ruler.update() divisionLines.clicked.connect(divisionLinesSetting) currentLength = QLabel('0px') currentLength.setAlignment(Qt.AlignCenter) # setup the layout layout = QGridLayout() layout.setSpacing(10) # set the same width/height for all the columns/rows columnWidth = 120 rowHeight = 25 layout.setRowMinimumHeight(0, rowHeight) layout.setRowMinimumHeight(1, rowHeight) layout.setRowMinimumHeight(2, rowHeight) layout.setColumnMinimumWidth(0, columnWidth) layout.setColumnMinimumWidth(1, columnWidth) layout.setColumnMinimumWidth(2, columnWidth) # first column layout.addWidget(pixels, 0, 0) layout.addWidget(centimeters, 1, 0) layout.addWidget(inches, 2, 0) # second column layout.addWidget(horizontal, 0, 1) layout.addWidget(vertical, 1, 1) # third column layout.addWidget(alwaysAbove, 0, 2) layout.addWidget(divisionLines, 1, 2) layout.addWidget(currentLength, 2, 2) layout.setSizeConstraint(QLayout.SetFixedSize) self.current_length = currentLength self.vertical = vertical self.horizontal = horizontal self.setLayout(layout)
class Ui_TaxWidget(object): def setupUi(self, TaxWidget): if not TaxWidget.objectName(): TaxWidget.setObjectName(u"TaxWidget") TaxWidget.resize(696, 408) self.gridLayout = QGridLayout(TaxWidget) self.gridLayout.setObjectName(u"gridLayout") self.AccountLbl = QLabel(TaxWidget) self.AccountLbl.setObjectName(u"AccountLbl") self.gridLayout.addWidget(self.AccountLbl, 1, 0, 1, 1) self.AccountWidget = AccountSelector(TaxWidget) self.AccountWidget.setObjectName(u"AccountWidget") self.gridLayout.addWidget(self.AccountWidget, 1, 1, 1, 2) self.YearLbl = QLabel(TaxWidget) self.YearLbl.setObjectName(u"YearLbl") self.gridLayout.addWidget(self.YearLbl, 0, 0, 1, 1) self.Year = QSpinBox(TaxWidget) self.Year.setObjectName(u"Year") self.Year.setAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter) self.Year.setMinimum(2010) self.Year.setMaximum(2030) self.Year.setValue(2020) self.gridLayout.addWidget(self.Year, 0, 1, 1, 2) self.verticalSpacer = QSpacerItem(20, 52, QSizePolicy.Minimum, QSizePolicy.Expanding) self.gridLayout.addItem(self.verticalSpacer, 8, 0, 1, 1) self.line = QFrame(TaxWidget) self.line.setObjectName(u"line") self.line.setFrameShape(QFrame.HLine) self.line.setFrameShadow(QFrame.Sunken) self.gridLayout.addWidget(self.line, 3, 0, 1, 3) self.DlsgGroup = QGroupBox(TaxWidget) self.DlsgGroup.setObjectName(u"DlsgGroup") sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.DlsgGroup.sizePolicy().hasHeightForWidth()) self.DlsgGroup.setSizePolicy(sizePolicy) self.DlsgGroup.setFlat(False) self.DlsgGroup.setCheckable(True) self.DlsgGroup.setChecked(False) self.gridLayout_2 = QGridLayout(self.DlsgGroup) self.gridLayout_2.setSpacing(2) self.gridLayout_2.setObjectName(u"gridLayout_2") self.gridLayout_2.setContentsMargins(6, 6, 6, 6) self.DlsgFileLbl = QLabel(self.DlsgGroup) self.DlsgFileLbl.setObjectName(u"DlsgFileLbl") self.gridLayout_2.addWidget(self.DlsgFileLbl, 0, 0, 1, 1) self.IncomeSourceBroker = QCheckBox(self.DlsgGroup) self.IncomeSourceBroker.setObjectName(u"IncomeSourceBroker") self.IncomeSourceBroker.setChecked(True) self.gridLayout_2.addWidget(self.IncomeSourceBroker, 1, 0, 1, 3) self.DividendsOnly = QCheckBox(self.DlsgGroup) self.DividendsOnly.setObjectName(u"DividendsOnly") self.gridLayout_2.addWidget(self.DividendsOnly, 2, 0, 1, 3) self.DlsgSelectBtn = QPushButton(self.DlsgGroup) self.DlsgSelectBtn.setObjectName(u"DlsgSelectBtn") self.gridLayout_2.addWidget(self.DlsgSelectBtn, 0, 2, 1, 1) self.DlsgFileName = QLineEdit(self.DlsgGroup) self.DlsgFileName.setObjectName(u"DlsgFileName") self.gridLayout_2.addWidget(self.DlsgFileName, 0, 1, 1, 1) self.gridLayout.addWidget(self.DlsgGroup, 5, 0, 1, 3) self.XlsFileLbl = QLabel(TaxWidget) self.XlsFileLbl.setObjectName(u"XlsFileLbl") self.gridLayout.addWidget(self.XlsFileLbl, 2, 0, 1, 1) self.XlsFileName = QLineEdit(TaxWidget) self.XlsFileName.setObjectName(u"XlsFileName") sizePolicy1 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth(self.XlsFileName.sizePolicy().hasHeightForWidth()) self.XlsFileName.setSizePolicy(sizePolicy1) self.gridLayout.addWidget(self.XlsFileName, 2, 1, 1, 1) self.XlsSelectBtn = QPushButton(TaxWidget) self.XlsSelectBtn.setObjectName(u"XlsSelectBtn") sizePolicy2 = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed) sizePolicy2.setHorizontalStretch(0) sizePolicy2.setVerticalStretch(0) sizePolicy2.setHeightForWidth(self.XlsSelectBtn.sizePolicy().hasHeightForWidth()) self.XlsSelectBtn.setSizePolicy(sizePolicy2) self.gridLayout.addWidget(self.XlsSelectBtn, 2, 2, 1, 1) self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.gridLayout.addItem(self.horizontalSpacer, 5, 3, 1, 1) self.NoSettlement = QCheckBox(TaxWidget) self.NoSettlement.setObjectName(u"NoSettlement") self.gridLayout.addWidget(self.NoSettlement, 6, 0, 1, 4) self.SaveButton = QPushButton(TaxWidget) self.SaveButton.setObjectName(u"SaveButton") self.gridLayout.addWidget(self.SaveButton, 7, 2, 1, 1) self.WarningLbl = QLabel(TaxWidget) self.WarningLbl.setObjectName(u"WarningLbl") font = QFont() font.setItalic(True) self.WarningLbl.setFont(font) self.gridLayout.addWidget(self.WarningLbl, 4, 0, 1, 3) self.retranslateUi(TaxWidget) QMetaObject.connectSlotsByName(TaxWidget) # setupUi def retranslateUi(self, TaxWidget): TaxWidget.setWindowTitle(QCoreApplication.translate("TaxWidget", u"Taxes", None)) self.AccountLbl.setText(QCoreApplication.translate("TaxWidget", u"Account:", None)) #if QT_CONFIG(tooltip) self.AccountWidget.setToolTip(QCoreApplication.translate("TaxWidget", u"Foreign account to prepare tax report for", None)) #endif // QT_CONFIG(tooltip) self.YearLbl.setText(QCoreApplication.translate("TaxWidget", u"Year:", None)) self.Year.setSuffix("") self.DlsgGroup.setTitle(QCoreApplication.translate("TaxWidget", u"Create tax form in \"\u0414\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u044f\" program format (*.dcX)", None)) self.DlsgFileLbl.setText(QCoreApplication.translate("TaxWidget", u"Output file:", None)) self.IncomeSourceBroker.setText(QCoreApplication.translate("TaxWidget", u"Use broker name as income source", None)) self.DividendsOnly.setText(QCoreApplication.translate("TaxWidget", u"Update only information about dividends", None)) #if QT_CONFIG(tooltip) self.DlsgSelectBtn.setToolTip(QCoreApplication.translate("TaxWidget", u"Select file", None)) #endif // QT_CONFIG(tooltip) self.DlsgSelectBtn.setText(QCoreApplication.translate("TaxWidget", u" ... ", None)) #if QT_CONFIG(tooltip) self.DlsgFileName.setToolTip(QCoreApplication.translate("TaxWidget", u"File where to store russian tax form", None)) #endif // QT_CONFIG(tooltip) self.XlsFileLbl.setText(QCoreApplication.translate("TaxWidget", u"Excel file:", None)) #if QT_CONFIG(tooltip) self.XlsFileName.setToolTip(QCoreApplication.translate("TaxWidget", u"File where to store tax report in Excel format", None)) #endif // QT_CONFIG(tooltip) #if QT_CONFIG(tooltip) self.XlsSelectBtn.setToolTip(QCoreApplication.translate("TaxWidget", u"Select file", None)) #endif // QT_CONFIG(tooltip) self.XlsSelectBtn.setText(QCoreApplication.translate("TaxWidget", u"...", None)) self.NoSettlement.setText(QCoreApplication.translate("TaxWidget", u"Do not use settlement date for currency rates", None)) self.SaveButton.setText(QCoreApplication.translate("TaxWidget", u"Save Report", None)) self.WarningLbl.setText(QCoreApplication.translate("TaxWidget", u"Below functions are experimental - use it with care", None))
class Ui_FindAndReplaceDlg(object): def setupUi(self, FindAndReplaceDlg): if not FindAndReplaceDlg.objectName(): FindAndReplaceDlg.setObjectName(u"FindAndReplaceDlg") FindAndReplaceDlg.resize(355, 274) self.hboxLayout = QHBoxLayout(FindAndReplaceDlg) # ifndef Q_OS_MAC self.hboxLayout.setSpacing(6) # endif # ifndef Q_OS_MAC self.hboxLayout.setContentsMargins(9, 9, 9, 9) # endif self.hboxLayout.setObjectName(u"hboxLayout") self.vboxLayout = QVBoxLayout() # ifndef Q_OS_MAC self.vboxLayout.setSpacing(6) # endif # ifndef Q_OS_MAC self.vboxLayout.setContentsMargins(0, 0, 0, 0) # endif self.vboxLayout.setObjectName(u"vboxLayout") self.gridLayout = QGridLayout() # ifndef Q_OS_MAC self.gridLayout.setSpacing(6) # endif # ifndef Q_OS_MAC self.gridLayout.setContentsMargins(0, 0, 0, 0) # endif self.gridLayout.setObjectName(u"gridLayout") self.replaceLineEdit = QLineEdit(FindAndReplaceDlg) self.replaceLineEdit.setObjectName(u"replaceLineEdit") self.gridLayout.addWidget(self.replaceLineEdit, 1, 1, 1, 1) self.findLineEdit = QLineEdit(FindAndReplaceDlg) self.findLineEdit.setObjectName(u"findLineEdit") self.gridLayout.addWidget(self.findLineEdit, 0, 1, 1, 1) self.label_2 = QLabel(FindAndReplaceDlg) self.label_2.setObjectName(u"label_2") self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1) self.label = QLabel(FindAndReplaceDlg) self.label.setObjectName(u"label") self.gridLayout.addWidget(self.label, 0, 0, 1, 1) self.vboxLayout.addLayout(self.gridLayout) self.vboxLayout1 = QVBoxLayout() # ifndef Q_OS_MAC self.vboxLayout1.setSpacing(6) # endif self.vboxLayout1.setContentsMargins(0, 0, 0, 0) self.vboxLayout1.setObjectName(u"vboxLayout1") self.caseCheckBox = QCheckBox(FindAndReplaceDlg) self.caseCheckBox.setObjectName(u"caseCheckBox") self.vboxLayout1.addWidget(self.caseCheckBox) self.wholeCheckBox = QCheckBox(FindAndReplaceDlg) self.wholeCheckBox.setObjectName(u"wholeCheckBox") self.wholeCheckBox.setChecked(True) self.vboxLayout1.addWidget(self.wholeCheckBox) self.vboxLayout.addLayout(self.vboxLayout1) self.spacerItem = QSpacerItem(231, 16, QSizePolicy.Minimum, QSizePolicy.Expanding) self.vboxLayout.addItem(self.spacerItem) self.moreFrame = QFrame(FindAndReplaceDlg) self.moreFrame.setObjectName(u"moreFrame") self.moreFrame.setFrameShape(QFrame.StyledPanel) self.moreFrame.setFrameShadow(QFrame.Raised) self.vboxLayout2 = QVBoxLayout(self.moreFrame) # ifndef Q_OS_MAC self.vboxLayout2.setSpacing(6) # endif # ifndef Q_OS_MAC self.vboxLayout2.setContentsMargins(9, 9, 9, 9) # endif self.vboxLayout2.setObjectName(u"vboxLayout2") self.backwardsCheckBox = QCheckBox(self.moreFrame) self.backwardsCheckBox.setObjectName(u"backwardsCheckBox") self.vboxLayout2.addWidget(self.backwardsCheckBox) self.regexCheckBox = QCheckBox(self.moreFrame) self.regexCheckBox.setObjectName(u"regexCheckBox") self.vboxLayout2.addWidget(self.regexCheckBox) self.ignoreNotesCheckBox = QCheckBox(self.moreFrame) self.ignoreNotesCheckBox.setObjectName(u"ignoreNotesCheckBox") self.vboxLayout2.addWidget(self.ignoreNotesCheckBox) self.vboxLayout.addWidget(self.moreFrame) self.hboxLayout.addLayout(self.vboxLayout) self.line = QFrame(FindAndReplaceDlg) self.line.setObjectName(u"line") self.line.setFrameShape(QFrame.VLine) self.line.setFrameShadow(QFrame.Sunken) self.hboxLayout.addWidget(self.line) self.vboxLayout3 = QVBoxLayout() # ifndef Q_OS_MAC self.vboxLayout3.setSpacing(6) # endif self.vboxLayout3.setContentsMargins(0, 0, 0, 0) self.vboxLayout3.setObjectName(u"vboxLayout3") self.findButton = QPushButton(FindAndReplaceDlg) self.findButton.setObjectName(u"findButton") self.findButton.setFocusPolicy(Qt.NoFocus) self.vboxLayout3.addWidget(self.findButton) self.replaceButton = QPushButton(FindAndReplaceDlg) self.replaceButton.setObjectName(u"replaceButton") self.replaceButton.setFocusPolicy(Qt.NoFocus) self.vboxLayout3.addWidget(self.replaceButton) self.closeButton = QPushButton(FindAndReplaceDlg) self.closeButton.setObjectName(u"closeButton") self.closeButton.setFocusPolicy(Qt.NoFocus) self.vboxLayout3.addWidget(self.closeButton) self.moreButton = QPushButton(FindAndReplaceDlg) self.moreButton.setObjectName(u"moreButton") self.moreButton.setFocusPolicy(Qt.NoFocus) self.moreButton.setCheckable(True) self.vboxLayout3.addWidget(self.moreButton) self.spacerItem1 = QSpacerItem(21, 16, QSizePolicy.Minimum, QSizePolicy.Expanding) self.vboxLayout3.addItem(self.spacerItem1) self.hboxLayout.addLayout(self.vboxLayout3) # if QT_CONFIG(shortcut) self.label_2.setBuddy(self.replaceLineEdit) self.label.setBuddy(self.findLineEdit) # endif // QT_CONFIG(shortcut) QWidget.setTabOrder(self.findLineEdit, self.replaceLineEdit) QWidget.setTabOrder(self.replaceLineEdit, self.caseCheckBox) QWidget.setTabOrder(self.caseCheckBox, self.wholeCheckBox) QWidget.setTabOrder(self.wholeCheckBox, self.backwardsCheckBox) QWidget.setTabOrder(self.backwardsCheckBox, self.regexCheckBox) QWidget.setTabOrder(self.regexCheckBox, self.ignoreNotesCheckBox) self.retranslateUi(FindAndReplaceDlg) self.closeButton.clicked.connect(FindAndReplaceDlg.reject) self.moreButton.toggled.connect(self.moreFrame.setVisible) QMetaObject.connectSlotsByName(FindAndReplaceDlg) # setupUi def retranslateUi(self, FindAndReplaceDlg): FindAndReplaceDlg.setWindowTitle( QCoreApplication.translate("FindAndReplaceDlg", u"Find and Replace", None)) self.label_2.setText( QCoreApplication.translate("FindAndReplaceDlg", u"Replace w&ith:", None)) self.label.setText( QCoreApplication.translate("FindAndReplaceDlg", u"Find &what:", None)) self.caseCheckBox.setText( QCoreApplication.translate("FindAndReplaceDlg", u"&Case sensitive", None)) self.wholeCheckBox.setText( QCoreApplication.translate("FindAndReplaceDlg", u"Wh&ole words", None)) self.backwardsCheckBox.setText( QCoreApplication.translate("FindAndReplaceDlg", u"Search &Backwards", None)) self.regexCheckBox.setText( QCoreApplication.translate("FindAndReplaceDlg", u"Regular E&xpression", None)) self.ignoreNotesCheckBox.setText( QCoreApplication.translate("FindAndReplaceDlg", u"Ignore foot¬es and endnotes", None)) self.findButton.setText( QCoreApplication.translate("FindAndReplaceDlg", u"&Find", None)) self.replaceButton.setText( QCoreApplication.translate("FindAndReplaceDlg", u"&Replace", None)) self.closeButton.setText( QCoreApplication.translate("FindAndReplaceDlg", u"Close", None)) self.moreButton.setText( QCoreApplication.translate("FindAndReplaceDlg", u"&More", None))
class Ui_AssetDialog(object): def setupUi(self, AssetDialog): if not AssetDialog.objectName(): AssetDialog.setObjectName(u"AssetDialog") AssetDialog.setWindowModality(Qt.ApplicationModal) AssetDialog.resize(927, 323) AssetDialog.setModal(False) self.gridLayout = QGridLayout(AssetDialog) self.gridLayout.setSpacing(2) self.gridLayout.setObjectName(u"gridLayout") self.gridLayout.setContentsMargins(2, 2, 2, 2) self.horizontalSpacer_4 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.gridLayout.addItem(self.horizontalSpacer_4, 1, 2, 1, 1) self.frame = QFrame(AssetDialog) self.frame.setObjectName(u"frame") sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.frame.sizePolicy().hasHeightForWidth()) self.frame.setSizePolicy(sizePolicy) self.frame.setFrameShape(QFrame.NoFrame) self.frame.setFrameShadow(QFrame.Raised) self.horizontalLayout_3 = QHBoxLayout(self.frame) self.horizontalLayout_3.setSpacing(2) self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0) self.splitter = QSplitter(self.frame) self.splitter.setObjectName(u"splitter") sizePolicy1 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth(self.splitter.sizePolicy().hasHeightForWidth()) self.splitter.setSizePolicy(sizePolicy1) self.splitter.setOrientation(Qt.Horizontal) self.SymbolsFrame = QFrame(self.splitter) self.SymbolsFrame.setObjectName(u"SymbolsFrame") sizePolicy2 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) sizePolicy2.setHorizontalStretch(5) sizePolicy2.setVerticalStretch(0) sizePolicy2.setHeightForWidth(self.SymbolsFrame.sizePolicy().hasHeightForWidth()) self.SymbolsFrame.setSizePolicy(sizePolicy2) self.SymbolsFrame.setFrameShape(QFrame.NoFrame) self.SymbolsFrame.setFrameShadow(QFrame.Raised) self.verticalLayout = QVBoxLayout(self.SymbolsFrame) self.verticalLayout.setSpacing(2) self.verticalLayout.setObjectName(u"verticalLayout") self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.SymbolsCaptionFrame = QFrame(self.SymbolsFrame) self.SymbolsCaptionFrame.setObjectName(u"SymbolsCaptionFrame") self.SymbolsCaptionFrame.setFrameShape(QFrame.NoFrame) self.SymbolsCaptionFrame.setFrameShadow(QFrame.Raised) self.horizontalLayout_5 = QHBoxLayout(self.SymbolsCaptionFrame) self.horizontalLayout_5.setSpacing(2) self.horizontalLayout_5.setObjectName(u"horizontalLayout_5") self.horizontalLayout_5.setContentsMargins(0, 0, 0, 0) self.SymbolsLabel = QLabel(self.SymbolsCaptionFrame) self.SymbolsLabel.setObjectName(u"SymbolsLabel") self.horizontalLayout_5.addWidget(self.SymbolsLabel) self.horizontalSpacer_2 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout_5.addItem(self.horizontalSpacer_2) self.AddSymbolButton = QPushButton(self.SymbolsCaptionFrame) self.AddSymbolButton.setObjectName(u"AddSymbolButton") self.horizontalLayout_5.addWidget(self.AddSymbolButton) self.RemoveSymbolButton = QPushButton(self.SymbolsCaptionFrame) self.RemoveSymbolButton.setObjectName(u"RemoveSymbolButton") self.horizontalLayout_5.addWidget(self.RemoveSymbolButton) self.verticalLayout.addWidget(self.SymbolsCaptionFrame) self.SymbolsTable = QTableView(self.SymbolsFrame) self.SymbolsTable.setObjectName(u"SymbolsTable") self.SymbolsTable.setEditTriggers(QAbstractItemView.AnyKeyPressed|QAbstractItemView.EditKeyPressed|QAbstractItemView.SelectedClicked) self.SymbolsTable.setAlternatingRowColors(True) self.SymbolsTable.setSelectionBehavior(QAbstractItemView.SelectRows) self.SymbolsTable.verticalHeader().setVisible(False) self.SymbolsTable.verticalHeader().setMinimumSectionSize(20) self.SymbolsTable.verticalHeader().setDefaultSectionSize(20) self.verticalLayout.addWidget(self.SymbolsTable) self.splitter.addWidget(self.SymbolsFrame) self.DataFrame = QFrame(self.splitter) self.DataFrame.setObjectName(u"DataFrame") sizePolicy3 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) sizePolicy3.setHorizontalStretch(2) sizePolicy3.setVerticalStretch(0) sizePolicy3.setHeightForWidth(self.DataFrame.sizePolicy().hasHeightForWidth()) self.DataFrame.setSizePolicy(sizePolicy3) self.DataFrame.setFrameShape(QFrame.NoFrame) self.DataFrame.setFrameShadow(QFrame.Raised) self.verticalLayout_2 = QVBoxLayout(self.DataFrame) self.verticalLayout_2.setSpacing(2) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.verticalLayout_2.setContentsMargins(0, 0, 0, 0) self.DataCaptionFrame = QFrame(self.DataFrame) self.DataCaptionFrame.setObjectName(u"DataCaptionFrame") self.DataCaptionFrame.setFrameShape(QFrame.NoFrame) self.DataCaptionFrame.setFrameShadow(QFrame.Raised) self.horizontalLayout_2 = QHBoxLayout(self.DataCaptionFrame) self.horizontalLayout_2.setSpacing(2) self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0) self.DataLbl = QLabel(self.DataCaptionFrame) self.DataLbl.setObjectName(u"DataLbl") self.horizontalLayout_2.addWidget(self.DataLbl) self.horizontalSpacer_3 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout_2.addItem(self.horizontalSpacer_3) self.AddDataButton = QPushButton(self.DataCaptionFrame) self.AddDataButton.setObjectName(u"AddDataButton") self.horizontalLayout_2.addWidget(self.AddDataButton) self.RemoveDataButton = QPushButton(self.DataCaptionFrame) self.RemoveDataButton.setObjectName(u"RemoveDataButton") self.horizontalLayout_2.addWidget(self.RemoveDataButton) self.verticalLayout_2.addWidget(self.DataCaptionFrame) self.DataTable = QTableView(self.DataFrame) self.DataTable.setObjectName(u"DataTable") self.DataTable.setEditTriggers(QAbstractItemView.AnyKeyPressed|QAbstractItemView.EditKeyPressed|QAbstractItemView.SelectedClicked) self.DataTable.setAlternatingRowColors(True) self.DataTable.setSelectionBehavior(QAbstractItemView.SelectRows) self.DataTable.verticalHeader().setVisible(False) self.DataTable.verticalHeader().setMinimumSectionSize(20) self.DataTable.verticalHeader().setDefaultSectionSize(20) self.verticalLayout_2.addWidget(self.DataTable) self.splitter.addWidget(self.DataFrame) self.horizontalLayout_3.addWidget(self.splitter) self.gridLayout.addWidget(self.frame, 3, 0, 1, 5) self.NameLbl = QLabel(AssetDialog) self.NameLbl.setObjectName(u"NameLbl") self.gridLayout.addWidget(self.NameLbl, 0, 0, 1, 1) self.isinLbl = QLabel(AssetDialog) self.isinLbl.setObjectName(u"isinLbl") self.gridLayout.addWidget(self.isinLbl, 1, 0, 1, 1) self.BaseAssetSelector = AssetSelector(AssetDialog) self.BaseAssetSelector.setObjectName(u"BaseAssetSelector") self.gridLayout.addWidget(self.BaseAssetSelector, 2, 1, 1, 1) self.ButtonsFrame = QFrame(AssetDialog) self.ButtonsFrame.setObjectName(u"ButtonsFrame") self.ButtonsFrame.setFrameShape(QFrame.NoFrame) self.ButtonsFrame.setFrameShadow(QFrame.Raised) self.horizontalLayout = QHBoxLayout(self.ButtonsFrame) self.horizontalLayout.setSpacing(2) self.horizontalLayout.setObjectName(u"horizontalLayout") self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout.addItem(self.horizontalSpacer) self.CancelButton = QPushButton(self.ButtonsFrame) self.CancelButton.setObjectName(u"CancelButton") self.horizontalLayout.addWidget(self.CancelButton) self.OkButton = QPushButton(self.ButtonsFrame) self.OkButton.setObjectName(u"OkButton") self.horizontalLayout.addWidget(self.OkButton) self.gridLayout.addWidget(self.ButtonsFrame, 10, 0, 1, 5) self.BaseLbl = QLabel(AssetDialog) self.BaseLbl.setObjectName(u"BaseLbl") self.gridLayout.addWidget(self.BaseLbl, 2, 0, 1, 1) self.TypeLbl = QLabel(AssetDialog) self.TypeLbl.setObjectName(u"TypeLbl") self.gridLayout.addWidget(self.TypeLbl, 1, 3, 1, 1) self.isinEdit = QLineEdit(AssetDialog) self.isinEdit.setObjectName(u"isinEdit") self.gridLayout.addWidget(self.isinEdit, 1, 1, 1, 1) self.CountryLbl = QLabel(AssetDialog) self.CountryLbl.setObjectName(u"CountryLbl") self.gridLayout.addWidget(self.CountryLbl, 2, 3, 1, 1) self.CountryCombo = CountryCombo(AssetDialog) self.CountryCombo.setObjectName(u"CountryCombo") self.gridLayout.addWidget(self.CountryCombo, 2, 4, 1, 1) self.TypeCombo = AssetTypeCombo(AssetDialog) self.TypeCombo.setObjectName(u"TypeCombo") self.gridLayout.addWidget(self.TypeCombo, 1, 4, 1, 1) self.NameEdit = QLineEdit(AssetDialog) self.NameEdit.setObjectName(u"NameEdit") self.gridLayout.addWidget(self.NameEdit, 0, 1, 1, 4) self.retranslateUi(AssetDialog) self.OkButton.clicked.connect(AssetDialog.accept) self.CancelButton.clicked.connect(AssetDialog.reject) QMetaObject.connectSlotsByName(AssetDialog) # setupUi def retranslateUi(self, AssetDialog): AssetDialog.setWindowTitle(QCoreApplication.translate("AssetDialog", u"Asset", None)) self.SymbolsLabel.setText(QCoreApplication.translate("AssetDialog", u"Symbols", None)) self.AddSymbolButton.setText("") self.RemoveSymbolButton.setText("") self.DataLbl.setText(QCoreApplication.translate("AssetDialog", u"Extra data", None)) self.AddDataButton.setText("") self.RemoveDataButton.setText("") self.NameLbl.setText(QCoreApplication.translate("AssetDialog", u"Name:", None)) self.isinLbl.setText(QCoreApplication.translate("AssetDialog", u"ISIN:", None)) self.CancelButton.setText(QCoreApplication.translate("AssetDialog", u"Cancel", None)) self.OkButton.setText(QCoreApplication.translate("AssetDialog", u"OK", None)) self.BaseLbl.setText(QCoreApplication.translate("AssetDialog", u"Base asset:", None)) self.TypeLbl.setText(QCoreApplication.translate("AssetDialog", u"Type: ", None)) self.CountryLbl.setText(QCoreApplication.translate("AssetDialog", u"Country: ", None))
class ResultsGrid(QScrollArea): def __init__(self, parent=None): QScrollArea.__init__(self) self.setParent(parent) # Make QScrollArea transparent self.setStyleSheet( "QScrollArea { background-color: transparent } .QFrame { background-color: transparent }" ) self.setWidgetResizable(True) self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) # Add Touch Gestures to menu. QScroller.grabGesture(self, QScroller.LeftMouseButtonGesture) # Layout settings self.layout = QGridLayout() self.layout.setContentsMargins(0, 0, 0, 0) self.layout.setSpacing(0) # QScrollArea requires a separate QWidget to work properly frame = QFrame() frame.setLayout(self.layout) self.setWidget(frame) def clearResults(self): # Clear the results in the list while self.layout.count(): item = self.layout.takeAt(0) if item.widget() is not None: item.widget().deleteLater() def addResults(self, results): # Add the results to the list # results (list): list of python dict representing results details (playlist or song search) self.clearResults() for i in range(len(results)): item = self.ResultsGridItem(results[i], self) self.layout.addWidget(item, i // 6, i % 6) if results: self.layout.setRowStretch(self.layout.rowCount(), 1) self.layout.setColumnStretch(self.layout.columnCount(), 1) else: # If the results are empty, display no result label = QLabel("没有结果/No Result") label.setStyleSheet("color: white") label.setAlignment(Qt.AlignCenter) font = QFont() font.setPointSize(35) label.setFont(font) self.layout.addWidget(label) class ResultsGridItem(QToolButton): def __init__(self, result, parent=None): QToolButton.__init__(self) self.setParent(parent) self.result = result self.setContentsMargins(0, 0, 0, 0) # Button formatting self.setFixedSize(200, 240) self.setAutoRaise(True) # TODO: change with global themes self.setStyleSheet( "QToolButton:pressed { background-color: rgba(255, 255, 255, 0.1)} QToolButton { background-color: rgba(255, 255, 255, 0.05); border: 1px solid white; color: white}" ) # Set layout settings self.layout = QGridLayout() self.layout.setContentsMargins(0, 0, 0, 0) self.layout.setSpacing(0) if result["type"] == "artists": # Artist image self.formattedImage(self.window().artistPath + result["artist_path"]) self.formattedLabel(result["artist_name"]) # Favourite button self.favouriteButton = QToolButton() self.favouriteButton.setStyleSheet( "QToolButton:pressed { background-color: rgb(31, 41, 75)} QToolButton { background-color: rgb(25, 33, 60);}" ) # Toggle Favourite Icon depending on DB if self.result["favourited"] == 0: self.favouriteButton.isFavourited = False self.favouriteButton.setIcon(QIcon("icons/star.svg")) else: self.favouriteButton.isFavourited = True self.favouriteButton.setIcon( QIcon("icons/star-yellow.svg")) self.favouriteButton.setIconSize(QSize(30, 30)) self.favouriteButton.setFixedSize(70, 70) self.favouriteButton.clicked.connect(self.clickedFavourite) self.layout.addWidget(self.favouriteButton, 0, 0, Qt.AlignRight | Qt.AlignTop) self.clicked.connect(self.clickedArtist) elif result["type"] == "languages": # Language image self.formattedImage(self.window().languagePath + result["language_path"]) self.formattedLabel(result["language_name"]) self.clicked.connect(self.clickedLanguage) self.setLayout(self.layout) def clickedFavourite(self): # Toggle Icon and DB state of song being favourited # For artists only if self.favouriteButton.isFavourited: self.favouriteButton.isFavourited = False self.favouriteButton.setIcon(QIcon("icons/star.svg")) else: self.favouriteButton.isFavourited = True self.favouriteButton.setIcon( QIcon("icons/star-yellow.svg")) DB.setFavouriteArtist(self.result["artist_id"]) def formattedImage(self, path): # Format an image given the path self.setIcon(QIcon(path)) self.setIconSize(QSize(180, 180)) def formattedLabel(self, text): # Format a label given text font = QFont() font.setPixelSize(18) self.setText(text) self.setFont(font) self.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) def clickedArtist(self): # Called when an Artist is clicked on self.window().content.addWidget( WindowSearch( "搜索全部/Search", self, self.window().content.currentWidget().counter + 1, self.result)) self.window().content.setCurrentIndex( self.window().content.currentWidget().counter + 1) def clickedLanguage(self): # Called when a Language is clicked on self.window().content.addWidget( WindowSearch( "搜索歌手/Artist Search", self, self.window().content.currentWidget().counter + 1, self.result, grid=True)) self.window().content.setCurrentIndex( self.window().content.currentWidget().counter + 1)
class ResultsGridItem(QToolButton): def __init__(self, result, parent=None): QToolButton.__init__(self) self.setParent(parent) self.result = result self.setContentsMargins(0, 0, 0, 0) # Button formatting self.setFixedSize(200, 240) self.setAutoRaise(True) # TODO: change with global themes self.setStyleSheet( "QToolButton:pressed { background-color: rgba(255, 255, 255, 0.1)} QToolButton { background-color: rgba(255, 255, 255, 0.05); border: 1px solid white; color: white}" ) # Set layout settings self.layout = QGridLayout() self.layout.setContentsMargins(0, 0, 0, 0) self.layout.setSpacing(0) if result["type"] == "artists": # Artist image self.formattedImage(self.window().artistPath + result["artist_path"]) self.formattedLabel(result["artist_name"]) # Favourite button self.favouriteButton = QToolButton() self.favouriteButton.setStyleSheet( "QToolButton:pressed { background-color: rgb(31, 41, 75)} QToolButton { background-color: rgb(25, 33, 60);}" ) # Toggle Favourite Icon depending on DB if self.result["favourited"] == 0: self.favouriteButton.isFavourited = False self.favouriteButton.setIcon(QIcon("icons/star.svg")) else: self.favouriteButton.isFavourited = True self.favouriteButton.setIcon( QIcon("icons/star-yellow.svg")) self.favouriteButton.setIconSize(QSize(30, 30)) self.favouriteButton.setFixedSize(70, 70) self.favouriteButton.clicked.connect(self.clickedFavourite) self.layout.addWidget(self.favouriteButton, 0, 0, Qt.AlignRight | Qt.AlignTop) self.clicked.connect(self.clickedArtist) elif result["type"] == "languages": # Language image self.formattedImage(self.window().languagePath + result["language_path"]) self.formattedLabel(result["language_name"]) self.clicked.connect(self.clickedLanguage) self.setLayout(self.layout) def clickedFavourite(self): # Toggle Icon and DB state of song being favourited # For artists only if self.favouriteButton.isFavourited: self.favouriteButton.isFavourited = False self.favouriteButton.setIcon(QIcon("icons/star.svg")) else: self.favouriteButton.isFavourited = True self.favouriteButton.setIcon( QIcon("icons/star-yellow.svg")) DB.setFavouriteArtist(self.result["artist_id"]) def formattedImage(self, path): # Format an image given the path self.setIcon(QIcon(path)) self.setIconSize(QSize(180, 180)) def formattedLabel(self, text): # Format a label given text font = QFont() font.setPixelSize(18) self.setText(text) self.setFont(font) self.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) def clickedArtist(self): # Called when an Artist is clicked on self.window().content.addWidget( WindowSearch( "搜索全部/Search", self, self.window().content.currentWidget().counter + 1, self.result)) self.window().content.setCurrentIndex( self.window().content.currentWidget().counter + 1) def clickedLanguage(self): # Called when a Language is clicked on self.window().content.addWidget( WindowSearch( "搜索歌手/Artist Search", self, self.window().content.currentWidget().counter + 1, self.result, grid=True)) self.window().content.setCurrentIndex( self.window().content.currentWidget().counter + 1)
class Ui_Config(object): def setupUi(self, Config): if not Config.objectName(): Config.setObjectName(u"Config") Config.resize(600, 650) Config.setSizeGripEnabled(True) self.vboxLayout = QVBoxLayout(Config) self.vboxLayout.setSpacing(6) self.vboxLayout.setContentsMargins(11, 11, 11, 11) self.vboxLayout.setObjectName(u"vboxLayout") self.vboxLayout.setContentsMargins(8, 8, 8, 8) self.hboxLayout = QHBoxLayout() self.hboxLayout.setSpacing(6) self.hboxLayout.setObjectName(u"hboxLayout") self.hboxLayout.setContentsMargins(0, 0, 0, 0) self.ButtonGroup1 = QGroupBox(Config) self.ButtonGroup1.setObjectName(u"ButtonGroup1") sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.ButtonGroup1.sizePolicy().hasHeightForWidth()) self.ButtonGroup1.setSizePolicy(sizePolicy) self.vboxLayout1 = QVBoxLayout(self.ButtonGroup1) self.vboxLayout1.setSpacing(6) self.vboxLayout1.setContentsMargins(11, 11, 11, 11) self.vboxLayout1.setObjectName(u"vboxLayout1") self.vboxLayout1.setContentsMargins(11, 11, 11, 11) self.size_176_220 = QRadioButton(self.ButtonGroup1) self.size_176_220.setObjectName(u"size_176_220") self.vboxLayout1.addWidget(self.size_176_220) self.size_240_320 = QRadioButton(self.ButtonGroup1) self.size_240_320.setObjectName(u"size_240_320") self.vboxLayout1.addWidget(self.size_240_320) self.size_320_240 = QRadioButton(self.ButtonGroup1) self.size_320_240.setObjectName(u"size_320_240") self.vboxLayout1.addWidget(self.size_320_240) self.size_640_480 = QRadioButton(self.ButtonGroup1) self.size_640_480.setObjectName(u"size_640_480") self.vboxLayout1.addWidget(self.size_640_480) self.size_800_600 = QRadioButton(self.ButtonGroup1) self.size_800_600.setObjectName(u"size_800_600") self.vboxLayout1.addWidget(self.size_800_600) self.size_1024_768 = QRadioButton(self.ButtonGroup1) self.size_1024_768.setObjectName(u"size_1024_768") self.vboxLayout1.addWidget(self.size_1024_768) self.hboxLayout1 = QHBoxLayout() self.hboxLayout1.setSpacing(6) self.hboxLayout1.setObjectName(u"hboxLayout1") self.hboxLayout1.setContentsMargins(0, 0, 0, 0) self.size_custom = QRadioButton(self.ButtonGroup1) self.size_custom.setObjectName(u"size_custom") sizePolicy1 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.size_custom.sizePolicy().hasHeightForWidth()) self.size_custom.setSizePolicy(sizePolicy1) self.hboxLayout1.addWidget(self.size_custom) self.size_width = QSpinBox(self.ButtonGroup1) self.size_width.setObjectName(u"size_width") self.size_width.setMinimum(1) self.size_width.setMaximum(1280) self.size_width.setSingleStep(16) self.size_width.setValue(400) self.hboxLayout1.addWidget(self.size_width) self.size_height = QSpinBox(self.ButtonGroup1) self.size_height.setObjectName(u"size_height") self.size_height.setMinimum(1) self.size_height.setMaximum(1024) self.size_height.setSingleStep(16) self.size_height.setValue(300) self.hboxLayout1.addWidget(self.size_height) self.vboxLayout1.addLayout(self.hboxLayout1) self.hboxLayout.addWidget(self.ButtonGroup1) self.ButtonGroup2 = QGroupBox(Config) self.ButtonGroup2.setObjectName(u"ButtonGroup2") self.vboxLayout2 = QVBoxLayout(self.ButtonGroup2) self.vboxLayout2.setSpacing(6) self.vboxLayout2.setContentsMargins(11, 11, 11, 11) self.vboxLayout2.setObjectName(u"vboxLayout2") self.vboxLayout2.setContentsMargins(11, 11, 11, 11) self.depth_1 = QRadioButton(self.ButtonGroup2) self.depth_1.setObjectName(u"depth_1") self.vboxLayout2.addWidget(self.depth_1) self.depth_4gray = QRadioButton(self.ButtonGroup2) self.depth_4gray.setObjectName(u"depth_4gray") self.vboxLayout2.addWidget(self.depth_4gray) self.depth_8 = QRadioButton(self.ButtonGroup2) self.depth_8.setObjectName(u"depth_8") self.vboxLayout2.addWidget(self.depth_8) self.depth_12 = QRadioButton(self.ButtonGroup2) self.depth_12.setObjectName(u"depth_12") self.vboxLayout2.addWidget(self.depth_12) self.depth_15 = QRadioButton(self.ButtonGroup2) self.depth_15.setObjectName(u"depth_15") self.vboxLayout2.addWidget(self.depth_15) self.depth_16 = QRadioButton(self.ButtonGroup2) self.depth_16.setObjectName(u"depth_16") self.vboxLayout2.addWidget(self.depth_16) self.depth_18 = QRadioButton(self.ButtonGroup2) self.depth_18.setObjectName(u"depth_18") self.vboxLayout2.addWidget(self.depth_18) self.depth_24 = QRadioButton(self.ButtonGroup2) self.depth_24.setObjectName(u"depth_24") self.vboxLayout2.addWidget(self.depth_24) self.depth_32 = QRadioButton(self.ButtonGroup2) self.depth_32.setObjectName(u"depth_32") self.vboxLayout2.addWidget(self.depth_32) self.depth_32_argb = QRadioButton(self.ButtonGroup2) self.depth_32_argb.setObjectName(u"depth_32_argb") self.vboxLayout2.addWidget(self.depth_32_argb) self.hboxLayout.addWidget(self.ButtonGroup2) self.vboxLayout.addLayout(self.hboxLayout) self.hboxLayout2 = QHBoxLayout() self.hboxLayout2.setSpacing(6) self.hboxLayout2.setObjectName(u"hboxLayout2") self.hboxLayout2.setContentsMargins(0, 0, 0, 0) self.TextLabel1_3 = QLabel(Config) self.TextLabel1_3.setObjectName(u"TextLabel1_3") self.hboxLayout2.addWidget(self.TextLabel1_3) self.skin = QComboBox(Config) self.skin.addItem("") self.skin.setObjectName(u"skin") sizePolicy2 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed) sizePolicy2.setHorizontalStretch(0) sizePolicy2.setVerticalStretch(0) sizePolicy2.setHeightForWidth( self.skin.sizePolicy().hasHeightForWidth()) self.skin.setSizePolicy(sizePolicy2) self.hboxLayout2.addWidget(self.skin) self.vboxLayout.addLayout(self.hboxLayout2) self.touchScreen = QCheckBox(Config) self.touchScreen.setObjectName(u"touchScreen") self.vboxLayout.addWidget(self.touchScreen) self.lcdScreen = QCheckBox(Config) self.lcdScreen.setObjectName(u"lcdScreen") self.vboxLayout.addWidget(self.lcdScreen) self.spacerItem = QSpacerItem(20, 10, QSizePolicy.Minimum, QSizePolicy.Expanding) self.vboxLayout.addItem(self.spacerItem) self.TextLabel1 = QLabel(Config) self.TextLabel1.setObjectName(u"TextLabel1") sizePolicy.setHeightForWidth( self.TextLabel1.sizePolicy().hasHeightForWidth()) self.TextLabel1.setSizePolicy(sizePolicy) self.TextLabel1.setWordWrap(True) self.vboxLayout.addWidget(self.TextLabel1) self.GroupBox1 = QGroupBox(Config) self.GroupBox1.setObjectName(u"GroupBox1") self.gridLayout = QGridLayout(self.GroupBox1) self.gridLayout.setSpacing(6) self.gridLayout.setContentsMargins(11, 11, 11, 11) self.gridLayout.setObjectName(u"gridLayout") self.gridLayout.setHorizontalSpacing(6) self.gridLayout.setVerticalSpacing(6) self.gridLayout.setContentsMargins(11, 11, 11, 11) self.TextLabel3 = QLabel(self.GroupBox1) self.TextLabel3.setObjectName(u"TextLabel3") self.gridLayout.addWidget(self.TextLabel3, 6, 0, 1, 1) self.bslider = QSlider(self.GroupBox1) self.bslider.setObjectName(u"bslider") palette = QPalette() brush = QBrush(QColor(128, 128, 128, 255)) brush.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.WindowText, brush) brush1 = QBrush(QColor(0, 0, 255, 255)) brush1.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Button, brush1) brush2 = QBrush(QColor(127, 127, 255, 255)) brush2.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Light, brush2) brush3 = QBrush(QColor(38, 38, 255, 255)) brush3.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Midlight, brush3) brush4 = QBrush(QColor(0, 0, 127, 255)) brush4.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Dark, brush4) brush5 = QBrush(QColor(0, 0, 170, 255)) brush5.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Mid, brush5) brush6 = QBrush(QColor(0, 0, 0, 255)) brush6.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Text, brush6) brush7 = QBrush(QColor(255, 255, 255, 255)) brush7.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.BrightText, brush7) palette.setBrush(QPalette.Active, QPalette.ButtonText, brush) palette.setBrush(QPalette.Active, QPalette.Base, brush7) brush8 = QBrush(QColor(220, 220, 220, 255)) brush8.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Window, brush8) palette.setBrush(QPalette.Active, QPalette.Shadow, brush6) brush9 = QBrush(QColor(10, 95, 137, 255)) brush9.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Highlight, brush9) palette.setBrush(QPalette.Active, QPalette.HighlightedText, brush7) palette.setBrush(QPalette.Active, QPalette.Link, brush6) palette.setBrush(QPalette.Active, QPalette.LinkVisited, brush6) brush10 = QBrush(QColor(232, 232, 232, 255)) brush10.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.AlternateBase, brush10) palette.setBrush(QPalette.Inactive, QPalette.WindowText, brush) palette.setBrush(QPalette.Inactive, QPalette.Button, brush1) palette.setBrush(QPalette.Inactive, QPalette.Light, brush2) palette.setBrush(QPalette.Inactive, QPalette.Midlight, brush3) palette.setBrush(QPalette.Inactive, QPalette.Dark, brush4) palette.setBrush(QPalette.Inactive, QPalette.Mid, brush5) palette.setBrush(QPalette.Inactive, QPalette.Text, brush6) palette.setBrush(QPalette.Inactive, QPalette.BrightText, brush7) palette.setBrush(QPalette.Inactive, QPalette.ButtonText, brush) palette.setBrush(QPalette.Inactive, QPalette.Base, brush7) palette.setBrush(QPalette.Inactive, QPalette.Window, brush8) palette.setBrush(QPalette.Inactive, QPalette.Shadow, brush6) palette.setBrush(QPalette.Inactive, QPalette.Highlight, brush9) palette.setBrush(QPalette.Inactive, QPalette.HighlightedText, brush7) palette.setBrush(QPalette.Inactive, QPalette.Link, brush6) palette.setBrush(QPalette.Inactive, QPalette.LinkVisited, brush6) palette.setBrush(QPalette.Inactive, QPalette.AlternateBase, brush10) palette.setBrush(QPalette.Disabled, QPalette.WindowText, brush) palette.setBrush(QPalette.Disabled, QPalette.Button, brush1) palette.setBrush(QPalette.Disabled, QPalette.Light, brush2) palette.setBrush(QPalette.Disabled, QPalette.Midlight, brush3) palette.setBrush(QPalette.Disabled, QPalette.Dark, brush4) palette.setBrush(QPalette.Disabled, QPalette.Mid, brush5) palette.setBrush(QPalette.Disabled, QPalette.Text, brush6) palette.setBrush(QPalette.Disabled, QPalette.BrightText, brush7) palette.setBrush(QPalette.Disabled, QPalette.ButtonText, brush) palette.setBrush(QPalette.Disabled, QPalette.Base, brush7) palette.setBrush(QPalette.Disabled, QPalette.Window, brush8) palette.setBrush(QPalette.Disabled, QPalette.Shadow, brush6) palette.setBrush(QPalette.Disabled, QPalette.Highlight, brush9) palette.setBrush(QPalette.Disabled, QPalette.HighlightedText, brush7) palette.setBrush(QPalette.Disabled, QPalette.Link, brush6) palette.setBrush(QPalette.Disabled, QPalette.LinkVisited, brush6) palette.setBrush(QPalette.Disabled, QPalette.AlternateBase, brush10) self.bslider.setPalette(palette) self.bslider.setMaximum(400) self.bslider.setValue(100) self.bslider.setOrientation(Qt.Horizontal) self.gridLayout.addWidget(self.bslider, 6, 1, 1, 1) self.blabel = QLabel(self.GroupBox1) self.blabel.setObjectName(u"blabel") self.gridLayout.addWidget(self.blabel, 6, 2, 1, 1) self.TextLabel2 = QLabel(self.GroupBox1) self.TextLabel2.setObjectName(u"TextLabel2") self.gridLayout.addWidget(self.TextLabel2, 4, 0, 1, 1) self.gslider = QSlider(self.GroupBox1) self.gslider.setObjectName(u"gslider") palette1 = QPalette() palette1.setBrush(QPalette.Active, QPalette.WindowText, brush) brush11 = QBrush(QColor(0, 255, 0, 255)) brush11.setStyle(Qt.SolidPattern) palette1.setBrush(QPalette.Active, QPalette.Button, brush11) brush12 = QBrush(QColor(127, 255, 127, 255)) brush12.setStyle(Qt.SolidPattern) palette1.setBrush(QPalette.Active, QPalette.Light, brush12) brush13 = QBrush(QColor(38, 255, 38, 255)) brush13.setStyle(Qt.SolidPattern) palette1.setBrush(QPalette.Active, QPalette.Midlight, brush13) brush14 = QBrush(QColor(0, 127, 0, 255)) brush14.setStyle(Qt.SolidPattern) palette1.setBrush(QPalette.Active, QPalette.Dark, brush14) brush15 = QBrush(QColor(0, 170, 0, 255)) brush15.setStyle(Qt.SolidPattern) palette1.setBrush(QPalette.Active, QPalette.Mid, brush15) palette1.setBrush(QPalette.Active, QPalette.Text, brush6) palette1.setBrush(QPalette.Active, QPalette.BrightText, brush7) palette1.setBrush(QPalette.Active, QPalette.ButtonText, brush) palette1.setBrush(QPalette.Active, QPalette.Base, brush7) palette1.setBrush(QPalette.Active, QPalette.Window, brush8) palette1.setBrush(QPalette.Active, QPalette.Shadow, brush6) palette1.setBrush(QPalette.Active, QPalette.Highlight, brush9) palette1.setBrush(QPalette.Active, QPalette.HighlightedText, brush7) palette1.setBrush(QPalette.Active, QPalette.Link, brush6) palette1.setBrush(QPalette.Active, QPalette.LinkVisited, brush6) palette1.setBrush(QPalette.Active, QPalette.AlternateBase, brush10) palette1.setBrush(QPalette.Inactive, QPalette.WindowText, brush) palette1.setBrush(QPalette.Inactive, QPalette.Button, brush11) palette1.setBrush(QPalette.Inactive, QPalette.Light, brush12) palette1.setBrush(QPalette.Inactive, QPalette.Midlight, brush13) palette1.setBrush(QPalette.Inactive, QPalette.Dark, brush14) palette1.setBrush(QPalette.Inactive, QPalette.Mid, brush15) palette1.setBrush(QPalette.Inactive, QPalette.Text, brush6) palette1.setBrush(QPalette.Inactive, QPalette.BrightText, brush7) palette1.setBrush(QPalette.Inactive, QPalette.ButtonText, brush) palette1.setBrush(QPalette.Inactive, QPalette.Base, brush7) palette1.setBrush(QPalette.Inactive, QPalette.Window, brush8) palette1.setBrush(QPalette.Inactive, QPalette.Shadow, brush6) palette1.setBrush(QPalette.Inactive, QPalette.Highlight, brush9) palette1.setBrush(QPalette.Inactive, QPalette.HighlightedText, brush7) palette1.setBrush(QPalette.Inactive, QPalette.Link, brush6) palette1.setBrush(QPalette.Inactive, QPalette.LinkVisited, brush6) palette1.setBrush(QPalette.Inactive, QPalette.AlternateBase, brush10) palette1.setBrush(QPalette.Disabled, QPalette.WindowText, brush) palette1.setBrush(QPalette.Disabled, QPalette.Button, brush11) palette1.setBrush(QPalette.Disabled, QPalette.Light, brush12) palette1.setBrush(QPalette.Disabled, QPalette.Midlight, brush13) palette1.setBrush(QPalette.Disabled, QPalette.Dark, brush14) palette1.setBrush(QPalette.Disabled, QPalette.Mid, brush15) palette1.setBrush(QPalette.Disabled, QPalette.Text, brush6) palette1.setBrush(QPalette.Disabled, QPalette.BrightText, brush7) palette1.setBrush(QPalette.Disabled, QPalette.ButtonText, brush) palette1.setBrush(QPalette.Disabled, QPalette.Base, brush7) palette1.setBrush(QPalette.Disabled, QPalette.Window, brush8) palette1.setBrush(QPalette.Disabled, QPalette.Shadow, brush6) palette1.setBrush(QPalette.Disabled, QPalette.Highlight, brush9) palette1.setBrush(QPalette.Disabled, QPalette.HighlightedText, brush7) palette1.setBrush(QPalette.Disabled, QPalette.Link, brush6) palette1.setBrush(QPalette.Disabled, QPalette.LinkVisited, brush6) palette1.setBrush(QPalette.Disabled, QPalette.AlternateBase, brush10) self.gslider.setPalette(palette1) self.gslider.setMaximum(400) self.gslider.setValue(100) self.gslider.setOrientation(Qt.Horizontal) self.gridLayout.addWidget(self.gslider, 4, 1, 1, 1) self.glabel = QLabel(self.GroupBox1) self.glabel.setObjectName(u"glabel") self.gridLayout.addWidget(self.glabel, 4, 2, 1, 1) self.TextLabel7 = QLabel(self.GroupBox1) self.TextLabel7.setObjectName(u"TextLabel7") self.gridLayout.addWidget(self.TextLabel7, 0, 0, 1, 1) self.TextLabel8 = QLabel(self.GroupBox1) self.TextLabel8.setObjectName(u"TextLabel8") self.gridLayout.addWidget(self.TextLabel8, 0, 2, 1, 1) self.gammaslider = QSlider(self.GroupBox1) self.gammaslider.setObjectName(u"gammaslider") palette2 = QPalette() palette2.setBrush(QPalette.Active, QPalette.WindowText, brush) palette2.setBrush(QPalette.Active, QPalette.Button, brush7) palette2.setBrush(QPalette.Active, QPalette.Light, brush7) palette2.setBrush(QPalette.Active, QPalette.Midlight, brush7) brush16 = QBrush(QColor(127, 127, 127, 255)) brush16.setStyle(Qt.SolidPattern) palette2.setBrush(QPalette.Active, QPalette.Dark, brush16) brush17 = QBrush(QColor(170, 170, 170, 255)) brush17.setStyle(Qt.SolidPattern) palette2.setBrush(QPalette.Active, QPalette.Mid, brush17) palette2.setBrush(QPalette.Active, QPalette.Text, brush6) palette2.setBrush(QPalette.Active, QPalette.BrightText, brush7) palette2.setBrush(QPalette.Active, QPalette.ButtonText, brush) palette2.setBrush(QPalette.Active, QPalette.Base, brush7) palette2.setBrush(QPalette.Active, QPalette.Window, brush8) palette2.setBrush(QPalette.Active, QPalette.Shadow, brush6) palette2.setBrush(QPalette.Active, QPalette.Highlight, brush9) palette2.setBrush(QPalette.Active, QPalette.HighlightedText, brush7) palette2.setBrush(QPalette.Active, QPalette.Link, brush6) palette2.setBrush(QPalette.Active, QPalette.LinkVisited, brush6) palette2.setBrush(QPalette.Active, QPalette.AlternateBase, brush10) palette2.setBrush(QPalette.Inactive, QPalette.WindowText, brush) palette2.setBrush(QPalette.Inactive, QPalette.Button, brush7) palette2.setBrush(QPalette.Inactive, QPalette.Light, brush7) palette2.setBrush(QPalette.Inactive, QPalette.Midlight, brush7) palette2.setBrush(QPalette.Inactive, QPalette.Dark, brush16) palette2.setBrush(QPalette.Inactive, QPalette.Mid, brush17) palette2.setBrush(QPalette.Inactive, QPalette.Text, brush6) palette2.setBrush(QPalette.Inactive, QPalette.BrightText, brush7) palette2.setBrush(QPalette.Inactive, QPalette.ButtonText, brush) palette2.setBrush(QPalette.Inactive, QPalette.Base, brush7) palette2.setBrush(QPalette.Inactive, QPalette.Window, brush8) palette2.setBrush(QPalette.Inactive, QPalette.Shadow, brush6) palette2.setBrush(QPalette.Inactive, QPalette.Highlight, brush9) palette2.setBrush(QPalette.Inactive, QPalette.HighlightedText, brush7) palette2.setBrush(QPalette.Inactive, QPalette.Link, brush6) palette2.setBrush(QPalette.Inactive, QPalette.LinkVisited, brush6) palette2.setBrush(QPalette.Inactive, QPalette.AlternateBase, brush10) palette2.setBrush(QPalette.Disabled, QPalette.WindowText, brush) palette2.setBrush(QPalette.Disabled, QPalette.Button, brush7) palette2.setBrush(QPalette.Disabled, QPalette.Light, brush7) palette2.setBrush(QPalette.Disabled, QPalette.Midlight, brush7) palette2.setBrush(QPalette.Disabled, QPalette.Dark, brush16) palette2.setBrush(QPalette.Disabled, QPalette.Mid, brush17) palette2.setBrush(QPalette.Disabled, QPalette.Text, brush6) palette2.setBrush(QPalette.Disabled, QPalette.BrightText, brush7) palette2.setBrush(QPalette.Disabled, QPalette.ButtonText, brush) palette2.setBrush(QPalette.Disabled, QPalette.Base, brush7) palette2.setBrush(QPalette.Disabled, QPalette.Window, brush8) palette2.setBrush(QPalette.Disabled, QPalette.Shadow, brush6) palette2.setBrush(QPalette.Disabled, QPalette.Highlight, brush9) palette2.setBrush(QPalette.Disabled, QPalette.HighlightedText, brush7) palette2.setBrush(QPalette.Disabled, QPalette.Link, brush6) palette2.setBrush(QPalette.Disabled, QPalette.LinkVisited, brush6) palette2.setBrush(QPalette.Disabled, QPalette.AlternateBase, brush10) self.gammaslider.setPalette(palette2) self.gammaslider.setMaximum(400) self.gammaslider.setValue(100) self.gammaslider.setOrientation(Qt.Horizontal) self.gridLayout.addWidget(self.gammaslider, 0, 1, 1, 1) self.TextLabel1_2 = QLabel(self.GroupBox1) self.TextLabel1_2.setObjectName(u"TextLabel1_2") self.gridLayout.addWidget(self.TextLabel1_2, 2, 0, 1, 1) self.rlabel = QLabel(self.GroupBox1) self.rlabel.setObjectName(u"rlabel") self.gridLayout.addWidget(self.rlabel, 2, 2, 1, 1) self.rslider = QSlider(self.GroupBox1) self.rslider.setObjectName(u"rslider") palette3 = QPalette() palette3.setBrush(QPalette.Active, QPalette.WindowText, brush) brush18 = QBrush(QColor(255, 0, 0, 255)) brush18.setStyle(Qt.SolidPattern) palette3.setBrush(QPalette.Active, QPalette.Button, brush18) brush19 = QBrush(QColor(255, 127, 127, 255)) brush19.setStyle(Qt.SolidPattern) palette3.setBrush(QPalette.Active, QPalette.Light, brush19) brush20 = QBrush(QColor(255, 38, 38, 255)) brush20.setStyle(Qt.SolidPattern) palette3.setBrush(QPalette.Active, QPalette.Midlight, brush20) brush21 = QBrush(QColor(127, 0, 0, 255)) brush21.setStyle(Qt.SolidPattern) palette3.setBrush(QPalette.Active, QPalette.Dark, brush21) brush22 = QBrush(QColor(170, 0, 0, 255)) brush22.setStyle(Qt.SolidPattern) palette3.setBrush(QPalette.Active, QPalette.Mid, brush22) palette3.setBrush(QPalette.Active, QPalette.Text, brush6) palette3.setBrush(QPalette.Active, QPalette.BrightText, brush7) palette3.setBrush(QPalette.Active, QPalette.ButtonText, brush) palette3.setBrush(QPalette.Active, QPalette.Base, brush7) palette3.setBrush(QPalette.Active, QPalette.Window, brush8) palette3.setBrush(QPalette.Active, QPalette.Shadow, brush6) palette3.setBrush(QPalette.Active, QPalette.Highlight, brush9) palette3.setBrush(QPalette.Active, QPalette.HighlightedText, brush7) palette3.setBrush(QPalette.Active, QPalette.Link, brush6) palette3.setBrush(QPalette.Active, QPalette.LinkVisited, brush6) palette3.setBrush(QPalette.Active, QPalette.AlternateBase, brush10) palette3.setBrush(QPalette.Inactive, QPalette.WindowText, brush) palette3.setBrush(QPalette.Inactive, QPalette.Button, brush18) palette3.setBrush(QPalette.Inactive, QPalette.Light, brush19) palette3.setBrush(QPalette.Inactive, QPalette.Midlight, brush20) palette3.setBrush(QPalette.Inactive, QPalette.Dark, brush21) palette3.setBrush(QPalette.Inactive, QPalette.Mid, brush22) palette3.setBrush(QPalette.Inactive, QPalette.Text, brush6) palette3.setBrush(QPalette.Inactive, QPalette.BrightText, brush7) palette3.setBrush(QPalette.Inactive, QPalette.ButtonText, brush) palette3.setBrush(QPalette.Inactive, QPalette.Base, brush7) palette3.setBrush(QPalette.Inactive, QPalette.Window, brush8) palette3.setBrush(QPalette.Inactive, QPalette.Shadow, brush6) palette3.setBrush(QPalette.Inactive, QPalette.Highlight, brush9) palette3.setBrush(QPalette.Inactive, QPalette.HighlightedText, brush7) palette3.setBrush(QPalette.Inactive, QPalette.Link, brush6) palette3.setBrush(QPalette.Inactive, QPalette.LinkVisited, brush6) palette3.setBrush(QPalette.Inactive, QPalette.AlternateBase, brush10) palette3.setBrush(QPalette.Disabled, QPalette.WindowText, brush) palette3.setBrush(QPalette.Disabled, QPalette.Button, brush18) palette3.setBrush(QPalette.Disabled, QPalette.Light, brush19) palette3.setBrush(QPalette.Disabled, QPalette.Midlight, brush20) palette3.setBrush(QPalette.Disabled, QPalette.Dark, brush21) palette3.setBrush(QPalette.Disabled, QPalette.Mid, brush22) palette3.setBrush(QPalette.Disabled, QPalette.Text, brush6) palette3.setBrush(QPalette.Disabled, QPalette.BrightText, brush7) palette3.setBrush(QPalette.Disabled, QPalette.ButtonText, brush) palette3.setBrush(QPalette.Disabled, QPalette.Base, brush7) palette3.setBrush(QPalette.Disabled, QPalette.Window, brush8) palette3.setBrush(QPalette.Disabled, QPalette.Shadow, brush6) palette3.setBrush(QPalette.Disabled, QPalette.Highlight, brush9) palette3.setBrush(QPalette.Disabled, QPalette.HighlightedText, brush7) palette3.setBrush(QPalette.Disabled, QPalette.Link, brush6) palette3.setBrush(QPalette.Disabled, QPalette.LinkVisited, brush6) palette3.setBrush(QPalette.Disabled, QPalette.AlternateBase, brush10) self.rslider.setPalette(palette3) self.rslider.setMaximum(400) self.rslider.setValue(100) self.rslider.setOrientation(Qt.Horizontal) self.gridLayout.addWidget(self.rslider, 2, 1, 1, 1) self.PushButton3 = QPushButton(self.GroupBox1) self.PushButton3.setObjectName(u"PushButton3") self.gridLayout.addWidget(self.PushButton3, 8, 0, 1, 3) self.MyCustomWidget1 = GammaView(self.GroupBox1) self.MyCustomWidget1.setObjectName(u"MyCustomWidget1") self.gridLayout.addWidget(self.MyCustomWidget1, 0, 3, 9, 1) self.vboxLayout.addWidget(self.GroupBox1) self.hboxLayout3 = QHBoxLayout() self.hboxLayout3.setSpacing(6) self.hboxLayout3.setObjectName(u"hboxLayout3") self.hboxLayout3.setContentsMargins(0, 0, 0, 0) self.spacerItem1 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.hboxLayout3.addItem(self.spacerItem1) self.buttonOk = QPushButton(Config) self.buttonOk.setObjectName(u"buttonOk") self.buttonOk.setAutoDefault(True) self.hboxLayout3.addWidget(self.buttonOk) self.buttonCancel = QPushButton(Config) self.buttonCancel.setObjectName(u"buttonCancel") self.buttonCancel.setAutoDefault(True) self.hboxLayout3.addWidget(self.buttonCancel) self.vboxLayout.addLayout(self.hboxLayout3) self.retranslateUi(Config) self.size_width.valueChanged.connect(self.size_custom.click) self.size_height.valueChanged.connect(self.size_custom.click) self.buttonOk.setDefault(True) QMetaObject.connectSlotsByName(Config) # setupUi def retranslateUi(self, Config): Config.setWindowTitle( QCoreApplication.translate("Config", u"Configure", None)) self.ButtonGroup1.setTitle( QCoreApplication.translate("Config", u"Size", None)) self.size_176_220.setText( QCoreApplication.translate("Config", u"176x220 \"SmartPhone\"", None)) self.size_240_320.setText( QCoreApplication.translate("Config", u"240x320 \"PDA\"", None)) self.size_320_240.setText( QCoreApplication.translate("Config", u"320x240 \"TV\" / \"QVGA\"", None)) self.size_640_480.setText( QCoreApplication.translate("Config", u"640x480 \"VGA\"", None)) self.size_800_600.setText( QCoreApplication.translate("Config", u"800x600", None)) self.size_1024_768.setText( QCoreApplication.translate("Config", u"1024x768", None)) self.size_custom.setText( QCoreApplication.translate("Config", u"Custom", None)) self.ButtonGroup2.setTitle( QCoreApplication.translate("Config", u"Depth", None)) self.depth_1.setText( QCoreApplication.translate("Config", u"1 bit monochrome", None)) self.depth_4gray.setText( QCoreApplication.translate("Config", u"4 bit grayscale", None)) self.depth_8.setText( QCoreApplication.translate("Config", u"8 bit", None)) self.depth_12.setText( QCoreApplication.translate("Config", u"12 (16) bit", None)) self.depth_15.setText( QCoreApplication.translate("Config", u"15 bit", None)) self.depth_16.setText( QCoreApplication.translate("Config", u"16 bit", None)) self.depth_18.setText( QCoreApplication.translate("Config", u"18 bit", None)) self.depth_24.setText( QCoreApplication.translate("Config", u"24 bit", None)) self.depth_32.setText( QCoreApplication.translate("Config", u"32 bit", None)) self.depth_32_argb.setText( QCoreApplication.translate("Config", u"32 bit ARGB", None)) self.TextLabel1_3.setText( QCoreApplication.translate("Config", u"Skin", None)) self.skin.setItemText( 0, QCoreApplication.translate("Config", u"None", None)) self.touchScreen.setText( QCoreApplication.translate( "Config", u"Emulate touch screen (no mouse move)", None)) self.lcdScreen.setText( QCoreApplication.translate( "Config", u"Emulate LCD screen (Only with fixed zoom of 3.0 times magnification)", None)) self.TextLabel1.setText( QCoreApplication.translate( "Config", u"<p>Note that any applications using the virtual framebuffer will be terminated if you change the Size or Depth <i>above</i>. You may freely modify the Gamma <i>below</i>.", None)) self.GroupBox1.setTitle( QCoreApplication.translate("Config", u"Gamma", None)) self.TextLabel3.setText( QCoreApplication.translate("Config", u"Blue", None)) self.blabel.setText(QCoreApplication.translate("Config", u"1.0", None)) self.TextLabel2.setText( QCoreApplication.translate("Config", u"Green", None)) self.glabel.setText(QCoreApplication.translate("Config", u"1.0", None)) self.TextLabel7.setText( QCoreApplication.translate("Config", u"All", None)) self.TextLabel8.setText( QCoreApplication.translate("Config", u"1.0", None)) self.TextLabel1_2.setText( QCoreApplication.translate("Config", u"Red", None)) self.rlabel.setText(QCoreApplication.translate("Config", u"1.0", None)) self.PushButton3.setText( QCoreApplication.translate("Config", u"Set all to 1.0", None)) self.buttonOk.setText( QCoreApplication.translate("Config", u"&OK", None)) self.buttonCancel.setText( QCoreApplication.translate("Config", u"&Cancel", None))
class Ui_CategoryReportWidget(object): def setupUi(self, CategoryReportWidget): if not CategoryReportWidget.objectName(): CategoryReportWidget.setObjectName(u"CategoryReportWidget") CategoryReportWidget.resize(636, 345) self.verticalLayout = QVBoxLayout(CategoryReportWidget) self.verticalLayout.setSpacing(0) self.verticalLayout.setObjectName(u"verticalLayout") self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.ReportParamsFrame = QFrame(CategoryReportWidget) self.ReportParamsFrame.setObjectName(u"ReportParamsFrame") self.ReportParamsFrame.setFrameShape(QFrame.Panel) self.ReportParamsFrame.setFrameShadow(QFrame.Sunken) self.gridLayout = QGridLayout(self.ReportParamsFrame) self.gridLayout.setSpacing(6) self.gridLayout.setObjectName(u"gridLayout") self.gridLayout.setContentsMargins(2, 2, 2, 2) self.ReportFrameSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.gridLayout.addItem(self.ReportFrameSpacer, 0, 3, 1, 1) self.ReportRange = DateRangeSelector(self.ReportParamsFrame) self.ReportRange.setObjectName(u"ReportRange") self.ReportRange.setProperty("ItemsList", u"QTD;YTD;this_year;last_year") self.gridLayout.addWidget(self.ReportRange, 0, 0, 1, 1) self.ReportCategoryLbl = QLabel(self.ReportParamsFrame) self.ReportCategoryLbl.setObjectName(u"ReportCategoryLbl") self.gridLayout.addWidget(self.ReportCategoryLbl, 0, 1, 1, 1) self.ReportCategoryEdit = CategorySelector(self.ReportParamsFrame) self.ReportCategoryEdit.setObjectName(u"ReportCategoryEdit") self.gridLayout.addWidget(self.ReportCategoryEdit, 0, 2, 1, 1) self.verticalLayout.addWidget(self.ReportParamsFrame) self.ReportTableView = QTableView(CategoryReportWidget) self.ReportTableView.setObjectName(u"ReportTableView") self.ReportTableView.setFrameShape(QFrame.Panel) self.ReportTableView.setFrameShadow(QFrame.Sunken) self.ReportTableView.setEditTriggers(QAbstractItemView.NoEditTriggers) self.ReportTableView.setAlternatingRowColors(True) self.ReportTableView.setGridStyle(Qt.DotLine) self.ReportTableView.setWordWrap(False) self.ReportTableView.verticalHeader().setVisible(False) self.ReportTableView.verticalHeader().setMinimumSectionSize(20) self.ReportTableView.verticalHeader().setDefaultSectionSize(20) self.verticalLayout.addWidget(self.ReportTableView) self.retranslateUi(CategoryReportWidget) QMetaObject.connectSlotsByName(CategoryReportWidget) # setupUi def retranslateUi(self, CategoryReportWidget): CategoryReportWidget.setWindowTitle( QCoreApplication.translate("CategoryReportWidget", u"Report by category", None)) self.ReportCategoryLbl.setText( QCoreApplication.translate("CategoryReportWidget", u"Category:", None))
class Ui_TimeRemap_UI(object): def setupUi(self, TimeRemap_UI): if not TimeRemap_UI.objectName(): TimeRemap_UI.setObjectName(u"TimeRemap_UI") TimeRemap_UI.resize(398, 379) self.gridLayout_2 = QGridLayout(TimeRemap_UI) self.gridLayout_2.setSpacing(0) self.gridLayout_2.setObjectName(u"gridLayout_2") self.gridLayout_2.setContentsMargins(0, 0, 0, 0) self.warningMessage = KMessageWidget(TimeRemap_UI) self.warningMessage.setObjectName(u"warningMessage") self.warningMessage.setWordWrap(True) self.warningMessage.setCloseButtonVisible(False) self.warningMessage.setMessageType(KMessageWidget.Warning) self.gridLayout_2.addWidget(self.warningMessage, 0, 0, 1, 1) self.remap_box = QFrame(TimeRemap_UI) self.remap_box.setObjectName(u"remap_box") self.remap_box.setFrameShape(QFrame.NoFrame) self.remap_box.setFrameShadow(QFrame.Plain) self.gridLayout = QGridLayout(self.remap_box) self.gridLayout.setSpacing(0) self.gridLayout.setObjectName(u"gridLayout") self.gridLayout.setContentsMargins(0, 0, 0, 0) self.horizontalLayout_6 = QHBoxLayout() self.horizontalLayout_6.setObjectName(u"horizontalLayout_6") self.label_6 = QLabel(self.remap_box) self.label_6.setObjectName(u"label_6") self.horizontalLayout_6.addWidget(self.label_6) self.button_center_top = QToolButton(self.remap_box) self.button_center_top.setObjectName(u"button_center_top") icon = QIcon() iconThemeName = u"align-horizontal-center" if QIcon.hasThemeIcon(iconThemeName): icon = QIcon.fromTheme(iconThemeName) else: icon.addFile(u".", QSize(), QIcon.Normal, QIcon.Off) self.button_center_top.setIcon(icon) self.button_center_top.setAutoRaise(True) self.horizontalLayout_6.addWidget(self.button_center_top) self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout_6.addItem(self.horizontalSpacer) self.horizontalSpacer1 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout_6.addItem(self.horizontalSpacer1) self.gridLayout.addLayout(self.horizontalLayout_6, 0, 0, 1, 1) self.remapLayout = QVBoxLayout() self.remapLayout.setObjectName(u"remapLayout") self.gridLayout.addLayout(self.remapLayout, 1, 0, 1, 1) self.horizontalLayout_7 = QHBoxLayout() self.horizontalLayout_7.setObjectName(u"horizontalLayout_7") self.label_5 = QLabel(self.remap_box) self.label_5.setObjectName(u"label_5") self.horizontalLayout_7.addWidget(self.label_5) self.button_center = QToolButton(self.remap_box) self.button_center.setObjectName(u"button_center") self.button_center.setIcon(icon) self.button_center.setAutoRaise(True) self.horizontalLayout_7.addWidget(self.button_center) self.horizontalSpacer_2 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout_7.addItem(self.horizontalSpacer_2) self.gridLayout.addLayout(self.horizontalLayout_7, 2, 0, 1, 1) self.horizontalLayout_8 = QHBoxLayout() self.horizontalLayout_8.setObjectName(u"horizontalLayout_8") self.button_prev = QToolButton(self.remap_box) self.button_prev.setObjectName(u"button_prev") self.button_prev.setAutoRaise(True) self.horizontalLayout_8.addWidget(self.button_prev) self.button_add = QToolButton(self.remap_box) self.button_add.setObjectName(u"button_add") self.button_add.setAutoRaise(True) self.horizontalLayout_8.addWidget(self.button_add) self.button_next = QToolButton(self.remap_box) self.button_next.setObjectName(u"button_next") self.button_next.setAutoRaise(True) self.horizontalLayout_8.addWidget(self.button_next) self.horizontalSpacer_3 = QSpacerItem(28, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout_8.addItem(self.horizontalSpacer_3) self.gridLayout.addLayout(self.horizontalLayout_8, 3, 0, 1, 1) self.info_frame = QFrame(self.remap_box) self.info_frame.setObjectName(u"info_frame") self.info_frame.setFrameShape(QFrame.NoFrame) self.info_frame.setFrameShadow(QFrame.Raised) self.verticalLayout_2 = QVBoxLayout(self.info_frame) self.verticalLayout_2.setSpacing(0) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.verticalLayout_2.setContentsMargins(0, 0, 0, 0) self.horizontalLayout_9 = QHBoxLayout() self.horizontalLayout_9.setObjectName(u"horizontalLayout_9") self.label_7 = QLabel(self.info_frame) self.label_7.setObjectName(u"label_7") self.horizontalLayout_9.addWidget(self.label_7) self.inLayout = QHBoxLayout() self.inLayout.setObjectName(u"inLayout") self.horizontalLayout_9.addLayout(self.inLayout) self.verticalLayout_2.addLayout(self.horizontalLayout_9) self.horizontalLayout_10 = QHBoxLayout() self.horizontalLayout_10.setObjectName(u"horizontalLayout_10") self.label_8 = QLabel(self.info_frame) self.label_8.setObjectName(u"label_8") self.horizontalLayout_10.addWidget(self.label_8) self.outLayout = QHBoxLayout() self.outLayout.setObjectName(u"outLayout") self.horizontalLayout_10.addLayout(self.outLayout) self.verticalLayout_2.addLayout(self.horizontalLayout_10) self.horizontalLayout_11 = QHBoxLayout() self.horizontalLayout_11.setObjectName(u"horizontalLayout_11") self.label_9 = QLabel(self.info_frame) self.label_9.setObjectName(u"label_9") self.horizontalLayout_11.addWidget(self.label_9) self.speedBefore = QDoubleSpinBox(self.info_frame) self.speedBefore.setObjectName(u"speedBefore") self.speedBefore.setMinimum(-100000.000000000000000) self.speedBefore.setMaximum(100000.000000000000000) self.speedBefore.setValue(100.000000000000000) self.horizontalLayout_11.addWidget(self.speedBefore) self.verticalLayout_2.addLayout(self.horizontalLayout_11) self.horizontalLayout_12 = QHBoxLayout() self.horizontalLayout_12.setObjectName(u"horizontalLayout_12") self.label_10 = QLabel(self.info_frame) self.label_10.setObjectName(u"label_10") self.horizontalLayout_12.addWidget(self.label_10) self.speedAfter = QDoubleSpinBox(self.info_frame) self.speedAfter.setObjectName(u"speedAfter") self.speedAfter.setMinimum(-100000.000000000000000) self.speedAfter.setMaximum(100000.000000000000000) self.speedAfter.setValue(100.000000000000000) self.horizontalLayout_12.addWidget(self.speedAfter) self.verticalLayout_2.addLayout(self.horizontalLayout_12) self.gridLayout.addWidget(self.info_frame, 4, 0, 1, 1) self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) self.gridLayout.addItem(self.verticalSpacer, 5, 0, 1, 1) self.horizontalLayout_13 = QHBoxLayout() self.horizontalLayout_13.setObjectName(u"horizontalLayout_13") self.pitch_compensate = QCheckBox(self.remap_box) self.pitch_compensate.setObjectName(u"pitch_compensate") self.pitch_compensate.setChecked(True) self.pitch_compensate.setTristate(False) self.horizontalLayout_13.addWidget(self.pitch_compensate) self.frame_blending = QCheckBox(self.remap_box) self.frame_blending.setObjectName(u"frame_blending") self.horizontalLayout_13.addWidget(self.frame_blending) self.gridLayout.addLayout(self.horizontalLayout_13, 6, 0, 1, 1) self.horizontalLayout_14 = QHBoxLayout() self.horizontalLayout_14.setObjectName(u"horizontalLayout_14") self.move_next = QCheckBox(self.remap_box) self.move_next.setObjectName(u"move_next") self.move_next.setChecked(True) self.horizontalLayout_14.addWidget(self.move_next) self.button_del = QToolButton(self.remap_box) self.button_del.setObjectName(u"button_del") icon1 = QIcon() iconThemeName = u"edit-delete" if QIcon.hasThemeIcon(iconThemeName): icon1 = QIcon.fromTheme(iconThemeName) else: icon1.addFile(u".", QSize(), QIcon.Normal, QIcon.Off) self.button_del.setIcon(icon1) self.horizontalLayout_14.addWidget(self.button_del) self.gridLayout.addLayout(self.horizontalLayout_14, 7, 0, 1, 1) self.gridLayout_2.addWidget(self.remap_box, 1, 0, 1, 1) self.retranslateUi(TimeRemap_UI) QMetaObject.connectSlotsByName(TimeRemap_UI) # setupUi def retranslateUi(self, TimeRemap_UI): TimeRemap_UI.setWindowTitle( QCoreApplication.translate("TimeRemap_UI", u"Form", None)) self.label_6.setText( QCoreApplication.translate("TimeRemap_UI", u"Source clip", None)) self.button_center_top.setText( QCoreApplication.translate("TimeRemap_UI", u"...", None)) self.label_5.setText( QCoreApplication.translate("TimeRemap_UI", u"Output", None)) self.button_center.setText( QCoreApplication.translate("TimeRemap_UI", u"...", None)) self.button_prev.setText( QCoreApplication.translate("TimeRemap_UI", u"...", None)) self.button_add.setText( QCoreApplication.translate("TimeRemap_UI", u"...", None)) self.button_next.setText( QCoreApplication.translate("TimeRemap_UI", u"...", None)) self.label_7.setText( QCoreApplication.translate("TimeRemap_UI", u"Source time", None)) self.label_8.setText( QCoreApplication.translate("TimeRemap_UI", u"Output time", None)) self.label_9.setText( QCoreApplication.translate("TimeRemap_UI", u"Speed before", None)) self.label_10.setText( QCoreApplication.translate("TimeRemap_UI", u"After", None)) self.pitch_compensate.setText( QCoreApplication.translate("TimeRemap_UI", u"Pitch compensation", None)) self.frame_blending.setText( QCoreApplication.translate("TimeRemap_UI", u"Frame blending", None)) self.move_next.setText( QCoreApplication.translate("TimeRemap_UI", u"Preserve speed of next keyframes", None)) self.button_del.setText( QCoreApplication.translate("TimeRemap_UI", u"...", None))
def create_GUI(self) -> None: self.setWindowTitle("MineSweeper 1.1") self.win_massage = QMessageBox(self) self.win_massage.setText("Gratuluji, dokázal jsi nalézt všechny miny") self.setMouseTracking(True) centralWidget = QWidget(self) centralWidget.setStyleSheet("background: white") self.setCentralWidget(centralWidget) self.setFixedSize(X_WINDOW_SIZE + 20, Y_WINDOW_SIZE) layout = QGridLayout(centralWidget) layout.setSpacing(0) layout.setContentsMargins(0, 0, 0, 0) centralWidget.setLayout(layout) self.list_of_labels: list = [] self.list_of_mines = generate_mines(self.number_of_mines, X_SIZE, Y_SIZE) # RESET BUTTON self.reset_button = QPushButton(centralWidget) self.reset_button.setText("RESET") self.reset_button.clicked.connect(self.reset) self.reset_button.setStyleSheet("margin: 3px") self.reset_button.setMinimumSize(0, 50) # TIMER LABEL self.timer_label = QLabel(centralWidget) self.timer_label.setText(f"{self.curr_time.minute():0>2}:{self.curr_time.second():0>2}") self.timer_label.setAlignment(Qt.AlignHCenter) self.timer_label.setStyleSheet("font: 34px") # DIFFICULTY SLIDER self.difficulty_slider = QSlider(centralWidget) self.difficulty_slider.setOrientation(Qt.Horizontal) self.difficulty_slider.setFixedHeight(30) self.difficulty_slider.setRange(1, 10) self.difficulty_slider.setTickInterval(1) self.difficulty_slider.setValue(self.difficulty_slider_default_value) self.difficulty_slider.valueChanged.connect(self.difficulty_label_set) self.difficulty_slider.sliderReleased.connect(self.new_mines_set) # DIFFICULTY LABEL self.difficulty_label = QLabel(centralWidget) self.difficulty_label.setText(str(self.difficulty_slider_default_value)) self.difficulty_label.setAlignment(Qt.AlignCenter) self.difficulty_label.setStyleSheet("font: 20px") for i in range(Y_SIZE): row = [] for j in range(X_SIZE): if (i, j) in self.list_of_mines: mine = True else: mine = False label = Chunk(j, i, mine) label.setFixedSize(FIELD_SQUARE_SIZE, FIELD_SQUARE_SIZE) label.setStyleSheet(f"background: {self.undiscovered_color}; border: 1px solid grey") layout.addWidget(label, i, j) row.append(label) self.list_of_labels.append(row) self.color_theme_combobox = QComboBox(centralWidget) self.color_theme_combobox.addItem("Dark theme", "dark") self.color_theme_combobox.addItem("Light theme", "light") self.color_theme_combobox.addItem("Color theme", "colorful") self.color_theme_combobox.currentIndexChanged.connect(self.theme_change) self.color_theme_combobox.setMinimumHeight(FIELD_SQUARE_SIZE * 2) if self.theme == "dark": self.color_theme_combobox.setCurrentIndex(0) elif self.theme == "light": self.color_theme_combobox.setCurrentIndex(1) else: self.color_theme_combobox.setCurrentIndex(2) layout.addWidget(self.color_theme_combobox, Y_SIZE - 2, X_SIZE, 2, 1) layout.addWidget(self.timer_label, 0, X_SIZE, 3, 1) layout.addWidget(self.reset_button, 2, X_SIZE, 3, 1) layout.addWidget(self.difficulty_slider, Y_SIZE, 1, 1, X_SIZE - 2) layout.addWidget(self.difficulty_label, Y_SIZE, X_SIZE, 1, 1) self.mines_number_surroundings_calculate()
class Ui_VehicleRentalDlg(object): def setupUi(self, VehicleRentalDlg): if not VehicleRentalDlg.objectName(): VehicleRentalDlg.setObjectName(u"VehicleRentalDlg") VehicleRentalDlg.resize(206, 246) self.gridLayout = QGridLayout(VehicleRentalDlg) # ifndef Q_OS_MAC self.gridLayout.setSpacing(6) # endif # ifndef Q_OS_MAC self.gridLayout.setContentsMargins(9, 9, 9, 9) # endif self.gridLayout.setObjectName(u"gridLayout") self.buttonBox = QDialogButtonBox(VehicleRentalDlg) self.buttonBox.setObjectName(u"buttonBox") self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok) self.gridLayout.addWidget(self.buttonBox, 4, 0, 1, 1) self.spacerItem = QSpacerItem(188, 16, QSizePolicy.Minimum, QSizePolicy.Expanding) self.gridLayout.addItem(self.spacerItem, 3, 0, 1, 1) self.hboxLayout = QHBoxLayout() # ifndef Q_OS_MAC self.hboxLayout.setSpacing(6) # endif self.hboxLayout.setContentsMargins(0, 0, 0, 0) self.hboxLayout.setObjectName(u"hboxLayout") self.label_6 = QLabel(VehicleRentalDlg) self.label_6.setObjectName(u"label_6") self.hboxLayout.addWidget(self.label_6) self.mileageLabel = QLabel(VehicleRentalDlg) self.mileageLabel.setObjectName(u"mileageLabel") self.mileageLabel.setFrameShape(QFrame.StyledPanel) self.mileageLabel.setFrameShadow(QFrame.Sunken) self.mileageLabel.setAlignment(Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter) self.hboxLayout.addWidget(self.mileageLabel) self.gridLayout.addLayout(self.hboxLayout, 2, 0, 1, 1) self.stackedWidget = QStackedWidget(VehicleRentalDlg) self.stackedWidget.setObjectName(u"stackedWidget") self.page_2 = QWidget() self.page_2.setObjectName(u"page_2") self.gridLayout1 = QGridLayout(self.page_2) # ifndef Q_OS_MAC self.gridLayout1.setSpacing(6) # endif # ifndef Q_OS_MAC self.gridLayout1.setContentsMargins(9, 9, 9, 9) # endif self.gridLayout1.setObjectName(u"gridLayout1") self.colorComboBox = QComboBox(self.page_2) self.colorComboBox.addItem("") self.colorComboBox.addItem("") self.colorComboBox.addItem("") self.colorComboBox.addItem("") self.colorComboBox.addItem("") self.colorComboBox.addItem("") self.colorComboBox.addItem("") self.colorComboBox.setObjectName(u"colorComboBox") self.gridLayout1.addWidget(self.colorComboBox, 0, 1, 1, 1) self.label_4 = QLabel(self.page_2) self.label_4.setObjectName(u"label_4") self.gridLayout1.addWidget(self.label_4, 0, 0, 1, 1) self.label_5 = QLabel(self.page_2) self.label_5.setObjectName(u"label_5") self.gridLayout1.addWidget(self.label_5, 1, 0, 1, 1) self.seatsSpinBox = QSpinBox(self.page_2) self.seatsSpinBox.setObjectName(u"seatsSpinBox") self.seatsSpinBox.setAlignment(Qt.AlignRight) self.seatsSpinBox.setMinimum(2) self.seatsSpinBox.setMaximum(12) self.seatsSpinBox.setValue(4) self.gridLayout1.addWidget(self.seatsSpinBox, 1, 1, 1, 1) self.stackedWidget.addWidget(self.page_2) self.page = QWidget() self.page.setObjectName(u"page") self.gridLayout2 = QGridLayout(self.page) # ifndef Q_OS_MAC self.gridLayout2.setSpacing(6) # endif # ifndef Q_OS_MAC self.gridLayout2.setContentsMargins(9, 9, 9, 9) # endif self.gridLayout2.setObjectName(u"gridLayout2") self.weightSpinBox = QSpinBox(self.page) self.weightSpinBox.setObjectName(u"weightSpinBox") self.weightSpinBox.setAlignment(Qt.AlignRight) self.weightSpinBox.setMinimum(1) self.weightSpinBox.setMaximum(8) self.gridLayout2.addWidget(self.weightSpinBox, 0, 1, 1, 1) self.label_3 = QLabel(self.page) self.label_3.setObjectName(u"label_3") self.gridLayout2.addWidget(self.label_3, 1, 0, 1, 1) self.label_2 = QLabel(self.page) self.label_2.setObjectName(u"label_2") self.gridLayout2.addWidget(self.label_2, 0, 0, 1, 1) self.volumeSpinBox = QSpinBox(self.page) self.volumeSpinBox.setObjectName(u"volumeSpinBox") self.volumeSpinBox.setAlignment(Qt.AlignRight) self.volumeSpinBox.setMinimum(4) self.volumeSpinBox.setMaximum(22) self.volumeSpinBox.setValue(10) self.gridLayout2.addWidget(self.volumeSpinBox, 1, 1, 1, 1) self.stackedWidget.addWidget(self.page) self.gridLayout.addWidget(self.stackedWidget, 1, 0, 1, 1) self.hboxLayout1 = QHBoxLayout() # ifndef Q_OS_MAC self.hboxLayout1.setSpacing(6) # endif self.hboxLayout1.setContentsMargins(0, 0, 0, 0) self.hboxLayout1.setObjectName(u"hboxLayout1") self.label = QLabel(VehicleRentalDlg) self.label.setObjectName(u"label") self.hboxLayout1.addWidget(self.label) self.vehicleComboBox = QComboBox(VehicleRentalDlg) self.vehicleComboBox.addItem("") self.vehicleComboBox.addItem("") self.vehicleComboBox.setObjectName(u"vehicleComboBox") self.hboxLayout1.addWidget(self.vehicleComboBox) self.gridLayout.addLayout(self.hboxLayout1, 0, 0, 1, 1) # if QT_CONFIG(shortcut) self.label_4.setBuddy(self.colorComboBox) self.label_5.setBuddy(self.seatsSpinBox) self.label_3.setBuddy(self.volumeSpinBox) self.label_2.setBuddy(self.seatsSpinBox) self.label.setBuddy(self.vehicleComboBox) # endif // QT_CONFIG(shortcut) self.retranslateUi(VehicleRentalDlg) self.vehicleComboBox.currentIndexChanged.connect( self.stackedWidget.setCurrentIndex) self.buttonBox.accepted.connect(VehicleRentalDlg.accept) self.buttonBox.rejected.connect(VehicleRentalDlg.reject) self.stackedWidget.setCurrentIndex(0) QMetaObject.connectSlotsByName(VehicleRentalDlg) # setupUi def retranslateUi(self, VehicleRentalDlg): VehicleRentalDlg.setWindowTitle( QCoreApplication.translate("VehicleRentalDlg", u"Vehicle Rental", None)) self.label_6.setText( QCoreApplication.translate("VehicleRentalDlg", u"Max. Mileage:", None)) self.mileageLabel.setText( QCoreApplication.translate("VehicleRentalDlg", u"1000 miles", None)) self.colorComboBox.setItemText( 0, QCoreApplication.translate("VehicleRentalDlg", u"Black", None)) self.colorComboBox.setItemText( 1, QCoreApplication.translate("VehicleRentalDlg", u"Blue", None)) self.colorComboBox.setItemText( 2, QCoreApplication.translate("VehicleRentalDlg", u"Green", None)) self.colorComboBox.setItemText( 3, QCoreApplication.translate("VehicleRentalDlg", u"Red", None)) self.colorComboBox.setItemText( 4, QCoreApplication.translate("VehicleRentalDlg", u"Silver", None)) self.colorComboBox.setItemText( 5, QCoreApplication.translate("VehicleRentalDlg", u"White", None)) self.colorComboBox.setItemText( 6, QCoreApplication.translate("VehicleRentalDlg", u"Yellow", None)) self.label_4.setText( QCoreApplication.translate("VehicleRentalDlg", u"Co&lor:", None)) self.label_5.setText( QCoreApplication.translate("VehicleRentalDlg", u"&Seats:", None)) self.weightSpinBox.setSuffix( QCoreApplication.translate("VehicleRentalDlg", u" tons", None)) self.label_3.setText( QCoreApplication.translate("VehicleRentalDlg", u"Volu&me:", None)) self.label_2.setText( QCoreApplication.translate("VehicleRentalDlg", u"&Weight:", None)) self.volumeSpinBox.setSuffix( QCoreApplication.translate("VehicleRentalDlg", u" cu m", None)) self.label.setText( QCoreApplication.translate("VehicleRentalDlg", u"&Vehicle Type:", None)) self.vehicleComboBox.setItemText( 0, QCoreApplication.translate("VehicleRentalDlg", u"Car", None)) self.vehicleComboBox.setItemText( 1, QCoreApplication.translate("VehicleRentalDlg", u"Van", None))