jiveaxe
8th November 2007, 09:38
Hi,
I have almost completed my application and now I am working on restyling the gui. I started creating a new GMCButton like this:
class GMCButton: public QPushButton
{
Q_OBJECT
public:
GMCButton(QWidget *parent = 0);
};
then in my centralwidget.cpp
searchButton = new GMCButton(tr("&Open search dialog"));
During compilation I got this error:
mainwindow.cpp: In constructor ‘MainWindow::MainWindow()’:
mainwindow.cpp:41: error: no matching function for call to ‘MainWindow::connect(GMCButton*&, const char [11], MainWindow* const, const char [20])’
/usr/include/qt4/QtCore/qobject.h:191: note: candidates are: static bool QObject::connect(const QObject*, const char*, const QObject*, const char*, Qt::ConnectionType)
/usr/include/qt4/QtCore/qobject.h:292: note: bool QObject::connect(const QObject*, const char*, const char*, Qt::ConnectionType) const
in correspondence of this line (in mainwindow.cpp):
connect(centralWidget->searchButton, SIGNAL(clicked()), this, SLOT(viewSearchDialog()));
Why this error?
Regards
I have almost completed my application and now I am working on restyling the gui. I started creating a new GMCButton like this:
class GMCButton: public QPushButton
{
Q_OBJECT
public:
GMCButton(QWidget *parent = 0);
};
then in my centralwidget.cpp
searchButton = new GMCButton(tr("&Open search dialog"));
During compilation I got this error:
mainwindow.cpp: In constructor ‘MainWindow::MainWindow()’:
mainwindow.cpp:41: error: no matching function for call to ‘MainWindow::connect(GMCButton*&, const char [11], MainWindow* const, const char [20])’
/usr/include/qt4/QtCore/qobject.h:191: note: candidates are: static bool QObject::connect(const QObject*, const char*, const QObject*, const char*, Qt::ConnectionType)
/usr/include/qt4/QtCore/qobject.h:292: note: bool QObject::connect(const QObject*, const char*, const char*, Qt::ConnectionType) const
in correspondence of this line (in mainwindow.cpp):
connect(centralWidget->searchButton, SIGNAL(clicked()), this, SLOT(viewSearchDialog()));
Why this error?
Regards