Hi guys,
Thanks in advance. I'm triying to show the lable of the tics in a Qwt3D in two lines. To do that , I needed to create a new class that inherits from LineraScale class, and then overwrite the ticLabel member function.
Header class
class myScale: public LinearScale
{
public:
Scale* clone() const {return new myScale();}
QString ticLabel
(unsigned int idx
) const;
};
class myScale: public LinearScale
{
public:
Scale* clone() const {return new myScale();}
QString ticLabel(unsigned int idx) const;
};
To copy to clipboard, switch view to plain text mode
The cpp file
QString myScale
::ticLabel(unsigned int idx
) const {
return QString("This is 1st line" + "\n" + "this should be the 2nd one" );
}
QString myScale::ticLabel(unsigned int idx) const
{
return QString("This is 1st line" + "\n" + "this should be the 2nd one" );
}
To copy to clipboard, switch view to plain text mode
But when the plot is shown, the result appears in the same line "This is the 1st line this should be the 2nd one".
It is possible to do that with QwtPlot, but with this module, the "\n" has no effect.
Further info: To plot the label , internally the Qwt3D uses a Qwt3D::Label, and it sets the string with the memeber function void setString ( QString const & s ) // Sets the labels string For unicode labeling ( QChar(0x3c0) etc.) please look at www.unicode.org.
I dont know if the problem is this conversion or if the unicode labeling has any other simbol to indicate the new line.
Any idea?
Thanks!!
Bookmarks