[질문]QT c++ 프로그래밍에 대하여
글쓴이: seungogi / 작성시간: 화, 2005/06/21 - 9:58오후
QT c++ 프로그래밍에 대하여 질문이 있습니다.
canwidgetbase.h
class QButtonGroup; class canWidgetBase : public QWidget { Q_OBJECT 중략 public: QPushButton* pushButton1; 중략 }
canwidget.h
#include "canwidgetbase.h" class canWidget : public canWidgetBase 중략 public slots: 중략 void setbttnen(); }
canwidget.cpp
#include "canwidget.h" #include "canwidgetbase.h" 중략 void canWidget::setbttnen() { pushButton1->setEnabled( TRUE ); }
위에서 보는바와 같이 canwidgetbase 클래스에서 QPushButton* pushButton1; 을 선언했고 이 클래스를 상속받는 canwidget 클래스의 멤버함수 setbttnen()에서 pushButton1->setEnabled( TRUE );을 실행토록 했는데 컴파일할 때 다음과 같은 에러가 납니다.
canwidget.cpp:96: error: invalid use of undefined type ‘struct QPushButton’ ./canwidgetbase.h:21: error: forward declaration of ‘struct QPushButton’
부모클래스의 pushButton1 속성을 자식 클래스에서 변경하려고 하는데 방법을 모르겠습니다.Kdevelop으로 코딩하고 있는데 C++에 대해서 공부를 해도 그 이유를 잘 모르겠습니다.
도와 주시면 감사하겠습니다.
Forums:
혹시 [code:1]#include <qpushbutton.h>
혹시
#include <qpushbutton.h>
를 하셨는지...#include <qpushbutton.h> 이런것은 kde
#include <qpushbutton.h> 이런것은 kdevelop이 알아서 자동적으로 포함시킵니다. 당연히 canwidgetbase.h에 포함되어 있습니다.
[quote="Anonymous"]#include <qpushbut
canwidgetbase.h 파일 전체를 올려봐 주시겠어요?
제 생각에
class QPushButton;
이렇게만 선언되어있고
#include <qpushbutton.h> 라고 안되어 있는것 같은데요?
http://www.korone.net QT 커뮤니티 사이트
댓글 달기