[Solved] Cannot get any focus signal
-
wrote on 20 Jul 2015, 10:09 last edited by Zylann
Hello,
we are trying to debug a focus problem in our application, and it seems QApplication::focusWidgetChanged is never emitted.
I created a simple object just to listen the signals like this:connect( app, SIGNAL(focusWidgetChanged(QWidget * old, QWidget * now)), this, SLOT(onFocusWidgetChanged(QWidget * old, QWidget * now)) ); connect( app, SIGNAL(focusWindowChanged(QWidget * now)), this, SLOT(onFocusWindowChanged(QWidget * now)) );
We have forms, multiple docks and windows in our application, but none of these focus signals are called Oo
How can I know when something is focused? Or does it really means there is no focusing at all in the application? -
wrote on 20 Jul 2015, 12:10 last edited by
I tried too, it didn't works either.
-
wrote on 20 Jul 2015, 12:38 last edited by Zylann
I use Windows 7 64 bits, with Visual Studio 2013 as IDE.
EDIT: I just noticed these warnings:
[Warning] QObject::connect: No such signal QApplication::focusChanged(QWidget * old, QWidget * now)
[Warning] QObject::connect: No such signal QApplication::focusWindowChanged(QWidget * now)
But these signals exist? -
I use Windows 7 64 bits, with Visual Studio 2013 as IDE.
EDIT: I just noticed these warnings:
[Warning] QObject::connect: No such signal QApplication::focusChanged(QWidget * old, QWidget * now)
[Warning] QObject::connect: No such signal QApplication::focusWindowChanged(QWidget * now)
But these signals exist? -
I use Windows 7 64 bits, with Visual Studio 2013 as IDE.
EDIT: I just noticed these warnings:
[Warning] QObject::connect: No such signal QApplication::focusChanged(QWidget * old, QWidget * now)
[Warning] QObject::connect: No such signal QApplication::focusWindowChanged(QWidget * now)
But these signals exist?wrote on 20 Jul 2015, 12:56 last edited by tarod.net@Zylann OMG :) I see where the problem is.
You don't need to name your input variables in the signal/slot methods.
connect(app, SIGNAL(focusChanged(QWidget *, QWidget *)), this, SLOT(focusChanged(QWidget *, QWidget *)) );
-
wrote on 20 Jul 2015, 16:47 last edited by
Ooooh yes, it fixed the problem :'D
Thank you !
1/9