def __init__(self, parent=None): super(BlockingClient, self).__init__(parent) self.thread = FortuneThread() self.currentFortune = '' hostLabel = QLabel("&Server name:") portLabel = QLabel("S&erver port:") for ipAddress in QNetworkInterface.allAddresses(): if ipAddress != QHostAddress.LocalHost and ipAddress.toIPv4Address( ) != 0: break else: ipAddress = QHostAddress(QHostAddress.LocalHost) ipAddress = ipAddress.toString() self.hostLineEdit = QLineEdit(ipAddress) self.portLineEdit = QLineEdit() self.portLineEdit.setValidator(QIntValidator(1, 65535, self)) hostLabel.setBuddy(self.hostLineEdit) portLabel.setBuddy(self.portLineEdit) self.statusLabel = QLabel( "This example requires that you run the Fortune Server example as well." ) self.statusLabel.setWordWrap(True) self.getFortuneButton = QPushButton("Get Fortune") self.getFortuneButton.setDefault(True) self.getFortuneButton.setEnabled(False) quitButton = QPushButton("Quit") buttonBox = QDialogButtonBox() buttonBox.addButton(self.getFortuneButton, QDialogButtonBox.ActionRole) buttonBox.addButton(quitButton, QDialogButtonBox.RejectRole) self.getFortuneButton.clicked.connect(self.requestNewFortune) quitButton.clicked.connect(self.close) self.hostLineEdit.textChanged.connect(self.enableGetFortuneButton) self.portLineEdit.textChanged.connect(self.enableGetFortuneButton) self.thread.newFortune.connect(self.showFortune) self.thread.error.connect(self.displayError) mainLayout = QGridLayout() mainLayout.addWidget(hostLabel, 0, 0) mainLayout.addWidget(self.hostLineEdit, 0, 1) mainLayout.addWidget(portLabel, 1, 0) mainLayout.addWidget(self.portLineEdit, 1, 1) mainLayout.addWidget(self.statusLabel, 2, 0, 1, 2) mainLayout.addWidget(buttonBox, 3, 0, 1, 2) self.setLayout(mainLayout) self.setWindowTitle("Blocking Fortune Client") self.portLineEdit.setFocus()
def create_date_picker(text, parent): """Creates a label with the given text and an accompanying date picker""" date_edit = QDateTimeEdit(QDate.currentDate(), parent) date_edit.setMaximumDate(QDate.currentDate()) date_edit.setDisplayFormat(DATE_FORMAT) date_edit.setCalendarPopup(True) date_edit.setDisabled(True) date_edit_label = QLabel(text, date_edit) date_edit_label.setBuddy(date_edit) return (date_edit, date_edit_label)
class Form(QDialog): def __init__(self, parent=None): super(Form, self).__init__(parent) self.title = "Emoji Splitter" self.setWindowTitle(self.title) # preview_split widget self.preview_widget = QLabel() # media_preview = QPixmap('C:/Users/roela/PycharmProjects/Emojisplitter/bolkvis.png') # media_preview = QMovie('Naamloos.gif') # QPixmap('Naamloos.gif') self.media_preview('Naamloos.gif') # embed preview_split in a scrollable window self.preview_scroll_area = QScrollArea() self.preview_scroll_area.setWidget(self.preview_widget) self.preview_scroll_area.setBackgroundRole(QPalette.Dark) self.preview_scroll_area.setWidgetResizable(True) # Create button widgets self.open_file_button = QPushButton("Select &File") self.filename = QLineEdit("C:/Users/roela/PycharmProjects/Emojisplitter/Naamloos.gif") self.preview_button = QPushButton("&Preview Split") self.fit_to_window_checkbox = QCheckBox("Fit Preview Image to &Window") self.horizontal_emojis_spinbox = QSpinBox() self.horizontal_emojis_spinbox.setMinimum(1) self.horizontal_emojis_label = QLabel("Number of &horizontal emojis:") self.horizontal_emojis_label.setBuddy(self.horizontal_emojis_spinbox) self.vertical_emojis_spinbox = QSpinBox() self.vertical_emojis_spinbox.setMinimum(1) self.vertical_emojis_label = QLabel("Number of &vertical emojis:") self.vertical_emojis_label.setBuddy(self.vertical_emojis_spinbox) self.split_emojis_button = QPushButton("&Split Emoji") self.results_folder_button = QPushButton("Open folder with &results") # give the button_layout a fixed width button_container = QWidget() button_container.setFixedWidth(256) # Create layout and add widgets button_layout = QVBoxLayout(button_container) button_layout.addWidget(self.open_file_button) button_layout.addWidget(self.filename) # Put labels next to spinboxes horizontal_emojis_layout = QHBoxLayout() horizontal_emojis_layout.addWidget(self.horizontal_emojis_label) horizontal_emojis_layout.addWidget(self.horizontal_emojis_spinbox) vertical_emojis_layout = QHBoxLayout() vertical_emojis_layout.addWidget(self.vertical_emojis_label) vertical_emojis_layout.addWidget(self.vertical_emojis_spinbox) button_layout.addLayout(horizontal_emojis_layout) button_layout.addLayout(vertical_emojis_layout) button_layout.addWidget(self.preview_button) button_layout.addWidget(self.fit_to_window_checkbox) button_layout.addWidget(self.split_emojis_button) button_layout.addWidget(self.results_folder_button) preview_layout = QVBoxLayout() # preview_layout.addWidget(self.preview_widget) preview_layout.addWidget(self.preview_scroll_area) # combine button and preview_split layout nested_layout = QHBoxLayout() nested_layout.addWidget(button_container) nested_layout.addLayout(preview_layout) # Set dialog layout self.setLayout(nested_layout) # Add button functions self.open_file_button.clicked.connect(self.open_file) self.preview_button.clicked.connect(self.preview_split) self.fit_to_window_checkbox.clicked.connect(self.fit_to_window) self.split_emojis_button.clicked.connect(self.split) self.results_folder_button.clicked.connect(self.open_folder_with_results) # update preview_split on changing value of a spinbox self.horizontal_emojis_spinbox.valueChanged.connect(self.preview_split) self.vertical_emojis_spinbox.valueChanged.connect(self.preview_split) # Preview the image. def preview_split(self): preview_image = emojisplitter.emojisplitter(self.filename.text(), self.horizontal_emojis_spinbox.value(), self.vertical_emojis_spinbox.value(), False) self.preview_widget.setPixmap(preview_image) if self.fit_to_window_checkbox.checkState(): self.fit_to_window() # Fit the image to the current window def fit_to_window(self): self.preview_widget.setPixmap( self.preview_widget.pixmap().scaled(self.preview_scroll_area.width(), self.preview_scroll_area.height(), aspectMode=Qt.KeepAspectRatio)) # open file def open_file(self): self.filename.setText(QFileDialog.getOpenFileName(self, "Open Image")[0]) self.media_preview(self.filename.text()) def media_preview(self, filename): media_preview = QMovie(filename) self.preview_widget.setMovie(media_preview) self.preview_widget.movie().start() self.preview_widget.resize(media_preview.currentPixmap().width(), media_preview.currentPixmap().height()) # self.preview_split() # This immediately show where the split would be def split(self): emojisplitter.emojisplitter(self.filename.text(), self.horizontal_emojis_spinbox.value(), self.vertical_emojis_spinbox.value(), True) def open_folder_with_results(self): path = Path(self.filename.text()).parent webbrowser.open('file:///' + str(path))
def create_qlineedit(self, text): """Creates a label with the given text and an accompanying line edit""" line_edit = QLineEdit(self) line_edit_label = QLabel(text, line_edit) line_edit_label.setBuddy(line_edit) return (line_edit, line_edit_label)
class Window(QWidget): def __init__(self): super(Window, self).__init__() self.proxyModel = QSortFilterProxyModel() self.proxyModel.setDynamicSortFilter(True) self.sourceGroupBox = QGroupBox("Original Model") self.proxyGroupBox = QGroupBox("Sorted/Filtered Model") self.sourceView = QTreeView() self.sourceView.setRootIsDecorated(False) self.sourceView.setAlternatingRowColors(True) self.proxyView = QTreeView() self.proxyView.setRootIsDecorated(False) self.proxyView.setAlternatingRowColors(True) self.proxyView.setModel(self.proxyModel) self.proxyView.setSortingEnabled(True) self.sortCaseSensitivityCheckBox = QCheckBox("Case sensitive sorting") self.filterCaseSensitivityCheckBox = QCheckBox("Case sensitive filter") self.filterPatternLineEdit = QLineEdit() self.filterPatternLineEdit.setClearButtonEnabled(True) self.filterPatternLabel = QLabel("&Filter pattern:") self.filterPatternLabel.setBuddy(self.filterPatternLineEdit) self.filterSyntaxComboBox = QComboBox() self.filterSyntaxComboBox.addItem("Regular expression", REGULAR_EXPRESSION) self.filterSyntaxComboBox.addItem("Wildcard", WILDCARD) self.filterSyntaxComboBox.addItem("Fixed string", FIXED_STRING) self.filterSyntaxLabel = QLabel("Filter &syntax:") self.filterSyntaxLabel.setBuddy(self.filterSyntaxComboBox) self.filterColumnComboBox = QComboBox() self.filterColumnComboBox.addItem("Subject") self.filterColumnComboBox.addItem("Sender") self.filterColumnComboBox.addItem("Date") self.filterColumnLabel = QLabel("Filter &column:") self.filterColumnLabel.setBuddy(self.filterColumnComboBox) self.filterPatternLineEdit.textChanged.connect(self.filterRegExpChanged) self.filterSyntaxComboBox.currentIndexChanged.connect(self.filterRegExpChanged) self.filterColumnComboBox.currentIndexChanged.connect(self.filterColumnChanged) self.filterCaseSensitivityCheckBox.toggled.connect(self.filterRegExpChanged) self.sortCaseSensitivityCheckBox.toggled.connect(self.sortChanged) sourceLayout = QHBoxLayout() sourceLayout.addWidget(self.sourceView) self.sourceGroupBox.setLayout(sourceLayout) proxyLayout = QGridLayout() proxyLayout.addWidget(self.proxyView, 0, 0, 1, 3) proxyLayout.addWidget(self.filterPatternLabel, 1, 0) proxyLayout.addWidget(self.filterPatternLineEdit, 1, 1, 1, 2) proxyLayout.addWidget(self.filterSyntaxLabel, 2, 0) proxyLayout.addWidget(self.filterSyntaxComboBox, 2, 1, 1, 2) proxyLayout.addWidget(self.filterColumnLabel, 3, 0) proxyLayout.addWidget(self.filterColumnComboBox, 3, 1, 1, 2) proxyLayout.addWidget(self.filterCaseSensitivityCheckBox, 4, 0, 1, 2) proxyLayout.addWidget(self.sortCaseSensitivityCheckBox, 4, 2) self.proxyGroupBox.setLayout(proxyLayout) mainLayout = QVBoxLayout() mainLayout.addWidget(self.sourceGroupBox) mainLayout.addWidget(self.proxyGroupBox) self.setLayout(mainLayout) self.setWindowTitle("Basic Sort/Filter Model") self.resize(500, 450) self.proxyView.sortByColumn(1, Qt.AscendingOrder) self.filterColumnComboBox.setCurrentIndex(1) self.filterPatternLineEdit.setText("Andy|Grace") self.filterCaseSensitivityCheckBox.setChecked(True) self.sortCaseSensitivityCheckBox.setChecked(True) def setSourceModel(self, model): self.proxyModel.setSourceModel(model) self.sourceView.setModel(model) def filterRegExpChanged(self): syntax_nr = self.filterSyntaxComboBox.currentData() pattern = self.filterPatternLineEdit.text() if syntax_nr == WILDCARD: pattern = QRegularExpression.wildcardToRegularExpression(pattern) elif syntax_nr == FIXED_STRING: pattern = QRegularExpression.escape(pattern) regExp = QRegularExpression(pattern) if not self.filterCaseSensitivityCheckBox.isChecked(): options = regExp.patternOptions() options |= QRegularExpression.CaseInsensitiveOption regExp.setPatternOptions(options) self.proxyModel.setFilterRegularExpression(regExp) def filterColumnChanged(self): self.proxyModel.setFilterKeyColumn(self.filterColumnComboBox.currentIndex()) def sortChanged(self): if self.sortCaseSensitivityCheckBox.isChecked(): caseSensitivity = Qt.CaseSensitive else: caseSensitivity = Qt.CaseInsensitive self.proxyModel.setSortCaseSensitivity(caseSensitivity)
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))
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))
def __init__(self, parent=None): super(LocationDialog, self).__init__(parent) self.format_combo = QComboBox() self.format_combo.addItem("Native") self.format_combo.addItem("INI") self.scope_cCombo = QComboBox() self.scope_cCombo.addItem("User") self.scope_cCombo.addItem("System") self.organization_combo = QComboBox() self.organization_combo.addItem("Trolltech") self.organization_combo.setEditable(True) self.application_combo = QComboBox() self.application_combo.addItem("Any") self.application_combo.addItem("Application Example") self.application_combo.addItem("Assistant") self.application_combo.addItem("Designer") self.application_combo.addItem("Linguist") self.application_combo.setEditable(True) self.application_combo.setCurrentIndex(3) format_label = QLabel("&Format:") format_label.setBuddy(self.format_combo) scope_label = QLabel("&Scope:") scope_label.setBuddy(self.scope_cCombo) organization_label = QLabel("&Organization:") organization_label.setBuddy(self.organization_combo) application_label = QLabel("&Application:") application_label.setBuddy(self.application_combo) self.locations_groupbox = QGroupBox("Setting Locations") self.locations_table = QTableWidget() self.locations_table.setSelectionMode(QAbstractItemView.SingleSelection) self.locations_table.setSelectionBehavior(QAbstractItemView.SelectRows) self.locations_table.setEditTriggers(QAbstractItemView.NoEditTriggers) self.locations_table.setColumnCount(2) self.locations_table.setHorizontalHeaderLabels(("Location", "Access")) self.locations_table.horizontalHeader().setSectionResizeMode(0, QHeaderView.Stretch) self.locations_table.horizontalHeader().resizeSection(1, 180) self.button_box = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel) self.format_combo.activated.connect(self.update_locations) self.scope_cCombo.activated.connect(self.update_locations) self.organization_combo.lineEdit().editingFinished.connect(self.update_locations) self.application_combo.lineEdit().editingFinished.connect(self.update_locations) self.button_box.accepted.connect(self.accept) self.button_box.rejected.connect(self.reject) locations_layout = QVBoxLayout(self.locations_groupbox) locations_layout.addWidget(self.locations_table) mainLayout = QGridLayout(self) mainLayout.addWidget(format_label, 0, 0) mainLayout.addWidget(self.format_combo, 0, 1) mainLayout.addWidget(scope_label, 1, 0) mainLayout.addWidget(self.scope_cCombo, 1, 1) mainLayout.addWidget(organization_label, 2, 0) mainLayout.addWidget(self.organization_combo, 2, 1) mainLayout.addWidget(application_label, 3, 0) mainLayout.addWidget(self.application_combo, 3, 1) mainLayout.addWidget(self.locations_groupbox, 4, 0, 1, 2) mainLayout.addWidget(self.button_box, 5, 0, 1, 2) self.update_locations() self.setWindowTitle("Open Application Settings") self.resize(650, 400)
def __init__(self): super(Window, self).__init__() self.renderArea = RenderArea() self.shapeComboBox = QComboBox() self.shapeComboBox.addItem("Polygon", RenderArea.Polygon) self.shapeComboBox.addItem("Rectangle", RenderArea.Rect) self.shapeComboBox.addItem("Rounded Rectangle", RenderArea.RoundedRect) self.shapeComboBox.addItem("Ellipse", RenderArea.Ellipse) self.shapeComboBox.addItem("Pie", RenderArea.Pie) self.shapeComboBox.addItem("Chord", RenderArea.Chord) self.shapeComboBox.addItem("Path", RenderArea.Path) self.shapeComboBox.addItem("Line", RenderArea.Line) self.shapeComboBox.addItem("Polyline", RenderArea.Polyline) self.shapeComboBox.addItem("Arc", RenderArea.Arc) self.shapeComboBox.addItem("Points", RenderArea.Points) self.shapeComboBox.addItem("Text", RenderArea.Text) self.shapeComboBox.addItem("Pixmap", RenderArea.Pixmap) shapeLabel = QLabel("&Shape:") shapeLabel.setBuddy(self.shapeComboBox) self.penWidthSpinBox = QSpinBox() self.penWidthSpinBox.setRange(0, 20) self.penWidthSpinBox.setSpecialValueText("0 (cosmetic pen)") penWidthLabel = QLabel("Pen &Width:") penWidthLabel.setBuddy(self.penWidthSpinBox) self.penStyleComboBox = QComboBox() self.penStyleComboBox.addItem("Solid", Qt.SolidLine) self.penStyleComboBox.addItem("Dash", Qt.DashLine) self.penStyleComboBox.addItem("Dot", Qt.DotLine) self.penStyleComboBox.addItem("Dash Dot", Qt.DashDotLine) self.penStyleComboBox.addItem("Dash Dot Dot", Qt.DashDotDotLine) self.penStyleComboBox.addItem("None", Qt.NoPen) penStyleLabel = QLabel("&Pen Style:") penStyleLabel.setBuddy(self.penStyleComboBox) self.penCapComboBox = QComboBox() self.penCapComboBox.addItem("Flat", Qt.FlatCap) self.penCapComboBox.addItem("Square", Qt.SquareCap) self.penCapComboBox.addItem("Round", Qt.RoundCap) penCapLabel = QLabel("Pen &Cap:") penCapLabel.setBuddy(self.penCapComboBox) self.penJoinComboBox = QComboBox() self.penJoinComboBox.addItem("Miter", Qt.MiterJoin) self.penJoinComboBox.addItem("Bevel", Qt.BevelJoin) self.penJoinComboBox.addItem("Round", Qt.RoundJoin) penJoinLabel = QLabel("Pen &Join:") penJoinLabel.setBuddy(self.penJoinComboBox) self.brushStyleComboBox = QComboBox() self.brushStyleComboBox.addItem("Linear Gradient", Qt.LinearGradientPattern) self.brushStyleComboBox.addItem("Radial Gradient", Qt.RadialGradientPattern) self.brushStyleComboBox.addItem("Conical Gradient", Qt.ConicalGradientPattern) self.brushStyleComboBox.addItem("Texture", Qt.TexturePattern) self.brushStyleComboBox.addItem("Solid", Qt.SolidPattern) self.brushStyleComboBox.addItem("Horizontal", Qt.HorPattern) self.brushStyleComboBox.addItem("Vertical", Qt.VerPattern) self.brushStyleComboBox.addItem("Cross", Qt.CrossPattern) self.brushStyleComboBox.addItem("Backward Diagonal", Qt.BDiagPattern) self.brushStyleComboBox.addItem("Forward Diagonal", Qt.FDiagPattern) self.brushStyleComboBox.addItem("Diagonal Cross", Qt.DiagCrossPattern) self.brushStyleComboBox.addItem("Dense 1", Qt.Dense1Pattern) self.brushStyleComboBox.addItem("Dense 2", Qt.Dense2Pattern) self.brushStyleComboBox.addItem("Dense 3", Qt.Dense3Pattern) self.brushStyleComboBox.addItem("Dense 4", Qt.Dense4Pattern) self.brushStyleComboBox.addItem("Dense 5", Qt.Dense5Pattern) self.brushStyleComboBox.addItem("Dense 6", Qt.Dense6Pattern) self.brushStyleComboBox.addItem("Dense 7", Qt.Dense7Pattern) self.brushStyleComboBox.addItem("None", Qt.NoBrush) brushStyleLabel = QLabel("&Brush Style:") brushStyleLabel.setBuddy(self.brushStyleComboBox) otherOptionsLabel = QLabel("Other Options:") self.antialiasingCheckBox = QCheckBox("&Antialiasing") self.transformationsCheckBox = QCheckBox("&Transformations") self.shapeComboBox.activated.connect(self.shapeChanged) self.penWidthSpinBox.valueChanged.connect(self.penChanged) self.penStyleComboBox.activated.connect(self.penChanged) self.penCapComboBox.activated.connect(self.penChanged) self.penJoinComboBox.activated.connect(self.penChanged) self.brushStyleComboBox.activated.connect(self.brushChanged) self.antialiasingCheckBox.toggled.connect( self.renderArea.setAntialiased) self.transformationsCheckBox.toggled.connect( self.renderArea.setTransformed) mainLayout = QGridLayout() mainLayout.setColumnStretch(0, 1) mainLayout.setColumnStretch(3, 1) mainLayout.addWidget(self.renderArea, 0, 0, 1, 4) mainLayout.setRowMinimumHeight(1, 6) mainLayout.addWidget(shapeLabel, 2, 1, Qt.AlignRight) mainLayout.addWidget(self.shapeComboBox, 2, 2) mainLayout.addWidget(penWidthLabel, 3, 1, Qt.AlignRight) mainLayout.addWidget(self.penWidthSpinBox, 3, 2) mainLayout.addWidget(penStyleLabel, 4, 1, Qt.AlignRight) mainLayout.addWidget(self.penStyleComboBox, 4, 2) mainLayout.addWidget(penCapLabel, 5, 1, Qt.AlignRight) mainLayout.addWidget(self.penCapComboBox, 5, 2) mainLayout.addWidget(penJoinLabel, 6, 1, Qt.AlignRight) mainLayout.addWidget(self.penJoinComboBox, 6, 2) mainLayout.addWidget(brushStyleLabel, 7, 1, Qt.AlignRight) mainLayout.addWidget(self.brushStyleComboBox, 7, 2) mainLayout.setRowMinimumHeight(8, 6) mainLayout.addWidget(otherOptionsLabel, 9, 1, Qt.AlignRight) mainLayout.addWidget(self.antialiasingCheckBox, 9, 2) mainLayout.addWidget(self.transformationsCheckBox, 10, 2) self.setLayout(mainLayout) self.shapeChanged() self.penChanged() self.brushChanged() self.antialiasingCheckBox.setChecked(True) self.setWindowTitle("Basic Drawing")
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))