Skip to content

Commit

Permalink
Make sure group image is displayed.
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Dec 9, 2015
1 parent b9e092e commit 5148385
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions OMEdit/OMEditGUI/Component/ComponentProperties.cpp
Expand Up @@ -341,7 +341,7 @@ GroupBox::GroupBox(const QString &title, QWidget *parent)
*/
void GroupBox::setGroupImage(QString groupImage)
{
if (!mpGroupImageLabel->pixmap() || (mpGroupImageLabel->pixmap() && mpGroupImageLabel->pixmap()->isNull())) {
if (QFile::exists(groupImage)) {
QPixmap pixmap(groupImage);
mpGroupImageLabel->setPixmap(pixmap);
}
Expand Down Expand Up @@ -677,7 +677,9 @@ void ComponentParameters::createTabsGroupBoxesAndParametersHelper(LibraryTreeIte
}
// get the group image
groupImage = StringHandler::removeFirstLastQuotes(dialogAnnotation.at(9));
groupImage = mpMainWindow->getOMCProxy()->uriToFilename(groupImage);
if (!groupImage.isEmpty()) {
groupImage = mpMainWindow->getOMCProxy()->uriToFilename(groupImage);
}
}
// if showStartAttribute true and group name is empty or Parameters then we should make group name Initialization
if (showStartAttribute && groupBox.isEmpty()) {
Expand All @@ -695,18 +697,19 @@ void ComponentParameters::createTabsGroupBoxesAndParametersHelper(LibraryTreeIte
} else {
ParametersScrollArea *pParametersScrollArea;
pParametersScrollArea = qobject_cast<ParametersScrollArea*>(mpParametersTabWidget->widget(mTabsMap.value(tab)));
if (pParametersScrollArea && !pParametersScrollArea->getGroupBox(groupBox)) {
GroupBox *pGroupBox = new GroupBox(groupBox);
// set the group image
pGroupBox->setGroupImage(groupImage);
GroupBox *pGroupBox = pParametersScrollArea->getGroupBox(groupBox);
if (pParametersScrollArea && !pGroupBox) {
pGroupBox = new GroupBox(groupBox);
pParametersScrollArea->addGroupBox(pGroupBox);
}
// set the group image
pGroupBox->setGroupImage(groupImage);
}
// create the Parameter
Parameter *pParameter = new Parameter(pComponent, showStartAttribute, tab, groupBox);
pParameter->setEnabled(enable);
QString componentDefinedInClass = pComponent->getGraphicsView()->getModelWidget()->getLibraryTreeItem()->getNameStructure();
QString value = pOMCProxy->getParameterValue(componentDefinedInClass, pComponent->getName());
QString value = pComponent->getComponentInfo()->getParameterValue(pOMCProxy, componentDefinedInClass);
pParameter->setValueWidget(value, true);
if (showStartAttribute) {
pParameter->setValueWidget(start, true);
Expand Down

0 comments on commit 5148385

Please sign in to comment.