当前位置: 首页>>代码示例>>C++>>正文


C++ QComboBox::setObjectName方法代码示例

本文整理汇总了C++中QComboBox::setObjectName方法的典型用法代码示例。如果您正苦于以下问题:C++ QComboBox::setObjectName方法的具体用法?C++ QComboBox::setObjectName怎么用?C++ QComboBox::setObjectName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QComboBox的用法示例。


在下文中一共展示了QComboBox::setObjectName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setEditorData

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void ComparisonSelectionItemDelegate::setEditorData(QWidget* editor, const QModelIndex& index) const
{
  qint32 col = index.column();
  // bool ok = false;
  if (col == ComparisonSelectionTableModel::FeatureName)
  {
    QString objName = QString::number(index.row()) + "," + QString::number(ComparisonSelectionTableModel::FeatureName);
    QString state = index.model()->data(index).toString();
    QComboBox* comboBox = qobject_cast<QComboBox* > (editor);
    Q_ASSERT(comboBox);
    comboBox->setObjectName(objName);
    comboBox->setCurrentIndex(comboBox->findText(state));
  }
  else if (col == ComparisonSelectionTableModel::FeatureValue )
  {
    QString objName = QString::number(index.row()) + "," + QString::number(ComparisonSelectionTableModel::FeatureValue);
    QLineEdit* lineEdit = qobject_cast<QLineEdit* > (editor);
    Q_ASSERT(lineEdit);
    lineEdit->setObjectName(objName);
//    QVariant var = index.model()->data(index);
//    double d = var.toDouble();
//    qDebug() << lineEdit->text();
//    lineEdit->setText(QString::number(d));
  }
  else if (col == ComparisonSelectionTableModel::FeatureOperator)
  {
    QString objName = QString::number(index.row()) + "," + QString::number(ComparisonSelectionTableModel::FeatureOperator);
    QString state = index.model()->data(index).toString();
    QComboBox* comboBox = qobject_cast<QComboBox* > (editor);
    Q_ASSERT(comboBox);
    comboBox->setObjectName(objName);
    comboBox->setCurrentIndex(comboBox->findText(state));
  }
  else { QStyledItemDelegate::setEditorData(editor, index); }
}
开发者ID:BlueQuartzSoftware,项目名称:SIMPLView,代码行数:38,代码来源:ComparisonSelectionItemDelegate.cpp

示例2: collectExtraInfo

bool Pad::collectExtraInfo(QWidget * parent, const QString & family, const QString & prop, const QString & value, bool swappingEnabled, QString & returnProp, QString & returnValue, QWidget * & returnWidget) 
{
	if (prop.compare("shape", Qt::CaseInsensitive) == 0) {
		returnWidget = setUpDimEntry(false, false, false, returnWidget);
        returnWidget->setEnabled(swappingEnabled);
		returnProp = tr("shape");
		return true;
	}

    if (!copperBlocker()) {
	    if (prop.compare("connect to", Qt::CaseInsensitive) == 0) {
		    QComboBox * comboBox = new QComboBox();
		    comboBox->setObjectName("infoViewComboBox");
		    comboBox->setEditable(false);
		    comboBox->setEnabled(swappingEnabled);
		    comboBox->addItem(tr("center"), "center");
		    comboBox->addItem(tr("north"), "north");
		    comboBox->addItem(tr("east"), "east");
		    comboBox->addItem(tr("south"), "south");
		    comboBox->addItem(tr("west"), "west");
		    QString connectAt = m_modelPart->localProp("connect").toString();
		    for (int i = 0; i < comboBox->count(); i++) {
			    if (comboBox->itemData(i).toString().compare(connectAt) == 0) {
				    comboBox->setCurrentIndex(i);
				    break;
			    }
		    }

		    connect(comboBox, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(terminalPointEntry(const QString &)));

		    returnWidget = comboBox;
		    returnProp = tr("connect to");
		    return true;
	    }
    }
开发者ID:honsey,项目名称:fztaxedit,代码行数:35,代码来源:pad.cpp

示例3: collectExtraInfo

bool Ruler::collectExtraInfo(QWidget * parent, const QString & family, const QString & prop, const QString & value, bool swappingEnabled, QString & returnProp, QString & returnValue, QWidget * & returnWidget)
{
	bool result = PaletteItem::collectExtraInfo(parent, family, prop, value, swappingEnabled, returnProp, returnValue, returnWidget);

	if (prop.compare("width", Qt::CaseInsensitive) == 0) {
		returnProp = tr("width");

		int units = m_modelPart->localProp("width").toString().contains("cm") ? IndexCm : IndexIn;
		QLineEdit * e1 = new QLineEdit();
		QDoubleValidator * validator = new QDoubleValidator(e1);
		validator->setRange(1.0, 20 * ((units == IndexCm) ? 2.54 : 1), 2);
		validator->setNotation(QDoubleValidator::StandardNotation);
		e1->setValidator(validator);
		e1->setEnabled(swappingEnabled);
		QString temp = m_modelPart->localProp("width").toString();
		temp.chop(2);
		e1->setText(temp);
		e1->setObjectName("infoViewLineEdit");	
        e1->setMaximumWidth(80);

		m_widthEditor = e1;
		m_widthValidator = validator;

		QComboBox * comboBox = new QComboBox(parent);
		comboBox->setEditable(false);
		comboBox->setEnabled(swappingEnabled);
		comboBox->addItem("cm");
		comboBox->addItem("in");
		comboBox->setCurrentIndex(units);
		m_unitsEditor = comboBox;
		comboBox->setObjectName("infoViewComboBox");	
        comboBox->setMinimumWidth(60);


		QHBoxLayout * hboxLayout = new QHBoxLayout();
		hboxLayout->setAlignment(Qt::AlignLeft);
		hboxLayout->setContentsMargins(0, 0, 0, 0);
		hboxLayout->setSpacing(0);
		hboxLayout->setMargin(0);


		hboxLayout->addWidget(e1);
		hboxLayout->addWidget(comboBox);

		QFrame * frame = new QFrame();
		frame->setLayout(hboxLayout);
		frame->setObjectName("infoViewPartFrame");

		connect(e1, SIGNAL(editingFinished()), this, SLOT(widthEntry()));
		connect(comboBox, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(unitsEntry(const QString &)));

        returnValue = temp + QString::number(units);
		returnWidget = frame;

		return true;
	}
开发者ID:honsey,项目名称:fztaxedit,代码行数:56,代码来源:ruler.cpp

示例4: copyComboBox

QComboBox* LayoutManager::copyComboBox(QObject *obj) {
    QComboBox *oldComboBox = qobject_cast<QComboBox*>(obj);
    QComboBox *newComboBox = new QComboBox();

    for(int i=0;i<oldComboBox->count();i++) {
        newComboBox->addItem(oldComboBox->itemText(i),oldComboBox->itemData(i));
    }
    newComboBox->setObjectName(oldComboBox->objectName() + " " + QString::number(keyLayouts.size()));

    return newComboBox;
}
开发者ID:floreks,项目名称:D3Helper,代码行数:11,代码来源:layoutmanager.cpp

示例5: addParameter

void ParametersToolBox::addParameter(QVBoxLayout * layout,
		const QString & key,
		const QString & value)
{
	if(value.contains(';'))
	{
		QComboBox * widget = new QComboBox(this);
		widget->setObjectName(key);
		QStringList splitted = value.split(':');
		widget->addItems(splitted.last().split(';'));
		widget->setCurrentIndex(splitted.first().toInt());
		connect(widget, SIGNAL(currentIndexChanged(int)), this, SLOT(changeParameter(int)));
		addParameter(layout, key.split('/').last(), widget);
	}
开发者ID:conanhung,项目名称:examples,代码行数:14,代码来源:ParametersToolBox.cpp

示例6: setupUi

    void setupUi(SAComboBoxPropertyItem *par)
    {
        comboBox = new QComboBox(par);
        comboBox->setObjectName(QStringLiteral("comboBox"));

        par->setWidget(comboBox);
        par->connect(comboBox,static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged)
                ,par,static_cast<void(SAComboBoxPropertyItem::*)(int)>(&SAComboBoxPropertyItem::currentIndexChanged));
        par->connect(comboBox,static_cast<void(QComboBox::*)(const QString&)>(&QComboBox::currentIndexChanged)
                ,par,static_cast<void(SAComboBoxPropertyItem::*)(const QString&)>(&SAComboBoxPropertyItem::currentIndexChanged));
        par->connect(comboBox,&QComboBox::currentTextChanged
                ,par,&SAComboBoxPropertyItem::currentTextChanged);
        par->connect(comboBox,&QComboBox::editTextChanged
                ,par,&SAComboBoxPropertyItem::editTextChanged);

    } // setupUi
开发者ID:czyt1988,项目名称:sa,代码行数:16,代码来源:SAComboBoxPropertyItem.cpp

示例7: addTriplet

void ContactDialog::addTriplet(int& count, QGridLayout* l, const QString& nameTemplate, const QString& itemValue)
{
    if (count>=MIN_VISIBLE_TRIPLETS) {
        // Value
        QLineEdit* le = new QLineEdit(this);
        le->setObjectName(QString("le%1%2").arg(nameTemplate).arg(count+1));
        l->addWidget(le, count, 0);
        // Item type combo box
        QComboBox* cbT = new QComboBox(this);
        cbT->setObjectName(QString("cb%1Type%2").arg(nameTemplate).arg(count+1));
        cbT->setMaxVisibleItems(32); // "mixed" (last item) must be strongly visible
        connect(cbT, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(itemTypeChanged(const QString&)));
        l->addWidget(cbT, count, 1);
        // Delete button
        QToolButton* btnD = addDelButton(count, nameTemplate, SLOT(slotDelTriplet()));
        l->addWidget(btnD, count, 2);
    }
开发者ID:DarkHobbit,项目名称:doublecontact,代码行数:17,代码来源:contactdialog.cpp

示例8: 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);
    }
}
开发者ID:DavideMalvezzi,项目名称:EscorpioEvo15-DAQSystem,代码行数:42,代码来源:dashbar.cpp

示例9: setupLoadImage

void Board::setupLoadImage(QWidget * parent, const QString & family, const QString & prop, const QString & value, bool swappingEnabled, QString & returnProp, QString & returnValue, QWidget * & returnWidget) 
{
    Q_UNUSED(returnValue);
    Q_UNUSED(value);
    Q_UNUSED(prop);
    Q_UNUSED(family);
    Q_UNUSED(parent);

	returnProp = tr("image file");

	QFrame * frame = new QFrame();
	frame->setObjectName("infoViewPartFrame");
	QVBoxLayout * vboxLayout = new QVBoxLayout();
	vboxLayout->setContentsMargins(0, 0, 0, 0);
	vboxLayout->setSpacing(0);
	vboxLayout->setMargin(0);

	QComboBox * comboBox = new QComboBox();
	comboBox->setObjectName("infoViewComboBox");
	comboBox->setEditable(false);
	comboBox->setEnabled(swappingEnabled);
	m_fileNameComboBox = comboBox;

	setFileNameItems();

	connect(comboBox, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(fileNameEntry(const QString &)));

	QPushButton * button = new QPushButton (tr("load image file"));
	button->setObjectName("infoViewButton");
	connect(button, SIGNAL(pressed()), this, SLOT(prepLoadImage()));
	button->setEnabled(swappingEnabled);

	vboxLayout->addWidget(comboBox);
	vboxLayout->addWidget(button);

	frame->setLayout(vboxLayout);
	returnWidget = frame;

	returnProp = "";
}
开发者ID:bacchante95,项目名称:fritzing,代码行数:40,代码来源:resizableboard.cpp

示例10: addComboBox

QComboBox* VOptionable::addComboBox(QLayout *layout, QString objectName, QString text, QStringList strList, int index, QString value)
{
  QWidget* parentWidget = layout->parentWidget();
  if (parentWidget == NULL)
  {
    LOG_FATAL("parentWidget is null(%s)", qPrintable(objectName));
    return NULL;
  }
  if (parentWidget->findChild<QObject*>(objectName) != NULL)
  {
    LOG_FATAL("parentWidget->findChild(%s) is not null", qPrintable(objectName));
    return NULL;
  }
  QLabel*    label    = new QLabel(parentWidget);
  QComboBox* comboBox = new QComboBox(parentWidget);

  label->setText(text);
  comboBox->setObjectName(objectName);
  foreach (QString text, strList)
  {
    comboBox->addItem(text);
  }
开发者ID:gilgil1973,项目名称:vdream90,代码行数:22,代码来源:vobjectwidget.cpp

示例11: createWidgetForEnum

QWidget* PropertyEditor::createWidgetForEnum(const QString& name, const QVariant& value, QMetaEnum me, const QString &detail, QWidget* parent)
{
    mProperties[name] = value;
    QComboBox *box = new QComboBox(parent);
    if (!detail.isEmpty())
        box->setToolTip(detail);
    box->setObjectName(name);
    box->setEditable(false);
    for (int i = 0; i < me.keyCount(); ++i) {
        box->addItem(QString::fromLatin1(me.key(i)), me.value(i));
    }
    if (value.type() == QVariant::Int) {
        box->setCurrentIndex(box->findData(value));
    } else {
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
        box->setCurrentText(value.toString());
#else
        box->setCurrentIndex(box->findText(value.toString()));
#endif
    }
    connect(box, SIGNAL(currentIndexChanged(int)), SLOT(onEnumChange(int)));
    return box;
}
开发者ID:baoniu,项目名称:QtAV,代码行数:23,代码来源:PropertyEditor.cpp

示例12: addQuantity

void IngredientUI::addQuantity() {
    quantityNo++;

    QPushButton* removeQuantityButton = new QPushButton("-", quantitiesGroupBox);
    removeQuantityButton->setObjectName(QString::fromUtf8("removeQuantityButton_%1").arg(quantityNo));
    removeQuantityButton->setMaximumSize(QSize(20, 15));

    gridLayout->addWidget(removeQuantityButton, quantityNo-1, 6, 1, 1);

    QPushButton* addQuantityButton = new QPushButton("+", quantitiesGroupBox);
    addQuantityButton->setObjectName(QString::fromUtf8("addQuantityButton_%1").arg(quantityNo));
    addQuantityButton->setMaximumSize(QSize(20, 15));

    gridLayout->addWidget(addQuantityButton, quantityNo-1, 7, 1, 1);

    QComboBox* quantityComboBox = new QComboBox(quantitiesGroupBox);
    quantityComboBox->setObjectName(QString::fromUtf8("quantityComboBox_%1").arg(quantityNo));
    quantityComboBox->setModel(model);

    gridLayout->addWidget(quantityComboBox, quantityNo-1, 3, 1, 3);

    connect(addQuantityButton, SIGNAL(clicked()), this, SLOT(addQuantity()));
    connect(removeQuantityButton, SIGNAL(clicked()), this, SLOT(removeQuantity()));
}
开发者ID:jexhson,项目名称:janine,代码行数:24,代码来源:IngredientUI.cpp

示例13: addProcedure

void CookwareUI::addProcedure() {
    procedureNo++;

    QPushButton* removeProcedureButton = new QPushButton("-", proceduresGroupBox);
    removeProcedureButton->setObjectName(QString::fromUtf8("removeProcedureButton_%1").arg(procedureNo));
    removeProcedureButton->setMaximumSize(QSize(20, 15));

    gridLayout_3->addWidget(removeProcedureButton, procedureNo-1, 6, 1, 1);

    QPushButton* addProcedureButton = new QPushButton("+", proceduresGroupBox);
    addProcedureButton->setObjectName(QString::fromUtf8("addProcedureButton_%1").arg(procedureNo));
    addProcedureButton->setMaximumSize(QSize(20, 15));

    gridLayout_3->addWidget(addProcedureButton, procedureNo-1, 7, 1, 1);

    QComboBox* procedureComboBox = new QComboBox(proceduresGroupBox);
    procedureComboBox->setObjectName(QString::fromUtf8("procedureComboBox_%1").arg(procedureNo));
    procedureComboBox->setModel(procedureModel);

    gridLayout_3->addWidget(procedureComboBox, procedureNo-1, 3, 1, 3);

    connect(addProcedureButton, SIGNAL(clicked()), this, SLOT(addProcedure()));
    connect(removeProcedureButton, SIGNAL(clicked()), this, SLOT(removeProcedure()));
}
开发者ID:jexhson,项目名称:janine,代码行数:24,代码来源:CookwareUI.cpp

示例14: addbutton_clicked

void ConfigStation::addbutton_clicked()
{
    QHBoxLayout *hlayout =new QHBoxLayout;
    QLineEdit *stale = new QLineEdit;
    QComboBox *chancb = new QComboBox;
    QComboBox *compcb = new QComboBox;
    QLineEdit *locle = new QLineEdit;
    locle->setEnabled(false);
    QLineEdit *netle = new QLineEdit;
    QLineEdit *latle = new QLineEdit;
    QLineEdit *lonle = new QLineEdit;
    QLineEdit *elevle = new QLineEdit;

    qlist.push_back(stale);

    sta.resize(qlist.count()); chan.resize(qlist.count()); comp.resize(qlist.count()); loc.resize(qlist.count()); net.resize(qlist.count());
    lat.resize(qlist.count()); lon.resize(qlist.count()); elev.resize(qlist.count());
    chan[qlist.count()-1] = "HG";
    comp[qlist.count()-1] = "Z";
    loc[qlist.count()-1] = "--";

    int i=0;
    stale->setObjectName("lineedit_" + QString::number(qlist.count()) + "_" + QString::number(i+1) ); i++;
    chancb->setObjectName("lineedit_" + QString::number(qlist.count()) + "_" + QString::number(i+1) ); i++;
    compcb->setObjectName("lineedit_" + QString::number(qlist.count()) + "_" + QString::number(i+1) ); i++;
    locle->setObjectName("lineedit_" + QString::number(qlist.count()) + "_" + QString::number(i+1) ); i++;
    netle->setObjectName("lineedit_" + QString::number(qlist.count()) + "_" + QString::number(i+1) ); i++;
    latle->setObjectName("lineedit_" + QString::number(qlist.count()) + "_" + QString::number(i+1) ); i++;
    lonle->setObjectName("lineedit_" + QString::number(qlist.count()) + "_" + QString::number(i+1) ); i++;
    elevle->setObjectName("lineedit_" + QString::number(qlist.count()) + "_" + QString::number(i+1) );

    stale->setAlignment(Qt::AlignCenter);
    locle->setAlignment(Qt::AlignCenter);
    netle->setAlignment(Qt::AlignCenter);
    latle->setAlignment(Qt::AlignCenter);
    lonle->setAlignment(Qt::AlignCenter);
    elevle->setAlignment(Qt::AlignCenter);

    locle->setText("--");
    QStringList chan;
    chan << "HG" << "BG" << "HH" << "BH" << "EL" << "SL";
    chancb->addItems(chan); chancb->setCurrentIndex(0);

    QStringList comp;
    comp << "Z" << "N" << "E" << "Z/N/E" << "N/E";
    compcb->addItems(comp); compcb->setCurrentIndex(0);

    hlayout->addWidget(stale);
    hlayout->addWidget(chancb);
    hlayout->addWidget(compcb);
    hlayout->addWidget(locle);
    hlayout->addWidget(netle);
    hlayout->addWidget(latle);
    hlayout->addWidget(lonle);
    hlayout->addWidget(elevle);

    chancb->setMaximumWidth(130);
    chancb->setMinimumWidth(130);
    compcb->setMaximumWidth(130);
    compcb->setMinimumWidth(130);

    middlelayout->addLayout(hlayout);

    connect(stale, SIGNAL(textChanged(QString)), SLOT(lineedit_textChanged(QString)));
    connect(chancb, SIGNAL(currentIndexChanged(QString)), SLOT(lineedit_textChanged(QString)));
    connect(compcb, SIGNAL(currentIndexChanged(QString)), SLOT(lineedit_textChanged(QString)));
    connect(locle, SIGNAL(textChanged(QString)), SLOT(lineedit_textChanged(QString)));
    connect(netle, SIGNAL(textChanged(QString)), SLOT(lineedit_textChanged(QString)));
    connect(latle, SIGNAL(textChanged(QString)), SLOT(lineedit_textChanged(QString)));
    connect(lonle, SIGNAL(textChanged(QString)), SLOT(lineedit_textChanged(QString)));
    connect(elevle, SIGNAL(textChanged(QString)), SLOT(lineedit_textChanged(QString)));
}
开发者ID:hayoungdaddy,项目名称:KGminer_QT,代码行数:72,代码来源:configstation.cpp

示例15: createLayout

void DkGeneralPreference::createLayout() {

	// color settings
	DkColorChooser* highlightColorChooser = new DkColorChooser(QColor(0, 204, 255), tr("Highlight Color"), this);
	highlightColorChooser->setObjectName("highlightColor");
	highlightColorChooser->setColor(&Settings::param().display().highlightColor);
	connect(highlightColorChooser, SIGNAL(accepted()), this, SLOT(showRestartLabel()));

	DkColorChooser* iconColorChooser = new DkColorChooser(QColor(219, 89, 2, 255), tr("Icon Color"), this);
	iconColorChooser->setObjectName("iconColor");
	iconColorChooser->setColor(&Settings::param().display().iconColor);
	connect(iconColorChooser, SIGNAL(accepted()), this, SLOT(showRestartLabel()));

	DkColorChooser* bgColorChooser = new DkColorChooser(QColor(100, 100, 100, 255), tr("Background Color"), this);
	bgColorChooser->setObjectName("backgroundColor");
	bgColorChooser->setColor(&Settings::param().display().bgColor);
	connect(bgColorChooser, SIGNAL(accepted()), this, SLOT(showRestartLabel()));

	DkColorChooser* fullscreenColorChooser = new DkColorChooser(QColor(86,86,90), tr("Fullscreen Color"), this);
	fullscreenColorChooser->setObjectName("fullscreenColor");
	fullscreenColorChooser->setColor(&Settings::param().slideShow().backgroundColor);
	connect(fullscreenColorChooser, SIGNAL(accepted()), this, SLOT(showRestartLabel()));

	DkColorChooser* fgdHUDColorChooser = new DkColorChooser(QColor(255, 255, 255, 255), tr("HUD Foreground Color"), this);
	fgdHUDColorChooser->setObjectName("fgdHUDColor");
	fgdHUDColorChooser->setColor(&Settings::param().display().hudFgdColor);
	connect(fgdHUDColorChooser, SIGNAL(accepted()), this, SLOT(showRestartLabel()));

	DkColorChooser* bgHUDColorChooser = new DkColorChooser(QColor(0, 0, 0, 100), tr("HUD Background Color"), this);
	bgHUDColorChooser->setObjectName("bgHUDColor");
	bgHUDColorChooser->setColor((Settings::param().app().appMode == DkSettings::mode_frameless) ?
		&Settings::param().display().bgColorFrameless : &Settings::param().display().hudBgColor);
	connect(bgHUDColorChooser, SIGNAL(accepted()), this, SLOT(showRestartLabel()));

	DkGroupWidget* colorGroup = new DkGroupWidget(tr("Color Settings"), this);
	colorGroup->addWidget(highlightColorChooser);
	colorGroup->addWidget(iconColorChooser);
	colorGroup->addWidget(bgColorChooser);
	colorGroup->addWidget(fullscreenColorChooser);
	colorGroup->addWidget(fgdHUDColorChooser);
	colorGroup->addWidget(bgHUDColorChooser);

	// default pushbutton
	QPushButton* defaultSettings = new QPushButton(tr("Reset All Settings"));
	defaultSettings->setObjectName("defaultSettings");
	defaultSettings->setMaximumWidth(300);

	DkGroupWidget* defaultGroup = new DkGroupWidget(tr("Default Settings"), this);
	defaultGroup->addWidget(defaultSettings);

	// the left column (holding all color settings)
	QWidget* leftColumn = new QWidget(this);
	leftColumn->setMinimumWidth(400);

	QVBoxLayout* leftColumnLayout = new QVBoxLayout(leftColumn);
	leftColumnLayout->setAlignment(Qt::AlignTop);
	leftColumnLayout->addWidget(colorGroup);
	leftColumnLayout->addWidget(defaultGroup);

	// checkboxes
	QCheckBox* cbRecentFiles = new QCheckBox(tr("Show Recent Files on Start-Up"), this);
	cbRecentFiles->setObjectName("showRecentFiles");
	cbRecentFiles->setToolTip(tr("Show the History Panel on Start-Up"));
	cbRecentFiles->setChecked(Settings::param().app().showRecentFiles);

	QCheckBox* cbLogRecentFiles = new QCheckBox(tr("Log Recent Files"), this);
	cbLogRecentFiles->setObjectName("logRecentFiles");
	cbLogRecentFiles->setToolTip(tr("If checked, recent files will be saved."));
	cbLogRecentFiles->setChecked(Settings::param().global().logRecentFiles);

	QCheckBox* cbLoopImages = new QCheckBox(tr("Loop Images"), this);
	cbLoopImages->setObjectName("loopImages");
	cbLoopImages->setToolTip(tr("Start with the first image in a folder after showing the last."));
	cbLoopImages->setChecked(Settings::param().global().loop);

	QCheckBox* cbZoomOnWheel = new QCheckBox(tr("Mouse Wheel Zooms"), this);
	cbZoomOnWheel->setObjectName("zoomOnWheel");
	cbZoomOnWheel->setToolTip(tr("If checked, the mouse wheel zooms - otherwise it is used to switch between images."));
	cbZoomOnWheel->setChecked(Settings::param().global().zoomOnWheel);

	QCheckBox* cbDoubleClickForFullscreen = new QCheckBox(tr("Double Click Opens Fullscreen"), this);
	cbDoubleClickForFullscreen->setObjectName("doubleClickForFullscreen");
	cbDoubleClickForFullscreen->setToolTip(tr("If checked, a double click on the canvas opens the fullscreen mode."));
	cbDoubleClickForFullscreen->setChecked(Settings::param().global().doubleClickForFullscreen);

	QCheckBox* cbShowBgImage = new QCheckBox(tr("Show Background Image"), this);
	cbShowBgImage->setObjectName("showBgImage");
	cbShowBgImage->setToolTip(tr("If checked, the nomacs logo is shown in the bottom right corner."));
	cbShowBgImage->setChecked(Settings::param().global().showBgImage);

	QCheckBox* cbSwitchModifier = new QCheckBox(tr("Switch CTRL with ALT"), this);
	cbSwitchModifier->setObjectName("switchModifier");
	cbSwitchModifier->setToolTip(tr("If checked, CTRL + Mouse is switched with ALT + Mouse."));
	cbSwitchModifier->setChecked(Settings::param().sync().switchModifier);

	QCheckBox* cbEnableNetworkSync = new QCheckBox(tr("Enable LAN Sync"), this);
	cbEnableNetworkSync->setObjectName("networkSync");
	cbEnableNetworkSync->setToolTip(tr("If checked, syncing in your LAN is enabled."));
	cbEnableNetworkSync->setChecked(Settings::param().sync().enableNetworkSync);

//.........这里部分代码省略.........
开发者ID:Messna,项目名称:nomacs,代码行数:101,代码来源:DkPreferenceWidgets.cpp


注:本文中的QComboBox::setObjectName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。