18 #ifndef QGSPROPERTYASSISTANTWIDGET_H
19 #define QGSPROPERTYASSISTANTWIDGET_H
23 #include "ui_qgspropertyassistantwidgetbase.h"
24 #include "ui_qgspropertysizeassistantwidget.h"
25 #include "ui_qgspropertycolorassistantwidget.h"
26 #include "ui_qgspropertygenericnumericassistantwidget.h"
31 #include <QStandardItemModel>
32 #include <QItemDelegate>
40 class GUI_EXPORT QgsPropertyAbstractTransformerWidget :
public QWidget
48 , mDefinition( definition )
65 class GUI_EXPORT QgsPropertyGenericNumericAssistantWidget :
public QgsPropertyAbstractTransformerWidget,
private Ui::PropertyGenericNumericAssistant
77 class GUI_EXPORT QgsPropertySizeAssistantWidget :
public QgsPropertyAbstractTransformerWidget,
private Ui::PropertySizeAssistant
90 class GUI_EXPORT QgsPropertyColorAssistantWidget :
public QgsPropertyAbstractTransformerWidget,
private Ui::PropertyColorAssistant
149 void setSymbol( std::shared_ptr< QgsSymbol > symbol ) { mSymbol = symbol; updatePreview(); }
SIP_SKIP
154 void computeValuesFromLayer();
155 void updatePreview();
163 QgsPropertyAbstractTransformerWidget *mTransformerWidget =
nullptr;
167 QStandardItemModel mPreviewList;
169 std::shared_ptr< QgsSymbol > mSymbol;
171 bool computeValuesFromExpression(
const QString &expression,
double &minValue,
double &maxValue )
const;
172 bool computeValuesFromField(
const QString &fieldName,
double &minValue,
double &maxValue )
const;
179 class QgsAssistantPreviewItemDelegate :
public QItemDelegate
184 explicit QgsAssistantPreviewItemDelegate( QStandardItemModel *model ) : mModel( model ) {}
186 QSize sizeHint(
const QStyleOptionViewItem & ,
const QModelIndex &index )
const override
188 QSize size = mModel->item( index.row() )->icon().actualSize( QSize( 512, 512 ) );
194 QStandardItemModel *mModel =
nullptr;
202 #endif // QGSPROPERTYASSISTANTWIDGET_H