[Qt-interest] QFile private member
Scott Aron Bloom
Scott.Bloom at sabgroup.com
Tue Feb 10 23:12:49 CET 2009
>>>> Qt-interest mailing list
> >>>> Qt-interest at trolltech.com
> >>>> http://lists.trolltech.com/mailman/listinfo/qt-interest
> >>> [Scott Aron Bloom]
> >>> You are creating a new QFile, except by using QFile rather then
> > QFile *.
> >>> Simply making it a QFile *, and then in the constructor, creating
a
> >>> blank QFile...
> >>>
> >>> file = new QFile;
> >>>
> >>> You will solve all your issues...
> >>>
> >>> Scott
> >>>
> >>>
> >> OK, cool. Andrew called it and Scott actually figured out that I
know
> >> nothing about C++ and then told me how to assign an actual object
to a
> >> pointer. (I think that's how to describe what's happening here.)
> >>
> >> The other suggestions, including Andreas', using reference "file
> > QFile"
> >> and not pointer "file * QFile" all fail to compile with the same
> > error.
> >> I'm pretty sure I'd need an explicit copy constructor to get that
to
> >> work. (And I'm finding there's nothing "plain" about C++, Andreas
:))
> >>
> >> Thanks guys. Hopefully I can actually figure out how to use this
> > pointer
> >> I've now got.
> >>
> >> Re: destructor: will-do, Bob.
> >
> > Good luck... However, I seriously recommend you take a basic C++
class
> > first.. Even a C++ class using QT, but your fundamentals are weak
and
> > need work
> >
> > Scott
>
> Thanks again, Scott, for pointing out the obvious.
It really wasn't meant as an insult..
But when you describe
file = new QFile
as assigning an actual object to a pointer... I don't think your going
to be successful, and are going to waste a lot of effort because your
lacking basic C++ knowledge...
Scott
More information about the Qt-interest-old
mailing list