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

C++ FROM_UTF8函数代码示例

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

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



在下文中一共展示了FROM_UTF8函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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,代码来源:cvpcb_mainframe.cpp


示例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,代码来源:class_DisplayFootprintsFrame.cpp


示例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,代码来源:CQSpeciesDetail.cpp


示例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,代码来源:sch_bus_entry.cpp


示例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,代码来源:CQExperimentData.cpp


示例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,代码来源:CopasiPlot.cpp


示例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,代码来源:CQReferenceDM.cpp


示例8: assert

// virtual
void 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,代码来源:CScanWidgetScan.cpp


示例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,代码来源:CQCompartment.cpp


示例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,代码来源:CQModelWidget.cpp


示例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,代码来源:CQNotes.cpp


示例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,代码来源:CQCompartment.cpp


示例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,代码来源:session.cpp


示例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,代码来源:ircnetworkplugin.cpp


示例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,代码来源:singleircnetworkplugin.cpp


示例16: Locker

// virtual
bool 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,代码来源:CProgressBar.cpp


示例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,代码来源:curve2dwidget.cpp


示例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,代码来源:component_references_lister.cpp


示例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,代码来源:CQUnitDM.cpp


示例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,代码来源:qwt3dPlot.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ FRTOS1_vTaskDelay函数代码示例发布时间:2022-05-30
下一篇:
C++ FROM_SYSBUS函数代码示例发布时间: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