anupamgee
27th April 2009, 13:21
hi friends,
I used a qlabel .I want to call a customized SLOT on the click of QLabel.
But it is not working for me ..................
i used the following code:
tabwindow.cpp
TabWindow::TabWindow(QWidget *parent): QWidget(parent)
{
onlinelabel = new QLabel(this);
onlinelabel->setText(tr("label"));
onlinelabel->setGeometry(11,46,50,16);
connect(onlinelabel,SIGNAL(linkActivated(QString)) ,this,SLOT(showmenu(QString)));
}
void TabWindow::showmenu(const QString & link)
{ //some code
}
tabwindow.h
class TabWindow : public QWidget
{
Q_OBJECT
public:
TabWindow(QWidget *parent = 0);
QLabel *onlinelabel;
public slots:
void showmenu(const QString & link);
};
What i am doing wrong??
I used a qlabel .I want to call a customized SLOT on the click of QLabel.
But it is not working for me ..................
i used the following code:
tabwindow.cpp
TabWindow::TabWindow(QWidget *parent): QWidget(parent)
{
onlinelabel = new QLabel(this);
onlinelabel->setText(tr("label"));
onlinelabel->setGeometry(11,46,50,16);
connect(onlinelabel,SIGNAL(linkActivated(QString)) ,this,SLOT(showmenu(QString)));
}
void TabWindow::showmenu(const QString & link)
{ //some code
}
tabwindow.h
class TabWindow : public QWidget
{
Q_OBJECT
public:
TabWindow(QWidget *parent = 0);
QLabel *onlinelabel;
public slots:
void showmenu(const QString & link);
};
What i am doing wrong??