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


C++ setDefault函数代码示例

本文整理汇总了C++中setDefault函数的典型用法代码示例。如果您正苦于以下问题:C++ setDefault函数的具体用法?C++ setDefault怎么用?C++ setDefault使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: makeRoom

int GvMField::set(const char* s)
{
	//delete contents 
	makeRoom(0);

	// TRACE("Parsing an MField from :%s\n",s);

	if (strcmp(s,"[]") == 0) {
		setDefault(TRUE);
		OnChanged();
  		return(1);
	} 


	// create a parser 
	GvInput in;

    in.setString(s);
	in.version = 2.0;
	in.vrml2 = 1;
	
	// read 
	int ret = this->readValue(&in);

	setDefault(FALSE);
	OnChanged();

	return ret;
}
开发者ID:deepmatrix,项目名称:blaxxun-cc3d,代码行数:29,代码来源:gvfield.cpp

示例2: createTypeInformation

void RCPerspectiveCamera::createTypeInformation(Shift::PropertyInformationTyped<RCPerspectiveCamera> *info,
                                                const Shift::PropertyInformationCreateData &data)
  {
  auto childBlock = info->createChildrenBlock(data);

  auto proj = childBlock.overrideChild(&RCCamera::projection);
  proj->setCompute([](RCPerspectiveCamera *c)
    {
    c->projection.computeLock() = Eks::TransformUtilities::perspective(
      c->fieldOfView(),
      c->aspectRatio(),
      c->nearClip(),
      c->farClip());
    });

  auto affectsProj = childBlock.createAffects(&proj, 1);

  auto width = childBlock.overrideChild(&RCCamera::viewportWidth);
  width->setAffects(affectsProj, true);

  auto height = childBlock.overrideChild(&RCCamera::viewportHeight);
  height->setAffects(affectsProj, false);

  auto fov = childBlock.add(&RCPerspectiveCamera::fieldOfView, "fieldOfView");
  fov->setDefault(Eks::degreesToRadians(45.0f));
  fov->setAffects(affectsProj, false);

  auto nC = childBlock.add(&RCPerspectiveCamera::nearClip, "nearClip");
  nC->setDefault(0.1f);
  nC->setAffects(affectsProj, false);

  auto fC = childBlock.add(&RCPerspectiveCamera::farClip, "farClip");
  fC->setDefault(100.0f);
  fC->setAffects(affectsProj, false);
  }
开发者ID:jorj1988,项目名称:Shift,代码行数:35,代码来源:RCCamera.cpp

示例3: p

KEMailSettings::KEMailSettings()
    : p(new KEMailSettingsPrivate())
{
    p->m_sCurrentProfile.clear();

    p->m_pConfig = new KConfig(QStringLiteral("emaildefaults"));

    const QStringList groups = p->m_pConfig->groupList();
    for (QStringList::ConstIterator it = groups.begin(); it != groups.end(); ++it) {
        if ((*it).startsWith(QLatin1String("PROFILE_"))) {
            p->profiles += (*it).mid(8, (*it).length());
        }
    }

    KConfigGroup cg(p->m_pConfig, "Defaults");
    p->m_sDefaultProfile = cg.readEntry("Profile", tr("Default"));
    if (!p->m_sDefaultProfile.isNull()) {
        if (!p->m_pConfig->hasGroup(QStringLiteral("PROFILE_") + p->m_sDefaultProfile)) {
            setDefault(tr("Default"));
        } else {
            setDefault(p->m_sDefaultProfile);
        }
    } else {
        if (!p->profiles.isEmpty()) {
            setDefault(p->profiles[0]);
        } else {
            setDefault(tr("Default"));
        }
    }
    setProfile(defaultProfileName());
}
开发者ID:KDE,项目名称:kconfig,代码行数:31,代码来源:kemailsettings.cpp

示例4: updateDefaultButton

void WindowController::updateDefaultButton()
{
	if (mWindow->defaultButton()) {
		// Set new instance
		auto newDefaultButtonController = std::dynamic_pointer_cast<ButtonController>(findResourceById (mWindow->defaultButton().get()));
		if (newDefaultButtonController && (mDefaultId != newDefaultButtonController->getCommandId())) {
			// Deselect previous default button
			if (mDefaultId != -1) {
				auto oldDefaultButtonController = std::dynamic_pointer_cast<ButtonController>(MessageDispatcher::getInstance().getControllerById (mDefaultId));
				if (oldDefaultButtonController) {
					oldDefaultButtonController->setDefault (false);
				}
			}
			// Select new default button
			mDefaultId = newDefaultButtonController->getCommandId();
			newDefaultButtonController->setDefault (true);
			// Redraw window
			::InvalidateRect (mHWnd, NULL, TRUE);
		}
	} else {
		// Clear current instance
		if (mDefaultId != -1) {
			auto oldDefaultButtonController = std::dynamic_pointer_cast<ButtonController>(MessageDispatcher::getInstance().getControllerById (mDefaultId));
			oldDefaultButtonController->setDefault (false);
			mDefaultId = -1;
			// Redraw window
			::InvalidateRect (mHWnd, NULL, TRUE);
		}
	}
}
开发者ID:vcappello,项目名称:deved,代码行数:30,代码来源:window_controller.cpp

示例5: switch

void Daemon::processDisconnected( Channel dead ) {
    switch ( _state ) {
    case State::Leaving:
        break;
    case State::Supervising:
        NOTE();
        if ( _rope == dead )
            Logger::log( "working child died" );
        else
            Logger::log( "internal error happened - other connection than rope to the child has died" );
        setDefault();
        break;
    case State::Free:
    case State::Enslaved:
    case State::FormingGroup:
        NOTE();
        Logger::log( "closed connection to " + info( dead ) + " which is weird" );
        setDefault();
        break;
    case State::Running:
    case State::Grouped:
        NOTE();
        Logger::log( "closed connection to " + info( dead ) );
        ::exit( 0 );
    }
}
开发者ID:spito,项目名称:dp,代码行数:26,代码来源:daemon.cpp

示例6: setDefault

void
GpgServerModel::setDefault(const QString &server)
{
	if (server.isEmpty()) {
		setDefault(-1);
	} else {
		const int row = stringList().indexOf(server);
		Q_ASSERT(row >= 0);
		setDefault(row);
	}
}
开发者ID:KDE,项目名称:kgpg,代码行数:11,代码来源:gpgservermodel.cpp

示例7: addItem

    void RimWellPathCompletions::AutomaticWellShutInEnum::setUp()
    {
        addItem(RimWellPathCompletions::ISOLATE_FROM_FORMATION, "SHUT", "Isolate from Formation");
        addItem(RimWellPathCompletions::STOP_ABOVE_FORMATION, "STOP", "Stop above Formation");

        setDefault(RimWellPathCompletions::STOP_ABOVE_FORMATION);
    }
开发者ID:OPM,项目名称:ResInsight,代码行数:7,代码来源:RimWellPathCompletions.cpp

示例8: AfxMessageBox

void Prefs::open() {

    char *p=getenv( "blitzpath" );
    if( !p ) {
        AfxMessageBox( "blitzpath environment variable not found!",MB_TOPMOST|MB_SETFOREGROUND|MB_ICONINFORMATION );
        ExitProcess(0);
    }

    homeDir=p;

    AddFontResource( (homeDir+"/cfg/blitz.fon").c_str() );

    setDefault();

    bool prg_windowed;

    ifstream in( (homeDir+"/cfg/blitzide.prefs").c_str() );
    if( !in.good() ) return;

    while( !in.eof() ) {
        string t;
        in>>t;
        if( !t.size() ) continue;
        while( in.peek()=='\t' ) in.ignore();
        if( t=="prg_debug" ) in>>prg_debug;
        else if( t=="prg_lastbuild" ) getline( in,prg_lastbuild );
        else if( t=="prg_windowed" ) in>>prg_windowed;
        else if( t=="win_maximized" ) in>>win_maximized;
开发者ID:RubAlonso,项目名称:blitzplus,代码行数:28,代码来源:prefs.cpp

示例9: QDialog

ApplyChangesWidget::ApplyChangesWidget(QWidget* parent)
    : QDialog(parent), d(new ApplyChangesWidgetPrivate(this))
{
    setSizeGripEnabled(true);

    auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
    auto mainLayout = new QVBoxLayout(this);
    auto okButton = buttonBox->button(QDialogButtonBox::Ok);
    okButton->setDefault(true);
    okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
    connect(buttonBox, &QDialogButtonBox::accepted, this, &ApplyChangesWidget::accept);
    connect(buttonBox, &QDialogButtonBox::rejected, this, &ApplyChangesWidget::reject);

    QWidget* w=new QWidget(this);
    d->m_info=new QLabel(w);
    d->m_documentTabs = new QTabWidget(w);
    connect(d->m_documentTabs, &QTabWidget::currentChanged,
            this, &ApplyChangesWidget::indexChanged);

    QVBoxLayout* l = new QVBoxLayout(w);
    l->addWidget(d->m_info);
    l->addWidget(d->m_documentTabs);

    mainLayout->addWidget(w);
    mainLayout->addWidget(buttonBox);

    resize(QSize(800, 400));
}
开发者ID:KDE,项目名称:kdevplatform,代码行数:28,代码来源:applychangeswidget.cpp

示例10: addItem

void AppEnum<RicfExportVisibleCells::ExportKeyword>::setUp()
{
    addItem(RicfExportVisibleCells::FLUXNUM, "FLUXNUM", "FLUXNUM");
    addItem(RicfExportVisibleCells::MULTNUM, "MULTNUM", "MULTNUM");

    setDefault(RicfExportVisibleCells::FLUXNUM);
}
开发者ID:OPM,项目名称:ResInsight,代码行数:7,代码来源:RicfExportVisibleCells.cpp

示例11: addItem

    void caf::AppEnum< RimDefines::DepthUnitType >::setUp()
    {
        addItem(RimDefines::UNIT_METER,  "UNIT_METER",   "Meter");
        addItem(RimDefines::UNIT_FEET,   "UNIT_FEET",    "Feet");

        setDefault(RimDefines::UNIT_METER);
    }
开发者ID:atgeirr,项目名称:ResInsight,代码行数:7,代码来源:RimDefines.cpp

示例12: setDefault

void Settings::load(QSettings *settings)
{
    setDefault();

    settings->beginGroup(QLatin1String(Constants::SETTINGS_GROUP));

    scanningScope = static_cast<ScanningScope>(settings->value(QLatin1String(Constants::SCANNING_SCOPE),
        ScanningScopeCurrentFile).toInt());

    KeywordList newKeywords;
    const int keywordsSize = settings->beginReadArray(QLatin1String(Constants::KEYWORDS_LIST));
    if (keywordsSize > 0) {
        const QString nameKey = QLatin1String("name");
        const QString colorKey = QLatin1String("color");
        const QString iconResourceKey = QLatin1String("iconResource"); // Legacy since 3.7 TODO: remove in 4.0
        const QString iconTypeKey = QLatin1String("iconType");
        for (int i = 0; i < keywordsSize; ++i) {
            settings->setArrayIndex(i);
            Keyword keyword;
            keyword.name = settings->value(nameKey).toString();
            keyword.color = settings->value(colorKey).value<QColor>();
            keyword.iconType = settings->contains(iconTypeKey) ?
                        static_cast<IconType>(settings->value(iconTypeKey).toInt())
                      : resourceToTypeKey(settings->value(iconResourceKey).toString());
            newKeywords << keyword;
        }
        keywords = newKeywords;
    }
    settings->endArray();

    settings->endGroup();
}
开发者ID:qrsrjm,项目名称:qt-creator,代码行数:32,代码来源:settings.cpp

示例13: setDefault

void Settings::load(QSettings *settings)
{
    setDefault();

    settings->beginGroup(QLatin1String(Constants::SETTINGS_GROUP));

    scanningScope = static_cast<ScanningScope>(settings->value(QLatin1String(Constants::SCANNING_SCOPE),
        scanningScope).toInt());

    KeywordList newKeywords;
    const int size = settings->beginReadArray(QLatin1String(Constants::KEYWORDS_LIST));
    if (size > 0) {
        const QString nameKey = QLatin1String("name");
        const QString colorKey = QLatin1String("color");
        const QString iconResourceKey = QLatin1String("iconResource");
        for (int i = 0; i < size; ++i) {
            settings->setArrayIndex(i);
            Keyword keyword;
            keyword.name = settings->value(nameKey).toString();
            keyword.color = settings->value(colorKey).value<QColor>();
            keyword.iconResource = settings->value(iconResourceKey).toString();
            newKeywords << keyword;
        }
        keywords = newKeywords;
    }
    settings->endArray();

    settings->endGroup();
}
开发者ID:ProDataLab,项目名称:qt-creator,代码行数:29,代码来源:settings.cpp

示例14: addItem

void caf::AppEnum< RigFemResultPosEnum >::setUp()
{
    addItem(RIG_NODAL,            "NODAL",            "Nodal");
    addItem(RIG_ELEMENT_NODAL,    "ELEMENT_NODAL",    "Element Nodal");
    addItem(RIG_INTEGRATION_POINT,"INTEGRATION_POINT","Integration Point");
    setDefault(RIG_NODAL);
}
开发者ID:atgeirr,项目名称:ResInsight,代码行数:7,代码来源:RimGeoMechResultDefinition.cpp

示例15: ParserItem

 ParserIntItem::ParserIntItem(const Json::JsonObject& jsonConfig) : ParserItem(jsonConfig)
 {
     if (jsonConfig.has_item("default")) 
         setDefault( jsonConfig.get_int("default") );
     else
         m_default = defaultInt();
 }
开发者ID:AtleH,项目名称:opm-parser,代码行数:7,代码来源:ParserIntItem.cpp


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