brevleq
21st December 2008, 20:42
Hi guys!
I'm trying to use QComboBox as my base class for my ComboView, but I'm having a problem when I try build my program:
hudson@brevleq:~/.projetos/CLP$ make
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/opt/qt4/mkspecs/linux-g++ -I. -I/opt/qt4/include/QtCore -I/opt/qt4/include/QtCore -I/opt/qt4/include/QtGui -I/opt/qt4/include/QtGui -I/opt/qt4/include -I. -Icontainer -Iporta -Iobserver -Iobserver/events -Igenerator -Icontroller -Iview -Ifrontend -I. -I. -o ComboView.o view/ComboView.cpp
view/ComboView.cpp: In constructor 'ComboView::ComboView(QWidget*)':
view/ComboView.cpp:14: error: no matching function for call to 'ComboView::currentIndexChanged()'
/opt/qt4/include/QtGui/qcombobox.h:230: note: candidates are: void QComboBox::currentIndexChanged(int)
/opt/qt4/include/QtGui/qcombobox.h:231: note: void QComboBox::currentIndexChanged(const QString&)
view/ComboView.cpp:14: error: 'signal' was not declared in this scope
view/ComboView.cpp:14: error: 'slot' was not declared in this scope
make: ** [ComboView.o] Erro 1
hudson@brevleq:~/.projetos/CLP$
I think the inheritance I did is wrong, but I can't find the problem!!
These are the sources:
#ifndef COMBOVIEW_H
#define COMBOVIEW_H
#include <QComboBox>
#include <QWidget>
#include "View.h"
#include "PortaEntrada.h"
class ComboView : public QComboBox,public View {
Q_OBJECT
public:
ComboView(QWidget *parent=0);
protected slots:
void typeChanged(void);
};
#endif
#include "ComboView.h"
ComboView::ComboView(QWidget *parent):QComboBox(parent){
addItem("Constante",PortaEntrada::CONSTANT);
addItem("Triangular",PortaEntrada::TRIANGULAR);
addItem("Quadratica",PortaEntrada::QUADRATIC);
QComboBox::connect(this,signal(currentIndexChanged ()),this,slot(typeChanged()));
}
void ComboView::typeChanged(void){
controller->setProperty(currentIndex());
}
what I did wrong?
I'm trying to use QComboBox as my base class for my ComboView, but I'm having a problem when I try build my program:
hudson@brevleq:~/.projetos/CLP$ make
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/opt/qt4/mkspecs/linux-g++ -I. -I/opt/qt4/include/QtCore -I/opt/qt4/include/QtCore -I/opt/qt4/include/QtGui -I/opt/qt4/include/QtGui -I/opt/qt4/include -I. -Icontainer -Iporta -Iobserver -Iobserver/events -Igenerator -Icontroller -Iview -Ifrontend -I. -I. -o ComboView.o view/ComboView.cpp
view/ComboView.cpp: In constructor 'ComboView::ComboView(QWidget*)':
view/ComboView.cpp:14: error: no matching function for call to 'ComboView::currentIndexChanged()'
/opt/qt4/include/QtGui/qcombobox.h:230: note: candidates are: void QComboBox::currentIndexChanged(int)
/opt/qt4/include/QtGui/qcombobox.h:231: note: void QComboBox::currentIndexChanged(const QString&)
view/ComboView.cpp:14: error: 'signal' was not declared in this scope
view/ComboView.cpp:14: error: 'slot' was not declared in this scope
make: ** [ComboView.o] Erro 1
hudson@brevleq:~/.projetos/CLP$
I think the inheritance I did is wrong, but I can't find the problem!!
These are the sources:
#ifndef COMBOVIEW_H
#define COMBOVIEW_H
#include <QComboBox>
#include <QWidget>
#include "View.h"
#include "PortaEntrada.h"
class ComboView : public QComboBox,public View {
Q_OBJECT
public:
ComboView(QWidget *parent=0);
protected slots:
void typeChanged(void);
};
#endif
#include "ComboView.h"
ComboView::ComboView(QWidget *parent):QComboBox(parent){
addItem("Constante",PortaEntrada::CONSTANT);
addItem("Triangular",PortaEntrada::TRIANGULAR);
addItem("Quadratica",PortaEntrada::QUADRATIC);
QComboBox::connect(this,signal(currentIndexChanged ()),this,slot(typeChanged()));
}
void ComboView::typeChanged(void){
controller->setProperty(currentIndex());
}
what I did wrong?