def __init__(self, parent): PAbstractBox.__init__(self, parent) self._form = Ui_AddCmdDialog() self._form.setupUi(self) self._animation = 2 self._duration = 500 self._shown = False
def __init__(self, parent): PAbstractBox.__init__(self, parent) self.verticalLayout = QtGui.QVBoxLayout(self) self.verticalLayout.setSpacing(20) self.verticalLayout.setObjectName("verticalLayout") spacerItem = QtGui.QSpacerItem(20, 139, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.verticalLayout.addItem(spacerItem) self.horizontalLayout_2 = QtGui.QHBoxLayout() self.horizontalLayout_2.setSpacing(10) self.horizontalLayout_2.setObjectName("horizontalLayout_2") spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.horizontalLayout_2.addItem(spacerItem1) self.icon = QtGui.QLabel(self) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(32) sizePolicy.setVerticalStretch(32) sizePolicy.setHeightForWidth( self.icon.sizePolicy().hasHeightForWidth()) self.icon.setSizePolicy(sizePolicy) self.icon.setMinimumSize(QtCore.QSize(32, 32)) self.icon.setMaximumSize(QtCore.QSize(32, 32)) self.icon.setText("") self.icon.setPixmap(QtGui.QPixmap(ICON_SUCCESS)) self.icon.setAlignment(QtCore.Qt.AlignCenter) self.icon.setObjectName("icon") self.horizontalLayout_2.addWidget(self.icon) self.busy = QProgressIndicator(self, "white") self.busy.setFixedSize(30, 30) self.horizontalLayout_2.addWidget(self.busy) self.label = QtGui.QLabel(self) self.label.setText(" ") self.label.setMinimumHeight(30) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.label.sizePolicy().hasHeightForWidth()) self.label.setSizePolicy(sizePolicy) self.label.setAlignment(QtCore.Qt.AlignCenter) # Word wrap self.label.setWordWrap(False) self.label.setIndent(0) self.label.setObjectName("label") self.horizontalLayout_2.addWidget(self.label) spacerItem2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.horizontalLayout_2.addItem(spacerItem2) self.verticalLayout.addLayout(self.horizontalLayout_2) self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem3) self.okButton = QtGui.QPushButton(self) self.okButton.setStyleSheet("color: #222222") self.okButton.setObjectName("okButton") self.okButton.setText(i18n("OK")) self.okButton.hide() self.horizontalLayout.addWidget(self.okButton) spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem4) self.verticalLayout.addLayout(self.horizontalLayout) spacerItem5 = QtGui.QSpacerItem(20, 138, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.verticalLayout.addItem(spacerItem5) self._animation = 2 self._duration = 500 self.okButton.clicked.connect(self.hideBox)
def __init__(self, parent): PAbstractBox.__init__(self, parent) self.verticalLayout = QtGui.QVBoxLayout(self) self.verticalLayout.setSpacing(20) self.verticalLayout.setObjectName("verticalLayout") spacerItem = QtGui.QSpacerItem(20, 139, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.verticalLayout.addItem(spacerItem) self.horizontalLayout_2 = QtGui.QHBoxLayout() self.horizontalLayout_2.setSpacing(10) self.horizontalLayout_2.setObjectName("horizontalLayout_2") spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.horizontalLayout_2.addItem(spacerItem1) self.icon = QtGui.QLabel(self) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(32) sizePolicy.setVerticalStretch(32) sizePolicy.setHeightForWidth(self.icon.sizePolicy().hasHeightForWidth()) self.icon.setSizePolicy(sizePolicy) self.icon.setMinimumSize(QtCore.QSize(32, 32)) self.icon.setMaximumSize(QtCore.QSize(32, 32)) self.icon.setText("") self.icon.setPixmap(QtGui.QPixmap(ICON_SUCCESS)) self.icon.setAlignment(QtCore.Qt.AlignCenter) self.icon.setObjectName("icon") self.horizontalLayout_2.addWidget(self.icon) self.busy = QProgressIndicator(self, "white") self.busy.setFixedSize(30, 30) self.horizontalLayout_2.addWidget(self.busy) self.label = QtGui.QLabel(self) self.label.setText(" ") self.label.setMinimumHeight(30) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth()) self.label.setSizePolicy(sizePolicy) self.label.setAlignment(QtCore.Qt.AlignCenter) # Word wrap self.label.setWordWrap(False) self.label.setIndent(0) self.label.setObjectName("label") self.horizontalLayout_2.addWidget(self.label) spacerItem2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.horizontalLayout_2.addItem(spacerItem2) self.verticalLayout.addLayout(self.horizontalLayout_2) self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem3) self.okButton = QtGui.QPushButton(self) self.okButton.setStyleSheet("color: #222222") self.okButton.setObjectName("okButton") self.okButton.setText(i18n("OK")) self.okButton.hide() self.horizontalLayout.addWidget(self.okButton) spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem4) self.verticalLayout.addLayout(self.horizontalLayout) spacerItem5 = QtGui.QSpacerItem(20, 138, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.verticalLayout.addItem(spacerItem5) self._animation = 2 self._duration = 500 self.okButton.clicked.connect(self.hideBox)