• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setLanguage函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: setLanguage

	const char* CLocale::getLanguage()
	{
		if (s_strSysLanguage.size() == 0)
		{
#ifdef SCUT_IPHONE
			setLanguage(ScutUtility::getIphoneSysLanguage().c_str());
#endif

#ifdef SCUT_ANDROID
			char * p = getLanguageJNI();
			if (p)
			{
				setLanguage(p);
				free(p);
			}
#endif
#ifdef SCUT_WIN32
			if (s_strSysLanguage.size() == 0)
			{
				s_strSysLanguage = "zh_CN";
			}
#endif
		}

		return s_strSysLanguage.c_str();
	}
开发者ID:109383670,项目名称:Scut,代码行数:26,代码来源:ScutLocale.cpp


示例2: setLanguage

// Try to guess if a *.h file is C or C++, return FALSE if file is not *.h, TRUE otherwise.
bool SciDoc::SetLanguageForHeader(const FXString &fn)
{
  if (FXPath::extension(fn)=="h") {
    FXString fnbase=FXPath::stripExtension(fn);
    // Check for matching source file and set language accordingly if found...
    if (FXStat::exists(fnbase+".c")) {
      setLanguage("c");
    } else if (FXStat::exists(fnbase+".cpp")||FXStat::exists(fnbase+".cxx")||FXStat::exists(fnbase+".cc")) {
      setLanguage("cpp");
    } else {
      // Take a wild guess - if the file contains the word "class" it's probably  C++
      const char *content=(const char*)(sendMessage(SCI_GETCHARACTERPOINTER,0,0));
#ifdef FOX_1_7_50_OR_NEWER
      if (FXRex("\\<class\\>").search(content,strlen(content),0,strlen(content))>=0) {
#else
      if (FXRex("\\<class\\>").match(content)) {
#endif
        setLanguage("cpp");
      } else {
        setLanguage("c");
      }
    }
    return true;
  } else {
    return false;
开发者ID:yetanothergeek,项目名称:fxite,代码行数:26,代码来源:scidoc.cpp


示例3: QApplication

MisliDesktopGui::MisliDesktopGui(int argc, char *argv[]) :
    QApplication(argc,argv)
{
    QWidget dummyWidget; //so I can use the static functions below
    misliWindow = NULL;
    translator = NULL;
    clearSettingsOnExit = false;

    int user_reply;

    //Set some creditentials
    setQuitOnLastWindowClosed(false);
    setOrganizationName("p10"); //this is needed for proper settings access in windows
    setApplicationName("misli");
    setApplicationVersion("2.0.0");

    //Construct the splash screen
    splash = new QSplashScreen(QPixmap(":/img/icon.png"));
    splash->show();

    //Init the settings
    settings = new QSettings;

    //Check if there's a series of failed starts and suggest clearing the settings
    if(failedStarts()>=2){
        user_reply = QMessageBox::question(&dummyWidget,tr("Warning"),tr("There have been two unsuccessful starts of the program. Clearing the program settings will probably solve the issue . Persistent program crashes are mostly caused by corrupted notefiles , so you can try to manually narrow out the problematic notefile (remove the notefiles from the work directories one by one). The last one edited is probably the problem (you can try to correct it manually with a text editor to avoid loss of data).\n Do you want to clear the settings?"));

        if(user_reply==QMessageBox::Ok){ //if the user pressed Ok
            settings->clear();
            settings->sync();
            exit(0);
        }
    }
    //Assume we won't start successfully , if we do - the value gets -1-ed on close
    setFailedStarts(failedStarts()+1);

    if(firstProgramStart()){
        QString newLanguage = QInputDialog::getItem(&dummyWidget,tr("Set the language"),tr("Language:/Език:"),QStringList()<<"English"<<"Български",0,false);
        if(newLanguage=="English") setLanguage("en");
        if(newLanguage=="Български") setLanguage("bg");
    }

    updateTranslator();

    //Construct the misli instance class
    misliInstance = new MisliInstance(false);

    //Connections
    connect(this,SIGNAL(languageChanged(QString)),this,SLOT(updateTranslator()));
    connect(this,SIGNAL(aboutToQuit()),this,SLOT(stuffToDoBeforeQuitting()));

    //Start worker thread as soon as the main loop starts (so that we first show the splash screen and then start work)
    workerThread.start();
    misliInstance->loadStoredDirs();
    misliWindow = new MisliWindow(this);
    splash->finish(misliWindow);
    misliWindow->showMaximized();
}
开发者ID:petko10,项目名称:misli,代码行数:58,代码来源:mislidesktopgui.cpp


示例4: setLanguage

void LanguageTag::setBcp47(const string & bcp) {
	size_t splitPos = bcp.find("-x-");
	if (splitPos != string::npos) {
		setLanguage(bcp.substr(0, splitPos));
		setPrivateUse(bcp.substr(splitPos + 2));
	}
	else {
		setLanguage(bcp);
	}
}
开发者ID:komu,项目名称:corevoikko,代码行数:10,代码来源:LanguageTag.cpp


示例5: Info

// ---------------------------------------------------
void TextDoc::setLanguage (const QString& FileName)
{
  QFileInfo Info (FileName);
  QString ext = Info.extension (false);
  if (ext == "vhd" || ext == "vhdl")
    setLanguage (LANG_VHDL);
  else if (ext == "v")
    setLanguage (LANG_VERILOG);
  else if (ext == "va")
    setLanguage (LANG_VERILOGA);
  else if (ext == "m" || ext == "oct")
    setLanguage (LANG_OCTAVE);
  else
    setLanguage (LANG_NONE);
}
开发者ID:AMDmi3,项目名称:qucs,代码行数:16,代码来源:textdoc.cpp


示例6: setLanguage

void DialogOptions::saveOptions()
{
    setLanguage();
    setOverwriteMode();

    close();
}
开发者ID:lukeandrew,项目名称:Converseen,代码行数:7,代码来源:dialogoptions.cpp


示例7: saveSettings

/*!
 * \brief TextDoc::save saves the current document and it settings
 * \return true/false if the document was opened with success
 */
int TextDoc::save ()
{
  saveSettings ();

  QFile file (DocName);
  if (!file.open (QIODevice::WriteOnly))
    return -1;
  setLanguage (DocName);

  QTextStream stream (&file);
  stream << toPlainText();
  document()->setModified (false);
  slotSetChanged ();
  file.close ();

  QFileInfo Info (DocName);
  lastSaved = Info.lastModified ();

  /// clear highlighted lines on save \see MessageDock::slotCursor()
  QList<QTextEdit::ExtraSelection> extraSelections;
  this->setExtraSelections(extraSelections);
  refreshLanguage();

  return 0;
}
开发者ID:NextGenIntelligence,项目名称:qucs,代码行数:29,代码来源:textdoc.cpp


示例8: AntlrInput

/* Use lookahead=2 */
Smt2Input::Smt2Input(AntlrInputStream& inputStream, InputLanguage lang) :
  AntlrInput(inputStream, 2) {

  pANTLR3_INPUT_STREAM input = inputStream.getAntlr3InputStream();
  assert( input != NULL );

  d_pSmt2Lexer = Smt2LexerNew(input);
  if( d_pSmt2Lexer == NULL ) {
    throw ParserException("Failed to create SMT2 lexer.");
  }

  setAntlr3Lexer( d_pSmt2Lexer->pLexer );

  pANTLR3_COMMON_TOKEN_STREAM tokenStream = getTokenStream();
  assert( tokenStream != NULL );

  d_pSmt2Parser = Smt2ParserNew(tokenStream);
  if( d_pSmt2Parser == NULL ) {
    throw ParserException("Failed to create SMT2 parser.");
  }

  setAntlr3Parser(d_pSmt2Parser->pParser);

  setLanguage(lang);
}
开发者ID:jinala,项目名称:CVC4,代码行数:26,代码来源:smt2_input.cpp


示例9: Q_D

//! \brief SpellChecker::setLanguage switches to the given language if possible
//! \param language The new language use "en" or "en_US". If more than one
//! exists, the first one in the directory listing is used
//! \return true if switching the language succeded
bool SpellChecker::setLanguage(const QString &language)
{
    Q_D(SpellChecker);

    qDebug() << "spellechecker.cpp in setLanguage() lang=" << language << "dictPath=" << dictPath();

    QDir dictDir(dictPath());
    QStringList affMatches = dictDir.entryList(QStringList(language+"*.aff"));
    QStringList dicMatches = dictDir.entryList(QStringList(language+"*.dic"));

    if (affMatches.isEmpty() || dicMatches.isEmpty()) {
        QString lang = language;
        lang.truncate(2);
        qWarning() << "Did not find a dictionary for" << language << " - checking for " << lang;
        if (language.length() > 2) {
            return setLanguage(lang);
        }

        qWarning() << "No dictionary found for" << language << "turning off spellchecking";
        d->clear();
        return false;
    }

    d->aff_file = dictPath() + "/" + affMatches[0];
    d->dic_file = dictPath() + "/" + dicMatches[0];

    qDebug() << "spellechecker.cpp in setLanguage() aff_file=" << d->aff_file << "dic_file=" << d->dic_file;

    if (enabled()) {
        setEnabled(false);
        return setEnabled(true);
    } else {
        return true;
    }
}
开发者ID:Herrie82,项目名称:webos-keyboard,代码行数:39,代码来源:spellchecker.cpp


示例10: QObject

App::App(QObject *parent) :
    QObject(parent)
{
    Controller *controller = new Controller(this);
    MainWindow *mw = new MainWindow(0);
    mw->hide();

    if (!controller->initAR()) {
        mw->error(tr("Unable to find any usable cameras. "
                  "Check if they are connected"), tr("Camera error"));
        QApplication::quit();
    }

    mw->showFullScreen();
    connect(controller, SIGNAL(setStatus(IplImage*,IplImage*,QList<Model3D*>*)),
            mw, SLOT(setStatus(IplImage*,IplImage*,QList<Model3D*>*)));
    connect(controller, SIGNAL(refresh(int,int)),
            mw, SLOT(refreshValues(int,int)));

    connect(mw, SIGNAL(languageChanged(QLocale::Language)),
            controller, SLOT(setLanguage(QLocale::Language)));
    connect(mw, SIGNAL(nextCamera()),
            controller, SLOT(nextCamera()));
    connect(mw, SIGNAL(toggleDebug()),
            controller, SLOT(toggleDebug()));

}
开发者ID:timakima,项目名称:arteacher,代码行数:27,代码来源:app.cpp


示例11: setLanguage

// let the "programming language" for a group depend on what is inserted into it.
// First item that has an associated languages determines the language for the whole group.
void GroupDef::updateLanguage(const Definition *d)
{
  if (getLanguage()==SrcLangExt_Unknown && d->getLanguage()!=SrcLangExt_Unknown)
  {
    setLanguage(d->getLanguage());
  }
}
开发者ID:wufengyi,项目名称:doxygen,代码行数:9,代码来源:groupdef.cpp


示例12: while

// Parse emacs modeline
FXbool Modeline::parseEmacsModeline(const FXchar* s){
  FXString key;
  FXString val;
  while(*s!='\0'){
    while(*s==';' || *s=='\t' || *s==' ') s++;
    if(*s=='\0' || (*s=='-' && *(s+1)=='*' && *(s+2)=='-')) break;
    key=FXString::null;
    val=FXString::null;
    while(*s!='\0' && *s!=':' && *s!=';' && *s!='\t' && *s!=' '){
      key+=*s++;
      }
    while(*s=='\t' || *s==' ') s++;
    if(*s=='\0') break;
    if(*s!=':') continue;
    s++;
    while(*s=='\t' || *s==' ') s++;
    if(*s=='\0') break;
    while(*s!='\0' && *s!=';' &&  *s!='\t' && *s!=' '){
      val+=*s++;
      }
    if(comparecase(key,"Mode")==0){
      setLanguage(val);
      }
    else if(key=="tab-width"){
      setTabWidth(val.toInt());
      }
    else if(key=="indent-tabs-mode"){
      setTabMode(val=="nil");
      }
    else if(key=="autowrap"){
      setWrapMode(val!="nil");
      }
    }
  return true;
  }
开发者ID:gogglesguy,项目名称:fox,代码行数:36,代码来源:Modeline.cpp


示例13: WContainerWidget

FormExample::FormExample()
    : WContainerWidget()
{
  WContainerWidget *langLayout = this->addWidget(cpp14::make_unique<WContainerWidget>());
  langLayout->setContentAlignment(AlignmentFlag::Right);
  langLayout->addWidget(cpp14::make_unique<WText>(tr("language")));

  const char *lang[] = { "en", "nl" };

  for (int i = 0; i < 2; ++i) {
    WText *t = langLayout->addWidget(cpp14::make_unique<WText>(lang[i]));
    t->setMargin(5);
    t->clicked().connect(std::bind(&FormExample::changeLanguage, this, t));

    languageSelects_.push_back(t);
  }

  /*
   * Start with the reported locale, if available
   */
  setLanguage(wApp->locale().name());

  Form *form = this->addWidget(cpp14::make_unique<Form>());
  form->setMargin(20);
}
开发者ID:AlexanderKotliar,项目名称:wt,代码行数:25,代码来源:FormExample.C


示例14: QTranslator

Country::Country(LANGUAGES lang)
{
    m_Linguist = new QTranslator();

    setLanguage(lang);

}
开发者ID:BTS2-Projet-1,项目名称:BTS2-Projet-1_Deploiment,代码行数:7,代码来源:country.cpp


示例15: setLanguage

/// Updates font settings according to request
void Font::update(Font const & newfont,
		     Language const * document_language,
		     bool toggleall)
{
	bits_.update(newfont.fontInfo(), toggleall);

	if (newfont.language() == language() && toggleall)
		if (language() == document_language)
			setLanguage(default_language);
		else
			setLanguage(document_language);
	else if (newfont.language() == reset_language)
		setLanguage(document_language);
	else if (newfont.language() != ignore_language)
		setLanguage(newfont.language());
}
开发者ID:hashinisenaratne,项目名称:HSTML,代码行数:17,代码来源:Font.cpp


示例16: init18N

void init18N(int argc, char *argv[])
{
	int i;
	int languageId = -1;

	setlocale(LC_NUMERIC, "");

	for (i = 1 ; i < argc ; i++)
	{
		if (strcmp(argv[i], "-language") == 0)
		{
			languageId = i + 1;

			if (languageId >= argc)
			{
				SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_ERROR, "You must specify a language to use with -language. Using default.");
			}
		}
	}

	setLanguage("tbftss", languageId == -1 ? NULL : argv[languageId]);

	SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "Numeric is %s", setlocale(LC_NUMERIC, "C"));
	SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "atof(2.75) is %f", atof("2.75"));
}
开发者ID:stephenjsweeney,项目名称:tbftss,代码行数:25,代码来源:init.c


示例17: dir

void Cutegram::init_languages()
{
    QDir dir(p->translationsPath);
    QStringList languages = dir.entryList( QDir::Files );
    if( !languages.contains("lang-en.qm") )
        languages.prepend("lang-en.qm");

    for( int i=0 ; i<languages.size() ; i++ )
    {
        QString locale_str = languages[i];
        locale_str.truncate( locale_str.lastIndexOf('.') );
        locale_str.remove( 0, locale_str.indexOf('-') + 1 );

        QLocale locale(locale_str);

        QString  lang = QString("%1 (%2)").arg(QLocale::languageToString(locale.language()), QLocale::countryToString(locale.country()));
        QVariant data = p->translationsPath + "/" + languages[i];

        p->languages.insert( lang, data );
        p->locales.insert( lang , locale );

        if( lang == AsemanApplication::settings()->value("General/Language","English (UnitedStates)").toString() )
            setLanguage( lang );
    }
}
开发者ID:zafisoft,项目名称:Cutegram,代码行数:25,代码来源:cutegram.cpp


示例18: m_textEdit

SpellChecker::SpellChecker(QTextEdit *textEdit): m_textEdit(textEdit)
{
    m_regExp = new QRegExp("[^\\s]*");
    //m_cursor= new QTextCursor(m_textEdit->document());
    spell_config1 = new_aspell_config();
    spell_config2 = new_aspell_config();
    aspell_config_replace(spell_config1, "lang", m_lang1.toAscii());
    aspell_config_replace(spell_config2, "lang", m_lang2.toAscii());
    aspell_config_replace(spell_config1, "encoding", "utf-8");
    aspell_config_replace(spell_config2, "encoding", "utf-8");
    m_map = new StringMap();
    m_map->insert("ara", "ar");
    m_map->insert("ruseng", "ru");
    m_map->insert("rus", "ru");
    m_map->insert("bul", "bg");
    m_map->insert("cze", "cs");
    m_map->insert("dan", "da");
    m_map->insert("dut", "nl");
    m_map->insert("nld", "nl");
    m_map->insert("ell", "el");
    m_map->insert("eng", "en");
    m_map->insert("est", "et");
    m_map->insert("fin", "fi");
    m_map->insert("fra", "fr");
    m_map->insert("ger", "de");
    m_map->insert("deu", "de");
    m_map->insert("deu-frak", "de-alt");
    m_map->insert("heb", "he");
    m_map->insert("hin", "hi");
    m_map->insert("hrv", "hr");
    m_map->insert("hun", "hu");
    m_map->insert("ind", "in");
    m_map->insert("isl", "is");
    m_map->insert("ita", "it");
    m_map->insert("lav", "lv");
    m_map->insert("lit", "lt");
    m_map->insert("mkd", "mk");
    m_map->insert("msa", "ms");
    m_map->insert("nor", "no");
    m_map->insert("pol", "pl");
    m_map->insert("por", "pt_PT");
    m_map->insert("rum", "ro");
    //m_map->insert("rus", "ru");
    m_map->insert("ron", "ro");
    m_map->insert("slo", "sl");
    m_map->insert("slk", "sk");
    m_map->insert("spa", "es");
    m_map->insert("srp", "sr");
    m_map->insert("swa", "sw");
    m_map->insert("swe", "sv");
    m_map->insert("swef", "sv");
    m_map->insert("tur", "tr");
    m_map->insert("ukr", "uk");
    m_map->insert("vie", "vi");
    spell_checker1 = 0;
    spell_checker2 = 0;
    setLanguage("ruseng");
    dictList = new QStringList();
}
开发者ID:sibskull,项目名称:yagf,代码行数:59,代码来源:spellchecker.cpp


示例19: setSelected

void VideoTrackPrivateAVFObjC::resetPropertiesFromTrack()
{
    setSelected(m_impl->enabled());
    setKind(m_impl->videoKind());
    setId(m_impl->id());
    setLabel(m_impl->label());
    setLanguage(m_impl->language());
}
开发者ID:ZeusbaseWeb,项目名称:webkit,代码行数:8,代码来源:VideoTrackPrivateAVFObjC.cpp


示例20: getLanguage

/**
 *
 *
 *  @author FloSoft
 */
const std::string Languages::setLanguage(unsigned int i)
{
    const Language l = getLanguage(i);

    setLanguage(l.code);

    return l.code;
}
开发者ID:lweberk,项目名称:s25client,代码行数:13,代码来源:languages.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setLastError函数代码示例发布时间:2022-05-30
下一篇:
C++ setLabelText函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap