PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
QPlusStatusIcon.h
Go to the documentation of this file.
1 /*=Plus=header=begin======================================================
2  Program: Plus
3  Copyright (c) Laboratory for Percutaneous Surgery. All rights reserved.
4  See License.txt for details.
5 =========================================================Plus=header=end*/
6 
7 #ifndef STATUSICON_H
8 #define STATUSICON_H
9 
10 // Local includes
11 #include "PlusConfigure.h"
12 #include "PlusWidgetsExport.h"
13 
14 // VTK includes
15 #include <vtkCallbackCommand.h>
16 
17 // Qt includes
18 #include <QLabel>
19 #include <QLineEdit>
20 #include <QPushButton>
21 #include <QTextEdit>
22 #include <QWidget>
23 #include <QTimer>
24 
25 //-----------------------------------------------------------------------------
26 
31 class vtkDisplayMessageCallback : public QObject, public vtkCallbackCommand
32 {
33  Q_OBJECT
34 
35 public:
37  {
39  return cb;
40  }
41 
43  : QObject()
44  { }
45 
46  virtual void Execute(vtkObject* caller, unsigned long eventId, void* callData);
47 
48 signals:
49  void AddMessage(QString);
50 };
51 
52 //-----------------------------------------------------------------------------
53 
61 class PlusWidgetsExport QPlusStatusIcon : public QWidget
62 {
63  Q_OBJECT
64 
65 public:
71  QPlusStatusIcon(QWidget* aParent = 0, Qt::WindowFlags aFlags = 0);
72 
76  ~QPlusStatusIcon();
77 
78  void SetMaxMessageCount(int count);
79 
80 protected:
87  bool eventFilter(QObject* obj, QEvent* ev);
88 
89  void resizeEvent(QResizeEvent* event);
90 
95  PlusStatus ConstructMessageListWidget();
96 
100  void ResetIconState();
101 
105  void ParseMessage(QString& aInputString);
106 
110  void ApplyFilter();
111 
112 protected slots:
116  void CreateCustomContextMenu(const QPoint& aPoint);
117 
121  void ClearMessageList();
122 
126  void ClearFilterButtonClicked();
127 
131  void FilterLineEditEdited(const QString&);
132 
136  void ApplyFilterTimerFired();
137 
138 public slots:
143  void AddMessage(QString aInputString);
144 
145 protected:
147  int m_Level;
148 
150  QLabel* m_DotLabel;
151 
154 
156  QTextEdit* m_MessageTextEdit;
157 
159  QLineEdit* m_FilterLineEdit;
161  QPushButton* m_ClearFilterButton;
164 
168 
170  std::vector<QString> m_MessageLog;
171 
172  /* Allow a maximum number of messages to be logged */
174 };
175 
176 #endif
QTextEdit * m_MessageTextEdit
igsioStatus PlusStatus
Definition: PlusCommon.h:40
QLineEdit * m_FilterLineEdit
QPushButton * m_ClearFilterButton
unsigned long m_DisplayMessageCallbackTag
unsigned long m_DisplayWideMessageCallbackTag
static vtkDisplayMessageCallback * New()
Callback command class that catches the log message event and adds it to the text field of the status...
Phidget_ChannelClass uint32_t * count
Definition: phidget22.h:1321
virtual void Execute(vtkObject *caller, unsigned long eventId, void *callData)
QFrame * m_MessageListFrame
std::vector< QString > m_MessageLog