HAL
channel_selector.cpp
Go to the documentation of this file.
2 
4 
5 #include <QKeyEvent>
6 #include <QLineEdit>
7 
8 namespace hal
9 {
11  {
13  this->setModel(model);
14  }
15 
17  {
18  if (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter)
19  {
20  QString txt = lineEdit()->text();
21  if (!txt.isEmpty())
22  {
24  std::string cname = txt.toStdString();
25  model->handleLogmanagerCallback(spdlog::level::level_enum::debug , cname, cname + " has manually been added to channellist");
26  return;
27  }
28  }
30  }
31 
32 }
Table model for log channels.
Definition: channel_model.h:48
static ChannelModel * instance()
ChannelSelector(QWidget *parent=nullptr)
void keyPressEvent(QKeyEvent *e) override
virtual void keyPressEvent(QKeyEvent *e) override
QLineEdit * lineEdit() const const
QAbstractItemModel * model() const const
void setModel(QAbstractItemModel *model)
int key() const const
bool isEmpty() const const
std::string toStdString() const const
Key_Return