28 #include <QPushButton>
33 #define FADE_TIMER_MSEC 100
34 #define FADE_DURATION 2000
61 widget.labelCaption->setText(
"");
62 widget.labelSubcaption->setText(
"");
64 connect(&fadeTimer, SIGNAL(timeout()),
this, SLOT(
timerEvent()));
75 connect(widget.labelCaption, SIGNAL(doubleClicked()),
this, SLOT(
clearText()));
85 const std::string& subCaption,
88 ARMARX_DEBUG <<
"New message: " << caption <<
" (" << subCaption <<
")";
89 emit
setMessageContent(QString::fromStdString(caption), QString::fromStdString(subCaption));
97 emit setCaptionContent(QString::fromStdString(caption));
105 emit setSubCaptionContent(QString::fromStdString(subCaption));
112 if (fadeDuration <= 0)
117 std::stringstream ss;
118 ss <<
"#" << std::hex << (int)(255 * (((
float)fadeDuration) /
FADE_DURATION)) <<
"0000";
120 ARMARX_INFO << (
"<font color='" + QString::fromStdString(ss.str()) +
"'>" + currentCaption +
123 widget.labelCaption->setText(
"<font color='" + QString::fromStdString(ss.str()) +
"'>" +
124 currentCaption +
"</font>");
125 widget.labelSubcaption->setText(
"<font color='" + QString::fromStdString(ss.str()) +
"'>" +
126 currentSubCaption +
"</font>");
131 const QString& subcaption)
133 currentCaption = caption;
134 currentSubCaption = subcaption;
141 currentCaption = caption;
148 currentSubCaption = subcaption;
157 widget.labelCaption->setText(
"<font color='#FF0000'>" + currentCaption +
"</font>");
158 widget.labelSubcaption->setText(
"<font color='#FF0000'>" + currentSubCaption +
"</font>");
167 widget.labelCaption->setText(
"");
168 widget.labelSubcaption->setText(
"");
174 QToolBar* customToolbar =
new QToolBar(parent);
175 customToolbar->addAction(
"clear",
this, SLOT(
clearText()));
176 return customToolbar;