Hi,
thanks for your sample code. I have used QwtText before as shown below:
text1.
setFont(QFont("Helvetica",
10,
QFont::Bold));
text1.
setColor(QColor(Qt
::yellow));
d_mrk1->setLabel(text1);
QwtText text1("Magnitude: ");
text1.setFont(QFont("Helvetica", 10, QFont::Bold));
text1.setColor(QColor(Qt::yellow));
d_mrk1->setLabel(text1);
To copy to clipboard, switch view to plain text mode
This works perfectly fine. The reason I switched to QString is because I wanted to use arg() so that I can have the string updated with the integer in the arg() as shown in my previous posts.
Now, I realized I can use QString inside QwtText, therefore I got the following solution now:
text1.
setFont(QFont("Helvetica",
10,
QFont::Bold));
text1.
setColor(QColor(Qt
::yellow));
d_mrk1->setLabel(text1);
QwtText text1(QString("Magnitude: %1").arg(0));
text1.setFont(QFont("Helvetica", 10, QFont::Bold));
text1.setColor(QColor(Qt::yellow));
d_mrk1->setLabel(text1);
To copy to clipboard, switch view to plain text mode
Thanks a lot! :-)
Bookmarks