[mythtv] Strange behaviour in QT's QValueVector

florin baiduc florinbaiduc at gmail.com
Thu Mar 23 05:45:33 UTC 2006


The declarations are as follows (note that I changed the ThemedButton
class, but still it should be added normally).
My latest changes are not on the SVN.
buttonList:
...
QValueVector<ThemedButton> buttonList;
...

newbutton:
...
ThemedButton newbutton(parent,"ThemedButton"+buttonList.size());
...

and then:
buttonList.push_back(newbutton); //- generating the compile error.

What do you think about this ? (thanks for helping).


On 3/23/06, tj <htpc at treblid.dyndns.org> wrote:
>
>
> ________________________________
> From: florin baiduc [mailto:florinbaiduc at gmail.com]
> To: Development of mythtv [mailto:mythtv-dev at mythtv.org]
> Sent: Thu, 23 Mar 2006 13:22:06 +0800
> Subject: Re: [mythtv] Strange behaviour in QT's QValueVector
>
>
> That's one ideea, thanks for it. But still, I am wondering why do I
> get this error (while using values instead of pointers), and what
> could cause it?
> I don't use this class much so I can't be sure. But iirc QValueVector stores
> everything by value... Hence when you push back some object (e.g. a QWidget
> or something).. It actually stores a copy of the object (or whatever), not a
> reference to the actual object itself. Hence you can modify one but not
> affect the other.. If that's what you want..
>
> I don't have access to the mythtv source atm, what is newbutton declared as
> (ThemeButton pointer or object?), and how do you declare buttonList?
>
>
>
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>
>
>


More information about the mythtv-dev mailing list