27 #include <QPushButton>
32 #define FADE_TIMER_MSEC 100
33 #define FADE_DURATION 2000
63 widget.labelCaption->setText(
"");
64 widget.labelSubcaption->setText(
"");
66 connect(&fadeTimer, SIGNAL(timeout()),
this, SLOT(
timerEvent()));
70 connect(widget.labelCaption, SIGNAL(doubleClicked()),
this, SLOT(
clearText()));
81 ARMARX_DEBUG <<
"New message: " << caption <<
" (" << subCaption <<
")";
82 emit
setMessageContent(QString::fromStdString(caption), QString::fromStdString(subCaption));
88 emit setCaptionContent(QString::fromStdString(caption));
94 emit setSubCaptionContent(QString::fromStdString(subCaption));
102 if (fadeDuration <= 0)
107 std::stringstream ss;
108 ss <<
"#" << std::hex << (int)(255 * (((
float)fadeDuration) /
FADE_DURATION)) <<
"0000";
110 ARMARX_INFO << (
"<font color='" + QString::fromStdString(ss.str()) +
"'>" + currentCaption +
"</font>").toStdString();
111 widget.labelCaption->setText(
"<font color='" + QString::fromStdString(ss.str()) +
"'>" + currentCaption +
"</font>");
112 widget.labelSubcaption->setText(
"<font color='" + QString::fromStdString(ss.str()) +
"'>" + currentSubCaption +
"</font>");
117 currentCaption = caption;
118 currentSubCaption = subcaption;
124 currentCaption = caption;
129 currentSubCaption = subcaption;
137 widget.labelCaption->setText(
"<font color='#FF0000'>" + currentCaption +
"</font>");
138 widget.labelSubcaption->setText(
"<font color='#FF0000'>" + currentSubCaption +
"</font>");
146 widget.labelCaption->setText(
"");
147 widget.labelSubcaption->setText(
"");
152 QToolBar* customToolbar =
new QToolBar(parent);
153 customToolbar->addAction(
"clear",
this, SLOT(
clearText()));
154 return customToolbar;