15 #ifndef QGSCOLORSCHEMELIST_H
16 #define QGSCOLORSCHEMELIST_H
20 #include <QAbstractItemModel>
21 #include <QItemDelegate>
38 void paint( QPainter * painter,
const QStyleOptionViewItem & option,
const QModelIndex &
index )
const;
39 QSize sizeHint(
const QStyleOptionViewItem & option,
const QModelIndex & index )
const;
40 bool editorEvent( QEvent * event, QAbstractItemModel * model,
const QStyleOptionViewItem & option,
const QModelIndex & index );
48 const QPixmap &transparentBackground()
const;
75 QModelIndex
index(
int row,
int column,
const QModelIndex &parent = QModelIndex() )
const;
76 QModelIndex parent(
const QModelIndex &index )
const;
77 int rowCount(
const QModelIndex &parent = QModelIndex() )
const;
78 int columnCount(
const QModelIndex &parent = QModelIndex() )
const;
79 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole )
const;
80 Qt::ItemFlags flags(
const QModelIndex & index )
const;
81 bool setData(
const QModelIndex & index,
const QVariant & value,
int role = Qt::EditRole );
82 QVariant headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole )
const;
83 Qt::DropActions supportedDropActions()
const;
84 QStringList mimeTypes()
const;
85 bool removeRows(
int row,
int count,
const QModelIndex & parent = QModelIndex() );
86 bool insertRows(
int row,
int count,
const QModelIndex &parent = QModelIndex() );
87 QMimeData *mimeData(
const QModelIndexList &indexes )
const;
88 bool dropMimeData(
const QMimeData *data, Qt::DropAction action,
int row,
int column,
const QModelIndex &parent );
100 void setScheme(
QgsColorScheme* scheme,
const QString context = QString(),
const QColor baseColor = QColor() );
118 void addColor(
const QColor color,
const QString label = QString() );
166 bool saveColorsToScheme();
172 bool importColorsFromGpl( QFile &
file );
178 bool exportColorsToGpl( QFile &file );
183 bool isDirty()
const;
192 void setScheme(
QgsColorScheme* scheme,
const QString context = QString(),
const QColor baseColor = QColor() );
196 void removeSelection();
202 void addColor(
const QColor color,
const QString label = QString() );
219 void colorSelected(
const QColor color );
223 void keyPressEvent( QKeyEvent* event );
225 void mousePressEvent( QMouseEvent* event );
227 void mouseReleaseEvent( QMouseEvent* event );
234 QPoint mDragStartPosition;