This QFloatArray1D should look like
Qt Code:
  1. class QFloatArray1D {
  2. public:
  3. QFloatArray1D( float* valueArray, int length );
  4. ...
  5. const float* array( int* length ) const;
  6. void setArray( float* valueArray, int length );
  7. float valueAt( int idx ) const;
  8. ..
  9. };
To copy to clipboard, switch view to plain text mode 

The reason is that I need to create a MyGraphicsTraceItem as

Qt Code:
  1. class MyGraphicsTraceItem : public QGraphicsItem
  2. {
  3. public:
  4.  
  5. MyGraphicsTraceItem( float* traceData,
  6. int traceLength,
  7. float traceIndexFrom,
  8. float indexDelta,
  9. QGraphicsItem *parent = 0 );
  10.  
  11. private:
  12.  
  13. float* theTraceData;
  14. int theTraceLength;
  15. float theTraceIndexFrom;
  16. float theTraceIndexDelta;
  17.  
  18. };
To copy to clipboard, switch view to plain text mode 

But I feel something is wrong with this code, so I would wish to have a constructor like
Qt Code:
  1. public:
  2. MyGraphicsTraceItem( const QFloatArray1D& traceData,
  3. float traceIndexFrom,
  4. float indexDelta,
  5. QGraphicsItem *parent = 0 );
  6. private:
  7.  
  8. QFloatArray1D theTraceData; // <== explicitly shared
  9. float theTraceIndexFrom;
  10. float theTraceIndexDelta;
To copy to clipboard, switch view to plain text mode 

Also, what does Q_DECLARE_PRIVATE do, and how can I use it?

Thanks