27 #ifndef __TY_PALETTE_WIDGET__
28 #define __TY_PALETTE_WIDGET__
48 #include <QVBoxLayout>
52 #include <QItemDelegate>
53 #include <QDoubleSpinBox>
55 #include <QTextStream>
105 virtual void apply();
161 int rowCount(
const QModelIndex& parent = QModelIndex())
const;
162 int columnCount(
const QModelIndex& parent = QModelIndex())
const;
164 QVariant
data(
const QModelIndex& index,
int role)
const;
165 QVariant
headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole)
const;
167 Qt::ItemFlags
flags(
const QModelIndex& index)
const;
168 bool setData(
const QModelIndex& index,
const QVariant& value,
int role = Qt::EditRole);
171 void addRow(
float noiseLevel);
176 return index.row() ==
rowCount(QModelIndex()) - 1;
195 QWidget*
createEditor(QWidget* parent,
const QStyleOptionViewItem& option,
196 const QModelIndex& index)
const;
198 void setEditorData(QWidget* editor,
const QModelIndex& index)
const;
199 void setModelData(QWidget* editor, QAbstractItemModel* model,
const QModelIndex& index)
const;
215 QWidget*
createEditor(QWidget* parent,
const QStyleOptionViewItem& option,
216 const QModelIndex& index)
const;
218 void setEditorData(QWidget* editor,
const QModelIndex& index)
const;
219 void setModelData(QWidget* editor, QAbstractItemModel* model,
const QModelIndex& index)
const;
(Qt) Delegate for displaying and editing colors
void setEditorData(QWidget *editor, const QModelIndex &index) const
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
PaletteColorDelegate(QObject *parent=NULL)
PaletteEditor(TYPalette *palette, QWidget *parent=NULL)
QPushButton * deleteNoiseLevelButton
void propagateModelChanges(const QModelIndex &topLeft, const QModelIndex &bottomRight)
PaletteValueDelegate value_delegate
QDoubleSpinBox * newNoiseLevelSpin
void notifyTYPaletteExternalyChanged()
PaletteColorDelegate color_delegate
QPushButton * newNoiseLevelButton
void paletteChanged(const TYPalette *palette)
(Qt) Data model for a TYPalette
void addRow(float noiseLevel)
bool isSpecialInfiniteCell(const QModelIndex &index) const
void getBoundsForValue(unsigned i, float &inf, float &sup) const
std::set< unsigned > checked_rows
void deleteSelectedRows()
QVariant data(const QModelIndex &index, int role) const
PaletteModel(TYPalette *p_palette, QObject *parent=NULL)
int rowCount(const QModelIndex &parent=QModelIndex()) const
Qt::ItemFlags flags(const QModelIndex &index) const
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
int columnCount(const QModelIndex &parent=QModelIndex()) const
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
(Qt) Delegate for displaying and editing colors
PaletteValueDelegate(QObject *parent=NULL)
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
void setEditorData(QWidget *editor, const QModelIndex &index) const
Classe de definition d'une palette.