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


C++ Property::briefDocumentation方法代码示例

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


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

示例1: row

/**
 * Tie together an input widget and a property
 * @param widget :: The widget that will collect the input
 * @param property :: The name of the property to tie the given widget to
 * @param parent_layout :: An optional pointer to a QLayout class that is
 * reponsible for managing the passed widget.
 * If given, a validator label will be added for the given input widget
 * @param readHistory :: If true then a history value will be retrieved
 *
 * @return A NULL pointer if a valid label was successfully add to a passed
 * parent_layout otherwise it
 *          returns a pointer to the QLabel instance marking the validity
 */
QWidget *AlgorithmDialog::tie(QWidget *widget, const QString &property,
                              QLayout *parent_layout, bool readHistory) {
  if (m_tied_properties.contains(property))
    m_tied_properties.remove(property);

  Mantid::Kernel::Property *prop = getAlgorithmProperty(property);
  if (prop) { // Set a few things on the widget
    widget->setToolTip(QString::fromStdString(prop->briefDocumentation()));
  }
  widget->setEnabled(isWidgetEnabled(property));

  PropertyWidget *propWidget = qobject_cast<PropertyWidget *>(widget);

  // Save in the hashes
  m_tied_properties.insert(property, widget);

  // If the widget's layout has been given then assume that a validator is
  // required, else assume not
  QWidget *validlbl(nullptr);
  if (parent_layout) {
    // Check if the validator is already there
    validlbl = getValidatorMarker(property);
    if (validlbl) {
      // Find where it was sitting in the layout
      int item_index;
      if (propWidget)
        item_index = parent_layout->indexOf(propWidget->getMainWidget());
      else
        item_index = parent_layout->indexOf(widget);

      if (QBoxLayout *box = qobject_cast<QBoxLayout *>(parent_layout)) {
        box->insertWidget(item_index + 1, validlbl);
      } else if (QGridLayout *grid =
                     qobject_cast<QGridLayout *>(parent_layout)) {
        int row(0), col(0), span(0);
        grid->getItemPosition(item_index, &row, &col, &span, &span);
        grid->addWidget(validlbl, row, col + 2);
      } else {
      }
    }
  } else {
    m_noValidation.append(property);
  }

  if (readHistory) {
    setPreviousValue(widget, property);
  }

  return validlbl;
}
开发者ID:DanNixon,项目名称:mantid,代码行数:63,代码来源:AlgorithmDialog.cpp


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