16 #ifndef QGSDATADEFINEDSIZELEGENDWIDGET_H
17 #define QGSDATADEFINEDSIZELEGENDWIDGET_H
23 #include "ui_qgsdatadefinedsizelegendwidget.h"
27 #include <QStyledItemDelegate>
29 class QStandardItemModel;
46 class GUI_EXPORT QgsDataDefinedSizeLegendWidget :
public QgsPanelWidget,
private Ui::QgsDataDefinedSizeLegendWidget
58 ~QgsDataDefinedSizeLegendWidget()
override;
69 void removeSizeClass();
70 void onSizeClassesChanged();
73 std::unique_ptr<QgsMarkerSymbol> mSourceSymbol;
74 bool mOverrideSymbol =
false;
81 QStandardItemModel *mSizeClassesModel =
nullptr;
88 class SizeClassDelegate :
public QStyledItemDelegate
93 SizeClassDelegate( QObject *parent )
94 : QStyledItemDelegate( parent )
98 QWidget *createEditor( QWidget *parent,
const QStyleOptionViewItem &,
const QModelIndex & )
const override
100 QLineEdit *lineEdit =
new QLineEdit( parent );
101 QDoubleValidator *validator =
new QDoubleValidator( 0, 1e6, 1, lineEdit );
102 lineEdit->setValidator( validator );
110 #endif // QGSDATADEFINEDSIZELEGENDWIDGET_H