src/plugins/simulation/SingleCellView/src/singlecellviewinformationgraphswidget.cpp
// Go through our graph properties and update (incl. retranslate) their
// information
Go through our graph properties and update (incl. retranslate) their
information
Go through our graph properties and update ( incl . retranslate ) their information
foreach (Core::Property *graphProperty, graphProperties) {
        graphProperty->properties()[0]->setName(tr("Model"));
        graphProperty->properties()[1]->setName(tr("X"));
        graphProperty->properties()[2]->setName(tr("Y"));
        QString oldModelValue = graphProperty->properties()[0]->value();
        QString newModelValue = oldModelValue;
        graphProperty->properties()[0]->setListValues(modelListValues, false);
        if (newModelValue.isEmpty()) {
            newModelValue = graphProperty->properties()[0]->value();
        } else if (!modelListValues.contains(oldModelValue)) {
            if (oldModelValue.contains(PropertySeparator))
                newModelValue = QFileInfo(mFileName).fileName()+PropertySeparator+mFileName;
            else
                newModelValue = tr("Current");
        }
        graphProperty->properties()[0]->setValue(newModelValue, true);
    }
foreach ( Core :: Property * graphProperty , graphProperties ) { graphProperty -> properties ( ) [ 0 ] -> setName ( tr ( " " ) ) ; graphProperty -> properties ( ) [ 1 ] -> setName ( tr ( " " ) ) ; graphProperty -> properties ( ) [ 2 ] -> setName ( tr ( " " ) ) ; QString oldModelValue = graphProperty -> properties ( ) [ 0 ] -> value ( ) ; QString newModelValue = oldModelValue ; graphProperty -> properties ( ) [ 0 ] -> setListValues ( modelListValues , false ) ; if ( newModelValue . isEmpty ( ) ) { newModelValue = graphProperty -> properties ( ) [ 0 ] -> value ( ) ; } else if ( ! modelListValues . contains ( oldModelValue ) ) { if ( oldModelValue . contains ( PropertySeparator ) ) newModelValue = QFileInfo ( mFileName ) . fileName ( ) + PropertySeparator + mFileName ; else newModelValue = tr ( " " ) ; } graphProperty -> properties ( ) [ 0 ] -> setValue ( newModelValue , true ) ; }
Go through our graph properties and update (incl.
Go through our graph properties and update ( incl .
// Keep track of the current model value, so that we can safely update // its list values and then select the correct model value back // Note: we don't want setListValues() to emit a signal since one will //       be emitted as a result of our call to setValue() below... // newModelValue is empty, which means that this is the first time // we come here, so update our graph info using the current value of // our model property // Our old model value is not in our new model list values, which // means that either the value of the model property was "Current" // (and the locale got changed) or the current file got renamed, so // we use that instead // The current file got renamed // The value of the model property was "Current" (and the locale // got changed) // Set the value of our model property to newModelValue (which will // result in updateGraphInfo() being called, so we are all fine) // Note: we must force the setting of the value since it may very well //       be that it's the same as before, yet we want the signal //       associated with setValue() to be emitted (so that //       updateGraphInfo() can then be called)...