class Footer(QWidget): def __init__(self): QWidget.__init__(self) self.__InitUi() def __InitUi(self): self.setFixedHeight(160) SetWidgetBackgroundColor(COLOR_WIDGET_2, self) self.__Layout = QGridLayout() self.setLayout(self.__Layout) self.__Layout.setContentsMargins(30,30,30,30) self.__Layout.setHorizontalSpacing(30) self.__Layout.setVerticalSpacing(30) self.__lblProcess = LabelSmalSize("", COLOR_FONT_4, True) self.__Layout.addWidget(self.__lblProcess) self.__pgbProgress = Progressbar() self.__Layout.addWidget(self.__pgbProgress) def ProcessStartet(self, strProcess): self.__lblProcess.setText(strProcess) self.__pgbProgress.setMaximum(0) def ProcessEnded(self): self.__lblProcess.setText("") self.__pgbProgress.setMaximum(100)
def makeControlWidgets(self, parent): """Creates control widgets for the colormap's internal parameters. "parent" is a parent widget. Returns None if no controls are required""" top = QWidget(parent) layout = QGridLayout(top) layout.setContentsMargins(0, 0, 0, 0) for irow, icol, control in ((0, 0, self.gamma), (0, 1, self.color), (1, 0, self.cycles), (1, 1, self.hue)): control.makeControlWidgets(top, layout, irow, icol) QObject.connect(control, SIGNAL("valueChanged"), self.emitChange) QObject.connect(control, SIGNAL("valueMoved"), self.emitPreview) return top
def makeControlWidgets(self, parent): """Creates control widgets for the colormap's internal parameters. "parent" is a parent widget. Returns None if no controls are required""" top = QWidget(parent) layout = QGridLayout(top) layout.setContentsMargins(0, 0, 0, 0) for irow, icol, control in ((0, 0, self.gamma), (0, 1, self.color), (1, 0, self.cycles), (1, 1, self.hue)): control.makeControlWidgets(top, layout, irow, icol) QObject.connect(control, SIGNAL("valueChanged"), self.emitChange) QObject.connect(control, SIGNAL("valueMoved"), self.emitPreview) return top
def __init__(self, parent, modal=True, flags=Qt.WindowFlags()): QDialog.__init__(self, parent, flags) self.setModal(modal) self.setWindowTitle("Add FITS brick") lo = QVBoxLayout(self) lo.setMargin(10) lo.setSpacing(5) # file selector self.wfile = FileSelector(self, label="FITS filename:", dialog_label="FITS file", default_suffix="fits", file_types="FITS files (*.fits *.FITS)", file_mode=QFileDialog.ExistingFile) lo.addWidget(self.wfile) # overwrite or add mode lo1 = QGridLayout() lo.addLayout(lo1) lo1.setContentsMargins(0, 0, 0, 0) lo1.addWidget(QLabel("Padding factor:", self), 0, 0) self.wpad = QLineEdit("2", self) self.wpad.setValidator(QDoubleValidator(self)) lo1.addWidget(self.wpad, 0, 1) lo1.addWidget(QLabel("Assign source name:", self), 1, 0) self.wname = QLineEdit(self) lo1.addWidget(self.wname, 1, 1) # OK/cancel buttons lo.addSpacing(10) lo2 = QHBoxLayout() lo.addLayout(lo2) lo2.setContentsMargins(0, 0, 0, 0) lo2.setMargin(5) self.wokbtn = QPushButton("OK", self) self.wokbtn.setMinimumWidth(128) QObject.connect(self.wokbtn, SIGNAL("clicked()"), self.accept) self.wokbtn.setEnabled(False) cancelbtn = QPushButton("Cancel", self) cancelbtn.setMinimumWidth(128) QObject.connect(cancelbtn, SIGNAL("clicked()"), self.reject) lo2.addWidget(self.wokbtn) lo2.addStretch(1) lo2.addWidget(cancelbtn) self.setMinimumWidth(384) # signals QObject.connect(self.wfile, SIGNAL("filenameSelected"), self._fileSelected) # internal state self.qerrmsg = QErrorMessage(self)