[Qt-interest] QObject copy construction

Luc Devallonné luc.devallonne at mnemis.com
Tue Feb 17 12:52:18 CET 2009


Did you consider storing pointers in your container ?

something like QList<QObject*>

Luc

On Tue, Feb 17, 2009 at 12:48 PM, Andrea Franceschini
<therealmorpheu5 at gmail.com> wrote:
> I know that QObjects cannot be copy constructed and I understand the
> reason but my point is: how can I have my class extend QObject and fit
> into a container such as QHash? I mean, Whenever I try to browse the
> container, be it via foreach or via iterators, the copy constructor
> always gets called.
>
> What am I missing? Am I to discard all the advantages of inheriting
> QObject? I don't want to define Q_DISABLE_COPY because it is
> "dangerous".
>
> Thanks,
> --
> Andrea
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>



-- 
Luc Devallonné
Cell: +41 78 751 32 15
Skype: luc.devallonne




More information about the Qt-interest-old mailing list