Quote Originally Posted by FelixB View Post
of course not. you create "symbol" as a local variable and pass a pointer on it.

try
Qt Code:
  1. curve->setSymbol(QwtSymbol(QwtSymbol::Ellipse));
To copy to clipboard, switch view to plain text mode 
There is no difference between what you suggest and my code. Your code does not pass a pointer to a QwtSymbol, it passes a reference. If you actually tried to pass a pointer, the code would fail to compile, since setSymbol() takes a "const QwtSymbol &" argument. Furthermore, your code does not allow setting a symbol size, as Patrik noted, since you have no way to access the reference once the setSymbol() call returns.

So for completeness, my code should be updated to read something like this:

Qt Code:
  1. QwtSymbol symbol( QwtSymbol::Rect );
  2. symbol.setSize( QSize( 5, 5) );
  3. myCurve->setSymbol( symbol );
To copy to clipboard, switch view to plain text mode