OpenMS
MetaInfoVisualizer.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer:Timo Sachsenberg $
6 // $Authors: Marc Sturm $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 // OpenMS_GUI config
12 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
13 
14 //OpenMS
18 
19 //STL
20 #include <vector>
21 #include <utility>
22 
23 class QAbstractButton;
24 class QButtonGroup;
25 
26 namespace OpenMS
27 {
33  class OPENMS_GUI_DLLAPI MetaInfoVisualizer :
34  public BaseVisualizerGUI,
35  public BaseVisualizer<MetaInfoInterface>
36  {
37  Q_OBJECT
38 
39 public:
41  MetaInfoVisualizer(bool editable = false, QWidget * parent = nullptr);
42 
43  //Docu in base class
45 
46 public slots:
47 
48  //Docu in base class
49  void store() override;
50 
51 protected slots:
52 
54  void add_();
56  void clear_();
58  void remove_(int);
60  void undo_();
61 
62 protected:
64  void loadData_(UInt index);
65 
73 
75 
76  std::vector<std::pair<UInt, QLineEdit *> > metainfoptr_;
77  std::vector<std::pair<UInt, QLabel *> > metalabels_;
78  std::vector<std::pair<UInt, QAbstractButton *> > metabuttons_;
80 
82 
83  QPushButton * addbutton_;
84  QPushButton * clearbutton_;
85  QButtonGroup * buttongroup_;
87 
89  int nextrow_;
90 
92  QGridLayout * viewlayout_;
93 
95  std::vector<UInt> keys_;
96  };
97 
98 
99 }
A base class for all visualizer classes.
Definition: BaseVisualizerGUI.h:40
A base class for all visualizer classes.
Definition: BaseVisualizer.h:28
Interface for classes that can store arbitrary meta information (Type-Name-Value tuples).
Definition: MetaInfoInterface.h:35
MetaInfoVisualizer is a visualizer class for all classes that use one MetaInfo object as member.
Definition: MetaInfoVisualizer.h:36
std::vector< std::pair< UInt, QLabel * > > metalabels_
Definition: MetaInfoVisualizer.h:77
std::vector< std::pair< UInt, QLineEdit * > > metainfoptr_
Definition: MetaInfoVisualizer.h:76
QPushButton * clearbutton_
Definition: MetaInfoVisualizer.h:84
std::vector< UInt > keys_
Container for metainfo data.
Definition: MetaInfoVisualizer.h:95
void load(MetaInfoInterface &m)
QLineEdit * newkey_
Definition: MetaInfoVisualizer.h:69
QLineEdit * newdescription_
Definition: MetaInfoVisualizer.h:71
MetaInfoVisualizer(bool editable=false, QWidget *parent=nullptr)
Constructor.
int nextrow_
Counter to keep track of the actual row in the layout.
Definition: MetaInfoVisualizer.h:89
void clear_()
Clears out all fields.
std::vector< std::pair< UInt, QAbstractButton * > > metabuttons_
Definition: MetaInfoVisualizer.h:78
void undo_()
Undo the changes made in the GUI.
void loadData_(UInt index)
Loads all Type-Value pairs one after another.
void add_()
Adds a new Type-Value pair to the MetaInfo Object.
QPushButton * addbutton_
Definition: MetaInfoVisualizer.h:83
QLineEdit * newvalue_
Definition: MetaInfoVisualizer.h:70
QGridLayout * viewlayout_
The layout to display the Type-Value pairs.
Definition: MetaInfoVisualizer.h:92
void remove_(int)
Removes a selected Type-Value pair from the MetaInfo Object.
QButtonGroup * buttongroup_
Definition: MetaInfoVisualizer.h:85
unsigned int UInt
Unsigned integer type.
Definition: Types.h:64
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19