OpenMS
MetaInfoVisualizer Class Reference

MetaInfoVisualizer is a visualizer class for all classes that use one MetaInfo object as member. More...

#include <OpenMS/VISUAL/VISUALIZER/MetaInfoVisualizer.h>

Inheritance diagram for MetaInfoVisualizer:
[legend]
Collaboration diagram for MetaInfoVisualizer:
[legend]

Public Slots

void store () override
 
- Public Slots inherited from BaseVisualizerGUI
virtual void store ()=0
 Saves the changes made in the GUI to the object. More...
 

Public Member Functions

 MetaInfoVisualizer (bool editable=false, QWidget *parent=nullptr)
 Constructor. More...
 
void load (MetaInfoInterface &m)
 
- Public Member Functions inherited from BaseVisualizerGUI
 BaseVisualizerGUI (bool editable=false, QWidget *parent=nullptr)
 Constructor. More...
 
bool isEditable () const
 Returns if the values are editable. More...
 
- Public Member Functions inherited from BaseVisualizer< MetaInfoInterface >
void load (MetaInfoInterface &o)
 Loads the object that is to be edited. More...
 
virtual ~BaseVisualizer ()
 

Protected Slots

void add_ ()
 Adds a new Type-Value pair to the MetaInfo Object. More...
 
void clear_ ()
 Clears out all fields. More...
 
void remove_ (int)
 Removes a selected Type-Value pair from the MetaInfo Object. More...
 
void undo_ ()
 Undo the changes made in the GUI. More...
 

Protected Member Functions

void loadData_ (UInt index)
 Loads all Type-Value pairs one after another. More...
 
- Protected Member Functions inherited from BaseVisualizerGUI
void addLabel_ (const QString &label)
 Adds a label to the grid layout. More...
 
void addLabel_ (const QString &label, UInt row)
 Adds a label to a certain row. More...
 
void addLineEdit_ (QLineEdit *&ptr, QString label)
 Adds a line edit field with label to the grid layout. More...
 
void addIntLineEdit_ (QLineEdit *&ptr, QString label)
 Adds a line edit field to the grid layout including a int validator. More...
 
void addDoubleLineEdit_ (QLineEdit *&ptr, QString label)
 Adds a line edit field to the grid layout including a double validator. More...
 
void addLineEditButton_ (const QString &label, QLineEdit *&ptr1, QPushButton *&ptr2, const QString &buttonlabel)
 Adds a line edit field with label and button to the next free position in the grid. More...
 
void addListView_ (QListWidget *&ptr, QString label)
 Adds a list edit field to the grid layout. More...
 
void addTextEdit_ (QTextEdit *&ptr, QString label)
 Adds a text edit field to the grid layout. More...
 
void addComboBox_ (QComboBox *&ptr, QString label)
 Adds a drop-down field to the grid layout. More...
 
void addBooleanComboBox_ (QComboBox *&ptr, QString label)
 Adds a boolean drop-down field to the grid layout ( 'true'=1, 'false'=0 ). More...
 
void fillComboBox_ (QComboBox *&ptr, const std::string *items, int item_count)
 Fills a combo box with string items (the number of strings is determined by item_count). More...
 
void addVSpacer_ ()
 Adds vertical spacer. More...
 
void addButton_ (QPushButton *&ptr, const QString &label)
 Adds a button to the next free position in the grid. More...
 
void add2Buttons_ (QPushButton *&ptr1, const QString &label1, QPushButton *&ptr2, const QString &label2)
 Adds two buttons in a row. More...
 
void addSeparator_ ()
 Adds a horizontal line as a separator. More...
 
void finishAdding_ ()
 Adds buttons common to all visualizers. More...
 
- Protected Member Functions inherited from BaseVisualizer< MetaInfoInterface >
virtual void update_ ()
 Updates the GUI from the temp_ variable. More...
 

Protected Attributes

Edit fields for new Type-Value pair.
QLineEditnewkey_
 
QLineEditnewvalue_
 
QLineEditnewdescription_
 
Arrays of pointers to objects for temporary metaInfo data
std::vector< std::pair< UInt, QLineEdit * > > metainfoptr_
 
std::vector< std::pair< UInt, QLabel * > > metalabels_
 
std::vector< std::pair< UInt, QAbstractButton * > > metabuttons_
 
Edit fields and buttons
QPushButton * addbutton_
 
QPushButton * clearbutton_
 
QButtonGroup * buttongroup_
 
int nextrow_
 Counter to keep track of the actual row in the layout. More...
 
QGridLayout * viewlayout_
 The layout to display the Type-Value pairs. More...
 
std::vector< UIntkeys_
 Container for metainfo data. More...
 
- Protected Attributes inherited from BaseVisualizerGUI
QPushButton * undo_button_
 Undo button. More...
 
QGridLayout * mainlayout_
 The main layout. More...
 
UInt row_
 Counter for the current grid row. More...
 
bool editable_
 Edit flag. More...
 
- Protected Attributes inherited from BaseVisualizer< MetaInfoInterface >
MetaInfoInterfaceptr_
 Pointer to the object that is currently edited. More...
 
MetaInfoInterface temp_
 Copy of current object used to restore the original values. More...
 

Additional Inherited Members

- Signals inherited from BaseVisualizerGUI
void sendStatus (std::string status)
 Sends a status message, if date is not in proper format. More...
 

Detailed Description

MetaInfoVisualizer is a visualizer class for all classes that use one MetaInfo object as member.

Meta information is an array of Type-Name-Value tuples. Classes that have a MetaInfo objects as a member can use this class to edit the MetaInfo object.

Constructor & Destructor Documentation

◆ MetaInfoVisualizer()

MetaInfoVisualizer ( bool  editable = false,
QWidget parent = nullptr 
)

Constructor.

Member Function Documentation

◆ add_

void add_ ( )
protectedslot

Adds a new Type-Value pair to the MetaInfo Object.

◆ clear_

void clear_ ( )
protectedslot

Clears out all fields.

◆ load()

void load ( MetaInfoInterface m)

◆ loadData_()

void loadData_ ( UInt  index)
protected

Loads all Type-Value pairs one after another.

◆ remove_

void remove_ ( int  )
protectedslot

Removes a selected Type-Value pair from the MetaInfo Object.

◆ store

void store ( )
overrideslot

◆ undo_

void undo_ ( )
protectedslot

Undo the changes made in the GUI.

Member Data Documentation

◆ addbutton_

QPushButton* addbutton_
protected

◆ buttongroup_

QButtonGroup* buttongroup_
protected

◆ clearbutton_

QPushButton* clearbutton_
protected

◆ keys_

std::vector<UInt> keys_
protected

Container for metainfo data.

◆ metabuttons_

std::vector<std::pair<UInt, QAbstractButton *> > metabuttons_
protected

◆ metainfoptr_

std::vector<std::pair<UInt, QLineEdit *> > metainfoptr_
protected

◆ metalabels_

std::vector<std::pair<UInt, QLabel *> > metalabels_
protected

◆ newdescription_

QLineEdit* newdescription_
protected

◆ newkey_

QLineEdit* newkey_
protected

◆ newvalue_

QLineEdit* newvalue_
protected

◆ nextrow_

int nextrow_
protected

Counter to keep track of the actual row in the layout.

◆ viewlayout_

QGridLayout* viewlayout_
protected

The layout to display the Type-Value pairs.