[Qt-interest] tracking uniqueness

Michael user23 at web.de
Fri Apr 23 15:26:52 CEST 2010


Am 23.04.2010 15:14, schrieb Oliver Heins:
> Hi Andreas,
>
> thanks for your help.
>
> Andreas Pakulat <apaku at gmx.de> writes:
>
>   
>> On 23.04.10 11:29:01, Oliver Heins wrote:
>>
>> The only way I can see to make this work is use a send in the id for Token
>> in its constructor, i.e.:
>>
>> Token( int id_ ) : id(id_) {}
>>
>> and then have the member variable on Editor. 
>>     
> I'll give that a try, but I think I'm in the need of a default
> constructor.
>   

I'd suggest something like this:

class Editor
{
    Editor(){ mThisToken=lastUnique++;};

    quint32 memberToken;
    static quint32 lastUnique;
}

regards Michael



More information about the Qt-interest-old mailing list