Results 1 to 8 of 8

Thread: problem with constructor and inheritance QFile object

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2011
    Location
    Australia
    Posts
    44
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default problem with constructor and inheritance QFile object

    here is my code:

    in _File.h:

    Qt Code:
    1. #include <QString>
    2. #include <QFile>
    3.  
    4. class _File : public QFile
    5.  
    6.  
    7. {
    8. Q_OBJECT
    9.  
    10. public:
    11. _File();
    12. _File(const QString &name);
    13. ....//and it goes on
    14. };
    To copy to clipboard, switch view to plain text mode 

    in _File.cpp


    Qt Code:
    1. _File::_File() :
    2.  
    3. {
    4. this->setProgress(0);
    5.  
    6. this->setFilename("");
    7. }
    8.  
    9.  
    10. _File::_File(const QString &qtname)
    11. : QFile(name)
    12. {
    13.  
    14. this->setProgress(0);
    15. ...}}
    To copy to clipboard, switch view to plain text mode 

    and it goes on

    but it has got compilation errors now. it says :
    QFile::QFile(const QFile&) is private

    within this context; when i click "within this context" it takes me to starting braces of _File class in header file


    I am so over this error now, i have been trying to resolve this error for about 2 hours now...any help would be appreciated. thanks
    Last edited by wysota; 24th January 2011 at 14:42. Reason: missing [code] tags

Similar Threads

  1. Object and multiple inheritance for interfaces
    By brcain in forum Qt Programming
    Replies: 8
    Last Post: 29th June 2021, 15:29
  2. Replies: 4
    Last Post: 20th August 2010, 13:07
  3. Inheritance problem
    By brevleq in forum Qt Programming
    Replies: 6
    Last Post: 23rd December 2008, 06:27
  4. problem in widget inheritance
    By wagmare in forum Qt Programming
    Replies: 2
    Last Post: 10th December 2008, 07:35
  5. Replies: 4
    Last Post: 12th August 2008, 01:55

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.