Results 1 to 4 of 4

Thread: Draw the tic label of a Qwt3D plot in two separate lines

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2010
    Qt products

    Default Draw the tic label of a Qwt3D plot in two separate lines

    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
    Qt Code:
    1. class myScale: public LinearScale
    2. {
    3. public:
    4. Scale* clone() const {return new myScale();}
    5. QString ticLabel(unsigned int idx) const;
    6. };
    To copy to clipboard, switch view to plain text mode 

    The cpp file
    Qt Code:
    1. QString myScale::ticLabel(unsigned int idx) const
    2. {
    4. return QString("This is 1st line" + "\n" + "this should be the 2nd one" );
    6. }
    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

    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?

    Last edited by locke; 28th May 2010 at 11:11.

Similar Threads

  1. Draw lines in a QGridLayout
    By Eos Pengwern in forum Qt Programming
    Replies: 0
    Last Post: 28th April 2010, 01:27
  2. plot with hor. lines and text
    By hugo vanwoerkom in forum Qwt
    Replies: 2
    Last Post: 10th March 2010, 17:00
  3. How to draw some points and lines?
    By luffy27 in forum Qt Programming
    Replies: 1
    Last Post: 24th November 2006, 16:47
  4. How to draw lines with the right width?
    By albanelporto in forum Qt Programming
    Replies: 3
    Last Post: 22nd November 2006, 11:51

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.