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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:04:46+00:00 2026-06-05T18:04:46+00:00

In my custom widget, there are seven labels included as child widgets. Their texts

  • 0

In my custom widget, there are seven labels included as child widgets. Their texts and text formats should be set by user of the parent widget. I created 14 slots to accomplish this:

void setCenterText(const QString &text) {
    ui->labelCenter->setText(text);
}

void setRightText(const QString &text);
...

Can it be done via something like: connect(parent, slot(a), child, slot(b)) and a signal connected to the parent slot is automatically forwarded to the child widget?

  • 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-05T18:04:48+00:00Added an answer on June 5, 2026 at 6:04 pm

    Can it be done via something like: connect(parent, slot(a), child,
    slot(b)) and a signal connected to the parent slot is automatically
    forwarded to the child widget?

    You can’t connect slots to slots, but more importantly, without specifying the target widget in another argument, there is no way for the parent widget to know which child needs modifying.

    Although what you are doing is laborious, it is a basic tennant of aggregate-based component building, and it does offer advantages – primarily the ability to very finely tune exactly what child widget properties are exposed to the programmer.

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

Sidebar

Related Questions

Observation: Inside my template of a custom widget that I'm making, there's a line:
I am writing a custom widget with qt. I was wondering if there was
I've written a custom widget with its own set of styles. These styles are
I'm developing a custom widget (inheriting from QWidget) to use as a control. How
I am designing a custom widget which is basically a QGroupBox holding a configurable
I have a custom Widget derived from QFrame. I will need to draw on
I need a custom widget height. I tried using this Integer.toString(yourWidget.getElement().getOffsetHeight()) but, If I
I'm subclassing QProgressBar in a custom widget, and I overwrote the paintEvent method with
I've got the following custom widget: class QDESIGNER_WIDGET_EXPORT MySpecialButton : public QAbstractButton { Q_OBJECT
So I've got a custom widget that inherits from frame and contains a canvas

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.