UserGroupingLineEdit.cpp
Go to the documentation of this file.
1 #include "UserGroupingLineEdit.h"
2 
3 #include <sstream>
4 
5 namespace armarx
6 {
8  const std::set<uint32_t>& validSegmentIDs, uint32_t segmentID) :
9  groupID(segmentID), validSegmentIDs(validSegmentIDs)
10  {
11  connect(this, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
12  }
13 
15  {
16  return groupID;
17  }
18 
20  {
21  groupID = value;
22  }
23 
24  void UserGroupingLineEdit::onEditingFinished()
25  {
26  // parse text
27  std::vector<uint32_t> segments;
28 
29  std::stringstream textStream(text().toStdString());
30 
31  uint32_t id;
32  while (textStream >> id)
33  {
34  if (validSegmentIDs.find(id) != validSegmentIDs.end())
35  {
36  segments.push_back(id);
37  }
38  }
39 
40  emit groupingChanged(groupID, segments);
41  }
42 }
armarx::UserGroupingLineEdit::groupingChanged
void groupingChanged(uint32_t groupID, std::vector< uint32_t > segmentIDs)
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:926
armarx::UserGroupingLineEdit::setGroupID
void setGroupID(const uint32_t &value)
Definition: UserGroupingLineEdit.cpp:19
UserGroupingLineEdit.h
armarx::UserGroupingLineEdit::getGroupID
uint32_t getGroupID() const
Definition: UserGroupingLineEdit.cpp:14
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::UserGroupingLineEdit::UserGroupingLineEdit
UserGroupingLineEdit(const std::set< uint32_t > &validSegmentIDs, uint32_t groupID=0)
Definition: UserGroupingLineEdit.cpp:7