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

  • SEARCH
  • Home
  • 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 8233029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:59:57+00:00 2026-06-07T17:59:57+00:00

From API docs: Custom types registered using qRegisterMetaType() and qRegisterMetaTypeStreamOperators() can be stored using

  • 0

From API docs:

Custom types registered using qRegisterMetaType() and
qRegisterMetaTypeStreamOperators() can be stored using QSettings.

How can I do that? I get the error:

too few template-parameter-lists at qRegisterMetaTypeStreamOperators

My code:

class LineUser {
public:
    int uId;
    QString passwd;
    qint8 statusType;
};

Q_DECLARE_METATYPE(LineUser)
QDataStream &operator<<(QDataStream &out, const LineUser &myObj) {
    out<<myObj.uId<<myObj.passwd<<myObj.statusType;
    return out;
}
QDataStream &operator>>(QDataStream &in, LineUser &myObj) {
    in>>myObj.uId>>myObj.passwd>>myObj.statusType;
    return in;
}
qRegisterMetaTypeStreamOperators<LineUser>("LineUser");
  • 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-06-07T17:59:59+00:00Added an answer on June 7, 2026 at 5:59 pm

    qRegisterMetaTypeStreamOperators is a function, not a macro.

    You need to call it from a .cpp file, e.g. in your main() method

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can see in the API docs for Predef that they're subclasses of a
I'm using https://docs.djangoproject.com/en/dev/ref/contrib/sitemaps/?from=olddocs . I have a sitemap generated from api.example.me for the domain:
This is from jQuery API docs: typeString Default: 'GET' The type of request to
From: http://developers.soundcloud.com/docs/api/tracks#filtering I'm not sure from the docs if this functionality is available. I
Is there an easy way to generate docs for REST api direct from a
Here's an example taken from http://docs.jquery.com/API/1.1/AJAX#.24.post.28_url.2C_params.2C_callback_.29 $.ajax({ type: POST, url: some.php, data: name=John&location=Boston, success:
I ran an example copied from: http://developers.facebook.com/docs/reference/javascript/ http://developers.facebook.com/docs/reference/javascript/FB.api/ (I only changed my APP_ID) <div
I need to use Twitter api from iPhone 3.0 (SDK 3.0). can i use
To extend the User object with custom fields, the Django docs recommend using UserProfiles
I've been having a problem using the javascript API of the RadComboBox from Telerik.

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.