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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:47:04+00:00 2026-06-01T20:47:04+00:00

using Qt I have a QStackedWidget with several QPushButton buttons. The parent widget of

  • 0

using Qt I have a QStackedWidget with several QPushButton buttons. The parent widget of the widget is the QMainWindow. Inside the QStackedWidget I also have some QLineEdit. What I want to do is simple: validate the form that contains the textboxes and if it’s all fine call a function of a custom class that will process the data. The instance of the class is created inside my QMainWindow class. What would be the best way to call the methods of that class? Should I use the signals/slots mechanism of Qt connecting my custom class to the instances of the widget inside the QStackedWidget?

  • 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-01T20:47:06+00:00Added an answer on June 1, 2026 at 8:47 pm

    You can derive off of QValidator as many times as necessary and install a validator on each field that requires validation. This way, you are ensured that the field is either empty or else contains a valid entry.

    Before processing your data, make sure that all of the appropriate fields have data, and you’re guaranteed then that you have a valid form.

    The typical way to pass data from a form to some consumer of form data is to create a middle-man class to hold the data. An instance of the class is populated after the form is validated, and the instance is then passed to the consumer. This way, if there are changes in the form, your consumer is isolated from these changes, provided the same data is being collected.

    The general rule is to work against object interfaces, not their implementation. It doesn’t matter whether you do sig/slot or a direct function call so long as you keep some things in mind:

    Sig/slot does not guarantee call order, and emitting signals essentially means that anybody who can see this object can connect to its signal and pick this change up. if you must have a guaranteed order of processing of your form data by sub-components, then why even give a maintenance programmer the option to mess up?

    Secondly, it should not matter where the objects reside. Some day when your data consumers become very complicated and you want to snap a different one in based upon some scenario (maybe user privs, or today’s date, or the current temperature, I don’t know!), then you’re going to want to do a re-arch. If your logic for getting the data to the consumers is highly dependent upon the objects residing in a certain way in your form, then you’re doing it wrong.

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

Sidebar

Related Questions

I have a simple comboBox with some Value/Text items in it. I have using
I have using Hg for some projects on my google code hosting. For each
I've been trying my hand at optimising some code I have using microsoft's sse
I'm trying from 2 days to curve fit some data that I have using
I have using the following code $header .= Reply-To: Some One <someone@mydomain.com>\r\n; $header .=
I have using some examples on this site to create an email class for
I have using android alert dialog builder to display the some user message(String) as
I have using cakephp and I want to obscure all numbers which is more
I have using jsp technology in my project.I want to do session tracking in
I have using blocks in each method of my repository. If I want to

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.