本文整理汇总了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;
}
示例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);
}
示例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());
}
示例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);
}
}
}
示例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 );
}
}
示例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);
}
}
示例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);
}
示例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;
示例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));
}
示例10: addItem
void AppEnum<RicfExportVisibleCells::ExportKeyword>::setUp()
{
addItem(RicfExportVisibleCells::FLUXNUM, "FLUXNUM", "FLUXNUM");
addItem(RicfExportVisibleCells::MULTNUM, "MULTNUM", "MULTNUM");
setDefault(RicfExportVisibleCells::FLUXNUM);
}
示例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);
}
示例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();
}
示例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();
}
示例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);
}
示例15: ParserItem
ParserIntItem::ParserIntItem(const Json::JsonObject& jsonConfig) : ParserItem(jsonConfig)
{
if (jsonConfig.has_item("default"))
setDefault( jsonConfig.get_int("default") );
else
m_default = defaultInt();
}