15 #ifndef QGSCOLORSCHEMELIST_H 16 #define QGSCOLORSCHEMELIST_H 20 #include <QAbstractItemModel> 21 #include <QItemDelegate> 48 const QPixmap &transparentBackground()
const;
82 QVariant headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole )
const override;
166 bool saveColorsToScheme();
172 bool importColorsFromGpl(
QFile &file );
178 bool exportColorsToGpl(
QFile &file );
183 bool isDirty()
const;
203 void removeSelection();
226 void colorSelected(
const QColor &color );
241 QPoint mDragStartPosition;
virtual int rowCount(const QModelIndex &parent) const=0
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const=0
QgsNamedColorList colors() const
Returns a list of colors shown in the widget.
QColor baseColor() const
Get the base color for the color scheme used by the model.
Abstract base class for color schemes.
QString context() const
Get the current color scheme context for the model.
virtual bool insertRows(int row, int count, const QModelIndex &parent)
virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
virtual QStringList mimeTypes() const
virtual Qt::DropActions supportedDropActions() const
virtual QVariant data(const QModelIndex &index, int role) const=0
virtual bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index)
virtual QMimeData * mimeData(const QModelIndexList &indexes) const
virtual void mouseReleaseEvent(QMouseEvent *event)
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const=0
An editable list of color swatches, taken from an associated QgsColorScheme.
virtual bool removeRows(int row, int count, const QModelIndex &parent)
bool isDirty() const
Returns whether the color scheme model has been modified.
virtual int columnCount(const QModelIndex &parent) const=0
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const=0
virtual bool setData(const QModelIndex &index, const QVariant &value, int role)
virtual Qt::ItemFlags flags(const QModelIndex &index) const
virtual void mousePressEvent(QMouseEvent *event)
virtual void keyPressEvent(QKeyEvent *event)
A delegate for showing a color swatch in a list.
A model for colors in a color scheme.