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


C++ KstScalarPtr::tagName方法代码示例

本文整理汇总了C++中KstScalarPtr::tagName方法的典型用法代码示例。如果您正苦于以下问题:C++ KstScalarPtr::tagName方法的具体用法?C++ KstScalarPtr::tagName怎么用?C++ KstScalarPtr::tagName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KstScalarPtr的用法示例。


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

示例1: sampleTag

QString CrossPowerSpectrum::sampleTag() const {
  KstScalarPtr s = sample();
  if (s) {
    return s->tagName();
  }
  return QString::null;
}
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:7,代码来源:crosspowerspectrum.cpp

示例2: rl

const QString& KstIfaceImpl::generateScalar(const QString& name, double value) {
  KstScalarPtr s = new KstScalar(name, 0L, value);
  KstReadLocker rl(s);
  s->setOrphan(true);
  s->setEditable(true);
  return s->tagName();
}
开发者ID:,项目名称:,代码行数:7,代码来源:

示例3: fillFieldsForEdit

void KstBasicDialogI::fillFieldsForEdit() {

  KstBasicPluginPtr ptr = kst_cast<KstBasicPlugin>(_dp);
  if (!ptr)
    return; //shouldn't happen

  ptr->readLock();

  _tagName->setText(ptr->tagName());
  _legendText->setText(defaultTag); //FIXME?

  //Update the various widgets...

  //input vectors...
  QStringList iv = ptr->inputVectorList();
  QStringList::ConstIterator ivI = iv.begin();
  for (; ivI != iv.end(); ++ivI) {
    KstVectorPtr p = ptr->inputVector(*ivI);
    QString t = p ? p->tagName() : QString::null;
    if (VectorSelector *w = vector(*ivI)) {
      w->setSelection(t);
    }
  }

  //input scalars...
  QStringList is = ptr->inputScalarList();
  QStringList::ConstIterator isI = is.begin();
  for (; isI != is.end(); ++isI) {
    KstScalarPtr p = ptr->inputScalar(*isI);
    QString t = p ? p->tagName() : QString::null;
    if (ScalarSelector *w = scalar(*isI)) {
      w->setSelection(t);
    }
  }

  //input strings...
  QStringList istr = ptr->inputStringList();
  QStringList::ConstIterator istrI = istr.begin();
  for (; istrI != istr.end(); ++istrI) {
    KstStringPtr p = ptr->inputString(*istrI);
    QString t = p ? p->tagName() : QString::null;
    if (StringSelector *w = string(*istrI)) {
      w->setSelection(t);
    }
  }

  //output vectors...
  QStringList ov = ptr->outputVectorList();
  QStringList::ConstIterator ovI = ov.begin();
  for (; ovI != ov.end(); ++ovI) {
    KstVectorPtr p = ptr->outputVector(*ovI);
    QString t = p ? p->tagName() : QString::null;
    if (QLineEdit *w = output(*ovI)) {
      w->setText(t);
      w->setEnabled(false);
    }
  }

  //output scalars...
  QStringList os = ptr->outputScalarList();
  QStringList::ConstIterator osI = os.begin();
  for (; osI != os.end(); ++osI) {
    KstScalarPtr p = ptr->outputScalar(*osI);
    QString t = p ? p->tagName() : QString::null;
    if (QLineEdit *w = output(*osI)) {
      w->setText(t);
      w->setEnabled(false);
    }
  }

  //ouput strings...
  QStringList ostr = ptr->outputStringList();
  QStringList::ConstIterator ostrI = ostr.begin();
  for (; ostrI != ostr.end(); ++ostrI) {
    KstStringPtr p = ptr->outputString(*ostrI);
    QString t = p ? p->tagName() : QString::null;
    if (QLineEdit *w = output(*ostrI)) {
      w->setText(t);
      w->setEnabled(false);
    }
  }

  ptr->unlock();

  adjustSize();
  resize(minimumSizeHint());
  setFixedHeight(height());
}
开发者ID:,项目名称:,代码行数:88,代码来源:

示例4: doTests

void doTests() {
  KstScalarPtr sp = new KstScalar;
  doTest(!sp->tagName().isEmpty());
  doTest(sp->value() == 0.0);
  *sp = 3.1415;
  doTest(sp->displayable());
  doTest(sp->value() == 3.1415);
  sp->setValue(2.1415);
  doTest(sp->value() == 2.1415);
  sp->setValue(NOPOINT);
  doTest(sp->value() != sp->value());
  sp->setValue(INF);
  doTest(sp->value() == INF);
  doTest((*sp = 2.0).value() == 2.0);
  SListener *listener = new SListener;
  sp->connect(sp, SIGNAL(trigger()), listener, SLOT(trigger()));
  *sp = 3.1415;
  doTest(listener->_trigger == 1);
  sp->setValue(3.1415);
  doTest(listener->_trigger == 2);
  *sp = 1.1415;
  doTest(listener->_trigger == 3);

  KstScalarPtr sp2 = new KstScalar(sp->tagName());
  doTest(sp2->tagName() == sp->tagName() + "'");

  doTest(sp->isGlobal());
  doTest(sp2->isGlobal());
  doTest(sp->displayable());
  doTest(sp2->displayable());

  QDomNode n;
  QDomElement e;
  n = makeDOM1("load1", "2.14159265").firstChild();
  e = n.toElement();
  KstScalarPtr sp3 = new KstScalar(e);
  doTest(sp3->orphan() == false);
  doTest(sp3->value() == 2.14159265);
  doTest(sp3->tagName() == "load1");
  doTest(sp3->isGlobal());
  doTest(sp3->displayable());

  n = makeDOM1("55.4232", "55.4232", true).firstChild();
  e = n.toElement();
  KstScalarPtr sp4 = new KstScalar(e);
  doTest(sp4->orphan());
  doTest(sp4->value() == 55.4232);
  doTest(sp4->tagName() == "55.4232");
  doTest(sp4->isGlobal());
  doTest(!sp4->displayable());

  n = makeDOM1("load2", "NAN").firstChild();
  e = n.toElement();
  sp4 = new KstScalar(e);
  doTest(sp4->value() != sp4->value());

  n = makeDOM1("load3", "INF").firstChild();
  e = n.toElement();
  sp4 = new KstScalar(e);
  doTest(sp4->value() == INF);

  n = makeDOM1("load4", "-INF").firstChild();
  e = n.toElement();
  sp4 = new KstScalar(e);
  doTest(sp4->value() == -INF);

  delete listener;
}
开发者ID:,项目名称:,代码行数:68,代码来源:


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