Hi,
I have a code in QT-3, and it is like this,

================================================== ================
class CVideoFrame
{
friend class CVideoDevice;
private:
struct VideoDataShared: public QShared
{
const QImage *RGB;
const QImage *Y, *U, *V;

unsigned long sequence;
unsigned long time_stamp;
} *data;

}

CVideoFrame::CVideoFrame(uint number, const QImage *rgb, const QImage *y, const QImage *u, const QImage *v)
{
data = new VideoDataShared;
if (data == 0)
return;

data->RGB = rgb;
data->Y = y;
data->U = u;
data->V = v;
data->sequence = 0;
data->time_stamp = 0;
m_Number = number;
}



CVideoFrame::CVideoFrame(const CVideoFrame &f)
{
data = f.data;
if (data != 0)
{
data->ref();
}
}
================================================== ===============
and it is working.

I need to write this cod in QT-4.3 and I try it like this,

================================================== ================

struct Shared
{
Shared() : count(1) {}
void ref() { ++count; }
bool deref() { return !--count; }
uint count;
};


class CVideoFrame
{

friend class CVideoDevice;
private:
struct VideoDataShared: public Shared
{
const QImage *RGB;
const QImage *Y, *U, *V;

unsigned long sequence;
unsigned long time_stamp;
} *data;

}
CVideoFrame::CVideoFrame(uint number, const QImage *rgb, const QImage *y, const QImage *u, const QImage *v)
{
data = new VideoDataShared;
if (data == 0)
return;

data->RGB = rgb;
data->Y = y;
data->U = u;
data->V = v;
data->sequence = 0;
data->time_stamp = 0;
m_Number = number;
}


CVideoFrame::CVideoFrame(const CVideoFrame &f)
{
data = f.data;
if (data != 0)
{
data->ref();
}
}

================================================== =============
and I can make this program withut error. But my program is not working properly. I think, this section have some error.

CVideoFrame::CVideoFrame(const CVideoFrame &f)
{
data = f.data;
if (data != 0)
{
data->ref();
//I think this line is not working.....
}
}

please help me to solve this problem.