Hello,
I want to catch "click" signal when the mose is clicked on a dialog, so that, I will implement a slot. Is there a way to do that?
Thanks for help...
Hello,
I want to catch "click" signal when the mose is clicked on a dialog, so that, I will implement a slot. Is there a way to do that?
Thanks for help...
Code attached:
untitled.zip
Basically You define a Signal in your dialog H File:
///////////////////
signals:
void clicked();
/// It could be any name....
///////////////////
Then You go a little deeper and define a function in the dialog H File
virtual void mousePressEvent ( QMouseEvent * event );
and define it as
void MainWindow::mousePressEvent ( QMouseEvent * event )
{
emit clicked();
}
And Lo! You have your own SIGNAL that can be attached to any slot!
fulbay (16th February 2011)
Many many thanks for your help!![]()
Bookmarks