本文整理汇总了C++中QSpinBox::setObjectName方法的典型用法代码示例。如果您正苦于以下问题:C++ QSpinBox::setObjectName方法的具体用法?C++ QSpinBox::setObjectName怎么用?C++ QSpinBox::setObjectName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSpinBox
的用法示例。
在下文中一共展示了QSpinBox::setObjectName方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QSpinBox
QList<QWidget *> Object::getControls()
{
QSpinBox *bonus = new QSpinBox();
bonus->setObjectName("bonus");
bonus->setMaximum(1000);
bonus->setValue(_bonus);
connect(bonus,SIGNAL(valueChanged(int)),this,SLOT(setAttribute()));
Control *c_bonus = new Control("Bonificación de armadura", bonus);
QSpinBox *time = new QSpinBox();
time->setSuffix(" seg");
time->setObjectName("time");
time->setMinimum(1);
time->setMaximum(1000);
time->setValue(_time);
connect(time,SIGNAL(valueChanged(int)),this,SLOT(setAttribute()));
Control *c_time = new Control("Tiempo de efecto", time);
QSpinBox *cooldown = new QSpinBox();
cooldown->setSuffix(" seg");
cooldown->setObjectName("cooldown");
cooldown->setMinimum(1);
cooldown->setMaximum(1000);
cooldown->setValue(_cooldown);
connect(cooldown,SIGNAL(valueChanged(int)),this,SLOT(setAttribute()));
Control *c_cooldown = new Control("Tiempo de reaparición", cooldown);
QList<QWidget*> controls = IObject::getControls();
controls.append(c_bonus);
controls.append(c_time);
controls.append(c_cooldown);
return controls;
}
示例2: getSettingsWidget
QWidget* DashLabel::getSettingsWidget(int setting){
QToolButton* btn;
QLineEdit *line;
QSpinBox *spin;
switch(setting){
case 0:
line = new QLineEdit;
line->setObjectName("Nome");
line->setText(item->text(0));
line->setMaxLength(14);
connect(line, SIGNAL(textChanged(QString)), this, SLOT(setName(QString)));
return line;
case 2:
spin = new QSpinBox;
spin->setObjectName("X");
spin->setMinimum(0);
spin->setMaximum(1920);
spin->setValue(x);
connect(spin, SIGNAL(valueChanged(int)), this, SLOT(setX(int)));
return spin;
case 3:
spin = new QSpinBox;
spin->setObjectName("Y");
spin->setMinimum(0);
spin->setMaximum(1920);
spin->setValue(y);
connect(spin, SIGNAL(valueChanged(int)), this, SLOT(setY(int)));
return spin;
case 4:
line = new QLineEdit;
line->setObjectName("Testo");
line->setText(text);
connect(line, SIGNAL(textChanged(QString)), this, SLOT(setText(QString)));
return line;
case 5:
btn = new QToolButton;
btn->setObjectName("Font");
btn->setText("...");
connect(btn, SIGNAL(clicked()), this, SLOT(setFont()));
return btn;
default:
return DashWidget::getSettingsWidget(setting);
}
}
示例3: 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);
}
示例4: getSettingsWidget
QWidget* DashBar::getSettingsWidget(int setting){
QComboBox *combo;
QSpinBox *spin;
switch (setting) {
case 6:
combo = new QComboBox;
combo->setObjectName("Orientamento");
combo->addItem("Verticale");
combo->addItem("Orizzontale");
combo->setCurrentIndex(orientation == Qt::Vertical? 0 : 1);
connect(combo, SIGNAL(activated(int)), this, SLOT(setOrientation(int)));
return combo;
case 7:
spin = new QSpinBox;
spin->setObjectName("Min");
spin->setMinimum(INT_MIN);
spin->setMaximum(INT_MAX);
spin->setValue(value1);
connect(spin, SIGNAL(valueChanged(int)), this, SLOT(setValue1(int)));
return spin;
case 8:
spin = new QSpinBox;
spin->setObjectName("Max");
spin->setMinimum(INT_MIN);
spin->setMaximum(INT_MAX);
spin->setValue(value2);
connect(spin, SIGNAL(valueChanged(int)), this, SLOT(setValue2(int)));
return spin;
/*
case 9:
spin = new QSpinBox;
spin->setObjectName("Value");
spin->setMinimum(INT_MIN);
spin->setMaximum(INT_MAX);
spin->setValue(value);
connect(spin, SIGNAL(valueChanged(int)), this, SLOT(setValue(int)));
return spin;
*/
default:
return DashWidget::getSettingsWidget(setting);
}
}
示例5: createWidgetForInt
QWidget* PropertyEditor::createWidgetForInt(const QString& name, int value, const QString& detail, QWidget* parent)
{
mProperties[name] = value;
QSpinBox *box = new QSpinBox(parent);
if (!detail.isEmpty())
box->setToolTip(detail);
box->setObjectName(name);
box->setValue(value);
connect(box, SIGNAL(valueChanged(int)), SLOT(onIntChange(int)));
return box;
}
示例6: createLayout
void DkFilePreference::createLayout() {
// temp folder
DkDirectoryChooser* dirChooser = new DkDirectoryChooser(Settings::param().global().tmpPath, this);
dirChooser->setObjectName("dirChooser");
QLabel* tLabel = new QLabel(tr("Screenshots are automatically saved to this folder"), this);
DkGroupWidget* tempFolderGroup = new DkGroupWidget(tr("Use Temporary Folder"), this);
tempFolderGroup->addWidget(dirChooser);
tempFolderGroup->addWidget(tLabel);
// cache size
int maxCache = qMax(qRound(DkMemory::getTotalMemory()*0.1), 512);
qDebug() << "max cache" << maxCache;
QSpinBox* cacheBox = new QSpinBox(this);
cacheBox->setObjectName("cacheBox");
cacheBox->setMinimum(0);
cacheBox->setMaximum(maxCache);
cacheBox->setSuffix(" MB");
cacheBox->setMaximumWidth(200);
cacheBox->setValue(qRound(Settings::param().resources().cacheMemory));
QLabel* cLabel = new QLabel(tr("We recommend to set a moderate cache value arround 100 MB"), this);
DkGroupWidget* cacheGroup = new DkGroupWidget(tr("Maximal Cache Size"), this);
cacheGroup->addWidget(cacheBox);
cacheGroup->addWidget(cLabel);
// history size
// cache size
QSpinBox* historyBox = new QSpinBox(this);
historyBox->setObjectName("historyBox");
historyBox->setMinimum(0);
historyBox->setMaximum(1024);
historyBox->setSuffix(" MB");
historyBox->setMaximumWidth(200);
historyBox->setValue(qRound(Settings::param().resources().historyMemory));
QLabel* hLabel = new QLabel(tr("We recommend to set a moderate edit history value arround 100 MB"), this);
DkGroupWidget* historyGroup = new DkGroupWidget(tr("History Size"), this);
historyGroup->addWidget(historyBox);
historyGroup->addWidget(hLabel);
// loading policy
QVector<QRadioButton*> loadButtons;
loadButtons.append(new QRadioButton(tr("Skip Images"), this));
loadButtons[0]->setToolTip(tr("Images are skipped until the Next key is released"));
loadButtons.append(new QRadioButton(tr("Wait for Images to be Loaded"), this));
loadButtons[1]->setToolTip(tr("The next image is loaded after the current image is shown."));
// check wrt the current settings
loadButtons[0]->setChecked(!Settings::param().resources().waitForLastImg);
loadButtons[1]->setChecked(Settings::param().resources().waitForLastImg);
QButtonGroup* loadButtonGroup = new QButtonGroup(this);
loadButtonGroup->setObjectName("loadGroup");
loadButtonGroup->addButton(loadButtons[0], 0);
loadButtonGroup->addButton(loadButtons[1], 1);
DkGroupWidget* loadGroup = new DkGroupWidget(tr("Image Loading Policy"), this);
loadGroup->addWidget(loadButtons[0]);
loadGroup->addWidget(loadButtons[1]);
// skip images
QSpinBox* skipBox = new QSpinBox(this);
skipBox->setObjectName("skipBox");
skipBox->setMinimum(2);
skipBox->setMaximum(1000);
skipBox->setValue(Settings::param().global().skipImgs);
skipBox->setMaximumWidth(200);
DkGroupWidget* skipGroup = new DkGroupWidget(tr("Number of Skipped Images on PgUp/PgDown"), this);
skipGroup->addWidget(skipBox);
// left column
QWidget* leftWidget = new QWidget(this);
QVBoxLayout* leftLayout = new QVBoxLayout(leftWidget);
leftLayout->addWidget(tempFolderGroup);
leftLayout->addWidget(cacheGroup);
leftLayout->addWidget(historyGroup);
leftLayout->addWidget(loadGroup);
leftLayout->addWidget(skipGroup);
QHBoxLayout* layout = new QHBoxLayout(this);
layout->setAlignment(Qt::AlignLeft);
layout->addWidget(leftWidget);
}
示例7: QLabel
QList<QPair<QLabel*, QWidget*> > QgsVectorLayerSaveAsDialog::createControls( const QMap<QString, QgsVectorFileWriter::Option*>& options )
{
QList<QPair<QLabel*, QWidget*> > controls;
QMap<QString, QgsVectorFileWriter::Option*>::ConstIterator it;
for ( it = options.constBegin(); it != options.constEnd(); ++it )
{
QgsVectorFileWriter::Option *option = it.value();
QLabel *label = new QLabel( it.key() );
QWidget *control = nullptr;
switch ( option->type )
{
case QgsVectorFileWriter::Int:
{
QgsVectorFileWriter::IntOption *opt = dynamic_cast<QgsVectorFileWriter::IntOption*>( option );
if ( opt )
{
QSpinBox *sb = new QSpinBox();
sb->setObjectName( it.key() );
sb->setValue( opt->defaultValue );
control = sb;
}
break;
}
case QgsVectorFileWriter::Set:
{
QgsVectorFileWriter::SetOption *opt = dynamic_cast<QgsVectorFileWriter::SetOption*>( option );
if ( opt )
{
QComboBox* cb = new QComboBox();
cb->setObjectName( it.key() );
Q_FOREACH ( const QString& val, opt->values )
{
cb->addItem( val, val );
}
if ( opt->allowNone )
cb->addItem( tr( "<Default>" ), QVariant( QVariant::String ) );
int idx = cb->findText( opt->defaultValue );
if ( idx == -1 )
idx = cb->findData( QVariant( QVariant::String ) );
cb->setCurrentIndex( idx );
control = cb;
}
break;
}
case QgsVectorFileWriter::String:
{
QgsVectorFileWriter::StringOption *opt = dynamic_cast<QgsVectorFileWriter::StringOption*>( option );
if ( opt )
{
QLineEdit* le = new QLineEdit( opt->defaultValue );
le->setObjectName( it.key() );
control = le;
}
break;
}
case QgsVectorFileWriter::Hidden:
control = nullptr;
break;
}
if ( control )
{
// Pack the tooltip in some html element, so it gets linebreaks.
label->setToolTip( QString( "<p>%1</p>" ).arg( option->docString ) );
control->setToolTip( QString( "<p>%1</p>" ).arg( option->docString ) );
controls << QPair<QLabel*, QWidget*>( label, control );
}
}
return controls;
}
示例8: on_addInputButton_clicked
void MultisigDialog::on_addInputButton_clicked()
{
if(isFirstRawTx){
isFirstRawTx = false;
ui->txInputsScrollArea->show();
}
QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
QFrame* txInputFrame = new QFrame(ui->txInputsWidget);
sizePolicy.setHeightForWidth(txInputFrame->sizePolicy().hasHeightForWidth());
txInputFrame->setFrameShape(QFrame::StyledPanel);
txInputFrame->setFrameShadow(QFrame::Raised);
txInputFrame->setObjectName(QStringLiteral("txInputFrame"));
QVBoxLayout* frameLayout = new QVBoxLayout(txInputFrame);
frameLayout->setSpacing(1);
frameLayout->setObjectName(QStringLiteral("txInputFrameLayout"));
frameLayout->setContentsMargins(6, 6, 6, 6);
QHBoxLayout* txInputLayout = new QHBoxLayout();
txInputLayout->setObjectName(QStringLiteral("txInputLayout"));
QLabel* txInputIdLabel = new QLabel(txInputFrame);
txInputIdLabel->setObjectName(QStringLiteral("txInputIdLabel"));
txInputIdLabel->setText(QApplication::translate("MultisigDialog", strprintf("%i. Tx Hash: ", ui->inputsList->count()+1).c_str(), 0));
txInputLayout->addWidget(txInputIdLabel);
QLineEdit* txInputId = new QLineEdit(txInputFrame);
txInputId->setObjectName(QStringLiteral("txInputId"));
txInputLayout->addWidget(txInputId);
QSpacerItem* horizontalSpacer = new QSpacerItem(10, 20, QSizePolicy::Fixed, QSizePolicy::Minimum);
txInputLayout->addItem(horizontalSpacer);
QLabel* txInputVoutLabel = new QLabel(txInputFrame);
txInputVoutLabel->setObjectName(QStringLiteral("txInputVoutLabel"));
txInputVoutLabel->setText(QApplication::translate("MultisigDialog", "Vout Position: ", 0));
txInputLayout->addWidget(txInputVoutLabel);
QSpinBox* txInputVout = new QSpinBox(txInputFrame);
txInputVout->setObjectName("txInputVout");
sizePolicy.setHeightForWidth(txInputVout->sizePolicy().hasHeightForWidth());
txInputVout->setSizePolicy(sizePolicy);
txInputLayout->addWidget(txInputVout);
QPushButton* inputDeleteButton = new QPushButton(txInputFrame);
inputDeleteButton->setObjectName(QStringLiteral("inputDeleteButton"));
QIcon icon;
icon.addFile(QStringLiteral(":/icons/remove"), QSize(), QIcon::Normal, QIcon::Off);
inputDeleteButton->setIcon(icon);
inputDeleteButton->setAutoDefault(false);
connect(inputDeleteButton, SIGNAL(clicked()), this, SLOT(deleteFrame()));
txInputLayout->addWidget(inputDeleteButton);
frameLayout->addLayout(txInputLayout);
ui->inputsList->addWidget(txInputFrame);
}
示例9: createWidget
QWidget* WidgetStyle::createWidget(const QString& name)
{
if(name == "CheckBox")
{
QCheckBox* box = new QCheckBox("CheckBox");
box->setObjectName("CheckBox");
return setLayoutWidget({ box }, { 100, 30 });
}
else if(name == "ComboBox")
{
QComboBox* box = new QComboBox;
box->addItem("Item1");
box->addItem("Item3");
box->addItem("Item3");
box->setObjectName("ComboBox");
return setLayoutWidget({ box }, { 70, 30 });
}
else if(name == "DateEdit")
{
QDateEdit* date = new QDateEdit;
date->setObjectName("DateEdit");
return setLayoutWidget({ date }, { 110, 40 });
}
else if(name == "DateTimeEdit")
{
QDateTimeEdit* date = new QDateTimeEdit;
date->setObjectName("DateTimeEdit");
return setLayoutWidget({ date }, { 160, 30 });
}
else if(name == "Dialog")
{
QDialog* dialog = new QDialog;
dialog->setObjectName("Dialog");
return setLayoutWidget({ dialog }, { 160, 110 });
}
else if(name == "DockWidget") //?
{
QDockWidget* widget = new QDockWidget;
widget->setObjectName("DockWidget");
widget->resize(61, 22);
return widget;
}
else if(name == "DoubleSpinBox")
{
QDoubleSpinBox* box = new QDoubleSpinBox;
box->setObjectName("DoubleSpinBox");
return setLayoutWidget({ box }, { 90, 40 });
}
else if(name == "Frame") //??
{
QFrame* frame = new QFrame;
frame->setObjectName("Frame");
frame->resize(150, 100);
return frame;
}
else if(name == "GroupBox")
{
QGroupBox* box = new QGroupBox("GroupBox");
box->setObjectName("GroupBox");
return setLayoutWidget({ box }, { 160, 110 });
}
else if(name == "Label")
{
QLabel* label = new QLabel("Label");
label->setObjectName("Label");
return setLayoutWidget({ label }, { 40, 20});
}
else if(name == "LineEdit")
{
QLineEdit* line = new QLineEdit;
line->setObjectName("LineEdit");
return setLayoutWidget({ line }, { 30, 30 });
}
else if(name == "ListView") //??
{
QListView* view = new QListView;
view->setObjectName("ListView");
view->resize(71, 71);
return view;
}
else if(name == "ListWidget")
{
QListWidget* list = new QListWidget;
list->setObjectName("ListWidget");
for(int i = 0; i < 20; i++)
list->addItem(QString("Item %1").arg(i));
return setLayoutWidget({ list }, { 80, 80 });
}
else if(name == "MainWindow")
{
QMainWindow* window = new QMainWindow;
window->setObjectName("MainWindow");
return setLayoutWidget({ window }, { 160, 110 });
}
else if(name == "Menu")
{
QMenu* parentMenu = new QMenu;
parentMenu->setObjectName("Menu");
parentMenu->addMenu("Menu1");
QMenu* menu1 = parentMenu->addMenu("Menu2");
//.........这里部分代码省略.........
示例10: CreateActiveMQConnectivityWidgets
void ConfigScreen::CreateActiveMQConnectivityWidgets()
{
QLineEdit* activemquri = new QLineEdit ( _activemqscreen );
activemquri->setObjectName ( "kcfg_ActiveMQURI" );
_lactivemqscreen->addRow ( "ActiveMQ URI:", activemquri );
_confman->addWidget ( activemquri );
QLineEdit* activemqusername = new QLineEdit ( _activemqscreen );
activemqusername->setObjectName ( "kcfg_ActiveMQUsername" );
_lactivemqscreen->addRow ( "ActiveMQ username:", activemqusername );
_confman->addWidget ( activemqusername );
QLineEdit* activemqpassword = new QLineEdit ( _activemqscreen );
activemqpassword->setObjectName ( "kcfg_ActiveMQPassword" );
_lactivemqscreen->addRow ( "ActiveMQ password:", activemqpassword );
_confman->addWidget ( activemqpassword );
QLineEdit* activemqtopicname = new QLineEdit ( _activemqscreen );
activemqtopicname->setObjectName ( "kcfg_ActiveMQTopicName" );
_lactivemqscreen->addRow ( "CSS Alarm Server topic name:", activemqtopicname );
_confman->addWidget ( activemqtopicname );
QSpinBox* laboratorynotificationtimeout = new QSpinBox ( _activemqscreen );
laboratorynotificationtimeout->setMinimum ( 0 );
laboratorynotificationtimeout->setMaximum ( 3600 );
laboratorynotificationtimeout->setSuffix ( QString::fromUtf8 ( " seconds" ) );
laboratorynotificationtimeout->setSpecialValueText ( QString::fromUtf8 ( "Notification disabled" ) );
laboratorynotificationtimeout->setObjectName ( "kcfg_LaboratoryNotificationTimeout" );
_lactivemqscreen->addRow ( "Laboratory notification timeout:", laboratorynotificationtimeout );
_confman->addWidget ( laboratorynotificationtimeout );
QSpinBox* desktopnotificationtimeout = new QSpinBox ( _activemqscreen );
desktopnotificationtimeout->setMinimum ( 0 );
desktopnotificationtimeout->setMaximum ( 3600 );
desktopnotificationtimeout->setSuffix ( QString::fromUtf8 ( " seconds" ) );
desktopnotificationtimeout->setSpecialValueText ( QString::fromUtf8 ( "Notification disabled" ) );
desktopnotificationtimeout->setObjectName ( "kcfg_DesktopNotificationTimeout" );
_lactivemqscreen->addRow ( "Desktop notification timeout:", desktopnotificationtimeout );
_confman->addWidget ( desktopnotificationtimeout );
QSpinBox* emailnotificationtimeout = new QSpinBox ( _activemqscreen );
emailnotificationtimeout->setMinimum ( 0 );
emailnotificationtimeout->setMaximum ( 3600 );
emailnotificationtimeout->setSuffix ( QString::fromUtf8 ( " seconds" ) );
emailnotificationtimeout->setSpecialValueText ( QString::fromUtf8 ( "Notification disabled" ) );
emailnotificationtimeout->setObjectName ( "kcfg_EMailNotificationTimeout" );
_lactivemqscreen->addRow ( "E-Mail notification timeout:", emailnotificationtimeout );
_confman->addWidget ( emailnotificationtimeout );
QLineEdit* emailnotificationfrom = new QLineEdit ( _activemqscreen );
emailnotificationfrom->setObjectName ( "kcfg_EMailNotificationFrom" );
_lactivemqscreen->addRow ( "E-Mail notification sender address:", emailnotificationfrom );
_confman->addWidget ( emailnotificationfrom );
QLineEdit* emailnotificationto = new QLineEdit ( _activemqscreen );
emailnotificationto->setObjectName ( "kcfg_EMailNotificationTo" );
_lactivemqscreen->addRow ( "E-Mail notification recipient address:", emailnotificationto );
_confman->addWidget ( emailnotificationto );
QLineEdit* emailnotificationservername = new QLineEdit ( _activemqscreen );
emailnotificationservername->setObjectName ( "kcfg_EMailNotificationServerName" );
_lactivemqscreen->addRow ( "SMTP server name:", emailnotificationservername );
_confman->addWidget ( emailnotificationservername );
QSpinBox* emailnotificationserverport = new QSpinBox ( _activemqscreen );
emailnotificationserverport->setMinimum ( 0 ); // Minimum port number in TCP standard
emailnotificationserverport->setMaximum ( 65535 ); // Maximum port number in TCP standard
emailnotificationserverport->setObjectName ( "kcfg_EMailNotificationServerPort" );
_lactivemqscreen->addRow ( "SMTP server port:", emailnotificationserverport );
_confman->addWidget ( emailnotificationserverport );
QLineEdit* flashlightrelaisdevicenode = new QLineEdit ( _activemqscreen );
flashlightrelaisdevicenode->setObjectName ( QString::fromUtf8 ( "kcfg_FlashLightRelaisDeviceNode" ) );
_lactivemqscreen->addRow ( QString::fromUtf8 ( "Device node of relais for red flash light:" ), flashlightrelaisdevicenode );
_confman->addWidget ( flashlightrelaisdevicenode );
}
示例11: setupDetTable
void preferencedialog::setupDetTable(){
ui->detTable->setRowCount(detectors.size());
calList.clear();
for(unsigned int i=0; i<detectors.size(); i++){
calList.push_back("");
calNum.push_back(0);
}
//Setup all items
for (unsigned int j=0; j<detectors.size(); j++){
for(int i=0; i<8; i++){
ui->detTable->setItem(j,i, new QTableWidgetItem(""));
}
}
for(unsigned int i=0; i<detectors.size(); i++){
ui->detTable->item(i,0)->setText(detectors.at(i).getType());
ui->detTable->item(i,1)->setText(detectors.at(i).getName());
ui->detTable->item(i,2)->setText(detectors.at(i).getDgfmodule());
ui->detTable->item(i,3)->setText(detectors.at(i).getCrate());
ui->detTable->item(i,4)->setText(detectors.at(i).getSlot());
ui->detTable->item(i,5)->setText(detectors.at(i).getAddress());
calList.replace(i, detectors.at(i).getCalFilePath());
for(int j=0; j<calNames.size(); j++){
if(detectors.size()>i){
if(calNames.at(j)==detectors.at(i).getCalFilePath()){
if((int)detectors.size()<=calNum.size()){
calNum.replace(i,j+1);
}
}
}
else{
qDebug() << "ERROR: detectors.at(i) does not exist! i="<<i<<" (preferencedialog::setupDetTable())";
}
}
}
for(unsigned int i=0; i<detectors.size(); i++){
QComboBox* calCombo = new QComboBox(this);
calCombo->addItem("");
for(int j=0; j<calNames.size(); j++){
if(calNames.at(j).size()!=0) {calCombo->addItem("..."+calNames.at(j).right(20));}
}
calCombo->setCurrentIndex(calNum.at(i));
calCombo->setObjectName(QString::number(i));
connect(calCombo, SIGNAL(currentIndexChanged(QString)), this, SLOT(calStringChanged(QString)));
ui->detTable->setCellWidget(i,6,calCombo);
}
for(unsigned int i=0; i<detectors.size(); i++){
QComboBox* detCombo = new QComboBox(this);
detCombo->addItem("");
detCombo->addItem("Germanium");
detCombo->addItem("Silicon");
if(detectors.at(i).getDetType()=="Germanium")
detCombo->setCurrentIndex(1);
if(detectors.at(i).getDetType()=="Silicon")
detCombo->setCurrentIndex(2);
detCombo->setObjectName("detCombo"+QString::number(i));
connect(detCombo, SIGNAL(currentIndexChanged(QString)), this, SLOT(detTypeChanged(QString)));
ui->detTable->setCellWidget(i,7,detCombo);
}
for(unsigned int i=0; i<detectors.size(); i++){
QSpinBox* ratesBox = new QSpinBox(this);
ratesBox->setObjectName("ratesBox"+QString::number(i));
connect(ratesBox, SIGNAL(valueChanged(QString)), this, SLOT(ratesLimitChanged(QString)));
ratesBox->setRange(0,100000);
ratesBox->setValue(detectors.at(i).getIratesLimit());
ui->detTable->setCellWidget(i,8,ratesBox);
}
ui->detTable->resizeColumnsToContents();
ui->detTable->setSelectionMode(QAbstractItemView::SingleSelection);
}
示例12: setupUI
void setupUI(SAPenSetWidget*parent ,Qt::Orientation orient)
{
if (parent->objectName().isEmpty())
parent->setObjectName(QStringLiteral("SAPenSetWidget"));
if(Qt::Horizontal == orient)
{
parent->resize(247, 48);
horizontalLayoutMain = new QHBoxLayout(parent);
horizontalLayoutMain->setSpacing(0);
horizontalLayoutMain->setObjectName(QStringLiteral("horizontalLayout_2"));
horizontalLayoutMain->setContentsMargins(0, 0, 0, 0);
verticalLayoutHorizontal = new QVBoxLayout();
verticalLayoutHorizontal->setSpacing(0);
verticalLayoutHorizontal->setObjectName(QStringLiteral("verticalLayout"));
horizontalLayoutHorizontalColor = new QHBoxLayout();
horizontalLayoutHorizontalColor->setObjectName(QStringLiteral("horizontalLayout"));
labelColor = new QLabel(parent);
labelColor->setObjectName(QStringLiteral("labelColor"));
labelColor->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
horizontalLayoutHorizontalColor->addWidget(labelColor);
pushButtonColor = new SAColorPickerButton(parent);
pushButtonColor->setObjectName(QStringLiteral("pushButtonColor"));
QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
sizePolicy.setHeightForWidth(pushButtonColor->sizePolicy().hasHeightForWidth());
pushButtonColor->setSizePolicy(sizePolicy);
horizontalLayoutHorizontalColor->addWidget(pushButtonColor);
verticalLayoutHorizontal->addLayout(horizontalLayoutHorizontalColor);
horizontalSliderColorAlpha = new QSlider(parent);
horizontalSliderColorAlpha->setObjectName(QStringLiteral("horizontalSliderColorAlpha"));
QSizePolicy sizePolicy1(QSizePolicy::Preferred, QSizePolicy::Maximum);
sizePolicy1.setHorizontalStretch(0);
sizePolicy1.setVerticalStretch(0);
sizePolicy1.setHeightForWidth(horizontalSliderColorAlpha->sizePolicy().hasHeightForWidth());
horizontalSliderColorAlpha->setSizePolicy(sizePolicy1);
horizontalSliderColorAlpha->setMinimumSize(QSize(8, 0));
horizontalSliderColorAlpha->setOrientation(Qt::Horizontal);
verticalLayoutHorizontal->addWidget(horizontalSliderColorAlpha);
horizontalLayoutMain->addLayout(verticalLayoutHorizontal);
labelWidth = new QLabel(parent);
labelWidth->setObjectName(QStringLiteral("labelWidth"));
labelWidth->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
horizontalLayoutMain->addWidget(labelWidth);
spinBoxPenWidth = new QSpinBox(parent);
spinBoxPenWidth->setObjectName(QStringLiteral("spinBoxPenWidth"));
spinBoxPenWidth->setMaximum(100);
horizontalLayoutMain->addWidget(spinBoxPenWidth);
labelStyle = new QLabel(parent);
labelStyle->setObjectName(QStringLiteral("labelStyle"));
labelStyle->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
horizontalLayoutMain->addWidget(labelStyle);
comboBoxPenStyle = new SAPenStyleComboBox(parent);
comboBoxPenStyle->setObjectName(QStringLiteral("comboBoxPenStyle"));
horizontalLayoutMain->addWidget(comboBoxPenStyle);
}
else
{
parent->resize(109, 79);
verticalLayoutMain = new QVBoxLayout(parent);
verticalLayoutMain->setSpacing(4);
verticalLayoutMain->setObjectName(QStringLiteral("verticalLayout"));
verticalLayoutMain->setContentsMargins(1, 1, 1, 1);
horizontalLayoutVerticalColor = new QHBoxLayout();
horizontalLayoutVerticalColor->setSpacing(4);
horizontalLayoutVerticalColor->setObjectName(QStringLiteral("horizontalLayout"));
labelColor = new QLabel(parent);
labelColor->setObjectName(QStringLiteral("labelColor"));
labelColor->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter);
horizontalLayoutVerticalColor->addWidget(labelColor);
pushButtonColor = new SAColorPickerButton(parent);
pushButtonColor->setObjectName(QStringLiteral("pushButtonColor"));
QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
sizePolicy.setHeightForWidth(pushButtonColor->sizePolicy().hasHeightForWidth());
pushButtonColor->setSizePolicy(sizePolicy);
horizontalLayoutVerticalColor->addWidget(pushButtonColor);
horizontalSliderColorAlpha = new QSlider(parent);
//.........这里部分代码省略.........
示例13: createLayout
void DkDisplayPreference::createLayout() {
// zoom settings
QCheckBox* invertZoom = new QCheckBox(tr("Invert zoom wheel behaviour"), this);
invertZoom->setObjectName("invertZoom");
invertZoom->setChecked(Settings::param().display().invertZoom);
QLabel* interpolationLabel = new QLabel(tr("Show pixels if zoom level is above"), this);
QSpinBox* sbInterpolation = new QSpinBox(this);
sbInterpolation->setObjectName("interpolationBox");
sbInterpolation->setToolTip(tr("nomacs will not interpolate images if the zoom level is larger."));
sbInterpolation->setSuffix("%");
sbInterpolation->setMinimum(0);
sbInterpolation->setMaximum(10000);
sbInterpolation->setValue(Settings::param().display().interpolateZoomLevel);
DkGroupWidget* zoomGroup = new DkGroupWidget(tr("Zoom"), this);
zoomGroup->addWidget(invertZoom);
zoomGroup->addWidget(interpolationLabel);
zoomGroup->addWidget(sbInterpolation);
// keep zoom radio buttons
QVector<QRadioButton*> keepZoomButtons;
keepZoomButtons.resize(DkSettings::zoom_end);
keepZoomButtons[DkSettings::zoom_always_keep] = new QRadioButton(tr("Always keep zoom"), this);
keepZoomButtons[DkSettings::zoom_keep_same_size] = new QRadioButton(tr("Keep zoom if the size is the same"), this);
keepZoomButtons[DkSettings::zoom_keep_same_size]->setToolTip(tr("If checked, the zoom level is only kept, if the image loaded has the same level as the previous."));
keepZoomButtons[DkSettings::zoom_never_keep] = new QRadioButton(tr("Never keep zoom"), this);
// check wrt the current settings
keepZoomButtons[Settings::param().display().keepZoom]->setChecked(true);
QButtonGroup* keepZoomButtonGroup = new QButtonGroup(this);
keepZoomButtonGroup->setObjectName("keepZoom");
keepZoomButtonGroup->addButton(keepZoomButtons[DkSettings::zoom_always_keep], DkSettings::zoom_always_keep);
keepZoomButtonGroup->addButton(keepZoomButtons[DkSettings::zoom_keep_same_size], DkSettings::zoom_keep_same_size);
keepZoomButtonGroup->addButton(keepZoomButtons[DkSettings::zoom_never_keep], DkSettings::zoom_never_keep);
DkGroupWidget* keepZoomGroup = new DkGroupWidget(tr("When Displaying New Images"), this);
keepZoomGroup->addWidget(keepZoomButtons[DkSettings::zoom_always_keep]);
keepZoomGroup->addWidget(keepZoomButtons[DkSettings::zoom_keep_same_size]);
keepZoomGroup->addWidget(keepZoomButtons[DkSettings::zoom_never_keep]);
// icon size
QSpinBox* sbIconSize = new QSpinBox(this);
sbIconSize->setObjectName("iconSizeBox");
sbIconSize->setToolTip(tr("Define the icon size in pixel."));
sbIconSize->setSuffix(" px");
sbIconSize->setMinimum(16);
sbIconSize->setMaximum(1024);
sbIconSize->setValue(Settings::param().display().iconSize);
DkGroupWidget* iconGroup = new DkGroupWidget(tr("Icon Size"), this);
iconGroup->addWidget(sbIconSize);
// slideshow
QLabel* fadeImageLabel = new QLabel(tr("Image Transition"), this);
QDoubleSpinBox* fadeImageBox = new QDoubleSpinBox(this);
fadeImageBox->setObjectName("fadeImageBox");
fadeImageBox->setToolTip(tr("Define the image transition speed."));
fadeImageBox->setSuffix(" sec");
fadeImageBox->setMinimum(0.0);
fadeImageBox->setMaximum(3);
fadeImageBox->setSingleStep(.2);
fadeImageBox->setValue(Settings::param().display().fadeSec);
QLabel* displayTimeLabel = new QLabel(tr("Display Time"), this);
QDoubleSpinBox* displayTimeBox = new QDoubleSpinBox(this);
displayTimeBox->setObjectName("displayTimeBox");
displayTimeBox->setToolTip(tr("Define the time an image is displayed."));
displayTimeBox->setSuffix(" sec");
displayTimeBox->setMinimum(0.0);
displayTimeBox->setMaximum(30);
displayTimeBox->setSingleStep(.2);
displayTimeBox->setValue(Settings::param().slideShow().time);
DkGroupWidget* slideshowGroup = new DkGroupWidget(tr("Slideshow"), this);
slideshowGroup->addWidget(fadeImageLabel);
slideshowGroup->addWidget(fadeImageBox);
slideshowGroup->addWidget(displayTimeLabel);
slideshowGroup->addWidget(displayTimeBox);
// left column
QWidget* leftWidget = new QWidget(this);
QVBoxLayout* leftLayout = new QVBoxLayout(leftWidget);
leftLayout->setAlignment(Qt::AlignTop);
leftLayout->addWidget(zoomGroup);
leftLayout->addWidget(keepZoomGroup);
leftLayout->addWidget(iconGroup);
leftLayout->addWidget(slideshowGroup);
// right column
QWidget* rightWidget = new QWidget(this);
QVBoxLayout* rightLayout = new QVBoxLayout(rightWidget);
rightLayout->setAlignment(Qt::AlignTop);
QHBoxLayout* layout = new QHBoxLayout(this);
//.........这里部分代码省略.........
示例14: fillTabsWithPass
void RmShaderDialog::fillTabsWithPass(int index)
{
clearTabs();
if (index < 0 || eff_selected == NULL || index >= eff_selected->size())
return;
pass_selected = &(eff_selected->at(index));
// Set the source code of vertex shader
ui.textVertex->setText(pass_selected->getVertex());
// Set the source code of fragment shader
ui.textFragment->setText(pass_selected->getFragment());
// General Info in the first tab
QString info;
if (pass_selected->hasRenderTarget())
info += "Render Target: " + pass_selected->getRenderTarget().name + "\n";
for (int i = 0; i < 2; i++)
for (int j = 0;
j < (i == 0 ? pass_selected->vertexUniformVariableSize() : pass_selected->fragmentUniformVariableSize());
j++) {
UniformVar v = pass_selected->getUniform(j, i == 0 ? RmPass::VERTEX : RmPass::FRAGMENT);
if(v.representerTagName == "RmRenderTarget") {
if (i == 0)
info += "Vertex";
else
info += "Fragment";
info += " render Input: " + v.name;
for (int k = 0; k < eff_selected -> size(); k++)
if (eff_selected->at(k).getRenderTarget().name == v.textureName) {
info += " (from pass: " + eff_selected->at(k).getName() + ")";
break;
}
info += "\n";
}
}
if (!info.isEmpty()) {
QLabel *lblinfo = new QLabel(info);
layoutUniform->addWidget(lblinfo, 0, 0, 1, 5);
shown.append(lblinfo);
}
// any value change is sent to the state holder with this mapper
// Signal are send from signaler in the form "varnameNM" where
// NM is the index of row and column in case of matrix. (00 if
// it is a simple variable).
delete signaler;
signaler = new QSignalMapper();
connect(signaler, SIGNAL(mapped(const QString &)), this, SLOT(valuesChanged(const QString &)));
// Uniform Variables in the first Tab
QList<QString> usedVarables; // parser can give same variable twice in the vertex and fragment
int row = 1;
for (int ii = 0; ii < 2; ii++)
for (int jj = 0;
jj < (ii == 0 ? pass_selected->vertexUniformVariableSize() : pass_selected->fragmentUniformVariableSize());
jj++) {
UniformVar v = pass_selected->getUniform(jj, ii == 0 ? RmPass::VERTEX : RmPass::FRAGMENT);
if (v.representerTagName == "RmRenderTarget" || usedVarables.contains(v.name))
continue;
usedVarables.append(v.name);
QString varname = (ii == 0 ? "Vertex: " : "Fragment: ");
varname += UniformVar::getStringFromUniformType(v.type) +
" " + v.name + (v.minSet || v.maxSet ? "\n" : "");
switch (v.type) {
case UniformVar::INT:
case UniformVar::IVEC2:
case UniformVar::IVEC3:
case UniformVar::IVEC4: {
int n = v.type == UniformVar::INT ? 1 : (v.type == UniformVar::IVEC2 ? 2 : (v.type == UniformVar::IVEC3 ? 3 : 4 ));
for (int i = 0; i < n; i++) {
QSpinBox *input = new QSpinBox();
input->setObjectName(v.name + "0" + QString().setNum(i));
if (v.minSet)
input->setMinimum(v.fmin);
else
input -> setMinimum(-1000);
if (v.maxSet)
input->setMaximum(v.fmax);
else
input->setMaximum(1000);
input->setSingleStep((v.minSet && v.maxSet )? std::max(( v.imax - v.imin )/10, 1) : 1 );
input->setValue(v.ivec4[i]);
layoutUniform->addWidget(input, row, 1 + i, 1,
((i + 1)==n ? 5-n : 1));
shown.append(input);
connect(input, SIGNAL(valueChanged(int)), signaler, SLOT(map()));
//.........这里部分代码省略.........