PDA

View Full Version : Not declared in scope



mikea
3rd October 2014, 23:52
The follow is a header file of a simple dialog generated with QCreator. On the two method/function definitions I get the following errors:

QFXINFO has not be declared
QIFT was not declared in this scope

This is probably a c++ issue, but what am I doing wrong?



#ifndef DIALOG_H
#define DIALOG_H

#include <QDialog>
#include <QList>

namespace Ui {
class Dialog;
}

class Dialog : public QDialog
{
Q_OBJECT

public:
explicit Dialog(QWidget *parent = 0);
~Dialog();

void readQFX(QString fileName, QFXINFO qfxInfo, QList<QIFT> qifTL);
void writeQIF(QString filename, QFXINFO qfxInfo, QList<QIFT> qifTL);


private:
Ui::Dialog *ui;

// Define a QIF transaction
struct QIFT
{
QString cleared; // value = C* set by program for all trans.
QString date; // value form qfx <DTPOSTED>
QString memo; // taken from qfx <NAME>
QString ckNum; // taken from qfx <CHECKNUM>
QString amt; // taken from qfx <TRNAMT>
};

QList<QIFT> qifTL; // list of QFX2QIF transactions

// Define QFX info record
struct QFXINFO
{
QString org; // value = (C1 for Capital One for example).
QString type; // value = bank or credit card
QString startDate; // transaction start date
QString stopDate; // transaction stop date
};

QFXINFO qfxInfo;



private slots:
void on_donePB_pressed();
void on_QFXSourcePB_pressed();
void on_saveFolderPB_pressed();
void on_reformatePB_pressed();

};

#endif // DIALOG_H

wysota
3rd October 2014, 23:54
You did not include header files for the two types.

mikea
4th October 2014, 02:32
wysota, Thanks for the reply. It seems the compiler did not like the structs being private and the function defs using them public. I made the structs public and it compiled - same if I made all private. Makes sense.
Mike

wysota
4th October 2014, 08:06
Oh, I didn't notice these types were private internal classes of your class.