Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7278609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:53:51+00:00 2026-05-28T22:53:51+00:00

I am trying to develop a Qt App using 4.7.3 which involves the writing

  • 0

I am trying to develop a Qt App using 4.7.3 which involves the writing of a QList to a flie.

My class is:

class Task  
{  
public:  
    QString ta, desc;  
    QTime ti;  
    QDate da; 
    int pri, diff;  
    bool ala;  
};  

the corresponding QList is : QList tasks;

My file is :

QFile theFile("dataBase");  
QDataStream stream(&theFile);  
stream.setVersion(QDataStream::Qt_4_7);

to read:

theFile.open(QIODevice::ReadOnly);  
stream >> tasks;

to write:

theFile.open(QIODevice::WriteOnly);  
stream << tasks;  

while compiling on Windows using Qt 4.7.3 and GCC 4.4 toolchain I get the following error:

c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtCore\qstringlist.h:46: In file included from c:/QtSDK/Desktop/Qt/4.7.3/mingw/include/QtCore/qstringlist.h:46,

c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtCore\qdatastream.h:250: error: no match for ‘operator>>’ in ‘s >> t’

c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtCore\qdatastream.h:-1: In function ‘QDataStream& operator<<(QDataStream&, const QList&) [with T = Task]’:

c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\QtCore\qdatastream.h:263: error: no match for ‘operator<<‘ in ‘s << ((const QList*)l)->QList::at with T = Task’

Although the overload for the << and >> operators exist, I cant find any reason for these errors…..

Please Help Anyone, as this is a pretty important app which I have to make
Thanks in Advance….

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T22:53:52+00:00Added an answer on May 28, 2026 at 10:53 pm

    You need to define you own operator out and in … Something like this:

    .h file:

    class myClass{
    public:
        QString name;
        QString gender;
        QDate birthDay;
        QString job;
        QString address;
        int phoneNo;
    };
    
    QDataStream &operator <<(QDataStream &stream, const myClass &myclass);
    QDataStream &operator >>(QDataStream &stream, myClass &myclass);
    

    .cpp file:

    QDataStream &operator <<(QDataStream &stream, const myClass &myclass)
    {
        stream<<myclass.address;
        stream<<myclass.birthDay;
        stream<<myclass.gender;
        stream<<myclass.job;
        stream<<myclass.name;
        stream<<myclass.phoneNo;
        return stream;
    }
    
    QDataStream &operator >>(QDataStream &stream, myClass &myclass)
    {
        stream>>myclass.address;
        stream>>myclass.birthDay;
        stream>>myclass.gender;
        stream>>myclass.job;
        stream>>myclass.name;
        stream>>myclass.phoneNo;
        return stream;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to develop an app using XNA and for state management I'm using
I am trying to develop a iphone app by using cocos2d. I create a
I'm trying to develop an app using Django 1.1 on Webfaction. I'd like to
I'm trying to develop an app for ipad and I'm using the contenteditable feature.
I'm currently using the iOS 5 SDK trying to develop my app. I'm trying
I'm trying to develop an app which uses the Camera. So far it's been
I'm using Sqlite with android to develop and app which can be customizable (for
I am trying to develop a document based mac app using this Apple walkthrough
i'm trying to develop my first simple app for iphone using the MapKit. I'm
I'm currently trying to develop an encryption app for Android using ECDH and BouncyCastle.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.