Add framework support for editor auto values

Add support for a field to be linked to a value updated by code outside the object itself. Mark the linked field by using a background color and icons for linked/unlinked state.
The auto value states is set as attributes in the project xml file. 
Add reference implementation in cafTestApplication, see Fwk/AppFwk/cafTests/cafTestApplication/MainWindow.cpp

* Tree View Editor: Avoid sending notification if selection is unchanged
* Use std++17 in test solution
* Move icons to icon factory
* add support for creating QIcon from SVG text string
This commit is contained in:
Magne Sjaastad
2022-09-02 13:20:52 +02:00
committed by GitHub
parent 30c3fe3a5c
commit e97a476d85
24 changed files with 979 additions and 183 deletions

View File

@@ -560,8 +560,11 @@ bool PdmUiTreeViewEditor::eventFilter( QObject* obj, QEvent* event )
{
if ( event->type() == QEvent::FocusIn )
{
this->updateSelectionManager();
emit selectionChanged();
bool anyChanges = this->updateSelectionManager();
if ( anyChanges )
{
emit selectionChanged();
}
}
// standard event processing
@@ -571,14 +574,16 @@ bool PdmUiTreeViewEditor::eventFilter( QObject* obj, QEvent* event )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void PdmUiTreeViewEditor::updateSelectionManager()
bool PdmUiTreeViewEditor::updateSelectionManager()
{
if ( m_updateSelectionManager )
{
std::vector<PdmUiItem*> items;
this->selectedUiItems( items );
SelectionManager::instance()->setSelectedItems( items );
return SelectionManager::instance()->setSelectedItems( items );
}
return false;
}
//--------------------------------------------------------------------------------------------------