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 622429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:59:01+00:00 2026-05-13T18:59:01+00:00

In QT we can connect signals and slots using the following simple syntax: connect(pObject1,

  • 0

In QT we can connect signals and slots using the following simple syntax:

connect(pObject1, signal1, pObject2, slot2)

For instance, one can write something like:

A a;
B b;    
connect(&a, SIGNAL(valueChanged(int)), &a, SLOT(setValue(int)));

With Boost::Signal the syntax we would write it this way:

A a;
B b;    
a.valueChanged.connect(boost::bind(&B::SetValue, &b, _1))

IMHO, the boost signal’s syntax is more complicated. Is there a way to make the Boost::Signal’s syntax more QT like.

  • 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-13T18:59:01+00:00Added an answer on May 13, 2026 at 6:59 pm

    The thing with Qt is that it goes through a code generation phase during compilation, that Boost can’t do. That means that Qt can do some very clever syntactic things that can’t be copied without going through a similar process.

    To quote Wikipedia:

    Known as the moc, this is a tool that is run on the sources of a Qt program. It interprets certain macros from the C++ code as annotations, and uses them to generate additional C++ code with “Meta Information” about the classes used in the program. This meta information is used by Qt to provide programming features not available natively in C++: the signal/slot system, introspection and asynchronous function calls.

    (I can’t get the link to work, but it’s http://en.wikipedia.org/wiki/Qt_(framework))

    Edit: I think the Wikipedia quote is quite clear that the signal/slot system is implemented using the moc. I doubt very much that there’s any way to use the same syntax without using a similar system.

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

Sidebar

Related Questions

In Qt, one can connect a signal to a slot using: connect(x, SIGNAL(S()), y,
In PyQt, there's a concept of signals and slots to connect objects to one
To test if i can connect to my database, I execute the following code
How do you check if you can connect to the internet via java? One
I have a Solaris daemon written in Java6. Clients can connect to it using
I'm using boost::signals and leaking memory when I try to connect multiple signals to
i know i can connect multiple slots to the same signal. but Can I
In Qt, signals and slots require matching argument types: QObject::connect: Incompatible sender/receiver arguments QLabel::linkActivated(QString)
Qt documentation states that signals and slots can be direct , queued and auto
I'm trying to write a library aiming to reproduce Qt's threading semantics: signals can

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.