kavinsiva
12th August 2009, 05:40
hi,
When i am running the following program i am getting following error
Object::connect: No such slot QMainWindow::open()
pls help me to resolve this one
my win.h Header File
#ifndef WIN_H
#define WIN_H
#include<QtGui>
class win : public : QMainWindow
{
public:
win();
private slots:
void open();
private :
QPushButton *pb1;
};
#endif
my win.cpp file
#include"win.h"
#include<QtGui>
win::win()
{
setWindowTitle("test Window");
pb1=createLink(tr("& test"),SLOT(open()));
pb1->setVisible(true);
pb1->setGeometry(0,0,40,40);
pb1->setText("test");
QObject::connect(pb1,SIGNAL(pressed()),this,SLOT(o pen()));
}
void win::open()
{
setWindowTitle("event occured");
}
When i am running the following program i am getting following error
Object::connect: No such slot QMainWindow::open()
pls help me to resolve this one
my win.h Header File
#ifndef WIN_H
#define WIN_H
#include<QtGui>
class win : public : QMainWindow
{
public:
win();
private slots:
void open();
private :
QPushButton *pb1;
};
#endif
my win.cpp file
#include"win.h"
#include<QtGui>
win::win()
{
setWindowTitle("test Window");
pb1=createLink(tr("& test"),SLOT(open()));
pb1->setVisible(true);
pb1->setGeometry(0,0,40,40);
pb1->setText("test");
QObject::connect(pb1,SIGNAL(pressed()),this,SLOT(o pen()));
}
void win::open()
{
setWindowTitle("event occured");
}