本文整理汇总了C++中CCopasiDataModel::getGUI方法的典型用法代码示例。如果您正苦于以下问题:C++ CCopasiDataModel::getGUI方法的具体用法?C++ CCopasiDataModel::getGUI怎么用?C++ CCopasiDataModel::getGUI使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCopasiDataModel
的用法示例。
在下文中一共展示了CCopasiDataModel::getGUI方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addSlider
void SliderDialog::addSlider(CSlider* pSlider)
{
if (mpParentWindow == NULL)
return;
// check if there already is a slider for this object
CCopasiDataModel * pDataModel = pSlider->getObjectDataModel();
assert(pDataModel != NULL);
SCopasiXMLGUI* pGUI = pDataModel->getGUI();
assert(pGUI);
if (!equivalentSliderExists(pSlider))
{
CObjectInterface::ContainerList listOfContainers;
assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
listOfContainers.push_back(pDataModel->getModel());
pSlider->compile(listOfContainers);
pGUI->getSliderList()->add(pSlider, true);
}
CopasiSlider* tmp = findCopasiSliderForCSlider(pSlider);
if (!tmp)
{
setCurrentSlider(new CopasiSlider(pSlider, mpParentWindow->getDataModel(), mpSliderBox));
mpCurrSlider->installEventFilter(this);
mpCurrSlider->setHidden(true);
mpCurrSlider->updateSliderData();
// make sure the slider points to the correct object
// for the currently set framework
this->setCorrectSliderObject(this->mpCurrSlider);
mSliderMap[mCurrentFolderId].push_back(mpCurrSlider);
QBoxLayout* layout = static_cast<QBoxLayout*>(mpSliderBox->layout());
int childCount = layout->count() - 1;
layout->insertWidget(childCount, mpCurrSlider);
connect(mpCurrSlider, SIGNAL(valueChanged(double)), this , SLOT(sliderValueChanged()));
connect(mpCurrSlider, SIGNAL(sliderReleased()), this, SLOT(sliderReleased()));
connect(mpCurrSlider, SIGNAL(sliderPressed()), this, SLOT(sliderPressed()));
connect(mpCurrSlider, SIGNAL(closeClicked(CopasiSlider*)), this, SLOT(removeSlider(CopasiSlider*)));
connect(mpCurrSlider, SIGNAL(editClicked(CopasiSlider*)), this, SLOT(editSlider(CopasiSlider*)));
mpCurrSlider->setHidden(false);
mChanged = true;
}
示例2: removeSlider
void SliderDialog::removeSlider()
{
if (mpCurrSlider)
{
CCopasiDataModel * pDataModel = mpCurrSlider->getCSlider()->getObjectDataModel();
assert(pDataModel != NULL);
CCopasiVector<CSlider>* pSliderList = pDataModel->getGUI()->getSliderList();
size_t i, maxCount = pSliderList->size();
for (i = 0; i < maxCount; ++i)
{
CSlider* pTmpSlider = &pSliderList->operator[](i);
if (pTmpSlider == mpCurrSlider->getCSlider())
{
pSliderList->remove(i);
break;
}
}
deleteSlider(mpCurrSlider);
mpCurrSlider = NULL;
}
}