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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:12:20+00:00 2026-05-28T03:12:20+00:00

I’m a student programmer and I’m doing some GUI programing for my company and

  • 0

I’m a student programmer and I’m doing some GUI programing for my company and I have recently ran into an issue that I feel I need some assistance with. Im using Qt and some of its widgets are still confusing to me and the documentation is informative but sometimes confusing to a student(I am hoping that I’m not looking to deep into the issue and overlooking the issue). The build issue I am receiving is in the use of the Ui in the member function checkData. As you might have guessed I am trying to validate data entered into the interface and either display an error message or collect the data. I am using the toDouble function of the class QString to asses the input. The function identifies whether or not the input can be converted by the bool parameter in toDouble(bool &worksornot).
Prior to the conversion toDOuble I take in the text from the lineEdit field perspectivley from the Ui. It seems that this is where my issue is; however according to the documentation this SHOULD work; however should has always been a funny word. The code for my checkData Functions is here:

void InjectionDialog::checkData()
{
        bool validateFluidVelocity;
        QString tempStrFluidVelocity;
        tempStrFluidVelocity = ui->InjectionDialog.lineEditFluidVelocity->text();
        double convertedFluidVelocity = tempStrFluidVelocity.toDouble(&validateFluidVelocity);
                if (validateFluidVelocity == false)
        {
            QErrorMessage validateErrorFluidVelocityError;
            validateErrorFluidVelocityError.showMessage("Fluid velocity input is invalid");
            validateErrorFluidVelocityError.exec();
        }
                else
                {
                    transData.lineEditFluidVelocity = convertedFluidVelocity;
                }
        bool validateFluidMassFlow;
        QString tempStrFluidMassFlow;
        tempStrFluidMassFlow = ui->InjectionDialog.lineEditFluidMassFlow->text();
        double convertedFluidMassFlow = tempStrFluidMassFlow.toDouble(&validateFluidMassFlow);
                if (validateFluidMassFlow == false)
        {
        QErrorMessage validateErrorFluidMassFlowError;
        validateErrorFluidMassFlowError.showMessage("Fluid mass flow input is invalid");
        validateErrorFluidMassFlowError.exec();
        }
                else
                {
                    transData.lineEditFluidMassFlow = convertedFluidMassFlow;
                }
        bool validateParticleVelocity;
        QString tempStrParticleVelocity;
        tempStrParticleVelocity = ui->InjectionDialog.lineEditParticleVelocity->text();
        double convertedParticleVelocity = tempStrParticleVelocity.toDouble(&validateParticleVelocity);
                if (validateParticleVelocity == false)
        {
        QErrorMessage validateErrorParticleVelocity;
        validateErrorParticleVelocity.showMessage("Particle velocity input is invalid");
        validateErrorParticleVelocity.exec();
        }
                else
                {
                    transData.lineEditParitcleVelocity =convertedParticleVelocity;
                }
        bool validateParticleMassFlow;
        QString tempStrParticleMassFlow;
        tempStrParticleMassFlow = ui->InjectionDialog.lineEditParticleMassFlow->text();
        double convertedParticleMassFlow = tempStrParticleMassFlow.toDouble(&validateParticleMassFlow);
                if (validateParticleMassFlow == false)
        {
        QErrorMessage validateErrorParticleMassFlow;
        validateErrorParticleMassFlow.showMessage("Particle mass flow input is invalid");
        validateErrorParticleMassFlow.exec();
        }
                else
                {
                    transData.lineEditParticleMassFlow = convertedParticleMassFlow;
                }

Sorry about the long names; as a student I have found that I need to use alot more description vs abbreviation. Because I’m not sure what the problem is I’m not sure how much of my code is relevant. Please don’t leave negative comments or mark this question as unsubstantial. Just let me know what you would like to see and Ill add more. Heres my injectiondialog header:

#ifndef INJECTIONDIALOG_H
#define INJECTIONDIALOG_H
#include "injectiondata.h"

#include <QDialog>

namespace Ui {
class InjectionDialog;
}

class InjectionDialog : public QDialog
{
    Q_OBJECT

public:
    void setData(InjectionData &name);
    explicit InjectionDialog(QWidget *parent = 0);
    ~InjectionDialog();

private:
    InjectionData transData;
    Ui::InjectionDialog *ui;

private slots:
    void checkData();
    void checkFluidVelocity();
};

#endif // INJECTIONDIALOG_H

The exact error I recieve is invlaid use of ‘Ui::InjectionDialog’ and this occurs on

tempStrFluidVelocity = ui->InjectionDialog.lineEditFluidVelocity->text();
tempStrFluidMassFlow = ui->InjectionDialog.lineEditFluidMassFlow->text();
tempStrParticleVelocity = ui->InjectionDialog.lineEditParticleVelocity->text();
tempStrParticleMassFlow = ui->InjectionDialog.lineEditParticleMassFlow->text();

Thanks in advance for any help you can give me.

  • 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-28T03:12:20+00:00Added an answer on May 28, 2026 at 3:12 am

    You only need to remove the “InjectionDialog” text and dereference the ui elements directly:

    tempStrFluidVelocity = ui->lineEditFluidVelocity->text();
    tempStrFluidMassFlow = ui->lineEditFluidMassFlow->text();
    tempStrParticleVelocity = ui->lineEditParticleVelocity->text();
    tempStrParticleMassFlow = ui->lineEditParticleMassFlow->text();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have some data like this: 1 2 3 4 5 9 2 6
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text

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.