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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:29:45+00:00 2026-05-22T22:29:45+00:00

Im building an application where a few objets outside the mainWindow will need to

  • 0

Im building an application where a few objets outside the mainWindow will need to talk to be connected to the ui elements, just simple on click events triggering member functions. I was wondering whether to Add slots to the main window that connect to each ui element so that I only ever need to interface my external objects with one ui object, the main window, or whether I should directly connect my objects signals to the individual ui elements slots.

Also could someone share an example of how to connect a signal from an external object into the mainWindow, I’m very new to this and until now I’ve always added all my code to the mainWindow to keep things simple but i know thats bad practice so i think its time to move on.

Thanks all

j

  • 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-22T22:29:46+00:00Added an answer on May 22, 2026 at 10:29 pm

    There is no difference in syntax between connecting an “external” object or an “internal” one to a slot. The connect call takes two object pointer (from/to) and doesn’t really care about where they are (except if you’re using threads).

    The Qt Signals and slots documentation has all you need to know about these connections, and the examples show real code that uses signals. (The analog clock for instance uses a QTimer which is “external” to its main window.)

    There is no one-size-fits-all answer to the “where should I put my public slots” question. Do what is easier to maintain/more logical for your particular scenario. Having all your “external” signals routed to a single object that dispatches them is “clean” from an interface (API) point of view, but it means you’ll need to maintain more code than if you routed the signals directly to the object that needs to react on them.

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

Sidebar

Related Questions

We have a few projects that involve building an application that is composed of
I am building an application where a page will load user controls (x.ascx) dynamically
I am building an application where I want to be able to click a
I am building application that required some data from iPhone's Call log(read only). The
When building an application, is there any meaningful difference between the idea of Find
I'm building an application that is targeting Windows, Mac and Linux soon. I was
I'm building an application in C# using WPF. How can I bind to some
We're currently building an application that executes a number of external tools. We often
I am building an application as a library, but to make sure I can
I am considering building an application that is a blend of a dynamic language

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.