Commit 91e72d2a authored by T.J. Corona's avatar T.J. Corona

Add signals to update model-related UI.

parent 7ec9faca
......@@ -64,6 +64,11 @@ smtk::attribute::MeshItemPtr qtMeshItem::meshItem()
return dynamic_pointer_cast<MeshItem>(this->getObject());
}
void qtMeshItem::refreshEntityItems()
{
this->Internals->MeshItemCombo->init();
}
bool qtMeshItem::add(const smtk::mesh::MeshSet& val)
{
if (this->meshItem()->appendValue(val))
......@@ -255,6 +260,8 @@ void qtMeshItem::loadAssociatedEntities()
editBox->setToolTip("Associate meshes");
editBox->setModel(new QStandardItemModel());
editBox->setItemDelegate(new qtCheckableComboItemDelegate(editBox));
connect(
this->baseView()->uiManager(), SIGNAL(refreshEntityItems()), this, SLOT(refreshEntityItems()));
QSizePolicy sizeFixedPolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
QBoxLayout* editorLayout = new QHBoxLayout;
......
......@@ -45,6 +45,7 @@ public:
public slots:
void setOutputOptional(int);
void refreshEntityItems();
protected slots:
virtual void updateItemData();
......
......@@ -184,6 +184,11 @@ void qtModelEntityItem::updateItemData()
this->qtItem::updateItemData();
}
void qtModelEntityItem::refreshEntityItems()
{
this->Internals->EntityItemCombo->init();
}
void qtModelEntityItem::addEntityAssociationWidget()
{
smtk::attribute::ModelEntityItemPtr item =
......@@ -211,6 +216,8 @@ void qtModelEntityItem::addEntityAssociationWidget()
editBox->setToolTip("Associate model entities");
editBox->setModel(new QStandardItemModel());
editBox->setItemDelegate(new qtCheckableComboItemDelegate(editBox));
connect(
this->baseView()->uiManager(), SIGNAL(refreshEntityItems()), this, SLOT(refreshEntityItems()));
QSizePolicy sizeFixedPolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
QBoxLayout* editorLayout = new QHBoxLayout;
......
......@@ -57,6 +57,7 @@ public slots:
void updateSelection(const smtk::model::EntityRefs& selEntities,
const smtk::mesh::MeshSets& selMeshes, const smtk::model::DescriptivePhrases& DesPhrases,
const std::string& incomingSelectionSource);
void refreshEntityItems();
signals:
void requestEntityAssociation();
......
......@@ -353,6 +353,8 @@ bool qtModelOperationWidget::initOperatorUI(const smtk::model::OperatorPtr& brOp
QObject::connect(uiManager,
SIGNAL(meshSelectionItemCreated(smtk::extension::qtMeshSelectionItem*)), this,
SLOT(onMeshSelectionItemCreated(smtk::extension::qtMeshSelectionItem*)));
QObject::connect(this, SIGNAL(operationFinished(const smtk::model::OperatorResult&)), uiManager,
SLOT(onOperationFinished()));
qtModelOperationWidgetInternals::OperatorInfo opInfo;
opInfo.opPtr = brOp;
......
......@@ -67,6 +67,7 @@ public slots:
signals:
void operationRequested(const smtk::model::OperatorPtr& brOp);
void operationCancelled(const smtk::model::OperatorPtr& brOp);
void operationFinished(const smtk::model::OperatorResult&);
void fileItemCreated(smtk::extension::qtFileItem* fileItem);
void modelEntityItemCreated(smtk::extension::qtModelEntityItem* entItem);
void meshSelectionItemCreated(smtk::extension::qtMeshSelectionItem* meshItem,
......
......@@ -1063,6 +1063,8 @@ qtOperatorDockWidget* qtModelView::operatorsDock()
const std::string&, const smtk::common::UUID&)),
this, SIGNAL(meshSelectionItemCreated(
smtk::extension::qtMeshSelectionItem*, const std::string&, const smtk::common::UUID&)));
QObject::connect(this, SIGNAL(operationFinished(const smtk::model::OperatorResult&)), opWidget,
SIGNAL(operationFinished(const smtk::model::OperatorResult&)));
QWidget* dockP = NULL;
foreach (QWidget* widget, QApplication::topLevelWidgets())
......
......@@ -623,6 +623,11 @@ void qtUIManager::onViewUIModified(
emit this->viewUIChanged(bview, item);
}
void qtUIManager::onOperationFinished()
{
emit this->refreshEntityItems();
}
int qtUIManager::getWidthOfAttributeMaxLabel(smtk::attribute::DefinitionPtr def, const QFont& font)
{
std::string text;
......
......@@ -153,6 +153,7 @@ public slots:
void updateModelViews();
void onViewUIModified(smtk::extension::qtBaseView*, smtk::attribute::ItemPtr);
void setAdvanceLevel(int b);
void onOperationFinished();
signals:
void fileItemCreated(smtk::extension::qtFileItem* fileItem);
......@@ -163,6 +164,7 @@ signals:
const smtk::model::EntityRefs& selEntities, const smtk::mesh::MeshSets& selMeshes,
const smtk::model::DescriptivePhrases& DesPhrases,
const smtk::extension::SelectionModifier modifierFlag, const std::string& selectionSource);
void refreshEntityItems();
friend class qtRootView;
friend class qtAssociationWidget;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment