VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtMultiMapEditorWidget.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2008 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtMultiMapEditorWidget.h,v $ $Revision: 1.7 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #pragma once
14 #include <vrvCoreQt/vrvCoreQt.h>
16 #include <QtCore/QStringList>
17 #include <QtWidgets/QWidget>
18 #include <map>
19 
20 class QHBoxLayout;
21 class QLabel;
22 class QLineEdit;
23 class QPushButton;
24 class QTreeWidget;
25 class QTreeWidgetItem;
26 class QVBoxLayout;
27 class QAction;
28 class QMenu;
29 
30 namespace makVrv
31 {
34  class DT_DLL_VRVCOREQT DtMultiMapEditorWidget : public QWidget,
36  {
37  Q_OBJECT;
38  public:
39 
41  DtMultiMapEditorWidget(DtDe& de, QWidget* parent, Qt::WindowFlags f = 0);
42 
43  //DTOR
44  virtual ~DtMultiMapEditorWidget();
45 
47  virtual void setColumnTitles( QString keyTitle,QStringList valueTitles);
48 
50  virtual QString columnTitle(int col) const;
51 
54  virtual void setPossibleValues(QStringList values,int column = 1);
55 
57  const QStringList& possibleValues(int column);
58 
60  virtual void addValue(const std::string& key, const std::string& value,
61  int index = 1);
62 
64  virtual void changeValue(const std::string& key, const std::string& oldValue,
65  const std::string& value, int index = 1);
66 
68  virtual void deleteValue(const std::string& key, const std::string& value);
69 
71  virtual void deleteValues(const std::vector<std::string>& key, const std::vector<std::string>& value);
72 
75  virtual void replaceValue(const std::string& key, const std::string& oldValue,
76  const std::string& newValue);
77 
79  virtual void clearValues();
80 
82  virtual void sortItems();
83 
85  virtual void setTitle(const QString&);
86 
88  virtual void unableToRenameParameter(const std::string& oldName);
89 
91  virtual void selectValue(const std::string& key,const std::string& value);
92 
94  virtual void selectFirstValue(const std::string& key);
95 
99  virtual void renameKey(const std::string& oldkey, const std::string& value,
100  const std::string& newkey);
101 
103  virtual QWidget* widget();
104 
106  virtual std::vector<std::string> selectedInstancesNames();
107 
108  protected slots:
109 
110  virtual void on_myTreeWidget_itemActivated(QTreeWidgetItem * item, int column);
111  virtual void on_myTreeWidget_itemClicked(QTreeWidgetItem * item, int column);
112  virtual void on_myTreeWidget_itemChanged(QTreeWidgetItem * item, int column);
113  virtual void on_myAddButton_clicked();
114  virtual void on_myDeleteButton_clicked();
115  virtual void on_keySelected(QAction* action);
116 
117  virtual void on_myTreeWidget_itemSelectionChanged();
118 
119  void editParameterName( QString nameInData );
120 
121  protected:
122 
123  void setupGui();
124 
125  QTreeWidgetItem* findItem( const std::string& key, const std::string& value );
126  bool selectedInstanceNameAndValue(std::vector<std::string>& names, std::vector<std::string>& values) const;
127 
128  virtual void setValid(const std::string& name, const std::string& value,
129  bool valid, const QString& errorText);
130 
131  protected:
132 
134  QVBoxLayout* myMainLayout;
135  QHBoxLayout* myButtonLayout;
141 
142  typedef std::multimap<std::string,QTreeWidgetItem*> FastTreeLoopkupMap;
144  std::map<int,QStringList> myPossibleValueMap;
145  };
146 }

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)