Hi,
I have almost completed my application and now I am working on restyling the gui. I started creating a new GMCButton like this:
{
Q_OBJECT
public:
};
class GMCButton: public QPushButton
{
Q_OBJECT
public:
GMCButton(QWidget *parent = 0);
};
To copy to clipboard, switch view to plain text mode
then in my centralwidget.cpp
searchButton = new GMCButton(tr("&Open search dialog"));
During compilation I got this error:
[HTML]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[/HTML]
in correspondence of this line (in mainwindow.cpp):
connect(centralWidget->searchButton, SIGNAL(clicked()), this, SLOT(viewSearchDialog()));
connect(centralWidget->searchButton, SIGNAL(clicked()), this, SLOT(viewSearchDialog()));
To copy to clipboard, switch view to plain text mode
Why this error?
Regards
Bookmarks