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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:41:41+00:00 2026-05-28T04:41:41+00:00

I’m a student programmer and I am using Qt to build some GUI applications

  • 0

I’m a student programmer and I am using Qt to build some GUI applications for work and I have been running into moc issues over and over again. I was hoping for a solution to the current problem that I am having; however, if anyone more veteraned in Qt could shed some light on how to properly handle these files while making changes to your cpp file(s) I’d appreciate any help. In my most recent change (sorry I can’t post what it did look like, because it’s obviously been restructured) I was validating data by nesting a function inside of my checkData function. Because I would like a specific error to appear for each field that might be invalid I began to create a function for each QLineEdit. I realized that this would not work (or at least make more work) then instead of just providing sequenced checks of information. Below is the new code without the original nested function:

void InjectionDialog::checkData() {
   bool validateFluidVelocity;
   QString tempStrFluidVelocity;
   tempStrFluidVelocity = ui->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->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->lineEditParticleVelocity->text();
   double convertedParticleVelocity =
      tempStrParticleVelocity.toDouble(&validateParticleVelocity);
   if (validateParticleVelocity == false) {
      QErrorMessage validateErrorParticleVelocity;
      validateErrorParticleVelocity.
         showMessage("Particle velocity input is invalid");
      validateErrorParticleVelocity.exec();
   }
   else {
      transData.lineEditParitcle_sic_Velocity = convertedParticleVelocity;
   }
   bool validateParticleMassFlow;
   QString tempStrParticleMassFlow;
   tempStrParticleMassFlow = ui->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;
   }
}

Initially I had InjectionDialog::checkFluidVelociy for the first check but decided against it pretty quickly. Now with the code restructured I receive the error:

In function ‘InjectionDialog::checkFluidVelocity(QMetaObject::Call, int, void**)’:
this error is referenced to moc_injectionDialog.o

unidentified reference to ‘InjectionDialog::checkFluidVelocity()’
this error is referenced to moc_injectiondialog.cpp

In moc_injectiondialog I have the following I have the following listed:

/****************************************************************************
** Meta object code from reading C++ file 'injectiondialog.h'
**
** Created: Sat Jan 7 21:58:22 2012
**      by: The Qt Meta Object Compiler version 62 (Qt 4.7.4)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/

#include "../InjectionGUI/injectiondialog.h"
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'injectiondialog.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 62
#error "This file was generated using the moc from 4.7.4. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif

QT_BEGIN_MOC_NAMESPACE
static const uint qt_meta_data_InjectionDialog[] = {

 // content:
       5,       // revision
       0,       // classname
       0,    0, // classinfo
       2,   14, // methods
       0,    0, // properties
       0,    0, // enums/sets
       0,    0, // constructors
       0,       // flags
       0,       // signalCount

 // slots: signature, parameters, type, tag, flags
      17,   16,   16,   16, 0x08,
      29,   16,   16,   16, 0x08,

       0        // eod
};

static const char qt_meta_stringdata_InjectionDialog[] = {
    "InjectionDialog\0\0checkData()\0"
    "checkFluidVelocity()\0"
};

const QMetaObject InjectionDialog::staticMetaObject = {
    { &QDialog::staticMetaObject, qt_meta_stringdata_InjectionDialog,
      qt_meta_data_InjectionDialog, 0 }
};

#ifdef Q_NO_DATA_RELOCATION
const QMetaObject &InjectionDialog::getStaticMetaObject() { return staticMetaObject; }
#endif //Q_NO_DATA_RELOCATION

const QMetaObject *InjectionDialog::metaObject() const
{
    return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
}

void *InjectionDialog::qt_metacast(const char *_clname)
{
    if (!_clname) return 0;
    if (!strcmp(_clname, qt_meta_stringdata_InjectionDialog))
        return static_cast<void*>(const_cast< InjectionDialog*>(this));
    return QDialog::qt_metacast(_clname);
}

int InjectionDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QDialog::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: checkData(); break;
        case 1: checkFluidVelocity(); break;
        default: ;
        }
        _id -= 2;
    }
    return _id;
}
QT_END_MOC_NAMESPACE

I have looked over some of the other moc_file posts and most of them say to have Qt clean and rebuild the project. I have ran a project clean up and rebuild all to try to overhaul this moc file but have not had any success in getting rid of the error. It seems like a bug but I couldn’t find anything online about it so maybe it’s something I don’t know about. Thanks in advance for any help you can offer.

  • 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-28T04:41:42+00:00Added an answer on May 28, 2026 at 4:41 am

    Whenever I have MOC problems, I Build->Clean All and then Build->Run qmake (Qt Creator IDE). If that doesn’t solve my problem, I go into my project folder and delete moc_* files and any other junk that Clean doesn’t remove – basically leaving nothing but headers, source and resources.

    • 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 jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I am currently running into a problem where an element is coming back from
We're building an app, our first using Rails 3, and we're having to build
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have thousands of HTML files to process using Groovy/Java and I need to
I have some data like this: 1 2 3 4 5 9 2 6

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.