您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ FROM_UTF8函数代码示例

51自学网 2021-06-01 20:43:13
  C++
这篇教程C++ FROM_UTF8函数代码示例写得很实用,希望能帮到您。

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

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

示例1: FROM_UTF8

void CVPCB_MAINFRAME::refreshAfterComponentSearch( COMPONENT* component ){    // Tell AuiMgr that objects are changed !    if( m_auimgr.GetManagedWindow() )   // Be sure Aui Manager is initialized                                        // (could be not the case when starting CvPcb        m_auimgr.Update();    if( component == NULL )        return;    // Preview of the already assigned footprint.    // Find the footprint that was already chosen for this component and select it,    // but only if the selection is made from the component list or the library list.    // If the selection is made from the footprint list, do not change the current    // selected footprint.    if( FindFocus() == m_compListBox || FindFocus() == m_libListBox )    {        wxString module = FROM_UTF8( component->GetFPID().Format().c_str() );        bool found = false;        for( int ii = 0; ii < m_footprintListBox->GetCount(); ii++ )        {            wxString footprintName;            wxString msg = m_footprintListBox->OnGetItemText( ii, 0 );            msg.Trim( true );            msg.Trim( false );            footprintName = msg.AfterFirst( wxChar( ' ' ) );            if( module.Cmp( footprintName ) == 0 )            {                m_footprintListBox->SetSelection( ii, true );                found = true;                break;            }        }        if( !found )        {            int ii = m_footprintListBox->GetSelection();            if ( ii >= 0 )                m_footprintListBox->SetSelection( ii, false );            if( GetFootprintViewerFrame() )            {                CreateScreenCmp();            }        }    }    SendMessageToEESCHEMA();    DisplayStatus();}
开发者ID:chgans,项目名称:kicad,代码行数:54,


示例2: DisplayInfoMessage

MODULE* DISPLAY_FOOTPRINTS_FRAME::Get_Module( const wxString& aFootprintName ){    MODULE* footprint = NULL;    try    {        FPID fpid;        if( fpid.Parse( aFootprintName ) >= 0 )        {            DisplayInfoMessage( this, wxString::Format( wxT( "Footprint ID <%s> is not valid." ),                                                        GetChars( aFootprintName ) ) );            return NULL;        }        std::string nickname = fpid.GetLibNickname();        std::string fpname   = fpid.GetFootprintName();        wxLogDebug( wxT( "Load footprint <%s> from library <%s>." ),                    fpname.c_str(), nickname.c_str()  );        footprint = Prj().PcbFootprintLibs()->FootprintLoad(                FROM_UTF8( nickname.c_str() ), FROM_UTF8( fpname.c_str() ) );    }    catch( const IO_ERROR& ioe )    {        DisplayError( this, ioe.errorText );        return NULL;    }    if( footprint )    {        footprint->SetParent( (EDA_ITEM*) GetBoard() );        footprint->SetPosition( wxPoint( 0, 0 ) );        return footprint;    }    wxString msg = wxString::Format( _( "Footprint '%s' not found" ), aFootprintName.GetData() );    DisplayError( this, msg );    return NULL;}
开发者ID:grtwall,项目名称:kicad-source-mirror,代码行数:41,


示例3: CopasiWidget

/* *  Constructs a CQSpeciesDetail which is a child of 'parent', with the *  name 'name'.' */CQSpeciesDetail::CQSpeciesDetail(QWidget* parent, const char* name) :    CopasiWidget(parent, name),    mChanged(false),    mInitialNumberLastChanged(true),    mpMetab(NULL),    mpCurrentCompartment(NULL),    mItemToType(),    mInitialNumber(0.0),    mInitialConcentration(0.0),    mExpressionValid(false),    mInitialExpressionValid(false){  setupUi(this);  mpComboBoxType->insertItem(FROM_UTF8(CModelEntity::StatusName[CModelEntity::REACTIONS]));  mpComboBoxType->insertItem(FROM_UTF8(CModelEntity::StatusName[CModelEntity::FIXED]));  mpComboBoxType->insertItem(FROM_UTF8(CModelEntity::StatusName[CModelEntity::ASSIGNMENT]));  mpComboBoxType->insertItem(FROM_UTF8(CModelEntity::StatusName[CModelEntity::ODE]));  mItemToType.push_back(CModelEntity::REACTIONS);  mItemToType.push_back(CModelEntity::FIXED);  mItemToType.push_back(CModelEntity::ASSIGNMENT);  mItemToType.push_back(CModelEntity::ODE);//  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);//  int Width = fontMetrics().width("Concentration (" +//                                  FROM_UTF8((*CCopasiRootContainer::getDatamodelList())[0]->getModel()->getConcentrationUnitsDisplayString()) +//                                  ")");////  mpLblValue->setMinimumWidth(Width);  mpExpressionEMW->mpExpressionWidget->setExpressionType(CQExpressionWidget::TransientExpression);  mpInitialExpressionEMW->mpExpressionWidget->setExpressionType(CQExpressionWidget::InitialExpression);  mpReactionTable->verticalHeader()->hide();  mpReactionTable->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);  mpReactionTable->horizontalHeader()->hide();  mpReactionTable->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);}
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:45,


示例4: while

bool SCH_BUS_ENTRY_BASE::Load( LINE_READER& aLine, wxString& aErrorMsg,                               SCH_ITEM **out ){    char Name1[256];    char Name2[256];    char* line = (char*) aLine;    *out = NULL;    while( (*line != ' ' ) && *line )        line++;    if( sscanf( line, "%255s %255s", Name1, Name2 ) != 2  )    {        aErrorMsg.Printf( wxT( "Eeschema file bus entry load error at line %d" ),                          aLine.LineNumber() );        aErrorMsg << wxT( "/n" ) << FROM_UTF8( (char*) aLine );        return false;    }    SCH_BUS_ENTRY_BASE *this_new;    if( Name1[0] == 'B' )        this_new = new SCH_BUS_BUS_ENTRY;    else        this_new = new SCH_BUS_WIRE_ENTRY;    *out = this_new;    if( !aLine.ReadLine() || sscanf( (char*) aLine, "%d %d %d %d ",                &this_new->m_pos.x, &this_new->m_pos.y,                &this_new->m_size.x, &this_new->m_size.y ) != 4 )    {        aErrorMsg.Printf( wxT( "Eeschema file bus entry load error at line %d" ),                          aLine.LineNumber() );        aErrorMsg << wxT( "/n" ) << FROM_UTF8( (char*) aLine );        return false;    }    this_new->m_size.x -= this_new->m_pos.x;    this_new->m_size.y -= this_new->m_pos.y;    return true;}
开发者ID:RyuKojiro,项目名称:kicad-source-mirror,代码行数:41,


示例5: Files

void CQExperimentData::slotFileAdd(){  QString File =    CopasiFileDialog::getOpenFileName(this,                                      "Open File Dialog",                                      "",                                      "Data Files (*.txt *.csv);;All Files (*)",                                      "Open Data Files");  if (File.isNull()) return;  std::map<std::string, std::string>::const_iterator it = mFileMap.begin();  std::map<std::string, std::string>::const_iterator end = mFileMap.end();  int i;  for (; it != end; ++it)    if (it->second == TO_UTF8(File))      {        for (i = 0; i < mpBoxFile->count(); i++)          if (it->first == TO_UTF8(mpBoxFile->item(i)->text()))            {              mpBoxFile->setCurrentRow(i);              break;            }        return;      }  std::string FileName = CDirEntry::fileName(TO_UTF8(File));  i = 0;  while (mFileMap.find(FileName) != mFileMap.end())    FileName = StringPrint("%s_%d", CDirEntry::fileName(TO_UTF8(File)).c_str(), i++);  mFileMap[FileName] = TO_UTF8(File);  mpBoxFile->addItem(FROM_UTF8(FileName));  mpBoxFile->setCurrentRow(mpBoxFile->count() - 1);  size_t First, Last;  if (mpFileInfo->getFirstUnusedSection(First, Last))    {      do        {          slotExperimentAdd();        }      while (mpBtnExperimentAdd->isEnabled());      mpBoxExperiment->setCurrentRow(0);    }}
开发者ID:sachiinb,项目名称:COPASI,代码行数:53,


示例6: setAxisTitle

void CopasiPlot::setAxisUnits(const C_INT32 & index,                              const CCopasiObject * pObject){  if (pObject == NULL) return;  std::string Units = pObject->getUnits();  if (Units != "")    setAxisTitle(index, FROM_UTF8(Units));  return;}
开发者ID:bmoreau,项目名称:COPASI,代码行数:12,


示例7: QVariant

QVariant CQReferenceDM::data(const QModelIndex &index, int role) const{  if (!index.isValid())    return QVariant();  if (index.row() >= rowCount())    return QVariant();  if (role == Qt::DisplayRole || role == Qt::EditRole)    {      if (isDefaultRow(index))        {          if (index.column() == COL_RESOURCE_REFERENCE)            return QVariant(QString("-- select --"));          else if (index.column() == COL_ROW_NUMBER)            return QVariant(QString(""));          else            return QVariant(QString(""));        }      else        {          switch (index.column())            {              case COL_ROW_NUMBER:                return QVariant(index.row() + 1);              case COL_RESOURCE_REFERENCE:                return QVariant(QString(FROM_UTF8(mpMIRIAMInfo->getReferences()[index.row()].getResource())));              case COL_ID_REFERENCE:                return QVariant(QString(FROM_UTF8(mpMIRIAMInfo->getReferences()[index.row()].getId())));              case COL_DESCRIPTION:                return QVariant(QString(FROM_UTF8(mpMIRIAMInfo->getReferences()[index.row()].getDescription())));            }        }    }  return QVariant();}
开发者ID:jonasfoe,项目名称:COPASI,代码行数:40,


示例8: assert

// virtualvoid CScanWidgetScan::load(const CCopasiParameterGroup * pItem){  if (pItem == NULL) return;  *mpData = *pItem;  void * tmp;  if (!(tmp = mpData->getValue("Type").pVOID)) return;  CScanProblem::Type type = *(CScanProblem::Type*)tmp;  if (type != CScanProblem::SCAN_LINEAR)    return;  if (!(tmp = mpData->getValue("Number of steps").pVOID)) return;  lineEditNumber->setText(QString::number(*(C_INT32*)tmp));  if (!(tmp = mpData->getValue("Object").pVOID)) return;  std::string tmpString = *(std::string*)tmp;  if (tmpString == "")    mpObject = NULL;  else    {      assert(CCopasiRootContainer::getDatamodelList()->size() > 0);      CCopasiDataModel* pDataModel = (*CCopasiRootContainer::getDatamodelList())[0];      assert(pDataModel != NULL);      mpObject = pDataModel->getDataObject(tmpString);    }  if (mpObject)    lineEditObject->setText(FROM_UTF8(mpObject->getObjectDisplayName()));  else    lineEditObject->setText("");  if (!(tmp = mpData->getValue("Minimum").pVOID)) return;  lineEditMin->setText(QString::number(*(C_FLOAT64*)tmp));  if (!(tmp = mpData->getValue("Maximum").pVOID)) return;  lineEditMax->setText(QString::number(*(C_FLOAT64*)tmp));  if (!(tmp = mpData->getValue("log").pVOID)) return;  checkBoxLog->setChecked(*(bool*)tmp);  return;}
开发者ID:PriKalra,项目名称:COPASI,代码行数:53,


示例9: load

void CQCompartment::load(){  if (mpCompartment == NULL) return;  //Dimensionality  mpComboBoxDim->setCurrentIndex(mpCompartment->getDimensionality());  // slotDimesionalityChanged(mpCompartment->getDimensionality());  // Simulation Type  mpComboBoxType->setCurrentIndex(mpComboBoxType->findText(FROM_UTF8(CModelEntity::StatusName[mpCompartment->getStatus()])));  // Initial Volume  mpEditInitialVolume->setText(convertToQString(mpCompartment->getInitialValue()));  // Transient Volume  mpEditCurrentVolume->setText(convertToQString(mpCompartment->getValue()));  // Concentration Rate  mpEditRate->setText(convertToQString(mpCompartment->getRate()));  // Expression  mpExpressionEMW->mpExpressionWidget->setExpression(mpCompartment->getExpression());  mpExpressionEMW->updateWidget();  // Initial Expression  mpInitialExpressionEMW->mpExpressionWidget->setExpression(mpCompartment->getInitialExpression());  mpInitialExpressionEMW->updateWidget();  // Noise Expression  mpNoiseExpressionWidget->mpExpressionWidget->setExpression(mpCompartment->getNoiseExpression());  mpNoiseExpressionWidget->updateWidget();  mpBoxAddNoise->setChecked(mpCompartment->hasNoise());  // Type dependent display of values  slotTypeChanged(mpComboBoxType->currentText());  // Use Initial Expression  if (mpCompartment->getStatus() == CModelEntity::Status::ASSIGNMENT ||      mpCompartment->getInitialExpression() == "")    {      mpBoxUseInitialExpression->setChecked(false);    }  else    {      mpBoxUseInitialExpression->setChecked(true);    }  loadMetaboliteTable();  mChanged = false;  return;}
开发者ID:copasi,项目名称:COPASI,代码行数:52,


示例10: load

void CQModelWidget::load(){  if (mpModel == NULL)    return;  mpComboTimeUnit->setCurrentIndex(mpComboTimeUnit->findText(FROM_UTF8(mpModel->getTimeUnitName())));  mpComboVolumeUnit->setCurrentIndex(mpComboVolumeUnit->findText(FROM_UTF8(mpModel->getVolumeUnitName())));  mpComboQuantityUnit->setCurrentIndex(mpComboQuantityUnit->findText(FROM_UTF8(mpModel->getQuantityUnitName())));  mpComboAreaUnit->setCurrentIndex(mpComboAreaUnit->findText(FROM_UTF8(mpModel->getAreaUnitName())));  mpComboLengthUnit->setCurrentIndex(mpComboLengthUnit->findText(FROM_UTF8(mpModel->getLengthUnitName())));  mpCheckStochasticCorrection->setChecked(mpModel->getModelType() == CModel::deterministic);  mpLblInitialTime->setText("Initial Time (" + mpComboTimeUnit->currentText() + ")");  mpEditInitialTime->setText(QString::number(mpModel->getInitialTime()));  mpEditInitialTime->setReadOnly(mpModel->isAutonomous());  mpLblCurrentTime->setText("Time (" + mpComboTimeUnit->currentText() + ")");  mpEditCurrentTime->setText(QString::number(mpModel->getTime()));  return;}
开发者ID:ShuoLearner,项目名称:COPASI,代码行数:22,


示例11: if

void CQNotes::load(){  if (mpObject != NULL)    {      const std::string * pNotes = NULL;      if (dynamic_cast< CModelEntity * >(mpObject))        pNotes = &static_cast< CModelEntity * >(mpObject)->getNotes();      else if (dynamic_cast< CEvent * >(mpObject))        pNotes = &static_cast< CEvent * >(mpObject)->getNotes();      else if (dynamic_cast< CReaction * >(mpObject))        pNotes = &static_cast< CReaction * >(mpObject)->getNotes();      else if (dynamic_cast< CFunction * >(mpObject))        pNotes = &static_cast< CFunction * >(mpObject)->getNotes();      else if (dynamic_cast< CReportDefinition * >(mpObject))        pNotes = & static_cast< CReportDefinition * >(mpObject)->getComment();      if (pNotes != NULL)        {          // The notes are UTF8 encoded however the html does not specify an encoding          // thus Qt uses locale settings.          mpWebView->setHtml(FROM_UTF8(*pNotes));          mpEdit->setPlainText(FROM_UTF8(*pNotes));          mpValidatorXML->saved();          slotValidateXML();          if (!mpValidatorXML->isFreeText() && mEditMode)            {              slotToggleMode();            }          mValidity = QValidator::Acceptable;        }    }  mChanged = false;  return;}
开发者ID:ShuoLearner,项目名称:COPASI,代码行数:39,


示例12: CopasiWidget

/* *  Constructs a CQCompartment which is a child of 'parent', with the *  name 'name'.' */CQCompartment::CQCompartment(QWidget* parent, const char* name):  CopasiWidget(parent, name),  mItemToType(),  mpCompartment(NULL),  mChanged(false),  mExpressionValid(true),  mInitialExpressionValid(true){  setupUi(this);  mpComboBoxType->insertItem(mpComboBoxType->count(), FROM_UTF8(CModelEntity::StatusName[CModelEntity::FIXED]));  mpComboBoxType->insertItem(mpComboBoxType->count(), FROM_UTF8(CModelEntity::StatusName[CModelEntity::ASSIGNMENT]));  mpComboBoxType->insertItem(mpComboBoxType->count(), FROM_UTF8(CModelEntity::StatusName[CModelEntity::ODE]));  mItemToType.push_back(CModelEntity::FIXED);  mItemToType.push_back(CModelEntity::ASSIGNMENT);  mItemToType.push_back(CModelEntity::ODE);  mpMetaboliteTable->horizontalHeader()->hide();  mExpressionValid = false;  mpExpressionEMW->mpExpressionWidget->setExpressionType(CQExpressionWidget::TransientExpression);  mInitialExpressionValid = false;  mpInitialExpressionEMW->mpExpressionWidget->setExpressionType(CQExpressionWidget::InitialExpression);#ifdef COPASI_EXTUNIT  mpLblDim->show();  mpComboBoxDim->show();#else  mpLblDim->hide();  mpComboBoxDim->hide();#endif#ifdef COPASI_UNDO  CopasiUI3Window *  pWindow = dynamic_cast<CopasiUI3Window * >(parent->parent());  setUndoStack(pWindow->getUndoStack());#endif}
开发者ID:PriKalra,项目名称:COPASI,代码行数:43,


示例13: sendCommand

void MyIrcSession::on_connected() {	m_connected = true;	if (suffix.empty()) {		np->handleConnected(user);// 		if (!sentList) {// 			sendCommand(IrcCommand::createList("", ""));// 			sentList = true;// 		}	}// 	sendCommand(IrcCommand::createCapability("REQ", QStringList("away-notify")));	for(AutoJoinMap::iterator it = m_autoJoin.begin(); it != m_autoJoin.end(); it++) {		sendCommand(IrcCommand::createJoin(FROM_UTF8(it->second->getChannel()), FROM_UTF8(it->second->getPassword())));	}	if (getIdentify().find(" ") != std::string::npos) {		std::string to = getIdentify().substr(0, getIdentify().find(" "));		std::string what = getIdentify().substr(getIdentify().find(" ") + 1);		sendCommand(IrcCommand::createMessage(FROM_UTF8(to), FROM_UTF8(what)));	}}
开发者ID:jadestorm,项目名称:libtransport,代码行数:22,


示例14: MyIrcSession

MyIrcSession *IRCNetworkPlugin::createSession(const std::string &user, const std::string &hostname, const std::string &nickname, const std::string &password, const std::string &suffix) {	MyIrcSession *session = new MyIrcSession(user, this, suffix);	session->setUserName(FROM_UTF8(nickname));	session->setNickName(FROM_UTF8(nickname));	session->setRealName(FROM_UTF8(nickname));	session->setHost(FROM_UTF8(hostname));	session->setPort(6667);// 	session->setEncoding("UTF8");	if (!password.empty()) {		std::string identify = m_identify;		boost::replace_all(identify, "$password", password);		boost::replace_all(identify, "$name", nickname);		session->setIdentify(identify);	}	LOG4CXX_INFO(logger, user << ": Connecting " << hostname << " as " << nickname << ", suffix=" << suffix);	session->open();	return session;}
开发者ID:stv0g,项目名称:spectrum2,代码行数:22,


示例15: LOG4CXX_WARN

void SingleIRCNetworkPlugin::handleMessageSendRequest(const std::string &user, const std::string &legacyName, const std::string &message, const std::string &/*xhtml*/) {	if (m_sessions[user] == NULL) {		LOG4CXX_WARN(logger, user << ": Message received for unconnected user");		return;	}	// handle PMs	std::string r = legacyName;	if (legacyName.find("/") == std::string::npos) {		r = legacyName.substr(0, r.find("@"));	}	else {		r = legacyName.substr(legacyName.find("/") + 1);	}	LOG4CXX_INFO(logger, user << ": Forwarding message to " << r);	m_sessions[user]->sendCommand(IrcCommand::createMessage(FROM_UTF8(r), FROM_UTF8(message)));	if (r.find("#") == 0) {		handleMessage(user, legacyName, message, TO_UTF8(m_sessions[user]->nickName()));	}}
开发者ID:arnt,项目名称:libtransport,代码行数:22,


示例16: Locker

// virtualbool CProgressBar::setName(const std::string & name){  if (mpMainThread != NULL &&      QThread::currentThread() != mpMainThread)    {      QMutexLocker Locker(&mMutex);      mSlotFinished = false;      emit signalSetName(FROM_UTF8(name));      if (!mSlotFinished)        {          mWaitSlot.wait(&mMutex);        }    }  else    {      slotSetName(FROM_UTF8(name));    }  return true;}
开发者ID:mgaldzic,项目名称:copasi_api,代码行数:23,


示例17:

void Curve2DWidget::buttonPressedY(){  if (!mpModel) return;  mpObjectY = CCopasiSelectionDialog::getObjectSingle(this,              CQSimpleSelectionTree::NumericValues,              mpObjectY);  if (mpObjectY)    {      mpEditY->setText(FROM_UTF8(mpObjectY->getObjectDisplayName()));      if (mpObjectX)        mpEditTitle->setText(FROM_UTF8(mpObjectY->getObjectDisplayName()                                       + "|"                                       + mpObjectX->getObjectDisplayName()));      //TODO update tab title    }  else    mpEditY->setText("");}
开发者ID:PriKalra,项目名称:COPASI,代码行数:22,


示例18: TO_UTF8

void SCH_REFERENCE::Annotate(){    if( m_NumRef < 0 )        m_Ref += '?';    else    {        m_Ref = TO_UTF8( GetRef() << GetRefNumber() );    }    m_RootCmp->SetRef( &m_SheetPath, FROM_UTF8( m_Ref.c_str() ) );    m_RootCmp->SetUnit( m_Unit );    m_RootCmp->SetUnitSelection( &m_SheetPath, m_Unit );}
开发者ID:zhihuitech,项目名称:kicad-source-mirror,代码行数:13,


示例19: assert

bool CQUnitDM::removeRows(QModelIndexList rows, const QModelIndex&){  if (rows.isEmpty())    return false;  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);  CCopasiDataModel* pDataModel = &CCopasiRootContainer::getDatamodelList()->operator[](0);  assert(pDataModel != NULL);  CModel * pModel = pDataModel->getModel();  if (pModel == NULL)    return false;  // Build the list of pointers to items to be deleted  // before actually deleting any item.  QList <CUnitDefinition *> pUnitDefQList;  QModelIndexList::const_iterator i;  CUnitDefinition * pUnitDef;  for (i = rows.begin(); i != rows.end(); ++i)    {      if (!isDefaultRow(*i) &&          (pUnitDef = &CCopasiRootContainer::getUnitList()->operator[](i->row())) != NULL &&          pModel->getUnitSymbolUsage(pUnitDef->getSymbol()).empty() &&          !pUnitDef->isReadOnly())//Don't delete built-ins or used units        pUnitDefQList.append(&CCopasiRootContainer::getUnitList()->operator[](i->row()));    }  for (QList <CUnitDefinition *>::const_iterator j = pUnitDefQList.begin(); j != pUnitDefQList.end(); ++j)    {      size_t delRow =        CCopasiRootContainer::getUnitList()->CCopasiVector< CUnitDefinition >::getIndex(*j);      if (delRow != C_INVALID_INDEX)        {          CCopasiObject::DataObjectSet DeletedObjects;          DeletedObjects.insert(*j);          QMessageBox::StandardButton choice =            CQMessageBox::confirmDelete(NULL, "unit",                                        FROM_UTF8((*j)->getObjectName()),                                        DeletedObjects);          if (choice == QMessageBox::Ok)            removeRow((int) delRow);        }    }  return true;}
开发者ID:jonasfoe,项目名称:COPASI,代码行数:51,


示例20: qDebug

void CQBarChart::saveDataToFile(){#ifdef DEBUG_UI  qDebug() << "-- in qwt3dPlot.cpp Plot3d::saveDataToFile --";#endif  C_INT32 Answer = QMessageBox::No;  QString fileName, filetype_; //, newFilter;  while (Answer == QMessageBox::No)    {      QString *userFilter = new QString;      fileName =        CopasiFileDialog::getSaveFileName(this, "Save File Dialog",                                          "ILDMResults-barsPrint", "BMP Files (*.bmp);;PS Files (*.ps);;PDF Files (*.pdf)", "Save to",                                          userFilter);      if (fileName.isNull()) return;      if (*userFilter == "BMP Files (*.bmp)")        filetype_ = "BMP";      else if (*userFilter == "PS Files (*.ps)")        filetype_ = "PS";      else if (*userFilter == "PDF Files (*.pdf)")        filetype_ = "PDF";#ifdef DEBUG_UI      qDebug() << "user's filter pointer = " << *userFilter;      qDebug() << "filetype_ = " << filetype_;#endif      // Checks whether the file exists      Answer = checkSelection(fileName);      if (Answer == QMessageBox::Cancel) return;    }  int failed = 0;  QCursor oldCursor = cursor();  setCursor(Qt::WaitCursor);  failed = !Qwt3D::IO::save(mpPlot, fileName, filetype_);  setCursor(oldCursor);  if (failed)    {      std::string s = "Could not save data to ";      s += TO_UTF8(fileName);      CQMessageBox::critical(this, "Save Error", FROM_UTF8(s), QMessageBox::Ok, QMessageBox::Ok);    }}
开发者ID:copasi,项目名称:COPASI,代码行数:51,


示例21: _

void FOOTPRINT_EDIT_FRAME::updateTitle(){    wxString title = _( "Footprint Editor" );    LIB_ID   fpid = GetLoadedFPID();    bool     writable = true;    if( IsCurrentFPFromBoard() )    {        title += wxString::Format( wxT( " /u2014 %s [from %s.%s]" ),                                   GetBoard()->m_Modules->GetReference(),                                   Prj().GetProjectName(), PcbFileExtension );    }    else if( fpid.IsValid() )    {        try        {            writable = Prj().PcbFootprintLibs()->IsFootprintLibWritable( fpid.GetLibNickname() );        }        catch( const IO_ERROR& )        {            // best efforts...        }        // Note: don't used GetLoadedFPID(); footprint name may have been edited        title += wxString::Format( wxT( " /u2014 %s %s" ),                                   FROM_UTF8( GetBoard()->m_Modules->GetFPID().Format().c_str() ),                                   writable ? wxString( wxEmptyString ) : _( "[Read Only]" ) );    }    else if( !fpid.GetLibItemName().empty() )    {        // Note: don't used GetLoadedFPID(); footprint name may have been edited        title += wxString::Format( wxT( " /u2014 %s %s" ),                                   FROM_UTF8( GetBoard()->m_Modules->GetFPID().GetLibItemName().c_str() ),                                   _( "[Unsaved]" ) );    }    SetTitle( title );}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:38,


示例22: OnRun

    int OnRun()             // overload wxApp virtual    {        try        {            return wxApp::OnRun();        }        catch( const std::exception& e )        {            wxLogError( wxT( "Unhandled exception class: %s  what: %s" ),                GetChars( FROM_UTF8( typeid(e).name() )),                GetChars( FROM_UTF8( e.what() ) ) );        }        catch( const IO_ERROR& ioe )        {            wxLogError( GetChars( ioe.errorText ) );        }        catch(...)        {            wxLogError( wxT( "Unhandled exception of unknown type" ) );        }        return -1;    }
开发者ID:corecode,项目名称:kicad-source-mirror,代码行数:23,


示例23: GetColumnType

EValueType GetColumnType(	sqlite3_stmt*	stmt,	int				index ){	const char* s = sqlite3_column_decltype( stmt, index );	if( s )	{		wstring str;		FROM_UTF8( s, str );		return ConvertTypeNameToEnum( str );	}	return (EValueType) sqlite3_column_type( stmt, index );}
开发者ID:lesteriv,项目名称:slite,代码行数:14,


示例24: slotSelect

void DefaultPlotDialog::slotSelect(){    if (!mpTask) return;    int i = listBox->currentRow();    if (i >= 0)    {        mIndex = mList[i];        lineEditTitle->setText(FROM_UTF8(COutputAssistant::getItemName(mIndex)));        textEdit->setText(FROM_UTF8(COutputAssistant::getItem(mIndex).description));        createButton->setEnabled(!lineEditTitle->text().startsWith("-- "));    }    else //Listbox is emtpy, so there is no current row (-1)    {        mIndex = 0;        lineEditTitle->setText("");        textEdit->setText("");        createButton->setEnabled(false);    }}
开发者ID:PriKalra,项目名称:COPASI,代码行数:23,


示例25: FROM_UTF8

//staticQStringList ParameterTable::getListOfAllCompartmentNames(const CModel & model){  QStringList ret;  ret += "unknown";  //all the global paramters  in the model  size_t i, imax = model.getCompartments().size();  for (i = 0; i < imax; ++i)    ret += FROM_UTF8(model.getCompartments()[i]->getObjectName());  return ret;}
开发者ID:cpanchal,项目名称:COPASI,代码行数:15,


示例26: QVariant

QVariant CQCreatorDM::data(const QModelIndex &index, int role) const{  if (!index.isValid())    return QVariant();  if (index.row() >= rowCount())    return QVariant();  if (role == Qt::DisplayRole || role == Qt::EditRole)    {      if (isDefaultRow(index))        {          if (index.column() == COL_ROW_NUMBER)            return QVariant(QString(""));          else            return QVariant(QString(""));        }      else        {          switch (index.column())            {              case COL_ROW_NUMBER:                return QVariant(index.row() + 1);              case COL_FAMILY_NAME:                return QVariant(QString(FROM_UTF8(mpMIRIAMInfo->getCreators()[index.row()]->getFamilyName())));              case COL_GIVEN_NAME:                return QVariant(QString(FROM_UTF8(mpMIRIAMInfo->getCreators()[index.row()]->getGivenName())));              case COL_EMAIL:                return QVariant(QString(FROM_UTF8(mpMIRIAMInfo->getCreators()[index.row()]->getEmail())));              case COL_ORG:                return QVariant(QString(FROM_UTF8(mpMIRIAMInfo->getCreators()[index.row()]->getORG())));            }        }    }  return QVariant();}
开发者ID:Koliham,项目名称:COPASI,代码行数:37,


示例27: FROM_UTF8

void CQNotes::load(){  if (mpObject != NULL)    {      QString Notes;      CAnnotation * pAnnotation = CAnnotation::castObject(mpObject);      CReportDefinition * pReportDefinition = static_cast< CReportDefinition * >(mpObject);      if (pAnnotation != NULL)        {          Notes = FROM_UTF8(pAnnotation->getNotes());        }      else if (pReportDefinition != NULL)        {          Notes = FROM_UTF8(pReportDefinition->getComment());        }      // The notes are UTF8 encoded however the html does not specify an encoding      // thus Qt uses locale settings.      mpWebView->setHtml(Notes);      mpEdit->setPlainText(Notes);      mpValidatorXML->saved();      slotValidateXML();      if (!mpValidatorXML->isFreeText() && mEditMode)        {          slotToggleMode();        }      mValidity = QValidator::Acceptable;    }  mChanged = false;  return;}
开发者ID:PriKalra,项目名称:COPASI,代码行数:37,


示例28: assert

bool CQReportDM::removeRows(QModelIndexList rows, const QModelIndex&){    if (rows.isEmpty())        return false;    assert(mpDataModel != NULL);    CCopasiVector< CReportDefinition > * pReportList = mpDataModel->getReportDefinitionList();    if (pReportList == NULL)        return false;    QList< CReportDefinition * > Reports;    QModelIndexList::const_iterator i;    for (i = rows.begin(); i != rows.end(); ++i)    {        if (!isDefaultRow(*i) && &pReportList->operator[](i->row()))            Reports.append(&pReportList->operator[](i->row()));    }    QList< CReportDefinition * >::const_iterator j;    for (j = Reports.begin(); j != Reports.end(); ++j)    {        CReportDefinition * pReport = *j;        size_t delRow = pReportList->getIndex(pReport);        if (delRow != C_INVALID_INDEX)        {            std::set< const CCopasiObject * > DeletedObjects;            DeletedObjects.insert(pReport);            QMessageBox::StandardButton choice =                CQMessageBox::confirmDelete(NULL, "report",                                            FROM_UTF8(pReport->getObjectName()),                                            DeletedObjects);            if (choice == QMessageBox::Ok)            {                removeRow((int) delRow);            }        }    }    return true;}
开发者ID:copasi,项目名称:COPASI,代码行数:49,


示例29: CopasiWidget

CQTabWidget::CQTabWidget(const ListViews::ObjectType & objectType, CopasiWidget * pCopasiWidget,                         QWidget * parent, Qt::WindowFlags f) :  CopasiWidget(parent, NULL, f),  mPages(),  mObjectType(objectType),  mIgnoreLeave(false){  setupUi(this);  mpLblName->setText("<h3>" + FROM_UTF8(ListViews::ObjectTypeName[mObjectType]) + "</h3>");  mpTabWidget->addTab(pCopasiWidget, "Details");  mPages.push_back(pCopasiWidget);  switch (mObjectType)    {      case  ListViews::MODEL:        mpBtnNew->hide();        mpBtnCopy->hide();        mpBtnDelete->hide();        break;      case ListViews::MODELPARAMETERSET:        mpBtnNew->setText("Apply");        mpBtnNew->setToolTip("Apply the current parameters to the model.");        // The break statement is intentionally missing      default:        CQNotes* pNotes = new CQNotes(mpTabWidget);        mPages.push_back(pNotes);        mpTabWidget->addTab(pNotes, "Notes");        connect(this, SIGNAL(newClicked()), pCopasiWidget, SLOT(slotBtnNew()));        connect(this, SIGNAL(copyClicked()), pCopasiWidget, SLOT(slotBtnCopy()));        connect(this, SIGNAL(deleteClicked()), pCopasiWidget, SLOT(slotBtnDelete()));        connect(this, SIGNAL(copyClicked()), pNotes, SLOT(slotBtnCopy()));        break;    }  CQMiriamWidget* pMIRIAMWidget = new CQMiriamWidget(mpTabWidget);  mPages.push_back(pMIRIAMWidget);  mpTabWidget->addTab(pMIRIAMWidget, "Annotation");  connect(this, SIGNAL(copyClicked()), pMIRIAMWidget, SLOT(slotBtnCopy()));  CQRDFTreeView* pRDFTreeView = new CQRDFTreeView(mpTabWidget);  mPages.push_back(pRDFTreeView);  mpTabWidget->addTab(pRDFTreeView, "RDF Browser");}
开发者ID:cpanchal,项目名称:COPASI,代码行数:49,



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


C++ FRTOS1_vTaskDelay函数代码示例
C++ FROM_SYSBUS函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。