本文整理汇总了C++中QSpinBox::show方法的典型用法代码示例。如果您正苦于以下问题:C++ QSpinBox::show方法的具体用法?C++ QSpinBox::show怎么用?C++ QSpinBox::show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSpinBox
的用法示例。
在下文中一共展示了QSpinBox::show方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
QApplication::setStyle(new CustomStyle);
QApplication app(argc, argv);
QSpinBox spinBox;
spinBox.show();
return app.exec();
}
示例2: updateField
//al seleccionar un modulo, se crean las etiquetas y los campos editables de los parametros de dicho modulo.
void ParameterDialog::updateField(QString module){
ui->label->setText("Parameters of "+module+":");
int index = ui->currentList->currentRow();
clearLists();
if(index < 0 )
return;
std::deque<parameter> parametros;
parametros = getParameters(index);
int j=0;
//Se revisa la lista de parametros del module seleccionado.
for(int i = 0; i < parametros.size(); i++){
//por cada parametro se crea una etiqueta y su campo editor de dato dependiendo de la tipo del parametro.
QLabel *labelTemp = new QLabel(ui->scrollAreaWidgetContents);
parameter &p = parametros[i];
labelTemp->setText(p.name);
if( p.type == "int"){
QSpinBox *lineEditTemp = new QSpinBox(ui->scrollAreaWidgetContents);
lineEditTemp->setMaximum((va->moduleSequence[index]->listParameters[i].value.toInt())+1000);
lineEditTemp->setValue(va->moduleSequence[index]->listParameters[i].value.toInt());
lineEditTemp->setObjectName(va->moduleSequence[index]->listParameters[i].name);
lineEditTemp->show();
lineEditTemp->setGeometry(QRect(160,30+j,113,20));
valueSB.push_back(lineEditTemp);
}
else if( p.type == "QString"){
QLineEdit *lineEditTemp = new QLineEdit(ui->scrollAreaWidgetContents);
lineEditTemp->setText(p.value);
lineEditTemp->setObjectName(p.name);
lineEditTemp->show();
lineEditTemp->setGeometry(QRect(160,30+j,113,20));
valueL.push_back(lineEditTemp);
}
else if( p.type == "double"){
QDoubleSpinBox * lineEditTemp = new QDoubleSpinBox(ui->scrollAreaWidgetContents);
lineEditTemp->setMaximum(p.value.toInt()+1000);
lineEditTemp->setValue(p.value.toDouble());
lineEditTemp->setObjectName(p.name);
lineEditTemp->show();
lineEditTemp->setGeometry(QRect(160,30+j,113,20));
valueDSB.push_back(lineEditTemp);
}
else {
QLineEdit *lineEditTemp = new QLineEdit(ui->scrollAreaWidgetContents);
lineEditTemp->setText(p.value);
lineEditTemp->setObjectName(p.name);
lineEditTemp->show();
lineEditTemp->setGeometry(QRect(160,30+j,113,20));
valueL.push_back(lineEditTemp);
}
labelTemp->show();
labelTemp->setGeometry(QRect(10,30+j,(labelTemp->text().size())*7,13));
nameParam.push_back(labelTemp);
j+=30;
}
ui->scrollAreaWidgetContents->setGeometry(ui->scrollAreaWidgetContents->x(), ui->scrollAreaWidgetContents->y(), ui->scrollAreaWidgetContents->width(), j+40);
}
示例3: updateCoordSysWidget
void ReflectanceModelDockWidget::updateCoordSysWidget(int index)
{
QString name = ui_->reflectanceModelComboBox->itemText(index);
lb::ReflectanceModel* model = reflectanceModels_[name.toLocal8Bit().data()];
QLabel* halfLabel = ui_->halfDiffCsNumAngle1Label;
QLabel* specLabel = ui_->specularCsNumAngle1Label;
QLabel* spheLabel = ui_->sphericalCsNumAngle1Label;
QSpinBox* halfSpinBox = ui_->halfDiffCsNumAngle1SpinBox;
QSpinBox* specSpinBox = ui_->specularCsNumAngle1SpinBox;
QSpinBox* spheSpinBox = ui_->sphericalCsNumAngle1SpinBox;
// Hide labels and fields for an anisotropic BRDF if an isotropic reflectance model is selected.
if (model->isIsotropic()) {
halfLabel->hide();
halfSpinBox->hide();
ui_->halfDiffCoordSysFormLayout->removeWidget(halfLabel);
ui_->halfDiffCoordSysFormLayout->removeWidget(halfSpinBox);
specLabel->hide();
specSpinBox->hide();
ui_->specularCoordSysFormLayout->removeWidget(specLabel);
ui_->specularCoordSysFormLayout->removeWidget(specSpinBox);
spheLabel->hide();
spheSpinBox->hide();
ui_->sphericalCoordSysFormLayout->removeWidget(spheLabel);
ui_->sphericalCoordSysFormLayout->removeWidget(spheSpinBox);
}
else {
ui_->halfDiffCoordSysFormLayout->insertRow(2, halfLabel, halfSpinBox);
halfLabel->show();
halfSpinBox->show();
ui_->specularCoordSysFormLayout->insertRow(2, specLabel, specSpinBox);
specLabel->show();
specSpinBox->show();
ui_->sphericalCoordSysFormLayout->insertRow(2, spheLabel, spheSpinBox);
spheLabel->show();
spheSpinBox->show();
}
}
示例4: setReminder
void OtherReminderDialog::setReminder(bool allDay, int minutes)
{
if (allDay) {
minutesSB->hide();
minutesL->hide();
hoursSB->hide();
hoursL->hide();
} else {
minutesSB->show();
minutesL->show();
hoursSB->show();
minutesL->show();
}
int weeks = minutes / (7 * 24 * 60);
int days = (minutes - (weeks * 7 * 24 * 60)) / (24 * 60);
int hours = (minutes - (((weeks * 7) + days) * 24 * 60)) / 60;
minutesSB->setValue(minutes % 60);
hoursSB->setValue(hours);
daysSB->setValue(days);
weeksSB->setValue(weeks);
}
示例5: main
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QSpinBox *spinBox = new QSpinBox;
spinBox->setRange(1,100); //set range of spinBox's values
spinBox->setSuffix(" MB"); // set suffix after our values
spinBox->setButtonSymbols(QSpinBox::PlusMinus);
spinBox->setWrapping(true); // loop mode activating
spinBox->setFixedHeight(100);
spinBox->setFixedWidth(100);
spinBox->move(430,340);
spinBox->show();
return a.exec();
}