[Qt-interest] problem in QTooltip
chandrasekar wagmare
sekarwagmare at gmail.com
Fri Apr 3 14:29:56 CEST 2009
hi friends,
i am having a window with size (10,800,1010,40) .. its having a
button (*diagnosButton*) ... a thread is running parallel which will
receive communication from server and emit a signal *newMessage (QString*)
... in my mainwindow i get the signal of thread and called a slot ()
this is the slot
*void TidBar::showToolTip(const QString &message)
{
QFont serifFont("Times", 12, QFont::Bold);
QPalette color;
int setval = 0;
color.setColor(
QPalette::Inactive,QPalette::QPalette::ToolTipBase,Qt::yellow);
//value =
diagnosButton->mapToGlobal(diagnosButton->rect().topLeft());
value = diagnosButton->mapToGlobal(QPoint(0, 0));
qreal x = value.x();
qreal y = value.y();
QRect rectval = this->rect();
QPoint value2 (x + 70, y - 54);
QToolTip::setPalette(color);
QToolTip::setFont(serifFont);
QToolTip::showText(value2, message,this ,rectval );
}
*
i try to show a tooltip with the message from the thread signal
newMessage(QString) .... i thought this tooltip will last for long until i
move the cursor outside the window ...
*but the tooltip disapper or hide afer few seconds* .... i dont
know where i mistaked .... please help
--
CHANDRU
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090403/1e63354e/attachment.html
More information about the Qt-interest-old
mailing list