13 #ifndef QmitkLevelWindowPresetDefinitionDialog_h
14 #define QmitkLevelWindowPresetDefinitionDialog_h
18 #include "ui_QmitkLevelWindowPresetDefinition.h"
21 #include <QSortFilterProxyModel>
28 public Ui::QmitkLevelWindowPresetDefinition
37 std::map<std::string, double> &window,
64 Entry(
const std::string &n,
double l,
double w) : name(n), level(l), window(w) {}
68 std::map<std::string, double> &windows,
69 QObject *parent =
nullptr);
71 int rowCount(
const QModelIndex &)
const override;
73 QVariant
data(
const QModelIndex &index,
int)
const override;
75 QVariant
headerData(
int section, Qt::Orientation orientation,
int)
const override;
77 void addPreset(std::string &name,
double level,
double window);
79 void changePreset(
int row, std::string &name,
double level,
double window);
81 void getLevels(std::map<std::string, double> &levels);
89 std::vector<Entry> m_Entries;
QVariant headerData(int section, Qt::Orientation orientation, int) const override
Entry getPreset(const QModelIndex &) const
bool contains(std::string &name)
int rowCount(const QModelIndex &) const override
QVariant data(const QModelIndex &index, int) const override
void removePreset(const QModelIndex &)
int columnCount(const QModelIndex &) const override
void getLevels(std::map< std::string, double > &levels)
void getWindows(std::map< std::string, double > &windows)
void addPreset(std::string &name, double level, double window)
void changePreset(int row, std::string &name, double level, double window)
PresetTableModel(std::map< std::string, double > &levels, std::map< std::string, double > &windows, QObject *parent=nullptr)
std::map< std::string, double > getLevelPresets()
void showEvent(QShowEvent *event) override
QmitkLevelWindowPresetDefinitionDialog(QWidget *parent=nullptr, Qt::WindowFlags f={})
void resizeEvent(QResizeEvent *event) override
void setPresets(std::map< std::string, double > &level, std::map< std::string, double > &window, QString initLevel, QString initWindow)
QSortFilterProxyModel m_SortModel
PresetTableModel * m_TableModel
~QmitkLevelWindowPresetDefinitionDialog() override
void sortPresets(int index)
void ListViewSelectionChanged(const QItemSelection &, const QItemSelection &)
std::map< std::string, double > getWindowPresets()
Entry(const std::string &n, double l, double w)