I have issues with my code. The compiler keeps showing this error for every CButton pointer I created.
/home/trafel/ドキュメント/Projects/C++/CCalc/ccalc.h:23: error : 'CButton' does not name a type
CButton *button_0;
^
The CButton class extends from QPushButton. Here is the code from the main header:
#ifndef CCALC_H
#define CCALC_H
#include <QWidget>
#include <QMainWindow>
#include <QPushButton>
#include "clabel.h"
#include "cbutton.h"
class CCalc : public QMainWindow
{
Q_OBJECT
public:
CCalc();
~CCalc();
public slots:
void CPush(QString);
void CAction(QString);
private:
CButton *button_0;
CButton *button_1;
CButton *button_2;
CButton *button_3;
CButton *button_4;
CButton *button_5;
CButton *button_6;
CButton *button_7;
CButton *button_8;
CButton *button_9;
CButton *button_equal;
CButton *button_plus;
CButton *button_minus;
CButton *button_multiply;
CButton *button_divide;
CButton *button_power;
CButton *button_root;
CButton *button_leftParenthesis;
CButton *button_rightParenthesis;
CButton *button_return;
CButton *button_ce;
CLabel *label_input;
CLabel *label_output;
QMenu *menu_session;
QAction *session_new;
QAction *session_open;
QAction *session_save;
QAction *session_quit;
QMenu *menu_log;
QAction *log_inspect;
QMenu *menu_help;
QAction *help_help;
QAction *help_about;
};
#endif // CCALC_H
And this is from the CButton class header :
#ifndef CBUTTON_H
#define CBUTTON_H
#include <QPushButton>
#include "ccalc.h"
class CButton : public QPushButton
{
Q_OBJECT
public:
CButton(QWidget *parent);
~CButton();
QString getValue();
void setValue(QString string);
private:
QString value;
};
#endif // CBUTTON_H
Did I forget to add something ?