def _create_inlite(self, settings): radio = QRadioButton( 'Either my objects are labelled with a barcode not listed above ' 'or I would like the performance and reliability of a commercial ' 'library') radio.setChecked('inlite' == settings['engine']) radio.setEnabled(inlite_available()) self._layout.addWidget(radio) prompt = QLabel( 'Only available on Windows. ' 'Visit <a href="http://www.inliteresearch.com/">Inlite Research</a> ' 'to download and install Inlite Research\'s ClearImage library.' ) prompt.setWordWrap(True) prompt.setOpenExternalLinks(True) prompt.setStyleSheet(self.STYLESHEET) self._layout.addWidget(prompt) prompt = QLabel('My objects are labelled with:') format = settings['inlite-format'] radio_1d = QRadioButton('1D barcodes') radio_1d.setChecked('1d' == format) radio_datamatrix = QRadioButton('Data Matrix barcodes') radio_datamatrix.setChecked('datamatrix' == format) radio_pdf417 = QRadioButton('PDF 417 barcodes') radio_pdf417.setChecked('pdf417' == format) radio_qr = QRadioButton('QR codes') radio_qr.setChecked('qrcode' == format) layout = QVBoxLayout() layout.addWidget(prompt) layout.addWidget(radio_1d) layout.addWidget(radio_datamatrix) layout.addWidget(radio_pdf417) layout.addWidget(radio_qr) group = QWidget() group.setLayout(layout) group.setStyleSheet(self.STYLESHEET) radio.toggled.connect(group.setEnabled) group.setEnabled(inlite_available() and 'inlite' == settings['engine']) self._layout.addWidget(group) return radio, radio_1d, radio_datamatrix, radio_pdf417, radio_qr
def __init__(self, *args, **kwargs): super(Widget_ConnectionType, self).__init__(*args, **kwargs) self.installEventFilter(self) mainLayout = QVBoxLayout(self) mainLayout.setSpacing(0) self.setStyleSheet("font-size:12px;") w_comboBox = QWidget() lay_comboBox = QHBoxLayout(w_comboBox) lay_comboBox.setContentsMargins(5, 5, 5, 5) lay_comboBox.setSpacing(0) label = QLabel("Connection Type : ") comboBox = QComboBox() comboBox.setStyleSheet("padding:2px; padding-left:5px") comboBox.addItem("Long Type") comboBox.addItem("Enum Type") lay_comboBox.addWidget(label) lay_comboBox.addWidget(comboBox) w_enumAttrName = QWidget() lay_enumAttrName = QHBoxLayout(w_enumAttrName) lay_enumAttrName.setContentsMargins(5, 5, 5, 5) lay_enumAttrName.setSpacing(0) label_enumName = QLabel("Enum Attribute Name : ") lineEdit = QLineEdit() lineEdit.setStyleSheet("padding:2px") lay_enumAttrName.addWidget(label_enumName) lay_enumAttrName.addWidget(lineEdit) w_enumAttrName.setEnabled(False) mainLayout.addWidget(w_comboBox) mainLayout.addWidget(w_enumAttrName) self.comboBox = comboBox self.w_enumAttrName = w_enumAttrName self.lineEdit = lineEdit self.comboBox.currentIndexChanged.connect(self.cmd_attrTypeCondition) self.readData() lineEdit.textEdited.connect(self.writeData) comboBox.currentIndexChanged.connect(self.writeData) self.readData()