22 #ifndef _sawNoteRecorderQtComponent_h
23 #define _sawNoteRecorderQtComponent_h
26 #include <QDockWidget>
27 #include <QTimerEvent>
28 #include <QErrorMessage>
36 #include "ui_sawNoteRecorderQtWidget.h"
37 #include <QButtonGroup>
39 #include <QPushButton>
41 #include <QVBoxLayout>
42 #include <QHBoxLayout>
43 #include <QDockWidget>
44 #include <QSizePolicy>
64 NoteWidget(
const QObject * noteRecorder, QString note) :
70 RemoveButton.setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
71 SaveButton.setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum);
72 NoteLineEdit.setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
74 QHBoxLayout *horLayout =
new QHBoxLayout(
this) ;
76 this->setLayout(horLayout);
78 horLayout->addWidget(&SaveButton);
79 horLayout->addWidget(&NoteLineEdit);
80 horLayout->addWidget(&RemoveButton);
82 NoteLineEdit.setText(note);
88 connect(&NoteLineEdit, SIGNAL( returnPressed()),
this, SLOT(
QSlotSaveClicked()));
89 RemoveButton.setToolTip(
"Remove Note from GUI");
91 RemoveButton.setStyleSheet(
" QPushButton { background: qradialgradient(cx:0, cy:0, radius: 2, fx:0.5, fy:0.5, stop:0 white, stop:1 rgba(190,0,0, 60%)); border-radius: 3px;}");
93 SaveButton.setStyleSheet(
" QPushButton { background-color : rgb(0, 180, 0); }");
98 double t = currentTime - ClickTime;
100 if (t <= decayTime) {
102 int color =
static_cast<int>(255 - (t/decayTime * 255));
104 QString ss =
"QLineEdit { background-color : hsv(120," + QString::number(color) +
",255); }";
105 NoteLineEdit.setStyleSheet(ss);
110 QString
GetText(
void) {
return NoteLineEdit.text();};
117 QPushButton SaveButton;
118 QPushButton RemoveButton;
119 QLineEdit NoteLineEdit;
154 void Configure(
const std::string & filename =
"");
164 QVBoxLayout NotesVLayout;
166 void AddNote(
const QString & noteTxt);
172 Ui::sawNoteRecorderQtWidget NoteRecorderWidget;
173 void MakeQTConnections(
void);
175 QVector<NoteWidget *> NoteVec;
179 QErrorMessage * ErrorMessageDialog;
180 void ErrorMessage(
const std::string & message);
182 void timerEvent(QTimerEvent *);
184 void RangeChangedEvent(
void) {
185 emit QSignalUpdateRange();
193 void QSlotAddExtraNoteClicked();
194 void QSlotNewLogFileClicked();
203 void QSlotPathClicked(
void);
206 void QSignalUpdateRange(
void);
212 #endif //_sawNoteRecorderQtComponent_h
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
static mtsManagerLocal * GetInstance(void)
Declaration of osaTimeServer class.
std::ofstream * LogFile
Definition: mtsComponent.h:461
QDockWidget * GetWidget(void)
Definition: sawNoteRecorderQtComponent.h:148
Declaration of Local Component ManagerThis class defines the local component manager (LCM) that manag...
void Show()
Definition: sawNoteRecorderQtComponent.h:156
Declaration of mtsComponent.
#define CMN_LOG_ALLOW_VERBOSE
Definition: cmnLogLoD.h:73
Definition: mtsComponent.h:150
double GetAbsoluteTimeInSeconds(void) const
#define CMN_DECLARE_SERVICES(hasDynamicCreation, lod)
Definition: cmnClassRegisterMacros.h:116
void QSlotLoadPresetsClicked()
Definition: sawNoteRecorderQtComponent.h:199
void Hide()
Definition: sawNoteRecorderQtComponent.h:157
Class for relative time.
Definition: osaTimeServer.h:73
void QSlotSavePresetsClicked()
Definition: sawNoteRecorderQtComponent.h:196
const int CMN_NO_DYNAMIC_CREATION
Definition: cmnClassRegisterMacros.h:328
virtual void Configure(const std::string &filename="")
const osaTimeServer & GetTimeServer(void) const
#define CMN_DECLARE_SERVICES_INSTANTIATION(className)
Definition: cmnClassRegisterMacros.h:202
Definition: sawNoteRecorderQtComponent.h:141