Connect not declared in this scope
-
Hi
I was trying to record my voice using Qt but when i compiled the problem i get this error:
connect was not declared in this scope .
here's the code:
@
#include <QtGui/QApplication>
#include "mainwindow.h"
#include <QPushButton>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QTextEdit>
#include <QWidget>
#include <record.h>
#include <QObject>int main(int argc, char argv[])
{
QApplication a(argc, argv);
QWidget w;
Record rec=new Record();
//MainWindow w;
QPushButton *record =new QPushButton("Record");
QPushButton *stop =new QPushButton("Stop");
QTextEdit *output=new QTextEdit() ;
output->setGeometry(5, 5, 200, 150);
QVBoxLayout *vlayout=new QVBoxLayout;
QHBoxLayout *hlayout=new QHBoxLayout;
QBoxLayout *layout=new QVBoxLayout;
hlayout->addWidget(record);
hlayout->addWidget(stop);
vlayout->addLayout(hlayout);
vlayout->addWidget(output);
layout->addLayout(vlayout);
w.setLayout(layout);
connect(record,SIGNAL(clicked()),rec,SLOT(startRecord()));
// connect(record,SIGNAL(clicked()),a,SLOT(quit()));w.show(); return a.exec();
}
@How can i fix that .
Thanks in advance .
-
try QObject::connect()
also you need to pass pointer to connect like
&a not a