def initUi(self): self.setWindowTitle(self.tr('Remove Attributes')) self.setModal(True) self.resize(366, 274) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Expanding) self.setSizePolicy(sizePolicy) self.gridLayout = QtGui.QGridLayout(self) self.dialogHeading = QtGui.QLabel( self.tr('Select the attribute column(s) which shall be removed'), self) self.listView = QtGui.QListView(self) model = QtGui.QStandardItemModel() for column in self.columns: item = QtGui.QStandardItem(column) model.appendRow(item) self.listView.setModel(model) self.listView.setSelectionMode(QtGui.QListView.MultiSelection) self.buttonBox = QtGui.QDialogButtonBox(self) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok) self.gridLayout.addWidget(self.dialogHeading, 0, 0, 1, 1) self.gridLayout.addWidget(self.listView, 1, 0, 1, 1) self.gridLayout.addWidget(self.buttonBox, 2, 0, 1, 1) self.buttonBox.accepted.connect(self.accept) self.buttonBox.rejected.connect(self.reject)
def initUi(self): self.setModal(True) self.resize(303, 168) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed) self.setSizePolicy(sizePolicy) self.verticalLayout = QtGui.QVBoxLayout(self) self.dialogHeading = QtGui.QLabel( self.tr('Add a new attribute column'), self) self.gridLayout = QtGui.QGridLayout() self.columnNameLineEdit = QtGui.QLineEdit(self) self.columnNameLabel = QtGui.QLabel(self.tr('Name'), self) self.dataTypeComboBox = QtGui.QComboBox(self) self.dataTypeComboBox.addItems(SupportedDtypes.names()) self.columnTypeLabel = QtGui.QLabel(self.tr('Type'), self) self.defaultValueLineEdit = QtGui.QLineEdit(self) self.lineEditValidator = DefaultValueValidator(self) self.defaultValueLineEdit.setValidator(self.lineEditValidator) self.defaultValueLabel = QtGui.QLabel(self.tr('Inital Value(s)'), self) self.gridLayout.addWidget(self.columnNameLabel, 0, 0, 1, 1) self.gridLayout.addWidget(self.columnNameLineEdit, 0, 1, 1, 1) self.gridLayout.addWidget(self.columnTypeLabel, 1, 0, 1, 1) self.gridLayout.addWidget(self.dataTypeComboBox, 1, 1, 1, 1) self.gridLayout.addWidget(self.defaultValueLabel, 2, 0, 1, 1) self.gridLayout.addWidget(self.defaultValueLineEdit, 2, 1, 1, 1) self.buttonBox = QtGui.QDialogButtonBox(self) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok) self.verticalLayout.addWidget(self.dialogHeading) self.verticalLayout.addLayout(self.gridLayout) self.verticalLayout.addWidget(self.buttonBox) self.buttonBox.accepted.connect(self.accept) self.buttonBox.rejected.connect(self.reject) self.dataTypeComboBox.currentIndexChanged.connect( self.updateValidatorDtype) self.updateValidatorDtype(self.dataTypeComboBox.currentIndex())
def initUi(self): self.sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Expanding) self._pbHeight = 30 self.setMinimumWidth(self._width) #self.setMaximumWidth(self._width) self.setMinimumHeight(self._minHeight) self.glayout = QtGui.QGridLayout(self) self.totalProgressBar = QtGui.QProgressBar(self) self.totalProgressBar.setMinimumHeight(self._pbHeight) self.totalProgressBar.setMaximumHeight(self._pbHeight) self.toggleButton = QtGui.QPushButton('Details', self) self.toggleButton.setCheckable(True) self.toggleButton.toggled.connect(self.showDetails) self.glayout.addWidget(self.totalProgressBar, 0, 0, 1, 1) self.glayout.addWidget(self.toggleButton, 0, 1, 1, 1) #styleSheet = """.QProgressBar { #border: none; #border-radius: 3px; #text-align: center; #background-color: rgba(37, 37, 37, 50%); #color: white; #margin: 1px; #border-bottom-left-radius:5px; #border-top-left-radius:5px; #} #.QProgressBar::chunk { #background-color: #05B8CC; #border-radius: 3px; #} #.OverlayProgressWidget { #background-color: white; #} #""" ## set stylesheet for all progressbars in this widget #self.setStyleSheet(styleSheet) parent = self.parent() xAnchor = parent.width() - self._width - self._margin yAnchor = self._margin self.setGeometry(xAnchor, yAnchor, self._width, self._minHeight)