CustusX  2023.01.05-dev+develop.0da12
An IGT application
cx::PresetWidget Class Reference

Base class for preset handling. Takes care of making a uniform preset system. Contains a preset selector, functionality for resetting to a default preset, saving new presets and deleting presets. More...

#include <cxPresetWidget.h>

Inheritance diagram for cx::PresetWidget:
cx::BaseWidget cx::OptimizedUpdateWidget cx::FilterPresetWidget cx::TransferFunctionPresetWidget

Public Slots

virtual void resetSlot ()
 
virtual void saveSlot ()
 
virtual void deleteSlot ()
 
virtual void populatePresetListSlot ()
 Fill the preset list with the available presets. More...
 
- Public Slots inherited from cx::BaseWidget
void adjustSizeSlot ()
 
- Public Slots inherited from cx::OptimizedUpdateWidget
virtual void setModified ()
 

Signals

void presetSelected (QString name)
 

Public Member Functions

 PresetWidget (QWidget *parent)
 
virtual ~PresetWidget ()
 
bool requestSetCurrentPreset (QString name)
 tries to set the preset to the requested name More...
 
QString getCurrentPreset ()
 returns the name of the currently selected preset More...
 
void showDetailed (bool detailed)
 sets the presetwidget in detailed mode or not More...
 
virtual void setPresets (PresetsPtr presets)
 
QString getLastUsedPresetNameFromSettingsFile () const
 
- Public Member Functions inherited from cx::BaseWidget
 BaseWidget (QWidget *parent, QString objectName, QString windowTitle)
 
virtual ~BaseWidget ()
 
QWidget * createMethodWidget (QWidget *inputWidget, QWidget *outputWidget, QString methodname, bool inputChecked=false, bool outputVisible=true)
 Create a specialized widget for filters, with input/ouput, enable and options. More...
 
QGroupBox * createGroupbox (QWidget *widget, QString boxname)
 Create a group box with a given name. More...
 
QGroupBox * wrapInGroupBox (QWidget *base, QString name)
 
CXFramewrapInFrame (QWidget *base)
 
QAction * createAction2 (QObject *parent, QIcon iconName, QString text, QString tip, QLayout *layout=NULL, QToolButton *button=new QToolButton())
 
template<class T >
QAction * createAction (QObject *parent, QIcon iconName, QString text, QString tip, T slot, QLayout *layout=NULL, QToolButton *button=new QToolButton())
 
- Public Member Functions inherited from cx::OptimizedUpdateWidget
 OptimizedUpdateWidget (QWidget *parent=NULL)
 
virtual ~OptimizedUpdateWidget ()
 
void forcePrePaint ()
 

Protected Slots

virtual void presetsBoxChangedSlot (const QString &)
 

Protected Member Functions

virtual void populateButtonLayout ()
 makes buttons based on the actions found in the actiongroup More...
 
void populatePresetList (QStringList list)
 populates the preset combobox More...
 
QString getNewPresetName (bool withoutSpaces)
 
- Protected Member Functions inherited from cx::BaseWidget
virtual void showEvent (QShowEvent *event)
 
- Protected Member Functions inherited from cx::OptimizedUpdateWidget
virtual void prePaintEvent ()
 
virtual void paintEvent (QPaintEvent *event)
 

Protected Attributes

QActionGroup * mActionGroup
 contains all actions that will have buttons More...
 
PresetsPtr mPresets
 

Additional Inherited Members

- Static Public Member Functions inherited from cx::BaseWidget
static QFrame * createHorizontalLine ()
 Creates a horizontal line which can be inserted into widgets. More...
 

Detailed Description

Base class for preset handling. Takes care of making a uniform preset system. Contains a preset selector, functionality for resetting to a default preset, saving new presets and deleting presets.

Date
Mar 8, 2013
Author
Janne Beate Bakeng, SINTEF

Definition at line 34 of file cxPresetWidget.h.

Constructor & Destructor Documentation

cx::PresetWidget::PresetWidget ( QWidget *  parent)

Definition at line 22 of file cxPresetWidget.cpp.

virtual cx::PresetWidget::~PresetWidget ( )
inlinevirtual

Definition at line 40 of file cxPresetWidget.h.

Member Function Documentation

void cx::PresetWidget::deleteSlot ( )
virtualslot

Definition at line 127 of file cxPresetWidget.cpp.

QString cx::PresetWidget::getCurrentPreset ( )

returns the name of the currently selected preset

Definition at line 65 of file cxPresetWidget.cpp.

QString cx::PresetWidget::getLastUsedPresetNameFromSettingsFile ( ) const

Definition at line 103 of file cxPresetWidget.cpp.

QString cx::PresetWidget::getNewPresetName ( bool  withoutSpaces = false)
protected

Definition at line 187 of file cxPresetWidget.cpp.

void cx::PresetWidget::populateButtonLayout ( )
protectedvirtual

makes buttons based on the actions found in the actiongroup

Definition at line 144 of file cxPresetWidget.cpp.

void cx::PresetWidget::populatePresetList ( QStringList  list)
protected

populates the preset combobox

Definition at line 175 of file cxPresetWidget.cpp.

void cx::PresetWidget::populatePresetListSlot ( )
virtualslot

Fill the preset list with the available presets.

Definition at line 133 of file cxPresetWidget.cpp.

void cx::PresetWidget::presetsBoxChangedSlot ( const QString &  name)
protectedvirtualslot

Definition at line 138 of file cxPresetWidget.cpp.

void cx::PresetWidget::presetSelected ( QString  name)
signal
bool cx::PresetWidget::requestSetCurrentPreset ( QString  name)

tries to set the preset to the requested name

Definition at line 56 of file cxPresetWidget.cpp.

void cx::PresetWidget::resetSlot ( )
virtualslot

Definition at line 116 of file cxPresetWidget.cpp.

void cx::PresetWidget::saveSlot ( )
virtualslot

Definition at line 121 of file cxPresetWidget.cpp.

void cx::PresetWidget::setPresets ( PresetsPtr  presets)
virtual

Definition at line 87 of file cxPresetWidget.cpp.

void cx::PresetWidget::showDetailed ( bool  detailed)

sets the presetwidget in detailed mode or not

Definition at line 70 of file cxPresetWidget.cpp.

Member Data Documentation

QActionGroup* cx::PresetWidget::mActionGroup
protected

contains all actions that will have buttons

Definition at line 67 of file cxPresetWidget.h.

PresetsPtr cx::PresetWidget::mPresets
protected

Definition at line 68 of file cxPresetWidget.h.


The documentation for this class was generated from the following files: