mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-03 00:02:25 -05:00
remove non working caching of field values
This commit is contained in:
parent
bb8bced5d6
commit
2857896fbd
@ -62,8 +62,8 @@ Loads field names and values from the specified map.
|
||||
|
||||
.. versionadded:: 2.12
|
||||
|
||||
.. deprecated::
|
||||
use setLayer() and expressionTree()->
|
||||
.. deprecated:: QGIS 3.14
|
||||
this will not do anything, use setLayer() instead
|
||||
%End
|
||||
|
||||
void setGeomCalculator( const QgsDistanceArea &da );
|
||||
|
@ -259,7 +259,7 @@ void QgsExpressionBuilderWidget::expressionTreeItemChanged( QgsExpressionItem *i
|
||||
bool isField = mLayer && item->getItemType() == QgsExpressionItem::Field;
|
||||
if ( isField )
|
||||
{
|
||||
loadFieldValues( mFieldValues.value( item->text() ) );
|
||||
mValuesModel->clear();
|
||||
|
||||
cbxValuesInUse->setVisible( formatterCanProvideAvailableValues( item->text() ) );
|
||||
cbxValuesInUse->setChecked( false );
|
||||
@ -412,20 +412,8 @@ void QgsExpressionBuilderWidget::insertExpressionText( const QString &text )
|
||||
|
||||
void QgsExpressionBuilderWidget::loadFieldsAndValues( const QMap<QString, QStringList> &fieldValues )
|
||||
{
|
||||
mFieldValues.clear();
|
||||
QgsFields fields;
|
||||
for ( auto it = fieldValues.constBegin(); it != fieldValues.constEnd(); ++it )
|
||||
{
|
||||
fields.append( QgsField( it.key() ) );
|
||||
const QStringList values = it.value();
|
||||
QVariantMap map;
|
||||
for ( const QString &value : values )
|
||||
{
|
||||
map.insert( value, value );
|
||||
}
|
||||
mFieldValues.insert( it.key(), map );
|
||||
}
|
||||
mExpressionTreeView->loadFieldNames( fields );
|
||||
Q_UNUSED( fieldValues )
|
||||
// This is not maintained and setLayer() should be used instead.
|
||||
}
|
||||
|
||||
void QgsExpressionBuilderWidget::fillFieldValues( const QString &fieldName, int countLimit, bool forceUsedValues )
|
||||
@ -671,17 +659,6 @@ void QgsExpressionBuilderWidget::setParserError( bool parserError )
|
||||
emit parserErrorChanged();
|
||||
}
|
||||
|
||||
void QgsExpressionBuilderWidget::loadFieldValues( const QVariantMap &values )
|
||||
{
|
||||
mValuesModel->clear();
|
||||
for ( QVariantMap::ConstIterator it = values.constBegin(); it != values.constEnd(); ++ it )
|
||||
{
|
||||
QStandardItem *item = new QStandardItem( it.key() );
|
||||
item->setData( it.value() );
|
||||
mValuesModel->appendRow( item );
|
||||
}
|
||||
}
|
||||
|
||||
bool QgsExpressionBuilderWidget::evalError() const
|
||||
{
|
||||
return mEvalError;
|
||||
@ -1134,6 +1111,9 @@ QString QgsExpressionBuilderWidget::loadFunctionHelp( QgsExpressionItem *express
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Menu provider
|
||||
|
||||
QMenu *QgsExpressionBuilderWidget::ExpressionTreeMenuProvider::createContextMenu( QgsExpressionItem *item )
|
||||
{
|
||||
QMenu *menu = nullptr;
|
||||
|
@ -69,7 +69,7 @@ class GUI_EXPORT QgsExpressionBuilderWidget : public QWidget, private Ui::QgsExp
|
||||
* Loads field names and values from the specified map.
|
||||
* \note The field values must be quoted appropriately if they are strings.
|
||||
* \since QGIS 2.12
|
||||
* \deprecated use setLayer() and expressionTree()->
|
||||
* \deprecated since QGIS 3.14 this will not do anything, use setLayer() instead
|
||||
*/
|
||||
void loadFieldsAndValues( const QMap<QString, QStringList> &fieldValues );
|
||||
|
||||
@ -393,8 +393,6 @@ class GUI_EXPORT QgsExpressionBuilderWidget : public QWidget, private Ui::QgsExp
|
||||
*/
|
||||
void setParserError( bool parserError );
|
||||
|
||||
void loadFieldValues( const QVariantMap &values );
|
||||
|
||||
// Will hold items with
|
||||
// * a display string that matches the represented field values
|
||||
// * custom data in Qt::UserRole + 1 that contains a ready to use expression literal ('quoted string' or NULL or a plain number )
|
||||
@ -409,7 +407,6 @@ class GUI_EXPORT QgsExpressionBuilderWidget : public QWidget, private Ui::QgsExp
|
||||
QgsExpressionHighlighter *highlighter = nullptr;
|
||||
bool mExpressionValid = false;
|
||||
QgsDistanceArea mDa;
|
||||
QMap<QString, QVariantMap> mFieldValues;
|
||||
QgsExpressionContext mExpressionContext;
|
||||
QPointer< QgsProject > mProject;
|
||||
bool mEvalError = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user